AdaCore / Ada_Drivers_Library

Ada source code and complete sample GNAT projects for selected bare-board platforms supported by GNAT.
BSD 3-Clause "New" or "Revised" License
248 stars 144 forks source link

Changes has been made to the i2c inicialization #402

Closed mbdme26 closed 2 years ago

mbdme26 commented 2 years ago

Hello,

I'm Mario Vicente García and i'm doing a project with the University of Cantabria, Spain.

Carrying out tests to try to send data through the I2C bus to control the motors of the maqueen robot (https://tienda.bricogeek.com/microbit/1271-robot-maqueen-para-microbit.html) using your library and the Microbit V1.3x, we realized that the initialization of the GPIO pins (SCA and SCL) is done incorrectly.

Trying to do a succesful master_transmit to the maqueen address (0x20), the function returned us a 0 (ERROR). Doing an I2C bus probe to see all available addresses on the bus, we realized that only the accelerometer address was available (0x1D), but the compass and maqueen motors addresses were not available.

According to the next manual, the relevant configuration for the pins is the GPIO DRIVE:

https://infocenter.nordicsemi.com/pdf/nRF51_RM_v3.0.pdf (p.145, table 258)

So, applying the configuration on the SCL and SDA pins and doing again the probe of the I2C bus. We managed to see all the bus addresses correctly and successfully perform a master_transmit to the Maqueen motors.

Regards, Mario

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

mbdme26 commented 2 years ago

Good day @Fabien-Chouteau,

I have already made all the changes you requested. Thank you for your help!

Regards, Mario

mbdme26 commented 2 years ago

I'm sorry for the delay @Fabien-Chouteau , Style issues should be fixed. If there's anything else I need to do, don't hesitate to tell me.

Regards, Mario

Fabien-Chouteau commented 2 years ago

Thank you @mbdme26 :+1: