nbus_config.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * nbus_config.h
  3. *
  4. * Created on: Jun 19, 2026
  5. * Author: Juraj Dudak, Matus Necas
  6. */
  7. #ifndef INC_NBUS_CONFIG_H_
  8. #define INC_NBUS_CONFIG_H_
  9. /* BEGIN NBUS LED DEFINES */
  10. #define NBUS_USE_LED 0
  11. #define NBUS_LED_PORT GPIOB
  12. #define NBUS_LED_PIN 2// GPIO_PIN_3
  13. /* END NBUS LED DEFINES */
  14. /* BEGIN NBUS APP DEFINES */
  15. /** @brief Macro for UART buffer size for Master-Bridge */
  16. #define NBUS_APP_UART_FRAME_SIZE 64
  17. /** @brief Macro for blink cound during boot sequence. */
  18. #define NBUS_APP_BLINK_COUNT 10
  19. /** @brief Macro for blink delay during boot sequence. */
  20. #define NBUS_APP_BLINK_DELAY 50
  21. /* END NBUS APP DEFINES */
  22. /* BEGIN NBUS COMMUNICATOR DEFINES */
  23. /** @brief Macro for frame size of nBus Communicator. */
  24. #define NBUS_COMM_MAX_FRAME_SIZE 64
  25. /** @brief Macro for receive timeout in ms. */
  26. #define NBUS_COMM_UART_RX_TIMEOUT 5
  27. /** @brief Macro for transfer timeout in ms. */
  28. #define NBUS_COMM_UART_TX_TIMEOUT 10
  29. /* END NBUS COMMUNICATOR DEFINES */
  30. /* BEGIN NBUS SLAVE DEFINES */
  31. /** @brief Macro for slave cache size. */
  32. #define NBUS_SLAVE_CACHE_SIZE NBUS_TX_META_SIZE
  33. /* END NBUS SLAVE DEFINES */
  34. /* BEGIN NBUS BRIDGE DEFINES */
  35. /** @brief Macro for max slave modules for nBus Bridge. */
  36. #define NBUS_BRIDGE_MAX_SLAVES 16
  37. /** @brief Macro for echo message length in network scan. */
  38. #define NBUS_BRIDGE_ECHO_SCAN_SIZE 4
  39. /** @brief Macro for 0th byte in echo message in network scan. */
  40. #define NBUS_BRIDGE_ECHO_SCAN_BYTE0 (uint8_t)'n'
  41. #define NBUS_BRIDGE_ECHO_SCAN_BYTE1 (uint8_t)'B'
  42. #define NBUS_BRIDGE_ECHO_SCAN_BYTE2 (uint8_t)'u'
  43. #define NBUS_BRIDGE_ECHO_SCAN_BYTE3 (uint8_t)'s'
  44. /** @brief Macro for nBus Bridge running state delay. **/
  45. #define NBUS_BRIDGE_RUNNING_STATE_DELAY 50
  46. /** @brief Macro for nBus Bridge info version. **/
  47. #define NBUS_BRIDGE_INFO_VERSION "1.0"
  48. /** @brief Macro for nBus Bridge hardware family. **/
  49. #define NBUS_BRIDGE_INFO_HW_FAMILY "STM"
  50. /** @brief Macro for nBus Bridge hardware version. **/
  51. #define NBUS_BRIDGE_INFO_HW_VERSION "0.5"
  52. /** @brief Macro for nBus Bridge data packet size. **/
  53. #define NBUS_BRIDGE_DATAPACKET_SIZE (NBUS_COMM_MAX_FRAME_SIZE*NBUS_BRIDGE_MAX_SLAVES)
  54. /** @brief Macro for header size in bridge-cast. **/
  55. #define NBUS_BRIDGE_HEADER_SIZE 10
  56. /** @brief Macro for header byte in bridge-cast. **/
  57. #define NBUS_BRIDGE_HEADER_SEQ 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
  58. /* END NBUS BRIDGE DEFINES */
  59. #endif /* INC_NBUS_CONFIG_H_ */