2024-12-30 11:50:48 +08:00
|
|
|
#ifndef __BSP_BUTTON_H__
|
|
|
|
#define __BSP_BUTTON_H__
|
|
|
|
|
|
|
|
#include "board.h"
|
|
|
|
#include "drv_gpio.h"
|
|
|
|
|
|
|
|
#ifndef BUTTON_0
|
|
|
|
#define BUTTON_0 GET_PIN(B, 11)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// 不然就是用 timer 实现按键扫描处理
|
2025-01-24 09:43:39 +08:00
|
|
|
#define BUTTON_USE_THREAD
|
2024-12-30 11:50:48 +08:00
|
|
|
|
|
|
|
#ifdef BUTTON_USE_THREAD
|
|
|
|
#define BUTTON_THREAD_PRIORITY 5 // 优先级拉高,这时按键响应快点
|
2025-01-24 10:33:44 +08:00
|
|
|
#define BUTTON_THREAD_TICKS 5
|
|
|
|
#define BUTTON_THREAD_STACK_SIZE 1024 /**< button_thread 线程堆栈大小 */
|
2024-12-30 11:50:48 +08:00
|
|
|
#endif // !BUTTON_USE_THREAD
|
|
|
|
|
|
|
|
|
|
|
|
int BSP_BUTTON_Init(void);
|
|
|
|
|
|
|
|
|
|
|
|
#endif //!__BSP_BUTTON_H__
|