#ifndef _KEY_H_
#define _KEY_H_

uint8_t key_scan(void);
void key_init(void);
void gpio_key_init(gpio_pin_t pin);

//#define   ADC_KEY
#define   ADC_KEY_PORT      LRADC2

#define   GPIO_KEY
// #define   HOLD_KEY1_PIN    GPIO2
// #define   HOLD_KEY2_PIN    GPIO3



#define BUTTON_EVENT_BUTTION1        930
#define BUTTON_EVENT_BUTTION2        740
#define BUTTON_EVENT_BUTTION4        555
#define BUTTON_EVENT_BUTTION3        370
#define BUTTON_EVENT_BUTTION5        180
#define BUTTON_EVENT_DEBONSE         100
#define BUTTON_ERROR_STEP            50


#define KEY_NULL        0
#define KEY_UP          10
#define KEY_DOWN        11
#define KEY_LEFT        12
#define KEY_RIGHT       13
#define KEY_OK          14
#define KEY_POWERON     15
#define KEY_POWEROFF    16

#define HOLD_KEY_NULL   -1
#define HOLD_KEY1_DOWN   1
#define HOLD_KEY1_UP     2
#define HOLD_KEY2_DOWN   3
#define HOLD_KEY2_UP     4




#endif