Compatibility layer for Adafruit CircuitPython drivers on Micropython

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
cefn
Posts: 210
Joined: Tue Aug 09, 2016 10:58 am

Compatibility layer for Adafruit CircuitPython drivers on Micropython

Post by cefn » Wed Mar 07, 2018 2:43 pm

As many of you know, CircuitPython is an Adafruit-commissioned remix of Micropython.

I don't speak for Adafruit, but I understand the differences are about being more accessible and easy for learners (sometimes at the cost of performance or relevance for 'industrial' use cases). Currently CircuitPython is maintained for the target platforms which Adafruit ships (see https://github.com/adafruit/circuitpython/releases ) meaning there are Micropython platforms for which no CircuitPython build is available.

Alongside CircuitPython, Adafruit supports learners also by commissioning and maintaining a whole load of hardware drivers (see e.g. https://github.com/adafruit/Adafruit_Ci ... es/drivers ) which do not run on Micropython, and which would need specialist work to fork a Micropython flavour.

Adafruit commissioned some of my time to experiment with a proof-of-concept compatibility layer, called adafruit-blinka ( the name of the CircuitPython snake https://www.adafruit.com/product/2600 ) which might allow CircuitPython driver code to run directly on a Micropython official build. Assuming your application can accept the marginal increase in RAM, flash and processor overhead, a stable compatibility layer would give Micropython users the benefit of using tested CircuitPython modules without modification.

This is just an informal announcement that early experimentation is positive. I have learned it may be possible to run nearly all CircuitPython code on a Micropython official build, with several drivers having been proven to work with the proof-of-concept compatibility layer. At this stage, interested experimenters working in education who are willing to put up with very beta code might be able to offer feedback or contributions to achieve the CircuitPython conformance which they need for their projects on Micropython platforms.

Currently, there is support for Pin enumeration, I2C and UART support, but as-yet-untested SPI support. You can engage with the public Github repo at https://github.com/adafruit/Adafruit_Micropython_Blinka

Turbinenreiter
Posts: 279
Joined: Sun May 04, 2014 8:54 am

Re: Compatibility layer for Adafruit CircuitPython drivers on Micropython

Post by Turbinenreiter » Wed Mar 07, 2018 7:14 pm

This is truly a great move to battle the drawbacks of forking.

User avatar
pythoncoder
Posts: 3241
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Compatibility layer for Adafruit CircuitPython drivers on Micropython

Post by pythoncoder » Thu Mar 08, 2018 6:22 am

Agreed. :D
Peter Hinch

fpp
Posts: 64
Joined: Wed Jul 20, 2016 12:08 pm

Re: Compatibility layer for Adafruit CircuitPython drivers on Micropython

Post by fpp » Thu Mar 08, 2018 6:55 pm

Great move indeed, if it walks the whole mile !

Adafruit have invested hugely in CircuitPython, not only in the software itself but in its documentation and user support.

Enough at least to give the impression that the original micropython has been stagnating in comparison (not being backed, of course, by a comparable business activity).

So this specific way of "giving back to the upstream" could be seen as a win/win, bolstering both the micropython ecosystem and Adafruit's standing in the community.

Stock up the popcorn :-)

Post Reply