You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.4 KiB

  1. #pragma once
  2. #include "ui.h"
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. #define MAX_LEN 256
  6. /***********************************************************************************************************************
  7. * Ͷ *
  8. ***********************************************************************************************************************/
  9. typedef enum {
  10. /**
  11. * @brief ¼
  12. */
  13. kpt_button_event = 0x65, //
  14. kpt_sys_event_page_id = 0x66,
  15. kpt_sys_event_touch_data = 0x67,
  16. kpt_sys_event_sleep_touch = 0x68,
  17. kpt_sys_event_string_var = 0x70,
  18. kpt_sys_event_number_var = 0x71,
  19. kpt_sys_event_sleep_mode = 0x86,
  20. kpt_sys_event_auto_wakeup = 0x87,
  21. kpt_sys_event_sys_start = 0x88,
  22. kpt_sys_event_sd_upgrade = 0x89,
  23. kpt_sys_event_passthrough_finish = 0xFD,
  24. kpt_sys_event_passthrough_ready = 0xFE,
  25. /**
  26. * @brief ûϢִ
  27. */
  28. kpt_ack = 0xAA,
  29. kpt_inputfield_content_change_event0 = 0xAB, // ͬҳ�����������ݱ����¼�
  30. kpt_inputfield_content_change_event1 = 0xAC, // ��ҳ�����������¼�
  31. kpt_double_state_button_event = 0xAD,
  32. kpt_login_request = 0xAE,
  33. kpt_unlogin_request = 0xAF,
  34. kpt_on_keyboard_page_load = 0xB0, // ����ҳ������
  35. kpt_on_promopt_page_load = 0xB1, // ����ҳ������
  36. } tjc_event_type_t;
  37. typedef struct tjc_screen_packet {
  38. tjc_event_type_t eventId;
  39. uint8_t pid;
  40. uint8_t bid;
  41. union {
  42. // inputfield_content_event
  43. struct {
  44. uint8_t text[MAX_LEN];
  45. } inputfield_content;
  46. // kpt_usr_login_request
  47. // struct {
  48. // char usrName[TJC_MAX_USR_NAME_SIZE + 1]; //+1��Ϊ�˴����ַ���������
  49. // char passwd[TJC_USR_PASSWD_SIZE + 1];
  50. // } login_request;
  51. // kpt_double_state_button_event
  52. struct {
  53. uint8_t val;
  54. } double_state_button;
  55. struct {
  56. uint8_t val; // 0 ̧����1����
  57. } button_event;
  58. struct {
  59. uint8_t fromPage;
  60. uint8_t fromPopPage;
  61. } on_page_load;
  62. struct {
  63. bool isFromPopWin;
  64. } sys_event_page_id;
  65. } d;
  66. } tjc_screen_event_t;
  67. typedef void (*tjc_processe_event_t)(tjc_screen_event_t*);
  68. typedef void (*onpagefunc_t)();
  69. void event_process(uint8_t* packet);
  70. void regCallBack(onpagefunc_t cb);