在使用msp432e4011y芯片时,用到sdk中有关rom相关的api函数,不是很好理解他们的工作原理,希望可以有详细的文档对这部分的介绍,谢谢!
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.
用到sdk中有关rom相关的api函数
能否请您详细说下?
另外SDK内所有文档可以在下面的链接找到
https://dev.ti.com/tirex/explore/node?node=ADd.5CZAm27ncZbzoar0Ag__J4.hfJy__LATEST
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);例如这个函数,最终是指到了这个地方ROM_SYSCTLTABLE[6],但是我不知道这个地方放的是啥?同时SYSCTL_PERIPH_USB0这个宏表示的是啥意思?还有就是你们的usblib里面的.a文件是有里面的soure文件生成的吧,不是另外的库文件吧?
最终是指到了这个地方ROM_SYSCTLTABLE[6],但是我不知道这个地方放的是啥?
在代码中 #define ROM_SYSCTLTABLE ((uint32_t *)(ROM_APITABLE[13]))
//*****************************************************************************
//
// Pointers to the main API tables.
//
//*****************************************************************************
#define ROM_APITABLE ((uint32_t *)0x01000010)
即取ROM_APITABLE数组的第13个元素(地址为0x01000010+13*4)的值,然后用一个unt32_t型指针指向这个值。
所有 ROM API 都通过位于固定地址的两级查找表进行访问。这意味着,无论链接器将实际功能代码放在 ROM 的何处,也无论我们向每个驱动程序添加多少新功能(在一定限度内),代码始终可以使用相同的方法找到这些功能 - 找到开始ROM_APITABLE[n] 中每个驱动程序的 API 指针表,然后通过查看该表中的正确索引找到所需的特定函数的入口点。
同时SYSCTL_PERIPH_USB0这个宏表示的是啥意思
//*****************************************************************************
//
// The following are values that can be passed to the
// SysCtlPeripheralPresent(), SysCtlPeripheralEnable(),
// SysCtlPeripheralDisable(), and SysCtlPeripheralReset() APIs as the
// ui32Peripheral parameter. The peripherals in the fourth group (upper nibble
// is 3) can only be used with the SysCtlPeripheralPresent() API.
//
//*****************************************************************************
还有就是你们的usblib里面的.a文件是有里面的soure文件生成的吧,不是另外的库文件吧?
抱歉,有点没有理解您的意思
1.我就是想知道ROM API 指针表里面的具体函数内容是什么?
2.我想问的是usblib/Lib这个文件夹里面.a后缀文件是不是就是有usblib里面的soure code 生成的,还是说这个.a文件是另外的库文件。如果我想移植你们的usb库,我是不是可以不用管.a后缀的文件
.我就是想知道ROM API 指针表里面的具体函数内容是什么?
您指的是 ROM_APITABLE?如之前所说,所有 ROM API 都通过位于固定地址的两级查找表进行访问
我想问的是usblib/Lib这个文件夹里面.a后缀文件是不是就是有usblib里面的soure code 生成的
是的,您的理解是正确的
如果我想移植你们的usb库,我是不是可以不用管.a后缀的文件
是的
感谢你的回答!抱歉我可能没描述的很清楚。我想知道ROM里面存储的外设库具体函数内容是什么?是我们自己写的还是你们芯片在出厂前已经写好了的,我们只管调用api就行,还是说是sdk库里面的某部分内容?
是我们自己写的还是你们芯片在出厂前已经写好了的
据我了解是已经写好的,您直接调用就好
感谢,我刚看了下,ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0)和SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0)两者实现的目的是完全一样,只不过一个是在ROM里面,一个是在flash里面,应该可以这样理解吧?