Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

161 righe
6.7 KiB

  1. /*
  2. *********************************************************************************************************
  3. * EXAMPLE CODE
  4. *
  5. * This file is provided as an example on how to use Micrium products.
  6. *
  7. * Please feel free to use any application code labeled as 'EXAMPLE CODE' in
  8. * your application products. Example code may be used as is, in whole or in
  9. * part, or may be used as a reference only. This file can be modified as
  10. * required to meet the end-product requirements.
  11. *
  12. * Please help us continue to provide the Embedded community with the finest
  13. * software available. Your honesty is greatly appreciated.
  14. *
  15. * You can find our product's user manual, API reference, release notes and
  16. * more information at https://doc.micrium.com.
  17. * You can contact us at www.micrium.com.
  18. *********************************************************************************************************
  19. */
  20. /*
  21. *********************************************************************************************************
  22. *
  23. * APPLICATION CONFIGURATION
  24. *
  25. * ST Microelectronics STM32
  26. * on the
  27. *
  28. * STM3240G-EVAL
  29. * Evaluation Board
  30. *
  31. * Filename : app_cfg.h
  32. * Version : V1.00
  33. * Programmer(s) : DC
  34. *********************************************************************************************************
  35. */
  36. #ifndef APP_CFG_MODULE_PRESENT
  37. #define APP_CFG_MODULE_PRESENT
  38. /*
  39. *********************************************************************************************************
  40. * MODULE ENABLE / DISABLE
  41. *********************************************************************************************************
  42. */
  43. #define APP_CFG_SERIAL_EN DEF_ENABLED
  44. /*
  45. *********************************************************************************************************
  46. * TASK PRIORITIES
  47. *********************************************************************************************************
  48. */
  49. //#define APP_CFG_MUTEX_PRIO 2u
  50. //#define APP_CFG_TASK_START_PRIO 3u
  51. //#define APP_CFG_TASK_EVENT0_PRIO 4u
  52. //#define APP_CFG_TASK_EVENT1_PRIO 5u
  53. //#define APP_CFG_TASK_EQ0_PRIO 6u
  54. //#define APP_CFG_TASK_EQ1_PRIO 7u
  55. #define OS_TASK_TMR_PRIO (OS_LOWEST_PRIO - 2u)
  56. #define APP_TASK_START_PRIO 10u
  57. #define APP_TASK_MODBUS_SEND_PRIO 2u
  58. #define APP_TASK_MODBUS_PARSE_PRIO 3u
  59. /*
  60. *********************************************************************************************************
  61. * TASK STACK SIZES
  62. * Size of the task stacks (# of OS_STK entries)
  63. *********************************************************************************************************
  64. */
  65. #define APP_CFG_TASK_START_STK_SIZE 256u
  66. #define APP_CFG_TASK_EQ_STK_SIZE 512u
  67. #define APP_CFG_TASK_OBJ_STK_SIZE 256u
  68. #define APP_TASK_START_STK_SIZE 256u
  69. #define APP_TASK_MODBUS_PARSE_STK_SIZE 512u
  70. #define APP_TASK_MODBUS_SEND_STK_SIZE 512u
  71. /*
  72. *********************************************************************************************************
  73. * uC/SERIAL
  74. *
  75. * Note(s) : (1) Configure SERIAL_CFG_MAX_NBR_IF to the number of interfaces (i.e., UARTs) that will be
  76. * present.
  77. *
  78. * (2) Configure SERIAL_CFG_RD_BUF_EN to enable/disable read buffer functionality. The serial
  79. * core stores received data in the read buffer until the user requests it, providing a
  80. * reliable guarantee against receive overrun.
  81. *
  82. * (3) Configure SERIAL_CFG_WR_BUF_EN to enable/disable write buffer functionality. The serial
  83. * core stores line driver transmit data in the write buffer while the serial interface is
  84. * transmitting application data.
  85. *
  86. * (4) Configure SERIAL_CFG_ARG_CHK_EXT_EN to enable/disable extended argument checking
  87. * functionality.
  88. *
  89. * (5) Configure SERIAL_CFG_TX_DESC_NBR to allow multiple transmit operations (i.e., Serial_Wr,
  90. * Serial_WrAsync) to be queued.
  91. *********************************************************************************************************
  92. */
  93. #define SERIAL_CFG_MAX_NBR_IF 2u /* See Note #1. */
  94. #define SERIAL_CFG_RD_BUF_EN DEF_ENABLED /* See Note #2. */
  95. #define SERIAL_CFG_WR_BUF_EN DEF_ENABLED /* See Note #3. */
  96. #define SERIAL_CFG_ARG_CHK_EXT_EN DEF_DISABLED /* See Note #4. */
  97. #define SERIAL_CFG_TX_DESC_NBR 1u /* See Note #5. */
  98. /*
  99. *********************************************************************************************************
  100. * uC/SERIAL APPLICATION CONFIGURATION
  101. *********************************************************************************************************
  102. */
  103. #define APP_SERIAL_CFG_TRACE_EN DEF_ENABLED
  104. #define APP_SERIAL_CFG_TRACE_PORT_NAME "USART3"
  105. /*
  106. *********************************************************************************************************
  107. * TRACE / DEBUG CONFIGURATION
  108. *********************************************************************************************************
  109. */
  110. #ifndef TRACE_LEVEL_OFF
  111. #define TRACE_LEVEL_OFF 0u
  112. #endif
  113. #ifndef TRACE_LEVEL_INFO
  114. #define TRACE_LEVEL_INFO 1u
  115. #endif
  116. #ifndef TRACE_LEVEL_DBG
  117. #define TRACE_LEVEL_DBG 2u
  118. #endif
  119. //#include <cpu.h>
  120. //void App_SerPrintf (CPU_CHAR *format, ...);
  121. #if (APP_CFG_SERIAL_EN == DEF_ENABLED)
  122. #define APP_TRACE_LEVEL TRACE_LEVEL_DBG
  123. #else
  124. #define APP_TRACE_LEVEL TRACE_LEVEL_OFF
  125. #endif
  126. #define APP_TRACE App_SerPrintf
  127. #define APP_TRACE_INFO(x) ((APP_TRACE_LEVEL >= TRACE_LEVEL_INFO) ? (void)(APP_TRACE x) : (void)0)
  128. #define APP_TRACE_DBG(x) ((APP_TRACE_LEVEL >= TRACE_LEVEL_DBG) ? (void)(APP_TRACE x) : (void)0)
  129. #endif