nbus_config.h 2.6 KB

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