<!clock: {"ALL" : "TMR2" };
  pin:   {"TIMER2OutputPinRadio":{"TIMER_TOUT_PIN_FROM_TX": "TM2",
								  "TIMER_TOUT_PIN_FROM_TX_EXT": "TM2_EXT"},
		  "TPWM0OutputPinRadio":{"TPWM_TOUT_PIN_FROM_TX": "TM2",
								 "TPWM_TOUT_PIN_FROM_TX_EXT": "TM2_EXT"},
		  "TIMER2EventCountCheckbox":{"1": "TM2"},
		  "TIMER2CaptureSourceSelect":{"TIMER2_CAP_FROM_EXTERNAL": "TM2_EXT"},
		  "ALL":[""]};
!>
/*--------------------------------------------------------------------------*/
/* TIMER2 Configuration                                                     */
/*--------------------------------------------------------------------------*/

#define TIMER2_MODE						<!id:TIMER2ModeRadio;
										type:radio;
										label:Select TIMER2 operation mode;
										data:TIMER_ONESHOT_MODE;
										default:TIMER_ONESHOT_MODE;
										enum:[TIMER_ONESHOT_MODE, TIMER_PERIODIC_MODE, TIMER_TOGGLE_MODE, TIMER_CONTINUOUS_MODE];
										optionLabels:[One-shot, Periodic, Toggle, Continuous counting];
										dependencies:none;
										dependenciesOption:none;
										groupId:Timer_Common;
										groupName:Timer common configuration;!>

#define NUCODEGEN_TIMER2_TOUT_PIN		<!id:TIMER2OutputPinRadio;
										type:radio;
										label:Select TIMER2 output pin;
										data:TIMER_TOUT_PIN_FROM_TX;
										default:TIMER_TOUT_PIN_FROM_TX;
										enum:[TIMER_TOUT_PIN_FROM_TX, TIMER_TOUT_PIN_FROM_TX_EXT];
										optionLabels:[Output pin from TX, Output pin from TX_EXT];
										dependencies:TIMER2ModeRadio;
										dependenciesOption:TIMER_TOGGLE_MODE;
										groupId:Timer_Common;!>

#define TIMER2_FREQ						<!id:TIMER2FreqInteger;
										type:integer;
										label:Set TIMER2 frequency;
										data:1000000;
										default:1000000;
										helper:Enter your TIMER2 frequency 1~ClkSrc/2(Hz);
										minimum:1;
										maximum:24000000;
										dependencies:none;
										dependenciesOption:none;
										groupId:Timer_Common;!>

#define NUCODEGEN_TIMER2_VALUE			<!id:TIMER2SetValueCheckbox;
										type:checkbox;
										label:Enable TIMER2 set prescale & compared value;
										data:0;
										default:0;
										helper:Will change TIMER2 frequency;
										enum:[1];
										optionLabels:[<br>];
										dependencies:none;
										dependenciesOption:none;
										groupId:Timer_Common;!>

#if NUCODEGEN_TIMER2_VALUE
	#define TIMER2_PRESCALE_VALUE		<!id:TIMER2PrescaleInteger;
										type:integer;
										label:TIMER2 prescale value;
										data:90;
										default:90;
										helper:Enter your TIMER2 prescale value(dec);
										minimum:0;
										maximum:255;
										dependencies:TIMER2SetValueCheckbox;
										dependenciesOption:1;
										groupId:Timer_Common;!>
	#define TIMER2_CMP_VALUE			<!id:TIMER2CMPHexText;
										type:hextext;
										label:TIMER2 compared value;
										data:0x5A5A5A;
										default:0x5A5A5A;
										helper:Enter your TIMER2 compared value(hex);
										minimum:0x2;
										maximum:0xFFFFFF;
										dependencies:TIMER2SetValueCheckbox;
										dependenciesOption:1;
										groupId:Timer_Common;!>
#endif //NUCODEGEN_TIMER2_VALUE

#define NUCODEGEN_TIMER2_WAKEUP			<!id:TIMER2WakeUpCheckbox;
										type:checkbox;
										label:Enable TIMER2 wake-up;
										data:0;
										default:0;
										enum:[1];
										optionLabels:[<br>];
										dependencies:none;
										dependenciesOption:none
										groupId:Timer_Common;!>

#define NUCODEGEN_TIMER2_INT			<!id:TIMER2IntCheckbox;
										type:checkbox;
										label:Enable TIMER2 time-out interrupt;
										data:0;
										default:0;
										enum:[1];
										optionLabels:[<br>];
										dependencies:none;
										dependenciesOption:none
										groupId:Timer_Common;!>

#define NUCODEGEN_TIMER2_EVENT_CNT		<!id:TIMER2EventCountCheckbox;
										type:checkbox;
										label:Enable TIMER2 event counting;
										data:0;
										default:0;
										enum:[1];
										optionLabels:[<br>];
										dependencies:TIMER2ModeRadio;
										dependenciesOption:TIMER_ONESHOT_MODE|TIMER_PERIODIC_MODE|TIMER_CONTINUOUS_MODE;
										groupId:Event_Count;
										groupName:Event count configuration;
                                        filterExp:PB_dot5==1 or PC_dot7==1;!>

#define NUCODEGEN_TIMER2_COUNTER_PHASE	<!id:TIMER2PhaseRadio;
										type:radio;
										label:Select TIMER2 external count phase;
										data:TIMER_COUNTER_FALLING_EDGE;
										default:TIMER_COUNTER_FALLING_EDGE;
										enum:[TIMER_COUNTER_FALLING_EDGE, TIMER_COUNTER_RISING_EDGE];
										optionLabels:[Event falling edge, Event rising edge];
										dependencies:TIMER2EventCountCheckbox;
										dependenciesOption:1;
										groupId:Event_Count;
                                        filterExp:PB_dot5==1 or PC_dot7==1;!>

#define NUCODEGEN_TIMER2_EVENT_CNTDB	<!id:TIMER2EventCountDebounceCheckbox;
										type:checkbox;
										label:Enable TIMER2 event counting de-bounce;
										data:0;
										default:0;
										enum:[1];
										optionLabels:[<br>];
										dependencies:TIMER2EventCountCheckbox;
										dependenciesOption:1;
										groupId:Event_Count;
                                        filterExp:PB_dot5==1 or PC_dot7==1;!>

#define NUCODEGEN_TIMER2_CAP			<!id:TIMER2CaptureCheckbox;
										type:checkbox;
										label:Enable TIMER2 capture;
										data:0;
										default:0;
										enum:[1];
										optionLabels:[<br>];
										dependencies:TIMER2ModeRadio;
										dependenciesOption:TIMER_ONESHOT_MODE|TIMER_PERIODIC_MODE|TIMER_CONTINUOUS_MODE;
										groupId:Capture;
										groupName:Capture configuration;!>

#if NUCODEGEN_TIMER2_CAP
#define TIMER2_CAP_FROM_EXTERNAL 1
#define TIMER2_CAP_SRC					<!id:TIMER2CaptureSourceSelect;
										type:select;
										label:Select TIMER2 capture trigger source;
										data:TIMER2_CAP_FROM_EXTERNAL;
										default:TIMER2_CAP_FROM_EXTERNAL;
										enum:[TIMER2_CAP_FROM_EXTERNAL, TIMER_INTERCAPSEL_ACMP0, TIMER_INTERCAPSEL_ACMP1, TIMER_INTERCAPSEL_LIRC];
										optionLabels:[Capture source from external, Internal source from ACMP0, Internal source from ACMP1, Internal source from LIRC];
										dependencies:TIMER2CaptureCheckbox;
										dependenciesOption:1;
										groupId:Capture;!>
#endif //NUCODEGEN_TIMER2_CAP

#define NUCODEGEN_TIMER2_CAP_EDGE		<!id:TIMER2CaptureEdgeSelect;
										type:select;
										label:Select TIMER2 capture edge detect;
										data:TIMER_CAPTURE_FALLING_EDGE;
										default:TIMER_CAPTURE_FALLING_EDGE;
										enum:[TIMER_CAPTURE_FALLING_EDGE, TIMER_CAPTURE_RISING_EDGE, TIMER_CAPTURE_FALLING_AND_RISING_EDGE];
										optionLabels:[Capture on falling edge, Capture on rising edge, Capture on falling or rising edges];
										dependencies:TIMER2CaptureCheckbox;
										dependenciesOption:1;
										groupId:Capture;!>

#define NUCODEGEN_TIMER2_CAP_MODE		<!id:TIMER2CaptureModeRadio;
										type:radio;
										label:Select TIMER2 capture mode;
										data:TIMER_CAPTURE_FREE_COUNTING_MODE;
										default:TIMER_CAPTURE_FREE_COUNTING_MODE;
										enum:[TIMER_CAPTURE_FREE_COUNTING_MODE, TIMER_CAPTURE_COUNTER_RESET_MODE];
										optionLabels:[Free counting, Counter reset];
										dependencies:TIMER2CaptureCheckbox;
										dependenciesOption:1;
										groupId:Capture;!>

#define NUCODEGEN_TIMER2_CAPDB			<!id:TIMER2CaptureDebounceCheckbox;
										type:checkbox;
										label:Enable TIMER2 capture de-bounce;
										data:0;
										default:0;
										enum:[1];
										optionLabels:[<br>];
										dependencies:TIMER2CaptureCheckbox;
										dependenciesOption:1;
										groupId:Capture;!>

#define NUCODEGEN_TIMER2_CAP_INT		<!id:TIMER2CaptureIntCheckbox;
										type:checkbox;
										label:Enable TIMER2 capture interrupt;
										data:0;
										default:0;
										enum:[1];
										optionLabels:[<br>];
										dependencies:TIMER2CaptureCheckbox;
										dependenciesOption:1;
										groupId:Capture;!>

#define NUCODEGEN_TIMER2_TRG			<!id:TIMER2TriggerCheckbox;
										type:checkbox;
										label:Enable TIMER2 trigger;
										data:0;
										default:0;
										enum:[1];
										optionLabels:[<br>];
										dependencies:none;
										dependenciesOption:none;
										groupId:Timer_Trigger;
										groupName:Timer trigger configuration;!>

#define NUCODEGEN_TIMER2_TRG_SRC		<!id:TIMER2TriggerConditionRadio;
										type:radio;
										label:TIMER2 trigger condition select;
										data:TIMER_TRGSRC_TIMEOUT_EVENT;
										default:TIMER_TRGSRC_TIMEOUT_EVENT;
										enum:[TIMER_TRGSRC_TIMEOUT_EVENT, TIMER_TRGSRC_CAPTURE_EVENT];
										optionLabels:[Time-out event, Capture event];
										dependencies:TIMER2TriggerCheckbox;
										dependenciesOption:1;
										groupId:Timer_Trigger;!>

#define NUCODEGEN_TIMER2_TRG_TARGET		<!id:TIMER2TriggerTargetCheckbox;
										type:checkbox;
										label:Select TIMER2 trigger target;
										data:0;
										default:0;
										sort:false;
										enum:[TIMER_CTL_TRGPDMA_Msk, TIMER_CTL_TRGBPWM_Msk, TIMER_CTL_TRGADC_Msk, TIMER_CTL_TRGPWM_Msk];
										optionLabels:[TIMER2 trigger PDMA, TIMER2 trigger BPWM, TIMER2 trigger ADC, TIMER2 trigger PWM];
										dependencies:TIMER2TriggerCheckbox;
										dependenciesOption:1;
										groupId:Timer_Trigger;!>

