735 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
		
		
			
		
	
	
			735 lines
		
	
	
		
			23 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| 
								 | 
							
								/****************************************************************************
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
							 | 
						||
| 
								 | 
							
								be copied by any method or incorporated into another program without
							 | 
						||
| 
								 | 
							
								the express written consent of Aerospace C.Power. This Information or any portion
							 | 
						||
| 
								 | 
							
								thereof remains the property of Aerospace C.Power. The Information contained herein
							 | 
						||
| 
								 | 
							
								is believed to be accurate and Aerospace C.Power assumes no responsibility or
							 | 
						||
| 
								 | 
							
								liability for its use in any way and conveys no license or title under
							 | 
						||
| 
								 | 
							
								any patent or copyright and makes no representation or warranty that this
							 | 
						||
| 
								 | 
							
								Information is free from patent or copyright infringement.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								****************************************************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* This file contains the Kunlun features configuration
							 | 
						||
| 
								 | 
							
								 * any feature related .c file should include this file
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef PLC_CONFIG_API_H
							 | 
						||
| 
								 | 
							
								#define PLC_CONFIG_API_H
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								extern "C" {
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* PLC configuration start ****************************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if HW_PLATFORM == HW_PLATFORM_SIMU
							 | 
						||
| 
								 | 
							
								#define SUPPORT_SOUTHERN_POWER_GRID     1
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define SUPPORT_SOUTHERN_POWER_GRID     0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#define SUPPORT_SMART_GRID              1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* define if FW support CCO role */
							 | 
						||
| 
								 | 
							
								#if (HW_PLATFORM == HW_PLATFORM_SIMU)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef PLC_SUPPORT_CCO_ROLE
							 | 
						||
| 
								 | 
							
								#define PLC_SUPPORT_CCO_ROLE            1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef PLC_SUPPORT_STA_ROLE
							 | 
						||
| 
								 | 
							
								#define PLC_SUPPORT_STA_ROLE            1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if PLC_SUPPORT_CCO_ROLE
							 | 
						||
| 
								 | 
							
								#define RUN_IN_PSRAM                    1
							 | 
						||
| 
								 | 
							
								#define IOT_PSRAM_SIZE                  4
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define RUN_IN_PSRAM                    0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* #define number of nodes supported in the PLC network must be (n * 8 - 1) */
							 | 
						||
| 
								 | 
							
								#define PLC_NETWORK_SCALE               1015
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#else /* (HW_PLATFORM == HW_PLATFORM_SIMU) */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef PLC_SUPPORT_CCO_ROLE
							 | 
						||
| 
								 | 
							
								#define PLC_SUPPORT_CCO_ROLE            0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef IOT_FLASH_BUILD
							 | 
						||
| 
								 | 
							
								#define IOT_FLASH_BUILD                 0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if PLC_SUPPORT_CCO_ROLE
							 | 
						||
| 
								 | 
							
								#define PLC_SUPPORT_STA_ROLE            0
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define PLC_SUPPORT_STA_ROLE            1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if PLC_SUPPORT_CCO_ROLE
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if RUN_IN_PSRAM
							 | 
						||
| 
								 | 
							
								/* #define number of nodes supported in the PLC network must be (n * 8 - 1) */
							 | 
						||
| 
								 | 
							
								#define PLC_NETWORK_SCALE               1015
							 | 
						||
| 
								 | 
							
								#else /* RUN_IN_PSRAM */
							 | 
						||
| 
								 | 
							
								/* #define number of nodes supported in the PLC network must be (n * 8 - 1) */
							 | 
						||
| 
								 | 
							
								#define PLC_NETWORK_SCALE               207
							 | 
						||
| 
								 | 
							
								#endif /* RUN_IN_PSRAM */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#else /* PLC_SUPPORT_CCO_ROLE */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if ((TARGET_VERSION == TARGET_KUNLUN3) && !SUPPORT_SOUTHERN_POWER_GRID)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* #define number of nodes supported in the PLC network must be (n * 8 - 1) */
							 | 
						||
| 
								 | 
							
								#define PLC_NETWORK_SCALE               2039
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#else /* (TARGET_VERSION == TARGET_KUNLUN3) */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* #define number of nodes supported in the PLC network must be (n * 8 - 1) */
							 | 
						||
| 
								 | 
							
								#define PLC_NETWORK_SCALE               1015
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* (TARGET_VERSION == TARGET_KUNLUN3) */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* PLC_SUPPORT_CCO_ROLE */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* (HW_PLATFORM == HW_PLATFORM_SIMU) */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* PLC configuration end ******************************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* TASK priority configuration start ******************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_PING_TASK_PRIO              7
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_TASK_PRIO        7
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_BRM_TASK_PRIO               7
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_PLCUART_TASK_PRIO           7
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_GRAPP_PROTO_TASK_PRIO       6
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_DEV_TEST_TASK_PRIO          7
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_CKB_TASK_PRIO               7
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_TPUT_TASK_PRIO              6
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_PPM_DETECT_TASK_PRIO        7
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* TASK priority configuration end ********************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* DEBUG configuration start **************************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef IOT_ASSERT_DEBUG
							 | 
						||
| 
								 | 
							
								#if (PLC_SUPPORT_CCO_ROLE || (IOT_FLASH_SIZE > 1))
							 | 
						||
| 
								 | 
							
								#define IOT_ASSERT_DEBUG                1
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_ASSERT_DEBUG                0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_PKT_DEBUG                   0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (TARGET_VERSION == TARGET_KUNLUN3)
							 | 
						||
| 
								 | 
							
								#define IOT_PKT_FREE_CALLBACK_ENABLE    1
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_PKT_FREE_CALLBACK_ENABLE    (PLC_SUPPORT_CCO_ROLE && RUN_IN_PSRAM)
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define SMART_GRID_DEBUG                1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if PLC_SUPPORT_CCO_ROLE
							 | 
						||
| 
								 | 
							
								#define IOT_EXCEPTION_DEBUG             0
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_EXCEPTION_DEBUG             1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_FULL_DUMP_DEBUG             0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* debug log output settings */
							 | 
						||
| 
								 | 
							
								#if (HW_PLATFORM == HW_PLATFORM_SIMU)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_PRINTF_DEBUG                1
							 | 
						||
| 
								 | 
							
								#define UART_DEBUG                      0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* dbglog debug */
							 | 
						||
| 
								 | 
							
								#define IOT_DBGLOG_DEBUG_DISABLE        0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#elif (HW_PLATFORM == HW_PLATFORM_FPGA) /* HW_PLATFORM == HW_PLATFORM_SIMU */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_PRINTF_DEBUG                1
							 | 
						||
| 
								 | 
							
								#define UART_DEBUG                      0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* dbglog debug */
							 | 
						||
| 
								 | 
							
								#define IOT_DBGLOG_DEBUG_DISABLE        0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#else /* HW_PLATFORM == HW_PLATFORM_SILICON */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if IOT_FLASH_BUILD
							 | 
						||
| 
								 | 
							
								#define IOT_PRINTF_DEBUG                1
							 | 
						||
| 
								 | 
							
								#else /* IOT_FLASH_BUILD */
							 | 
						||
| 
								 | 
							
								#define IOT_PRINTF_DEBUG                1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define UART_DEBUG                      0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* dbglog debug */
							 | 
						||
| 
								 | 
							
								#if (PLC_SUPPORT_CCO_ROLE)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_PRINTF_DEBUG && (IOT_FLASH_SIZE < 2))
							 | 
						||
| 
								 | 
							
								#define IOT_DBGLOG_DEBUG_DISABLE        1
							 | 
						||
| 
								 | 
							
								#else /* IOT_PRINTF_DEBUG */
							 | 
						||
| 
								 | 
							
								#define IOT_DBGLOG_DEBUG_DISABLE        0
							 | 
						||
| 
								 | 
							
								#endif /* IOT_PRINTF_DEBUG */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#else /* PLC_SUPPORT_CCO_ROLE */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_PRINTF_DEBUG && (IOT_FLASH_SIZE <= 2) && (!IOT_SMART_CONFIG))
							 | 
						||
| 
								 | 
							
								#define IOT_DBGLOG_DEBUG_DISABLE        1
							 | 
						||
| 
								 | 
							
								#else /* IOT_PRINTF_DEBUG */
							 | 
						||
| 
								 | 
							
								#define IOT_DBGLOG_DEBUG_DISABLE        0
							 | 
						||
| 
								 | 
							
								#endif /* IOT_PRINTF_DEBUG */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* PLC_SUPPORT_CCO_ROLE */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* interrupt err trigger cnt write to flash */
							 | 
						||
| 
								 | 
							
								#define IOT_INTERRUPT_ERR_TRIGGER_WRITE_FLASH_ENABLE   1
							 | 
						||
| 
								 | 
							
								/* 10min */
							 | 
						||
| 
								 | 
							
								#define IOT_INTERRUPT_ERR_TRIGGER_WRITE_FLASH_PER   120
							 | 
						||
| 
								 | 
							
								/* 1 hours */
							 | 
						||
| 
								 | 
							
								#define IOT_INTERRUPT_ERR_TRIGGER_WRITE_FLASH_FIXED_TIME   \
							 | 
						||
| 
								 | 
							
								    (IOT_INTERRUPT_ERR_TRIGGER_WRITE_FLASH_PER * 6)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_INTERRUPT_ERR_TRIGGER_CRASH   0
							 | 
						||
| 
								 | 
							
								#endif /* HW_PLATFORM == HW_PLATFORM_SIMU */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* DEBUG configuration end ****************************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* APPLICAITON configuration start ********************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (HW_PLATFORM == HW_PLATFORM_SIMU)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef IOT_APP_SELECTION
							 | 
						||
| 
								 | 
							
								#define IOT_APP_SELECTION               0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef IOT_SMART_CONFIG
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_CONFIG                0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* HW_PLATFORM == HW_PLATFORM_SIMU */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* IOT_APP enum defination : */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_0_SG                0   /* SG app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_1_PING              1   /* Ping app. Not used now. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_2_PLCUART           2   /* PLC-Uart app. Not used now. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_3_DEMO              3   /* Demo app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_4_GE                4   /* GE app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_5_SG_EXT            5   /* sg extend app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_6_SG_METER          6   /* sg meter app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_7_LED_CTRL          7   /* led controller app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_8_GE_LWIP           8   /* GE App with lwip. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_9_GE_EXT            9   /* GE extend app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_10_CP               10  /* Charge platform. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_11_BRM              11   /* branch management app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_12_DEMO_LWIP        12   /* demo lwip app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_13_GE_MODBUS        13  /* ge modbus app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_14_BSRM             14  /* branch signal recognition app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_15_SNIFFER          15  /* sniffer app */
							 | 
						||
| 
								 | 
							
								/* branch signal recognition cus app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_16_BSRM_CUS_APP     16
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_17_CUST_DEMO_APP    17  /* cus_core demo app for kl3. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_18_AT_APP           18  /* demo at app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_19_IOT_SNIFFER      19  /* iot sniffer app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_20_SUNSOLAR         20  /* sunslolar app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_21_HTBUS            21  /* htbus app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_22_GE_MICRO_CCTT    22  /* micro cctt app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_23_CUST_AT_APP      23  /* cus_core at app for kl3. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_24_SILA_APP         24  /* sila app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_25_AT_MICRO_CCTT    25  /* at micro cctt app */
							 | 
						||
| 
								 | 
							
								#define IOT_APP_DEF_26_IOT_DL645_APP    26  /* iot dl645 app. */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* macro define for sta control type */
							 | 
						||
| 
								 | 
							
								#define IOT_STA_CONTROL_TYPE_STA        1
							 | 
						||
| 
								 | 
							
								#define IOT_STA_CONTROL_TYPE_METER      2
							 | 
						||
| 
								 | 
							
								#define IOT_STA_CONTROL_TYPE_AUTO       3
							 | 
						||
| 
								 | 
							
								#define IOT_STA_CONTROL_TYPE_PPM_DETECT 4
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_STA_CONTROL_MODE            0
							 | 
						||
| 
								 | 
							
								/* enable/disable dev_test app for cco testing  */
							 | 
						||
| 
								 | 
							
								#define IOT_DEV_TEST_CCO_MODE           0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* enable/disable sg_ctrl app for control device */
							 | 
						||
| 
								 | 
							
								#define IOT_SG_CONTROLLER_ENABLE        0
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION != IOT_APP_DEF_0_SG)
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_ENABLE           0
							 | 
						||
| 
								 | 
							
								#elif (IOT_AI_ENABLE)
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_ENABLE           0
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#if (IOT_STA_CONTROL_MODE || IOT_SG_CONTROLLER_ENABLE)
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_ENABLE           0
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_ENABLE           1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/*Below Macro will define which IOT APP will run */
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_1_PING)
							 | 
						||
| 
								 | 
							
								/* enable PING APP */
							 | 
						||
| 
								 | 
							
								#define IOT_PING_APP_ENABLE             1
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_PING_APP_ENABLE             0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_2_PLCUART)
							 | 
						||
| 
								 | 
							
								/* enable PLCUART APP */
							 | 
						||
| 
								 | 
							
								#define IOT_PLCUART_APP_ENABLE          1
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_PLCUART_APP_ENABLE          0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_17_CUST_DEMO_APP)
							 | 
						||
| 
								 | 
							
								/* enable CUSTOMER APP */
							 | 
						||
| 
								 | 
							
								#define IOT_CUST_DEMO_APP_ENABLE        1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_23_CUST_AT_APP)
							 | 
						||
| 
								 | 
							
								/* enable CUSTOMER APP */
							 | 
						||
| 
								 | 
							
								#define IOT_CUST_AT_APP_ENABLE          1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_3_DEMO)
							 | 
						||
| 
								 | 
							
								/* enable DEMO APP */
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_ENABLE             1
							 | 
						||
| 
								 | 
							
								/* control the tx/rx led by app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APPCTRL_LED                 0
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_ETH_SUPPORT        0
							 | 
						||
| 
								 | 
							
								/* enable udp server on DEMO APP */
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_UDP_SERVER_ENABLE  0
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_TCP_SERVER_ENABLE  0
							 | 
						||
| 
								 | 
							
								#define IOT_ENABLE_ADD_PADDING_INFO     0
							 | 
						||
| 
								 | 
							
								#elif (IOT_APP_SELECTION == IOT_APP_DEF_12_DEMO_LWIP)
							 | 
						||
| 
								 | 
							
								/* enable DEMO APP */
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_ENABLE             1
							 | 
						||
| 
								 | 
							
								/* control the tx/rx led by app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APPCTRL_LED                 1
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_ETH_SUPPORT        0
							 | 
						||
| 
								 | 
							
								/* enable udp server on DEMO APP */
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_UDP_SERVER_ENABLE  0
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_TCP_SERVER_ENABLE  0
							 | 
						||
| 
								 | 
							
								/* enable lwip */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_SUPPORT                1
							 | 
						||
| 
								 | 
							
								#elif (IOT_APP_SELECTION == IOT_APP_DEF_18_AT_APP)
							 | 
						||
| 
								 | 
							
								/* enable AT APP */
							 | 
						||
| 
								 | 
							
								#define IOT_AT_APP_ENABLE               1
							 | 
						||
| 
								 | 
							
								/* control the tx/rx led by app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APPCTRL_LED                 0
							 | 
						||
| 
								 | 
							
								#define IOT_ENABLE_ADD_PADDING_INFO     0
							 | 
						||
| 
								 | 
							
								#define IOT_AT_ONLY                     1
							 | 
						||
| 
								 | 
							
								#elif (IOT_APP_SELECTION == IOT_APP_DEF_24_SILA_APP)
							 | 
						||
| 
								 | 
							
								/* enable AT APP */
							 | 
						||
| 
								 | 
							
								#define IOT_AT_APP_ENABLE               1
							 | 
						||
| 
								 | 
							
								/* control the tx/rx led by app. */
							 | 
						||
| 
								 | 
							
								#define IOT_APPCTRL_LED                 0
							 | 
						||
| 
								 | 
							
								#define IOT_ENABLE_ADD_PADDING_INFO     0
							 | 
						||
| 
								 | 
							
								#if PLC_SUPPORT_STA_ROLE
							 | 
						||
| 
								 | 
							
								/* sila dev module enable. */
							 | 
						||
| 
								 | 
							
								#define IOT_SILA_DEV_ENABLE             1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#elif (IOT_APP_SELECTION == IOT_APP_DEF_25_AT_MICRO_CCTT) // at micro cctt start
							 | 
						||
| 
								 | 
							
								/* enable micro cctt app */
							 | 
						||
| 
								 | 
							
								#define IOT_MICRO_CCTT_TASK_ENABLE      1
							 | 
						||
| 
								 | 
							
								/* enable at app */
							 | 
						||
| 
								 | 
							
								#define IOT_AT_APP_ENABLE               1
							 | 
						||
| 
								 | 
							
								/* at only */
							 | 
						||
| 
								 | 
							
								#define IOT_AT_ONLY                     1
							 | 
						||
| 
								 | 
							
								#define IOT_ENABLE_ADD_PADDING_INFO     0
							 | 
						||
| 
								 | 
							
								/* disable io operation for at */
							 | 
						||
| 
								 | 
							
								#define APP_IO_OPERATION_ENABLE         0
							 | 
						||
| 
								 | 
							
								/* enable lwip */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_SUPPORT                1
							 | 
						||
| 
								 | 
							
								/* enable expanded IO functions */
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_ENABLE             1
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_MCP23017_ENABLE    1
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_TCA9534A_ENABLE    1
							 | 
						||
| 
								 | 
							
								/* enable external rtc support */
							 | 
						||
| 
								 | 
							
								#define IOT_RTC_EXT_ENABLE              1
							 | 
						||
| 
								 | 
							
								/* enable external temperature/humidity support */
							 | 
						||
| 
								 | 
							
								#define IOT_HTM_EXT_CHT8310_ENABLE      1
							 | 
						||
| 
								 | 
							
								/* enable app to access cli interface */
							 | 
						||
| 
								 | 
							
								#define IOT_CLI_INF_MODE                2
							 | 
						||
| 
								 | 
							
								// micro cctt app end
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_ENABLE             0
							 | 
						||
| 
								 | 
							
								#define IOT_APPCTRL_LED                 0
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_ETH_SUPPORT        0
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_UDP_SERVER_ENABLE  0
							 | 
						||
| 
								 | 
							
								#define IOT_DEMO_APP_TCP_SERVER_ENABLE  0
							 | 
						||
| 
								 | 
							
								#define IOT_AT_APP_ENABLE               0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_4_GE)
							 | 
						||
| 
								 | 
							
								/* enable GR APP */
							 | 
						||
| 
								 | 
							
								#define IOT_GR_APP_ENABLE               1
							 | 
						||
| 
								 | 
							
								/* If to build grapp as libapp.a for ge_ext_sdk */
							 | 
						||
| 
								 | 
							
								#define IOT_GE_EXT_SDK_ENABLE           0
							 | 
						||
| 
								 | 
							
								#elif (IOT_APP_SELECTION == IOT_APP_DEF_7_LED_CTRL)
							 | 
						||
| 
								 | 
							
								/* enable led_ctrl task app */
							 | 
						||
| 
								 | 
							
								#define IOT_LED_CTRL_APP_ENABLE         1
							 | 
						||
| 
								 | 
							
								/* enable GR APP */
							 | 
						||
| 
								 | 
							
								#define IOT_GR_APP_ENABLE               1
							 | 
						||
| 
								 | 
							
								#elif (IOT_APP_SELECTION == IOT_APP_DEF_8_GE_LWIP)
							 | 
						||
| 
								 | 
							
								/* enable ge extern task app */
							 | 
						||
| 
								 | 
							
								#define IOT_GE_EXT_TASK_ENABLE          1
							 | 
						||
| 
								 | 
							
								/* enable GR APP */
							 | 
						||
| 
								 | 
							
								#define IOT_GR_APP_ENABLE               1
							 | 
						||
| 
								 | 
							
								/* enable lwip */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_SUPPORT                1
							 | 
						||
| 
								 | 
							
								/* If to build grapp as libapp.a for ge_ext_sdk */
							 | 
						||
| 
								 | 
							
								#define IOT_GE_EXT_SDK_ENABLE           1
							 | 
						||
| 
								 | 
							
								#elif (IOT_APP_SELECTION == IOT_APP_DEF_9_GE_EXT)
							 | 
						||
| 
								 | 
							
								/* enable ge extern task app */
							 | 
						||
| 
								 | 
							
								#define IOT_GE_EXT_TASK_ENABLE          1
							 | 
						||
| 
								 | 
							
								/* enable GR APP */
							 | 
						||
| 
								 | 
							
								#define IOT_GR_APP_ENABLE               1
							 | 
						||
| 
								 | 
							
								/* If to build grapp as libapp.a for ge_ext_sdk */
							 | 
						||
| 
								 | 
							
								#define IOT_GE_EXT_SDK_ENABLE           1
							 | 
						||
| 
								 | 
							
								#elif (IOT_APP_SELECTION == IOT_APP_DEF_10_CP)
							 | 
						||
| 
								 | 
							
								/* enable chargepile extern task app */
							 | 
						||
| 
								 | 
							
								#define IOT_CP_TASK_ENABLE              1
							 | 
						||
| 
								 | 
							
								/* enable GR APP */
							 | 
						||
| 
								 | 
							
								#define IOT_GR_APP_ENABLE               1
							 | 
						||
| 
								 | 
							
								/* If to build grapp as libapp.a for ge_ext_sdk */
							 | 
						||
| 
								 | 
							
								#define IOT_GE_EXT_SDK_ENABLE           1
							 | 
						||
| 
								 | 
							
								#elif (IOT_APP_SELECTION == IOT_APP_DEF_13_GE_MODBUS)
							 | 
						||
| 
								 | 
							
								/* enable ge extern task app */
							 | 
						||
| 
								 | 
							
								#define IOT_GE_MODBUS_TASK_ENABLE       1
							 | 
						||
| 
								 | 
							
								#define IOT_GE_EXT_TASK_ENABLE          0
							 | 
						||
| 
								 | 
							
								/* enable GR APP */
							 | 
						||
| 
								 | 
							
								#define IOT_GR_APP_ENABLE               1
							 | 
						||
| 
								 | 
							
								/* If to build grapp as libapp.a for ge_ext_sdk */
							 | 
						||
| 
								 | 
							
								#define IOT_GE_EXT_SDK_ENABLE           1
							 | 
						||
| 
								 | 
							
								#elif (IOT_APP_SELECTION == IOT_APP_DEF_22_GE_MICRO_CCTT) // micro cctt app start
							 | 
						||
| 
								 | 
							
								/* enable micro cctt app */
							 | 
						||
| 
								 | 
							
								#define IOT_MICRO_CCTT_TASK_ENABLE      1
							 | 
						||
| 
								 | 
							
								/* enable GR APP */
							 | 
						||
| 
								 | 
							
								#define IOT_GR_APP_ENABLE               1
							 | 
						||
| 
								 | 
							
								/* enable lwip */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_SUPPORT                1
							 | 
						||
| 
								 | 
							
								/* enable expanded IO functions */
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_ENABLE             1
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_MCP23017_ENABLE    1
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_TCA9534A_ENABLE    1
							 | 
						||
| 
								 | 
							
								/* enable external rtc support */
							 | 
						||
| 
								 | 
							
								#define IOT_RTC_EXT_ENABLE              1
							 | 
						||
| 
								 | 
							
								/* enable external temperature/humidity support */
							 | 
						||
| 
								 | 
							
								#define IOT_HTM_EXT_CHT8310_ENABLE      1
							 | 
						||
| 
								 | 
							
								/* enable app to access cli interface */
							 | 
						||
| 
								 | 
							
								#define IOT_CLI_INF_MODE                2
							 | 
						||
| 
								 | 
							
								// micro cctt app end
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								/* Disable IOT featuers. */
							 | 
						||
| 
								 | 
							
								#define IOT_GR_APP_ENABLE               0
							 | 
						||
| 
								 | 
							
								#define IOT_LED_CTRL_APP_ENABLE         0
							 | 
						||
| 
								 | 
							
								#define IOT_GE_EXT_TASK_ENABLE          0
							 | 
						||
| 
								 | 
							
								#define IOT_GE_MODBUS_TASK_ENABLE       0
							 | 
						||
| 
								 | 
							
								#define IOT_CP_TASK_ENABLE              0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef IOT_GE_EXT_SDK_ENABLE
							 | 
						||
| 
								 | 
							
								#define IOT_GE_EXT_SDK_ENABLE           0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* define app send msdu can add pad info or not */
							 | 
						||
| 
								 | 
							
								#ifndef IOT_ENABLE_ADD_PADDING_INFO
							 | 
						||
| 
								 | 
							
								#define IOT_ENABLE_ADD_PADDING_INFO     0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_5_SG_EXT\
							 | 
						||
| 
								 | 
							
								    || IOT_APP_SELECTION == IOT_APP_DEF_6_SG_METER)
							 | 
						||
| 
								 | 
							
								/* sg-ext & sg-meter app need sg app. */
							 | 
						||
| 
								 | 
							
								#ifdef IOT_SMART_GRID_ENABLE
							 | 
						||
| 
								 | 
							
								#undef IOT_SMART_GRID_ENABLE
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_ENABLE           1
							 | 
						||
| 
								 | 
							
								#define IOT_SG_EXT_SDK_ENABLE           1
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_SG_EXT_SDK_ENABLE           0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#if (IOT_SG_CONTROLLER_ENABLE && (TARGET_VERSION != TARGET_KUNLUN3))
							 | 
						||
| 
								 | 
							
								/* enable expanded IO functions */
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_ENABLE             1
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_MCP23017_ENABLE    1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_11_BRM)
							 | 
						||
| 
								 | 
							
								#ifdef IOT_SMART_GRID_ENABLE
							 | 
						||
| 
								 | 
							
								#undef IOT_SMART_GRID_ENABLE
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#ifdef IOT_SG_EXT_SDK_ENABLE
							 | 
						||
| 
								 | 
							
								#undef IOT_SG_EXT_SDK_ENABLE
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_ENABLE           1
							 | 
						||
| 
								 | 
							
								#define IOT_SG_EXT_SDK_ENABLE           1
							 | 
						||
| 
								 | 
							
								/* enable/disable brm app */
							 | 
						||
| 
								 | 
							
								#define IOT_BRM_ENABLE                  1
							 | 
						||
| 
								 | 
							
								/* enable extend io device */
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_ENABLE             1
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_TPT29555_ENABLE    1
							 | 
						||
| 
								 | 
							
								#define IOT_BRM_DEVADP_ENABLE           0
							 | 
						||
| 
								 | 
							
								#define IOT_BRM_PPM_PING_ENABLE         1
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_BRM_ENABLE                  0
							 | 
						||
| 
								 | 
							
								#define IOT_BRM_DEVADP_ENABLE           0
							 | 
						||
| 
								 | 
							
								#define IOT_BRM_PPM_PING_ENABLE         0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* bsrm mode */
							 | 
						||
| 
								 | 
							
								#define IOT_BSRM_MODE_DEFAULT           1
							 | 
						||
| 
								 | 
							
								#define IOT_BSRM_MODE_CUS_APP           2
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_14_BSRM)
							 | 
						||
| 
								 | 
							
								#ifdef IOT_BSRM_MODE
							 | 
						||
| 
								 | 
							
								#undef IOT_BSRM_MODE
							 | 
						||
| 
								 | 
							
								#endif /* IOT_BSRM_MODE */
							 | 
						||
| 
								 | 
							
								#define IOT_BSRM_MODE                   IOT_BSRM_MODE_DEFAULT
							 | 
						||
| 
								 | 
							
								#endif /* (IOT_APP_SELECTION == IOT_APP_DEF_14_BSRM) */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_16_BSRM_CUS_APP)
							 | 
						||
| 
								 | 
							
								#ifdef IOT_BSRM_MODE
							 | 
						||
| 
								 | 
							
								#undef IOT_BSRM_MODE
							 | 
						||
| 
								 | 
							
								#endif /* IOT_BSRM_MODE */
							 | 
						||
| 
								 | 
							
								#define IOT_BSRM_MODE                   IOT_BSRM_MODE_CUS_APP
							 | 
						||
| 
								 | 
							
								#endif /* (IOT_APP_SELECTION == IOT_APP_DEF_16_BSRM_CUS_APP) */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef IOT_BSRM_MODE
							 | 
						||
| 
								 | 
							
								#ifdef IOT_SMART_GRID_ENABLE
							 | 
						||
| 
								 | 
							
								#undef IOT_SMART_GRID_ENABLE
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#ifdef IOT_SG_EXT_SDK_ENABLE
							 | 
						||
| 
								 | 
							
								#undef IOT_SG_EXT_SDK_ENABLE
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#if (IOT_BSRM_MODE == IOT_BSRM_MODE_DEFAULT)
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_ENABLE           0
							 | 
						||
| 
								 | 
							
								#define IOT_SG_EXT_SDK_ENABLE           0
							 | 
						||
| 
								 | 
							
								#elif (IOT_BSRM_MODE == IOT_BSRM_MODE_CUS_APP)
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_ENABLE           1
							 | 
						||
| 
								 | 
							
								#define IOT_SG_EXT_SDK_ENABLE           1
							 | 
						||
| 
								 | 
							
								#endif /* (IOT_BSRM_MODE == IOT_BSRM_MODE_DEFAULT) */
							 | 
						||
| 
								 | 
							
								#else /* IOT_BSRM_MODE */
							 | 
						||
| 
								 | 
							
								#define IOT_BSRM_MODE                   0
							 | 
						||
| 
								 | 
							
								#endif /* IOT_BSRM_MODE */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_20_SUNSOLAR)
							 | 
						||
| 
								 | 
							
								#ifdef IOT_SMART_GRID_ENABLE
							 | 
						||
| 
								 | 
							
								#undef IOT_SMART_GRID_ENABLE
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#ifdef IOT_SG_EXT_SDK_ENABLE
							 | 
						||
| 
								 | 
							
								#undef IOT_SG_EXT_SDK_ENABLE
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_ENABLE           1
							 | 
						||
| 
								 | 
							
								#define IOT_SG_EXT_SDK_ENABLE           1
							 | 
						||
| 
								 | 
							
								/* enable sunsolar APP */
							 | 
						||
| 
								 | 
							
								#define IOT_SUNSOLAR_APP_ENABLE         1
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_SUNSOLAR_APP_ENABLE         0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (IOT_APP_SELECTION == IOT_APP_DEF_21_HTBUS)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef IOT_SMART_GRID_ENABLE
							 | 
						||
| 
								 | 
							
								#undef IOT_SMART_GRID_ENABLE
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef PLC_NETWORK_SCALE
							 | 
						||
| 
								 | 
							
								#undef PLC_NETWORK_SCALE
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_SMART_GRID_ENABLE           0
							 | 
						||
| 
								 | 
							
								#define IOT_HTBUS_EN                    1
							 | 
						||
| 
								 | 
							
								/* define the supported network scale for htbus */
							 | 
						||
| 
								 | 
							
								#define PLC_NETWORK_SCALE               65
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#else /* IOT_APP_SELECTION == IOT_APP_DEF_21_HTBUS */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_HTBUS_EN                    0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/*app tput test*/
							 | 
						||
| 
								 | 
							
								#define IOT_TPUT_APP_ENABLE             0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_ENERGE_METER_ENABLE         0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_PLC_PHY_TX_PWR_REDUCE       0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_OS_MALLOC_DEBUG             0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* For external uart port definations. */
							 | 
						||
| 
								 | 
							
								#ifndef IOT_EXTERNAL_UART_PORT_ENABLE
							 | 
						||
| 
								 | 
							
								#define IOT_EXTERNAL_UART_PORT_ENABLE   0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* For rom patch definations. */
							 | 
						||
| 
								 | 
							
								#ifndef IOT_ROM_PATCH_ENABLE
							 | 
						||
| 
								 | 
							
								#define IOT_ROM_PATCH_ENABLE   0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* For virtual channel definations. */
							 | 
						||
| 
								 | 
							
								#ifndef INCLUDE_VIRTUAL_CHANNEL
							 | 
						||
| 
								 | 
							
								#define INCLUDE_VIRTUAL_CHANNEL         0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* For virtual uart port definations. */
							 | 
						||
| 
								 | 
							
								#if INCLUDE_VIRTUAL_CHANNEL
							 | 
						||
| 
								 | 
							
								#define IOT_VRITUAL_UART_PORT_ENABLE    1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* for phy tx long preamble */
							 | 
						||
| 
								 | 
							
								#ifndef IOT_TX_LONG_PREAMBLE_ENABLE
							 | 
						||
| 
								 | 
							
								#define IOT_TX_LONG_PREAMBLE_ENABLE     0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* APPLICAITON configuration end **********************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* TCPIP configuration start **************************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef IOT_LWIP_SUPPORT
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (HW_PLATFORM == HW_PLATFORM_SIMU)
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_SUPPORT                    0
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#if (PLC_SUPPORT_CCO_ROLE || (IOT_STA_CONTROL_MODE == IOT_STA_CONTROL_TYPE_STA))
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_SUPPORT                    0
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_SUPPORT                    0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#endif /* #if (HW_PLATFORM == HW_PLATFORM_SIMU) */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* #ifndef IOT_LWIP_SUPPORT */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if IOT_LWIP_SUPPORT
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* comment:
							 | 
						||
| 
								 | 
							
								*   if you want to set uart link network bridge into an ethernet network for L2
							 | 
						||
| 
								 | 
							
								* forward mode. you need to set the macro 'IOT_LWIP_NETIF_PLC_SUPPORT' to 0 and
							 | 
						||
| 
								 | 
							
								* 'IOT_LWIP_NETIF_UART_SUPPORT' to 1 , it will make the data from eth is
							 | 
						||
| 
								 | 
							
								* forwarded unconditionally to uart.
							 | 
						||
| 
								 | 
							
								*   if you want to use the PLC link network, please set the macro
							 | 
						||
| 
								 | 
							
								* 'IOT_LWIP_NETIF_PLC_SUPPORT' to 1.
							 | 
						||
| 
								 | 
							
								*/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* set to 1 to enable PLC link network interface support */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_NETIF_PLC_SUPPORT          1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* set to 1 to enable ethernet link network interface support */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_NETIF_ETH_SUPPORT          0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* set to 1 to enable uart link network interface support */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_NETIF_UART_SUPPORT         1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* set to 1 to enable MSVC PCAP network interface support */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_NETIF_MSVC_PCAP_SUPPORT    0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if IOT_LWIP_NETIF_PLC_SUPPORT
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* set to 1 if PLC link network interface should use ethernet header. this mode
							 | 
						||
| 
								 | 
							
								 * is uaually used in case ARP is required and PLC link network is bridged into
							 | 
						||
| 
								 | 
							
								 * an ethernet network for L2 forward mode.
							 | 
						||
| 
								 | 
							
								 * set to 0 if PLC link network interface is bridged into an ethernet network
							 | 
						||
| 
								 | 
							
								 * for L3 forward mode. in this case, ethernet header won'be used. and DHCP/ARP
							 | 
						||
| 
								 | 
							
								 * is not supported. mac address and ip address are mapped by TEI in plc link
							 | 
						||
| 
								 | 
							
								 * network locally.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_NETIF_PLC_ETH_SUPPORT      1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* set to 1 to enable DHCP client support */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_NETIF_PLC_DHCP_SUPPORT     0
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* set to 1 to bridge uart link into plc network */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_NETIF_PLC_UART_SUPPORT     IOT_LWIP_NETIF_UART_SUPPORT
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* set to 1 to bridge plc link into eth network */
							 | 
						||
| 
								 | 
							
								#if PLC_SUPPORT_CCO_ROLE
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_NETIF_PLC_TO_ETH_SUPPORT   1
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_NETIF_PLC_TO_ETH_SUPPORT   0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* IOT_LWIP_NETIF_PLC_SUPPORT */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* enable emac driver */
							 | 
						||
| 
								 | 
							
								#define IOT_ETH_ENABLE                      \
							 | 
						||
| 
								 | 
							
								    (IOT_LWIP_NETIF_PLC_TO_ETH_SUPPORT ||  \
							 | 
						||
| 
								 | 
							
								    IOT_LWIP_NETIF_PLC_SUPPORT || \
							 | 
						||
| 
								 | 
							
								    IOT_LWIP_NETIF_ETH_SUPPORT || \
							 | 
						||
| 
								 | 
							
								    IOT_LWIP_NETIF_UART_SUPPORT)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if IOT_LWIP_NETIF_UART_SUPPORT
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if (PLC_SUPPORT_CCO_ROLE && (!IOT_LWIP_NETIF_PLC_SUPPORT))
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* set to 1 to enable uart and eth to forward data to each other at L2 forward mode. */
							 | 
						||
| 
								 | 
							
								#define IOT_LWIP_UART_OVER_ETH_SUPPORT      1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_ETH_ENABLE                      1
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* (PLC_SUPPORT_CCO_ROLE && (!IOT_LWIP_NETIF_PLC_SUPPORT)) */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* IOT_LWIP_NETIF_UART_SUPPORT */
							 | 
						||
| 
								 | 
							
								#endif /* IOT_LWIP_SUPPORT */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#if IOT_DEMO_APP_ETH_SUPPORT && !IOT_LWIP_SUPPORT
							 | 
						||
| 
								 | 
							
								#define IOT_ETH_ENABLE                      1
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_CLI_INF_MODE_UART               0
							 | 
						||
| 
								 | 
							
								#define IOT_CLI_INF_MODE_LWIP_SOCKET        1
							 | 
						||
| 
								 | 
							
								#define IOT_CLI_INF_MODE_APP                2
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef IOT_CLI_INF_MODE
							 | 
						||
| 
								 | 
							
								#if IOT_LWIP_SUPPORT
							 | 
						||
| 
								 | 
							
								#define IOT_CLI_INF_MODE                    IOT_CLI_INF_MODE_LWIP_SOCKET
							 | 
						||
| 
								 | 
							
								#else
							 | 
						||
| 
								 | 
							
								#define IOT_CLI_INF_MODE                    IOT_CLI_INF_MODE_UART
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								#endif /* #ifndef IOT_CLI_INF_MODE */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* TCPIP configuration end ****************************************************/
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* enable/disable expanded IO functions */
							 | 
						||
| 
								 | 
							
								#ifndef IOT_EXT_GPIO_ENABLE
							 | 
						||
| 
								 | 
							
								#define IOT_EXT_GPIO_ENABLE                 0
							 | 
						||
| 
								 | 
							
								#endif /* IOT_EXT_GPIO_ENABLE */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/* extern lora device. if enable, the lora device will be supported */
							 | 
						||
| 
								 | 
							
								#ifndef IOT_CUS_PORT_LORA_ENABLE
							 | 
						||
| 
								 | 
							
								#define IOT_CUS_PORT_LORA_ENABLE            0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef IOT_CUS_PORT_BLE_ENABLE
							 | 
						||
| 
								 | 
							
								#define IOT_CUS_PORT_BLE_ENABLE             0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef IOT_CUS_PORT_ZIGBEE_ENABLE
							 | 
						||
| 
								 | 
							
								#define IOT_CUS_PORT_ZIGBEE_ENABLE          0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef IOT_CUS_PORT_ETH_ENABLE
							 | 
						||
| 
								 | 
							
								#define IOT_CUS_PORT_ETH_ENABLE             0
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#define IOT_CUS_APP_MULTI_PORTS (IOT_CUS_PORT_RF_ENABLE  || \
							 | 
						||
| 
								 | 
							
								    IOT_CUS_PORT_BLE_ENABLE || IOT_CUS_PORT_LORA_ENABLE || \
							 | 
						||
| 
								 | 
							
								    IOT_CUS_PORT_ZIGBEE_ENABLE || IOT_CUS_PORT_ETH_ENABLE)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifdef __cplusplus
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								#endif
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif /* PLC_CONFIG_API_H */
							 |