<!filter:{
            "M252_C":{"SYS_VREF_OPTION_SUPPORT" :"0"},
            "M252_D":{"SYS_VREF_OPTION_SUPPORT" :"1"},
            "M252_E":{"SYS_VREF_OPTION_SUPPORT" :"1"},
            "M252_G":{"SYS_VREF_OPTION_SUPPORT" :"1"},
            "M256_D":{"SYS_VREF_OPTION_SUPPORT" :"1"},
            "M258_E":{"SYS_VREF_OPTION_SUPPORT" :"1"},
            "M258_G":{"SYS_VREF_OPTION_SUPPORT" :"1"}
        };
!>

/*--------------------------------------------------------------------------*/
/* SYS Configuration                                                        */
/*--------------------------------------------------------------------------*/
#define NUCODEGEN_SYS_LVREN_CONFIG              (<!id:SYS_LVRENRadio;
                                                    type:radio;
                                                    label:Enable LVR;
                                                    data:1;
                                                    default:1;
                                                    enum:[1,0];
                                                    optionLabels:[Enable, Disable];
                                                    dependencies:none;
                                                    dependenciesOption:none;
                                                    groupId:Group_LVRConfig;
                                                    groupName:Low-Voltage Detector (LVR) Configuration;
                                                !>)
#define NUCODEGEN_SYS_LVRDG_CONFIG              (<!id:SYS_LVRDGSelect;
                                                    type:select;
                                                    label:Select LVR De-glitch Time;
                                                    data:SYS_BODCTL_LVRDGSEL_0CLK;
                                                    default:SYS_BODCTL_LVRDGSEL_0CLK;
                                                    enum:[  SYS_BODCTL_LVRDGSEL_0CLK,  SYS_BODCTL_LVRDGSEL_4CLK,  SYS_BODCTL_LVRDGSEL_8CLK,   SYS_BODCTL_LVRDGSEL_16CLK,
                                                            SYS_BODCTL_LVRDGSEL_32CLK, SYS_BODCTL_LVRDGSEL_64CLK, SYS_BODCTL_LVRDGSEL_128CLK, SYS_BODCTL_LVRDGSEL_256CLK];
                                                    optionLabels:["Without de-glitch function", "4   MIRC clock, 1 us",  "8   MIRC clock, 2 us",  "16  MIRC clock, 4 us",
                                                                  "32  MIRC clock, 8 us",       "64  MIRC clock, 16 us", "128 MIRC clock, 32 us", "256 MIRC clock, 64 us"];
                                                    dependencies:SYS_LVRENRadio;
                                                    dependenciesOption:1;
                                                    groupId:Group_LVRConfig;
                                                    groupName:Low-Voltage Detector (LVR) Configuration;
                                                !>)
                                                
#define NUCODEGEN_SYS_BODEN_CONFIG              (<!id:SYS_BODENRadio;
                                                    type:radio;
                                                    label:Enable BOD;
                                                    data:1;
                                                    default:1;
                                                    enum:[1,0];
                                                    optionLabels:[Enable, Disable];
                                                    dependencies:none;
                                                    dependenciesOption:none;
                                                    groupId:Group_BODConfig;
                                                    groupName:Brown-Out Detector (BOD) Configuration;
                                                !>)
#define NUCODEGEN_SYS_BODVL_CONFIG              (<!id:SYS_BODVLSelect;
                                                    type:select;
                                                    label:Select BOD Voltage;
                                                    data:SYS_BODCTL_BODVL_1_8V;
                                                    default:SYS_BODCTL_BODVL_1_8V;
                                                    enum:[  SYS_BODCTL_BODVL_4_4V, SYS_BODCTL_BODVL_3_7V, SYS_BODCTL_BODVL_3_0V, SYS_BODCTL_BODVL_2_7V,
                                                            SYS_BODCTL_BODVL_2_4V, SYS_BODCTL_BODVL_2_0V, SYS_BODCTL_BODVL_1_8V];
                                                    optionLabels:[4.4V, 3.7V, 3.0V, 2.7V, 2.4V, 2.0V, 1.8V];
                                                    dependencies:SYS_BODENRadio;
                                                    dependenciesOption:1;
                                                    groupId:Group_BODConfig;
                                                !>)
#define NUCODEGEN_SYS_BODDG_CONFIG              (<!id:SYS_BODDGSelect;
                                                    type:select;
                                                    label:Select BOD De-glitch Time;
                                                    data:SYS_BODCTL_BODDGSEL_16CLK;
                                                    default:SYS_BODCTL_BODDGSEL_16CLK;
                                                    enum:[  SYS_BODCTL_BODDGSEL_0CLK,  SYS_BODCTL_BODDGSEL_4CLK,  SYS_BODCTL_BODDGSEL_8CLK,   SYS_BODCTL_BODDGSEL_16CLK,
                                                            SYS_BODCTL_BODDGSEL_32CLK, SYS_BODCTL_BODDGSEL_64CLK, SYS_BODCTL_BODDGSEL_128CLK, SYS_BODCTL_BODDGSEL_256CLK];
                                                    optionLabels:[BOD output is sample by LIRC, 4   system clock (HCLK),  8   system clock (HCLK),  16  system clock (HCLK),
                                                                  32  system clock (HCLK),      64  system clock (HCLK),  128 system clock (HCLK),  256 system clock (HCLK)];
                                                    dependencies:SYS_BODENRadio;
                                                    dependenciesOption:1;
                                                    groupId:Group_BODConfig;
                                                !>)
#define NUCODEGEN_SYS_BODRSTEN_CONFIG           (<!id:SYS_BODRSTENRadio;
                                                    type:select;
                                                    label:Enable BOD Reset Signal;
                                                    data:SYS_BODCTL_BOD_RST_EN;
                                                    default:SYS_BODCTL_BOD_RST_EN;
                                                    enum:[SYS_BODCTL_BOD_RST_EN, SYS_BODCTL_BOD_INTERRUPT_EN];
                                                    optionLabels:[Reset signal, Interrupt signal];
                                                    vertical:false;
                                                    dependencies:SYS_BODENRadio;
                                                    dependenciesOption:1;
                                                    groupId:Group_BODConfig;
                                                !>)
#define NUCODEGEN_SYS_BODLPM_CONFIG             (<!id:SYS_BODLPM1Select;
                                                    type:select;
                                                    label:Select BOD Power Mode;
                                                    data:0;
                                                    default:0;
                                                    helper:If BOD operates in low-power mode, user must enable LVR manually.;
                                                    enum:[0,1];
                                                    optionLabels:[Normal power mode, Low power mode];
                                                    vertical:false;
                                                    dependencies:[SYS_BODENRadio, SYS_LVRENRadio];
                                                    dependenciesOption:{"SYS_BODENRadio":"1", "SYS_LVRENRadio":"1"};
                                                    dependenciesDefault:false;
                                                    groupId:Group_BODConfig;
                                                !><!id:SYS_BODLPM2Select;
                                                    type:select;
                                                    label:Select BOD Power Mode;
                                                    data:0;
                                                    default:0;
                                                    helper:If BOD operates in low-power mode, user must enable LVR manually.;
                                                    enum:[0];
                                                    optionLabels:[Normal power mode];
                                                    vertical:false;
                                                    dependencies:[SYS_BODENRadio, SYS_LVRENRadio];
                                                    dependenciesOption:{"SYS_BODENRadio":"1", "SYS_LVRENRadio":"0"};
                                                    dependenciesDefault:false;
                                                    groupId:Group_BODConfig;
                                                !>)
#define NUCODEGEN_SYS_BOD_INT_ENABLE            (<!id:SYS_BODIntEnableCheckbox;
                                                    type:checkbox;
                                                    label:Enable BOD Interrupt;
                                                    data:1;
                                                    default:1;
                                                    helper:Vector: BOD_IRQHandler;
                                                    enum:[1];
                                                    optionLabels:[Enable Interrupt];
                                                    dependencies:SYS_BODENRadio;
                                                    dependenciesOption:1;
                                                    groupId:Group_BODConfig;
                                                !>)

#define NUCODEGEN_SYS_VREF_OPTION_SUPPORT       (<!id:SYS_VrefOptionSupportHidden0;
                                                    type:hidden;
                                                    data:0;
                                                    default:0;
                                                    observable:none;
                                                    listener:none;
                                                    dependencies:none;
                                                    dependenciesOption:none;
                                                    filterExp:SYS_VREF_OPTION_SUPPORT==0;
                                                    filterDefault:false;
                                                !><!id:SYS_VrefOptionSupportHidden1;
                                                    type:hidden;
                                                    data:1;
                                                    default:1;
                                                    observable:none;
                                                    listener:none;
                                                    dependencies:none;
                                                    dependenciesOption:none;
                                                    filterExp:SYS_VREF_OPTION_SUPPORT==1;
                                                    filterDefault:false;
                                                !>)

#if (NUCODEGEN_SYS_VREF_OPTION_SUPPORT)
#define NUCODEGEN_SYS_IVREN_ENABLE              (<!id:SYS_IVRENSelect;
                                                    type:select;
                                                    label:Select Reference Voltage;
                                                    data:0;
                                                    default:0;
                                                    enum:[1, 0];
                                                    optionLabels:[Internal voltage reference module, External voltage reference];
                                                    dependencies:none;
                                                    dependenciesOption:none;
                                                    groupId:Group_InternalVoltageReference;
                                                    groupName:Reference Voltage Configuration;
                                                    filterExp:SYS_VREF_OPTION_SUPPORT==1;
                                                    filterDefault:false;
                                                !>)

#define SYS_VREFCTL_IVRS_1_536_V                (0x00UL)
#define SYS_VREFCTL_IVRS_2_048_V                (0x01UL)
#define SYS_VREFCTL_IVRS_2_560_V                (0x02UL)
#define SYS_VREFCTL_IVRS_3_072_V                (0x03UL)
#define SYS_VREFCTL_IVRS_4_096_V                (0x04UL)

#define NUCODEGEN_SYS_IVRS_CONFIG               (<!id:SYS_IVRSSelect;
                                                    type:select;
                                                    label:Select Internal Voltage Reference Scale;
                                                    data:SYS_VREFCTL_IVRS_1_536_V;
                                                    default:SYS_VREFCTL_IVRS_1_536_V;
                                                    enum:[SYS_VREFCTL_IVRS_1_536_V, SYS_VREFCTL_IVRS_2_048_V, SYS_VREFCTL_IVRS_2_560_V, SYS_VREFCTL_IVRS_3_072_V, SYS_VREFCTL_IVRS_4_096_V];
                                                    optionLabels:["1.536V",
                                                                  "2.048V",
                                                                  "2.560V",
                                                                  "3.072V",
                                                                  "4.096V"];
                                                    dependencies:SYS_IVRENSelect;
                                                    dependenciesOption:1;
                                                    groupId:Group_InternalVoltageReference;
                                                    groupName:Internal Voltage Reference Configuration;
                                                    filterExp:SYS_VREF_OPTION_SUPPORT==1;
                                                    filterDefault:false;
                                                !>)
#endif

#define NUCODEGEN_SYS_HIRCTRIM_EN               (<!id:SYS_HIRCTRIM_En;
                                                    type:radio;
                                                    label:Enable HIRC Trim Function;
                                                    data:0;
                                                    default:0;
                                                    enum:[1,0];
                                                    optionLabels:[Enable, Disable];
                                                    dependencies:none;
                                                    dependenciesOption:none;
                                                    groupId:Group_HIRCTrim;
                                                    groupName:HIRC Trim Configuration;
                                                !>)
#define NUCODEGEN_SYS_HIRCTRIM_ERRSTOP_EN       (<!id:SYS_HIRCTRIM_Error_Stop_En;
                                                    type:radio;
                                                    label:Enable HIRC Trim Error Stop;
                                                    data:0;
                                                    default:0;
                                                    enum:[1,0];
                                                    optionLabels:[Enable, Disable];
                                                    dependencies:SYS_HIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_HIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_HIRCTRIM_LOOPSEL          (<!id:SYS_HIRCTRIM_LoopSel;
                                                    type:select;
                                                    label:Select Trim Calculation Loop ;
                                                    data:2;
                                                    default:2;
                                                    enum:[0, 1, 2, 3];
                                                    optionLabels:[4 Reference clock, 8 Reference clock, 16 Reference clock, 32 Reference clock];
                                                    vertical:true;
                                                    dependencies:SYS_HIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_HIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_HIRCTRIM_RETRYCNT         (<!id:SYS_HIRCTRIM_RetryCnt;
                                                    type:select;
                                                    label:Select Trim Retry Count ;
                                                    data:2;
                                                    default:2;
                                                    enum:[0, 1, 2, 3];
                                                    optionLabels:[64 Loops, 128 Loops, 256 Loops, 512 Loops];
                                                    vertical:true;
                                                    dependencies:SYS_HIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_HIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_HIRCTRIM_REFCLOCK         (<!id:SYS_HIRCTRIM_Ref_CLK;
                                                    type:select;
                                                    label:Select Trim Reference Clock;
                                                    data:0;
                                                    default:0;
                                                    enum:[0, 1];
                                                    optionLabels:[LXT, USB];
                                                    vertical:true;
                                                    dependencies:SYS_HIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_HIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_HIRCTRIM_BOUND_EN         (<!id:SYS_HIRCTRIM_Boundary_En;
                                                    type:radio;
                                                    label:Enable HIRC Trim Boundary ;
                                                    data:1;
                                                    default:1;
                                                    enum:[1, 0];
                                                    optionLabels:[Enable, Disable];
                                                    vertical:false;
                                                    dependencies:SYS_HIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_HIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_HIRCTRIM_BOUND_RANGE      (<!id:SYS_HIRCTRIM_Boundary_Range;
                                                    type:integer;
                                                    label:Enter HIRC Trim Boundary value;
                                                    data:8;
                                                    default:8;
                                                    helper:Enter your boundary value 1~31;
                                                    minimum:1;
                                                    maximum:31;
                                                    dependencies:SYS_HIRCTRIM_Boundary_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_HIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_HIRCTRIM_INT_EN           (<!id:SYS_HIRCTRIM_INT_En;
                                                    type:checkbox;
                                                    label:Enable HIRC Trim Interrupt Function;
                                                    data:0;
                                                    default:0;
                                                    enum:[1];
                                                    optionLabels:[Enable HIRC Trim Interrupt];
                                                    dependencies:SYS_HIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_HIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_HIRCTRIM_INT_SEL          (<!id:SYS_HIRCTRIM_INT_Sel;
                                                    type:multipleselect;
                                                    label:Select Interrupts We Want for HIRC trim;
                                                    size:2;
                                                    data:[];
                                                    default:[];
                                                    helper:Select which interrupt enable.;
                                                    sort:false;
                                                    enum:[2, 4];
                                                    optionLabels:[Trim Failure, Clock Error];
                                                    dependencies:SYS_HIRCTRIM_INT_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_HIRCTrim;
                                                !>)
                                                
#define NUCODEGEN_SYS_MIRCTRIM_EN               (<!id:SYS_MIRCTRIM_En;
                                                    type:radio;
                                                    label:Enable MIRC Trim Function;
                                                    data:0;
                                                    default:0;
                                                    enum:[1,0];
                                                    optionLabels:[Enable, Disable];
                                                    dependencies:none;
                                                    dependenciesOption:none;
                                                    groupId:Group_MIRCTrim;
                                                    groupName:MIRC Trim Configuration;
                                                !>)
#define NUCODEGEN_SYS_MIRCTRIM_ERRSTOP_EN       (<!id:SYS_MIRCTRIM_Error_Stop_En;
                                                    type:radio;
                                                    label:Enable MIRC Trim Error Stop;
                                                    data:0;
                                                    default:0;
                                                    enum:[1,0];
                                                    optionLabels:[Enable, Disable];
                                                    dependencies:SYS_MIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_MIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_MIRCTRIM_LOOPSEL          (<!id:SYS_MIRCTRIM_LoopSel;
                                                    type:select;
                                                    label:Select Trim Calculation Loop ;
                                                    data:2;
                                                    default:2;
                                                    enum:[1, 2, 3];
                                                    optionLabels:[8 Reference clock, 16 Reference clock, 32 Reference clock];
                                                    vertical:true;
                                                    dependencies:SYS_MIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_MIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_MIRCTRIM_RETRYCNT         (<!id:SYS_MIRCTRIM_RetryCnt;
                                                    type:select;
                                                    label:Select Trim Retry Count ;
                                                    data:2;
                                                    default:2;
                                                    enum:[0, 1, 2, 3];
                                                    optionLabels:[64 Loops, 128 Loops, 256 Loops, 512 Loops];
                                                    vertical:true;
                                                    dependencies:SYS_MIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_MIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_MIRCTRIM_REFCLOCK         (<!id:SYS_MIRCTRIM_Ref_CLK;
                                                    type:select;
                                                    label:Select Trim Reference Clock;
                                                    data:0;
                                                    default:0;
                                                    enum:[0, 1];
                                                    optionLabels:[LXT, USB];
                                                    vertical:true;
                                                    dependencies:SYS_MIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_MIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_MIRCTRIM_BOUND_EN         (<!id:SYS_MIRCTRIM_Boundary_En;
                                                    type:radio;
                                                    label:Enable MIRC Trim Boundary ;
                                                    data:1;
                                                    default:1;
                                                    enum:[1, 0];
                                                    optionLabels:[Enable, Disable];
                                                    vertical:false;
                                                    dependencies:SYS_MIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_MIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_MIRCTRIM_BOUND_RANGE      (<!id:SYS_MIRCTRIM_Boundary_Range;
                                                    type:integer;
                                                    label:Enter MIRC Trim Boundary value;
                                                    data:8;
                                                    default:8;
                                                    helper:Enter your boundary value 1~31;
                                                    minimum:1;
                                                    maximum:31;
                                                    dependencies:SYS_MIRCTRIM_Boundary_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_MIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_MIRCTRIM_INT_EN           (<!id:SYS_MIRCTRIM_INT_En;
                                                    type:checkbox;
                                                    label:Enable MIRC Trim Interrupt Function;
                                                    data:0;
                                                    default:0;
                                                    enum:[1];
                                                    optionLabels:[Enable MIRC Trim Interrupt];
                                                    dependencies:SYS_MIRCTRIM_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_MIRCTrim;
                                                !>)
#define NUCODEGEN_SYS_MIRCTRIM_INT_SEL          (<!id:SYS_MIRCTRIM_INT_Sel;
                                                    type:multipleselect;
                                                    label:Select Interrupts We Want for MIRC trim;
                                                    size:2;
                                                    data:[];
                                                    default:[];
                                                    helper:Select which interrupt enable.;
                                                    sort:false;
                                                    enum:[2, 4];
                                                    optionLabels:[Trim Failure, Clock Error];
                                                    dependencies:SYS_MIRCTRIM_INT_En;
                                                    dependenciesOption:1;
                                                    groupId:Group_MIRCTrim;
                                                !>)
