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

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
JonatanESalinas
Posts: 5
Joined: Wed Feb 24, 2021 7:34 pm
Location: México

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

Post by JonatanESalinas » 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!


JonatanESalinas
Posts: 5
Joined: Wed Feb 24, 2021 7:34 pm
Location: México

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

Post by JonatanESalinas » Tue Mar 09, 2021 4:29 pm

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.

Post Reply