cancel
Showing results for 
Search instead for 
Did you mean: 

i2c combined example

estersci2
Associate III
Posted on October 10, 2015 at 16:53

Hi,

I would be very grateful if anyone could post some sample code to implement...

 i2c 7-bit protocol with combined  write and read, multiple data bytes to be read in a sequence.

Basic std FW library compatible sample code not involving Cube or CPAL would be preferable!!!

Thanks in advance.

P.S. Just wondering - the people who post those lovely clean sample snippets - where do you get them?

2 REPLIES 2
Posted on October 10, 2015 at 18:12

where do you get them?

Well I'm an engineer, and I write stuff, either from scratch, or by synthesizing what I need from other code I've written, or other code examples that don't do exactly what I want, but can be bent into shape. That and I can digest technical manuals. ST provided their own subset of examples in most of the SPL, DISCO, EVAL and Cube releases.

There's really not a magic spring in the ground where they bubble out of the ether.

I'm also really good at static code analysis, from machine language on up.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
estersci2
Associate III
Posted on October 10, 2015 at 18:54

The problem is those examples are quite a bit complex and sometimes there are two many unknowns to be sure when you are a new guy...

For example, in the case of a combined write and read protocol, typically does the Stm32 keep reading data byte after data byte after databyte automatically, until you programatically issue a stop condition?

Do you happen to have a very easy to follow combined read write prototcol with multiple data bits available please, that is as simple/clear as possible?