打開hal\_button.h文件,接口列表如下:
* 驅動程序初始化:
```
void hal_button_init(void);
```
* 驅動程序反初始化:
```
void hal_button_deinit(void);
```
* 按鍵驅動程序所需要的輪詢(該函數需要上層在系統空閑時頻繁調用):
```
void hal_button_poll(void);
```
* 按鍵驅動程序所需要的定時輪詢(該函數需要上層進行周期性調用):
```
void hal_button_on_10ms_timer(void);
```
* 打開指定按鍵,成功返回文件描述符:
```
int hal_button_open(GPIO_TypeDef *gpio, uint16_t pin, uint8_t trigger_level, uint8_t irq_enable);
```
* 關閉指定按鍵:
```
void hal_button_close(int fd);
```
* 設置按鍵驅動程序的回調函數:
```
void hal_button_set_callbacks(int fd, void (*on_clicks)(unsigned char times), void (*on_hold)(unsigned char seconds));
```
<br/>
- 框架介紹
- Main 函數
- HAL 函數接口說明
- hal_system.h
- hal_systick.h
- hal_idt.h
- hal_ioctl.h
- hal_flash.h
- hal_lpm.h
- hal_rtc.h
- hal_iwdg.h
- hal_uart.h
- hal_i2c.h
- hal_led.h
- hal_button.h
- hal_vht2x.h
- hal_lcd.h
- Services 函數接口說明
- svc_system.h
- svc_database.h
- svc_hid.h
- svc_msg.h
- svc_humiture.h
- svc_log.h
- Tasks 說明
- task_system.c
- task_example.c
- Libs 函數接口說明
- mathlib.h
- json.h
- atcmd.h
- atcmd_proxy.h
- libwifi.h
- libs1.h