rogerclarkmelbourne / Arduino_STM32

Arduino STM32. Hardware files to support STM32 boards, on Arduino IDE 1.8.x including LeafLabs Maple and other generic STM32F103 boards
Other
2.53k stars 1.26k forks source link

STM32F4: Fix support of second I2C device (I2C2) and add a third (I2C3) #936

Closed board707 closed 1 month ago

board707 commented 1 month ago

In the current STM32F4 code, support for the second I2C channel is not fully written and works only on some controllers. Despite the fact that the variant files contains macros for setting I2C2 pins, it values are not used in the code and the I2C2 device is always created on the hard-coded pins PB10 PB11. Because of this, I2C2 does not work on boards where the I2C2 interface uses another pins. This PR fixes these errors, and also adds support for the third (I2C3) channel. Tested I2C1, I2C2 and I2C3 on the blackpil_F401 board.

stevstrong commented 1 month ago

Thank you!