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.

65 lines
1.6 KiB

2 years ago
  1. #pragma once
  2. #include <fstream>
  3. #include <functional>
  4. #include <iostream>
  5. #include <list>
  6. #include <map>
  7. #include <memory>
  8. #include <mutex>
  9. #include <set>
  10. #include <sstream>
  11. #include <string>
  12. #include <vector>
  13. //
  14. #include "i_xsync_udp.hpp"
  15. #include "xsync_errcode.hpp"
  16. #include "xsync_regs.hpp"
  17. namespace xsync {
  18. using namespace std;
  19. #pragma pack(1)
  20. typedef struct {
  21. uint16_t type;
  22. uint16_t index;
  23. uint16_t cmd;
  24. uint16_t ndata;
  25. uint32_t data[]; // first is always checksum
  26. } iflytop_xsync_packet_header_t;
  27. typedef struct {
  28. uint32_t timecode0;
  29. uint32_t timecode1;
  30. } iflytop_timecode_report_packet_t;
  31. #pragma pack()
  32. typedef enum {
  33. kxsync_packet_type_none = 0,
  34. kxsync_packet_type_reg_read = 1,
  35. kxsync_packet_type_reg_write = 2,
  36. kxsync_packet_type_reg_read_regs = 3,
  37. kxsync_packet_type_timecode_report = 4,
  38. } xsync_protocol_cmd_t;
  39. typedef enum {
  40. kxsync_packet_type_cmd = 0,
  41. kxsync_packet_type_receipt = 1,
  42. kxsync_packet_type_report = 2,
  43. } xsync_protocol_packet_type_t;
  44. typedef enum {
  45. kxsync_device_type_none = 0,
  46. kxsync_device_type_xsync = 1,
  47. kxsync_device_type_puck_station = 2,
  48. kxsync_device_type_encoder = 3,
  49. } xsync_device_type_t;
  50. typedef enum {
  51. xsync_stm32_action_none = 0, //
  52. xsync_stm32_action_generator_new_mac = 1, //
  53. xsync_stm32_action_factory_reset = 2, //
  54. xsync_stm32_action_Basic_reboot = 3, //
  55. xsync_stm32_action_storage_cfg = 4, //
  56. } xsync_stm32_action_t;
  57. typedef enum { obtaining_ip_mode_type_static = 0, obtaining_ip_mode_type_dhcp = 1 } obtaining_ip_mode_t;
  58. } // namespace xsync