Which I2C functions should I use to create a user C module for MPU6050?
Posted: Tue Mar 09, 2021 1:11 am
Hi,
I'm trying to write a user C module to use a MPU6050 in my custom board. This custom board has a STM32F407VGT6 MCU on it.
I want to write data to the MPU6050 and read data from it, using I2C functions. Where is a good place to start looking?
I've seen the file i2c.c and its functions (i2c_write, i2c_writeto, i2c_read, i2c_readfrom), and I looked at machine_i2c.c and its functions (read_mem, write_mem, mp_machine_i2c_writeto, mp_machine_i2c_readfrom). Which of these functions are the ones I should use to communicate my MCU with the sensor?
Thanks in advance!
I'm trying to write a user C module to use a MPU6050 in my custom board. This custom board has a STM32F407VGT6 MCU on it.
I want to write data to the MPU6050 and read data from it, using I2C functions. Where is a good place to start looking?
I've seen the file i2c.c and its functions (i2c_write, i2c_writeto, i2c_read, i2c_readfrom), and I looked at machine_i2c.c and its functions (read_mem, write_mem, mp_machine_i2c_writeto, mp_machine_i2c_readfrom). Which of these functions are the ones I should use to communicate my MCU with the sensor?
Thanks in advance!