(四)GTM_TOM模块定时器中断应用


功能:

**定时1ms的中断(使用GTM模块的子单元TOM0模块),借助LED检测,分别300ms 500ms间隔闪烁2个LED **

基于iLLD库,跟外设GTM模块的子模块TOM相关的基本都在:

#include "IfxGtm_Tom_Timer.h"
#include "IfxGtm.h"
#include "IfxGtm_Cmu.h" 

interrupt.c文件:

#include "Interrupt.h"
#include "IfxGtm_Tom_Timer.h"
#include "IfxPort.h"
#include "Blinky_LED.h"

#define ISR_PRIORITY_TOM    9                       /* Interrupt priority number                                    */
#define TOM_FREQ            1000.0f                    /* TOM frequency                                                */


short one_sec_flag = 0;

IfxGtm_Tom_Timer g_timerDriver; //类似linux文件句柄

/* Macro to define the Interrupt Service Routine. */
IFX_INTERRUPT(interruptGtmTom, 0, ISR_PRIORITY_TOM);
/* Interrupt Service Routine of the TOM */
void interruptGtmTom(void)
{
   
    static int i,j,one_sec = 0;
    IfxGtm_Tom_Timer_acknowledgeTimerIrq(&g_timerDriver);                       /* Clear the timer event            */
    i++
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小爪.exe

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值