想用DM8148的timer1~8中的任何一个,有没有相关例程?
非常感谢!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
目前RDK中, timer1/2是可以直接使用的。请参考以下文档
http://processors.wiki.ti.com/index.php/TI81xx_PSP_Porting_Guide#Using_Hardware_Timers_from_Kernel_Module.2FDriver
Hello Eason,
非常感您的回复!
我现在遇到的主要问题是,PRCM向Timer提供时钟源,时钟源的选择配置,比较麻烦,
至少我个人看了文档后,我感觉比较乱,
我看了一下DM8148.gel 中有给Timer6的时钟配置,
但是我在文档里面很难找到诸如 CM_TIMER6_CLKSEL, CM_ALWON_TIMER_6_CLKCTRL寄存器的描述,
所以想写个裸机的Timer时钟 配置程序,还是比较难的。有没有比较详细的资料,或者好的建议,
非常感谢。
hotmenu TIMER_CLOCKS_Config()
{
GEL_TextOut("\t ***** Initializing Timer-6....***** \n");
WR_MEM_32(CM_SYSCLK18_CLKSEL, 0x1);
WR_MEM_32(CM_SYSCLK18_CLKSRC, 0x1); /* Set clksrc to 32.768 MHz, Lock Bit? */
WR_MEM_32(CM_DMTIMER_CLKSRC, RD_MEM_32(CM_DMTIMER_CLKSRC) & 0xFE3FFFFF); /* Selected sysclk18 */
WR_MEM_32(CM_TIMER6_CLKSEL, 0x1);
WR_MEM_32(CM_ALWON_TIMER_6_CLKCTRL, 0x2); /* Enable Timer-6 Clock */
while((RD_MEM_32(CM_ALWON_TIMER_6_CLKCTRL) & 0x0F) !=0x2); /* Poll for Module is functional */
WR_MEM_32(PINCNTL115, 0x00010040);
GEL_TextOut("\t ***** Timer-6 Initialized....***** \n");
}