Electronic – Difference between I2C STM32 HAL functions

embeddedhal-libraryi2cststm32

I'm using I2C in a project on STM32, and i was wondering what's the difference between HAL_I2C_Master_Transmit and HAL_I2C_mem_write, and the difference between HAL_I2C_Master_Receive and HAL_I2C_mem_read.

Best Answer

The MEM functios can directly read and write devices that have register address based access. They write the register addresss before reading or writing the register data. Most chips are like this. The non-MEM functions just do simple reads and writes.