flipperzero-firmware/target_f2/Inc/input_priv.h
Vadim Kaushan 8c36d65e63
Input handling and debouncing (#148)
* Add input driver and definitions for target_f2

* Add input_dump example

* Invert charge input

* Fix back and left button configuration

* remove input debug

* input testing case

* move header

* lint code

Co-authored-by: aanper <mail@s3f.ru>
2020-10-02 09:44:05 +03:00

30 lines
886 B
C

#ifndef __INPUT_PRIV_H
#define __INPUT_PRIV_H
#include "main.h"
#include "flipper_hal.h"
#define DEBOUNCE_TICKS 10
const GpioPin input_gpio[] = {
{BUTTON_UP_GPIO_Port, BUTTON_UP_Pin},
{BUTTON_DOWN_GPIO_Port, BUTTON_DOWN_Pin},
{BUTTON_RIGHT_GPIO_Port, BUTTON_RIGHT_Pin},
{BUTTON_LEFT_GPIO_Port, BUTTON_LEFT_Pin},
{BUTTON_OK_GPIO_Port, BUTTON_OK_Pin},
{BUTTON_BACK_GPIO_Port, BUTTON_BACK_Pin},
{CHRG_GPIO_Port, CHRG_Pin}
};
const bool input_invert[] = {
false, // {BUTTON_UP_GPIO_Port, BUTTON_UP_Pin},
false, // {BUTTON_DOWN_GPIO_Port, BUTTON_DOWN_Pin},
false, // {BUTTON_RIGHT_GPIO_Port, BUTTON_RIGHT_Pin},
false, // {BUTTON_LEFT_GPIO_Port, BUTTON_LEFT_Pin},
false, // {BUTTON_OK_GPIO_Port, BUTTON_OK_Pin},
false, // {BUTTON_BACK_GPIO_Port, BUTTON_BACK_Pin},
true, // {CHRG_GPIO_Port, CHRG_Pin}
};
#endif /* __INPUT_PRIV_H */