esp-who/components/modules/button/who_button.h

28 lines
499 B
C
Raw Normal View History

#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
2021-10-26 17:01:27 +08:00
/**
* @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
*/
2021-10-26 17:01:27 +08:00
void register_button(const gpio_num_t key_io_num, const QueueHandle_t key_state_o);
#ifdef __cplusplus
}
#endif