/* --------------------------------------------------------------------
 *  ACMP
 * ---------------------------------------------------------------------*/

#define NUCODEGEN_ACMP_UI                   0
#if (NUCODEGEN_ACMP_UI) 
/* --------------------------------------------------------------------
 * IP UI configuration
 * ---------------------------------------------------------------------*/
#endif /* NUCODEGEN_ACMP_UI */
#define NUCODEGEN_ACMP_MODULE_SEL         ACMP01
#define NUCODEGEN_ACMP_IRQ_MODULE_SEL     ACMP01_IRQn

/* --------------------------------------------------------------------
 * ACMP configuration
 * ---------------------------------------------------------------------*/
#define NUCODEGEN_ACMP0_ENABLE            <!id:UseACMP0ENBoolean;
                                            type:checkbox;
                                            label:This ACMP;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:none;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_P_SEL             <!id:UseACMP0PSelect;
                                            type:select;
                                            label:Select positive input pin;
                                            data:ACMP_CTL_POSSEL_P0;
                                            default:ACMP_CTL_POSSEL_P0;
                                            helper:;
                                            sort:false;
                                            enum:[ACMP_CTL_POSSEL_P0, ACMP_CTL_POSSEL_P1, ACMP_CTL_POSSEL_P2, ACMP_CTL_POSSEL_P3];
                                            optionLabels:[External pin - ACMP_P0, External pin - ACMP_P1, External pin - ACMP_P2, External pin - ACMP_P3];
                                            dependencies:UseACMP0ENBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_N_SEL             <!id:UseACMN0NSelect;
                                            type:select;
                                            label:Select negative input pin;
                                            data:ACMP_CTL_NEGSEL_PIN;
                                            default:ACMP_CTL_NEGSEL_PIN;
                                            helper:;
                                            sort:false;
                                            enum:[ACMP_CTL_NEGSEL_PIN, ACMP_CTL_NEGSEL_CRV, ACMP_CTL_NEGSEL_VBG, ACMP_CTL_NEGSEL_DAC];
                                            optionLabels:[External pin - ACMP_N, Comparator reference voltage, Internal Band-gap voltage, DAC output];
                                            dependencies:UseACMP0ENBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_HYSTERESIS_SEL    <!id:UseACMN0HysteresisSelect;
                                            type:select;
                                            label:Select hysteresis mode;
                                            data:ACMP_CTL_HYSTERESIS_30MV;
                                            default:ACMP_CTL_HYSTERESIS_30MV;
                                            helper:;
                                            sort:false;
                                            enum:[ACMP_CTL_HYSTERESIS_DISABLE, ACMP_CTL_HYSTERESIS_10MV, ACMP_CTL_HYSTERESIS_20MV, ACMP_CTL_HYSTERESIS_30MV];
                                            optionLabels:[Hysteresis - disable, Hysteresis - 10mv, Hysteresis - 20mv, Hysteresis - 30mv];
                                            dependencies:UseACMP0ENBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_ADVANCED          <!id:UseACMP0AdvanceBoolean;
                                            type:checkbox;
                                            label:Advanced configuration;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP0ENBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_FILTERCNT_EN      <!id:UseACMP0FilterCntBoolean;
                                           type:checkbox;
                                           label:Output filter;
                                           data:0;
                                           default:0;
                                           enum:[1];
                                           optionLabels:[Enable];
                                           dependencies:UseACMP0AdvanceBoolean;
                                           dependenciesOption:1;
                                           groupId:ACMP0;
                                           groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_FILTERCNT_SEL     <!id:UseACMN0FilterCntSelect;
                                            type:select;
                                            label:Select output filter count;
                                            data:ACMP_CTL_FILTSEL_OFF;
                                            default:ACMP_CTL_FILTSEL_OFF;
                                            helper:;
                                            sort:false;
                                            enum:[ACMP_CTL_FILTSEL_OFF, ACMP_CTL_FILTSEL_1PCLK, ACMP_CTL_FILTSEL_2PCLK, ACMP_CTL_FILTSEL_4PCLK, ACMP_CTL_FILTSEL_8PCLK, ACMP_CTL_FILTSEL_16PCLK, ACMP_CTL_FILTSEL_32PCLK, ACMP_CTL_FILTSEL_64PCLK];            optionLabels:[Output filter disable, Output sample 1 PCLK, Output sample 2 PCLK, Output sample 4 PCLK, Output sample 8 PCLK, Output sample 16 PCLK, Output sample 32 PCLK, Output sample 64 PCLK];
                                            dependencies:UseACMP0FilterCntBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_INT_EN            <!id:UseACMP0INTENBoolean;
                                            type:checkbox;
                                            label:ACMP Interrupt;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP0AdvanceBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_INT_COND_SEL      <!id:UseACMP0INTCondSelect;
                                            type:select;
                                            label:Select interrupt condition;
                                            data:ACMP_CTL_INTPOL_RF;
                                            default:ACMP_CTL_INTPOL_RF;
                                            helper:;
                                            sort:false;
                                            enum:[ACMP_CTL_INTPOL_RF, ACMP_CTL_INTPOL_R, ACMP_CTL_INTPOL_F];
                                            optionLabels:[Rising edge or falling edge, Rising edge, Falling edge];
                                            dependencies:UseACMP0INTENBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_OUTPUT_INVERSE_EN <!id:UseACMP0OutputInverseENBoolean;
                                            type:checkbox;
                                            label:Output inverse;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP0AdvanceBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_WKP_EN            <!id:UseACMP0WKPENBoolean;
                                            type:checkbox;
                                            label:Wake up function;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP0AdvanceBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_WIN_LATCH_EN      <!id:UseACMP0WinLatchENBoolean;
                                           type:checkbox;
                                            label:Window latch ;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP0AdvanceBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP0;
                                            groupName:ACMP0 configuration;!>
                                            
#define NUCODEGEN_ACMP1_ENABLE            <!id:UseACMP1ENBoolean;
                                            type:checkbox;
                                            label:This ACMP;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:none;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_P_SEL             <!id:UseACMP1PSelect;
                                            type:select;
                                            label:Select positive input pin;
                                            data:ACMP_CTL_POSSEL_P0;
                                            default:ACMP_CTL_POSSEL_P0;
                                            helper:;
                                            sort:false;
                                            enum:[ACMP_CTL_POSSEL_P0, ACMP_CTL_POSSEL_P1, ACMP_CTL_POSSEL_P2, ACMP_CTL_POSSEL_P3];
                                            optionLabels:[External pin - ACMP_P0, External pin - ACMP_P1, External pin - ACMP_P2, External pin - ACMP_P3];
                                            dependencies:UseACMP1ENBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_N_SEL             <!id:UseACMN1NSelect;
                                            type:select;
                                            label:Select negative input pin;
                                            data:ACMP_CTL_NEGSEL_PIN;
                                            default:ACMP_CTL_NEGSEL_PIN;
                                            helper:;
                                            sort:false;
                                            enum:[ACMP_CTL_NEGSEL_PIN, ACMP_CTL_NEGSEL_CRV, ACMP_CTL_NEGSEL_VBG, ACMP_CTL_NEGSEL_DAC];
                                            optionLabels:[External pin - ACMP_N,Comparator reference voltage,Internal Band-gap voltage, DAC output];
                                            dependencies:UseACMP1ENBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_HYSTERESIS_SEL    <!id:UseACMN1HysteresisSelect;
                                            type:select;
                                            label:Select hysteresis mode;
                                            data:ACMP_CTL_HYSTERESIS_30MV;
                                            default:ACMP_CTL_HYSTERESIS_30MV;
                                            helper:;
                                            sort:false;
                                            enum:[ACMP_CTL_HYSTERESIS_DISABLE, ACMP_CTL_HYSTERESIS_10MV, ACMP_CTL_HYSTERESIS_20MV, ACMP_CTL_HYSTERESIS_30MV];
                                            optionLabels:[Hysteresis - disable, Hysteresis - 10mv, Hysteresis - 20mv, Hysteresis - 30mv];
                                            dependencies:UseACMP1ENBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_ADVANCED          <!id:UseACMP1AdvanceBoolean;
                                            type:checkbox;
                                            label:Advanced configuration;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP1ENBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_FILTERCNT_EN      <!id:UseACMP1FilterCntBoolean;
                                            type:checkbox;
                                            label:Output filter;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP1AdvanceBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_FILTERCNT_SEL     <!id:UseACMN1FilterCntSelect;
                                            type:select;
                                            label:Select output filter count;
                                            data:ACMP_CTL_FILTSEL_OFF;
                                            default:ACMP_CTL_FILTSEL_OFF;
                                            helper:; 
                                            sort:false;
                                            enum:[ACMP_CTL_FILTSEL_OFF, ACMP_CTL_FILTSEL_1PCLK, ACMP_CTL_FILTSEL_2PCLK, ACMP_CTL_FILTSEL_4PCLK, ACMP_CTL_FILTSEL_8PCLK, ACMP_CTL_FILTSEL_16PCLK, ACMP_CTL_FILTSEL_32PCLK, ACMP_CTL_FILTSEL_64PCLK];            optionLabels:[Output filter disable, Output sample 1 PCLK, Output sample 2 PCLK, Output sample 4 PCLK, Output sample 8 PCLK, Output sample 16 PCLK, Output sample 32 PCLK, Output sample 64 PCLK];
                                            dependencies:UseACMP1FilterCntBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_INT_EN            <!id:UseACMP1INTENBoolean;
                                            type:checkbox;
                                            label:ACMP Interrupt;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP1AdvanceBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_INT_COND_SEL      <!id:UseACMP1INTCondSelect;
                                            type:select;
                                            label:Select interrupt condition;
                                            data:ACMP_CTL_INTPOL_RF;
                                            default:ACMP_CTL_INTPOL_RF;
                                            helper:;
                                            sort:false;
                                            enum:[ACMP_CTL_INTPOL_RF, ACMP_CTL_INTPOL_R, ACMP_CTL_INTPOL_F];
                                            optionLabels:[Rising edge or falling edge, Rising edge, Falling edge];
                                            dependencies:UseACMP1INTENBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_OUTPUT_INVERSE_EN <!id:UseACMP1OutputInverseENBoolean;
                                            type:checkbox;
                                            label:Output inverse;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP1AdvanceBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_WKP_EN            <!id:UseACMP1WKPENBoolean;
                                            type:checkbox;
                                            label:Wake up function;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP1AdvanceBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP1_WIN_LATCH_EN      <!id:UseACMP1WinLatchENBoolean;
                                            type:checkbox;
                                            label:Window latch;
                                            data:0;
                                            default:0;
                                            enum:[1];
                                            optionLabels:[Enable];
                                            dependencies:UseACMP1AdvanceBoolean;
                                            dependenciesOption:1;
                                            groupId:ACMP1;
                                            groupName:ACMP1 configuration;!>

#define NUCODEGEN_ACMP_WIN_COMPARE_EN    <!id:UseACMPWinCmpENBoolean;
                                            type:radio;
                                            label:Select ACMP Window compare function;
                                            data:0;
                                            default:0;
                                            helper:If the ACMP window comparison function is enabled, ACMP0_N is the voltage boundary and ACMP1_N is the voltage boundary.;
                                            enum:[0,1];
                                            optionLabels:[Disable,Enable];
                                            dependencies:[UseACMP0ENBoolean,UseACMP1ENBoolean];
                                            dependenciesOption:{"UseACMP0ENBoolean":"1" ,"UseACMP1ENBoolean":"1" };
                                            groupId:ACMP;
                                            groupName:ACMP general configuration;!>

#define NUCODEGEN_ACMP_CRV_SEL            <!id:UseACMPCRVRefRadio;
                                            type:radio;
                                            label:Select Comparator reference voltage source;
                                            data:ACMP_VREF_CRVSSEL_AVDD;
                                            default:ACMP_VREF_CRVSSEL_AVDD;
                                            helper:;
                                            sort:false;
                                            enum:[ACMP_VREF_CRVSSEL_AVDD, ACMP_VREF_CRVSSEL_INTVREF];
                                            optionLabels:[AVDD (Analog VDD), Internal voltage reference]; 
                                            vertical:false;
                                            dependencies:none;
                                            dependenciesOption:0;
                                            groupId:ACMP;
                                            groupName:ACMP general configuration;!>

#define NUCODEDEF_ACMP_CRV_SET            <!id:UseACMPCRVSettingInteger;
                                            type:integer;
                                            label:Comparator reference voltage;
                                            data:0;
                                            default:0;
                                            helper:Comparator reference voltage is equal to ((0~15)+4) /24 * Comparator reference voltage source.;
                                            minimum:0;  maximum:15;
                                            dependencies:none;
                                            dependenciesOption:1;
                                            groupId:ACMP;
                                            groupName:ACMP general configuration;!>

#if (NUCODEGEN_ACMP0_ENABLE)
#define ACMP_MODULE_0                     0
#endif /* NUCODEGEN_ACMP0_ENABLE */
#if (NUCODEGEN_ACMP1_ENABLE)
#define ACMP_MODULE_1                     1
#endif /* NUCODEGEN_ACMP1_ENABLE */

                                          <! clock: {"ALL" : "ACMP01" }; !>
                                          <! pin:   {"UseACMP0PSelect" : {"ACMP_CTL_POSSEL_P0" : "ACMP0_P0" ,
                                                                          "ACMP_CTL_POSSEL_P1" : "ACMP0_P1" ,
                                                                          "ACMP_CTL_POSSEL_P2" : "ACMP0_P2" ,
                                                                          "ACMP_CTL_POSSEL_P3" : "ACMP0_P3" },
                                                     "UseACMN0NSelect" : {"ACMP_CTL_NEGSEL_PIN": "ACMP0_N"  },
                                                     "UseACMP0WinLatchENBoolean" : {"1"     : "ACMP0_WLAT"  },
                                                     "UseACMP0ENBoolean" : {'1' : "ACMP0_O"},
                                                     "UseACMP1PSelect" : {"ACMP_CTL_POSSEL_P0" : "ACMP1_P0" ,
                                                                          "ACMP_CTL_POSSEL_P1" : "ACMP1_P1" ,
                                                                          "ACMP_CTL_POSSEL_P2" : "ACMP1_P2" ,
                                                                          "ACMP_CTL_POSSEL_P3" : "ACMP1_P3" },
                                                     "UseACMN1NSelect" : {"ACMP_CTL_NEGSEL_PIN": "ACMP1_N"  },
                                                     "UseACMP1WinLatchENBoolean" : {"1" : "ACMP1_WLAT"  },
                                                     "UseACMP1ENBoolean" : {'1' : "ACMP1_O"}
                                          }; !>