/* --------------------------------------------------------------------
 *  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];
							optionLabels: [External pin - ACMP N, CRV - Comparator reference voltage, VBG - Internal Band -gap voltage];
							dependencies: UseACMP0ENBoolean;
							dependenciesOption: 1;
							groupId: ACMP0;
							groupName: ACMP0 configuration;!>

#define NUCODEGEN_ACMP0_HYSTERESIS_SEL          <!id:UseACMN0HysteresisBoolean;
							type: checkbox;
							label: Hysteresis enable / disable;
							data:0;
							default: 0;
							helper: ;
							sort: false;
							enum: [1];
							optionLabels: [Enable];
							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_COMPARE_EN          <!id:UseACMP0WinCmpENBoolean;
							type: checkbox;
							label: Window compare enable(Lower voltage limit);
							data:0;
							default: 0;
							helper: The ACMP1 Window Comparison function must be enabled because ACMP1_N is the upper voltage limit.;
							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];
							optionLabels: [External pin - ACMP N, CRV -Comparator reference voltage, VBG - Internal Band - gap voltage];
							dependencies: UseACMP1ENBoolean;
							dependenciesOption: 1;
							groupId: ACMP1;
							groupName: ACMP1 configuration;!>
							
#define NUCODEGEN_ACMP1_HYSTERESIS_SEL          <!id:UseACMN1HysteresisBoolean;
							type: checkbox;
							label: Hysteresis enable / disable;
							data:0;
							default: 0;
							helper: ;
							sort: false;
							enum: [1];
							optionLabels: [Enable];
							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_COMPARE_EN          <!id:UseACMP1WinCmpENBoolean;
							type: checkbox;
							label: Window compare enable(Upper voltage limit);
							data:0;
							default: 0;
							helper: The ACMP0 Window Comparison function must be enabled because ACMP0_N is the lower voltage limit.;
							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_CRV_SEL                  <!id:UseACMPCRVRefRadio;
							type: radio;
							label: Select CRV source voltage;
							data:ACMP_VREF_CRVSSEL_VDDA;
							default: ACMP_VREF_CRVSSEL_VDDA;
							helper: ;
							sort: false;
							enum: [ACMP_VREF_CRVSSEL_VDDA, ACMP_VREF_CRVSSEL_INTVREF];
							optionLabels: [VDDA(Analog VDD), Internal voltage reference];
							vertical: false;
							dependencies: none;
							dependenciesOption: 0;
							groupId: ACMP;
							groupName: ACMP general configuration;!>
				
#define NUCODEGEN_ACMP_CRV_SET                  <!id:UseACMPCRVSettingInteger;
							type: integer;
							label: CRV voltage;
							data:0;
							default: 0;
							helper: CRV voltage = ((0~15) + 4)/24 * CRV 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"
		}
	};!>
