Make busio.I2C use finalizers for reset instead of bulk reset. This
makes it easier to track and free the memory that the IDF allocates
internally for its "handle".
Now, try_lock (SPI & I2C) & begin_transaction (display bus core) will check
that the related objects are still valid first; if they are not,
the lock/begin transaction will fail by returning false, rather than
"other things" such as raising a Python exception where it is not
permitted, accessing invalid memory, etc.
Closes#8278 and Closes#9426
This adds support for the next RP2 microcontroller, the RP2350.
Thanks to Raspberry Pi folks for early access and to @arturo182,
@oberchoo and @SalamCytron for helping with CircuitPython.
The traditional layout of pixels in bitmaps of depth less than eight
is with the order of values in a byte reversed, but with bytes in
the same order as the pixels on the line.
Before now, displayio.Bitmap did reverse the values, but did it on a
word (four bytes) basis, not byte, which resulted in groups of four
bytes being in the order opposite to the screen order.
This patch fixes this, by making processing of pixels in bitmaps of
depth less than 8 bits based on bytes, not words. Since the internal
details are changing, any code that accessed bitmaps through the
memoryview buffer, or that created bitmaps directly from raw data,
and that used depth of less than 8 bits will be affected.
Therefore, the gen_display_resources.py script also had to be modified
to account for the changes.
This simplifies allocating outside of the VM because the VM doesn't
take up all remaining memory by default.
On ESP we delegate to the IDF for allocations. For all other ports,
we use TLSF to manage an outer "port" heap. The IDF uses TLSF
internally and we use their fork for the other ports.
This also removes the dynamic C stack sizing. It wasn't often used
and is not possible with a fixed outer heap.
Fixes#8512. Fixes#7334.
These are moved:
* Display -> busdisplay.BusDisplay
* FourWire -> fourwire.FourWire
* EPaperDisplay -> epaperdisplay.EPaperDisplay
* I2CDisplay -> i2cdisplaybus.I2CDisplayBus
`paralleldisplay` is now `paralleldisplaybus` (and registered as
`paralleldisplay` too).
Bus related helpers are split out of display_core into bus_core.
It is in still displayio since it is a dependency of both
busdisplay and epaperdisplay.
Fixes#7667