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.

73 lines
1.4 KiB

2 years ago
  1. #pragma once
  2. #include "sdk/os/zos.hpp"
  3. namespace iflytop {
  4. namespace zcr {
  5. typedef struct {
  6. uint16_t packetindex;
  7. uint16_t cmdid;
  8. uint8_t subcmdid;
  9. uint8_t packetType;
  10. uint8_t data[];
  11. } Cmdheader_t;
  12. typedef enum {
  13. kpt_cmd = 0,
  14. kpt_ack = 1,
  15. kpt_error_ack = 2,
  16. kpt_status_report = 3,
  17. } PacketType_t;
  18. typedef enum {
  19. kcmd_ping = 0,
  20. kcmd_read_io = 1,
  21. kcmd_set_io = 2,
  22. kcmd_readadc_raw = 3,
  23. kcmd_m211887_operation = 1000, // ��������������
  24. kcmd_read_presure_sensor = 1001, // ѹ��������
  25. kcmd_triple_warning_light_ctl = 1002, // ��ɫ��ʾ�ƿ���
  26. kcmd_high_power_electrical_ctl = 1003, // �����ʵ�Դ����
  27. kcmd_peristaltic_pump_ctl = 1004, // Һ�ÿ���
  28. kcmd_read_huacheng_pressure_sensor = 1005, // ����ѹ��������
  29. } CmdID_t;
  30. } // namespace zcr
  31. } // namespace iflytop
  32. typedef struct {
  33. uint8_t boardid;
  34. } kcmd_ping_t;
  35. typedef struct {
  36. uint8_t boardid;
  37. } kcmd_ping_ack_t;
  38. typedef struct {
  39. uint8_t ioid;
  40. } kcmd_read_io_t;
  41. typedef struct {
  42. uint8_t ioid;
  43. uint8_t val;
  44. } kcmd_read_io_ack_t;
  45. typedef struct {
  46. uint8_t ioid;
  47. uint8_t val;
  48. } kcmd_set_io_t;
  49. typedef struct {
  50. uint8_t ioid;
  51. uint8_t val;
  52. } kcmd_set_io_ack_t;
  53. typedef struct {
  54. uint8_t sensorid;
  55. } kcmd_readadc_raw_t;
  56. typedef struct {
  57. uint8_t sensorid;
  58. uint8_t __p; // padding
  59. int32_t val;
  60. } kcmd_readadc_raw_ack_t;