You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
499 B
28 lines
499 B
#pragma once
|
|
#include "esp_event_loop.h"
|
|
#include "driver/gpio.h"
|
|
#include "esp_log.h"
|
|
|
|
typedef enum
|
|
{
|
|
KEY_SHORT_PRESS = 1,
|
|
KEY_LONG_PRESS,
|
|
KEY_DOUBLE_CLICK,
|
|
} key_state_t;
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
/**
|
|
* @brief initialize gpio button
|
|
*
|
|
* @param key_io_num the gpio number of the button
|
|
* @param key_state_o the queue to send the button state
|
|
*/
|
|
void register_button(const gpio_num_t key_io_num, const QueueHandle_t key_state_o);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|