
#define NUCODEGEN_UART2_FUNCSEL_UART           0
#define NUCODEGEN_UART2_FUNCSEL_IrDA           2
#define NUCODEGEN_UART2_FUNCSEL_RS485          3
#define NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE    4

#define UART2_MATCH_ADDRSS1     0xC0
#define UART2_MATCH_ADDRSS2     0xA2
#define UART2_UNMATCH_ADDRSS1   0xB1
#define UART2_UNMATCH_ADDRSS2   0xD3

#define NUCODEGEN_UART2_CTS_HIGH_LEVEL_ACT    0
#define NUCODEGEN_UART2_CTS_LOW_LEVEL_ACT     1

#define NUCODEGEN_UART2_RTS_HIGH_LEVEL_ACT    0
#define NUCODEGEN_UART2_RTS_LOW_LEVEL_ACT     1

#define NUCODEGEN_UART2_RS485_ADD_MODE        0
#define NUCODEGEN_UART2_RS485_NMM_MODE        1

#define NUCODEGEN_UART2_DISABLE_DATA_WAKEUP          0
#define NUCODEGEN_UART2_INCOMING_DATA_WAKEUP         1
#define NUCODEGEN_UART2_FIFO_THRESHOLD_WAKEUP        2

<! clock:  {"ALL" : "UART2" }; !>

<! pin:   {"UART2FunctionRadio":{ "NUCODEGEN_UART2_FUNCSEL_UART":        ["UART2_TXD","UART2_RXD"],
                                  "NUCODEGEN_UART2_FUNCSEL_IrDA":        ["UART2_TXD","UART2_RXD"],
                                  "NUCODEGEN_UART2_FUNCSEL_RS485":       ["UART2_TXD","UART2_RXD","UART2_nRTS"],
                                  "NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE": ["UART2_RXD"]
                                  },
           "UART2AutoflowControlCheckbox":{"1":["UART2_nCTS","UART2_nRTS"]
           }
        }; !>

#define NUCODEGEN_UART2_FUNCSEL_SEL     (<!id:UART2FunctionRadio;
                                        type:radio;
                                        label:UART2 Function Select;
                                        data:NUCODEGEN_UART2_FUNCSEL_UART;
                                        default:NUCODEGEN_UART2_FUNCSEL_UART;
                                        helper:;
                                        sort:false;
                                        enum:[NUCODEGEN_UART2_FUNCSEL_UART, NUCODEGEN_UART2_FUNCSEL_IrDA, NUCODEGEN_UART2_FUNCSEL_RS485, NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE];
                                        optionLabels:[UART, IrDA, RS485, Single Wire];
                                        vertical:false;
                                        dependencies:none;
                                        dependenciesOption:none;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#if (NUCODEGEN_UART2_FUNCSEL_SEL == NUCODEGEN_UART2_FUNCSEL_UART)

#define NUCODEGEN_UART2_BAUDRATE       (<!id:UART2Baudrateinteger;
                                        type:integer;
                                        label:UART2 Baud Rate ( 2400 bps ~ 1000000 bps );
                                        data:115200;
                                        default:115200;
                                        helper:Enter your UART2 baud rate.If the "data wake-up" function is enabled, the baud rate setting is invalid,
                                               and it will be set to a defined value.;
                                        sort:false;
                                        minimum:2400;
                                        maximum:1000000;
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_UART;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#define NUCODEGEN_UART2_LINE_CONFIG     (<!id:UART2SetLineConfigCheckbox;
                                        type:checkbox;
                                        label:Config UART2 Line Setting;
                                        data:0;
                                        default:0;
                                        sort:false;
                                        enum:[1];
                                        optionLabels:[Enable Config UART2 Line Setting];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_UART;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#define NUCODEGEN_UART2_WORD_LEN       (<!id:UART2WordLengthSelect;
                                        type:select;
                                        label:UART2 Word Length;
                                        data:UART_WORD_LEN_8;
                                        default:UART_WORD_LEN_8;
                                        helper:;
                                        sort:false;
                                        enum:[UART_WORD_LEN_5, UART_WORD_LEN_6, UART_WORD_LEN_7, UART_WORD_LEN_8];
                                        optionLabels:[5 bits, 6 bits, 7 bits, 8 bits];
                                        dependencies:UART2SetLineConfigCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#define NUCODEGEN_UART2_PARITY          (<!id:UART2ParityBitSelect;
                                        type:select;
                                        label:UART2 Parity Bit;
                                        data:UART_PARITY_NONE;
                                        default:UART_PARITY_NONE;
                                        helper:;
                                        sort:false;
                                        enum:[UART_PARITY_NONE, UART_PARITY_ODD, UART_PARITY_EVEN, UART_PARITY_MARK, UART_PARITY_SPACE];
                                        optionLabels:[None, Odd, Even, Mark, Space];
                                        dependencies:UART2SetLineConfigCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#define NUCODEGEN_UART2_STOP_BIT        (<!id:UART2StopBitSelect;
                                        type:select;
                                        label:UART2 Stop Bits;
                                        data:UART_STOP_BIT_1;
                                        default:UART_STOP_BIT_1;
                                        helper:;
                                        sort:false;
                                        enum:[UART_STOP_BIT_1, UART_STOP_BIT_1_5, UART_STOP_BIT_2];
                                        optionLabels:[1, 1.5 (for Word Length 5 bits), 2 (for Word Length 6-8 bits)];
                                        dependencies:UART2SetLineConfigCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#define NUCODEGEN_UART2_AUTOFLOW_EN     (<!id:UART2AutoflowControlCheckbox;
                                        type:checkbox;
                                        label:UART2 Auto-flow Control;
                                        data:0;
                                        default:0;
                                        sort:false;
                                        enum:[1];
                                        optionLabels:[Enable Auto-flow Control];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_UART;
                                        groupId:UART2AutoFlow;
                                        groupName:Auto flow Configuration;!>)

#define NUCODEGEN_UART2_RTSACTLV_LOW    (<!id:UART2RTSACTLVLevelSelect;
                                        type:select;
                                        label:nRTS pin output active level;
                                        data:NUCODEGEN_UART2_RTS_HIGH_LEVEL_ACT;
                                        default:NUCODEGEN_UART2_RTS_HIGH_LEVEL_ACT;
                                        enum:[NUCODEGEN_UART2_RTS_HIGH_LEVEL_ACT,NUCODEGEN_UART2_RTS_LOW_LEVEL_ACT];
                                        optionLabels:[High level,Low level];
                                        dependencies:UART2AutoflowControlCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2AutoFlow;
                                        groupName:Auto flow Configuration;!>)

#define NUCODEGEN_UART2_CTSACTLV_LOW    (<!id:UART2CTSACTLVLevelSelect;
                                        type:select;
                                        label:nCTS pin input active level;
                                        data:NUCODEGEN_UART2_CTS_HIGH_LEVEL_ACT;
                                        default:NUCODEGEN_UART2_CTS_HIGH_LEVEL_ACT;
                                        enum:[NUCODEGEN_UART2_CTS_HIGH_LEVEL_ACT,NUCODEGEN_UART2_CTS_LOW_LEVEL_ACT];
                                        optionLabels:[High level,Low level];
                                        dependencies:UART2AutoflowControlCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2AutoFlow;
                                        groupName:Auto flow Configuration;!>)

#define NUCODEGEN_UART2_FIFO_RTSTRGLV   (<!id:UART2RTSTriggerLevelSelect;
                                        type:select;
                                        label:nRTS Trigger Level for Auto-flow Control;
                                        data:UART_FIFO_RTSTRGLV_1BYTE;
                                        default:UART_FIFO_RTSTRGLV_1BYTE;
                                        helper:;
                                        sort:false;
                                        enum:[UART_FIFO_RTSTRGLV_1BYTE, UART_FIFO_RTSTRGLV_4BYTES, UART_FIFO_RTSTRGLV_8BYTES, UART_FIFO_RTSTRGLV_14BYTES];
                                        optionLabels:[1 byte, 4 bytes, 8 bytes, 14 bytes];
                                        dependencies:UART2AutoflowControlCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2AutoFlow;
                                        groupName:Auto flow Configuration;!>)

#define NUCODEGEN_UART2_MODEMINT_EN     <!id:UART2ModemINTSelect;
                                        type:select;
                                        label:Modem Status Interrupt Control;
                                        data:0;
                                        default:0;
                                        helper:Vector:UART2_IRQHandler;
                                        enum:[0,1];
                                        optionLabels:[Disable Interrupt, Enable Interrupt];
                                        vertical:true;
                                        dependencies:UART2AutoflowControlCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2AutoFlow;
                                        groupName:Auto flow Configuration;!>

#define NUCODEGEN_UART2_ABRD_EN         <!id:UART2AutoBaudrateCheckbox;
                                        type:checkbox;
                                        label:Automatic Baud Rate Detection;
                                        data:0;
                                        default:0;
                                        helper: The input pattern shall be 0x01.;
                                        enum:[1];
                                        optionLabels:[Enable Automatic Baud Rate Detection];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_UART;
                                        groupId:UART2AutoBaudRate;
                                        groupName:Auto Baud Rate Configuration;!>

#define NUCODEGEN_UART2_ABRDINT_EN      (<!id:UART2AutoBaudRateDetectINTSelect;
                                        type:select;
                                        label:Automatic Baud Rate Detection Interrupt;
                                        data:0;
                                        default:0;
                                        helper:Vector:UART2_IRQHandler;
                                        enum:[0,1];
                                        optionLabels:[Disable Interrupt, Enable Interrupt];
                                        dependencies:UART2AutoBaudrateCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2AutoBaudRate;
                                        groupName:Auto Baud Rate Configuration;!>)

#define NUCODEGEN_UART2_PDMA_EN         (<!id:UART2PDMACheckbox;
                                        type:checkbox;
                                        label:PDMA Channel Control;
                                        data:0;
                                        default:0;
                                        sort:false;
                                        enum:[1];
                                        optionLabels:[Enable PDMA Channel];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_UART;
                                        groupId:UART2PDMA;
                                        groupName:PDMA Configuration;!>)

#define NUCODEGEN_UART2_PDMAEN_MASK      (<!id:UART2PDMASelectCheckbox;
                                        type:multipleselect;
                                        label:Channel Setting;
                                        data:0;
                                        default:0;
                                        helper:This setting only enables the UART to support the PDMA function. It is still necessary to set the required functions for the PDMA.;
                                        sort:false;
                                        enum:[UART_INTEN_TXPDMAEN_Msk,UART_INTEN_RXPDMAEN_Msk];
                                        optionLabels:[Enable TX PDMA,Enable RX PDMA];
                                        dependencies:UART2PDMACheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2PDMA;
                                        groupName:PDMA Configuration;!>)

#define NUCODEGEN_UART2_INT_EN          (<!id:UART2IntCheckbox;
                                        type:checkbox;
                                        label:UART2 Interrupt Control ;
                                        data:0;
                                        default:0;
                                        enum:[1];
                                        optionLabels:[Enable UART2 Interrupt];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_UART;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define NUCODEGEN_UART2_INT_MASK        (<!id:UART2INTMASKMultipleSelect;
                                        type:multipleselect;
                                        label:Select Interrupts;
                                        size:4;
                                        data:0;
                                        default:0;
                                        helper:If you would like to use the ' Transmit Holding Register Empty ' or ' Transmitter Empty ' Interrupt function ,you can add in code.
                                               Vector:UART2_IRQHandler;
                                        sort:false;
                                        enum:[UART_INTEN_RDAIEN_Msk, UART_INTEN_RLSIEN_Msk,UART_INTEN_RXTOIEN_Msk, UART_INTEN_BUFERRIEN_Msk];
                                        optionLabels:[Receive Data Available, Receive Line Status, RX Time-Out, Buffer Error];
                                        dependencies:UART2IntCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)


#define NUCODEGEN_UART2_TOCNT_EN       (<!id:UART2TimeoutCounterCheckbox;
                                        type:checkbox;
                                        label:Receive Buffer Timeout Control;
                                        data:0;
                                        default:0;
                                        sort:false;
                                        enum:[1];
                                        optionLabels:[Enable Receive Buffer Timeout];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_UART;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define  NUCODEGEN_UART2_TOCNT          (<!id:UART2TimeoutCountInteger;
                                        type:integer;
                                        label:Timeout Count Value Setting;
                                        data:40;
                                        default:40;
                                        helper:Enter your UART2 Timeout Interrupt Comparator(The counting clock is baud rate).
                                               In order to avoid receiver time-out interrupt generation immediately during one character is being received, Timeout count value should be set between 40 and 255.;
                                        minimum:40;
                                        maximum:255;
                                        dependencies:(UART2TimeoutCounterCheckbox | UART2TimeoutWakeupSelect);
                                        dependenciesOption:{"UART2TimeoutCounterCheckbox" : "1",
                                                            "UART2TimeoutWakeupSelect" : "1"};
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define NUCODEGEN_UART2_RFITL           (<!id:UART2RxFifoLevelSelect;
                                        type:select;
                                        label:RX FIFO Threshold Interrupt;
                                        data:UART_FIFO_RFITL_1BYTE;
                                        default:UART_FIFO_RFITL_1BYTE;
                                        helper:;
                                        sort:false;
                                        enum:[UART_FIFO_RFITL_1BYTE, UART_FIFO_RFITL_4BYTES, UART_FIFO_RFITL_8BYTES, UART_FIFO_RFITL_14BYTES];
                                        optionLabels:[1 byte, 4 bytes, 8 bytes, 14 bytes];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_UART;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define NUCODEGEN_UART2_WAKEUP_EN       (<!id:UART2WakeUpCheckbox;
                                        type:checkbox;
                                        label:Wake-up Function Control;
                                        data:0;
                                        default:0;
                                        helper:;
                                        enum:[1];
                                        optionLabels:[Enable Wake-up function];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_UART;
                                        groupId:UART2WakeUp;
                                        groupName:Wake Up Configuration;!>)

#define NUCODEGEN_UART2_WAKEUP_INT_EN   (<!id:UART2WakeUpINTSelect;
                                        type:select;
                                        label:Wake-up interrupt Control;
                                        data:0;
                                        default:0;
                                        helper:Vector:UART2_IRQHandler;
                                        enum:[0,1];
                                        optionLabels:[Disable Interrupt, Enable Interrupt];
                                        dependencies:UART2WakeUpCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2WakeUp;
                                        groupName:Wake Up Configuration;!>)

#define NUCODEGEN_UART2_WKCTS_EN       (<!id:UART2nCTSWakeupSelect;
                                       type:select;
                                       label:nCTS Pin Wake Up Control;
                                       data:0;
                                       default:0;
                                       enum:[0,1];
                                       optionLabels:[Disable,Enable];
                                       dependencies:[UART2AutoflowControlCheckbox,UART2WakeUpCheckbox,UART2DataWakeupTypeSelect];
                                       dependenciesOption:{"UART2AutoflowControlCheckbox":"1",
                                                           "UART2WakeUpCheckbox":"1",
                                                           "UART2DataWakeupTypeSelect":"NUCODEGEN_UART2_DISABLE_DATA_WAKEUP"
                                                           };
                                       groupId:UART2WakeUp;
                                       groupName:Wake Up Configuration;!>)

#define NUCODEGEN_UART2_DATA_WAKEUP_SEL   (<!id:UART2DataWakeupTypeSelect;
                                          type:select;
                                          label:UART2 Data Wake Up Select;
                                          data:NUCODEGEN_UART2_DISABLE_DATA_WAKEUP;
                                          default:NUCODEGEN_UART2_DISABLE_DATA_WAKEUP;
                                          helper:To use the "Incoming data wake-up" function, you must set the UART clock source as HIRC.(If HIRC is 48000000 hz, the wake-up time will take 10.67 us.)
                                          To use the "FIFO threshold wake-up" function, you must set the UART clock source as LXT.(The maximum baud rate is 9600 bps.);
                                          enum:[NUCODEGEN_UART2_DISABLE_DATA_WAKEUP,NUCODEGEN_UART2_INCOMING_DATA_WAKEUP,NUCODEGEN_UART2_FIFO_THRESHOLD_WAKEUP];
                                          optionLabels:[Disable Data Wake Up,Incoming Data Wake Up ,FIFO Threshold Wake Up];
                                          dependencies:UART2WakeUpCheckbox;
                                          dependenciesOption:1;
                                          groupId:UART2WakeUp;
                                          groupName:Wake Up Configuration;!>)

#define NUCODEGEN_UART2_WKTOUT_EN    (<!id:UART2TimeoutWakeupSelect;
                                      type:select;
                                      label:Received Data FIFO Threshold Time Out Wake Up Control;
                                      helper:To use this function, you must set the 'Timeout Count Value'.;
                                      data:0;
                                      default:0;
                                      enum:[0,1];
                                      optionLabels:[Disable,Enable];
                                      dependencies:UART2DataWakeupTypeSelect;
                                      dependenciesOption:NUCODEGEN_UART2_FIFO_THRESHOLD_WAKEUP;
                                      groupId:UART2WakeUp;
                                      groupName:Wake Up Configuration;!>)

#if (NUCODEGEN_UART2_MODEMINT_EN == 1 && NUCODEGEN_UART2_ABRDINT_EN == 1 && NUCODEGEN_UART2_WAKEUP_INT_EN == 1  )
  #define NUCODEGEN_UART2_INT_CONFIG_MASK   NUCODEGEN_UART2_INT_MASK | UART_INTEN_MODEMIEN_Msk |UART_INTEN_ABRIEN_Msk | UART_INTEN_WKIEN_Msk
#elif(NUCODEGEN_UART2_MODEMINT_EN == 1 && NUCODEGEN_UART2_ABRDINT_EN == 1 && NUCODEGEN_UART2_WAKEUP_INT_EN == 0  )
  #define NUCODEGEN_UART2_INT_CONFIG_MASK   NUCODEGEN_UART2_INT_MASK | UART_INTEN_MODEMIEN_Msk |UART_INTEN_ABRIEN_Msk 
#elif(NUCODEGEN_UART2_MODEMINT_EN == 0 && NUCODEGEN_UART2_ABRDINT_EN == 1 && NUCODEGEN_UART2_WAKEUP_INT_EN == 1  )
  #define NUCODEGEN_UART2_INT_CONFIG_MASK   NUCODEGEN_UART2_INT_MASK |UART_INTEN_ABRIEN_Msk | UART_INTEN_WKIEN_Msk
#elif(NUCODEGEN_UART2_MODEMINT_EN == 1 && NUCODEGEN_UART2_ABRDINT_EN == 0 && NUCODEGEN_UART2_WAKEUP_INT_EN == 1  )
  #define NUCODEGEN_UART2_INT_CONFIG_MASK   NUCODEGEN_UART2_INT_MASK |UART_INTEN_MODEMIEN_Msk| UART_INTEN_WKIEN_Msk
#else
 #if(NUCODEGEN_UART2_MODEMINT_EN == 1)
   #define  NUCODEGEN_UART2_INT_CONFIG_MASK   NUCODEGEN_UART2_INT_MASK | UART_INTEN_MODEMIEN_Msk
 #elif (NUCODEGEN_UART2_ABRDINT_EN == 1)
   #define  NUCODEGEN_UART2_INT_CONFIG_MASK   NUCODEGEN_UART2_INT_MASK | UART_INTEN_ABRIEN_Msk
 #elif ( NUCODEGEN_UART2_WAKEUP_INT_EN == 1)
   #define  NUCODEGEN_UART2_INT_CONFIG_MASK   NUCODEGEN_UART2_INT_MASK | UART_INTEN_WKIEN_Msk
 #else
   #define  NUCODEGEN_UART2_INT_CONFIG_MASK   NUCODEGEN_UART2_INT_MASK
 #endif
#endif

#elif (NUCODEGEN_UART2_FUNCSEL_SEL == NUCODEGEN_UART2_FUNCSEL_IrDA)

#define NUCODEGEN_UART2_IRDA_BAUDRATE   (<!id:UART2IRDABaudrateinteger;
                                        type:integer;
                                        label:UART2 IrDA Baud Rate ( 2400 bps ~ 115200 bps );
                                        data:9600;
                                        default:9600;
                                        helper:Enter your UART2 IRDA baud rate.;
                                        sort:false;
                                        minimum:2400;
                                        maximum:115200;
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_IrDA;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#define NUCODEGEN_UART2_IRDA_MODE       (<!id:UART2IrDAModeRadio;
                                        type:radio;
                                        label:IrDA Receiver/Transmitter Selection;
                                        data:UART_IRDA_RXEN;
                                        default:UART_IRDA_RXEN;
                                        sort:false;
                                        enum:[UART_IRDA_RXEN, UART_IRDA_TXEN];
                                        optionLabels:[Rx mode, Tx mode];
                                        vertical:false;
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_IrDA;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#define NUCODEGEN_UART2_IRDA_INT_EN     (<!id:UART2IRDAIntCheckbox;
                                        type:checkbox;
                                        label:UART2 IrDA Interrupt Control; 
                                        data:0;
                                        default:0;
                                        enum:[1];
                                        optionLabels:[Enable UART2 IrDA Interrupt];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_IrDA;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define NUCODEGEN_UART2_IRDA_INT_MASK   (<!id:UART2IRDAINTMASKMultipleSelect;
                                        type:multipleselect;
                                        label:Select Interrupts;
                                        size:2;
                                        data:0;
                                        default:0;
                                        helper:If you would like to use the ' Transmit Holding Register Empty ' or ' Transmitter Empty ' Interrupt function ,you can add in code.
                                               Vector:UART2_IRQHandler;
                                        sort:false;
                                        enum:[UART_INTEN_RDAIEN_Msk, UART_INTEN_RXTOIEN_Msk];
                                        optionLabels:[Receive Data Available, RX Time-Out];
                                        dependencies:UART2IRDAIntCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#elif (NUCODEGEN_UART2_FUNCSEL_SEL == NUCODEGEN_UART2_FUNCSEL_RS485)

#define NUCODEGEN_UART2_RS485_BAUDRATE  (<!id:UART2RS485Baudrateinteger;
                                        type:integer;
                                        label:UART2 RS485 Baud Rate(2400 bps ~ 1000000 bps);
                                        data:115200;
                                        default:115200;
                                        helper:Enter your UART2 RS485 baud rate.If the "data wake-up" function is enabled, the baud rate setting is invalid,
                                               and it will be set to a defined value.;
                                        minimum:2400;
                                        maximum:1000000;
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_RS485;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#define NUCODEGEN_UART2_RS485_MODE      (<!id:UART2RS485CTLRadio;
                                        type:radio;
                                        label:RS485 Operation Mode;
                                        data:NUCODEGEN_UART2_RS485_ADD_MODE;
                                        default:NUCODEGEN_UART2_RS485_ADD_MODE;
                                        enum:[NUCODEGEN_UART2_RS485_ADD_MODE, NUCODEGEN_UART2_RS485_NMM_MODE];
                                        optionLabels:[Auto Address Detection Operation Mode (AAD), Normal Multi-Drop Operation Mode (NMM) ];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_RS485;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#define NUCODEGEN_UART2_RS485_ADDRMV    (<!id:UART2RS485AddrMVInteger;
                                        type:integer;
                                        label:UART2 RS485 Address Match Value;
                                        data:0;
                                        default:0;
                                        helper:Enter your UART2 RS485 Address Match Value;
                                        minimum:0;
                                        maximum:255;
                                        dependencies:UART2RS485CTLRadio;
                                        dependenciesOption:NUCODEGEN_UART2_RS485_ADD_MODE;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>)

#define NUCODEGEN_UART2_RS485_INT_EN    (<!id:UART2RS485IntCheckbox;
                                        type:checkbox;
                                        label:UART2 RS485 Interrupt Control;
                                        data:0;
                                        default:0;
                                        enum:[1];
                                        optionLabels:[Enable UART2 RS485 Interrupt];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_RS485;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define NUCODEGEN_UART2_RS485_INT_MASK  (<!id:UART2RS485INTMASKMultipleSelect;
                                        type:multipleselect;
                                        label:Select Interrupts;
                                        size:4;
                                        data:0;
                                        default:0;
                                        helper:If you would like to use the ' Transmit Holding Register Empty ' or ' Transmitter Empty ' Interrupt function ,you can add in code.;
                                        sort:false;
                                        enum:[UART_INTEN_RDAIEN_Msk, UART_INTEN_RLSIEN_Msk, UART_INTEN_RXTOIEN_Msk, UART_INTEN_BUFERRIEN_Msk];
                                        optionLabels:[Receive Data Available, Receive Line Status, RX Time-Out, Buffer Error];
                                        dependencies:UART2RS485IntCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define NUCODEGEN_UART2_TOCNT_EN       (<!id:UART2RS485TimeoutCounterCheckbox;
                                        type:checkbox;
                                        label:Receive Buffer Timeout Control;
                                        data:0;
                                        default:0;
                                        sort:false;
                                        enum:[1];
                                        optionLabels:[Enable Receive Buffer Timeout];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_RS485;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define  NUCODEGEN_UART2_TOCNT          (<!id:UART2RS485TimeoutCountInteger;
                                        type:integer;
                                        label:Timeout Count Value Setting;
                                        data:40;
                                        default:40;
                                        helper:Enter your UART2 Timeout Interrupt Comparator(The counting clock is baud rate).
                                               In order to avoid receiver time-out interrupt generation immediately during one character is being received, Timeout count value should be set between 40 and 255.;
                                        minimum:40;
                                        maximum:255;
                                        dependencies:(UART2RS485TimeoutCounterCheckbox | UART2RS485TimeoutWakeupSelect);
                                        dependenciesOption:{"UART2RS485TimeoutCounterCheckbox" : "1",
                                                            "UART2RS485TimeoutWakeupSelect" : "1"};
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define NUCODEGEN_UART2_RFITL           (<!id:UART2RS485RxFifoLevelSelect;
                                        type:select;
                                        label:RX FIFO Threshold Interrupt;
                                        data:UART_FIFO_RFITL_1BYTE;
                                        default:UART_FIFO_RFITL_1BYTE;
                                        helper:;
                                        sort:false;
                                        enum:[UART_FIFO_RFITL_1BYTE, UART_FIFO_RFITL_4BYTES, UART_FIFO_RFITL_8BYTES, UART_FIFO_RFITL_14BYTES];
                                        optionLabels:[1 byte, 4 bytes, 8 bytes, 14 bytes];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_RS485;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define NUCODEGEN_UART2_WAKEUP_EN       (<!id:UART2RS485WakeUpCheckbox;
                                        type:checkbox;
                                        label:Wake-up Function Control;
                                        data:0;
                                        default:0;
                                        helper:;
                                        enum:[1];
                                        optionLabels:[Enable Wake-up function];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_RS485;
                                        groupId:UART2WakeUp;
                                        groupName:Wake Up Configuration;!>)

#define NUCODEGEN_UART2_WAKEUP_INT_EN   (<!id:UART2RS485WakeUpINTSelect;
                                        type:select;
                                        label:Wake-up interrupt Control;
                                        data:0;
                                        default:0;
                                        helper:Vector:UART2_IRQHandler;
                                        enum:[0,1];
                                        optionLabels:[Disable Interrupt, Enable Interrupt];
                                        dependencies:UART2RS485WakeUpCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2WakeUp;
                                        groupName:Wake Up Configuration;!>)

#define NUCODEGEN_UART2_WKRS485_EN      <!id:UART2RS485ADDMWakeUpSelect;
                                        type:select;
                                        label:UART2 RS485 Address Match Wake-up Control;
                                        data:0;
                                        default:0;
                                        helper:To use this function, you must set the UART clock source as LXT.(The maximum baud rate is 9600 bps);
                                        enum:[0,1];
                                        optionLabels:[Disable, Enable];
                                        dependencies:[UART2RS485CTLRadio,UART2RS485WakeUpCheckbox];
                                        dependenciesOption:{"UART2RS485CTLRadio" : "NUCODEGEN_UART2_RS485_ADD_MODE",
                                                             "UART2RS485WakeUpCheckbox" : "1" };
                                        groupId:UART2WakeUp;
                                        groupName:Wake Up Configuration;!>

#define NUCODEGEN_UART2_WKRFRT_EN     (<!id:UART2RS485ThresholdWakeupSelect;
                                      type:select;
                                      label:Received Data FIFO Threshold Wake Up Control;
                                      data:0;
                                      default:0;
                                      helper:To use this function, you must set the UART clock source as LXT.(The maximum baud rate is 9600 bps);
                                      enum:[0,1];
                                      optionLabels:[Disable,Enable];
                                      dependencies:UART2RS485WakeUpCheckbox;
                                      dependenciesOption:1;
                                      groupId:UART2WakeUp;
                                      groupName:Wake Up Configuration;!>)

#define NUCODEGEN_UART2_WKTOUT_EN    (<!id:UART2RS485TimeoutWakeupSelect;
                                      type:select;
                                      label:Received Data FIFO Threshold Time Out Wake Up Control;
                                      helper:To use this function, you must set the 'Timeout Count Value'.;
                                      data:0;
                                      default:0;
                                      enum:[0,1];
                                      optionLabels:[Disable,Enable];
                                      dependencies:UART2RS485ThresholdWakeupSelect;
                                      dependenciesOption:1;
                                      groupId:UART2WakeUp;
                                      groupName:Wake Up Configuration;!>)

#if (NUCODEGEN_UART2_WAKEUP_INT_EN == 1)
  #define NUCODEGEN_UART2_RS485_INT_CONFIG_MASK   NUCODEGEN_UART2_RS485_INT_MASK | UART_INTEN_WKIEN_Msk
#else
  #define NUCODEGEN_UART2_RS485_INT_CONFIG_MASK   NUCODEGEN_UART2_RS485_INT_MASK
#endif

#elif (NUCODEGEN_UART2_FUNCSEL_SEL == NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE)
#define NUCODEGEN_UART2_SW_BAUD         <!id:UART2SWBaudrateinteger;
                                        type:integer;
                                        label:UART2 Single-wire Baud Rate ( 2400 bps ~ 1000000 bps );
                                        data:115200;
                                        default:115200;
                                        helper:Enter your UART2 Single-wire baud rate.If the "data wake-up" function is enabled, the baud rate setting is invalid,
                                               and it will be set to a defined value.;
                                        sort:false;
                                        minimum:2400;
                                        maximum:1000000;
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE;
                                        groupId:UART2Basic;
                                        groupName:Basic Configuration;!>

#define NUCODEGEN_UART2_ABRD_EN          <!id:UART2SWAutoBaudrateCheckbox;
                                        type:checkbox;
                                        label:Automatic Baud Rate Detection;
                                        data:0;
                                        default:0;
                                        helper: The input pattern shall be 0x01.;
                                        enum:[1];
                                        optionLabels:[Enable Automatic Baud Rate Detection];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE;
                                        groupId:UART2AutoBaudRate;
                                        groupName:Auto Baud Rate Configuration;!>

#define NUCODEGEN_UART2_ABRDINT_EN      (<!id:UART2SWAutoBaudRateDetectINTSelect;
                                        type:select;
                                        label:Automatic Baud Rate Detection Interrupt;
                                        data:0;
                                        default:0;
                                        helper:Vector:UART2_IRQHandler;
                                        enum:[0,1];
                                        optionLabels:[Disable Interrupt, Enable Interrupt];
                                        dependencies:UART2SWAutoBaudrateCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2AutoBaudRate;
                                        groupName:Auto Baud Rate Configuration;!>)

#define NUCODEGEN_UART2_PDMA_EN          <!id:UART2SWPDMACheckbox;
                                        type:checkbox;
                                        label:PDMA Channel Control;
                                        data:0;
                                        default:0;
                                        sort:false;
                                        enum:[1];
                                        optionLabels:[Enable PDMA Channel];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE;
                                        groupId:UART2PDMA;
                                        groupName:PDMA Configuration;!>
                                        
                                        
#define NUCODEGEN_UART2_PDMAEN_MASK     <!id:UART2SWPDMASelectCheckbox;
                                        type:select;
                                        label:Channel Select;
                                        data:0;
                                        default:0;
                                        helper:This setting only enables the UART to support the PDMA function. It is still necessary to set the required functions for the PDMA.;
                                        sort:false;
                                        enum:[UART_INTEN_TXPDMAEN_Msk,UART_INTEN_RXPDMAEN_Msk];
                                        optionLabels:[Enable TX PDMA,Enable RX PDMA];
                                        dependencies:UART2SWPDMACheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2PDMA;    
                                        groupName:PDMA Configuration;!>
                                        
#define NUCODEGEN_UART2_SW_INT_EN       <!id:UART2SWIntCheckbox;
                                        type:checkbox;
                                        label:UART2 Single-wire Interrupt Control;
                                        data:0;
                                        default:0;
                                        enum:[1];
                                        optionLabels:[Enable UART2 Single-wire Interrupt];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>

#define NUCODEGEN_UART2_SW_INT_MASK     <!id:UART2SWINT1MASKMultipleSelect;
                                        type:multipleselect;
                                        label:Select Interrupts;
                                        size:5;
                                        data:0;
                                        default:0;
                                        helper:If you would like to use the ' Transmit Holding Register Empty ' or ' Transmitter Empty ' Interrupt function ,you can add in code.
                                               Vector:UART2_IRQHandler;
                                        sort:false;
                                        enum:[UART_INTEN_RDAIEN_Msk, UART_INTEN_RLSIEN_Msk, UART_INTEN_RXTOIEN_Msk, UART_INTEN_BUFERRIEN_Msk,UART_INTEN_SWBEIEN_Msk];
                                        optionLabels:[Receive Data Available, Receive Line Status, RX Time-Out, Buffer Error, Single-wire Bit Error Detection];
                                        dependencies:UART2SWIntCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>

#define NUCODEGEN_UART2_TOCNT_EN         (<!id:UART2SWTimeoutCounterCheckbox;
                                        type:checkbox;
                                        label:Receive Buffer Timeout Control;
                                        data:0;
                                        default:0;
                                        sort:false;
                                        enum:[1];
                                        optionLabels:[Enable Receive Buffer Timeout];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define  NUCODEGEN_UART2_TOCNT          (<!id:UART2SWTimeoutCountInteger;
                                        type:integer;
                                        label:Timeout Count Value Setting;
                                        data:40;
                                        default:40;
                                        helper:Enter your UART2 Timeout Interrupt Comparator(The counting clock is baud rate).
                                               In order to avoid receiver time-out interrupt generation immediately during one character is being received, Timeout count value should be set between 40 and 255.;
                                        minimum:40;
                                        maximum:255;
                                        dependencies:(UART2SWTimeoutCounterCheckbox | UART2SWTimeoutWakeupSelect);
                                        dependenciesOption:{"UART2SWTimeoutCounterCheckbox" : "1",
                                                            "UART2SWTimeoutWakeupSelect" : "1"};
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define NUCODEGEN_UART2_RFITL           (<!id:UART2SWRxFifoLevelSelect;
                                        type:select;
                                        label:RX FIFO Threshold Interrupt;
                                        data:UART_FIFO_RFITL_1BYTE;
                                        default:UART_FIFO_RFITL_1BYTE;
                                        helper:;
                                        sort:false;
                                        enum:[UART_FIFO_RFITL_1BYTE, UART_FIFO_RFITL_4BYTES, UART_FIFO_RFITL_8BYTES, UART_FIFO_RFITL_14BYTES];
                                        optionLabels:[1 byte, 4 bytes, 8 bytes, 14 bytes];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE;
                                        groupId:UART2Interrupt;
                                        groupName:Interrupt Configuration;!>)

#define NUCODEGEN_UART2_WAKEUP_EN       (<!id:UART2SWWakeUpCheckbox;
                                        type:checkbox;
                                        label:Wake-up Function Control;
                                        data:0;
                                        default:0;
                                        helper:;
                                        enum:[1];
                                        optionLabels:[Enable Wake-up function];
                                        dependencies:UART2FunctionRadio;
                                        dependenciesOption:NUCODEGEN_UART2_FUNCSEL_SINGLE_WIRE;
                                        groupId:UART2WakeUp;
                                        groupName:Wake Up Configuration;!>)

#define NUCODEGEN_UART2_WAKEUP_INT_EN   (<!id:UART2SWWakeUpINTSelect;
                                        type:select;
                                        label:Wake-up interrupt Control;
                                        data:0;
                                        default:0;
                                        helper:Vector:UART2_IRQHandler;
                                        enum:[0,1];
                                        optionLabels:[Disable Interrupt, Enable Interrupt];
                                        dependencies:UART2SWWakeUpCheckbox;
                                        dependenciesOption:1;
                                        groupId:UART2WakeUp;
                                        groupName:Wake Up Configuration;!>)

#define NUCODEGEN_UART2_DATA_WAKEUP_SEL   (<!id:UART2SWDataWakeupTypeSelect;
                                          type:select;
                                          label:UART2 Data Wake Up Select;
                                          data:NUCODEGEN_UART2_DISABLE_DATA_WAKEUP;
                                          default:NUCODEGEN_UART2_DISABLE_DATA_WAKEUP;
                                          helper:To use the "Incoming data wake-up" function, you must set the UART clock source as HIRC.(If HIRC is 48000000 hz, the wake-up time will take 10.67 us.)
                                          To use the "FIFO threshold wake-up" function, you must set the UART clock source as LXT.(The maximum baud rate is 9600 bps.);
                                          enum:[NUCODEGEN_UART2_DISABLE_DATA_WAKEUP,NUCODEGEN_UART2_INCOMING_DATA_WAKEUP,NUCODEGEN_UART2_FIFO_THRESHOLD_WAKEUP];
                                          optionLabels:[Disable Data Wake-up,Incoming Data Wake-up ,FIFO Threshold Wake-up];
                                          dependencies:UART2SWWakeUpCheckbox;
                                          dependenciesOption:1;
                                          groupId:UART2WakeUp;
                                          groupName:Wake Up Configuration;!>)

#define NUCODEGEN_UART2_WKTOUT_EN    (<!id:UART2SWTimeoutWakeupSelect;
                                      type:select;
                                      label:Received Data FIFO Threshold Time Out Wake Up Control;
                                      helper:To use this function, you must set the 'Timeout Count Value'.;
                                      data:0;
                                      default:0;
                                      enum:[0,1];
                                      optionLabels:[Disable,Enable];
                                      dependencies:UART2SWDataWakeupTypeSelect;
                                      dependenciesOption:NUCODEGEN_UART2_FIFO_THRESHOLD_WAKEUP;
                                      groupId:UART2WakeUp;
                                      groupName:Wake Up Configuration;!>)

#if ( NUCODEGEN_UART2_ABRDINT_EN == 1 && NUCODEGEN_UART2_WAKEUP_INT_EN == 1  )
  #define NUCODEGEN_UART2_SW_INT_CONFIG_MASK   NUCODEGEN_UART2_SW_INT_MASK | UART_INTEN_ABRIEN_Msk | UART_INTEN_WKIEN_Msk
#elif( NUCODEGEN_UART2_ABRDINT_EN == 1 && NUCODEGEN_UART2_WAKEUP_INT_EN == 0  )
  #define NUCODEGEN_UART2_SW_INT_CONFIG_MASK   NUCODEGEN_UART2_SW_INT_MASK | UART_INTEN_ABRIEN_Msk 
#elif( NUCODEGEN_UART2_ABRDINT_EN == 0 && NUCODEGEN_UART2_WAKEUP_INT_EN == 1  )
  #define NUCODEGEN_UART2_SW_INT_CONFIG_MASK   NUCODEGEN_UART2_SW_INT_MASK | UART_INTEN_WKIEN_Msk
#else
  #define NUCODEGEN_UART2_SW_INT_CONFIG_MASK   NUCODEGEN_UART2_SW_INT_MASK
#endif

#endif



