2021-10-20 20:12:08 +08:00
|
|
|
#pragma once
|
2023-03-02 11:49:32 +08:00
|
|
|
#include "esp_timer.h"
|
|
|
|
#include "esp_event.h"
|
2021-10-20 20:12:08 +08:00
|
|
|
#include "driver/gpio.h"
|
|
|
|
#include "esp_log.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2021-10-26 17:01:27 +08:00
|
|
|
int button_index; /**< button index on the channel */
|
|
|
|
int min; /**< min voltage in mv corresponding to the button */
|
|
|
|
int max; /**< max voltage in mv corresponding to the button */
|
2021-10-20 20:12:08 +08:00
|
|
|
} button_adc_config_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief initialize adc button
|
|
|
|
*
|
|
|
|
* @param buttons_ptr the pointer of adc button configuration
|
|
|
|
* @param button_num the numbers of adc buttons
|
|
|
|
* @param key_state_o the queue to send which button is pressed
|
|
|
|
*/
|
|
|
|
void register_adc_button(button_adc_config_t *buttons_ptr, int button_num, const QueueHandle_t key_state_o);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|