1 /**
2  ******************************************************************************
3  *This file contains general configurations for ameba platform
4  ******************************************************************************
5 */
6 
7 #ifndef __PLATFORM_OPTS_H__
8 #define __PLATFORM_OPTS_H__
9 
10 #include "platform_autoconf.h"
11 #ifdef CONFIG_BT_EN
12 #include "platform_opts_bt.h"
13 #endif
14 /*For MP mode setting*/
15 //#define SUPPORT_MP_MODE		1
16 
17 /**
18  * For AT cmd Log service configurations
19  */
20 #define SUPPORT_LOG_SERVICE	0
21 #if SUPPORT_LOG_SERVICE
22 #define LOG_SERVICE_BUFLEN     100 //can't larger than UART_LOG_CMD_BUFLEN(127)
23 #define CONFIG_LOG_HISTORY	0
24 #if CONFIG_LOG_HISTORY
25 #define LOG_HISTORY_LEN    5
26 #endif
27 #define CONFIG_ATCMD_MP				1 //support MP AT command
28 #define SUPPORT_INTERACTIVE_MODE		0//on/off wifi_interactive_mode
29 #define CONFIG_LOG_SERVICE_LOCK 0
30 #endif
31 
32 /**
33  * For interactive mode configurations, depents on log service
34  */
35 #if SUPPORT_INTERACTIVE_MODE
36 #define CONFIG_INTERACTIVE_MODE     1
37 #define CONFIG_INTERACTIVE_EXT   0
38 #else
39 #define CONFIG_INTERACTIVE_MODE     0
40 #define CONFIG_INTERACTIVE_EXT   0
41 #endif
42 
43 /**
44  * For FreeRTOS tickless configurations
45  */
46 #define FREERTOS_PMU_TICKLESS_SUSPEND_SDRAM  1   // In sleep mode, 1: suspend SDRAM, 0: no act
47 
48 /******************************************************************************/
49 
50 /**
51 * For common flash usage
52 */
53 #define AP_SETTING_SECTOR		0x000FE000
54 #define UART_SETTING_SECTOR		0x000FC000
55 #define SPI_SETTING_SECTOR		0x000FC000
56 #if defined(CONFIG_BAIDU_DUER) && CONFIG_BAIDU_DUER
57 #define FAST_RECONNECT_DATA 	0x1FF000
58 #else
59 #define FAST_RECONNECT_DATA 	0x105000
60 #endif
61 #define CONFIG_ENABLE_RDP		0
62 
63 /**
64  * For Wlan configurations
65  */
66 #define CONFIG_WLAN	1
67 #if CONFIG_WLAN
68 #define CONFIG_LWIP_LAYER	1
69 #define CONFIG_INIT_NET		1 //init lwip layer when start up
70 #define CONFIG_WIFI_IND_USE_THREAD	0	// wifi indicate worker thread
71 
72 //on/off relative commands in log service
73 #define CONFIG_SSL_CLIENT	0
74 #define CONFIG_WEBSERVER	0
75 #define CONFIG_OTA_UPDATE	0
76 #define CONFIG_BSD_TCP		1//NOTE : Enable CONFIG_BSD_TCP will increase about 11KB code size
77 #define CONFIG_AIRKISS		0//on or off tencent airkiss
78 #define CONFIG_UART_SOCKET	0
79 #define CONFIG_JOYLINK			0//on or off for jdsmart or joylink
80 #define CONFIG_QQ_LINK		0//on or off for qqlink
81 #define CONFIG_UART_XMODEM	0//support uart xmodem upgrade or not
82 #define CONFIG_GOOGLE_NEST	0//on or off the at command control for google nest
83 #define CONFIG_TRANSPORT	0//on or off the at command for transport socket
84 #define CONFIG_ALINK			0//on or off for alibaba alink
85 #define CONFIG_HILINK			0//on or off for huawei hilink
86 
87 //#define CONFIG_BAIDU_DUER	1
88 #define CONFIG_DMIC_SEL	0
89 /* For WPS and P2P */
90 #define CONFIG_ENABLE_WPS		1
91 #define CONFIG_ENABLE_P2P		0//on/off p2p cmd in log_service or interactive mode
92 #define CONFIG_ENABLE_WPS_DISCOVERY	0
93 #if CONFIG_ENABLE_P2P
94 #define CONFIG_ENABLE_WPS_AP		1
95 #undef CONFIG_WIFI_IND_USE_THREAD
96 #define CONFIG_WIFI_IND_USE_THREAD	1
97 #endif
98 #if (CONFIG_ENABLE_P2P && ((CONFIG_ENABLE_WPS_AP == 0) || (CONFIG_ENABLE_WPS == 0)))
99 #error "If CONFIG_ENABLE_P2P, need to define CONFIG_ENABLE_WPS_AP 1"
100 #endif
101 
102 /* For SSL/TLS */
103 #define CONFIG_USE_POLARSSL     0
104 #define CONFIG_USE_MBEDTLS      1
105 #if ((CONFIG_USE_POLARSSL == 0) && (CONFIG_USE_MBEDTLS == 0)) || ((CONFIG_USE_POLARSSL == 1) && (CONFIG_USE_MBEDTLS == 1))
106 #undef CONFIG_USE_POLARSSL
107 #define CONFIG_USE_POLARSSL 1
108 #undef CONFIG_USE_MBEDTLS
109 #define CONFIG_USE_MBEDTLS 0
110 #endif
111 
112 /* For Simple Link */
113 #define CONFIG_INCLUDE_SIMPLE_CONFIG		1
114 
115 /*For fast reconnection*/
116 #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT	0
117 
118 /*For wowlan service settings*/
119 #define CONFIG_WOWLAN_SERVICE           			0
120 
121 #define CONFIG_GAGENT			0
122 /*Disable CONFIG_EXAMPLE_WLAN_FAST_CONNECT when CONFIG_GAGENT is enabled,because
123 	reconnect to previous AP is not suitable when re-configuration.
124 */
125 #if CONFIG_GAGENT
126 #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0
127 #endif
128 
129 #define CONFIG_JOINLINK    0
130 
131 #endif //end of #if CONFIG_WLAN
132 /*******************************************************************************/
133 
134 /**
135  * For Ethernet configurations
136  */
137 #define CONFIG_ETHERNET 0
138 #if CONFIG_ETHERNET
139 
140 #define CONFIG_LWIP_LAYER	1
141 #define CONFIG_INIT_NET         1 //init lwip layer when start up
142 
143 //on/off relative commands in log service
144 #define CONFIG_SSL_CLIENT	0
145 #define CONFIG_BSD_TCP		0//NOTE : Enable CONFIG_BSD_TCP will increase about 11KB code size
146 
147 #endif
148 
149 /**
150  * For user to adjust SLEEP_INTERVAL
151  */
152 #define CONFIG_DYNAMIC_TICKLESS  1
153 
154 /*******************************************************************************/
155 
156 /**
157  * For iNIC configurations
158  */
159 //#define CONFIG_INIC_EN 0//enable iNIC mode
160 #if defined(CONFIG_INIC_EN) && CONFIG_INIC_EN
161 #ifndef CONFIG_LWIP_LAYER
162 #define CONFIG_LWIP_LAYER	0
163 #endif
164 #ifndef CONFIG_INIC_SDIO_HCI
165 #define CONFIG_INIC_SDIO_HCI	0 //for SDIO or USB iNIC
166 #endif
167 #ifndef CONFIG_INIC_CMD_RSP
168 #define CONFIG_INIC_CMD_RSP	0
169 #endif
170 #ifndef CONFIG_INIC_USB_HCI
171 #define CONFIG_INIC_USB_HCI	0
172 #endif
173 #endif
174 /******************End of iNIC configurations*******************/
175 
176 /* For aj_basic_example */
177 #define CONFIG_EXAMPLE_AJ_BASIC          0
178 
179 /*For aj_ameba_led example*/
180 #define CONFIG_EXAMPLE_AJ_AMEBA_LED      0
181 
182 /* For WIFI GET BEACON FRAME example */
183 #define CONFIG_EXAMPLE_GET_BEACON_FRAME  0
184 
185 /* For WIFI MAC MONITOR example */
186 #define CONFIG_EXAMPLE_WIFI_MAC_MONITOR  0
187 
188 /* For HTTP CLIENT example */
189 #define CONFIG_EXAMPLE_HTTP_CLIENT  0
190 
191 /* For MQTT example */
192 #define CONFIG_EXAMPLE_MQTT				0
193 
194 /* For WiGadget example */
195 #define CONFIG_EXAMPLE_WIGADGET			0
196 
197 /*For google nest example*/
198 #define CONFIG_EXAMPLE_GOOGLE_NEST		0
199 
200 /* For mDNS example */
201 #define CONFIG_EXAMPLE_MDNS				0
202 
203 /* For multicast example */
204 #define CONFIG_EXAMPLE_MCAST			0
205 
206 /* For XML example */
207 #define CONFIG_EXAMPLE_XML				0
208 
209 /* For socket select example */
210 #define CONFIG_EXAMPLE_SOCKET_SELECT	0
211 
212 /* For socket nonblocking connect example */
213 #define CONFIG_EXAMPLE_NONBLOCK_CONNECT	0
214 
215 /* For socket TCP bidirectional transmission example */
216 #define CONFIG_EXAMPLE_SOCKET_TCP_TRX	0
217 
218 /* For ssl download example */
219 #define CONFIG_EXAMPLE_SSL_DOWNLOAD      0
220 
221 /* For http download example */
222 #define CONFIG_EXAMPLE_HTTP_DOWNLOAD	0
223 
224 /* For http ota update example */
225 #define CONFIG_EXAMPLE_OTA_HTTP	0
226 
227 /* For https ota update example */
228 #define CONFIG_EXAMPLE_OTA_HTTPS	0
229 
230 /* For tcp keepalive example */
231 #define CONFIG_EXAMPLE_TCP_KEEPALIVE	0
232 
233 /* For sntp show time example */
234 #define CONFIG_EXAMPLE_SNTP_SHOWTIME	0
235 
236 /* For pppoe example */
237 #define CONFIG_EXAMPLE_PPPOE            0
238 
239 /* For websocket client example */
240 #define CONFIG_EXAMPLE_WEBSOCKET		0
241 
242 /*For promisc softap mode example */
243 #define CONFIG_EXAMPLE_PROMISC_SOFTAP_CONFIG 0
244 
245 /*For Audio example */
246 #define CONFIG_EXAMPLE_AUDIO			0
247 #if CONFIG_EXAMPLE_AUDIO
248 #define FATFS_DISK_SD 	1
249 #define CONFIG_EXAMPLE_CODEC_SGTL5000         0
250 #define CONFIG_EXAMPLE_CODEC_ALC5651	      1
251 #endif
252 
253 #define CONFIG_EXAMPLE_AUDIO_MP3		0
254 #if CONFIG_EXAMPLE_AUDIO_MP3
255 #define FATFS_DISK_SD	1
256 #endif
257 
258 #define CONFIG_EXAMPLE_AUDIO_AMR		0
259 #if CONFIG_EXAMPLE_AUDIO_AMR
260 #define FATFS_DISK_SD	1
261 #endif
262 
263 #define CONFIG_EXAMPLE_AUDIO_AMR_FLASH 0
264 
265 #define CONFIG_EXAMPLE_AUDIO_AC3		0
266 #ifdef CONFIG_EXAMPLE_AUDIO_AC3
267 #define FATFS_DISK_SD	1
268 #endif
269 
270 #define CONFIG_EXAMPLE_AUDIO_HELIX_AAC	0
271 
272 #define CONFIG_EXAMPLE_AUDIO_HELIX_MP3	0
273 
274 #define CONFIG_EXAMPLE_AUDIO_PCM_UPLOAD	0
275 
276 #define CONFIG_EXAMPLE_AUDIO_HLS		0
277 #if CONFIG_EXAMPLE_AUDIO_HLS
278 #define FATFS_DISK_SD	1
279 #endif
280 
281 #define CONFIG_EXAMPLE_AUDIO_RECORDER	0
282 #if CONFIG_EXAMPLE_AUDIO_RECORDER
283 #define FATFS_DISK_SD	1
284 #endif
285 
286 #define CONFIG_EXAMPLE_AUDIO_M4A_SELFPARSE		0
287 #if CONFIG_EXAMPLE_AUDIO_M4A_SELFPARSE
288 #define FATFS_DISK_SD	1
289 #endif
290 
291 #define CONFIG_EXAMPLE_AUDIO_M4A			0
292 #if CONFIG_EXAMPLE_AUDIO_M4A
293 #define FATFS_DISK_SD	1
294 #endif
295 
296 #define CONFIG_EXAMPLE_AUDIO_FLAC		0
297 #if CONFIG_EXAMPLE_AUDIO_FLAC
298 #define FATFS_DISK_SD	1
299 #endif
300 
301 #define AUDIO_SIGNAL_GENERATE       0
302 
303 #define CONFIG_EXAMPLE_AUDIO_TTS        0
304 
305 /* For UART Module AT command example */
306 #define CONFIG_EXAMPLE_UART_ATCMD	0
307 #if CONFIG_EXAMPLE_UART_ATCMD
308 #undef CONFIG_OTA_UPDATE
309 #define CONFIG_OTA_UPDATE 1
310 #undef CONFIG_TRANSPORT
311 #define CONFIG_TRANSPORT 1
312 #undef LOG_SERVICE_BUFLEN
313 #define LOG_SERVICE_BUFLEN 1600
314 #undef CONFIG_LOG_SERVICE_LOCK
315 #define CONFIG_LOG_SERVICE_LOCK 1
316 #undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT
317 #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT  0
318 #endif
319 
320 /* For SPI Module AT command example */
321 #define CONFIG_EXAMPLE_SPI_ATCMD 0
322 
323 #if CONFIG_EXAMPLE_SPI_ATCMD
324 #undef CONFIG_OTA_UPDATE
325 #define CONFIG_OTA_UPDATE 1
326 #undef CONFIG_TRANSPORT
327 #define CONFIG_TRANSPORT 1
328 #undef LOG_SERVICE_BUFLEN
329 #define LOG_SERVICE_BUFLEN 1600
330 #undef CONFIG_LOG_SERVICE_LOCK
331 #define CONFIG_LOG_SERVICE_LOCK 1
332 #undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT
333 #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT  0
334 #endif
335 
336 /* For uvc example */
337 #ifdef CONFIG_UVC
338 /*for uvc_FATFS feature*/
339 #define CONFIG_UVC_SD_EN			0
340 #if CONFIG_UVC_SD_EN
341 #define CONFIG_FATFS_EN	1
342 #if CONFIG_FATFS_EN
343 // fatfs version
344 #define FATFS_R_10C
345 // fatfs disk interface
346 #define FATFS_DISK_USB	0
347 #define FATFS_DISK_SD 	1
348 #endif
349 #endif
350 #endif
351 
352 #define CONFIG_EXAMPLE_MEDIA_SS 				0
353 #define CONFIG_EXAMPLE_MEDIA_MS					0
354 #define CONFIG_EXAMPLE_MEDIA_GEO_RTP                            0
355 // Use media source/sink example
356 #if (CONFIG_EXAMPLE_MEDIA_SS==1) || (CONFIG_EXAMPLE_MEDIA_MS==1)
357 #undef CONFIG_INCLUDE_SIMPLE_CONFIG
358 #define CONFIG_INCLUDE_SIMPLE_CONFIG		0
359 #define CONFIG_ENABLE_WPS	0
360 #endif
361 
362 /* For Mjpeg capture example*/
363 #define CONFIG_EXAMPLE_MJPEG_CAPTURE		0
364 #if CONFIG_EXAMPLE_MJPEG_CAPTURE
365 #define FATFS_DISK_SD 	1
366 #endif
367 
368 /****************** For EAP method example *******************/
369 #define CONFIG_EXAMPLE_EAP	0
370 
371 // on/off specified eap method
372 #define CONFIG_ENABLE_PEAP	0
373 #define CONFIG_ENABLE_TLS	0
374 #define CONFIG_ENABLE_TTLS	0
375 
376 // optional feature: whether to verify the cert of radius server
377 #define ENABLE_EAP_SSL_VERIFY_SERVER	0
378 
379 #if CONFIG_ENABLE_PEAP || CONFIG_ENABLE_TLS || CONFIG_ENABLE_TTLS
380 #define CONFIG_ENABLE_EAP
381 #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0
382 #endif
383 
384 #if CONFIG_ENABLE_TLS
385 #define ENABLE_EAP_SSL_VERIFY_CLIENT	1
386 #else
387 #define ENABLE_EAP_SSL_VERIFY_CLIENT	0
388 #endif
389 /******************End of EAP configurations*******************/
390 
391 /* For usb mass storage example */
392 #define CONFIG_EXAMPLE_USB_MASS_STORAGE		0
393 
394 /* For usb device isoc example */
395 #define CONFIG_EXAMPLE_USB_ISOC_DEVICE			0
396 /* For usb host vendor specific  example */
397 #define CONFIG_EXAMPLE_USB_VENDOR_SPECIFIC		0
398 
399 /* For FATFS example*/
400 #define CONFIG_EXAMPLE_FATFS			0
401 #if CONFIG_EXAMPLE_FATFS
402 #define CONFIG_FATFS_EN	1
403 #if CONFIG_FATFS_EN
404 // fatfs version
405 #define FATFS_R_10C
406 // fatfs disk interface
407 #define FATFS_DISK_USB	0
408 #define FATFS_DISK_SD 	1
409 #endif
410 #endif
411 
412 /* For iNIC host example*/
413 #ifdef CONFIG_INIC_GSPI_HOST //this flag is defined in IAR project
414 #define	CONFIG_EXAMPLE_INIC_GSPI_HOST	1
415 #if CONFIG_EXAMPLE_INIC_GSPI_HOST
416 
417 #define CONFIG_INIC_HOST	1
418 
419 #undef CONFIG_WLAN
420 #define CONFIG_WLAN		0
421 #undef	CONFIG_INCLUDE_SIMPLE_CONFIG
422 #define CONFIG_INCLUDE_SIMPLE_CONFIG	0
423 #undef	CONFIG_EXAMPLE_WLAN_FAST_CONNECT
424 #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT	0
425 #undef CONFIG_LWIP_LAYER
426 #define CONFIG_LWIP_LAYER	1
427 #undef	CONFIG_BSD_TCP
428 #define CONFIG_BSD_TCP		1
429 
430 #endif
431 #endif
432 
433 /*For uart update example*/
434 #define CONFIG_UART_UPDATE				0
435 #if CONFIG_UART_UPDATE
436 #undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT
437 #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT 0
438 #endif
439 
440 /*For arduino wifi shield example */
441 #define CONFIG_EXAMPLE_ARDUINO_WIFI	0
442 #if CONFIG_EXAMPLE_ARDUINO_WIFI
443 #undef CONFIG_WIFI_NORMAL
444 #endif
445 
446 /* For uart adapter example */
447 /* Please also configure LWIP_UART_ADAPTER to 1
448 in lwip_opt.h for support uart adapter*/
449 #define CONFIG_EXAMPLE_UART_ADAPTER	0
450 #if CONFIG_EXAMPLE_UART_ADAPTER
451 #undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT
452 #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT	1
453 #undef CONFIG_EXAMPLE_MDNS
454 #define CONFIG_EXAMPLE_MDNS	1
455 #endif
456 
457 #if CONFIG_EXAMPLE_PROMISC_SOFTAP_CONFIG
458 #undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT
459 #define CONFIG_EXAMPLE_WLAN_FAST_CONNECT	1
460 #endif
461 
462 /* For wifi scenarios example (Wi-Fi, WPS enrollee, P2P GO) */
463 // also need to enable WPS and P2P
464 #define CONFIG_EXAMPLE_WLAN_SCENARIO	0
465 
466 /* For broadcast example */
467 #define CONFIG_EXAMPLE_BCAST			0
468 
469 /* For high-load memory use case memory usage */
470 #define CONFIG_EXAMPLE_HIGH_LOAD_MEMORY_USE		0
471 
472 /* For rarp example */
473 #define CONFIG_EXAMPLE_RARP				0
474 
475 /* For ssl server example */
476 #define CONFIG_EXAMPLE_SSL_SERVER		0
477 
478 #if CONFIG_QQ_LINK
479 #define FATFS_R_10C
480 #define FATFS_DISK_USB	0
481 #define FATFS_DISK_SD 	1
482 #endif
483 
484 #if CONFIG_ENABLE_WPS
485 #define WPS_CONNECT_RETRY_COUNT		4
486 #define WPS_CONNECT_RETRY_INTERVAL	5000 // in ms
487 #endif
488 
489 #define AUTO_RECONNECT_COUNT	8
490 #define AUTO_RECONNECT_INTERVAL	5 // in sec
491 
492 #if defined(CONFIG_INIC_EN) && CONFIG_INIC_EN
493 #undef CONFIG_INCLUDE_SIMPLE_CONFIG
494 #define CONFIG_INCLUDE_SIMPLE_CONFIG	0
495 #define SUPPORT_INTERACTIVE_MODE		0
496 #define CONFIG_INTERACTIVE_MODE		0
497 #define CONFIG_INTERACTIVE_EXT			0
498 #define CONFIG_OTA_UPDATE				0
499 #endif
500 
501 //#define CONFIG_EXAMPLE_COMPETITIVE_HEADPHONES		1
502 //#define CONFIG_EXAMPLE_COMPETITIVE_HEADPHONES_DONGLE	1
503 
504 /* For fast DHCP */
505 #if CONFIG_EXAMPLE_WLAN_FAST_CONNECT
506 #define CONFIG_FAST_DHCP 1
507 #else
508 #define CONFIG_FAST_DHCP 0
509 #endif
510 
511 #endif
512