dev_key.h 540 B

123456789101112131415161718192021222324252627282930
  1. #ifndef __DEV_KEY_H
  2. #define __DEV_KEY_H
  3. #include "hal_gpio.h"
  4. #include "multi_button.h"
  5. typedef union
  6. {
  7. struct
  8. {
  9. uint8_t key_up_state_flag : 1;
  10. uint8_t key0_state_flag : 1;
  11. uint8_t key1_state_flag : 1;
  12. uint8_t key2_state_flag : 1;
  13. } bits;
  14. uint8_t key_all_state;
  15. } dev_key_state_t;
  16. typedef struct
  17. {
  18. dev_key_state_t dev_key_state;
  19. uint8_t i;
  20. } dev_key_t;
  21. extern dev_key_t dev_key;
  22. void dev_key_button_init(void);
  23. void dev_key_button_task(void);
  24. #endif // __DEV_KEY_H