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.

[参考译文] EK-TM4C123GXL:具有 multiData 的 I2C 读取写入。

Guru**** 2464780 points
Other Parts Discussed in Thread: EK-TM4C123GXL

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/662288/ek-tm4c123gxl-i2c-readwrite-with-multidata

器件型号:EK-TM4C123GXL

大家好、

我使用 EK-TM4C123GXL 对放大器进行编程、因为我需要通过 I2C 向安装在总线上的从器件发送缓冲器、并从这些从器件读回缓冲器。

基本上、我需要一个函数来获取像这样的参数

 TI_WriteRead ( unsigned char slave_addr、
                                   int num_WRITE_Bytes、
                                   const unsigned char write_data[]、
                                   int num_read_Bytes、
                                   unsigned char read_data[])

是否有可用于通过 I2C 与 EK-TM4C123GXL 进行读写的 API?  

谢谢、

传感器

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

    大家好、Maw、

    TivaWare 中没有提供用于您确切描述的 API。 您需要使用现有 API 创建与之类似的 API、例如:

    I2CMasterControl (I2C0_BASE、I2C_MASTER_CMD_SINGLE_SEND);
    I2CMasterControl (I2C0_BASE、I2C_MASTER_CMD_SINGLE_Receive); 

    如果要传输多个字节、还可以选择以突发模式发送和接收。 这些都记录在 TIvaWare driverlib 文件夹中的 i2c.h 文件中。

    最后、您可能需要参考我们的外设示例文件夹、该文件夹位于:[INSTALL Path]\TivaWare_C_Series-2.1.4.178\examples\peripherals\i2c