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.

60 lines
1.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. #pragma once
  2. #include <stdint.h>
  3. #include <functional>
  4. namespace iflytop {
  5. typedef uint8_t u8;
  6. typedef uint16_t u16;
  7. typedef uint32_t u32;
  8. typedef uint64_t u64;
  9. typedef int8_t s8;
  10. typedef int16_t s16;
  11. typedef int32_t s32;
  12. typedef int64_t s64;
  13. typedef float f32;
  14. typedef double f64;
  15. typedef enum {
  16. kset_cmd_type_read = 0,
  17. kset_cmd_type_set = 1,
  18. } SetCmdOperationType_t;
  19. typedef enum {
  20. kMotorStopType_stop = 0,
  21. kMotorStopType_break = 1,
  22. } MotorStopType_t;
  23. typedef enum {
  24. kmodule_statu_idle = 0,
  25. kmodule_statu_work = 1,
  26. kmodule_statu_exception = 2,
  27. } module_statu_type_t;
  28. #ifndef ZSTRUCT
  29. #define ZSTRUCT(name, ...) \
  30. typedef struct { \
  31. __VA_ARGS__ \
  32. } name;
  33. #endif
  34. #pragma pack(push, 1)
  35. typedef struct {
  36. u16 id;
  37. uint32_t errorcode;
  38. } zcan_cmder_error_ack_t;
  39. typedef struct {
  40. u8 is_end;
  41. u8 len;
  42. u8 packet[255];
  43. } zcancmder_read_ram_ack_t;
  44. #pragma pack(pop)
  45. typedef std::function<void(int32_t status)> action_cb_status_t;
  46. } // namespace iflytop