AnsweredAssumed Answered

STM32CubeMx V1.00 Version 4.4.0 Howto send I2C read/writes with stop control

Question asked by de_jager.gerrie on Feb 2, 2015
Latest reply on Feb 26, 2015 by Montassar BEN ROMDHANE
It is not very clear how the HAL handles the start / write/read / stops.
I am use to the following I2C sequence

<start> < address> <r/w> < wrdata> <stop> this seem to fine using

if (HAL_I2C_Master_Transmit_IT(&hi2c1, (uint16_t)address, (uint8_t*)write_data, (uint16_t)length)!= HAL_OK) ...

But sometimes one need to  read a register  .. two cycles

<start> < address><r/w> < register>    /// no stop  (sequence 1)
< Rddata> <stop>                                    /// no start .(sequence 2)

How is this done using the HAL ?



Outcomes