How to send a non constant buffer over i2c?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to send a non constant buffer over i2c?

跳至解决方案
760 次查看
coder_72
Contributor I

Hello everybody,

i have a question about the MCUXPRESSO SDK. Can i send a non constant buffer(uint8_t) as a I2C Slave? I do not found a function to send a uint8_t buffer from a slave to master after a master request.

Thanks for your answers.

标签 (2)
0 项奖励
回复
1 解答
731 次查看
frank_m
Senior Contributor III

No, you can't.

I2C is a bus with a strict master-slave design. Only the master device can initiate transfers.

> Can i send a non constant buffer ...

I assume with "non constant" you mean of onknown length.
The usual method here is to execute consecutive (multi-byte) reads until the slave device returns NACK.

I2C memory and MEMS sensor devices are good examples for such protocols.

在原帖中查看解决方案

0 项奖励
回复
1 回复
732 次查看
frank_m
Senior Contributor III

No, you can't.

I2C is a bus with a strict master-slave design. Only the master device can initiate transfers.

> Can i send a non constant buffer ...

I assume with "non constant" you mean of onknown length.
The usual method here is to execute consecutive (multi-byte) reads until the slave device returns NACK.

I2C memory and MEMS sensor devices are good examples for such protocols.

0 项奖励
回复