官方提供的sdk的例程中文件夹,有好几出都有都有关于uart的.c和.h文件,他们是什么关系?是属于不同层的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的例程中文件夹,有好几出都有都有关于uart的.c和.h文件,他们是什么关系?是属于不同层的api吗?有没有使用说明。
C:\ti\simplelink_cc2640r2_sdk_1_30_00_25\source\ti\devices\cc26x0r2\driverlib
C:\ti\simplelink_cc2640r2_sdk_1_30_00_25\source\ti\drivers
C:\ti\simplelink_cc2640r2_sdk_1_30_00_25\source\ti\blestack\npi\src
请问下,这三个路径下的驱动文件有什么区别和联系?具体分别使用在什么情境?
Hi Alvin Chen
我目前也是正被这些驱动弄得头晕脑胀的,都不知道究竟添加哪一个。
麻烦也发一份到我的邮箱:332767003@qq.com
谢谢!
1.首先添加库文件\ti\simplelink_cc2640r2_sdk_1_30_00_25\source\ti\blestack\npi\src
2.
1. 打开宏定义:NPI_USE_UART
2. 打开宏定义:xPOWER_SAVING
3.利用API: void NPITLUART_initializeTransport(Char *tRxBuf, Char *tTxBuf, npiCB_t npiCBack) 注册你的串口,具体怎么用看函数声明
4.在CC2640R2_LAUNCHXL.c中定义了 管脚
const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC2640R2_LAUNCHXL_UARTCOUNT] = {
{
.baseAddr = UART0_BASE,
.powerMngrId = PowerCC26XX_PERIPH_UART0,
.intNum = INT_UART0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.txPin = CC2640R2_LAUNCHXL_UART_TX,
.rxPin = CC2640R2_LAUNCHXL_UART_RX,
.ctsPin = PIN_UNASSIGNED,
.rtsPin = PIN_UNASSIGNED
}
};
CC2640R2_LAUNCHXL.h
/* UART Board */
#define CC2640R2_LAUNCHXL_UART_RX IOID_2 /* RXD */
#define CC2640R2_LAUNCHXL_UART_TX IOID_3 /* TXD */
#define CC2640R2_LAUNCHXL_UART_CTS IOID_19 /* CTS */
#define CC2640R2_LAUNCHXL_UART_RTS IOID_18 /* RTS */
有部分网友反映RX TX不好用, 请把
#define CC2640R2_LAUNCHXL_UART_RX IOID_21 /* RXD */
#define CC2640R2_LAUNCHXL_UART_TX IOID_23 /* TXD */
麻烦发一份关于CC2640R2F的UART实例代码到我邮箱,谢谢!
840169928@qq.com