Page 1 of 1

Which I2C functions should I use to create a user C module for MPU6050?

Posted: Tue Mar 09, 2021 1:11 am
by JonatanESalinas
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!

Re: Which I2C functions should I use to create a user C module for MPU6050?

Posted: Tue Mar 09, 2021 7:38 am
by pythoncoder

Re: Which I2C functions should I use to create a user C module for MPU6050?

Posted: Tue Mar 09, 2021 4:29 pm
by JonatanESalinas
pythoncoder wrote:
Tue Mar 09, 2021 7:38 am
See this existing MPU6050 library.
Thank you! But this is a micropython module, what I want to do is to write a user C module (for educational purposes) for the MPU6050 for my custom board, and I don't know exactly which I2C functions should I use to make this.