38 lines
783 B
C
38 lines
783 B
C
/**
|
|
* @file localbtn.h
|
|
* @brief Local GPIO button reading using interrupt-based edge detection
|
|
*/
|
|
|
|
#ifndef LOCALBTN_H
|
|
#define LOCALBTN_H
|
|
|
|
#include "esp_err.h"
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
/**
|
|
* @brief Callback function type for mode changes
|
|
*/
|
|
typedef void (*localbtn_mode_change_callback_t)();
|
|
|
|
/**
|
|
* @brief Initialize local button with interrupt-based detection
|
|
* @param pin_localbtn GPIO pin number for button (active low)
|
|
* @return ESP_OK on success
|
|
*/
|
|
esp_err_t localbtn_init(int8_t pin_localbtn);
|
|
|
|
/**
|
|
* @brief Deinitialize local button reading
|
|
*/
|
|
void localbtn_deinit(void);
|
|
|
|
/**
|
|
* @brief Register callback for mode changes
|
|
* @param cb Callback function
|
|
*/
|
|
void localbtn_register_callback(localbtn_mode_change_callback_t cb);
|
|
|
|
#endif // LOCALBTN_H
|