How to send a non constant buffer over i2c?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to send a non constant buffer over i2c?

Jump to solution
670 Views
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.

Labels (2)
0 Kudos
Reply
1 Solution
641 Views
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.

View solution in original post

0 Kudos
Reply
1 Reply
642 Views
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 Kudos
Reply