platform_opts.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. /**
  2. ******************************************************************************
  3. *This file contains general configurations for ameba platform
  4. ******************************************************************************
  5. */
  6. #ifndef __PLATFORM_OPTS_H__
  7. #define __PLATFORM_OPTS_H__
  8. #include "platform_autoconf.h"
  9. /*For MP mode setting*/
  10. //#define SUPPORT_MP_MODE 1
  11. /**
  12. * For AT cmd Log service configurations
  13. */
  14. #define SUPPORT_LOG_SERVICE 1
  15. #if SUPPORT_LOG_SERVICE
  16. #define LOG_SERVICE_BUFLEN 100 //can't larger than UART_LOG_CMD_BUFLEN(127)
  17. #define CONFIG_LOG_HISTORY 0
  18. #if CONFIG_LOG_HISTORY
  19. #define LOG_HISTORY_LEN 5
  20. #endif
  21. #define SUPPORT_INTERACTIVE_MODE 0//on/off wifi_interactive_mode
  22. #define CONFIG_LOG_SERVICE_LOCK 0
  23. #endif
  24. /* For DCT example*/
  25. #define CONFIG_EXAMPLE_DCT 0
  26. /**
  27. * For interactive mode configurations, depents on log service
  28. */
  29. #if SUPPORT_INTERACTIVE_MODE
  30. #define CONFIG_INTERACTIVE_MODE 1
  31. #define CONFIG_INTERACTIVE_EXT 0
  32. #else
  33. #define CONFIG_INTERACTIVE_MODE 0
  34. #define CONFIG_INTERACTIVE_EXT 0
  35. #endif
  36. /**
  37. * For FreeRTOS tickless configurations
  38. */
  39. #define FREERTOS_PMU_TICKLESS_SUSPEND_SDRAM 1 // In sleep mode, 1: suspend SDRAM, 0: no act
  40. /******************************************************************************/
  41. /**
  42. * For common flash usage
  43. */
  44. #define AP_SETTING_SECTOR 0x000FE000
  45. #define UART_SETTING_SECTOR 0x000FC000
  46. #define SPI_SETTING_SECTOR 0x000FC000
  47. #define FAST_RECONNECT_DATA (0x80000 - 0x1000)
  48. #define FLASH_SECTOR_SIZE 0x1000
  49. #define CONFIG_ENABLE_RDP 0
  50. /**
  51. * For Wlan configurations
  52. */
  53. #define CONFIG_WLAN 1
  54. #if CONFIG_WLAN
  55. #define CONFIG_LWIP_LAYER 1
  56. #define CONFIG_INIT_NET 1 //init lwip layer when start up
  57. #define CONFIG_WIFI_IND_USE_THREAD 0 // wifi indicate worker thread
  58. //on/off relative commands in log service
  59. #define CONFIG_SSL_CLIENT 0
  60. #define CONFIG_WEBSERVER 0
  61. #define CONFIG_OTA_UPDATE 1
  62. #define CONFIG_BSD_TCP 1//NOTE : Enable CONFIG_BSD_TCP will increase about 11KB code size
  63. #define CONFIG_AIRKISS 0//on or off tencent airkiss
  64. #define CONFIG_UART_SOCKET 0
  65. #define CONFIG_UART_XMODEM 0//support uart xmodem upgrade or not
  66. #define CONFIG_TRANSPORT 0//on or off the at command for transport socket
  67. /* For WPS and P2P */
  68. #define CONFIG_ENABLE_WPS 0
  69. #define CONFIG_ENABLE_WPS_DISCOVERY 0
  70. #if CONFIG_ENABLE_P2P
  71. #define CONFIG_ENABLE_WPS_AP 1
  72. #undef CONFIG_WIFI_IND_USE_THREAD
  73. #define CONFIG_WIFI_IND_USE_THREAD 1
  74. #endif
  75. #if (CONFIG_ENABLE_P2P && ((CONFIG_ENABLE_WPS_AP == 0) || (CONFIG_ENABLE_WPS == 0)))
  76. #error "If CONFIG_ENABLE_P2P, need to define CONFIG_ENABLE_WPS_AP 1"
  77. #endif
  78. /* For SSL/TLS */
  79. #define CONFIG_USE_POLARSSL 1
  80. #define CONFIG_USE_MBEDTLS 0
  81. #if ((CONFIG_USE_POLARSSL == 0) && (CONFIG_USE_MBEDTLS == 0)) || ((CONFIG_USE_POLARSSL == 1) && (CONFIG_USE_MBEDTLS == 1))
  82. #undef CONFIG_USE_POLARSSL
  83. #define CONFIG_USE_POLARSSL 1
  84. #undef CONFIG_USE_MBEDTLS
  85. #define CONFIG_USE_MBEDTLS 0
  86. #endif
  87. /* For Simple Link */
  88. #define CONFIG_INCLUDE_SIMPLE_CONFIG 1
  89. /*For fast reconnection*/
  90. #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0
  91. #define CONFIG_GAGENT 0
  92. /*Disable CONFIG_EXAMPLE_WLAN_FAST_CONNECT when CONFIG_GAGENT is enabled,because
  93. reconnect to previous AP is not suitable when re-configuration.
  94. */
  95. #if CONFIG_GAGENT
  96. #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0
  97. #endif
  98. #endif //end of #if CONFIG_WLAN
  99. /*******************************************************************************/
  100. /**
  101. * For Ethernet configurations
  102. */
  103. #define CONFIG_ETHERNET 0
  104. #if CONFIG_ETHERNET
  105. #define CONFIG_LWIP_LAYER 1
  106. #define CONFIG_INIT_NET 1 //init lwip layer when start up
  107. //on/off relative commands in log service
  108. #define CONFIG_SSL_CLIENT 0
  109. #define CONFIG_BSD_TCP 0//NOTE : Enable CONFIG_BSD_TCP will increase about 11KB code size
  110. #endif
  111. /**
  112. * For user to adjust SLEEP_INTERVAL
  113. */
  114. #define CONFIG_DYNAMIC_TICKLESS 1
  115. /*******************************************************************************/
  116. /**
  117. * For iNIC configurations
  118. */
  119. //#define CONFIG_INIC_EN 0//enable iNIC mode
  120. #if CONFIG_INIC_EN
  121. #ifndef CONFIG_LWIP_LAYER
  122. #define CONFIG_LWIP_LAYER 0
  123. #endif
  124. #ifndef CONFIG_INIC_SDIO_HCI
  125. #define CONFIG_INIC_SDIO_HCI 0 //for SDIO or USB iNIC
  126. #endif
  127. #ifndef CONFIG_INIC_CMD_RSP
  128. #define CONFIG_INIC_CMD_RSP 0
  129. #endif
  130. #ifndef CONFIG_INIC_USB_HCI
  131. #define CONFIG_INIC_USB_HCI 0
  132. #endif
  133. #endif
  134. /******************End of iNIC configurations*******************/
  135. /* For WIFI GET BEACON FRAME example */
  136. #define CONFIG_EXAMPLE_GET_BEACON_FRAME 0
  137. /* For WIFI MAC MONITOR example */
  138. #define CONFIG_EXAMPLE_WIFI_MAC_MONITOR 0
  139. /* For HTTP CLIENT example */
  140. #define CONFIG_EXAMPLE_HTTP_CLIENT 0
  141. /* For MQTT example */
  142. #define CONFIG_EXAMPLE_MQTT 0
  143. /* For mDNS example */
  144. #define CONFIG_EXAMPLE_MDNS 0
  145. /* For multicast example */
  146. #define CONFIG_EXAMPLE_MCAST 0
  147. /* For XML example */
  148. #define CONFIG_EXAMPLE_XML 0
  149. /* For socket select example */
  150. #define CONFIG_EXAMPLE_SOCKET_SELECT 0
  151. /* For socket nonblocking connect example */
  152. #define CONFIG_EXAMPLE_NONBLOCK_CONNECT 0
  153. /* For socket TCP bidirectional transmission example */
  154. #define CONFIG_EXAMPLE_SOCKET_TCP_TRX 0
  155. /* For ssl download example */
  156. #define CONFIG_EXAMPLE_SSL_DOWNLOAD 0
  157. /* For http download example */
  158. #define CONFIG_EXAMPLE_HTTP_DOWNLOAD 0
  159. /* For httpc example */
  160. #define CONFIG_EXAMPLE_HTTPC 0
  161. /* For httpd example */
  162. #define CONFIG_EXAMPLE_HTTPD 0
  163. /* For tcp keepalive example */
  164. #define CONFIG_EXAMPLE_TCP_KEEPALIVE 0
  165. /* For sntp show time example */
  166. #define CONFIG_EXAMPLE_SNTP_SHOWTIME 0
  167. /* For websocket client example */
  168. #define CONFIG_EXAMPLE_WEBSOCKET 0
  169. /* For UART Module AT command example */
  170. #define CONFIG_EXAMPLE_UART_ATCMD 0
  171. #if CONFIG_EXAMPLE_UART_ATCMD
  172. #undef CONFIG_OTA_UPDATE
  173. #define CONFIG_OTA_UPDATE 1
  174. #undef CONFIG_TRANSPORT
  175. #define CONFIG_TRANSPORT 1
  176. #undef LOG_SERVICE_BUFLEN
  177. #define LOG_SERVICE_BUFLEN 1600
  178. #undef CONFIG_LOG_SERVICE_LOCK
  179. #define CONFIG_LOG_SERVICE_LOCK 1
  180. #undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT
  181. #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0
  182. #endif
  183. /****************** For EAP method example *******************/
  184. #define CONFIG_EXAMPLE_EAP 0
  185. // on/off specified eap method
  186. #define CONFIG_ENABLE_PEAP 0
  187. #define CONFIG_ENABLE_TLS 0
  188. #define CONFIG_ENABLE_TTLS 0
  189. // optional feature: whether to verify the cert of radius server
  190. #define ENABLE_EAP_SSL_VERIFY_SERVER 0
  191. #if CONFIG_ENABLE_PEAP || CONFIG_ENABLE_TLS || CONFIG_ENABLE_TTLS
  192. #define CONFIG_ENABLE_EAP
  193. #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0
  194. #endif
  195. #if CONFIG_ENABLE_TLS
  196. #define ENABLE_EAP_SSL_VERIFY_CLIENT 1
  197. #else
  198. #define ENABLE_EAP_SSL_VERIFY_CLIENT 0
  199. #endif
  200. /******************End of EAP configurations*******************/
  201. /* For iNIC host example*/
  202. #ifdef CONFIG_INIC_GSPI_HOST //this flag is defined in IAR project
  203. #define CONFIG_EXAMPLE_INIC_GSPI_HOST 1
  204. #if CONFIG_EXAMPLE_INIC_GSPI_HOST
  205. #define CONFIG_INIC_HOST 1
  206. #undef CONFIG_WLAN
  207. #define CONFIG_WLAN 0
  208. #undef CONFIG_INCLUDE_SIMPLE_CONFIG
  209. #define CONFIG_INCLUDE_SIMPLE_CONFIG 0
  210. #undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT
  211. #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0
  212. #undef CONFIG_LWIP_LAYER
  213. #define CONFIG_LWIP_LAYER 0
  214. #undef CONFIG_BSD_TCP
  215. #define CONFIG_BSD_TCP 1
  216. #endif
  217. #endif
  218. /*For uart update example*/
  219. #define CONFIG_UART_UPDATE 0
  220. #if CONFIG_UART_UPDATE
  221. #undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT
  222. #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0
  223. #endif
  224. /* For uart adapter example */
  225. /* Please also configure LWIP_UART_ADAPTER to 1
  226. in lwip_opt.h for support uart adapter*/
  227. #define CONFIG_EXAMPLE_UART_ADAPTER 0
  228. #if CONFIG_EXAMPLE_UART_ADAPTER
  229. #undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT
  230. #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 1
  231. #undef CONFIG_EXAMPLE_MDNS
  232. #define CONFIG_EXAMPLE_MDNS 1
  233. #endif
  234. /* For wifi scenarios example (Wi-Fi, WPS enrollee, P2P GO) */
  235. // also need to enable WPS and P2P
  236. #define CONFIG_EXAMPLE_WLAN_SCENARIO 0
  237. /* For broadcast example */
  238. #define CONFIG_EXAMPLE_BCAST 0
  239. /* For high-load memory use case memory usage */
  240. #define CONFIG_EXAMPLE_HIGH_LOAD_MEMORY_USE 0
  241. /* For rarp example */
  242. #define CONFIG_EXAMPLE_RARP 0
  243. /* For ssl server example */
  244. #define CONFIG_EXAMPLE_SSL_SERVER 0
  245. #if CONFIG_QQ_LINK
  246. #define FATFS_R_10C
  247. #define FATFS_DISK_USB 0
  248. #define FATFS_DISK_SD 1
  249. #endif
  250. #if CONFIG_ENABLE_WPS
  251. #define WPS_CONNECT_RETRY_COUNT 4
  252. #define WPS_CONNECT_RETRY_INTERVAL 5000 // in ms
  253. #endif
  254. #define AUTO_RECONNECT_COUNT 8
  255. #define AUTO_RECONNECT_INTERVAL 5 // in sec
  256. #if CONFIG_INIC_EN
  257. #undef CONFIG_INCLUDE_SIMPLE_CONFIG
  258. #define CONFIG_INCLUDE_SIMPLE_CONFIG 0
  259. #define SUPPORT_INTERACTIVE_MODE 0
  260. #define CONFIG_INTERACTIVE_MODE 0
  261. #define CONFIG_INTERACTIVE_EXT 0
  262. #define CONFIG_OTA_UPDATE 0
  263. #endif
  264. #endif