This started while adding USB MIDI support (and descriptor support is
in this change.) When seeing that I'd have to implement the MIDI class
logic twice, once for atmel-samd and once for nrf, I decided to refactor
the USB stack so its shared across ports. This has led to a number of
changes that remove items from the ports folder and move them into
supervisor.
Furthermore, we had external SPI flash support for nrf pending so I
factored out the connection between the usb stack and the flash API as
well. This PR also includes the QSPI support for nRF.
This enables various things in order to support the CPython standard library.
MICROPY_PY_BUILTINS_NOTIMPLEMENTED:
Support NotImplemented for easy conversion of stdlib.
It doesn't do fallbacks though, only raises TypeError.
MICROPY_PY_COLLECTIONS_ORDEREDDICT:
collections.OrderedDict
MICROPY_PY_FUNCTION_ATTRS:
Support function.__name__ for use as key in the function attribute workaround.
MICROPY_PY_IO:
uio module: BytesIO, FileIO, StringIO, TextIOWrapper
Also add 'io' alias.
MICROPY_PY_REVERSE_SPECIAL_METHODS:
Support the __r*__ special methods.
MICROPY_PY_SYS_EXC_INFO:
sys.exc_info() used by unittest when collecting exceptions.
MICROPY_CPYTHON_COMPAT:
Some of the things it adds:
>>> object.__init__
<function>
>>> object.__new__
<function>
>>> object.__class__
<class 'type'>
>>> object().__class__
<class 'object'>
>>> object.__name__
'object'
>>> 'Hello'.encode()
b'Hello'
>>> b'Hello'.decode()
'Hello'
Named tuple field names from string:
namedtuple('Point', 'x y')
Add alias for uerrno so the user doesn't have to know about the
CircuitPython special names for the module.
Make os and time weak modules (aliases) making it possible to add
functionality to those modules written in python.
Example:
'import os' will now look in the path for an os module and if not found
it will import the builtin module. An os module written in python will
import the builtin module through its name prefixed with an underscore
(_os) following the C module naming practice in CPython.
Also right align the macro values to increase readability making it
easier to compare the values for samd21 and samd51. Even the longest
macro from py/mpconfig.h will fit with this alignment.
It's designed to minimize RAM footprint by using Sprites to
represent objects on the screen. The object model also facilitates
partial screen updating which reduces the bandwidth needed to display.
This is all handled in C. Python simply manipulates the objects with
the ability to synchronize to frame timing.
Some boards (like the uGame10) may want to have their own set of extra
modules. This change lets them override EXTRA_BUILTIN_MODULES in their
mpconfigboard.h and makes the ugame10 board do that.
This evolves the API from 2.x (and breaks it). Playback devices are now
separate from the samples themselves. This allows for greater playback
flexibility. Two sample sources are audioio.RawSample and audioio.WaveFile.
They can both be mono or stereo. They can be output to audioio.AudioOut or
audiobusio.I2SOut.
Internally, the dma tracking has changed from a TC counting block transfers
to an interrupt generated by the block event sent to the EVSYS. This reduces
the overhead of each DMA transfer so multiple can occure without using up TCs.
Fixes#652. Fixes#522. Huge progress on #263
.. defaulting to off for circuitpython-supported boards, on for others.
.. fixing up the tests that fail when it is turned off, so that they skip
instead of failing
1. Turn off MICROPY_CPYTHON_COMPAT, which includes a number of minor CPython compatibility features,
most of which have workarounds, but uses up significant flash.
2. Turn on MICROPY_PY_SYS_MAXSIZE, which implements sys.maxsize.
3. Turn on MICROPY_CAN_OVERRIDE_BUILTINS, which implements "_" as the most recent value in the REPL,
and also enables redefining builtins.
* Added asf4_conf/samd*/hpl_sercom_config.h
* Adjusted clocks in peripheral_clk_config.h.
* Put some frozen libs back in CPX for testing.
* Implement common-hal I2C
* Add samd*_peripherals.h in parallel with samd*_pins.h for common
functions and data.
* Store SERCOM index in pins table for convenience.
* Canonicalize some #include guard names in various .h files.
simpler reset of SERCOMs; remove unused routine