OVMS3-idf/examples/06_bluedroid_demos/components/bluedroid_demos/include/app_button.h
2016-11-05 02:48:16 +08:00

51 lines
828 B
C

/*
* DEFINES
****************************************************************************************
*/
#define BUTTON_HEAD (0x01)
#define BUTTON_PRESS_EVT (0x10)
//the key value enum
enum
{
Button_Up = 0x01,
Button_Voice = 0x02,
Button_OK = 0x04,
Button_Down = 0x08,
Button_Back = 0x10,
};
typedef struct {
uint8_t key_val; //button val
uint8_t head; //the head of the frame
}key_frame;
typedef struct
{
bool button_press;
key_frame key_msg;
}app_key_env;
extern app_key_env key_press;
/*
* FUNCTIONS DECLARATION
****************************************************************************************
*/
void app_button_init(void);
void GPIO_isr_callback(void* arg);
uint8_t check_sum(uint8_t *check_array,uint8_t len);
void ble_but_prf_enable(void);
void ble_but_create_svc(void);