nbus_structs.h 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. }Nbus_FC_e;
  36. typedef struct {
  37. uint8_t ma;
  38. uint8_t sa;
  39. Nbus_FC_e fc;
  40. }Nbus_pdu;
  41. #endif /* INC_NBUS_STRUCTS_H_ */