WIFI技术
直播中

云中云

9年用户 1016经验值
私信 关注
[问答]

TC275如何设定GPT模块分频?

在illd里没找到相关函数,请问各位高手如何设定GPT模块分频,谢谢。                                                                                         

回帖(1)

方春晓

2024-2-22 09:59:06
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);}                                                                                                                                                                                                                                      
举报

更多回帖

发帖
×
20
完善资料,
赚取积分