+源码来源问题解答(如PSC.C)
void PSCInit(void)
{
// 使能 GPIO 模块
// 对相应外设模块的使能也可以在 BootLoader 中完成
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO, PSC_POWERDOMAIN_ALWAYS_ON, PSC_MDCTL_NEXT_ENABLE);
}
如你只能在PSC.H中找到int PSCModuleControl (unsigned int baseAdd, unsigned int moduleId, unsigned int powerDomain, unsigned int flags);这个函数的定义,而不知道原型,感觉跟日了狗一样;
要想知道这个函数的原型,需先TI官网下载一个startware安装包,再从里面即可查找到。这里我已经下载了,并上传到百度云,省去了各位在ti网上的注册麻烦。
链接:http://pan.baidu.com/s/1hqzxGtI 密码:0goe
在全英文路径安装好后,在drivers中可看到你想要的函数的原型。
要想将文件加入工程,请看其视频教程:12-1-6 通用输入输出口GPIO 单步调试
链接:http://pan.baidu.com/s/1bn4X8uF 密码:wmm2
void EVMOMAPL138_lpscTransition(psc_regs_t *psc, uint32_t in_domain, uint8_t in_module, uint8_t in_next_state)
{
// spin until existing transitions are done.
while (CHKBIT(psc->PTSTAT, in_domain)) {}
// if we are already in the requested state...just return.
if (CHKBIT(psc->MDSTAT[in_module], MASK_STATE) == in_next_state)
{
return;
}
// setup the transition...clear the bits before setting the next state.
CLRBIT(psc->MDCTL[in_module], NEXT);
SETBIT(psc->MDCTL[in_module], in_next_state);
// kick off the transition.
SETBIT(psc->PTCMD, in_domain);
// spin until transition is done.
while (CHKBIT(psc->PTSTAT, in_domain)) {}
while (CHKBIT(psc->MDSTAT[in_module], MASK_STATE) != in_next_state) {}
}