Close

I2C addressing with STM32CubeF4

A project log for 10DOF humanoid robot

For years i wanted to make a humanoid robot. I am presenting my first milestone here - robot can walk in straight line.

jure-tutaJure Tuta 08/13/2014 at 17:180 Comments

Due to rules that project must contain 4 logs I have to transfer a few logs from my blog to hackaday.io. This one will be useful for all hackers trying to implement STM32Cube HAL software on their chips.

Half year ago STM published new set of tools and software examples that implement HAL (wikipedia: Hardware abstraction layer) on the many of theirs µC. They are calling this set of tools STM32CubeF4. I2C addressing (not the 10bit, i am talking about 7bit) has only 7 bits because one bit of 8 bit addressing space is reserved for flag denoting if operation will be reading or writing. That one bit is LSB (Least significant bit). If you are into details, you can more here.

i2c-address1

Till now i worked with libraries that input a 7bit address and they automatically shift it for one bit to left. After that libs set LSB to the right value depending on the operation.

STM32CubeF4’s way is you have to shift the 7 bit address yourself

Code examples are on my blog: http://jure.tuta.si/?p=7

Discussions