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.

[参考译文] CC2642R:[CC2642R]如何将 UART 驱动程序添加到 simple_peripheral 项目中

Guru**** 2033340 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/929881/cc2642r-cc2642r-how-to-add-uart-driver-into-simple_peripheral-project

器件型号:CC2642R

您好、先生、

我们器件的 SOC 将通过 UART 向 BLE FW 发送和接收数据。

目前、我们使用 simple_peripheral FW、并计划添加 UART 驱动程序以读取 SOC 通过 UART_Read 发送的数据、并通过 UART_WRITE 将数据发送回 SOC。
我收集了以下相关信息。
但我不知道在 simple_peripheral 项目中从何处调用以下函数, 请帮助 我提供一些提示、示例代码或 文档以供参考。
UART_INIT
UART_PARAMS_INIT
UART_OPEN
UART_READ
UART_WRITE
6、UART_CLOSE
谢谢你。

https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/592069?tisearch=e2e-sitesearch&keymatch=UART_write

文件://C:/ti/simplelink_cc13x2_26x2_sdk_4_10_00_78/docs/tidrivers/doxygen/html/_u_a_r_t_8h.html

 

https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/901967?tisearch=e2e-sitesearch&keymatch=uart%252520transfer%252520data

 

https://e2e.ti.com/support/processors/f/791/p/850434/3146681?tisearch=e2e-sitesearch&keymatch=UART_write#3146681

 

https://github.com/ti-simplelink/ble_examples/blob/ble_examples-2.2/docs/spp_ble.md

 

https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/761533?tisearch=e2e-sitesearch&keymatch=uart%252520echo%252520simple_peripheral

 

https://e2e.ti.com/support/wireless-connectivity/bluetooth/f/538/t/924948?tisearch=e2e-sitesearch&keymatch=uart%2520echo%2520simple_peripheral

 

uartecho 示例代码

http://dev.ti.com/tirex/explore/node?node=AExXVVS1Iq3nAR4kS7oWXg__krol.2c__LATEST&search=uart%20driver

 http://dev.ti.com/tirex/explore/node?node=AP24VgJ7gbuZWQrdF16tIg__pTTHBmu__LATEST

陈爱丽

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Ariel、

    您可以查看 BLE5-Stack 用户指南 的 NPI 部分:https://dev.ti.com/tirex/content/simplelink_cc13x2_26x2_sdk_4_20_00_35/docs/ble5stack/ble_user_guide/html/ble-stack-common/npi-index.html 

    主机测试项目是已启用双向 UART 的 BLE 应用的示例: https://dev.ti.com/tirex/explore/node?node=AABc.DyqTiE3F4dl32lXcA__pTTHBmu__LATEST 

    然后、您已经找到了要参考的 uartecho 示例以及几个有用的 E2E 线程。

    此致、
    Ryan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Ryan、

    感谢您的回复。

    uartecho 使用 UART 驱动程序(UART_WRITE、UART_READ...)。
    请问 NPI 器件  和 UART 驱动程序之间有何区别? (NPITASK_sendToHost 和 UART_WRITE)
    谢谢你。
    Ariel

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好 Ariel、

    网络处理器接口(NPI)使用 UART 驱动 程序在 TI SoC 和外部 MCU/PC 之间建立串行数据链路、以发送/接收 BLE 数据包信息。

    此致、
    Ryan

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、Ryan、

    我想知道何时应该使用 NPI 以及何时应该直接使用 UART 驱动程序?

    例如:
    1.何时应该调用 UART_write()函数,何时应该调用 NPITASK_sendToHost()函数?
    uartecho 示例代码当前正在调用 UART 驱动程序函数(UART_reaad、UART_WRITE)、是否可以调用 NPI 函数(NPIITASK_sendToHost、HCI_TL_SendToStack)?
    我发现 simple_peripheral 和主机测试示例代码使用 NPI 函数、uartecho 示例代码使用 UART 驱动程序函数、  
    我可以问原因吗? 是因为 host_test 需要分析 HCI 命令、所以使用 NPI 函数。
    如果我只想通过 UART 发送原始数据、应该使用 UART 驱动程序还是 NPI 函数?
    谢谢你。
    Ariel
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    NPI 是连接 UART 的更高级别接口、但如果您实际上没有使用 UART 进行网络处理、则禁用 NPI 并改用 TI 驱动程序。  我提到国家预防家庭和家庭方案是一个参考,而不是一个建议。

    此致、
    Ryan