pulkin / micropython

MicroPython implementation on Ai-Thinker GPRS module A9 (RDA8955)
https://micropython.org
MIT License
102 stars 30 forks source link

Move the `i2c` module to `machine` #9

Open pulkin opened 4 years ago

pulkin commented 4 years ago

To conform with the API standard.

garudaonekh commented 3 years ago

hi, any update on this? I do not know how to migrate the available I2C libraries to this. many i2c libraries are based on the standard machine.I2C

pulkin commented 3 years ago

You could look how it is implemented here for example.

https://github.com/pulkin/micropython/blob/master/ports/esp8266/machine_hspi.c

garudaonekh commented 3 years ago

You could look how it is implemented here for example.

https://github.com/pulkin/micropython/blob/master/ports/esp8266/machine_hspi.c

I think it is simpler just to write a python class that wraps your existing one so that user can just change to the new class.