bsp_io_key.h 723 B

1234567891011121314151617181920212223242526272829
  1. #ifndef _BSP_IO_KEY_H
  2. #define _BSP_IO_KEY_H
  3. #include "driver_gpio.h"
  4. /* WK0 --> KEY0(PP) by default, no matter which way, see initialization in file 'bsp_io_key.c'. */
  5. #define IO_KEY_SCAN_MODE 0 // 0: Judge the level and determine the key status.
  6. // 1: Matrix row/column scanning.
  7. #define IO_KEY_COL_TABLE_SIZE 0
  8. #define IO_KEY_ROW_TABLE_SIZE 6
  9. typedef struct {
  10. gpio_typedef *gpiox;
  11. uint16_t gpio_pin;
  12. } key_io_typedef;
  13. extern key_io_typedef key_io_table_column[IO_KEY_COL_TABLE_SIZE];
  14. extern key_io_typedef key_io_table_row[IO_KEY_ROW_TABLE_SIZE];
  15. void bsp_io_key_init(void);
  16. u8 bsp_get_io_key_id(void);
  17. #endif // _BSP_IO_KEY_H