nbus_structs.h 932 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * @file nbus_structs.h
  3. *
  4. * @date: Mar 7, 2025
  5. * @author: Juraj Dudak
  6. */
  7. #ifndef INC_NBUS_STRUCTS_H_
  8. #define INC_NBUS_STRUCTS_H_
  9. #if defined(STM32F401xC) || defined(STM32F401xE)
  10. #include "stm32f4xx_hal.h"
  11. #endif
  12. #if defined (STM32L432xx)
  13. #include "stm32l4xx_hal.h"
  14. #endif
  15. #if defined (STM32L031xx) || defined (STM32L082xx)
  16. #include "stm32l0xx_hal.h"
  17. #endif
  18. typedef enum {
  19. FC_FIND = 0,
  20. FC_ECHO, /* 1 */
  21. FC_STOP, /* 2 */
  22. FC_START, /* 3 */
  23. FC_PARAM, /* 4 */
  24. FC_SENSOR_CNT, /* 5 */
  25. FC_SLEEP, /* 6 */
  26. FC_WAKEUP, /* 7 */
  27. FC_CALIBRATE, /* 8 */
  28. FC_RESET, /* 9 */
  29. FC_STORE, /* 0xA => 10 */
  30. FC_DATA, /* 0xB => 11 */
  31. FC_SYNC, /* 0xC => 12 */
  32. FC_SENSOR_TYPE, /* 0xD => 13 */
  33. FC_INFO, /* 0xE => 14 */
  34. FC_SENSOR_FORMAT, /* 0xF => 15 */
  35. FC_SLAVES, /* 0x10 => 16 */
  36. }Nbus_FC_e;
  37. typedef struct {
  38. uint8_t ma;
  39. uint8_t sa;
  40. Nbus_FC_e fc;
  41. }Nbus_pdu;
  42. #endif /* INC_NBUS_STRUCTS_H_ */