1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #ifndef _IO_H
- #define _IO_H
- #include "esp_common.h"
- #include "driver/gpio16.h"
- #define STATUS_LED 0
- #define SWITCH_A 5
- #define SWITCH_B 2
- #define LDO_SHUTDOWN 4
- #define STATUS_LED_MUX PERIPHS_IO_MUX_GPIO0_U
- #define SWITCH_A_MUX PERIPHS_IO_MUX_GPIO5_U
- #define SWITCH_B_MUX PERIPHS_IO_MUX_GPIO2_U
- #define LDO_SHUTDOWN_MUX PERIPHS_IO_MUX_GPIO4_U
- #define STATUS_LED_FUNC FUNC_GPIO0
- #define SWITCH_A_FUNC FUNC_GPIO5
- #define SWITCH_B_FUNC FUNC_GPIO2
- #define LDO_SHUTDOWN_FUNC FUNC_GPIO4
- #define DEBOUNCEDELAY 15
- typedef void (* switch_function_t)(void);
- typedef void (* imu_function_t)(void);
- typedef struct {
- os_timer_t switch_a_timer;
- os_timer_t switch_b_timer;
- switch_function_t switch_a_cb;
- switch_function_t switch_b_cb;
- imu_function_t imu_cb;
- uint32_t debounce_delay;
- } Encoder_t;
- void ICACHE_FLASH_ATTR Encoder_InitIO(void);
- void ICACHE_FLASH_ATTR Encoder_ShutDown(void);
- void ICACHE_FLASH_ATTR Encoder_Restart(void);
- #endif
|