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.

[参考译文] RTOS/EK-TM4C1294XL:CAN#39;t 从使用 I2C 在任务内部调用的 opt3001读取数据

Guru**** 2546490 points
Other Parts Discussed in Thread: OPT3001

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/800698/rtos-ek-tm4c1294xl-can-t-read-the-data-from-opt3001-called-inside-a-task-using-i2c

器件型号:EK-TM4C1294XL
主题中讨论的其他器件:OPT3001

工具/软件:TI-RTOS

您好!  

我正在尝试从 EK-TM4C129上连接的 Sensor BoosterPack 中的 opt3001传感器读取 lux 值。 问题是、我真的不知道如何从传感器读取数据。 我能够通过写入来设置寄存器配置。 此外、我看到了所有 I2C 示例、但除了射频示例外、没有一个示例使用 I2C 的读缓冲器、我尝试使用的是相同的方法、但使用 opt3001、但问题是它们没有使用函数读取缓冲器。 是否有人可以指导我或编写函数并使用它来读取 lux? 我在一个普通项目中完成了相同的代码、它运行良好(无 TI-RTOS)。 请查看 C 文件。 非常感谢。  

e2e.ti.com/.../7331.main.c

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    问题是按字节顺序排列的。 我将高字节与低字节交换。 更改订单可以解决我的问题。 谢谢。