what is the significance of the I2C_0 in i2c = I2C("I2C_0") , for initialising the i2c variable.It can be seen here:https://github.com/micropython/micropyt ... /README.md .
Thank you!!
i2c = I2C("I2C_0") function of the zephyr port of Micropython
Re: i2c = I2C("I2C_0") function of the zephyr port of Micropython
Zephyr's driver model defines the various peripherals by name (and this is configured in the board/mcu definitions and will correspond to pins etc). MicroPython just makes those names available to the machine API.
See https://docs.zephyrproject.org/latest/r ... index.html
I'm not 100% exactly how you know which pins it will correspond to (most MCUs will have default pins for a given peripheral). I notice for example that ESP32 conifgures the default pins in the devicetree config -- https://github.com/zephyrproject-rtos/z ... /esp32.dts Other boards might inherit it from the MCU config.
Re: i2c = I2C("I2C_0") function of the zephyr port of Micropython
Thank you very much.
In my case the UART and Pin class work perfectly, however I face issues with i2c and spi where although I can import the class but I get device not found on doing
i2c=I2C('I2C_0') in case of i2c and spi=SPI('SPI_0') in case of spi.
It would be very helpful if you can please guide me if you know the solution.
In my case the UART and Pin class work perfectly, however I face issues with i2c and spi where although I can import the class but I get device not found on doing
i2c=I2C('I2C_0') in case of i2c and spi=SPI('SPI_0') in case of spi.
It would be very helpful if you can please guide me if you know the solution.