|
发表于 2016-12-21 21:11:48
17858 浏览 3 回复
关于PWM——寄存器操作
我想通过操作寄存器来配置PWM,输出PWM 波来控制 BUZZER 已经裁剪去除了 System Type 和 char下的 PWM 驱动
printk("\n TCFG0= %d \n" ,test);
printk("\n TCFG1= %d \n" ,test);
printk("\n TCNTB= %d \n" ,test);
一下代码的这几句输出为0
我感觉配置没有写入寄存器
求救~~~~~~~~~~~~~
参考了这个代码:
int test =-1;
gpd0con = ioremap(GPD0CON,4);
timer_base = ioremap(TIMER_BASE,0x14);
//writel ((readl(gpd0con)&~(0xf<<0)) | (0x2<<0),gpd0con);
writel ((readl(timer_base +TCFG0 )&~(0xff<<0)) | (0xff <<0),timer_base +TCFG0);
|
|
|
|
|
|
|
|
发表于 2017-10-11 11:27:43
|
|
|
|
|
|
登录或注册
扫一扫关注迅为公众号


|