Enable Hardware I2C2 to Portenta C33 Port
Description
Currently, the Arduino Portenta C33 port only supports hardware I2C0 of the RA6M5. Access to I2C0 is via a connector on the board. If the board is used with the Arduino Protenta Hat Carrier I2C0 is brought out on the RPi 40 pin header to what is usually used by RPi hats for their onboard ID EEPROMs. The other I2C pins typically used for general user access are GPIO2 and GPIO3, 40-pin header pins 3 and 5 respectively. Arduino brings out hardware I2C2 of the C33 on the Ardunio Hat Carrier header pins 3 and 5, mirroring the standard RPi configuration.
Since the I2C configuration for the Portenta C33 port only defines I2C0, and since all the configuration files are generated files from the RA tools, adding support for I2C2 via a hack would be challenging at best.
Code Size
Adding the support fro I2C2 I would suppose, would increase code size only slightly. Barely noticeable on the RA6M5 with its relatively generous resources.
Implementation
I hope the MicroPython maintainers or community will implement this feature
Code of Conduct
Yes, I agree
renesas-ra/boards/ARDUINO_PORTENTA_C33: Fix incorrect I2C pins.
This PR fixes the incorrect assignment of the SCL and SDA pins on the Arduino Portenta C33.
Took the opportunity to also change the number of the interface to 0 as it's connected to IIC0
@iabdalkader helped me to test it. Seems to work:
>>> print(I2C(0))
I2C(0, freq=400000, scl=P408, sda=P407)
Als a bus scan is successful:
from machine import I2C
for addr in I2C(0).scan():
print("🙌 Found device at address 0x%x" %(addr))
prints 🙌 Found device at address 0x21