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.
 
 
 
 
 

50 lines
1.7 KiB

  1. /**
  2. * @file app_cfg.h
  3. * @brief 应用任务、Modbus 通信和状态寄存器配置。
  4. * @version 2.0
  5. * @author zengbingjie
  6. * @date 2026-07-29
  7. * @copyright 版权所有 (c) 2026 Xinje Electric。
  8. * @note 修改记录:2.0 增加 Modbus RTU 从站任务配置。
  9. */
  10. #ifndef APP_CFG_H
  11. #define APP_CFG_H
  12. #define CPU_CFG_KA_IPL_BOUNDARY (4U)
  13. #define CPU_CFG_NVIC_PRIO_BITS (4U)
  14. #define APP_TASK_MODBUS_PRIO (4U)
  15. #define APP_TASK_START_PRIO (5U)
  16. #define APP_TASK_T35_PRIO (6U)
  17. // uC/OS-II 定时器管理任务使用低优先级保留任务槽。
  18. #define OS_TASK_TMR_PRIO (OS_LOWEST_PRIO - 2U)
  19. #define APP_TASK_START_STK_SIZE (128U)
  20. #define APP_TASK_MODBUS_STK_SIZE (384U)
  21. #define APP_TASK_T35_STK_SIZE (128U)
  22. #define APP_MODBUS_BAUD_RATE (115200U)
  23. #define APP_MODBUS_T35_TICKS (2U)
  24. #define APP_MODBUS_T35_CHECK_TICKS (1U)
  25. #define APP_MODBUS_STATUS_UPDATE_TICKS (100U)
  26. #define APP_MODBUS_LINK_TIMEOUT_TICKS (5000U)
  27. #define APP_MODBUS_TX_TIMEOUT_TICKS (100U)
  28. #define APP_MODBUS_OUTPUT_COIL_COUNT (8U)
  29. #define APP_MODBUS_REG_LINK_STATE (0U)
  30. #define APP_MODBUS_REG_OPERATION_RX_COUNT (1U)
  31. #define APP_MODBUS_REG_OPERATION_TX_COUNT (2U)
  32. #define APP_MODBUS_REG_ERROR_COUNT (3U)
  33. #define APP_MODBUS_REG_SYSTEM_TICK_LOW (4U)
  34. #define APP_MODBUS_REG_SYSTEM_TICK_HIGH (5U)
  35. #define APP_MODBUS_REG_LAST_STATUS (6U)
  36. #define APP_MODBUS_REG_LAST_FRAME_LENGTH (7U)
  37. #define APP_MODBUS_LINK_DISCONNECTED (0U)
  38. #define APP_MODBUS_LINK_CONNECTED (1U)
  39. #endif