cancel
Showing results for 
Search instead for 
Did you mean: 

implementing STSW-IMG009 API

Ckjel.1
Associate

first question about initiating const from adr 0x2D to 0x87, is not the internal addresspointer incrementing ?

Second: The default device address is 0x29 or ?(datasheet says 0x52)

1 REPLY 1
John E KVAM
ST Employee

Let’s take the 0x29/0x52 question first, because it's a very common question. And it's confusing.

The I2C uses the LSB in a 8-bit byte an the Write/Read bit.

So, if your 7-bit address is 0x29, you shift it left one bit and append the Write/Read bit.

Thus, one can specify the Sensor address as 0x29, or the Write address as 0x52 and the Read address as 0x53.

These are all equivalent.

You are right about the incrementing addresses. We could have done that with one multi-byte write.

But our mandate was to build the simplest driver we could possibly think of, and you only do this operation one time.

That is why we used Dev as a I2C address and not a structure - like everyone else.

(That was a very controversial decision, to be sure. You won't find any other structures in there either - for the same reason. )

  • john
  •  


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.