illd里面有的void GPT_TimerInit(void){ // Initialize global clocks IfxGpt12_enableModule( MODULE_GPT120); IfxGpt12_setGpt1BlockPrescaler( MODULE_GPT120, IfxGpt12_Gpt1BlockPrescaler_8); IfxGpt12_T3_setMode ( MODULE_GPT120, IfxGpt12_Mode_timer); IfxGpt12_T3_setTimerDirection ( MODULE_GPT120, IfxGpt12_TimerDirection_up); //IfxGpt12_T3_setCounterInputMode( MODULE_GPT120, IfxGpt12_CounterInputMode_bothEdgesTxOTL); IfxGpt12_T2_setMode ( MODULE_GPT120, IfxGpt12_Mode_reload); IfxGpt12_T2_setReloadInputMode( MODULE_GPT120, IfxGpt12_CounterInputMode_bothEdgesTxOTL); IfxGpt12_T2_setTimerValue( MODULE_GPT120, 0xf000); /* setup interrupt */ volatile Ifx_SRC_SRCR *src = IfxGpt12_T3_getSrc( MODULE_GPT120); IfxSrc_init(src, IfxSrc_Tos_cpu0, ISR_PRIORITY_TIMER_T3); IfxSrc_enable(src); // configure P13.0~3 as general output IfxPort_setPinMode( MODULE_P33, 6, IfxPort_Mode_outputPushPullGeneral); IfxPort_setPinPadDriver( MODULE_P33, 6, IfxPort_PadDriver_cmosAutomotiveSpeed4); // configure P13.0~3 output as high to turn off IfxPort_setPinState( MODULE_P33, 6, IfxPort_State_high); IfxGpt12_T3_run( MODULE_GPT120, IfxGpt12_TimerRun_start);}
illd里面有的void GPT_TimerInit(void){ // Initialize global clocks IfxGpt12_enableModule( MODULE_GPT120); IfxGpt12_setGpt1BlockPrescaler( MODULE_GPT120, IfxGpt12_Gpt1BlockPrescaler_8); IfxGpt12_T3_setMode ( MODULE_GPT120, IfxGpt12_Mode_timer); IfxGpt12_T3_setTimerDirection ( MODULE_GPT120, IfxGpt12_TimerDirection_up); //IfxGpt12_T3_setCounterInputMode( MODULE_GPT120, IfxGpt12_CounterInputMode_bothEdgesTxOTL); IfxGpt12_T2_setMode ( MODULE_GPT120, IfxGpt12_Mode_reload); IfxGpt12_T2_setReloadInputMode( MODULE_GPT120, IfxGpt12_CounterInputMode_bothEdgesTxOTL); IfxGpt12_T2_setTimerValue( MODULE_GPT120, 0xf000); /* setup interrupt */ volatile Ifx_SRC_SRCR *src = IfxGpt12_T3_getSrc( MODULE_GPT120); IfxSrc_init(src, IfxSrc_Tos_cpu0, ISR_PRIORITY_TIMER_T3); IfxSrc_enable(src); // configure P13.0~3 as general output IfxPort_setPinMode( MODULE_P33, 6, IfxPort_Mode_outputPushPullGeneral); IfxPort_setPinPadDriver( MODULE_P33, 6, IfxPort_PadDriver_cmosAutomotiveSpeed4); // configure P13.0~3 output as high to turn off IfxPort_setPinState( MODULE_P33, 6, IfxPort_State_high); IfxGpt12_T3_run( MODULE_GPT120, IfxGpt12_TimerRun_start);}
举报