rtconfig.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. /***************************************************************************//**
  2. * @file rtconfig.h
  3. * @brief RT-Thread config file
  4. * COPYRIGHT (C) 2009, RT-Thread Development Team
  5. * @author
  6. * @version 0.4 beta
  7. *******************************************************************************
  8. * @section License
  9. * The license and distribution terms for this file may be found in the file
  10. * LICENSE in this distribution or at http://www.rt-thread.org/license/LICENSE
  11. ******************************************************************************/
  12. #ifndef __RTTHREAD_CFG_H__
  13. #define __RTTHREAD_CFG_H__
  14. /* Includes ------------------------------------------------------------------*/
  15. /* Exported types ------------------------------------------------------------*/
  16. /* Exported constants --------------------------------------------------------*/
  17. /* Exported macro ------------------------------------------------------------*/
  18. /* RT_NAME_MAX*/
  19. #define RT_NAME_MAX (8)
  20. /* RT_ALIGN_SIZE*/
  21. #define RT_ALIGN_SIZE (4)
  22. /* PRIORITY_MAX */
  23. #define RT_THREAD_PRIORITY_MAX (32)
  24. /* Tick per Second */
  25. #define RT_TICK_PER_SECOND (100)
  26. /* SECTION: RT_DEBUG */
  27. #define RT_DEBUG
  28. //#define RT_MEM_DEBUG (1)
  29. //#define RT_DEBUG_SCHEDULER (1)
  30. //#define THREAD_DEBUG
  31. //#define IRQ_DEBUG
  32. #define RT_USING_OVERFLOW_CHECK
  33. //#define DFS_DEBUG
  34. #define RT_LWIP_DEBUG
  35. //#define RT_IRQHDL_DEBUG
  36. //#define RT_USART_DEBUG
  37. //#define RT_IIC_DEBUG
  38. //#define RT_MISC_DEBUG
  39. //#define RT_ADC_DEBUG
  40. //#define RT_ACMP_DEBUG
  41. //#define RT_TIMER_DEBUG
  42. //#define RT_RTC_DEBUG
  43. #define EFM32_SFLASH_DEBUG
  44. //#define EFM32_SDCARD_DEBUG
  45. #define EFM32_ETHERNET_DEBUG
  46. /* Using Hook */
  47. //#define RT_USING_HOOK
  48. /* Using Software Timer */
  49. /* #define RT_USING_TIMER_SOFT */
  50. #define RT_TIMER_THREAD_PRIO (4)
  51. #define RT_TIMER_THREAD_STACK_SIZE (512)
  52. #define RT_TIMER_TICK_PER_SECOND (10)
  53. /* SECTION: IPC */
  54. /* Using Semaphore*/
  55. #define RT_USING_SEMAPHORE /* Using by DFS and lwIP */
  56. /* Using Mutex */
  57. //#define RT_USING_MUTEX /* Using by DFS */
  58. /* Using Event */
  59. //#define RT_USING_EVENT
  60. /* Using MailBox */
  61. #define RT_USING_MAILBOX /* Using by lwIP */
  62. /* Using Message Queue */
  63. //#define RT_USING_MESSAGEQUEUE
  64. /* SECTION: Memory Management */
  65. /* Using Memory Pool Management*/
  66. //#define RT_USING_MEMPOOL
  67. /* Using Dynamic Heap Management */
  68. #define RT_USING_HEAP
  69. /* Using Small MM */
  70. #define RT_USING_SMALL_MEM
  71. /* SECTION: Device System */
  72. /* Using Device System */
  73. #define RT_USING_DEVICE
  74. /* USART Device for Console */
  75. #if defined(EFM32_G290_DK)
  76. #define RT_USING_USART1 (0x0UL)
  77. #define RT_USART1_NAME "debug"
  78. //#define RT_USART1_USING_DMA (0x0UL)
  79. #elif defined(EFM32_G890_STK)
  80. #define RT_USING_USART1 (0x1UL)
  81. #define RT_USART1_NAME "debug"
  82. #define RT_USART1_USING_DMA (0x0UL)
  83. #endif
  84. /* SECTION: SPI options */
  85. #if defined(EFM32_G290_DK)
  86. #define RT_USING_USART0 (0x2UL)
  87. #define RT_USART0_SYNC_MODE (0x1UL) /* Master */
  88. #define RT_USART0_NAME "spi0"
  89. #define RT_USART0_USING_DMA (0x1UL)
  90. #define RT_USING_USART2 (0x1UL)
  91. #define RT_USART2_SYNC_MODE (0x1UL) /* Master */
  92. #define RT_USART2_NAME "spi2"
  93. #define RT_USART2_USING_DMA (0x2UL)
  94. #elif defined(EFM32_G890_STK)
  95. //#define RT_USING_USART0 (0x0UL)
  96. //#define RT_USART0_SYNC_MODE (0x1UL) /* Master */
  97. //#define RT_USART0_NAME "spi0"
  98. //#define RT_USART0_USING_DMA (0x1UL)
  99. #endif
  100. /* SECTION: IIC options */
  101. //#define RT_USING_IIC0 0x1UL
  102. #define RT_IIC0_NAME "iic0"
  103. /* SECTION: ACMP options */
  104. //#define RT_USING_ACMP0
  105. #define RT_ACMP0_NAME "acmp0"
  106. /* SECTION: ADC options */
  107. #define RT_USING_ADC0
  108. #define RT_ADC0_NAME "adc"
  109. /* SECTION: TIMER options */
  110. //#define RT_USING_TIMER2 (0x00) /* Continuous mode */
  111. #define RT_TIMER2_NAME "tmr2"
  112. /* SECTION: RTC options */
  113. #if (defined(EFM32_G290_DK) || defined(EFM32_G890_STK))
  114. //#define RT_USING_RTC
  115. #define RT_RTC_NAME "rtc"
  116. #endif
  117. /* SECTION: Serial options */
  118. #if defined(EFM32_G290_DK)
  119. #define RT_CONSOLE_DEVICE (0x1UL)
  120. #elif defined(EFM32_G890_STK)
  121. #define RT_CONSOLE_DEVICE (0x1UL)
  122. #endif
  123. /* SECTION: Console options */
  124. #define RT_USING_CONSOLE
  125. /* the buffer size of console*/
  126. #define RT_CONSOLEBUF_SIZE (128)
  127. /* SECTION: finsh, a C-Express shell */
  128. #define RT_USING_FINSH
  129. /* Using symbol table */
  130. #define FINSH_USING_SYMTAB
  131. #define FINSH_USING_DESCRIPTION
  132. /* SECTION: SPI Flash, MicroSD card and Ethernet */
  133. #if defined(EFM32_G290_DK)
  134. //#define EFM32_USING_SFLASH
  135. //#define EFM32_USING_SPISD
  136. #define EFM32_USING_ETHERNET
  137. #endif
  138. #if defined(EFM32_USING_SFLASH)
  139. #define SFLASH_USING_DEVICE_NAME RT_USART0_NAME
  140. #endif
  141. #if defined(EFM32_USING_SPISD)
  142. #define SPISD_USING_DEVICE_NAME RT_USART0_NAME
  143. #define SPISD_DEVICE_NAME "spiSd"
  144. #endif
  145. #if defined(EFM32_USING_ETHERNET)
  146. #define ETH_USING_DEVICE_NAME RT_USART2_NAME
  147. #define ETH_DEVICE_NAME "spiEth"
  148. #define ETH_ADDR_DEFAULT {0x11, 0x22, 0x33, 0x44, 0x55, 0x66}
  149. #endif
  150. /* SECTION: device filesystem */
  151. #if defined(EFM32_USING_SPISD)
  152. //#define RT_USING_DFS
  153. //#define RT_USING_DFS_ELMFAT
  154. #define DFS_ELMFAT_INTERFACE_EFM
  155. /* the max number of mounted filesystem */
  156. #define DFS_FILESYSTEMS_MAX (2)
  157. /* the max number of opened files */
  158. #define DFS_FD_MAX (4)
  159. /* the max number of cached sector */
  160. #define DFS_CACHE_MAX_NUM (4)
  161. #endif
  162. /* SECTION: lwip, a lighwight TCP/IP protocol stack */
  163. #if defined(EFM32_USING_ETHERNET)
  164. #define RT_USING_LWIP
  165. //#define RT_USING_NETUTILS
  166. //#define RT_LWIP_DHCP
  167. /* LwIP uses RT-Thread Memory Management */
  168. #define RT_LWIP_USING_RT_MEM
  169. /* Enable ICMP protocol*/
  170. #define RT_LWIP_ICMP
  171. /* Enable UDP protocol*/
  172. #define RT_LWIP_UDP
  173. /* Enable TCP protocol*/
  174. #define RT_LWIP_TCP
  175. /* Enable DNS */
  176. //#define RT_LWIP_DNS
  177. /* the number of simulatenously active TCP connections*/
  178. #define RT_LWIP_TCP_PCB_NUM (2)
  179. /* ip address of target*/
  180. #define RT_LWIP_IPADDR0 (192)
  181. #define RT_LWIP_IPADDR1 (168)
  182. #define RT_LWIP_IPADDR2 (1)
  183. #define RT_LWIP_IPADDR3 (118)
  184. /* gateway address of target*/
  185. #define RT_LWIP_GWADDR0 (192)
  186. #define RT_LWIP_GWADDR1 (168)
  187. #define RT_LWIP_GWADDR2 (1)
  188. #define RT_LWIP_GWADDR3 (1)
  189. /* mask address of target*/
  190. #define RT_LWIP_MSKADDR0 (255)
  191. #define RT_LWIP_MSKADDR1 (255)
  192. #define RT_LWIP_MSKADDR2 (255)
  193. #define RT_LWIP_MSKADDR3 (0)
  194. /* tcp thread options */
  195. #define RT_LWIP_TCPTHREAD_PRIORITY (12)
  196. #define RT_LWIP_TCPTHREAD_MBOX_SIZE (4)
  197. #define RT_LWIP_TCPTHREAD_STACKSIZE (512)
  198. /* ethernet if thread options */
  199. #define RT_LWIP_ETHTHREAD_PRIORITY (15)
  200. #define RT_LWIP_ETHTHREAD_MBOX_SIZE (4)
  201. #define RT_LWIP_ETHTHREAD_STACKSIZE (512)
  202. #endif
  203. /* Exported functions ------------------------------------------------------- */
  204. #endif /* __RTTHREAD_CFG_H__ */