BLE_TYQ_BJQ_CH32V303/bsp/inc/bsp_button.h

29 lines
617 B
C
Raw Normal View History

2024-12-01 13:49:43 +08:00
#ifndef __BSP_BUTTON_H__
#define __BSP_BUTTON_H__
#include "board.h"
#include "drv_gpio.h"
#ifndef BUTTON_0
2024-12-13 19:07:17 +08:00
#define BUTTON_0 GET_PIN(B, 15)//自检按键
#endif
#ifndef BUTTON_1
#define BUTTON_1 GET_PIN(C, 4) //消音按键
2024-12-01 13:49:43 +08:00
#endif
// 不然就是用 timer 实现按键扫描处理
2024-12-04 10:31:57 +08:00
#define BUTTON_USE_THREAD
2024-12-01 13:49:43 +08:00
#ifdef BUTTON_USE_THREAD
#define BUTTON_THREAD_PRIORITY 5 // 优先级拉高,这时按键响应快点
#define BUTTON_THREAD_TICKS 10
#define BUTTON_THREAD_STACK_SIZE 512 /**< button_thread 线程堆栈大小 */
#endif // !BUTTON_USE_THREAD
int BSP_BUTTON_Init(void);
#endif //!__BSP_BUTTON_H__