Key.h 618 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _KEY_H_
  2. #define _KEY_H_
  3. #include "gd32e23x_gpio.h"
  4. #define KEY_NAME_MAX 5
  5. #define KEY_A_RCU RCU_GPIOA
  6. #define KEY_B_RCU RCU_GPIOB
  7. #define KEY_A_IO GPIOA
  8. #define KEY_B_IO GPIOB
  9. #define KEY1 GPIO_PIN_4
  10. #define KEY2 GPIO_PIN_5
  11. #define KEY3 GPIO_PIN_6
  12. #define KEY4 GPIO_PIN_7
  13. #define KEY5 GPIO_PIN_15
  14. #define KEY_ON 0
  15. #define KEY_OFF 1
  16. void InitKey(void);
  17. unsigned char ScanKey(unsigned int gpio_periph,unsigned int pin);
  18. unsigned char ReadKeyValue(void);
  19. #endif