key.h 946 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef __HS_KEY_H_
  2. #define __HS_KEY_H_
  3. #include "common.h"
  4. #define KEY_SELECT 0
  5. #define KEY_UP 1
  6. #define KEY_DOWN 3
  7. #define KEY_BACK 2
  8. typedef struct tsHSKey{
  9. unsigned char onFlag;
  10. unsigned char softRelease;
  11. unsigned char pressedSec;
  12. unsigned int pressTime;
  13. unsigned int longPressTimeOne;
  14. unsigned int longPressTimeKeep;
  15. unsigned int prevTime;
  16. }HSKey;
  17. void ReadKEY(void);
  18. void KeyInit(void);
  19. void KeySelectPressed(void);
  20. void KeySelectReleased(void);
  21. void KeySelectLongPressedOne(void);
  22. void KeySelectLongPressedKeep(void);
  23. void KeyUpPressed(void);
  24. void KeyUpReleased(void);
  25. void KeyUpLongPressedOne(void);
  26. void KeyUpLongPressedKeep(void);
  27. void KeyDownPressed(void);
  28. void KeyDownReleased(void);
  29. void KeyDownLongPressedOne(void);
  30. void KeyDownLongPressedKeep(void);
  31. void KeyBackPressed(void);
  32. void KeyBackReleased(void);
  33. void KeyBackLongPressedOne(void);
  34. void KeyBackLongPressedKeep(void);
  35. #endif