keyboard.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Copyright 2023 Manuel Jinger
  2. * Copyright 2023 Dual Tachyon
  3. * https://github.com/DualTachyon
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. #ifndef DRIVER_KEYBOARD_H
  18. #define DRIVER_KEYBOARD_H
  19. #include <stdbool.h>
  20. #include <stdint.h>
  21. enum KEY_Code_e {
  22. KEY_0 = 0, // 0
  23. KEY_1, // 1
  24. KEY_2, // 2
  25. KEY_3, // 3
  26. KEY_4, // 4
  27. KEY_5, // 5
  28. KEY_6, // 6
  29. KEY_7, // 7
  30. KEY_8, // 8
  31. KEY_9, // 9
  32. KEY_MENU, // A
  33. KEY_UP, // B
  34. KEY_DOWN, // C
  35. KEY_EXIT, // D
  36. KEY_STAR, // *
  37. KEY_F, // #
  38. KEY_PTT, //
  39. KEY_SIDE2, //
  40. KEY_SIDE1, //
  41. KEY_INVALID //
  42. };
  43. typedef enum KEY_Code_e KEY_Code_t;
  44. #ifdef ENABLE_SCREEN_DUMP
  45. extern KEY_Code_t gSimulateKey;
  46. extern KEY_Code_t gSimulateHold;
  47. extern uint8_t gDebounceDefeat;
  48. extern uint8_t gPttCounter;
  49. #endif
  50. extern KEY_Code_t gKeyReading0;
  51. extern KEY_Code_t gKeyReading1;
  52. extern uint16_t gDebounceCounter;
  53. extern bool gWasFKeyPressed;
  54. KEY_Code_t KEYBOARD_Poll(void);
  55. #endif