BLE_TYQ_BJQ_CH32V303/bsp/inc/bsp_button.h

26 lines
570 B
C

#ifndef __BSP_BUTTON_H__
#define __BSP_BUTTON_H__
#include "board.h"
#include "drv_gpio.h"
#ifndef BUTTON_0
// #define BUTTON_0 GET_PIN(B, 12)
#define BUTTON_0 GET_PIN(B, 15)
#endif
// 不然就是用 timer 实现按键扫描处理
// #define BUTTON_USE_THREAD
#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__