打印

关于TIVA c123g的定时器

[复制链接]
1182|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
幽灵宇|  楼主 | 2014-8-6 20:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
/************************************************************
* @brief         初始化Timer0定时器中断,以10K的频率响应定时中断,
*                         通过调节PWM信号的占空比输出一组SPWM信号
* @param        null
* @return  null
************************************************************/
void Init_Timer0_SPWM() {

        // Enable the peripherals used by this example.
        ROM_SysCtlPeripheralEnable (SYSCTL_PERIPH_TIMER0);

        // Enable processor interrupts.
        ROM_IntMasterEnable ();

        // Configure the two 32-bit periodic timers.
        ROM_TimerConfigure (TIMER0_BASE, TIMER_CFG_PERIODIC);

        // 8K Hz响应
        ROM_TimerLoadSet (TIMER0_BASE, TIMER_A,
                        ROM_SysCtlClockGet() / SAMPLE_FREQUENCY);

        // Setup the interrupts for the timer timeouts.
        ROM_IntEnable (INT_TIMER0A);

        ROM_TimerIntEnable (TIMER0_BASE, TIMER_TIMA_TIMEOUT);
        // Enable the timers.
        ROM_TimerEnable (TIMER0_BASE, TIMER_A);

}

这段代码中的ROM类函数都是怎么定义的,都找不到啊~

相关帖子

沙发
dirtwillfly| | 2014-8-17 21:12 | 只看该作者
这列函数一般在相应头函数里有声明

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

1

帖子

0

粉丝