Seeeduino XIAO as i2c-slave with circuitpython?

I found information about how to program the XIAO in the Arduino environment to make it act as an i2c slave (for communication over the i2c bus with a Raspberry Pi as a master e.g.). Has anyone done that using circuitpython on the XIAO?

https://circuitpython.readthedocs.io/en/5.3.x/shared-bindings/i2cslave/init.html @alfons.vandaele There you go

Thank you! I will try that.

Where do I find the module i2cslave. It is not standard include on the XIAO library?

I learned recently that the module has been renamed to i2cperipheral. But it is not standard included. But I still haven’t found the file i2cperipheral.py. I want to include this in my lib directory.

Hi Alfons, i2cperipheral (renamed in 6.0.0) is a native module and is implemented in C. The source is here: https://github.com/adafruit/circuitpython/blob/main/shared-bindings/i2cperipheral/I2CPeripheral.c

It isn’t included in builds for boards with a separate SPI Flash chip like the XIAO. You can modify the build of CircuitPython to include it if you like but you will need to turn other modules off to make space.