diff --git a/.codespell/exclude-file.txt b/.codespell/exclude-file.txt new file mode 100644 index 0000000000..9f49d9ae0c --- /dev/null +++ b/.codespell/exclude-file.txt @@ -0,0 +1,7 @@ +#define MICROPY_HW_BOARD_NAME "BLOK" +USB_PRODUCT = "BLOK" + uint32_t THI = (*(uint32_t *)FUSES_HOT_TEMP_VAL_INT_ADDR & FUSES_HOT_TEMP_VAL_INT_Msk) >> FUSES_HOT_TEMP_VAL_INT_Pos; + float TH = THI + convert_dec_to_frac(THD); +print(binascii.b2a_base64(b"fo")) + # again, neither will "there" or "wither", since they have "the" +i1Qb$TE"rl diff --git a/.codespell/ignore-words.txt b/.codespell/ignore-words.txt new file mode 100644 index 0000000000..f2a8dc2be5 --- /dev/null +++ b/.codespell/ignore-words.txt @@ -0,0 +1,22 @@ +ans +ure +clen +ser +endianess +pris +synopsys +reenable +dout +inout +wel +iput +hsi +astroid +busses +cyphertext +dum +deque +deques +extint +shs +pass-thru diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..d4ef112d7a --- /dev/null +++ b/.codespellrc @@ -0,0 +1,10 @@ +# See: https://github.com/codespell-project/codespell#using-a-config-file +[codespell] +# In the event of a false positive, add the problematic word, in all lowercase, to 'ignore-words.txt' (one word per line). +# Or copy & paste the whole problematic line to 'exclude-file.txt' +ignore-words = .codespell/ignore-words.txt +exclude-file = .codespell/exclude-file.txt +check-filenames = +check-hidden = +count = +skip = .cproject,.git,./lib,./locale,ACKNOWLEDGEMENTS diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1905b233cf..942a51afdc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,9 +8,19 @@ repos: hooks: - id: check-yaml - id: end-of-file-fixer - exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/espressif/esp-idf-config/.*|ports/espressif/boards/.*/sdkconfig)' + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)' - id: trailing-whitespace - exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/.*)' + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|lib/mbedtls_errors/generate_errors.diff)' +- repo: https://github.com/codespell-project/codespell + rev: v2.2.4 + hooks: + - id: codespell + args: [-w] + exclude: | + (?x)^( + locale/| + lib/ + ) - repo: local hooks: - id: translations diff --git a/Makefile b/Makefile index 50c86fc128..d0f1fcb3d0 100644 --- a/Makefile +++ b/Makefile @@ -324,9 +324,24 @@ clean-stm: $(MAKE) -C ports/stm BOARD=feather_stm32f405_express clean -# Do blobless partial clones of submodules to save time and space. +# If available, do blobless partial clones of submodules to save time and space. # A blobless partial clone lazily fetches data as needed, but has all the metadata available (tags, etc.) # so it does not have the idiosyncrasies of a shallow clone. +# +# If not available, do a fetch that will fail, and then fix it up with a second fetch. +# (Only works for git servers that allow sha fetches.) .PHONY: fetch-submodules fetch-submodules: - git submodule update --init --filter=blob:none + git submodule sync + ##################################################################################### + # NOTE: Ideally, use git version 2.36.0 or later, to do partial clones of submodules. + # If an older git is used, submodules will be cloned with a shallow clone of depth 1. + # You will see a git usage message first if the git version is too old to do + # clones of submodules. + ##################################################################################### + git submodule update --init --filter=blob:none || git submodule update --init -N --depth 1 || git submodule foreach 'git fetch --tags --depth 1 origin $$sha1 && git checkout -q $$sha1' || echo 'make fetch-submodules FAILED' + +.PHONY: remove-submodules +remove-submodules: + git submodule deinit -f --all + rm -rf .git/modules/* diff --git a/conf.py b/conf.py index 7b3b4ca585..ea5072ae4c 100644 --- a/conf.py +++ b/conf.py @@ -77,6 +77,7 @@ needs_sphinx = '1.3' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', + "sphinxcontrib.jquery", 'sphinxcontrib.rsvgconverter', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index f558d66d40..843c143424 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -483,7 +483,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t if (self->scan_results != NULL) { if (!shared_module_bleio_scanresults_get_done(self->scan_results)) { - mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan.")); + mp_raise_bleio_BluetoothError(translate("Scan already in progress. Stop with stop_scan.")); } self->scan_results = NULL; } diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.h b/devices/ble_hci/common-hal/_bleio/Adapter.h index 48d4f2e6a2..45a37ad67c 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.h +++ b/devices/ble_hci/common-hal/_bleio/Adapter.h @@ -65,7 +65,7 @@ typedef struct _bleio_adapter_obj_t { uint16_t manufacturer; uint16_t lmp_subversion; - // Used to monitor advertising timeout for legacy avertising. + // Used to monitor advertising timeout for legacy advertising. uint64_t advertising_start_ticks; uint64_t advertising_timeout_msecs; // If zero, do not check. diff --git a/devices/ble_hci/common-hal/_bleio/Connection.c b/devices/ble_hci/common-hal/_bleio/Connection.c index 9531231506..e9e1254b43 100644 --- a/devices/ble_hci/common-hal/_bleio/Connection.c +++ b/devices/ble_hci/common-hal/_bleio/Connection.c @@ -515,7 +515,7 @@ void common_hal_bleio_connection_set_connection_interval(bleio_connection_intern // (gattc_char->char_props.write ? CHAR_PROP_WRITE : 0) | // (gattc_char->char_props.write_wo_resp ? CHAR_PROP_WRITE_NO_RESPONSE : 0); -// // Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler. +// // Call common_hal_bleio_characteristic_construct() to initialize some fields and set up evt handler. // common_hal_bleio_characteristic_construct( // characteristic, m_char_discovery_service, gattc_char->handle_value, uuid, // props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index f649967ca9..9dfe9eb26c 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -96,7 +96,7 @@ STATIC uint8_t bleio_properties_to_ble_spec_properties(uint8_t bleio_properties) return ble_spec_properties; } -// FIX not currently used; reenable when used. +// FIX not currently used; re-enable when used. #if 0 STATIC uint8_t ble_spec_properties_to_bleio_properties(uint8_t ble_spec_properties) { uint8_t bleio_properties = 0; @@ -964,7 +964,7 @@ static void process_read_group_req(uint16_t conn_handle, uint16_t mtu, uint8_t d // Keep track of the first one to make sure. size_t sizeof_first_service_uuid = 0; - // Size of a single bt_att_group_data chunk. Start with the intial size, and + // Size of a single bt_att_group_data chunk. Start with the initial size, and // add the uuid size in the loop below. size_t data_length = sizeof(struct bt_att_group_data); diff --git a/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h b/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h index af8695da98..0f03894caa 100644 --- a/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h +++ b/devices/ble_hci/common-hal/_bleio/hci_include/att_internal.h @@ -150,7 +150,7 @@ struct bt_att_read_mult_req { uint16_t handles[]; } __packed; -/* Read Multiple Respose */ +/* Read Multiple Response */ #define BT_ATT_OP_READ_MULT_RSP 0x0f struct bt_att_read_mult_rsp { uint8_t _dummy[0]; @@ -243,7 +243,7 @@ struct bt_att_read_mult_vl_req { uint16_t handles[]; } __packed; -/* Read Multiple Respose */ +/* Read Multiple Response */ #define BT_ATT_OP_READ_MULT_VL_RSP 0x21 struct bt_att_read_mult_vl_rsp { uint16_t len; diff --git a/examples/natmod/features1/features1.c b/examples/natmod/features1/features1.c index f865f1887c..a5e82252a1 100644 --- a/examples/natmod/features1/features1.c +++ b/examples/natmod/features1/features1.c @@ -88,7 +88,7 @@ mp_obj_t mpy_init(mp_obj_fun_bc_t *self, size_t n_args, size_t n_kw, mp_obj_t *a // This must be first, it sets up the globals dict and other things MP_DYNRUNTIME_INIT_ENTRY - // Messages can be printed as usualy + // Messages can be printed as usually mp_printf(&mp_plat_print, "initialising module self=%p\n", self); // Make the functions available in the module's namespace diff --git a/locale/ID.po b/locale/ID.po index a136f6e498..21d3e4a4c2 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -183,10 +183,6 @@ msgstr "%q harus <= %d" msgid "%q must be >= %d" msgstr "%q harus >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -195,6 +191,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -403,10 +403,6 @@ msgstr "0.0 ke kompleks berpangkat" msgid "3-arg pow() not supported" msgstr "pow() 3-arg tidak didukung" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1233,7 +1229,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1282,6 +1279,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ukuran potongan format tidak valid" @@ -1531,10 +1532,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Tidak ada kunci yang ditentukan" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Tidak ada dukungan bilangan bulat yang panjang" @@ -1961,8 +1958,8 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Pindai sudah dalam proses. Hentikan dengan stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2274,6 +2271,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2309,11 +2311,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2768,7 +2765,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3068,8 +3065,8 @@ msgid "extra positional arguments given" msgstr "argumen posisi ekstra telah diberikan" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4143,10 +4140,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4403,6 +4396,12 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "Zi harus berbentuk (n_section, 2)" +#~ msgid "No key was specified" +#~ msgstr "Tidak ada kunci yang ditentukan" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Pindai sudah dalam proses. Hentikan dengan stop_scan." + #~ msgid "Supply at least one UART pin" #~ msgstr "Berikan setidaknya satu pin UART" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0c7f823b5a..b5026f7829 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -180,10 +180,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -192,6 +188,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -400,10 +400,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1221,7 +1217,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1270,6 +1267,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -1519,10 +1520,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1935,7 +1932,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2248,6 +2245,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2283,11 +2285,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2740,7 +2737,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3040,8 +3037,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4114,10 +4111,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index 1d666730ec..a8d09ade34 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -184,10 +184,6 @@ msgstr "%q musí být <= %d" msgid "%q must be >= %d" msgstr "%q musí být >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -196,6 +192,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -404,10 +404,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "pow() nepodporuje 3 argumenty" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit typy" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1233,7 +1229,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1282,6 +1279,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "Chybný data_pin[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Neplatná velikost bloku" @@ -1531,10 +1532,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Nebyl zadán klíč" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1950,7 +1947,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2263,6 +2260,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2298,11 +2300,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2755,7 +2752,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3055,8 +3052,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4129,10 +4126,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4389,6 +4382,12 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "64 bit types" +#~ msgstr "64 bit typy" + +#~ msgid "No key was specified" +#~ msgstr "Nebyl zadán klíč" + #~ msgid "%q pin invalid" #~ msgstr "pin %q není platný" diff --git a/locale/de_DE.po b/locale/de_DE.po index f6bc0b789e..ab543ccea4 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,14 +6,14 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-01 17:39+0000\n" -"Last-Translator: Ettore Atalan \n" +"PO-Revision-Date: 2023-03-28 14:18+0000\n" +"Last-Translator: Luc \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.16\n" +"X-Generator: Weblate 4.17-dev\n" #: main.c msgid "" @@ -37,12 +37,17 @@ msgid "" "Please file an issue with your program at https://github.com/adafruit/" "circuitpython/issues." msgstr "" +"\n" +"Bitte erstellen Sie ein Problem (Issue) für Ihr Programm unter https://" +"github.com/adafruit/circuitpython/issues." #: supervisor/shared/safe_mode.c msgid "" "\n" "Press reset to exit safe mode.\n" msgstr "" +"\n" +"Drücke Reset, um den Sicherheitsmodus zu beenden.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -187,19 +192,19 @@ msgstr "%q muss <= %d sein" msgid "%q must be >= %d" msgstr "%q muss >= %d sein" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "" +msgstr "%q muss ein Bytearray oder ein Array vom Typ 'H' oder 'B' sein" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" "%q muss ein Byte-Array oder ein array vom Typ 'h', 'H', 'b', oder 'B' sein" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "%q muss ein Array vom Typ 'H' sein" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -409,10 +414,6 @@ msgstr "0.0 zu einer komplexen Potenz" msgid "3-arg pow() not supported" msgstr "3-arg pow() wird nicht unterstützt" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit-Typen" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -526,7 +527,7 @@ msgstr "Sucht bereits nach Wifi-Netzwerken" #: shared-module/os/getenv.c #, c-format msgid "An error occurred while retrieving '%s':\n" -msgstr "" +msgstr "Ein Fehler ist aufgetreten beim Abfragen von '%s':\n" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" @@ -602,7 +603,7 @@ msgstr "Bitmap-Grösse und Bits pro Wert müssen übereinstimmen" #: supervisor/shared/safe_mode.c msgid "Boot device must be first (interface #0)." -msgstr "" +msgstr "Boot-Device muss an erster Stelle kommen (Interface #0)." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" @@ -792,9 +793,8 @@ msgstr "" "Die Frequenz eines bereits verwendeten Timers kann nicht variiert werden" #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -#, fuzzy msgid "Cannot wake on pin edge, only level" -msgstr "Kann nicht durch \"Pin edge\" geweckt werden nur durch \"level\"" +msgstr "Kann nicht durch Flanke an Pin geweckt werden, sondern nur durch Pegel" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." @@ -826,11 +826,11 @@ msgstr "" #: shared-bindings/bitmaptools/__init__.c msgid "Coordinate arrays have different lengths" -msgstr "" +msgstr "Koordinaten-Arrays haben unterschiedliche Längen" #: shared-bindings/bitmaptools/__init__.c msgid "Coordinate arrays types have different sizes" -msgstr "" +msgstr "Typen der Koordinaten-Arrays haben unterschiedliche Längen" #: py/persistentcode.c msgid "Corrupt .mpy file" @@ -951,7 +951,7 @@ msgstr "Fehler in regex" #: supervisor/shared/safe_mode.c msgid "Error in safemode.py." -msgstr "" +msgstr "Fehler in safemode.py." #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "Error: Failure to bind" @@ -1028,7 +1028,7 @@ msgstr "Interner Flash konnte nicht geschrieben werden." #: supervisor/shared/safe_mode.c msgid "Fault detected by hardware." -msgstr "" +msgstr "Hardware hat Fehler festgestellt." #: py/moduerrno.c msgid "File exists" @@ -1121,12 +1121,13 @@ msgstr "Hardware in Benutzung, probiere alternative Pins" #: supervisor/shared/safe_mode.c msgid "Heap allocation when VM not running." -msgstr "" +msgstr "Allokation auf Heap während VM nicht läuft." #: supervisor/shared/safe_mode.c msgid "" "Heap was corrupted because the stack was too small. Increase stack size." msgstr "" +"Heap wurde beschädigt, weil der Stack zu klein war. Bitte Stack vergrößern." #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -1250,9 +1251,10 @@ msgstr "Der Interne WatchDog Timer ist abgelaufen." #: supervisor/shared/safe_mode.c msgid "Interrupt error." -msgstr "" +msgstr "Interrupt Fehler." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Ungültiger %q" @@ -1277,7 +1279,7 @@ msgstr "Ungültige BSSID" #: main.c msgid "Invalid CIRCUITPY_PYSTACK_SIZE\n" -msgstr "" +msgstr "Ungültiger Wert CIRCUITPY_PYSTACK_SIZE\n" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" @@ -1301,6 +1303,10 @@ msgstr "Ungültiges Byte %.*s" msgid "Invalid data_pins[%d]" msgstr "Ungültige data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ungültige format chunk size" @@ -1324,7 +1330,7 @@ msgstr "Ungültiger Zustand" #: shared-module/os/getenv.c msgid "Invalid unicode escape" -msgstr "" +msgstr "Ungültiges Unicode-Escape-Zeichen" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" @@ -1551,10 +1557,6 @@ msgstr "Nicht in Programm" msgid "No in or out in program" msgstr "Kein Ein oder Aus in Programm" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Es wurde kein Schlüssel angegeben" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Keine langen Integer (long) unterstützt" @@ -1723,7 +1725,7 @@ msgstr "Zeit für Vorgang abgelaufen" #: ports/raspberrypi/common-hal/mdns/Server.c msgid "Out of MDNS service slots" -msgstr "" +msgstr "Keine freien Slots für MDNS-Dienst mehr verfügbar" #: ports/espressif/common-hal/espidf/__init__.c msgid "Out of memory" @@ -1829,7 +1831,7 @@ msgstr "Polygone brauchen mindestens 3 Punkte" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "Der Präfix-Puffer muss sich auf dem Heap befinden" +msgstr "Präfix-Puffer muss sich auf dem Heap befinden" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload.\n" @@ -1877,7 +1879,7 @@ msgstr "RNG DeInit-Fehler" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "RNG Init-Fehler" +msgstr "RNG-Init-Fehler" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c @@ -1979,8 +1981,8 @@ msgstr "Maßstabs-Abmeßungen müssen durch 3 teilbar sein" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Scannen bereits in Bearbeitung. Stoppe mit stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "Scan läuft schon. Stoppen mit stop_scan." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2018,7 +2020,7 @@ msgstr "SocketPool kann nur mit wifi.radio verwendet werden" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "Quell- und Zielbuffer müssen gleich lang sein" +msgstr "Quell- und Zielpuffer müssen gleich lang sein" #: shared-bindings/paralleldisplay/ParallelBus.c msgid "Specify exactly one of data0 or data_pins" @@ -2038,7 +2040,7 @@ msgstr "Stereo rechts muss sich auf PWM-Kanal B befinden" #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Stopping AP is not supported." -msgstr "" +msgstr "Das Stoppen des AP wird nicht unterstützt." #: shared-bindings/alarm/time/TimeAlarm.c msgid "Supply one of monotonic_time or epoch_time" @@ -2055,6 +2057,8 @@ msgstr "Zeitüberschreitung beim Auslesen der Temperatur" #: supervisor/shared/safe_mode.c msgid "The `microcontroller` module was used to boot into safe mode." msgstr "" +"Das 'microcontroller'-Modul wurde benutzt, um in den Sichheitsmodus zu " +"booten." #: py/obj.c msgid "The above exception was the direct cause of the following exception:" @@ -2068,6 +2072,8 @@ msgstr "Die Länge von rgb_pins muss 6, 12, 18, 24 oder 30 betragen" #: supervisor/shared/safe_mode.c msgid "The power dipped. Make sure you are providing enough power." msgstr "" +"Die Spannung ist eingebrochen. Stelle sicher, dass genügend Leistung " +"verfügbar ist." #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -2076,7 +2082,7 @@ msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "Die Kanalanzahl des Samples stimmt nicht mit der des Mixers überein" +msgstr "Die Kanalanzahl des Samples stimmt nicht mit der des Mischers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" @@ -2084,12 +2090,11 @@ msgstr "Die Abtastrate der Probe stimmt nicht mit der des Mischers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "" -"Die Art des Vorzeichens des Samples stimmt nicht mit dem des Mixers überein" +msgstr "Der Vorzeichentyp des Samples stimmt nicht mit dem des Mixers überein" #: supervisor/shared/safe_mode.c msgid "Third-party firmware fatal error." -msgstr "" +msgstr "Fataler Fehler bei Drittanbieter-Firmware." #: shared-module/imagecapture/ParallelImageCapture.c msgid "This microcontroller does not support continuous capture." @@ -2109,7 +2114,7 @@ msgstr "Die Kachelhöhe muss die Bitmaphöhe genau teilen" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "Kachel index außerhalb der Grenzen" +msgstr "Kachelindex außerhalb der Grenzen" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" @@ -2136,7 +2141,7 @@ msgstr "Zu viele Kanäle im sample." #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "Zu viele Display Busse" +msgstr "Zu viele Anzeigebusse" #: shared-module/displayio/__init__.c msgid "Too many displays" @@ -2172,7 +2177,7 @@ msgstr "UART-Initialisierung" #: ports/raspberrypi/common-hal/busio/UART.c msgid "UART peripheral in use" -msgstr "" +msgstr "UART-Endgerät in Benutzung" #: ports/stm/common-hal/busio/UART.c msgid "UART re-init" @@ -2223,12 +2228,12 @@ msgstr "Konnte keine Buffer für Vorzeichenumwandlung allozieren" #: supervisor/shared/safe_mode.c msgid "Unable to allocate the heap." -msgstr "" +msgstr "Keine Allokation auf dem Heap möglich." #: ports/espressif/common-hal/analogbufio/BufferedIn.c #, c-format msgid "Unable to configure ADC DMA controller, ErrorCode:%d" -msgstr "" +msgstr "ADC-DMA-Controller konnte nicht konfiguriert werden, Fehlercode: %d" #: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" @@ -2251,7 +2256,7 @@ msgstr "Parser konnte nicht gestartet werden" #: ports/espressif/common-hal/analogbufio/BufferedIn.c #, c-format msgid "Unable to initialize ADC DMA controller, ErrorCode:%d" -msgstr "" +msgstr "ADC-DMA-Controller konnte nicht initialisiert werden, Fehlercode: %d" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" @@ -2260,7 +2265,7 @@ msgstr "Konnte Farbpalettendaten nicht lesen" #: ports/espressif/common-hal/analogbufio/BufferedIn.c #, c-format msgid "Unable to start ADC DMA controller, ErrorCode:%d" -msgstr "" +msgstr "ADC-DMA-Controller konnte nicht gestartet werden, Fehlercode: %d" #: ports/espressif/common-hal/mdns/Server.c #: ports/raspberrypi/common-hal/mdns/Server.c @@ -2298,6 +2303,11 @@ msgstr "Unbekannter BLE-Fehler bei %s:%d: %d" msgid "Unknown BLE error: %d" msgstr "Unbekannter BLE-Fehler: %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "Unbekannter Fehlercode %d" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2333,11 +2343,6 @@ msgstr "Unbekannter Systemfirmware Fehler: %04x" msgid "Unknown system firmware error: %d" msgstr "Unbekannter System-Firmware-Fehler: %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "Unbekannter Fehlercode %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2379,7 +2384,7 @@ msgstr "Update fehlgeschlagen" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "Wert Länge != Erforderliche feste Länge" +msgstr "Länge des Wertes != Erforderliche feste Länge" #: ports/espressif/common-hal/_bleio/Characteristic.c #: ports/espressif/common-hal/_bleio/Descriptor.c @@ -2440,11 +2445,11 @@ msgstr "Wi-Fi: " #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in access point mode." -msgstr "" +msgstr "Das Wifi ist im Accesspoint-Modus." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in station mode." -msgstr "" +msgstr "Das Wifi ist im Station-Modus." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is not enabled" @@ -2457,59 +2462,59 @@ msgstr "Aufgeweckt durch Alarm.\n" #: ports/espressif/common-hal/_bleio/PacketBuffer.c #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "Schreiben nicht unterstüzt für diese Charakteristik" +msgstr "Schreiben für diese Charakteristik nicht unterstützt" #: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "You pressed both buttons at start up." -msgstr "" +msgstr "Beide Knöpfe wurden beim Starten gedrückt." #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h #: ports/espressif/boards/m5stack_stick_c/mpconfigboard.h msgid "You pressed button A at start up." -msgstr "" +msgstr "Knopf A wurde beim Starten gedrückt." #: supervisor/shared/safe_mode.c msgid "You pressed the BOOT button at start up" -msgstr "" +msgstr "Der BOOT-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/adafruit_huzzah32_breakout/mpconfigboard.h msgid "You pressed the GPIO0 button at start up." -msgstr "" +msgstr "Der GPIO0-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h msgid "You pressed the Rec button at start up." -msgstr "" +msgstr "Der Rec-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." -msgstr "" +msgstr "Der SW38-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h msgid "You pressed the VOLUME button at start up." -msgstr "" +msgstr "Der VOLUME-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_u/mpconfigboard.h msgid "You pressed the central button at start up." -msgstr "" +msgstr "Der zentrale Knopf wurde beim Starten gedrückt." #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "You pressed the left button at start up." -msgstr "" +msgstr "Der linke Knopf wurde beim Starten gedrückt." #: supervisor/shared/safe_mode.c msgid "You pressed the reset button during boot." -msgstr "" +msgstr "Der Reset-Knopf wurde beim Booten gedrückt." #: supervisor/shared/micropython.c msgid "[truncated due to length]" -msgstr "" +msgstr "[abgeschnitten wegen der Länge]" #: py/objtype.c msgid "__init__() should return None" @@ -2582,7 +2587,7 @@ msgstr "Das Array hat zu viele Dimensionen" #: extmod/ulab/code/ndarray.c msgid "array is too big" -msgstr "" +msgstr "Array ist zu groß" #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c @@ -2797,8 +2802,8 @@ msgstr "kann keinen relativen Import durchführen" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" msgstr "" -"Nicht \"None\" Werte können nicht an einen gerade gestarteten Generator " -"gesendet werden" +"Nicht-None-Wert kann nicht an einen gerade gestarteten Generator gesendet " +"werden" #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" @@ -2808,9 +2813,9 @@ msgstr "Kann Blockgröße von 512 nicht setzen" msgid "can't set attribute" msgstr "kann Attribut nicht setzen" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" -msgstr "" +msgstr "Attribut '%q' kann nicht gesetzt werden" #: py/emitnative.c msgid "can't store '%q'" @@ -2880,7 +2885,7 @@ msgstr "Kanal wird erneut initialisiert" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "(char) Zeichenpuffer zu klein" +msgstr "Zeichenpuffer zu klein" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" @@ -2946,7 +2951,7 @@ msgstr "Convolve-Argumente müssen ndarrays sein" #: extmod/ulab/code/numpy/filter.c msgid "convolve arguments must not be empty" -msgstr "Convolve Argumente dürfen nicht leer sein" +msgstr "Faltungsargumente dürfen nicht leer sein" #: extmod/ulab/code/numpy/io/io.c msgid "corrupted file" @@ -2997,8 +3002,8 @@ msgstr "default ist keine Funktion" msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" -"Der Zielbuffer muss ein Bytearray oder ein Array vom Typ 'B' für bit_depth = " -"8 sein" +"Zielpuffer muss ein Bytearray oder ein Array vom Typ 'B' für bit_depth = 8 " +"sein" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" @@ -3058,7 +3063,7 @@ msgstr "leere Sequenz" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "Ende des Formats wärend der Suche nach einem conversion specifier" +msgstr "Ende des Formats bei der Suche nach einem Konvertierungsspezifizierer" #: shared-bindings/alarm/time/TimeAlarm.c msgid "epoch_time not supported on this board" @@ -3074,6 +3079,8 @@ msgid "" "espcamera.Camera requires reserved PSRAM to be configured. See the " "documentation for instructions." msgstr "" +"espcamera.Camera benötigt reservierten PSRAM um konfiguriert zu werden. " +"Siehe Dokumentation für Anweisungen." #: py/runtime.c msgid "exceptions must derive from BaseException" @@ -3116,8 +3123,8 @@ msgid "extra positional arguments given" msgstr "Es wurden zusätzliche Argumente ohne Schlüsselwort angegeben" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "Die Datei muss eine im Byte-Modus geöffnete Datei sein" @@ -3293,7 +3300,7 @@ msgstr "Index ist außerhalb der Grenzen" #: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" -msgstr "" +msgstr "Index muss tuple oder int sein" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c @@ -3485,7 +3492,7 @@ msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "iterations did not converge" -msgstr "Iterationen sind nicht konvergiert (converged)" +msgstr "Iterationen sind nicht konvergiert" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -3553,7 +3560,7 @@ msgstr "mDNS funktioniert nur mit integriertem WiFi" #: py/parse.c msgid "malformed f-string" -msgstr "fehlformatierter f-string" +msgstr "fehlerhafter F-String" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -3637,7 +3644,7 @@ msgstr "Mehrfache Vererbung nicht unterstützt" #: py/emitnative.c msgid "must raise an object" -msgstr "muss ein Objekt verursachen (raise)" +msgstr "muss ein Objekt aufwerfen (raise)" #: py/modbuiltins.c msgid "must use keyword argument for key function" @@ -3657,7 +3664,7 @@ msgstr "native Methode zu groß" #: py/emitnative.c msgid "native yield" -msgstr "native Ausbeute (yield)" +msgstr "natives yield" #: py/runtime.c #, c-format @@ -3670,15 +3677,15 @@ msgstr "negative Fakultät" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung" +msgstr "negative Potenz ohne Gleitkomma(float)-Unterstützung" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "Negative shift Anzahl" +msgstr "Negative Anzahl an Verschiebungen" #: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" -msgstr "" +msgstr "verschachtelter Index muss int sein" #: shared-module/sdcardio/SDCard.c msgid "no SD card" @@ -3686,11 +3693,11 @@ msgstr "keine SD-Karte" #: py/vm.c msgid "no active exception to reraise" -msgstr "Keine aktive Ausnahme zu verusachen (raise)" +msgstr "Keine aktive Ausnahme zum Wiederaufwerfen (reraise)" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "Kein Binding für nonlocal gefunden" +msgstr "Keine Bindung für nichtlokale Variable gefunden" #: shared-module/msgpack/__init__.c msgid "no default packer" @@ -3720,7 +3727,7 @@ msgstr "kein solches Attribut" #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "non-UUID gefunden in service_uuids_whitelist" +msgstr "Nicht-UUID in service_uuids_whitelist gefunden" #: py/compile.c msgid "non-default argument follows default argument" @@ -3736,7 +3743,7 @@ msgstr "Nicht-Schlüsselwort arg nach * / **" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "Nicht-Schlüsselwort Argument nach Schlüsselwort Argument" +msgstr "Nicht-Schlüsselwort-Argument nach Schlüsselwort-Argument" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "non-zero timeout must be > 0.01" @@ -3753,11 +3760,12 @@ msgstr "keine 128-bit UUID" #: py/objstr.c msgid "not all arguments converted during string formatting" msgstr "" -"Nicht alle Argumente wurden während der Formatierung des Strings konvertiert" +"Nicht alle Argumente wurden während der Formatierung der Zeichenfolge " +"konvertiert" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "Nicht genügend Argumente für den Formatierungs-String" +msgstr "Nicht genügend Argumente für die Formatzeichenfolge" #: extmod/ulab/code/numpy/carray/carray_tools.c msgid "not implemented for complex dtype" @@ -3853,11 +3861,11 @@ msgstr "nur Mono wird unterstützt" #: extmod/ulab/code/numpy/create.c msgid "only ndarrays can be concatenated" -msgstr "" +msgstr "nur ndarrays können aneinandergehängt werden" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only oversample=64 is supported" -msgstr "" +msgstr "nur oversample=64 wird unterstützt" #: ports/nrf/common-hal/audiobusio/PDMIn.c #: ports/stm/common-hal/audiobusio/PDMIn.c @@ -3894,7 +3902,7 @@ msgstr "Operation wird nur für boolesche 1D-Arrays implementiert" #: extmod/ulab/code/numpy/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "Die Operation ist für ndarrays nicht implementiert" +msgstr "Operation ist auf ndarrays nicht implementiert" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" @@ -3946,7 +3954,7 @@ msgstr "Die Parameter müssen Register der Reihenfolge a2 bis a5 sein" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "Die Parameter müssen Register der Reihenfolge r0 bis r3 sein" +msgstr "Parameter müssen Register im Bereich von r0 bis r3 sein" #: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" @@ -3987,7 +3995,7 @@ msgstr "pow() drittes Argument darf nicht 0 sein" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "pow() mit 3 Argumenten erfordert Integer" +msgstr "pow() mit 3 Argumenten erfordert ganze Zahlen" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" @@ -4019,7 +4027,7 @@ msgstr "Rückgabewert-Beschreibung muss ein Identifier sein" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "Rückgabe erwartet '%q', aber '%q' erhalten" +msgstr "Rückgabe (return) erwartet '%q', hat aber '%q' erhalten" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -4029,7 +4037,7 @@ msgstr "rgb_pins[%d] dupliziert eine andere Pinbelegung" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "rgb_pins [%d] befindet sich nicht am selben Port wie clock" +msgstr "rgb_pins[%d] befindet sich nicht am selben Port wie clock" #: extmod/ulab/code/numpy/numerical.c msgid "roll argument must be an ndarray" @@ -4066,7 +4074,7 @@ msgstr "kurze Lektüre" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "Vorzeichen nicht erlaubt in einem String formatierungs specifier" +msgstr "Vorzeichen im Zeichenfolgenformatbezeichner nicht zulässig" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" @@ -4098,7 +4106,7 @@ msgstr "weicher reboot\n" #: extmod/ulab/code/numpy/numerical.c msgid "sort argument must be an ndarray" -msgstr "sortierungs Argument muss ein ndarray sein" +msgstr "Sortierungsargument muss ein ndarray sein" #: extmod/ulab/code/scipy/signal/signal.c msgid "sos array must be of shape (n_section, 6)" @@ -4203,10 +4211,6 @@ msgstr "Zeitstempel außerhalb des Bereichs für Plattform time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes kann nur für dichte Arrays aufgerufen werden" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "zu viele Argumente mit dem angegebenen Format" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "zu viele Dimensionen" @@ -4222,7 +4226,7 @@ msgstr "zu viele Lokale für die native Methode" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "zu viele Werte zum Auspacken (erwartet %d)" +msgstr "zu viele Werte zum Auspacken (%d erwartet)" #: extmod/ulab/code/numpy/approx.c msgid "trapz is defined for 1D arrays of equal length" @@ -4256,7 +4260,7 @@ msgstr "Typ ist kein akzeptierter Basis-Typ" #: py/objgenerator.c py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "Typ vom Objekt '%q' hat kein Attribut '%q'" +msgstr "Typ-Objekt '%q' hat kein Attribut '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" @@ -4286,7 +4290,7 @@ msgstr "unerwartetes Schlüsselwort-Argument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "Unicode Name ausgebrochen (escaped)" +msgstr "Escaping von Unicode-Namen" #: py/parse.c msgid "unindent doesn't match any outer indent level" @@ -4295,7 +4299,7 @@ msgstr "unindent stimmt mit keiner äußeren Einrückungsebene überein" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "unbekannter Konvertierungs specifier %c" +msgstr "unbekannter Konvertierungsspezifizierer %c" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" @@ -4312,7 +4316,7 @@ msgstr "unbekannter Typ '%q'" #: py/objstr.c #, c-format msgid "unmatched '%c' in format" -msgstr "" +msgstr "'%c' in Format konnte nicht zugeordnet werden" #: py/objtype.c py/runtime.c msgid "unreadable attribute" @@ -4465,6 +4469,22 @@ msgstr "zi muss eine Gleitkommazahl sein" msgid "zi must be of shape (n_section, 2)" msgstr "zi muss die Form (n_section, 2) haben" +#~ msgid "64 bit types" +#~ msgstr "64 bit-Typen" + +#~ msgid "No key was specified" +#~ msgstr "Es wurde kein Schlüssel angegeben" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Scannen bereits in Bearbeitung. Stoppe mit stop_scan." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "Unbekannter Fehlercode %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "zu viele Argumente mit dem angegebenen Format" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/locale/el.po b/locale/el.po index f2382feb94..3336cbae67 100644 --- a/locale/el.po +++ b/locale/el.po @@ -188,10 +188,6 @@ msgstr "%q πρέπει να είναι <= %d" msgid "%q must be >= %d" msgstr "%q πρέπει να είναι >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -200,6 +196,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q πρέπει να είναι bytearray ή array τύπου 'h', 'H', 'b', ή 'B'" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -408,11 +408,6 @@ msgstr "0.0 σε μία σύνθετη δύναμη" msgid "3-arg pow() not supported" msgstr "pow() με 3 παραμέτρους δεν υποστηρίζεται" -#: shared-module/msgpack/__init__.c -#, fuzzy -msgid "64 bit types" -msgstr "64 bit τύποι" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1242,7 +1237,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1291,6 +1287,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -1540,10 +1540,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1958,7 +1954,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2271,6 +2267,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2306,11 +2307,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2763,7 +2759,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3063,8 +3059,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4137,10 +4133,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4397,6 +4389,10 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#, fuzzy +#~ msgid "64 bit types" +#~ msgstr "64 bit τύποι" + #~ msgid "%q pin invalid" #~ msgstr "%q άκυρο pin" diff --git a/locale/en_GB.po b/locale/en_GB.po index 45131d1dcb..9c26f47d45 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -187,10 +187,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "%q must be >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -199,6 +195,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -407,10 +407,6 @@ msgstr "0.0 to a complex power" msgid "3-arg pow() not supported" msgstr "3-arg pow() not supported" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit types" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1234,7 +1230,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Invalid %q" @@ -1283,6 +1280,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "Invalid data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Invalid format chunk size" @@ -1532,10 +1533,6 @@ msgstr "No in in program" msgid "No in or out in program" msgstr "No in or out in program" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "No key was specified" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "No long integer support" @@ -1956,8 +1953,8 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2269,6 +2266,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2304,11 +2306,6 @@ msgstr "Unknown system firmware error: %04x" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2763,7 +2760,7 @@ msgstr "can't set 512 block size" msgid "can't set attribute" msgstr "can't set attribute" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3066,8 +3063,8 @@ msgid "extra positional arguments given" msgstr "extra positional arguments given" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "file must be a file opened in byte mode" @@ -4140,10 +4137,6 @@ msgstr "timestamp out of range for platform time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes can be invoked for dense arrays only" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "too many arguments provided with the given format" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "too many dimensions" @@ -4400,6 +4393,18 @@ msgstr "zi must be of float type" msgid "zi must be of shape (n_section, 2)" msgstr "zi must be of shape (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "64 bit types" + +#~ msgid "No key was specified" +#~ msgstr "No key was specified" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Scan already in progess. Stop with stop_scan." + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "too many arguments provided with the given format" + #~ msgid "Supply at least one UART pin" #~ msgstr "Supply at least one UART pin" diff --git a/locale/es.po b/locale/es.po index cf81206c3d..d5db9c0c88 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-09 10:38+0000\n" +"PO-Revision-Date: 2023-03-25 02:42+0000\n" "Last-Translator: Jose David M \n" "Language-Team: \n" "Language: es\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.16.2-dev\n" +"X-Generator: Weblate 4.17-dev\n" #: main.c msgid "" @@ -195,10 +195,6 @@ msgstr "%q debe ser <= %d" msgid "%q must be >= %d" msgstr "%q debe ser >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "%q debe ser un arreglo de tipo 'H'" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q debe ser un bytearray o array de tipo 'H' o 'B'" @@ -207,6 +203,10 @@ msgstr "%q debe ser un bytearray o array de tipo 'H' o 'B'" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q debe ser un byte-matriz o matriz de tipo 'h', 'H', 'b', o 'B'" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "%q debe ser un arreglo de tipo 'H'" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -415,10 +415,6 @@ msgstr "0.0 a una potencia compleja" msgid "3-arg pow() not supported" msgstr "pow() con 3 argumentos no soportado" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "tipos de 64 bit" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1267,7 +1263,8 @@ msgstr "El temporizador interno watchdog terminó." msgid "Interrupt error." msgstr "Error de interrupción." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "%q inválido" @@ -1292,7 +1289,7 @@ msgstr "BSSID inválido" #: main.c msgid "Invalid CIRCUITPY_PYSTACK_SIZE\n" -msgstr "" +msgstr "CIRCUITPY_PYSTACK_SIZE inválido\n" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" @@ -1316,6 +1313,10 @@ msgstr "byte %.*s Inválido" msgid "Invalid data_pins[%d]" msgstr "Inválidos los data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Formato de fragmento de formato no válido" @@ -1569,10 +1570,6 @@ msgstr "No hay \"in\" en el programa" msgid "No in or out in program" msgstr "No hay \"in\" o \"out\" en el programa" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "No se especificó ninguna llave" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "No hay soporte de entero largo" @@ -2000,8 +1997,8 @@ msgstr "Las dimensiones de escala debe ser divisibles por 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Escaneo en progreso. Usa stop_scan para detener." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "Escaneo en progreso. Usa stop_scan para detenerlo." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2320,6 +2317,11 @@ msgstr "Error BLE desconocido en %s:%d: %d" msgid "Unknown BLE error: %d" msgstr "Error BLE desconocido: %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "Código de error desconocido %d" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2355,11 +2357,6 @@ msgstr "Error desconocido en el firmware sistema: %04x" msgid "Unknown system firmware error: %d" msgstr "Error del sistema de firmware desconocido: %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "Codigo de error desconocido: %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2823,7 +2820,7 @@ msgstr "no se puede definir un tamaño de bloque de 512" msgid "can't set attribute" msgstr "no se puede asignar el atributo" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "no se puede configurar el attributo '%q'" @@ -3131,8 +3128,8 @@ msgid "extra positional arguments given" msgstr "argumento posicional adicional dado" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "el archivo deberia ser una archivo abierto en modo byte" @@ -4213,10 +4210,6 @@ msgstr "timestamp fuera de rango para plataform time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes solo pueden ser invocados por arrays densos" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "demasiados argumentos provistos con el formato dado" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "demasiadas dimensiones" @@ -4473,6 +4466,22 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "64 bit types" +#~ msgstr "tipos de 64 bit" + +#~ msgid "No key was specified" +#~ msgstr "No se especificó ninguna llave" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Escaneo en progreso. Usa stop_scan para detener." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "Codigo de error desconocido: %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "demasiados argumentos provistos con el formato dado" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/locale/fil.po b/locale/fil.po index 591620e6c4..f83cfb1173 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -181,10 +181,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -193,6 +189,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -402,10 +402,6 @@ msgstr "0.0 para sa complex power" msgid "3-arg pow() not supported" msgstr "3-arg pow() hindi suportado" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1233,7 +1229,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1282,6 +1279,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Mali ang format ng chunk size" @@ -1531,10 +1532,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1951,7 +1948,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2265,6 +2262,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2300,11 +2302,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2761,7 +2758,7 @@ msgstr "" msgid "can't set attribute" msgstr "hindi ma i-set ang attribute" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3069,8 +3066,8 @@ msgid "extra positional arguments given" msgstr "dagdag na positional argument na ibinigay" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "file ay dapat buksan sa byte mode" @@ -4150,10 +4147,6 @@ msgstr "wala sa sakop ng timestamp ang platform time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "masyadong maraming mga argumento na ibinigay sa ibinigay na format" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4412,6 +4405,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "too many arguments provided with the given format" +#~ msgstr "masyadong maraming mga argumento na ibinigay sa ibinigay na format" + #~ msgid "Expected a %q" #~ msgstr "Umasa ng %q" diff --git a/locale/fr.po b/locale/fr.po index 4ebcc918bf..e536cbd346 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -192,10 +192,6 @@ msgstr "%q doit être <= %d" msgid "%q must be >= %d" msgstr "%q doit être >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q doit être un bytearray ou matrice de type 'H' ou 'B'" @@ -204,6 +200,10 @@ msgstr "%q doit être un bytearray ou matrice de type 'H' ou 'B'" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q doit être a bytearray ou array de type 'h', 'H', 'b', ou 'B'" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -412,10 +412,6 @@ msgstr "0.0 à une puissance complexe" msgid "3-arg pow() not supported" msgstr "pow() non supporté avec 3 paramètres" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "types à 64 bit" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1273,7 +1269,8 @@ msgstr "Le minuteur du watchdog interne a expiré." msgid "Interrupt error." msgstr "Erreur d'interruption." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "%q invalide" @@ -1322,6 +1319,10 @@ msgstr "Octet invalide %.*s" msgid "Invalid data_pins[%d]" msgstr "data_pins[%d] invalide" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Taille de bloc de formatage invalide" @@ -1575,10 +1576,6 @@ msgstr "Programme n'a pas de \"in\"" msgid "No in or out in program" msgstr "Programme n'a aucun \"in\" ni \"out\"" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Aucune clé n'a été spécifiée" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Pas de support pour chiffre entier long" @@ -2006,8 +2003,8 @@ msgstr "La dimension d'échelle doit être un multiple de 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Scan déjà en cours. Arrêtez avec stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2326,6 +2323,11 @@ msgstr "Erreur BLE inconnue à %s:%d : %d" msgid "Unknown BLE error: %d" msgstr "Erreur BLE inconnue : %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2361,11 +2363,6 @@ msgstr "Faute inconnue du logiciel système : %04x" msgid "Unknown system firmware error: %d" msgstr "Erreur du logiciel système inconnue : %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "Erreur inconnue %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2833,7 +2830,7 @@ msgstr "impossible de définir une taille de bloc de 512" msgid "can't set attribute" msgstr "attribut non modifiable" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "attribut '%q' non modifiable" @@ -3145,8 +3142,8 @@ msgid "extra positional arguments given" msgstr "argument(s) positionnel(s) supplémentaire(s) donné(s)" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "le fichier doit être un fichier ouvert en mode 'byte'" @@ -4232,10 +4229,6 @@ msgstr "timestamp hors bornes pour 'time_t' de la plateforme" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes ne peut être appelée que pour des matrices dense" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "trop d'arguments fournis avec ce format" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "Trop de dimensions" @@ -4492,6 +4485,22 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "types à 64 bit" + +#~ msgid "No key was specified" +#~ msgstr "Aucune clé n'a été spécifiée" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Scan déjà en cours. Arrêtez avec stop_scan." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "Erreur inconnue %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "trop d'arguments fournis avec ce format" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/locale/hi.po b/locale/hi.po index 2b9825e4b8..977cd4986a 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -180,10 +180,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -192,6 +188,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -400,10 +400,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1221,7 +1217,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1270,6 +1267,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -1519,10 +1520,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1935,7 +1932,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2248,6 +2245,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2283,11 +2285,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2740,7 +2737,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3040,8 +3037,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4114,10 +4111,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 84bc790df4..b4e998f698 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -184,10 +184,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -196,6 +192,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -405,10 +405,6 @@ msgstr "0.0 elevato alla potenza di un numero complesso" msgid "3-arg pow() not supported" msgstr "pow() con tre argmomenti non supportata" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "Tipo 64 bits" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1235,7 +1231,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1284,6 +1281,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -1534,10 +1535,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1958,7 +1955,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2272,6 +2269,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2307,11 +2309,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2769,7 +2766,7 @@ msgstr "" msgid "can't set attribute" msgstr "impossibile impostare attributo" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3074,8 +3071,8 @@ msgid "extra positional arguments given" msgstr "argomenti posizonali extra dati" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4160,10 +4157,6 @@ msgstr "timestamp è fuori intervallo per il time_t della piattaforma" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "troppi argomenti forniti con il formato specificato" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4422,6 +4415,12 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "64 bit types" +#~ msgstr "Tipo 64 bits" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "troppi argomenti forniti con il formato specificato" + #~ msgid "%q pin invalid" #~ msgstr "%q pin non valido" diff --git a/locale/ja.po b/locale/ja.po index 081dd57e9f..ab8ca26d28 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -187,10 +187,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -199,6 +195,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -407,10 +407,6 @@ msgstr "0.0を複素数でべき乗" msgid "3-arg pow() not supported" msgstr "引数3つのpow()は非対応" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1234,7 +1230,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "不正な %q" @@ -1283,6 +1280,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "フォーマットチャンクのサイズが不正" @@ -1532,10 +1533,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "キーが指定されていません" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "long integerに対応していません" @@ -1951,8 +1948,8 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "既にスキャン進行中。stop_scanで停止してください" +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2265,6 +2262,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2300,11 +2302,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2757,7 +2754,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3061,8 +3058,8 @@ msgid "extra positional arguments given" msgstr "余分な位置引数が与えられました" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "fileはバイトモードで開かれたファイルでなければなりません" @@ -4138,10 +4135,6 @@ msgstr "timestampがプラットフォームのtime_tの範囲外" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "指定された書式に対して引数が多すぎます" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4398,6 +4391,15 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "No key was specified" +#~ msgstr "キーが指定されていません" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "既にスキャン進行中。stop_scanで停止してください" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "指定された書式に対して引数が多すぎます" + #~ msgid "Supply at least one UART pin" #~ msgstr "少なくとも1つのUARTピンが必要" diff --git a/locale/ko.po b/locale/ko.po index 7668d8c8a3..21b5cdecd6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -181,10 +181,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -193,6 +189,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -401,10 +401,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1224,7 +1220,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "" @@ -1273,6 +1270,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "형식 청크 크기가 잘못되었습니다" @@ -1522,10 +1523,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1938,7 +1935,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2252,6 +2249,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2287,11 +2289,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2744,7 +2741,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3044,8 +3041,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4118,10 +4115,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 61c96a877d..50a0ab6d99 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -180,10 +180,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -192,6 +188,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -400,10 +400,6 @@ msgstr "0.0 tot een complexe macht" msgid "3-arg pow() not supported" msgstr "3-arg pow() niet ondersteund" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1229,7 +1225,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Ongeldige %q" @@ -1278,6 +1275,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ongeldig formaat stuk grootte" @@ -1527,10 +1528,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Een sleutel was niet gespecificeerd" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Geen lange integer ondersteuning" @@ -1956,8 +1953,8 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Scan wordt al uitvoerd. Stop met stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2269,6 +2266,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2304,11 +2306,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2768,7 +2765,7 @@ msgstr "kan geen 512 blokgrootte instellen" msgid "can't set attribute" msgstr "kan attribute niet instellen" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3070,8 +3067,8 @@ msgid "extra positional arguments given" msgstr "extra positionele argumenten gegeven" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "bestand moet een bestand zijn geopend in byte modus" @@ -4148,10 +4145,6 @@ msgstr "timestamp buiten bereik voor platform time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes kunnen alleen ingeroepen worden voor gesloten arrays" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "te veel argumenten opgegeven bij dit formaat" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4408,6 +4401,15 @@ msgstr "zi moet van type float zijn" msgid "zi must be of shape (n_section, 2)" msgstr "zi moet vorm (n_section, 2) hebben" +#~ msgid "No key was specified" +#~ msgstr "Een sleutel was niet gespecificeerd" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Scan wordt al uitvoerd. Stop met stop_scan." + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "te veel argumenten opgegeven bij dit formaat" + #~ msgid "Supply at least one UART pin" #~ msgstr "Geef op zijn minst 1 UART pin op" diff --git a/locale/pl.po b/locale/pl.po index 642e5f99de..e873e45a51 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -182,10 +182,6 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "" @@ -194,6 +190,10 @@ msgstr "" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -402,10 +402,6 @@ msgstr "0.0 do potęgi zespolonej" msgid "3-arg pow() not supported" msgstr "3-argumentowy pow() jest niewspierany" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1229,7 +1225,8 @@ msgstr "" msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Nieprawidłowe %q" @@ -1278,6 +1275,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Zła wielkość fragmentu formatu" @@ -1527,10 +1528,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Nie określono klucza" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1943,8 +1940,8 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Skanuj już w toku. Zatrzymaj za pomocą stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2256,6 +2253,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2291,11 +2293,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2748,7 +2745,7 @@ msgstr "" msgid "can't set attribute" msgstr "nie można ustawić atrybutu" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3049,8 +3046,8 @@ msgid "extra positional arguments given" msgstr "nadmiarowe argumenty pozycyjne" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "file musi być otwarte w trybie bajtowym" @@ -4124,10 +4121,6 @@ msgstr "timestamp poza zakresem dla time_t na tej platformie" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "zbyt wiele argumentów podanych dla tego formatu" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4384,6 +4377,15 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "No key was specified" +#~ msgstr "Nie określono klucza" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Skanuj już w toku. Zatrzymaj za pomocą stop_scan." + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "zbyt wiele argumentów podanych dla tego formatu" + #~ msgid "Supply at least one UART pin" #~ msgstr "Podaj co najmniej jeden pin UART" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index bef3ea8849..6968cfbb84 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-08 07:10+0000\n" +"PO-Revision-Date: 2023-03-25 02:42+0000\n" "Last-Translator: Wellington Terumi Uemura \n" "Language-Team: \n" "Language: pt_BR\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.16.2-dev\n" +"X-Generator: Weblate 4.17-dev\n" #: main.c msgid "" @@ -193,10 +193,6 @@ msgstr "%q deve ser <= %d" msgid "%q must be >= %d" msgstr "o %q deve ser >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "%q deve ser uma matriz do tipo 'H'" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q deve ser um bytearray ou uma matriz do tipo 'H' ou 'B'" @@ -205,6 +201,10 @@ msgstr "%q deve ser um bytearray ou uma matriz do tipo 'H' ou 'B'" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q deve ser um bytearray ou uma matriz do tipo 'h', 'H', 'b', ou 'B'" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "%q deve ser uma matriz do tipo 'H'" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -417,10 +417,6 @@ msgstr "0,0 para uma potência complexa" msgid "3-arg pow() not supported" msgstr "3-arg pow() não compatível" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "Tipos 64 bit" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1263,7 +1259,8 @@ msgstr "O temporizador do watchdog interno expirou." msgid "Interrupt error." msgstr "Erro de interrupção." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "%q Inválido" @@ -1288,7 +1285,7 @@ msgstr "BSSID Inválido" #: main.c msgid "Invalid CIRCUITPY_PYSTACK_SIZE\n" -msgstr "" +msgstr "CIRCUITPY_PYSTACK_SIZE inválido\n" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" @@ -1312,6 +1309,10 @@ msgstr "Byte %.*s inválido" msgid "Invalid data_pins[%d]" msgstr "data_pins[%d] inválido" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Tamanho do pedaço de formato inválido" @@ -1561,10 +1562,6 @@ msgstr "Sem entrada no programa" msgid "No in or out in program" msgstr "Sem entrada ou saída no programa" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Nenhuma chave foi definida" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Não há compatibilidade com inteiro longo" @@ -1994,8 +1991,8 @@ msgstr "As dimensões da escala devem ser poder ser divididas por 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "O escaneamento já está em andamento. Interrompa com stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "Digitalização já em andamento. Pare com stop_scan." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2314,6 +2311,11 @@ msgstr "Houve um erro BLE desconhecido em %s:%d: %d" msgid "Unknown BLE error: %d" msgstr "Houve um erro BLE desconhecido: %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "Código de erro desconhecido %d" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2349,11 +2351,6 @@ msgstr "Erro desconhecido do firmware: %04x" msgid "Unknown system firmware error: %d" msgstr "Ocorreu um erro desconhecido no firmware do sistema: %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "Código de erro desconhecido %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2819,7 +2816,7 @@ msgstr "não é possível definir o tamanho de 512 blocos" msgid "can't set attribute" msgstr "não é possível definir o atributo" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "não é possível definir o atributo '%q'" @@ -3128,8 +3125,8 @@ msgid "extra positional arguments given" msgstr "argumentos extra posicionais passados" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "o arquivo deve ser um arquivo aberto no modo byte" @@ -4213,10 +4210,6 @@ msgstr "timestamp fora do intervalo para a plataforma time_t" msgid "tobytes can be invoked for dense arrays only" msgstr "os tobytes podem ser invocados apenas nas matrizes densas" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "Muitos argumentos fornecidos com o formato dado" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "dimensões demais" @@ -4473,6 +4466,22 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "Tipos 64 bit" + +#~ msgid "No key was specified" +#~ msgstr "Nenhuma chave foi definida" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "O escaneamento já está em andamento. Interrompa com stop_scan." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "Código de erro desconhecido %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "Muitos argumentos fornecidos com o formato dado" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/locale/ru.po b/locale/ru.po index 2ad4b094a2..e2c1eae4f1 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -187,10 +187,6 @@ msgstr "%q должно быть <= %d" msgid "%q must be >= %d" msgstr "%q должно быть >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q должно быть bytearray или array типа 'H' или 'B'" @@ -199,6 +195,10 @@ msgstr "%q должно быть bytearray или array типа 'H' или 'B'" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q должно быть bytearray или array типа 'h', 'H', 'b', или 'B'" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -407,10 +407,6 @@ msgstr "0.0 в комплексную степень" msgid "3-arg pow() not supported" msgstr "3-аргументный pow() не поддерживается" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64-битные типы" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1266,7 +1262,8 @@ msgstr "Внутренний сторожевой таймер истек." msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Недопустимый %q" @@ -1315,6 +1312,10 @@ msgstr "Неверный байт %.*s" msgid "Invalid data_pins[%d]" msgstr "Неверный data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Неверный размер блока формата" @@ -1567,10 +1568,6 @@ msgstr "Нет in в программе" msgid "No in or out in program" msgstr "В программе отсутствует ввод или вывод" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Ключ не был указан" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Нет поддержки длинных целых чисел (long integer)" @@ -1996,7 +1993,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2311,6 +2308,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2346,11 +2348,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2803,7 +2800,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3103,8 +3100,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4177,10 +4174,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4437,6 +4430,12 @@ msgstr "zi должно быть типа float" msgid "zi must be of shape (n_section, 2)" msgstr "zi должен иметь форму (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "64-битные типы" + +#~ msgid "No key was specified" +#~ msgstr "Ключ не был указан" + #~ msgid "Supply at least one UART pin" #~ msgstr "Предоставьте хотяб один пин UART" diff --git a/locale/sv.po b/locale/sv.po index 3c2c9f6520..1cef8c6d7a 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-08 07:10+0000\n" +"PO-Revision-Date: 2023-03-25 02:42+0000\n" "Last-Translator: Jonny Bergdahl \n" "Language-Team: LANGUAGE \n" "Language: sv\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.16.2-dev\n" +"X-Generator: Weblate 4.17-dev\n" #: main.c msgid "" @@ -192,10 +192,6 @@ msgstr "%q måste vara <= %d" msgid "%q must be >= %d" msgstr "%q måste vara >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "%q måste vara en array av typen 'H'" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q måste vara en bytearray eller array av typen 'H' eller 'B'" @@ -206,6 +202,10 @@ msgstr "" "%q måste vara en bytearray eller en array av typen \"h\", \"H\", \"b\" eller " "\"B\"" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "%q måste vara en array av typen 'H'" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -414,10 +414,6 @@ msgstr "0,0 till ett komplext nummer" msgid "3-arg pow() not supported" msgstr "3-arguments pow() stöds inte" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64-bitars typer" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1248,7 +1244,8 @@ msgstr "Intern watchdog-timer har löpt ut." msgid "Interrupt error." msgstr "Interrupt-fel." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Ogiltig %q" @@ -1273,7 +1270,7 @@ msgstr "Ogiltig BSSID" #: main.c msgid "Invalid CIRCUITPY_PYSTACK_SIZE\n" -msgstr "" +msgstr "Ogiltig CIRCUITPY_PYSTACK_SIZE\n" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" @@ -1297,6 +1294,10 @@ msgstr "Ogiltig byte %.*s" msgid "Invalid data_pins[%d]" msgstr "Ogiltig data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ogiltig formatsegmentstorlek" @@ -1547,10 +1548,6 @@ msgstr "Inget in i programmet" msgid "No in or out in program" msgstr "Inget in eller ut i programmet" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Ingen nyckel angavs" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Inget stöd för långt heltal" @@ -1975,8 +1972,8 @@ msgstr "Skaldimension måste vara delbar med 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Skanning pågår redan. Avsluta med stop_scan." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "Skanning pågår redan. Stoppa med stop_scan." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2290,6 +2287,11 @@ msgstr "Okänt BLE-fel vid %s:%d: %d" msgid "Unknown BLE error: %d" msgstr "Okänt BLE-fel: %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "Okänd felkod %d" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2325,11 +2327,6 @@ msgstr "Okänt systemfirmwarefel: %04x" msgid "Unknown system firmware error: %d" msgstr "Okänt fel i systemets firmware: %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "Okänd felkod %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2790,7 +2787,7 @@ msgstr "kan inte sätta blockstorlek 512" msgid "can't set attribute" msgstr "kan inte att ange attribut" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "kan inte sätta attribut '%q'" @@ -3097,8 +3094,8 @@ msgid "extra positional arguments given" msgstr "extra positions-argument angivna" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "filen måste vara en fil som öppnats i byte-läge" @@ -4175,10 +4172,6 @@ msgstr "timestamp utom räckvidd för plattformens \"time_t\"" msgid "tobytes can be invoked for dense arrays only" msgstr "tobyte kan enbart anropas för täta matriser" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "för många argument för det givna formatet" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "för många dimensioner" @@ -4435,6 +4428,22 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "64-bitars typer" + +#~ msgid "No key was specified" +#~ msgstr "Ingen nyckel angavs" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Skanning pågår redan. Avsluta med stop_scan." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "Okänd felkod %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "för många argument för det givna formatet" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/locale/tr.po b/locale/tr.po index bd9d746940..f785cff4fc 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -188,10 +188,6 @@ msgstr "%q <= %d olmalıdır" msgid "%q must be >= %d" msgstr "%q >= %d olmalıdır" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q 'H' ya da 'B' tipi bir bytearray ya da array olmalıdır" @@ -200,6 +196,10 @@ msgstr "%q 'H' ya da 'B' tipi bir bytearray ya da array olmalıdır" msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "%q 'h', 'H', 'b' ya da 'B' tipi bir bytearray ya da array olmalı" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -409,10 +409,6 @@ msgstr "0.0'dan bir karmaşık güce" msgid "3-arg pow() not supported" msgstr "3-argümanlı pow() desteklenmemektedir" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit tipler" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1239,7 +1235,8 @@ msgstr "Dahili bekçi zamanlayıcısının süresi doldu." msgid "Interrupt error." msgstr "" -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "Geçersiz %q" @@ -1289,6 +1286,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "Geçersiz veri_pini [%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Geçersiz biçim yığın boyutu" @@ -1538,10 +1539,6 @@ msgstr "" msgid "No in or out in program" msgstr "" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "" @@ -1957,7 +1954,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." +msgid "Scan already in progress. Stop with stop_scan." msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -2270,6 +2267,11 @@ msgstr "" msgid "Unknown BLE error: %d" msgstr "" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2305,11 +2307,6 @@ msgstr "" msgid "Unknown system firmware error: %d" msgstr "" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2762,7 +2759,7 @@ msgstr "" msgid "can't set attribute" msgstr "" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "" @@ -3062,8 +3059,8 @@ msgid "extra positional arguments given" msgstr "" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "" @@ -4136,10 +4133,6 @@ msgstr "" msgid "tobytes can be invoked for dense arrays only" msgstr "" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "" @@ -4396,6 +4389,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "64 bit types" +#~ msgstr "64 bit tipler" + #~ msgid "%q pin invalid" #~ msgstr "%q pini geçersiz" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 72df0f5aed..2246687ef3 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -195,10 +195,6 @@ msgstr "%q bìxū <= %d" msgid "%q must be >= %d" msgstr "%q bìxū >= %d" -#: ports/espressif/common-hal/analogbufio/BufferedIn.c -msgid "%q must be array of type 'H'" -msgstr "%q bì xū shì lèi xíng wéi 'H' de shù zǔ" - #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" msgstr "%q bì xū shì zì jié shù zǔ huò lèi xíng wéi 'H' huò 'B' de shù zǔ" @@ -208,6 +204,10 @@ msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" msgstr "" "%q bì xū shì zì jié shù zǔ huò lèi xíng wéi 'h', 'H', 'b', huò 'B' de shù zǔ" +#: ports/espressif/common-hal/analogbufio/BufferedIn.c +msgid "%q must be array of type 'H'" +msgstr "%q bì xū shì lèi xíng wéi 'H' de shù zǔ" + #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or %q, not %q" @@ -416,10 +416,6 @@ msgstr "0.0 de fùshù cì mì" msgid "3-arg pow() not supported" msgstr "bù zhī chí 3-arg pow()" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 wèi lèixíng" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1255,7 +1251,8 @@ msgstr "Nèibù kān mén gǒu dìngshí qì chāoshí." msgid "Interrupt error." msgstr "zhōng duàn cuò wù." -#: py/argcheck.c shared-bindings/digitalio/DigitalInOut.c +#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c +#: shared-bindings/digitalio/DigitalInOut.c #: shared-bindings/displayio/EPaperDisplay.c msgid "Invalid %q" msgstr "wú xiào %q" @@ -1304,6 +1301,10 @@ msgstr "wú xiào zì jié %.*s" msgid "Invalid data_pins[%d]" msgstr "wú xiào data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Géshì kuài dàxiǎo wúxiào" @@ -1554,10 +1555,6 @@ msgstr "chéng xù zhōng méi yǒu" msgid "No in or out in program" msgstr "chéng xù zhōng méi yǒu jìn chū" -#: shared-bindings/aesio/aes.c -msgid "No key was specified" -msgstr "Wèi zhǐdìng mì yào" - #: shared-bindings/time/__init__.c msgid "No long integer support" msgstr "Méiyǒu zhǎng zhěngshù zhīchí" @@ -1980,8 +1977,8 @@ msgstr "bǐ lì chǐ cùn bì xū chú yǐ 3" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c -msgid "Scan already in progess. Stop with stop_scan." -msgstr "Zhèngzài jìn háng sǎomiáo. Shǐyòng stop_scan tíngzhǐ." +msgid "Scan already in progress. Stop with stop_scan." +msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -2295,6 +2292,11 @@ msgstr "%s:%d: %d chù chū xiàn wèi zhī BLE cuò wù" msgid "Unknown BLE error: %d" msgstr "wèi zhī de BLE cuò wù: %d" +#: ports/raspberrypi/common-hal/wifi/__init__.c +#, c-format +msgid "Unknown error code %d" +msgstr "" + #: shared-bindings/wifi/Radio.c #, c-format msgid "Unknown failure %d" @@ -2330,11 +2332,6 @@ msgstr "wèi zhī xì tǒng gù jiàn cuò wù: %04x" msgid "Unknown system firmware error: %d" msgstr "wèi zhī de xì tǒng gù jiàn cuò wù: %d" -#: ports/raspberrypi/common-hal/wifi/__init__.c -#, c-format -msgid "Unkown error code %d" -msgstr "wèi zhī cuò wù dài %d" - #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #: shared-module/_pixelmap/PixelMap.c #, c-format @@ -2795,7 +2792,7 @@ msgstr "wúfǎ shèzhì 512 kuài dàxiǎo" msgid "can't set attribute" msgstr "wúfǎ shèzhì shǔxìng" -#: py/runtime.c +#: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" msgstr "wú fǎ shè zhì shǔ xìng '%q'" @@ -3103,8 +3100,8 @@ msgid "extra positional arguments given" msgstr "gěi chūle éwài de wèizhì cānshù" #: shared-bindings/audiocore/WaveFile.c shared-bindings/audiomp3/MP3Decoder.c -#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/synthio/__init__.c -#: shared-module/gifio/GifWriter.c +#: shared-bindings/displayio/OnDiskBitmap.c shared-bindings/gifio/OnDiskGif.c +#: shared-bindings/synthio/__init__.c shared-module/gifio/GifWriter.c msgid "file must be a file opened in byte mode" msgstr "wénjiàn bìxū shì zài zì jié móshì xià dǎkāi de wénjiàn" @@ -4181,10 +4178,6 @@ msgstr "time_t shíjiān chuō chāochū píngtái fànwéi" msgid "tobytes can be invoked for dense arrays only" msgstr "tobytes zhǐ néng duì mì jí shù zǔ diào yòng" -#: shared-module/struct/__init__.c -msgid "too many arguments provided with the given format" -msgstr "tígōng jǐ dìng géshì de cānshù tài duō" - #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c msgid "too many dimensions" msgstr "chǐ cùn tài duō" @@ -4441,6 +4434,22 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "64 bit types" +#~ msgstr "64 wèi lèixíng" + +#~ msgid "No key was specified" +#~ msgstr "Wèi zhǐdìng mì yào" + +#~ msgid "Scan already in progess. Stop with stop_scan." +#~ msgstr "Zhèngzài jìn háng sǎomiáo. Shǐyòng stop_scan tíngzhǐ." + +#, c-format +#~ msgid "Unkown error code %d" +#~ msgstr "wèi zhī cuò wù dài %d" + +#~ msgid "too many arguments provided with the given format" +#~ msgstr "tígōng jǐ dìng géshì de cānshù tài duō" + #~ msgid "" #~ "\n" #~ "Invalid CIRCUITPY_PYSTACK_SIZE\n" diff --git a/main.c b/main.c index 7b805b57b0..6ff6202d6d 100644 --- a/main.c +++ b/main.c @@ -1111,6 +1111,8 @@ void gc_collect(void) { // have lost their references in the VM even though they are mounted. gc_collect_root((void **)&MP_STATE_VM(vfs_mount_table), sizeof(mp_vfs_mount_t) / sizeof(mp_uint_t)); + port_gc_collect(); + background_callback_gc_collect(); #if CIRCUITPY_ALARM @@ -1143,6 +1145,10 @@ void gc_collect(void) { gc_collect_end(); } +// Ports may provide an implementation of this function if it is needed +MP_WEAK void port_gc_collect() { +} + void NORETURN nlr_jump_fail(void *val) { reset_into_safe_mode(SAFE_MODE_NLR_JUMP_FAIL); while (true) { diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 5a4e5111da..ca906ab98f 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -59,6 +59,7 @@ INC += -I. \ ifeq ($(CHIP_FAMILY), samd21) PERIPHERALS_CHIP_FAMILY=samd21 OPTIMIZATION_FLAGS ?= -Os + # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_SAMD21 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_CDC_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128 -DCFG_TUD_CDC_TX_BUFSIZE=128 -DCFG_TUD_MSC_BUFSIZE=512 endif @@ -101,24 +102,23 @@ ifeq ($(DEBUG), 1) endif else CFLAGS += -DNDEBUG + + # Do a default shrink for small builds, including all SAMD21 builds. # -finline-limit can shrink the image size. # -finline-limit=80 or so is similar to not having it on. # There is no simple default value, though. - - # Do a default shrink for small builds. - ifndef CFLAGS_INLINE_LIMIT - ifeq ($(CIRCUITPY_FULL_BUILD),0) - CFLAGS_INLINE_LIMIT = 50 + ifeq ($(CIRCUITPY_FULL_BUILD),0) + CFLAGS += -finline-limit=45 + else + ifeq ($(CHIP_FAMILY), samd21) + # max-inline-insns-auto increases the size of SAMD51 builds. + CFLAGS += -finline-limit=45 --param max-inline-insns-auto=110 endif endif - ifdef CFLAGS_INLINE_LIMIT - CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT) - endif - - ifeq ($(CIRCUITPY_FULL_BUILD),0) - CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20 - endif + # We used to do this but it seems to not reduce space any more, at least in gcc 11. + # Leave it here, commented out, just for reference. + # --param inline-unit-growth=15 ifdef CFLAGS_BOARD CFLAGS += $(CFLAGS_BOARD) diff --git a/ports/atmel-samd/asf4_conf/samd21/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/samd21/hpl_tc_config.h index d651ca33a8..706c7f4b67 100644 --- a/ports/atmel-samd/asf4_conf/samd21/hpl_tc_config.h +++ b/ports/atmel-samd/asf4_conf/samd21/hpl_tc_config.h @@ -49,7 +49,7 @@ #define CONF_TC3_WAVE_DUTY_VAL 0x1f4 #endif -/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ #if CONF_TC3_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val #define CONF_TC3_CC0 \ ((uint32_t)(((double)CONF_TC3_WAVE_PER_VAL * CONF_GCLK_TC3_FREQUENCY) / 1000000 / (1 << CONF_TC3_PRESCALER) - 1)) diff --git a/ports/atmel-samd/asf4_conf/samd51/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/samd51/hpl_tc_config.h index 3bc688295b..dc08b6eb23 100644 --- a/ports/atmel-samd/asf4_conf/samd51/hpl_tc_config.h +++ b/ports/atmel-samd/asf4_conf/samd51/hpl_tc_config.h @@ -42,7 +42,7 @@ #define CONF_TC0_WAVE_DUTY_VAL 0x1f4 #endif -/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ #if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val #define CONF_TC0_CC0 \ ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1)) diff --git a/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h index 3bc688295b..dc08b6eb23 100644 --- a/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h +++ b/ports/atmel-samd/asf4_conf/same51/hpl_tc_config.h @@ -42,7 +42,7 @@ #define CONF_TC0_WAVE_DUTY_VAL 0x1f4 #endif -/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ #if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val #define CONF_TC0_CC0 \ ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1)) diff --git a/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h b/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h index 3bc688295b..dc08b6eb23 100644 --- a/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h +++ b/ports/atmel-samd/asf4_conf/same54/hpl_tc_config.h @@ -42,7 +42,7 @@ #define CONF_TC0_WAVE_DUTY_VAL 0x1f4 #endif -/* Caculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ +/* Calculate pwm ccx register value based on WAVE_PER_VAL and Waveform Duty Value */ #if CONF_TC0_PRESCALER < TC_CTRLA_PRESCALER_DIV64_Val #define CONF_TC0_CC0 \ ((uint32_t)(((double)CONF_TC0_WAVE_PER_VAL * CONF_GCLK_TC0_FREQUENCY) / 1000000 / (1 << CONF_TC0_PRESCALER) - 1)) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index 701dc4a8ec..aeea62d2a2 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -51,7 +51,7 @@ uint8_t display_init_sequence[] = { 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x2a, 0, // _INVOFF 0x36, 1, 0x18, // _MADCTL bottom to top refresh - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index a1cb3a0714..11db1ba0a8 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -50,7 +50,7 @@ uint8_t display_init_sequence[] = { 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x2a, 0, // _INVOFF 0x36, 1, 0b10100000, // _MADCTL for rotation 0 - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 8ff34f24c5..141365a4a1 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -52,7 +52,7 @@ uint8_t display_init_sequence[] = { 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x2a, 0, // _INVOFF 0x36, 1, 0b10100000, // _MADCTL for rotation 0 - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index 90cf9dff20..9953f27d02 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -52,7 +52,7 @@ uint8_t display_init_sequence[] = { 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x2a, 0, // _INVOFF 0x36, 1, 0xa8, // _MADCTL bottom to top refresh - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 16, 0x02, 0x1c, 0x07, 0x12, // _GMCTRP1 Gamma diff --git a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c index 2ead87428b..4c1d05feb2 100644 --- a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c @@ -36,7 +36,7 @@ STATIC volatile bool woke_up = false; STATIC mp_float_t wakeup_time; void common_hal_alarm_time_timealarm_construct(alarm_time_timealarm_obj_t *self, mp_float_t monotonic_time) { - // TODO: when issueing light/seep sleep, throw a ValueError if the + // TODO: when issuing light/seep sleep, throw a ValueError if the // time exceeds the maximum value. For light sleep, max = // 2**32 / 16384 = 3 days. For deep sleep, max = 2**32 / 32 // = 1550 days. diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index 22200c5d1c..6d1a3f7c0e 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -482,7 +482,7 @@ uint32_t common_hal_frequencyio_frequencyin_get_item(frequencyio_frequencyin_obj float time_each_event = self->factor / self->frequency; // get the time for each event during actual period float capture_diff = self->factor - self->capture_period; // get the difference of actual and base periods // we only need to adjust if the capture_diff can contain 1 or more events - // if so, we add how many events could have occured during the diff time + // if so, we add how many events could have occurred during the diff time if (time_each_event > capture_diff) { frequency_adjustment = capture_diff / time_each_event; } diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 887748c7a0..73686e1445 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -189,7 +189,7 @@ // - firmware // - internal CIRCUITPY flash filesystem (optional) // - internal config, used to store crystalless clock calibration info (optional) -// - microntroller.nvm (optional) +// - microcontroller.nvm (optional) // Define these regions starting up from the bottom of flash: diff --git a/ports/atmel-samd/sd_mmc/sd_mmc.c b/ports/atmel-samd/sd_mmc/sd_mmc.c index de5a3cfe17..b558922d1f 100644 --- a/ports/atmel-samd/sd_mmc/sd_mmc.c +++ b/ports/atmel-samd/sd_mmc/sd_mmc.c @@ -1073,7 +1073,7 @@ static void sd_mmc_deselect_slot(void) { * \note * This function runs the initialization procedure and the identification * process, then it sets the SD/MMC card in transfer state. - * At last, it will automaticly enable maximum bus width and transfer speed. + * At last, it will automatically enable maximum bus width and transfer speed. * * \return true if success, otherwise false */ @@ -1205,7 +1205,7 @@ static bool sd_mmc_mci_card_init(void) { * \note * This function runs the initialization procedure and the identification * process, then it sets the SD/MMC card in transfer state. - * At last, it will automaticly enable maximum bus width and transfer speed. + * At last, it will automatically enable maximum bus width and transfer speed. * * \return true if success, otherwise false */ @@ -1270,7 +1270,7 @@ static bool sd_mmc_mci_install_mmc(void) { uint8_t retry = 10; while (retry--) { /* Retry is a WORKAROUND for no compliance card (Atmel Internal ref. MMC19): - * These cards seem not ready immediatly + * These cards seem not ready immediately * after the end of busy of mmc_cmd6_set_high_speed()*/ /* Set default block size */ @@ -1427,7 +1427,7 @@ sd_mmc_err_t sd_mmc_wait_end_of_read_blocks(bool abort) { return SD_MMC_OK; } - /* All blocks are transfered then stop read operation */ + /* All blocks are transferred then stop read operation */ if (sd_mmc_nb_block_to_tranfer == 1) { /* Single block transfer, then nothing to do */ sd_mmc_deselect_slot(); @@ -1506,7 +1506,7 @@ sd_mmc_err_t sd_mmc_wait_end_of_write_blocks(bool abort) { return SD_MMC_OK; } - /* All blocks are transfered then stop write operation */ + /* All blocks are transferred then stop write operation */ if (sd_mmc_nb_block_to_tranfer == 1) { /* Single block transfer, then nothing to do */ sd_mmc_deselect_slot(); diff --git a/ports/atmel-samd/sd_mmc/sd_mmc.h b/ports/atmel-samd/sd_mmc/sd_mmc.h index e51bf17e80..667520317c 100644 --- a/ports/atmel-samd/sd_mmc/sd_mmc.h +++ b/ports/atmel-samd/sd_mmc/sd_mmc.h @@ -67,7 +67,7 @@ typedef uint8_t sd_mmc_err_t; /**< Type of return error code */ #define SD_MMC_INIT_ONGOING 1 /**< Card not initialized */ #define SD_MMC_ERR_NO_CARD 2 /**< No SD/MMC card inserted */ #define SD_MMC_ERR_UNUSABLE 3 /**< Unusable card */ -#define SD_MMC_ERR_SLOT 4 /**< Slot unknow */ +#define SD_MMC_ERR_SLOT 4 /**< Slot unknown */ #define SD_MMC_ERR_COMM 5 /**< General communication error */ #define SD_MMC_ERR_PARAM 6 /**< Illeage input parameter */ #define SD_MMC_ERR_WP 7 /**< Card write protected */ @@ -166,7 +166,7 @@ uint32_t sd_mmc_get_capacity(uint8_t slot); * * \param[in] slot Card slot * - * \return true, if write portected + * \return true, if write protected */ bool sd_mmc_is_write_protected(uint8_t slot); diff --git a/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h b/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h index 9b4d8e8e74..c205415559 100644 --- a/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h +++ b/ports/atmel-samd/sd_mmc/sd_mmc_protocol.h @@ -73,8 +73,8 @@ extern "C" { * Responses types: * * R1, R3, R4 & R5 use a 48 bits response protected by a 7bit CRC checksum - * - R1 receiv data not specified - * - R3 receiv OCR + * - R1 receive data not specified + * - R3 receive OCR * - R4, R5 RCA management (MMC only) * - R6, R7 RCA management (SD only) * @@ -115,14 +115,14 @@ typedef uint32_t sdmmc_cmd_def_t; #define SDMMC_RESP_CRC (1lu << 12) // ! Card may send busy #define SDMMC_RESP_BUSY (1lu << 13) -// Open drain for a braodcast command (bc) +// Open drain for a broadcast command (bc) // or to enter in inactive state (MCI only) #define SDMMC_CMD_OPENDRAIN (1lu << 14) // ! To signal a data write operation #define SDMMC_CMD_WRITE (1lu << 15) -// ! To signal a SDIO tranfer in multi byte mode +// ! To signal a SDIO transfer in multi byte mode #define SDMMC_CMD_SDIO_BYTE (1lu << 16) -// ! To signal a SDIO tranfer in block mode +// ! To signal a SDIO transfer in block mode #define SDMMC_CMD_SDIO_BLOCK (1lu << 17) // ! To signal a data transfer in stream mode #define SDMMC_CMD_STREAM (1lu << 18) @@ -132,7 +132,7 @@ typedef uint32_t sdmmc_cmd_def_t; #define SDMMC_CMD_MULTI_BLOCK (1lu << 20) // ! @} -// ! \name Set of flags to define a reponse type +// ! \name Set of flags to define a response type // ! @{ #define SDMMC_CMD_NO_RESP (0) #define SDMMC_CMD_R1 (SDMMC_RESP_PRESENT | SDMMC_RESP_CRC) @@ -324,7 +324,7 @@ typedef uint32_t sdmmc_cmd_def_t; #define SD_MCI_ACMD41_SD_SEND_OP_COND (41 | SDMMC_CMD_R3 | SDMMC_CMD_OPENDRAIN) /** * ACMD41(R1): Send host capacity support information (HCS) and activates the - * card's initilization process + * card's initialization process */ #define SD_SPI_ACMD41_SD_SEND_OP_COND (41 | SDMMC_CMD_R1) /** @@ -440,7 +440,7 @@ typedef uint32_t sdmmc_cmd_def_t; #define SDIO_R5_ERROR (1lu << 11) /**< General error */ #define SDIO_R5_FUNC_NUM (1lu << 9) /**< Invalid function number */ #define SDIO_R5_OUT_OF_RANGE (1lu << 8) /**< Argument out of range */ -#define SDIO_R5_STATUS_ERR (SDIO_R5_ERROR | SDIO_R5_FUNC_NUM | SDIO_R5_OUT_OF_RANGE) // !< Errro status bits mask +#define SDIO_R5_STATUS_ERR (SDIO_R5_ERROR | SDIO_R5_FUNC_NUM | SDIO_R5_OUT_OF_RANGE) // !< Error status bits mask // ! @} // ! \name SDIO state (in R6) diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 45b999f1a1..8cba5c61e0 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -307,7 +307,7 @@ safe_mode_t port_init(void) { // because it was hard enough to figure out, and maybe there's // a mistake that could make it work in the future. #if 0 - // Designate QSPI memory mapped region as not cachable. + // Designate QSPI memory mapped region as not cacheable. // Turn off MPU in case it is on. MPU->CTRL = 0; @@ -320,7 +320,7 @@ safe_mode_t port_init(void) { 0b011 << MPU_RASR_AP_Pos | // full read/write access for privileged and user mode 0b000 << MPU_RASR_TEX_Pos | // caching not allowed, strongly ordered 1 << MPU_RASR_S_Pos | // sharable - 0 << MPU_RASR_C_Pos | // not cachable + 0 << MPU_RASR_C_Pos | // not cacheable 0 << MPU_RASR_B_Pos | // not bufferable 0b10111 << MPU_RASR_SIZE_Pos | // 16MB region size 1 << MPU_RASR_ENABLE_Pos // enable this region diff --git a/ports/espressif/README.rst b/ports/espressif/README.rst index 949f3533ae..49f372359b 100644 --- a/ports/espressif/README.rst +++ b/ports/espressif/README.rst @@ -55,7 +55,7 @@ Connect these pins using a `USB adapter ` **UART Connection:** -A `USB to UART convertor `_ can be used for connecting to ESP32-C3 to get access to the serial console and REPL and for flashing CircuitPython. +A `USB to UART converter `_ can be used for connecting to ESP32-C3 to get access to the serial console and REPL and for flashing CircuitPython. The following connections need to be made in this case: @@ -92,7 +92,7 @@ Connect these pins using a `USB adapter ` **UART Connection:** -A `USB to UART convertor `_ can be used for connecting to ESP32-S2 to get access to the serial console and REPL and for flashing CircuitPython. +A `USB to UART converter `_ can be used for connecting to ESP32-S2 to get access to the serial console and REPL and for flashing CircuitPython. The following connections need to be made in this case: @@ -129,7 +129,7 @@ Connect these pins using a `USB adapter ` **UART Connection:** -A `USB to UART convertor `_ can be used for connecting to ESP32-S3 to get access to the serial console and REPL and for flashing CircuitPython. +A `USB to UART converter `_ can be used for connecting to ESP32-S3 to get access to the serial console and REPL and for flashing CircuitPython. The following connections need to be made in this case: diff --git a/ports/espressif/bindings/espcamera/Camera.c b/ports/espressif/bindings/espcamera/Camera.c index 824bc7d3dc..5fb9576e58 100644 --- a/ports/espressif/bindings/espcamera/Camera.c +++ b/ports/espressif/bindings/espcamera/Camera.c @@ -63,7 +63,7 @@ //| """ //| Configure and initialize a camera with the given properties //| -//| This driver requires that the ``CIRCUITPY_RESERVED_PSRAM`` in ``settings.toml`` be large enough to hold the camera frambuffer(s). Generally, boards with built-in cameras will have a default setting that is large enough. If the constructor raises a MemoryError or an IDFError, this probably indicates the setting is too small and should be increased. +//| This driver requires that the ``CIRCUITPY_RESERVED_PSRAM`` in ``settings.toml`` be large enough to hold the camera framebuffer(s). Generally, boards with built-in cameras will have a default setting that is large enough. If the constructor raises a MemoryError or an IDFError, this probably indicates the setting is too small and should be increased. //| //| //| .. important:: @@ -89,7 +89,7 @@ //| :param reset_pin: The reset input to the camera module //| :param pixel_format: The pixel format of the captured image //| :param frame_size: The size of captured image -//| :param jpeg_quality: For `PixelFormat.JPEG`, the quality. Higher numbers increase quality. If the quality is too high, the JPEG data will be larger than the availalble buffer size and the image will be unusable or truncated. The exact range of appropriate values depends on the sensor and must be determined empirically. +//| :param jpeg_quality: For `PixelFormat.JPEG`, the quality. Higher numbers increase quality. If the quality is too high, the JPEG data will be larger than the available buffer size and the image will be unusable or truncated. The exact range of appropriate values depends on the sensor and must be determined empirically. //| :param framebuffer_count: The number of framebuffers (1 for single-buffered and 2 for double-buffered) //| :param grab_mode: When to grab a new frame //| """ diff --git a/ports/espressif/bindings/espidf/__init__.c b/ports/espressif/bindings/espidf/__init__.c index c1ef9da1e0..65b7f12a18 100644 --- a/ports/espressif/bindings/espidf/__init__.c +++ b/ports/espressif/bindings/espidf/__init__.c @@ -34,6 +34,8 @@ #include "nvs_flash.h" #include "components/heap/include/esp_heap_caps.h" +//| import builtins +//| //| """Direct access to a few ESP-IDF details. This module *should not* include any functionality //| that could be implemented by other frameworks. It should only include ESP-IDF specific //| things.""" @@ -95,6 +97,13 @@ STATIC void espidf_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_pr mp_obj_exception_print(print, o_in, kind); } +//| class IDFError(builtins.OSError): +//| """Raised when an ``ESP-IDF`` function returns an error code. +//| `esp_err_t `_ +//| """ +//| +//| ... +//| const mp_obj_type_t mp_type_espidf_IDFError = { { &mp_type_type }, .name = MP_QSTR_IDFError, @@ -104,11 +113,8 @@ const mp_obj_type_t mp_type_espidf_IDFError = { .parent = &mp_type_OSError, }; - -//| import builtins -//| //| class MemoryError(builtins.MemoryError): -//| """Raised when an ESP IDF memory allocation fails.""" +//| """Raised when an ``ESP-IDF`` memory allocation fails.""" //| //| ... //| diff --git a/ports/espressif/bindings/espnow/ESPNow.c b/ports/espressif/bindings/espnow/ESPNow.c index 513966e1e8..78d80924fd 100644 --- a/ports/espressif/bindings/espnow/ESPNow.c +++ b/ports/espressif/bindings/espnow/ESPNow.c @@ -53,11 +53,13 @@ static void espnow_check_for_deinit(espnow_obj_t *self) { //| class ESPNow: //| """Provides access to the ESP-NOW protocol.""" //| -//| def __init__(self, buffer_size: Optional[int], phy_rate: Optional[int]) -> None: +//| def __init__(self, buffer_size: int = 526, phy_rate: int = 0) -> None: //| """Allocate and initialize `ESPNow` instance as a singleton. //| //| :param int buffer_size: The size of the internal ring buffer. Default: 526 bytes. -//| :param int phy_rate: The ESP-NOW physical layer rate. Default: 1 Mbps.""" +//| :param int phy_rate: The ESP-NOW physical layer rate. Default: 1 Mbps. +//| `wifi_phy_rate_t `_ +//| """ //| ... STATIC mp_obj_t espnow_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { enum { ARG_buffer_size, ARG_phy_rate }; @@ -71,7 +73,7 @@ STATIC mp_obj_t espnow_make_new(const mp_obj_type_t *type, size_t n_args, size_t espnow_obj_t *self = MP_STATE_PORT(espnow_singleton); - if (self != NULL) { + if (!common_hal_espnow_deinited(self)) { mp_raise_RuntimeError(translate("Already running")); } @@ -244,7 +246,9 @@ MP_PROPERTY_GETTER(espnow_buffer_size_obj, (mp_obj_t)&espnow_get_buffer_size_obj); //| phy_rate: int -//| """The ESP-NOW physical layer rate.""" +//| """The ESP-NOW physical layer rate. +//| `wifi_phy_rate_t `_ +//| """ //| STATIC mp_obj_t espnow_get_phy_rate(const mp_obj_t self_in) { espnow_obj_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/ports/espressif/bindings/espnow/Peer.c b/ports/espressif/bindings/espnow/Peer.c index 7b6cc5f668..f69bec01e6 100644 --- a/ports/espressif/bindings/espnow/Peer.c +++ b/ports/espressif/bindings/espnow/Peer.c @@ -31,19 +31,17 @@ #include "bindings/espnow/Peer.h" #include "common-hal/espnow/__init__.h" -// TODO: check peer already exist -// TODO: check peer dosen't exist - //| class Peer: //| """A data class to store parameters specific to a peer.""" //| //| def __init__( //| self, //| mac: bytes, +//| *, //| lmk: Optional[bytes], //| channel: int = 0, //| interface: int = 0, -//| encrypt: bool = False, +//| encrypted: bool = False, //| ) -> None: //| """Construct a new peer object. //| @@ -51,17 +49,17 @@ //| :param bytes lmk: The Local Master Key (lmk) of the peer. //| :param int channel: The peer's channel. Default: 0 ie. use the current channel. //| :param int interface: The WiFi interface to use. Default: 0 ie. STA. -//| :param bool encrypt: Whether or not to use encryption. +//| :param bool encrypted: Whether or not to use encryption. //| """ //| ... STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_mac, ARG_lmk, ARG_channel, ARG_interface, ARG_encrypt }; + enum { ARG_mac, ARG_lmk, ARG_channel, ARG_interface, ARG_encrypted }; static const mp_arg_t allowed_args[] = { { MP_QSTR_mac, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_lmk, MP_ARG_OBJ, { .u_obj = mp_const_none } }, - { MP_QSTR_channel, MP_ARG_INT, { .u_obj = mp_const_none } }, - { MP_QSTR_interface,MP_ARG_INT, { .u_obj = mp_const_none } }, - { MP_QSTR_encrypt, MP_ARG_BOOL,{ .u_obj = mp_const_none } }, + { MP_QSTR_lmk, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = mp_const_none } }, + { MP_QSTR_channel, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, + { MP_QSTR_interface,MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, + { MP_QSTR_encrypted,MP_ARG_BOOL | MP_ARG_KW_ONLY,{ .u_bool = false } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -77,20 +75,11 @@ STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, s memcpy(self->peer_info.peer_addr, common_hal_espnow_get_bytes_len(args[ARG_mac].u_obj, ESP_NOW_ETH_ALEN), ESP_NOW_ETH_ALEN); - const mp_obj_t channel = args[ARG_channel].u_obj; - if (channel != mp_const_none) { - self->peer_info.channel = mp_arg_validate_int_range(mp_obj_get_int(channel), 0, 14, MP_QSTR_channel); - } + self->peer_info.channel = mp_arg_validate_int_range(args[ARG_channel].u_int, 0, 14, MP_QSTR_channel); - const mp_obj_t interface = args[ARG_interface].u_obj; - if (interface != mp_const_none) { - self->peer_info.ifidx = (wifi_interface_t)mp_arg_validate_int_range(mp_obj_get_int(interface), 0, 1, MP_QSTR_interface); - } + self->peer_info.ifidx = (wifi_interface_t)mp_arg_validate_int_range(args[ARG_interface].u_int, 0, 1, MP_QSTR_interface); - const mp_obj_t encrypt = args[ARG_encrypt].u_obj; - if (encrypt != mp_const_none) { - self->peer_info.encrypt = mp_obj_is_true(encrypt); - } + self->peer_info.encrypt = args[ARG_encrypted].u_bool; const mp_obj_t lmk = args[ARG_lmk].u_obj; if (lmk != mp_const_none) { diff --git a/ports/espressif/bindings/espnow/Peers.c b/ports/espressif/bindings/espnow/Peers.c index 15d07c09d0..6fda9aed7a 100644 --- a/ports/espressif/bindings/espnow/Peers.c +++ b/ports/espressif/bindings/espnow/Peers.c @@ -35,8 +35,6 @@ #include "esp_now.h" -// TODO: Check for deinit - //| class Peers: //| """Maintains a `list` of `Peer` internally and only exposes a subset of `list` methods.""" //| diff --git a/ports/espressif/bindings/espnow/__init__.c b/ports/espressif/bindings/espnow/__init__.c index da15be49ea..3135858601 100644 --- a/ports/espressif/bindings/espnow/__init__.c +++ b/ports/espressif/bindings/espnow/__init__.c @@ -33,9 +33,8 @@ //| """ESP-NOW Module //| //| The `espnow` module provides an interface to the -//| `ESP-NOW `_ -//| protocol provided by Espressif on its SoCs -//| (`API docs `_). +//| `ESP-NOW `_ +//| protocol provided by Espressif on its SoCs. //| //| **Sender** //| diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/board.c b/ports/espressif/boards/01space_lcd042_esp32c3/board.c new file mode 100644 index 0000000000..56df21ab57 --- /dev/null +++ b/ports/espressif/boards/01space_lcd042_esp32c3/board.c @@ -0,0 +1,102 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * Copyright (c) 2021 skieast/Bruce Segal + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/board/__init__.h" +#include "shared-bindings/displayio/I2CDisplay.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/busio/I2C.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/board.h" +#include "supervisor/shared/board.h" +#include "shared-bindings/board/__init__.h" + +uint8_t display_init_sequence[] = { // SSD1306 + 0xAE, 0, // DISPLAY_OFF + 0x20, 1, 0x00, // Set memory addressing to horizontal mode. + 0x81, 1, 0xcf, // set contrast control + 0xA1, 0, // Column 127 is segment 0 + 0xA6, 0, // Normal display + 0xc8, 0, // Normal display + 0xA8, 1, 0x3f, // Mux ratio is 1/64 + 0xd5, 1, 0x80, // Set divide ratio + 0xd9, 1, 0xf1, // Set pre-charge period + 0xda, 1, 0x12, // Set com configuration + 0xdb, 1, 0x40, // Set vcom configuration + 0x8d, 1, 0x14, // Enable charge pump + 0xAF, 0, // DISPLAY_ON +}; + +void board_init(void) { + busio_i2c_obj_t *i2c = common_hal_board_create_i2c(0); + + // What we would do if it wasn't the shared board I2C: (for reference) + // busio_i2c_obj_t *i2c = &displays[0].i2cdisplay_bus.inline_bus; + // common_hal_busio_i2c_construct(i2c, &pin_GPIO23, &pin_GPIO22, 100000, 0); + // common_hal_busio_i2c_never_reset(i2c); + + displayio_i2cdisplay_obj_t *bus = &displays[0].i2cdisplay_bus; + bus->base.type = &displayio_i2cdisplay_type; + common_hal_displayio_i2cdisplay_construct(bus, + i2c, + 0x3c, + NULL + ); + + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 72, // Width + 40, // Height + 28, // column start + 28, // row start + 0, // rotation + 1, // Color depth + true, // grayscale + false, // pixels in byte share row. Only used with depth < 8 + 1, // bytes per cell. Only valid for depths < 8 + false, // reverse_pixels_in_byte. Only valid for depths < 8 + true, // reverse_pixels_in_word + 0x21, // Set column command + 0x22, // Set row command + 44, // Write ram command + display_init_sequence, + sizeof(display_init_sequence), + NULL, // no backlight pin + 0x81, // brightness command + 1.0f, // brightness + true, // single_byte_bounds + true, // data as commands + true, // auto_refresh + 60, // native_frames_per_second + true, // backlight_on_high + false, // SH1107_addressing + 0); // backlight pwm frequency +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.h b/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.h new file mode 100644 index 0000000000..cae80fa78c --- /dev/null +++ b/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.h @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 Neradoc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Board setup +#define MICROPY_HW_BOARD_NAME "01Space 0.42 OLED ESP32C3" +#define MICROPY_HW_MCU_NAME "ESP32-C3FH4" + +// Status LED +#define MICROPY_HW_NEOPIXEL (&pin_GPIO2) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO6, .sda = &pin_GPIO5}} + +// For entering safe mode +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) + +#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.mk b/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.mk new file mode 100644 index 0000000000..e4467a3bbf --- /dev/null +++ b/ports/espressif/boards/01space_lcd042_esp32c3/mpconfigboard.mk @@ -0,0 +1,8 @@ +CIRCUITPY_CREATOR_ID = 0x01011ACE +CIRCUITPY_CREATION_ID = 0x00C30042 + +IDF_TARGET = esp32c3 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/pins.c b/ports/espressif/boards/01space_lcd042_esp32c3/pins.c new file mode 100644 index 0000000000..a28ffca6d2 --- /dev/null +++ b/ports/espressif/boards/01space_lcd042_esp32c3/pins.c @@ -0,0 +1,68 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 Neradoc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig b/ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig new file mode 100644 index 0000000000..24f7d625ea --- /dev/null +++ b/ports/espressif/boards/01space_lcd042_esp32c3/sdkconfig @@ -0,0 +1,6 @@ +# chip is ESP32-C3 FH4 +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="01Space-LCD042-ESP32C3" +# end of LWIP diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig index a162344cfb..9d924272ec 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/sdkconfig @@ -5,4 +5,3 @@ CONFIG_ESP32S3_SPIRAM_SUPPORT=n # CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" # end of LWIP - diff --git a/ports/espressif/boards/deneyap_kart/board.c b/ports/espressif/boards/deneyap_kart/board.c new file mode 100644 index 0000000000..8c0c8b8b0b --- /dev/null +++ b/ports/espressif/boards/deneyap_kart/board.c @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 Radio Sound, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_kart/mpconfigboard.h b/ports/espressif/boards/deneyap_kart/mpconfigboard.h new file mode 100644 index 0000000000..c2251c3dcb --- /dev/null +++ b/ports/espressif/boards/deneyap_kart/mpconfigboard.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Kart" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO4) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO15, .sda = &pin_GPIO4}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO19, .mosi = &pin_GPIO5, .miso = &pin_GPIO18}} + +#define CIRCUITPY_BOARD_UART (0) + +// For entering safe mode, use BUT button +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +// Explanation of how a user got into safe mode +// #define BOARD_USER_SAFE_MODE_ACTION translate("You pressed the BUT button at start up.") + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/deneyap_kart/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart/mpconfigboard.mk new file mode 100644 index 0000000000..ea8c9a8522 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart/mpconfigboard.mk @@ -0,0 +1,8 @@ +CIRCUITPY_CREATOR_ID = 0x19231923 +CIRCUITPY_CREATION_ID = 0x00320001 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/deneyap_kart/pins.c b/ports/espressif/boards/deneyap_kart/pins.c new file mode 100644 index 0000000000..9408d4470c --- /dev/null +++ b/ports/espressif/boards/deneyap_kart/pins.c @@ -0,0 +1,99 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, right side, then left side + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_CAMD4), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_CAMD3), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_LEDG), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_LEDR), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_CAMD5), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_CAMD2), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_CAMD6), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_CAMPC), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_IMUSD), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_LEDB), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_IMUSC), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_T5), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_MICC), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_T4), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_MICD), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_T3), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_T2), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_CAMV), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_CAMH), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_CAMD9), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_CAMD8), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_T0), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_CAMXC), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_T1), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_CAMSD), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_CAMSC), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_CAMD7), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_kart/sdkconfig b/ports/espressif/boards/deneyap_kart/sdkconfig new file mode 100644 index 0000000000..7ec0461dcf --- /dev/null +++ b/ports/espressif/boards/deneyap_kart/sdkconfig @@ -0,0 +1,19 @@ +CONFIG_ESP32_SPIRAM_SUPPORT=y +# +# SPI RAM config +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=8388608 +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_IGNORE_NOTFOUND=y +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y diff --git a/ports/espressif/boards/deneyap_kart_1a/board.c b/ports/espressif/boards/deneyap_kart_1a/board.c new file mode 100644 index 0000000000..8c0c8b8b0b --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a/board.c @@ -0,0 +1,34 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2023 Radio Sound, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.h b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.h new file mode 100644 index 0000000000..ba7c216c89 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.h @@ -0,0 +1,50 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Kart 1A" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO15, .sda = &pin_GPIO4}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO19, .mosi = &pin_GPIO5, .miso = &pin_GPIO18}} + +#define CIRCUITPY_BOARD_UART (0) + +// For entering safe mode, use BUT button +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +// Explanation of how a user got into safe mode +// #define BOARD_USER_SAFE_MODE_ACTION translate("You pressed the BUT button at start up.") + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) diff --git a/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk new file mode 100644 index 0000000000..976083217e --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk @@ -0,0 +1,8 @@ +CIRCUITPY_CREATOR_ID = 0x19231923 +CIRCUITPY_CREATION_ID = 0x00320002 + +IDF_TARGET = esp32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/deneyap_kart_1a/pins.c b/ports/espressif/boards/deneyap_kart_1a/pins.c new file mode 100644 index 0000000000..c4b1d51840 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a/pins.c @@ -0,0 +1,97 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // External pins are in silkscreen order, from top to bottom, right side, then left side + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_CAMD4), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_CAMD3), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_CAMD5), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_CAMD2), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_CAMD6), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_CAMPC), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SDMI), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_T5), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_RGBLED), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_T4), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_SDCS), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_T3), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_SDMO), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_T2), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_SDCK), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_CAMV), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_CAMH), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_CAMD9), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_CAMD8), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_T0), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_CAMXC), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_T1), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_CAMSD), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_CAMSC), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_CAMD7), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_kart_1a/sdkconfig b/ports/espressif/boards/deneyap_kart_1a/sdkconfig new file mode 100644 index 0000000000..7ec0461dcf --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a/sdkconfig @@ -0,0 +1,19 @@ +CONFIG_ESP32_SPIRAM_SUPPORT=y +# +# SPI RAM config +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=8388608 +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_IGNORE_NOTFOUND=y +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CACHE_WORKAROUND=y diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/board.c b/ports/espressif/boards/deneyap_kart_1a_v2/board.c new file mode 100644 index 0000000000..2287dbaaa7 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/board.c @@ -0,0 +1,32 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h new file mode 100644 index 0000000000..088bfbfd41 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Kart 1A v2" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO33) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO21) + +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO4) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO3) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO38) +#define DEFAULT_UART_BUS_TX (&pin_GPIO39) + +#define DOUBLE_TAP_PIN (&pin_GPIO34) diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk new file mode 100644 index 0000000000..1ec7c73185 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x239A +USB_PID = 0x8148 + +USB_PRODUCT = "Deneyap Kart 1A v2" +USB_MANUFACTURER = "Turkish Technology Team Foundation" + +IDF_TARGET = esp32s3 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESPCAMERA = 0 diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/pins.c b/ports/espressif/boards/deneyap_kart_1a_v2/pins.c new file mode 100644 index 0000000000..cf4c915e7f --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/pins.c @@ -0,0 +1,73 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_I2C_POWER), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig b/ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig new file mode 100644 index 0000000000..4e99a09f2e --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig @@ -0,0 +1,47 @@ +# +# Component config +# +# +# ESP32S3-Specific +# +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_MODE_QUAD is not set +CONFIG_SPIRAM_MODE_OCT=y +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 +# +# PSRAM Clock and CS IO for ESP32S3 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM Clock and CS IO for ESP32S3 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_120M is not set +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# end of SPI RAM config + +# end of ESP32S3-Specific + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP + +# end of Component config diff --git a/ports/espressif/boards/deneyap_kart_g/board.c b/ports/espressif/boards/deneyap_kart_g/board.c new file mode 100644 index 0000000000..9b26fe466d --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_g/board.c @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/board.h" + + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_kart_g/mpconfigboard.h b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.h new file mode 100644 index 0000000000..ce2969bbda --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * Copyright (c) 2021 skieast/Bruce Segal + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Board setup +#define MICROPY_HW_BOARD_NAME "Deneyap Kart G" +#define MICROPY_HW_MCU_NAME "ESP32-C3FN4" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO2, .sda = &pin_GPIO8}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO4, .mosi = &pin_GPIO6, .miso = &pin_GPIO5}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} + +// For entering safe mode +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) + +#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk new file mode 100644 index 0000000000..a470d7a088 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk @@ -0,0 +1,8 @@ +CIRCUITPY_CREATOR_ID = 0x19231923 +CIRCUITPY_CREATION_ID = 0x00C30001 + +IDF_TARGET = esp32c3 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/deneyap_kart_g/pins.c b/ports/espressif/boards/deneyap_kart_g/pins.c new file mode 100644 index 0000000000..c8b7ef4996 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_g/pins.c @@ -0,0 +1,51 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_BT), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_RGBLED), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_PWM2), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_kart_g/sdkconfig b/ports/espressif/boards/deneyap_kart_g/sdkconfig new file mode 100644 index 0000000000..a988de5fea --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_g/sdkconfig @@ -0,0 +1,5 @@ +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="DeneyapKartG" +# end of LWIP diff --git a/ports/espressif/boards/deneyap_mini/board.c b/ports/espressif/boards/deneyap_mini/board.c new file mode 100644 index 0000000000..ac27ce4970 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/board.c @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_mini/mpconfigboard.h b/ports/espressif/boards/deneyap_mini/mpconfigboard.h new file mode 100644 index 0000000000..0e47285238 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/mpconfigboard.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Mini" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO37, .sda = &pin_GPIO36}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO38, .mosi = &pin_GPIO40, .miso = &pin_GPIO39}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO43, .rx = &pin_GPIO44}} diff --git a/ports/espressif/boards/deneyap_mini/mpconfigboard.mk b/ports/espressif/boards/deneyap_mini/mpconfigboard.mk new file mode 100644 index 0000000000..f6944b7d7a --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x303A +USB_PID = 0x8142 + +USB_PRODUCT = "Deneyap Mini" +USB_MANUFACTURER = "Turkish Technology Team Foundation" + +IDF_TARGET = esp32s2 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESPCAMERA = 0 diff --git a/ports/espressif/boards/deneyap_mini/pins.c b/ports/espressif/boards/deneyap_mini/pins.c new file mode 100644 index 0000000000..6c04661467 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/pins.c @@ -0,0 +1,89 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_MO), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_MI), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_MC), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_SC), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_SD), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_DA1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_DA0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_BT), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_LEDB), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_LEDG), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_LEDR), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_T0), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_T1), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_T2), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_T3), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_T4), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_T5), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_mini/sdkconfig b/ports/espressif/boards/deneyap_mini/sdkconfig new file mode 100644 index 0000000000..7dfaf3052c --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/sdkconfig @@ -0,0 +1,4 @@ +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="DeneyapMini" +# end of LWIP diff --git a/ports/espressif/boards/deneyap_mini_v2/board.c b/ports/espressif/boards/deneyap_mini_v2/board.c new file mode 100644 index 0000000000..2287dbaaa7 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/board.c @@ -0,0 +1,32 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h new file mode 100644 index 0000000000..be6cbd86b7 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Mini v2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO37, .sda = &pin_GPIO36}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO38, .mosi = &pin_GPIO40, .miso = &pin_GPIO39}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO43, .rx = &pin_GPIO44}} diff --git a/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk new file mode 100644 index 0000000000..fa9c6b40ea --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x303A +USB_PID = 0x8145 + +USB_PRODUCT = "Deneyap Mini v2" +USB_MANUFACTURER = "Turkish Technology Team Foundation" + +IDF_TARGET = esp32s2 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/deneyap_mini_v2/pins.c b/ports/espressif/boards/deneyap_mini_v2/pins.c new file mode 100644 index 0000000000..ab3250769d --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/pins.c @@ -0,0 +1,85 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_MO), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_MI), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_MC), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_SC), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_SD), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_DA1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_DA0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_RGBLED), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_T0), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_T1), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_T2), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_T3), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_T4), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_T5), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_T6), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_mini_v2/sdkconfig b/ports/espressif/boards/deneyap_mini_v2/sdkconfig new file mode 100644 index 0000000000..613b744ef2 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 +# end of SPI RAM config + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="DeneyapMini_v2" +# end of LWIP diff --git a/ports/espressif/boards/espressif_esp32_eye/sdkconfig b/ports/espressif/boards/espressif_esp32_eye/sdkconfig index a73d92e0a2..26db1e8087 100644 --- a/ports/espressif/boards/espressif_esp32_eye/sdkconfig +++ b/ports/espressif/boards/espressif_esp32_eye/sdkconfig @@ -69,4 +69,3 @@ CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX=32768 # CONFIG_ESP_CONSOLE_UART_TX_GPIO=1 CONFIG_ESP_CONSOLE_UART_RX_GPIO=3 - diff --git a/ports/espressif/boards/lolin_s2_mini/pins.c b/ports/espressif/boards/lolin_s2_mini/pins.c index a4b18c4e9b..ee81e00d9e 100644 --- a/ports/espressif/boards/lolin_s2_mini/pins.c +++ b/ports/espressif/boards/lolin_s2_mini/pins.c @@ -4,7 +4,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS // S2 Mini Board bottom, right, top-bottom - // GPIO0-GPIO14: broken out as a bloc on ESP32-S2FN4R2 SoC + // GPIO0-GPIO14: broken out as a block on ESP32-S2FN4R2 SoC // mpconfigboard.h: GPIO0: CIRCUITPY_BOOT_BUTTON { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, // RTC_GPIO0,GPIO0 @@ -57,7 +57,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // skip GPIO22-GPIO25: not broken out on ESP32-S2FN4R2 SoC // skip GPIO26-GPIO32: SPI Flash & RAM, not broken out on S2 Mini (internal to ESP32-S2FN4R2 SoC?) - // GPIO33-GPIO40: broken out as a bloc on ESP32-S2FN4R2 SoC, last 2 half of JTAG + // GPIO33-GPIO40: broken out as a block on ESP32-S2FN4R2 SoC, last 2 half of JTAG { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },// SPIIO4,GPIO33,FSPIHD { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },// def from Wemos MP { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO33) },// D1 mini pin D2 GPIO4 diff --git a/ports/espressif/boards/m5stack_atoms3_lite/board.c b/ports/espressif/boards/m5stack_atoms3_lite/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h new file mode 100644 index 0000000000..43dd436345 --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "M5Stack AtomS3 Lite" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO35) + +#define CIRCUITPY_BOARD_I2C (2) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO39, .sda = &pin_GPIO38}, \ + {.scl = &pin_GPIO1, .sda = &pin_GPIO2}} diff --git a/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk new file mode 100644 index 0000000000..8bb5ab76d8 --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x303A +USB_PID = 0x815F +USB_PRODUCT = "M5Stack AtomS3 Lite" +USB_MANUFACTURER = "M5Stack" + +IDF_TARGET = esp32s3 + +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB +CIRCUITPY_ESPCAMERA = 0 diff --git a/ports/espressif/boards/m5stack_atoms3_lite/pins.c b/ports/espressif/boards/m5stack_atoms3_lite/pins.c new file mode 100644 index 0000000000..052c15e69f --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/pins.c @@ -0,0 +1,42 @@ +#include "shared-bindings/board/__init__.h" + +CIRCUITPY_BOARD_BUS_SINGLETON(porta_i2c, i2c, 1) + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_PORTA_SCL), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_IR_LED), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_porta_i2c_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/m5stack_atoms3_lite/sdkconfig b/ports/espressif/boards/m5stack_atoms3_lite/sdkconfig new file mode 100644 index 0000000000..9d924272ec --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/sdkconfig @@ -0,0 +1,7 @@ +CONFIG_ESP32S3_SPIRAM_SUPPORT=n + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP diff --git a/ports/espressif/boards/m5stack_stick_c/board.c b/ports/espressif/boards/m5stack_stick_c/board.c index bbc0447056..ae29c9fa76 100644 --- a/ports/espressif/boards/m5stack_stick_c/board.c +++ b/ports/espressif/boards/m5stack_stick_c/board.c @@ -193,7 +193,7 @@ static bool pmic_init(void) { } // Reg: 12h - // Enable EXTEN, DCDC1, LDO2 and LDO3 + // Enable CTRL_EXTEN, DCDC1, LDO2 and LDO3 write_buf[0] = AXP192_DCDC13_LDO23_CTRL; write_buf[1] = AXP192_DCDC13_LDO23_CTRL_EXTEN | AXP192_DCDC13_LDO23_CTRL_LDO3 | diff --git a/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c index 070e3418da..359263df81 100644 --- a/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c +++ b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c @@ -51,7 +51,7 @@ uint8_t display_init_sequence[] = { 0xC5, 0x01, 0x0E, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x20, 0x00, // _INVOFF 0x36, 0x01, 0x18, // _MADCTL bottom to top refresh - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3A, 0x01, 0x05, // COLMOD - 16bit color 0xE0, 0x10, 0x02, 0x1C, 0x07, 0x12, 0x37, 0x32, 0x29, 0x2D, 0x29, 0x25, 0x2B, 0x39, 0x00, 0x01, 0x03, 0x10, // _GMCTRP1 Gamma diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index 3239c501cc..01adae3adb 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -221,7 +221,7 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active) { if (self->scan_results != NULL) { if (!shared_module_bleio_scanresults_get_done(self->scan_results)) { - mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan.")); + mp_raise_bleio_BluetoothError(translate("Scan already in progress. Stop with stop_scan.")); } self->scan_results = NULL; } diff --git a/ports/espressif/common-hal/_bleio/Connection.c b/ports/espressif/common-hal/_bleio/Connection.c index 75def8ad76..5e3e02d8e5 100644 --- a/ports/espressif/common-hal/_bleio/Connection.c +++ b/ports/espressif/common-hal/_bleio/Connection.c @@ -248,7 +248,7 @@ STATIC int _discovered_characteristic_cb(uint16_t conn_handle, ((chr->properties & BLE_GATT_CHR_PROP_WRITE) != 0 ? CHAR_PROP_WRITE : 0) | ((chr->properties & BLE_GATT_CHR_PROP_WRITE_NO_RSP) != 0 ? CHAR_PROP_WRITE_NO_RESPONSE : 0); - // Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler. + // Call common_hal_bleio_characteristic_construct() to initialize some fields and set up evt handler. common_hal_bleio_characteristic_construct( characteristic, service, chr->val_handle, uuid, props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, diff --git a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c index 232614ce32..b58234c9a8 100644 --- a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c +++ b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c @@ -119,7 +119,7 @@ void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alar for (uint8_t i = 1; i <= 14; i++) { if ((touch_channel_mask & 1 << i) != 0) { touch_pad_t touch_channel = (touch_pad_t)i; - // intialize touchpad + // initialize touchpad peripherals_touch_init(touch_channel); // wait for touch data to reset @@ -166,7 +166,7 @@ void alarm_touch_touchalarm_prepare_for_deep_sleep(void) { peripherals_touch_never_reset(false); peripherals_touch_reset(); - // intialize touchpad + // initialize touchpad peripherals_touch_init(touch_channel); #if !defined(CONFIG_IDF_TARGET_ESP32) diff --git a/ports/espressif/common-hal/microcontroller/Processor.c b/ports/espressif/common-hal/microcontroller/Processor.c index 1f09742955..c0e72c85b9 100644 --- a/ports/espressif/common-hal/microcontroller/Processor.c +++ b/ports/espressif/common-hal/microcontroller/Processor.c @@ -64,7 +64,7 @@ float common_hal_mcu_processor_get_voltage(void) { uint32_t common_hal_mcu_processor_get_frequency(void) { #if defined(CONFIG_IDF_TARGET_ESP32) - return CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 100000; + return CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 1000000; #elif defined(CONFIG_IDF_TARGET_ESP32C3) return CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ * 1000000; #elif defined(CONFIG_IDF_TARGET_ESP32S2) diff --git a/ports/espressif/common-hal/pulseio/PulseIn.c b/ports/espressif/common-hal/pulseio/PulseIn.c index bb6ef7f975..42db2f18bd 100644 --- a/ports/espressif/common-hal/pulseio/PulseIn.c +++ b/ports/espressif/common-hal/pulseio/PulseIn.c @@ -123,7 +123,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu rmt_config_t config = RMT_DEFAULT_CONFIG_RX(pin->number, channel); config.rx_config.filter_en = true; config.rx_config.idle_threshold = 30000; // 30*3=90ms idle required to register a sequence - config.clk_div = 240; // All measurements are divided by 3 to accomodate 65ms pulses + config.clk_div = 240; // All measurements are divided by 3 to accommodate 65ms pulses rmt_config(&config); rmt_driver_install(channel, 1000, 0); // TODO: pick a more specific buffer size? diff --git a/ports/espressif/common-hal/pwmio/PWMOut.c b/ports/espressif/common-hal/pwmio/PWMOut.c index 2cb1e6254b..519885a032 100644 --- a/ports/espressif/common-hal/pwmio/PWMOut.c +++ b/ports/espressif/common-hal/pwmio/PWMOut.c @@ -197,7 +197,7 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) { if (!taken || self->variable_frequency) { ledc_timer_rst(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num); reserved_timer_freq[self->tim_handle.timer_num] = 0; - // if timer isn't varfreq this will be off aleady + // if timer isn't varfreq this will be off already varfreq_timers[self->tim_handle.timer_num] = false; never_reset_tim[self->tim_handle.timer_num] = false; } diff --git a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c index 07b97cf9a3..088f4a15dc 100644 --- a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c @@ -69,7 +69,7 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode .unit = unit, }; - // Reinitalize same unit, CHANNEL_1 with different parameters. + // Reinitialize same unit, CHANNEL_1 with different parameters. peripherals_pcnt_reinit(&pcnt_config_channel_1); self->pin_a = pin_a->number; diff --git a/ports/espressif/i2s_lcd_driver.h b/ports/espressif/i2s_lcd_driver.h index 0002d6b564..27c4e66b06 100644 --- a/ports/espressif/i2s_lcd_driver.h +++ b/ports/espressif/i2s_lcd_driver.h @@ -44,7 +44,7 @@ typedef struct { } i2s_lcd_config_t; /** - * @brief Initilize i2s lcd driver. + * @brief Initialize i2s lcd driver. * * @param config configuration of i2s * diff --git a/ports/litex/boards/fomu/fomu-spi.ld b/ports/litex/boards/fomu/fomu-spi.ld index e7db25b0c5..33ba3db686 100644 --- a/ports/litex/boards/fomu/fomu-spi.ld +++ b/ports/litex/boards/fomu/fomu-spi.ld @@ -93,7 +93,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ - _sidata = _etext; /* This is used by the startup in order to initialize the .data secion */ + _sidata = _etext; /* This is used by the startup in order to initialize the .data section */ } >FLASH_FIRMWARE /* Uninitialized data section */ diff --git a/ports/litex/common-hal/neopixel_write/__init__.c b/ports/litex/common-hal/neopixel_write/__init__.c index e7e5600fb1..b26bbac695 100644 --- a/ports/litex/common-hal/neopixel_write/__init__.c +++ b/ports/litex/common-hal/neopixel_write/__init__.c @@ -72,7 +72,7 @@ static void ledda_init(void) { // Set clock register to 12 MHz / 64 kHz - 1 ledda_write((12000000 / 64000) - 1, LEDDBR); - // Ensure LED "breathe" effect is diabled + // Ensure LED "breathe" effect is disabled ledda_write(0, LEDDBCRR); ledda_write(0, LEDDBCFR); diff --git a/ports/litex/crt0-vexriscv.S b/ports/litex/crt0-vexriscv.S index 0419acf851..0517711865 100644 --- a/ports/litex/crt0-vexriscv.S +++ b/ports/litex/crt0-vexriscv.S @@ -6,7 +6,7 @@ _start: j crt_init - # This sentinal ensures that this program is loaded + # This sentinel ensures that this program is loaded # to RAM when loaded using dfu-util. #.word 0x17ab0f23 #.word 0x10001000 diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index d8d12b74da..ff2b6c35c1 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -119,6 +119,7 @@ SRC_SDK := \ drivers/lpuart/fsl_lpuart.c \ drivers/ocotp/fsl_ocotp.c \ drivers/pwm/fsl_pwm.c \ + drivers/sai/fsl_sai.c \ drivers/snvs_hp/fsl_snvs_hp.c \ drivers/snvs_lp/fsl_snvs_lp.c \ drivers/tempmon/fsl_tempmon.c \ @@ -136,6 +137,7 @@ SRC_C += \ peripherals/mimxrt10xx/$(CHIP_FAMILY)/clocks.c \ peripherals/mimxrt10xx/$(CHIP_FAMILY)/periph.c \ peripherals/mimxrt10xx/$(CHIP_FAMILY)/pins.c \ + peripherals/mimxrt10xx/pins.c \ reset.c \ supervisor/flexspi_nor_flash_ops.c @@ -146,11 +148,6 @@ SRC_C += \ endif -# TODO -#ifeq ($(CIRCUITPY_AUDIOBUSIO),1) -#SRC_C += peripherals/samd/i2s.c peripherals/samd/$(CHIP_FAMILY)/i2s.c -#endif -# SRC_COMMON_HAL_EXPANDED = $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ $(addprefix common-hal/, $(SRC_COMMON_HAL)) diff --git a/ports/mimxrt10xx/background.c b/ports/mimxrt10xx/background.c index 529f791a39..faa2bda3f8 100644 --- a/ports/mimxrt10xx/background.c +++ b/ports/mimxrt10xx/background.c @@ -35,9 +35,6 @@ void PLACE_IN_ITCM(port_background_task)(void) { } void port_background_tick(void) { - #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO - audio_dma_background(); - #endif } void port_start_background_task(void) { diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/pins.c b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c index 886909e1dd..98082e3c11 100644 --- a/ports/mimxrt10xx/boards/metro_m7_1011/pins.c +++ b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c @@ -38,8 +38,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_GPIO_SD_05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_GPIO_AD_11) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RESET), MP_ROM_PTR(&pin_GPIO_AD_07) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_GPIO_09) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_GPIO_10) }, + // These RX and TX are from the point of view of the i.MX microcontroller. + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_GPIO_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_GPIO_10) }, // SPI { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_AD_06) }, @@ -56,5 +57,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + + { MP_ROM_QSTR(MP_QSTR_I2S_WSEL), MP_ROM_PTR(&pin_GPIO_06) }, // D10 + { MP_ROM_QSTR(MP_QSTR_I2S_BCLK), MP_ROM_PTR(&pin_GPIO_07) }, // D9 + { MP_ROM_QSTR(MP_QSTR_I2S_DOUT), MP_ROM_PTR(&pin_GPIO_04) }, // D12 }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.c b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.c new file mode 100644 index 0000000000..06765afe02 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.c @@ -0,0 +1,154 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include + +#include "mpconfigport.h" + +// Some boards don't implement I2SOut, so suppress any routines from here. +#if CIRCUITPY_AUDIOBUSIO_I2SOUT + +#include "py/gc.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "common-hal/audiobusio/I2SOut.h" +#include "shared-bindings/audiobusio/I2SOut.h" +#include "shared-bindings/audiocore/RawSample.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate/translate.h" +#include "supervisor/shared/tick.h" + +// Where required we use identifier names that are required by NXP's +// API, even though they do not conform to the naming standards that Adafruit +// strives to adhere to. https://www.adafruit.com/blacklivesmatter +#include "sdk/drivers/sai/fsl_sai.h" + +STATIC void config_periph_pin(const mcu_periph_obj_t *periph) { + if (!periph) { + return; + } + if (periph->pin->mux_reg) { + IOMUXC_SetPinMux( + periph->pin->mux_reg, periph->mux_mode, + periph->input_reg, periph->input_idx, + 0, + 1); + } + + IOMUXC_SetPinConfig(0, 0, 0, 0, + periph->pin->cfg_reg, + IOMUXC_SW_PAD_CTL_PAD_HYS(0) + | IOMUXC_SW_PAD_CTL_PAD_PUS(0) + | IOMUXC_SW_PAD_CTL_PAD_PUE(0) + | IOMUXC_SW_PAD_CTL_PAD_PKE(1) + | IOMUXC_SW_PAD_CTL_PAD_ODE(0) + | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) + | IOMUXC_SW_PAD_CTL_PAD_DSE(4) + | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); +} + +// Caller validates that pins are free. +void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self, + const mcu_pin_obj_t *bit_clock, const mcu_pin_obj_t *word_select, + const mcu_pin_obj_t *data, bool left_justified) { + + int instance = -1; + const mcu_periph_obj_t *bclk_periph = find_pin_function(mcu_sai_tx_bclk_list, bit_clock, &instance, MP_QSTR_bit_clock); + const mcu_periph_obj_t *sync_periph = find_pin_function(mcu_sai_tx_sync_list, word_select, &instance, MP_QSTR_word_select); + const mcu_periph_obj_t *data_periph = find_pin_function(mcu_sai_tx_data0_list, data, &instance, MP_QSTR_data); + + sai_transceiver_t config; + SAI_GetClassicI2SConfig(&config, 16, kSAI_Stereo, 1); + config.syncMode = kSAI_ModeAsync; + config.fifo.fifoPacking = kSAI_FifoPackingDisabled; + // These identifier names are required by NXP's API, even though they do + // not conform to the naming standards that Adafruit strives to adhere to. + // https://www.adafruit.com/blacklivesmatter + config.masterSlave = kSAI_Master; + port_i2s_initialize(&self->i2s, instance, &config); + + self->bit_clock = bit_clock; + self->word_select = word_select; + self->data = data; + claim_pin(bit_clock); + claim_pin(word_select); + claim_pin(data); + config_periph_pin(data_periph); + config_periph_pin(sync_periph); + config_periph_pin(bclk_periph); +} + +bool common_hal_audiobusio_i2sout_deinited(audiobusio_i2sout_obj_t *self) { + return port_i2s_deinited(&self->i2s); +} + +void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t *self) { + if (common_hal_audiobusio_i2sout_deinited(self)) { + return; + } + + port_i2s_deinit(&self->i2s); + + common_hal_reset_pin(self->bit_clock); + self->bit_clock = NULL; + + common_hal_reset_pin(self->word_select); + self->word_select = NULL; + + common_hal_reset_pin(self->data); + self->data = NULL; +} + +void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self, + mp_obj_t sample, bool loop) { + if (common_hal_audiobusio_i2sout_get_playing(self)) { + common_hal_audiobusio_i2sout_stop(self); + } + port_i2s_play(&self->i2s, sample, loop); +} + +void common_hal_audiobusio_i2sout_pause(audiobusio_i2sout_obj_t *self) { + port_i2s_pause(&self->i2s); +} + +void common_hal_audiobusio_i2sout_resume(audiobusio_i2sout_obj_t *self) { + port_i2s_resume(&self->i2s); +} + +bool common_hal_audiobusio_i2sout_get_paused(audiobusio_i2sout_obj_t *self) { + return port_i2s_get_paused(&self->i2s); +} + +void common_hal_audiobusio_i2sout_stop(audiobusio_i2sout_obj_t *self) { + port_i2s_stop(&self->i2s); +} + +bool common_hal_audiobusio_i2sout_get_playing(audiobusio_i2sout_obj_t *self) { + return port_i2s_get_playing(&self->i2s); +} + +#endif // CIRCUITPY_AUDIOBUSIO_I2SOUT diff --git a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h new file mode 100644 index 0000000000..319e52c159 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +// Some boards don't implement I2SOut, so suppress any routines from here. +#if CIRCUITPY_AUDIOBUSIO_I2SOUT +#include "supervisor/background_callback.h" +#include "common-hal/microcontroller/Pin.h" + +#include "common-hal/audiobusio/__init__.h" + +typedef struct { + mp_obj_base_t base; + i2s_t i2s; + const mcu_pin_obj_t *bit_clock; + const mcu_pin_obj_t *word_select; + const mcu_pin_obj_t *data; +} audiobusio_i2sout_obj_t; + +#endif diff --git a/ports/mimxrt10xx/common-hal/audiobusio/PDMIn.c b/ports/mimxrt10xx/common-hal/audiobusio/PDMIn.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/common-hal/audiobusio/PDMIn.h b/ports/mimxrt10xx/common-hal/audiobusio/PDMIn.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c new file mode 100644 index 0000000000..13ae64d27c --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c @@ -0,0 +1,464 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include + +#include "py/runtime.h" + +#include "common-hal/audiobusio/__init__.h" +#include "shared-module/audiocore/__init__.h" + +#define SAI_CLOCK_SOURCE_SELECT (2U) +#define SAI_CLOCK_SOURCE_DIVIDER (63U) +#define SAI_CLOCK_SOURCE_PRE_DIVIDER (0U) + +#define SAI_CLOCK_FREQ (CLOCK_GetFreq(kCLOCK_AudioPllClk) / (SAI_CLOCK_SOURCE_DIVIDER + 1U) / \ + (SAI_CLOCK_SOURCE_PRE_DIVIDER + 1U)) + +#define AUDIO_BUFFER_FRAME_COUNT (128) // in uint32_t; there are 4, giving 2048 bytes. In all they hold 10ms @ stereo 16-bit 48kHz before all buffers drain + +/* + * AUDIO PLL setting: Frequency = Fref * (DIV_SELECT + NUM / DENOM) + * = 24 * (32 + 96 / 125) = 24 * (32.768) + * = 786.432 MHz = 48kHz * 16384 + * + * This default clocking is used during initial configuration; it also works well for + * frequencies that evenly divide 192kHz, such as 8/12/24/48kHz. However, it doesn't work + * well for 44.1/22/11kHz, so there's the possibility of using a different + * setting when playing a particular sample. + */ +const clock_audio_pll_config_t audioPllConfig = { + .loopDivider = 32, /* PLL loop divider. Valid range for DIV_SELECT divider value: 27~54. */ + .postDivider = 1, /* Divider after the PLL, should only be 1, 2, 4, 8, 16. */ + .numerator = 96, /* 30 bit numerator of fractional loop divider. */ + .denominator = 125, /* 30 bit denominator of fractional loop divider */ +}; + +static I2S_Type *const i2s_instances[] = I2S_BASE_PTRS; +static uint8_t i2s_in_use, i2s_playing; + +static I2S_Type *SAI_GetPeripheral(int idx) { + if (idx < 0 || idx >= (int)MP_ARRAY_SIZE(i2s_instances)) { + return NULL; + } + return i2s_instances[idx]; +} + +static int SAI_GetInstance(I2S_Type *peripheral) { + for (size_t i = 0; i < MP_ARRAY_SIZE(i2s_instances); i++) { if (peripheral == i2s_instances[i]) { + return i; + } + } + return -1; +} + +static bool i2s_clock_off(I2S_Type *peripheral) { + int index = SAI_GetInstance(peripheral); + switch (index) { + #if defined(SAI0) + case 0: + CLOCK_DisableClock(kCLOCK_Sai0); + return true; + #endif + #if defined(SAI1) + case 1: + CLOCK_DisableClock(kCLOCK_Sai1); + return true; + #endif + #if defined(SAI2) + case 2: + CLOCK_DisableClock(kCLOCK_Sai2); + return true; + #endif + #if defined(SAI3) + case 3: + CLOCK_DisableClock(kCLOCK_Sai3); + return true; + #endif + #if defined(SAI4) + case 4: + CLOCK_DisableClock(kCLOCK_Sai4); + return true; + #endif + #if defined(SAI5) + case 5: + CLOCK_DisableClock(kCLOCK_Sai5); + return true; + #endif + #if defined(SAI6) + case 6: + CLOCK_DisableClock(kCLOCK_Sai6); + return true; + #endif + #if defined(SAI7) + case 7: + CLOCK_DisableClock(kCLOCK_Sai7); + return true; + #endif + } + return false; +} + +static bool i2s_clocking(I2S_Type *peripheral) { + int index = SAI_GetInstance(peripheral); + switch (index) { + #if defined(SAI0) + case 0: + CLOCK_SetDiv(kCLOCK_Sai0PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai0Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai0Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai0); + return true; + #endif + #if defined(SAI1) + case 1: + CLOCK_SetDiv(kCLOCK_Sai1PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai1Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai1Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai1); + return true; + #endif + #if defined(SAI2) + case 2: + CLOCK_SetDiv(kCLOCK_Sai2PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai2Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai2Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai2); + return true; + #endif + #if defined(SAI3) + case 3: + CLOCK_SetDiv(kCLOCK_Sai3PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai3Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai3Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai3); + return true; + #endif + #if defined(SAI4) + case 4: + CLOCK_SetDiv(kCLOCK_Sai4PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai4Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai4Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai4); + return true; + #endif + #if defined(SAI5) + case 5: + CLOCK_SetDiv(kCLOCK_Sai5PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai5Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai5Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai5); + return true; + #endif + #if defined(SAI6) + case 6: + CLOCK_SetDiv(kCLOCK_Sai6PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai6Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai6Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai6); + return true; + #endif + #if defined(SAI7) + case 7: + CLOCK_SetDiv(kCLOCK_Sai7PreDiv, SAI_CLOCK_SOURCE_PRE_DIVIDER); + CLOCK_SetDiv(kCLOCK_Sai7Div, SAI_CLOCK_SOURCE_DIVIDER); + CLOCK_SetMux(kCLOCK_Sai7Mux, SAI_CLOCK_SOURCE_SELECT); + CLOCK_EnableClock(kCLOCK_Sai7); + return true; + #endif + } + return false; +} + + +static bool i2s_queue_available(i2s_t *self) { + return !self->handle.saiQueue[self->handle.queueUser].data; +} + +static void i2s_fill_buffer(i2s_t *self) { + if (!self->peripheral) { + return; + } + while (i2s_queue_available(self)) { + uint32_t *buffer = self->buffers[self->buffer_idx]; + uint32_t *ptr = buffer, *end = buffer + AUDIO_BUFFER_FRAME_COUNT; + self->buffer_idx = (self->buffer_idx + 1) % SAI_XFER_QUEUE_SIZE; + + while (self->playing && !self->paused && ptr < end) { + if (self->sample_data == self->sample_end) { + if (self->stopping) { + // non-looping sample, previously returned GET_BUFFER_DONE + self->playing = false; + break; + } + uint32_t sample_buffer_length; + audioio_get_buffer_result_t get_buffer_result = + audiosample_get_buffer(self->sample, false, 0, + &self->sample_data, &sample_buffer_length); + self->sample_end = self->sample_data + sample_buffer_length; + if (get_buffer_result == GET_BUFFER_DONE) { + if (self->loop) { + audiosample_reset_buffer(self->sample, false, 0); + } else { + self->stopping = true; + } + } + if (get_buffer_result == GET_BUFFER_ERROR || sample_buffer_length == 0) { + self->stopping = true; + } + } + size_t input_bytecount = self->sample_end - self->sample_data; + size_t bytes_per_input_frame = self->channel_count * self->bytes_per_sample; + size_t framecount = MIN((size_t)(end - ptr), input_bytecount / bytes_per_input_frame); + +#define SAMPLE_TYPE(is_signed, channel_count, bytes_per_sample) ((is_signed) | ((channel_count) << 1) | ((bytes_per_sample) << 3)) + + switch (SAMPLE_TYPE(self->samples_signed, self->channel_count, self->bytes_per_sample)) { + + case SAMPLE_TYPE(true, 2, 2): + memcpy(ptr, self->sample_data, 4 * framecount); + break; + + case SAMPLE_TYPE(false, 2, 2): + audiosample_convert_u16s_s16s((int16_t *)ptr, (uint16_t *)(void *)self->sample_data, framecount); + break; + + case SAMPLE_TYPE(true, 1, 2): + audiosample_convert_s16m_s16s((int16_t *)ptr, (int16_t *)(void *)self->sample_data, framecount); + break; + + case SAMPLE_TYPE(false, 1, 2): + audiosample_convert_u16m_s16s((int16_t *)ptr, (uint16_t *)(void *)self->sample_data, framecount); + break; + + case SAMPLE_TYPE(true, 2, 1): + audiosample_convert_s8s_s16s((int16_t *)ptr, (int8_t *)(void *)self->sample_data, framecount); + memcpy(ptr, self->sample_data, 4 * framecount); + break; + + case SAMPLE_TYPE(false, 2, 1): + audiosample_convert_u8s_s16s((int16_t *)ptr, (uint8_t *)(void *)self->sample_data, framecount); + break; + + case SAMPLE_TYPE(true, 1, 1): + audiosample_convert_s8m_s16s((int16_t *)ptr, (int8_t *)(void *)self->sample_data, framecount); + break; + + case SAMPLE_TYPE(false, 1, 1): + audiosample_convert_u8m_s16s((int16_t *)ptr, (uint8_t *)(void *)self->sample_data, framecount); + break; + } + self->sample_data += bytes_per_input_frame * framecount; // in bytes + ptr += framecount; // in frames + } + // Fill any remaining portion of the buffer with 'no sound' + memset(ptr, 0, (end - ptr) * sizeof(uint32_t)); + sai_transfer_t xfer = { + .data = (uint8_t *)buffer, + .dataSize = AUDIO_BUFFER_FRAME_COUNT * sizeof(uint32_t), + }; + int r = SAI_TransferSendNonBlocking(self->peripheral, &self->handle, &xfer); + if (r != kStatus_Success) { + mp_printf(&mp_plat_print, "transfer returned %d\n", (int)r); + } + } +} + +static void i2s_callback_fun(void *self_in) { + i2s_t *self = self_in; + i2s_fill_buffer(self); +} + +static void i2s_transfer_callback(I2S_Type *base, sai_handle_t *handle, status_t status, void *self_in) { + i2s_t *self = self_in; + if (status == kStatus_SAI_TxIdle) { + // a block has been finished + background_callback_add(&self->callback, i2s_callback_fun, self_in); + } +} + + +void port_i2s_initialize(i2s_t *self, int instance, sai_transceiver_t *config) { + if (!i2s_in_use) { + // need to set audio pll up! + + /* DeInit Audio PLL. */ + CLOCK_DeinitAudioPll(); + /* Bypass Audio PLL. */ + CLOCK_SetPllBypass(CCM_ANALOG, kCLOCK_PllAudio, 1); + /* Set divider for Audio PLL. */ + CCM_ANALOG->MISC2 &= ~CCM_ANALOG_MISC2_AUDIO_DIV_LSB_MASK; + CCM_ANALOG->MISC2 &= ~CCM_ANALOG_MISC2_AUDIO_DIV_MSB_MASK; + /* Enable Audio PLL output. */ + CCM_ANALOG->PLL_AUDIO |= CCM_ANALOG_PLL_AUDIO_ENABLE_MASK; + + CLOCK_InitAudioPll(&audioPllConfig); + } + + I2S_Type *peripheral = SAI_GetPeripheral(instance); + if (!peripheral) { + mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_I2SOut); + } + if (i2s_in_use & (1 << instance)) { + mp_raise_ValueError_varg(translate("%q in use"), MP_QSTR_I2SOut); + } + if (!i2s_clocking(peripheral)) { + mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_I2SOut); + } + for (size_t i = 0; i < MP_ARRAY_SIZE(self->buffers); i++) { + self->buffers[i] = m_malloc(AUDIO_BUFFER_FRAME_COUNT * sizeof(uint32_t), false); + } + self->peripheral = peripheral; + SAI_Init(self->peripheral); + SAI_TransferTxCreateHandle(peripheral, &self->handle, i2s_transfer_callback, (void *)self); + SAI_TransferTxSetConfig(peripheral, &self->handle, config); + self->sample_rate = 0; + i2s_in_use |= (1 << instance); +} + +bool port_i2s_deinited(i2s_t *self) { + return !self->peripheral; +} + +void port_i2s_deinit(i2s_t *self) { + if (port_i2s_deinited(self)) { + return; + } + SAI_TransferAbortSend(self->peripheral, &self->handle); + i2s_clock_off(self->peripheral); + + uint32_t instance_mask = 1 << SAI_GetInstance(self->peripheral); + i2s_in_use &= ~instance_mask; + i2s_playing &= ~instance_mask; + + if (!i2s_in_use) { + CCM_ANALOG->PLL_AUDIO = CCM_ANALOG_PLL_AUDIO_BYPASS_MASK | CCM_ANALOG_PLL_AUDIO_POWERDOWN_MASK | CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC(kCLOCK_PllClkSrc24M); + } + self->peripheral = NULL; + for (size_t i = 0; i < MP_ARRAY_SIZE(self->buffers); i++) { + self->buffers[i] = NULL; + } +} + +static uint32_t gcd(uint32_t a, uint32_t b) { + while (b) { + uint32_t tmp = a % b; + a = b; + b = tmp; + } + return a; +} + +static void set_sai_clocking_for_sample_rate(uint32_t sample_rate) { + mp_arg_validate_int_range((mp_uint_t)sample_rate, 4000, 192000, MP_QSTR_sample_rate); + + uint32_t target_rate = sample_rate; + // ensure the PWM rate of MQS will be adequately high + while (target_rate < 175000) { + target_rate <<= 1; + } + target_rate *= 4096; // various prescalers divide by this much + uint32_t div = gcd(target_rate % 24000000, 24000000); + clock_audio_pll_config_t config = { + .loopDivider = target_rate / 24000000, + .postDivider = 1, + .numerator = (target_rate % 24000000) / div, + .denominator = 24000000 / div, + }; + CLOCK_InitAudioPll(&config); +} + +void port_i2s_play(i2s_t *self, mp_obj_t sample, bool loop) { + self->sample = sample; + self->loop = loop; + self->bytes_per_sample = audiosample_bits_per_sample(sample) / 8; + self->channel_count = audiosample_channel_count(sample); + int instance = SAI_GetInstance(self->peripheral); + i2s_playing |= (1 << instance); + uint32_t sample_rate = audiosample_sample_rate(sample); + if (sample_rate != self->sample_rate) { + if (__builtin_popcount(i2s_playing) <= 1) { + // as this is the first/only i2s instance playing audio, we can + // safely change the overall clock used by the SAI peripheral, to + // get more accurate frequency reproduction. If another i2s + // instance is playing, then we can't touch the audio PLL and have + // to live with what we can get, which may be inaccurate + set_sai_clocking_for_sample_rate(sample_rate); + } + SAI_TxSetBitClockRate(self->peripheral, SAI_CLOCK_FREQ, sample_rate, 16, 2); + self->sample_rate = sample_rate; + } + bool single_buffer; + bool samples_signed; + uint32_t max_buffer_length; + uint8_t spacing; + audiosample_get_buffer_structure(sample, false, &single_buffer, &samples_signed, + &max_buffer_length, &spacing); + self->samples_signed = samples_signed; + self->playing = true; + self->paused = false; + self->stopping = false; + self->sample_data = self->sample_end = NULL; + + audiosample_reset_buffer(self->sample, false, 0); + +// TODO + #if 0 + uint32_t sample_rate = audiosample_sample_rate(sample); + if (sample_rate != self->i2s_config.sample_rate) { + CHECK_ESP_RESULT(i2s_set_sample_rates(self->instance, audiosample_sample_rate(sample))); + self->i2s_config.sample_rate = sample_rate; + } + #endif + background_callback_add(&self->callback, i2s_callback_fun, self); +} + +bool port_i2s_get_playing(i2s_t *self) { + return self->playing; +} + +bool port_i2s_get_paused(i2s_t *self) { + return self->paused; +} + +void port_i2s_stop(i2s_t *self) { + self->sample = NULL; + self->paused = false; + self->playing = false; + self->stopping = false; +} + +void port_i2s_pause(i2s_t *self) { + self->paused = true; +} + +void port_i2s_resume(i2s_t *self) { + self->paused = false; +} + +void i2s_reset() { +// this port relies on object finalizers for reset +} diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.h b/ports/mimxrt10xx/common-hal/audiobusio/__init__.h new file mode 100644 index 0000000000..f0663e2897 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.h @@ -0,0 +1,59 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "sdk/drivers/sai/fsl_sai.h" +#include "py/obj.h" + +#include "supervisor/background_callback.h" + + +typedef struct { + I2S_Type *peripheral; + sai_handle_t handle; + mp_obj_t sample; + uint32_t *buffers[SAI_XFER_QUEUE_SIZE]; + uint8_t *sample_data, *sample_end; + background_callback_t callback; + bool playing, paused, loop, stopping; + bool samples_signed; + uint8_t channel_count, bytes_per_sample; + uint8_t buffer_idx; + uint32_t sample_rate; +} i2s_t; + + +void i2s_reset(void); +void port_i2s_initialize(i2s_t *self, int instance, sai_transceiver_t *config); +void port_i2s_deinit(i2s_t *self); +bool port_i2s_deinited(i2s_t *self); +void port_i2s_play(i2s_t *self, mp_obj_t sample, bool loop); +void port_i2s_stop(i2s_t *self); +bool port_i2s_get_playing(i2s_t *self); +bool port_i2s_get_paused(i2s_t *self); +void port_i2s_pause(i2s_t *self); +void port_i2s_resume(i2s_t *self); diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c new file mode 100644 index 0000000000..8650522b41 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c @@ -0,0 +1,158 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include + +#include "mpconfigport.h" + +#include "py/gc.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "common-hal/audiobusio/__init__.h" +#include "common-hal/audiopwmio/PWMAudioOut.h" +#include "shared-bindings/audiopwmio/PWMAudioOut.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate/translate.h" +#include "supervisor/shared/tick.h" + +// Where required we use identifier names that are required by NXP's +// API, even though they do not conform to the naming standards that Adafruit +// strives to adhere to. https://www.adafruit.com/blacklivesmatter +#include "sdk/drivers/sai/fsl_sai.h" + +STATIC void config_periph_pin(const mcu_periph_obj_t *periph) { + if (!periph) { + return; + } + if (periph->pin->mux_reg) { + IOMUXC_SetPinMux( + periph->pin->mux_reg, periph->mux_mode, + periph->input_reg, periph->input_idx, + 0, + 1); + } + + IOMUXC_SetPinConfig(0, 0, 0, 0, + periph->pin->cfg_reg, + IOMUXC_SW_PAD_CTL_PAD_HYS(0) + | IOMUXC_SW_PAD_CTL_PAD_PUS(0) + | IOMUXC_SW_PAD_CTL_PAD_PUE(0) + | IOMUXC_SW_PAD_CTL_PAD_PKE(1) + | IOMUXC_SW_PAD_CTL_PAD_ODE(0) + | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) + | IOMUXC_SW_PAD_CTL_PAD_DSE(4) + | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); +} + +static void config_mqs(void) { + CCM->CCGR0 = (CCM->CCGR0 & (~CCM_CCGR0_CG2_MASK)) | CCM_CCGR0_CG2(3); /* Enable MQS hmclk. */ + + IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, true); /* Reset MQS. */ + IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, false); /* Release reset MQS. */ + IOMUXC_MQSEnable(IOMUXC_GPR, true); /* Enable MQS. */ + IOMUXC_MQSConfig(IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate64, 0u); /* 98.304MHz/64/(0+1) = 1.536MHz + Higher frequency PWM involves less low frequen cy harmonic.*/ + +} + +// Caller validates that pins are free. +void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t *self, + const mcu_pin_obj_t *left_channel, const mcu_pin_obj_t *right_channel, uint16_t default_value) { + + int instance = -1; + const mcu_periph_obj_t *left_periph = find_pin_function(mcu_mqs_left_list, left_channel, &instance, MP_QSTR_left_channel); + const mcu_periph_obj_t *right_periph = find_pin_function(mcu_mqs_right_list, right_channel, &instance, MP_QSTR_right_channel); + + sai_transceiver_t config; + SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, 1U << 0u); + config.frameSync.frameSyncEarly = false; + config.frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; + // config.syncMode = kSAI_ModeAsync; + config.fifo.fifoPacking = kSAI_FifoPackingDisabled; + // These identifier names are required by NXP's API, even though they do + // not conform to the naming standards that Adafruit strives to adhere to. + // https://www.adafruit.com/blacklivesmatter + // config.masterSlave = kSAI_Master; + port_i2s_initialize(&self->i2s, instance, &config); + + self->left_channel = left_channel; + self->right_channel = right_channel; + claim_pin(left_channel); + claim_pin(right_channel); + config_periph_pin(left_periph); + config_periph_pin(right_periph); + config_mqs(); +} + +bool common_hal_audiopwmio_pwmaudioout_deinited(audiopwmio_pwmaudioout_obj_t *self) { + return port_i2s_deinited(&self->i2s); +} + +void common_hal_audiopwmio_pwmaudioout_deinit(audiopwmio_pwmaudioout_obj_t *self) { + if (common_hal_audiopwmio_pwmaudioout_deinited(self)) { + return; + } + + port_i2s_deinit(&self->i2s); + + common_hal_reset_pin(self->left_channel); + self->left_channel = NULL; + + common_hal_reset_pin(self->right_channel); + self->right_channel = NULL; + + IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, true); /* Reset MQS. */ + CCM->CCGR0 = CCM->CCGR0 & (~CCM_CCGR0_CG2_MASK); /* Disable MQS hmclk. */ +} + +void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t *self, + mp_obj_t sample, bool loop) { + if (common_hal_audiopwmio_pwmaudioout_get_playing(self)) { + common_hal_audiopwmio_pwmaudioout_stop(self); + } + port_i2s_play(&self->i2s, sample, loop); +} + +void common_hal_audiopwmio_pwmaudioout_pause(audiopwmio_pwmaudioout_obj_t *self) { + port_i2s_pause(&self->i2s); +} + +void common_hal_audiopwmio_pwmaudioout_resume(audiopwmio_pwmaudioout_obj_t *self) { + port_i2s_resume(&self->i2s); +} + +bool common_hal_audiopwmio_pwmaudioout_get_paused(audiopwmio_pwmaudioout_obj_t *self) { + return port_i2s_get_paused(&self->i2s); +} + +void common_hal_audiopwmio_pwmaudioout_stop(audiopwmio_pwmaudioout_obj_t *self) { + port_i2s_stop(&self->i2s); +} + +bool common_hal_audiopwmio_pwmaudioout_get_playing(audiopwmio_pwmaudioout_obj_t *self) { + return port_i2s_get_playing(&self->i2s); +} diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h new file mode 100644 index 0000000000..b9e4279927 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#if CIRCUITPY_AUDIOBUSIO_I2SOUT +#include "supervisor/background_callback.h" +#include "common-hal/microcontroller/Pin.h" + +#include "common-hal/audiobusio/__init__.h" + +typedef struct { + mp_obj_base_t base; + i2s_t i2s; + const mcu_pin_obj_t *left_channel, *right_channel; +} audiopwmio_pwmaudioout_obj_t; + +#endif diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/__init__.c b/ports/mimxrt10xx/common-hal/audiopwmio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/__init__.h b/ports/mimxrt10xx/common-hal/audiopwmio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c index 3445cf42a0..2b4a78948e 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -40,7 +40,7 @@ #define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U -STATIC void pin_config(const mcu_pin_obj_t *pin, bool open_drain, digitalio_pull_t pull) { +void pin_config(const mcu_pin_obj_t *pin, bool open_drain, digitalio_pull_t pull) { IOMUXC_SetPinConfig(0, 0, 0, 0, pin->cfg_reg, IOMUXC_SW_PAD_CTL_PAD_HYS(1) | IOMUXC_SW_PAD_CTL_PAD_PUS((pull == PULL_UP) ? 2 : 0) diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.h b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.h index 4c19de20b6..06adb93cb8 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.h +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.h @@ -40,4 +40,6 @@ typedef struct { digitalio_pull_t pull; } digitalio_digitalinout_obj_t; +void pin_config(const mcu_pin_obj_t *pin, bool open_drain, digitalio_pull_t pull); + #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c index 3c8c7f2b27..9f9e306dd9 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.c @@ -25,8 +25,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "shared-bindings/microcontroller/__init__.h" +#include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" + +#include "py/gc.h" STATIC bool claimed_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; STATIC bool never_reset_pins[IOMUXC_SW_PAD_CTL_PAD_COUNT]; @@ -84,6 +87,7 @@ void common_hal_reset_pin(const mcu_pin_obj_t *pin) { return; } + disable_pin_change_interrupt(pin); never_reset_pins[pin->mux_idx] = false; claimed_pins[pin->mux_idx] = false; *(uint32_t *)pin->mux_reg = pin->mux_reset; @@ -116,3 +120,19 @@ void claim_pin(const mcu_pin_obj_t *pin) { void common_hal_mcu_pin_reset_number(uint8_t pin_no) { common_hal_reset_pin((mcu_pin_obj_t *)(mcu_pin_globals.map.table[pin_no].value)); } + +const mcu_periph_obj_t *find_pin_function_sz(const mcu_periph_obj_t *list, size_t sz, const mcu_pin_obj_t *pin, int *instance, uint16_t name) { + if (!pin) { + return NULL; + } + for (size_t i = 0; i < sz; i++) { + if (*instance != -1 && *instance != list[i].bank_idx) { + continue; + } + if (pin == list[i].pin) { + *instance = list[i].bank_idx; + return &list[i]; + } + } + mp_raise_ValueError_varg(translate("Invalid %q pin"), name); +} diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h index 1bfbe41a18..4c66dd4ea5 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Pin.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Pin.h @@ -25,11 +25,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H -#define MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H - -#include +#pragma once +#include "periph.h" #include "pins.h" void reset_all_pins(void); @@ -45,4 +43,8 @@ extern const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[]; // the port-default reset behavior. extern bool mimxrt10xx_board_reset_pin_number(const mcu_pin_obj_t *pin); -#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PIN_H +// Find the entry in the peripheral list for this pin. If instance is (-1), any instance (bank_idx) may be used. Otherwise, the bank_idx must match the instance. +// If instance was -1, and the function succeeds, then instance is updated with the new bank_idx. +// If the pin is NULL then NULL is always returned. But if it was not NULL, and no match was found, then a ValueError is raised. +const mcu_periph_obj_t *find_pin_function_sz(const mcu_periph_obj_t *list, size_t sz, const mcu_pin_obj_t *pin, int *instance, uint16_t name); +#define find_pin_function(list, pin, instance, name) (find_pin_function_sz((list), MP_ARRAY_SIZE((list)), (pin), (instance), (name))) diff --git a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c index 933d8aa444..a26c34ce32 100644 --- a/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c +++ b/ports/mimxrt10xx/common-hal/neopixel_write/__init__.c @@ -64,7 +64,7 @@ void PLACE_IN_ITCM(common_hal_neopixel_write)(const digitalio_digitalinout_obj_t const uint32_t pin = digitalinout->pin->number; __disable_irq(); - // Use DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL + // Use DWT in debug core. Usable when interrupts disabled, as opposed to Systick->VAL DWT->CYCCNT = 0; for (;;) { diff --git a/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c b/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c new file mode 100644 index 0000000000..043b791b4d --- /dev/null +++ b/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.c @@ -0,0 +1,87 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Nick Moore for Adafruit Industries + * Copyright (c) 2023 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "common-hal/digitalio/DigitalInOut.h" +#include "common-hal/rotaryio/IncrementalEncoder.h" +#include "shared-module/rotaryio/IncrementalEncoder.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/rotaryio/IncrementalEncoder.h" + +#include "py/runtime.h" + +#include "sdk/drivers/igpio/fsl_gpio.h" +static void encoder_change(void *self_in) { + rotaryio_incrementalencoder_obj_t *self = self_in; + + bool value_a = GPIO_PinRead(self->pin_a->gpio, self->pin_a->number); + bool value_b = GPIO_PinRead(self->pin_b->gpio, self->pin_b->number); + uint8_t new_state = (value_a << 1) | value_b; + shared_module_softencoder_state_update(self, new_state); +} + +void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencoder_obj_t *self, + const mcu_pin_obj_t *pin_a, const mcu_pin_obj_t *pin_b) { + + self->pin_a = pin_a; + self->pin_b = pin_b; + + // GPIO is always IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 until proven otherwise +#define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U + IOMUXC_SetPinMux(pin_a->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0); + IOMUXC_SetPinMux(pin_b->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0); + + const gpio_pin_config_t config = { kGPIO_DigitalInput, 0, kGPIO_IntRisingOrFallingEdge }; + GPIO_PinInit(pin_a->gpio, pin_a->number, &config); + GPIO_PinInit(pin_b->gpio, pin_b->number, &config); + + enable_pin_change_interrupt(pin_a, encoder_change, self); + enable_pin_change_interrupt(pin_b, encoder_change, self); + + pin_config(pin_a, false, PULL_UP); + pin_config(pin_b, false, PULL_UP); + + claim_pin(pin_a); + claim_pin(pin_b); +} + +bool common_hal_rotaryio_incrementalencoder_deinited(rotaryio_incrementalencoder_obj_t *self) { + return !self->pin_a; +} + +void common_hal_rotaryio_incrementalencoder_deinit(rotaryio_incrementalencoder_obj_t *self) { + if (common_hal_rotaryio_incrementalencoder_deinited(self)) { + return; + } + disable_pin_change_interrupt(self->pin_a); + disable_pin_change_interrupt(self->pin_b); + + common_hal_reset_pin(self->pin_a); + common_hal_reset_pin(self->pin_b); + + self->pin_a = NULL; + self->pin_b = NULL; +} diff --git a/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.h b/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.h new file mode 100644 index 0000000000..920b32cba9 --- /dev/null +++ b/ports/mimxrt10xx/common-hal/rotaryio/IncrementalEncoder.h @@ -0,0 +1,44 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2023 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#include "common-hal/microcontroller/Pin.h" + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t *pin_a, *pin_b; + uint8_t state; // + int8_t sub_count; // count intermediate transitions between detents + int8_t divisor; // Number of quadrature edges required per count + mp_int_t position; +} rotaryio_incrementalencoder_obj_t; + + +void incrementalencoder_interrupt_handler(uint8_t channel); diff --git a/ports/mimxrt10xx/common-hal/rotaryio/__init__.c b/ports/mimxrt10xx/common-hal/rotaryio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/common-hal/rotaryio/__init__.h b/ports/mimxrt10xx/common-hal/rotaryio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index 236d5b9966..b03535b6b2 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -11,8 +11,13 @@ CIRCUITPY_TUSB_MEM_ALIGN = 32 INTERNAL_FLASH_FILESYSTEM = 1 +CIRCUITPY_AUDIOBUSIO = 1 +CIRCUITPY_AUDIOBUSIO_PDMIN = 0 +CIRCUITPY_AUDIOCORE = 1 CIRCUITPY_AUDIOIO = 0 -CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOMIXER = 1 +CIRCUITPY_AUDIOMP3 = 1 +CIRCUITPY_AUDIOPWMIO = 1 CIRCUITPY_BUSDEVICE = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 @@ -20,7 +25,8 @@ CIRCUITPY_I2CTARGET = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_PULSEIO = 0 -CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_ROTARYIO = 1 +CIRCUITPY_ROTARYIO_SOFTENCODER = 1 CIRCUITPY_USB_MIDI = 1 LONGINT_IMPL = MPZ diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c index bdf3299217..b67f7b1179 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c @@ -29,7 +29,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[2] = { LPI2C1, LPI2C2 }; +LPI2C_Type *const mcu_i2c_banks[2] = { LPI2C1, LPI2C2 }; const mcu_periph_obj_t mcu_i2c_sda_list[8] = { PERIPH_PIN(1, 0, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_AD_13), @@ -55,7 +55,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[8] = { PERIPH_PIN(2, 3, kIOMUXC_LPI2C2_SCL_SELECT_INPUT, 3, &pin_GPIO_10), }; -LPSPI_Type *mcu_spi_banks[2] = { LPSPI1, LPSPI2 }; +LPSPI_Type *const mcu_spi_banks[2] = { LPSPI1, LPSPI2 }; const mcu_periph_obj_t mcu_spi_sck_list[4] = { PERIPH_PIN(1, 0, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_AD_06), @@ -81,7 +81,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[4] = { PERIPH_PIN(2, 1, kIOMUXC_LPSPI2_SDI_SELECT_INPUT, 1, &pin_GPIO_SD_09), }; -LPUART_Type *mcu_uart_banks[4] = { LPUART1, LPUART2, LPUART3, LPUART4 }; +LPUART_Type *const mcu_uart_banks[4] = { LPUART1, LPUART2, LPUART3, LPUART4 }; const mcu_periph_obj_t mcu_uart_rx_list[9] = { PERIPH_PIN(1, 2, kIOMUXC_LPUART1_RXD_SELECT_INPUT, 0, &pin_GPIO_SD_11), @@ -166,3 +166,34 @@ const mcu_pwm_obj_t mcu_pwm_list[20] = { PWM_PIN(PWM1, kPWM_Module_3, kPWM_PwmX, IOMUXC_GPIO_AD_09_FLEXPWM1_PWM3_X, &pin_GPIO_AD_09), }; + +const mcu_periph_obj_t mcu_sai_rx_bclk_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_08), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_00), +}; +const mcu_periph_obj_t mcu_sai_rx_data0_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_03), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_03), +}; +const mcu_periph_obj_t mcu_sai_rx_sync_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_02), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_04), +}; +const mcu_periph_obj_t mcu_sai_tx_bclk_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_06), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_01), +}; +const mcu_periph_obj_t mcu_sai_tx_data0_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_04), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_02), +}; +const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { + PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_07), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_00), +}; +const mcu_periph_obj_t mcu_mqs_left_list[] = { + PERIPH_PIN(3, 4, 0, 0, &pin_GPIO_AD_01), +}; +const mcu_periph_obj_t mcu_mqs_right_list[] = { + PERIPH_PIN(3, 4, 0, 0, &pin_GPIO_AD_02), +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h index c50d73294b..045e33ca0e 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h @@ -27,18 +27,18 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H -extern LPI2C_Type *mcu_i2c_banks[2]; +extern LPI2C_Type *const mcu_i2c_banks[2]; extern const mcu_periph_obj_t mcu_i2c_sda_list[8]; extern const mcu_periph_obj_t mcu_i2c_scl_list[8]; -extern LPSPI_Type *mcu_spi_banks[2]; +extern LPSPI_Type *const mcu_spi_banks[2]; extern const mcu_periph_obj_t mcu_spi_sck_list[4]; extern const mcu_periph_obj_t mcu_spi_mosi_list[4]; extern const mcu_periph_obj_t mcu_spi_miso_list[4]; -extern LPUART_Type *mcu_uart_banks[4]; +extern LPUART_Type *const mcu_uart_banks[4]; extern const mcu_periph_obj_t mcu_uart_rx_list[9]; extern const mcu_periph_obj_t mcu_uart_tx_list[9]; @@ -47,4 +47,14 @@ extern const mcu_periph_obj_t mcu_uart_cts_list[4]; extern const mcu_pwm_obj_t mcu_pwm_list[20]; +extern const mcu_periph_obj_t mcu_sai_rx_bclk_list[2]; +extern const mcu_periph_obj_t mcu_sai_rx_data0_list[2]; +extern const mcu_periph_obj_t mcu_sai_rx_sync_list[2]; +extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[2]; +extern const mcu_periph_obj_t mcu_sai_tx_data0_list[2]; +extern const mcu_periph_obj_t mcu_sai_tx_sync_list[2]; + +extern const mcu_periph_obj_t mcu_mqs_left_list[1]; +extern const mcu_periph_obj_t mcu_mqs_right_list[1]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c index 5b21c12c2a..59bd3cc105 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c @@ -30,7 +30,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; +LPI2C_Type *const mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; const mcu_periph_obj_t mcu_i2c_sda_list[8] = { PERIPH_PIN(1, 6, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_EMC_03), @@ -60,7 +60,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[8] = { PERIPH_PIN(4, 3, kIOMUXC_LPI2C4_SCL_SELECT_INPUT, 1, &pin_GPIO_SD_B1_02), }; -LPSPI_Type *mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; +LPSPI_Type *const mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; const mcu_periph_obj_t mcu_spi_sck_list[8] = { PERIPH_PIN(1, 4, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_SD_B0_02), @@ -104,7 +104,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[8] = { PERIPH_PIN(4, 4, kIOMUXC_LPSPI2_SDI_SELECT_INPUT, 1, &pin_GPIO_EMC_35), }; -LPUART_Type *mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; +LPUART_Type *const mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; const mcu_periph_obj_t mcu_uart_rx_list[16] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_07), @@ -256,3 +256,68 @@ const mcu_pwm_obj_t mcu_pwm_list[39] = { PWM_PIN(PWM2, kPWM_Module_2, kPWM_PwmX, IOMUXC_GPIO_EMC_12_FLEXPWM2_PWMX02, &pin_GPIO_EMC_12), PWM_PIN(PWM2, kPWM_Module_3, kPWM_PwmX, IOMUXC_GPIO_EMC_13_FLEXPWM2_PWMX03, &pin_GPIO_EMC_13), }; + +const mcu_periph_obj_t mcu_sai_rx_bclk_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_14), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_19), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_06), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_09), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_02), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_29), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_09), +}; +const mcu_periph_obj_t mcu_sai_rx_data0_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_13), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_21), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_05), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_08), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_03), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_30), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_11), +}; +const mcu_periph_obj_t mcu_sai_rx_sync_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_15), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_28), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_04), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_07), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_01), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_30), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_10), +}; +const mcu_periph_obj_t mcu_sai_tx_bclk_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_11), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_26), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_01), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_04), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_04), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_33), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B0_06), +}; +const mcu_periph_obj_t mcu_sai_tx_data0_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_12), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_25), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_03), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_06), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_04), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_32), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_08), +}; +const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_10), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_EMC_27), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_02), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_05), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_SD_B0_06), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_34), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_07), +}; +const mcu_periph_obj_t mcu_mqs_left_list[] = { + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_07), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_EMC_17), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_38), +}; +const mcu_periph_obj_t mcu_mqs_right_list[] = { + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_06), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_EMC_16), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_37), +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h index 6c778ad525..51c97b3eef 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h @@ -25,21 +25,20 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H -#define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H +#pragma once -extern LPI2C_Type *mcu_i2c_banks[4]; +extern LPI2C_Type *const mcu_i2c_banks[4]; extern const mcu_periph_obj_t mcu_i2c_sda_list[8]; extern const mcu_periph_obj_t mcu_i2c_scl_list[8]; -extern LPSPI_Type *mcu_spi_banks[4]; +extern LPSPI_Type *const mcu_spi_banks[4]; extern const mcu_periph_obj_t mcu_spi_sck_list[8]; extern const mcu_periph_obj_t mcu_spi_mosi_list[8]; extern const mcu_periph_obj_t mcu_spi_miso_list[8]; -extern LPUART_Type *mcu_uart_banks[8]; +extern LPUART_Type *const mcu_uart_banks[8]; extern const mcu_periph_obj_t mcu_uart_rx_list[16]; extern const mcu_periph_obj_t mcu_uart_tx_list[16]; @@ -48,4 +47,12 @@ extern const mcu_periph_obj_t mcu_uart_cts_list[10]; extern const mcu_pwm_obj_t mcu_pwm_list[39]; -#endif // MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIP_H +extern const mcu_periph_obj_t mcu_sai_rx_bclk_list[7]; +extern const mcu_periph_obj_t mcu_sai_rx_data0_list[7]; +extern const mcu_periph_obj_t mcu_sai_rx_sync_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_data0_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_sync_list[7]; + +extern const mcu_periph_obj_t mcu_mqs_left_list[3]; +extern const mcu_periph_obj_t mcu_mqs_right_list[3]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c index 19ce48f288..c43f4eb96b 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c @@ -29,7 +29,7 @@ #include "py/mphal.h" #include "mimxrt10xx/periph.h" -LPI2C_Type *mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; +LPI2C_Type *const mcu_i2c_banks[4] = { LPI2C1, LPI2C2, LPI2C3, LPI2C4 }; const mcu_periph_obj_t mcu_i2c_sda_list[9] = { PERIPH_PIN(1, 2, kIOMUXC_LPI2C1_SDA_SELECT_INPUT, 0, &pin_GPIO_SD_B1_05), @@ -61,7 +61,7 @@ const mcu_periph_obj_t mcu_i2c_scl_list[9] = { PERIPH_PIN(4, 0, kIOMUXC_LPI2C4_SCL_SELECT_INPUT, 1, &pin_GPIO_AD_B0_12), }; -LPSPI_Type *mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; +LPSPI_Type *const mcu_spi_banks[4] = { LPSPI1, LPSPI2, LPSPI3, LPSPI4 }; const mcu_periph_obj_t mcu_spi_sck_list[8] = { PERIPH_PIN(1, 3, kIOMUXC_LPSPI1_SCK_SELECT_INPUT, 0, &pin_GPIO_EMC_27), @@ -105,7 +105,7 @@ const mcu_periph_obj_t mcu_spi_miso_list[8] = { PERIPH_PIN(4, 1, kIOMUXC_LPSPI4_SDI_SELECT_INPUT, 1, &pin_GPIO_B1_05), }; -LPUART_Type *mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; +LPUART_Type *const mcu_uart_banks[8] = { LPUART1, LPUART2, LPUART3, LPUART4, LPUART5, LPUART6, LPUART7, LPUART8 }; const mcu_periph_obj_t mcu_uart_rx_list[18] = { PERIPH_PIN(1, 2, 0, 0, &pin_GPIO_AD_B0_13), @@ -306,3 +306,69 @@ const mcu_pwm_obj_t mcu_pwm_list[67] = { PWM_PIN(PWM4, kPWM_Module_3, kPWM_PwmB, IOMUXC_GPIO_EMC_18_FLEXPWM4_PWMB03, &pin_GPIO_EMC_18), }; + +const mcu_periph_obj_t mcu_sai_rx_bclk_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_11), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B0_15), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_SD_B1_05), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_EMC_10), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_AD_B0_06), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_35), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_00), +}; + +const mcu_periph_obj_t mcu_sai_rx_data0_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B1_00), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_12), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_06), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_AD_B0_08), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_EMC_08), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_33), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_00), +}; +const mcu_periph_obj_t mcu_sai_rx_sync_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_11), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B0_15), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_SD_B1_05), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_EMC_09), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_AD_B0_06), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_34), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_05), +}; +const mcu_periph_obj_t mcu_sai_tx_bclk_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_SD_B1_08), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B1_02), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_14), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_AD_B0_05), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_06), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_38), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_03), +}; +const mcu_periph_obj_t mcu_sai_tx_data0_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_13), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B1_01), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_SD_B1_07), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_EMC_04), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_AD_B0_09), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_36), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_01), +}; +const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_AD_B1_15), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_B1_03), + PERIPH_PIN(1, 3, 0, 0, &pin_GPIO_SD_B1_09), + PERIPH_PIN(2, 2, 0, 0, &pin_GPIO_AD_B0_04), + PERIPH_PIN(2, 3, 0, 0, &pin_GPIO_EMC_05), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_39), + PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_02), +}; +const mcu_periph_obj_t mcu_mqs_left_list[] = { + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_14), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_B0_01), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_05), +}; +const mcu_periph_obj_t mcu_mqs_right_list[] = { + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_13), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_B0_00), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_04), +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h index 067c05d0d0..28ea8e3742 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h @@ -27,18 +27,18 @@ #ifndef MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H #define MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H -extern LPI2C_Type *mcu_i2c_banks[4]; +extern LPI2C_Type *const mcu_i2c_banks[4]; extern const mcu_periph_obj_t mcu_i2c_sda_list[9]; extern const mcu_periph_obj_t mcu_i2c_scl_list[9]; -extern LPSPI_Type *mcu_spi_banks[4]; +extern LPSPI_Type *const mcu_spi_banks[4]; extern const mcu_periph_obj_t mcu_spi_sck_list[8]; extern const mcu_periph_obj_t mcu_spi_mosi_list[8]; extern const mcu_periph_obj_t mcu_spi_miso_list[8]; -extern LPUART_Type *mcu_uart_banks[8]; +extern LPUART_Type *const mcu_uart_banks[8]; extern const mcu_periph_obj_t mcu_uart_rx_list[18]; extern const mcu_periph_obj_t mcu_uart_tx_list[18]; @@ -47,4 +47,14 @@ extern const mcu_periph_obj_t mcu_uart_cts_list[9]; extern const mcu_pwm_obj_t mcu_pwm_list[67]; +extern const mcu_periph_obj_t mcu_sai_rx_bclk_list[7]; +extern const mcu_periph_obj_t mcu_sai_rx_data0_list[7]; +extern const mcu_periph_obj_t mcu_sai_rx_sync_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_data0_list[7]; +extern const mcu_periph_obj_t mcu_sai_tx_sync_list[7]; + +extern const mcu_periph_obj_t mcu_mqs_left_list[3]; +extern const mcu_periph_obj_t mcu_mqs_right_list[3]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h index c77497a775..8184d5b135 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/periph.h @@ -31,7 +31,7 @@ #include "pins.h" typedef struct { - uint8_t bank_idx : 4; + uint8_t bank_idx : 4; // e.g. the peripheral number uint8_t mux_mode : 4; uint32_t input_reg; uint8_t input_idx; @@ -72,9 +72,9 @@ typedef struct { .pin = p_pin, \ } -extern LPI2C_Type *mcu_i2c_banks[]; -extern LPSPI_Type *mcu_spi_banks[]; -extern LPUART_Type *mcu_uart_banks[]; +extern LPI2C_Type *const mcu_i2c_banks[]; +extern LPSPI_Type *const mcu_spi_banks[]; +extern LPUART_Type *const mcu_uart_banks[]; #ifdef MIMXRT1011_SERIES #include "MIMXRT1011/periph.h" diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c new file mode 100644 index 0000000000..d052711033 --- /dev/null +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.c @@ -0,0 +1,99 @@ +#include "peripherals/mimxrt10xx/pins.h" + +typedef struct { + gpio_change_interrupt_t *func; + void *data; +} pin_change_interrupt_data; + +/* Array of GPIO peripheral base address. */ +static GPIO_Type *const s_gpioBases[] = GPIO_BASE_PTRS; +static uint32_t GPIO_GetInstance(GPIO_Type *base) { + uint32_t instance; + + /* Find the instance index from base address mappings. */ + for (instance = 0U; instance < ARRAY_SIZE(s_gpioBases); instance++) + { + if (s_gpioBases[instance] == base) { + break; + } + } + + assert(instance < ARRAY_SIZE(s_gpioBases)); + + return instance; +} + + +/* to find IRQ based on GPIO */ +static const IRQn_Type low_irqs[] = GPIO_COMBINED_LOW_IRQS; +static const IRQn_Type high_irqs[] = GPIO_COMBINED_HIGH_IRQS; + +static volatile pin_change_interrupt_data pcid[MP_ARRAY_SIZE(s_gpioBases)][32]; + +void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data) { + int instance = GPIO_GetInstance(pin->gpio); + volatile pin_change_interrupt_data *pci = &pcid[instance][pin->number]; + common_hal_mcu_disable_interrupts(); + pci->data = data; + pci->func = func; + IRQn_Type irq = pin->number < 16 ? low_irqs[instance] : high_irqs[instance]; + if (irq != NotAvail_IRQn) { + EnableIRQ(irq); + } + pin->gpio->IMR |= (1 << pin->number); + common_hal_mcu_enable_interrupts(); +} + +void disable_pin_change_interrupt(const mcu_pin_obj_t *pin) { + volatile pin_change_interrupt_data *pci = &pcid[GPIO_GetInstance(pin->gpio)][pin->number]; + common_hal_mcu_disable_interrupts(); + pin->gpio->IMR &= ~(1 << pin->number); + pci->data = NULL; + pci->func = NULL; + pin->gpio->ISR = (1 << pin->number); // acknowledge any pending interrupt + common_hal_mcu_enable_interrupts(); +} + +static void pin_change_interrupt_common(uint32_t isr, volatile pin_change_interrupt_data *pcr) { + for (uint32_t i = 0; i < 32; i++) { + if (isr & (1 << i)) { + pin_change_interrupt_data cb = pcr[i]; + if (cb.func) { + cb.func(cb.data); + } + } + } +} + +#define GPIO_INTERRUPT_HANDLER(name, ptr, instance, offset) \ + void name(void); \ + __attribute__((used)) void name(void) { \ + uint32_t isr = ptr->ISR; \ + ptr->ISR = isr; \ + pin_change_interrupt_common(isr, pcid[instance]); \ + } + +#if defined(GPIO1) +GPIO_INTERRUPT_HANDLER(GPIO1_Combined_0_15_IRQHandler, GPIO1, 1, 0); +GPIO_INTERRUPT_HANDLER(GPIO1_Combined_16_31_IRQHandler, GPIO1, 1, 16); +#endif +#if defined(GPIO2) +GPIO_INTERRUPT_HANDLER(GPIO2_Combined_0_15_IRQHandler, GPIO2, 2, 0); +GPIO_INTERRUPT_HANDLER(GPIO2_Combined_16_31_IRQHandler, GPIO2, 2, 16); +#endif +#if defined(GPIO3) +GPIO_INTERRUPT_HANDLER(GPIO3_Combined_0_15_IRQHandler, GPIO3, 3, 0); +GPIO_INTERRUPT_HANDLER(GPIO3_Combined_16_31_IRQHandler, GPIO3, 3, 16); +#endif +#if defined(GPIO4) +GPIO_INTERRUPT_HANDLER(GPIO4_Combined_0_15_IRQHandler, GPIO4, 4, 0); +GPIO_INTERRUPT_HANDLER(GPIO4_Combined_16_31_IRQHandler, GPIO4, 4, 16); +#endif +#if defined(GPIO5) +GPIO_INTERRUPT_HANDLER(GPIO5_Combined_0_15_IRQHandler, GPIO5, 5, 0); +GPIO_INTERRUPT_HANDLER(GPIO5_Combined_16_31_IRQHandler, GPIO5, 5, 16); +#endif +#if defined(GPIO6) +GPIO_INTERRUPT_HANDLER(GPIO6_Combined_0_15_IRQHandler, GPIO6, 6, 0); +GPIO_INTERRUPT_HANDLER(GPIO6_Combined_16_31_IRQHandler, GPIO6, 6, 16); +#endif diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h index 82cb0dc69e..0457a09a1a 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/pins.h @@ -72,6 +72,10 @@ typedef struct { .pad_reset = p_pad_reset, \ } +typedef void (gpio_change_interrupt_t)(void *data); +void disable_pin_change_interrupt(const mcu_pin_obj_t *pin); +void enable_pin_change_interrupt(const mcu_pin_obj_t *pin, gpio_change_interrupt_t func, void *data); + #ifdef MIMXRT1011_SERIES #include "MIMXRT1011/pins.h" #elif defined(MIMXRT1021_SERIES) diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 55bf72352d..feb8566aad 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -36,6 +36,10 @@ #include "fsl_device_registers.h" +#if CIRCUITPY_AUDIOBUSIO +#include "common-hal/audiobusio/__init__.h" +#endif + #include "common-hal/microcontroller/Pin.h" #include "common-hal/pwmio/PWMOut.h" #include "common-hal/rtc/RTC.h" @@ -414,8 +418,7 @@ void reset_port(void) { audioout_reset(); #endif #if CIRCUITPY_AUDIOBUSIO - i2sout_reset(); - // pdmin_reset(); + i2s_reset(); #endif #if CIRCUITPY_TOUCHIO && CIRCUITPY_TOUCHIO_USE_NATIVE diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 2267a582a4..412ff86cde 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -241,7 +241,7 @@ FLASHER ?= ifeq ($(FLASHER),) -# Also update to bootloader settting to validate application and skip checksum ( app valid = 0x0001, crc = 0x0000 ) +# Also update to bootloader setting to validate application and skip checksum ( app valid = 0x0001, crc = 0x0000 ) flash: $(BUILD)/firmware.hex nrfjprog --program $< --sectorerase -f $(MCU_VARIANT) nrfjprog --erasepage $(BOOT_SETTING_ADDR) -f $(MCU_VARIANT) diff --git a/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/include/ble_l2cap.h b/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/include/ble_l2cap.h index d04bec3fbf..e0f005d9b0 100644 --- a/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/include/ble_l2cap.h +++ b/ports/nrf/bluetooth/s140_nrf52_6.1.0/s140_nrf52_6.1.0_API/include/ble_l2cap.h @@ -286,7 +286,7 @@ typedef struct /**@brief L2CAP event structure. */ typedef struct { - uint16_t conn_handle; /**< Connection Handle on which the event occured. */ + uint16_t conn_handle; /**< Connection Handle on which the event occurred. */ uint16_t local_cid; /**< Local Channel ID of the L2CAP channel, or @ref BLE_L2CAP_CID_INVALID if not present. */ union diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h index 933f398b57..a624338ceb 100644 --- a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/ble_l2cap.h @@ -287,7 +287,7 @@ typedef struct /**@brief L2CAP event structure. */ typedef struct { - uint16_t conn_handle; /**< Connection Handle on which the event occured. */ + uint16_t conn_handle; /**< Connection Handle on which the event occurred. */ uint16_t local_cid; /**< Local Channel ID of the L2CAP channel, or @ref BLE_L2CAP_CID_INVALID if not present. */ union diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h index 24001fb12a..3def7d6783 100644 --- a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_sdm.h @@ -275,8 +275,8 @@ typedef struct * If the application returns from the fault handler the SoftDevice will call NVIC_SystemReset(). * * @note It is recommended to either perform a reset in the fault handler or to let the SoftDevice reset the device. - * Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripherial may - * continously transmit packets. + * Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripheral may + * continuously transmit packets. * * @note This callback is executed in HardFault context, thus SVC functions cannot be called from the fault callback. * diff --git a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h index 293001eccf..629739ed75 100644 --- a/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h +++ b/ports/nrf/bluetooth/s140_nrf52_7.0.1/s140_nrf52_7.0.1_API/include/nrf_svc.h @@ -48,7 +48,7 @@ extern "C" { /** @brief Supervisor call declaration. * * A call to a function marked with @ref SVCALL, will trigger a Supervisor Call (SVC) Exception. - * The SVCs with SVC numbers 0x00-0x0F are forwared to the application. All other SVCs are handled by the SoftDevice. + * The SVCs with SVC numbers 0x00-0x0F are forwarded to the application. All other SVCs are handled by the SoftDevice. * * @param[in] number The SVC number to be used. * @param[in] return_type The return type of the SVC function. diff --git a/ports/nrf/boards/feather_nrf52840_express/README.md b/ports/nrf/boards/feather_nrf52840_express/README.md index 8d515010f9..88a78a20fd 100644 --- a/ports/nrf/boards/feather_nrf52840_express/README.md +++ b/ports/nrf/boards/feather_nrf52840_express/README.md @@ -104,7 +104,7 @@ Parsing hex file. Erasing user available code and UICR flash areas. Applying system reset. Checking that the area to write is not protected. -Programing device. +Programming device. Applying system reset. Run. ``` diff --git a/ports/nrf/boards/hiibot_bluefi/pins.c b/ports/nrf/boards/hiibot_bluefi/pins.c index ba1910dc9d..7e0e0a94f4 100644 --- a/ports/nrf/boards/hiibot_bluefi/pins.c +++ b/ports/nrf/boards/hiibot_bluefi/pins.c @@ -117,7 +117,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { // { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_P1_13) }, { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_P1_13) }, - // P28~P33/D28~D33 connecte into QSPI FlashROM (W25Q16JV_IQ) + // P28~P33/D28~D33 connected into QSPI FlashROM (W25Q16JV_IQ) { MP_ROM_QSTR(MP_QSTR_P34), MP_ROM_PTR(&pin_P0_22) }, { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_P0_22) }, diff --git a/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md b/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md index 5c41fdb7cf..7040507ba6 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md +++ b/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md @@ -8,11 +8,11 @@ We've also routed two I2C buses, 2 SPI buses, eleven GPIO, dedicated ## CircuitPython Pin Defs -CircuitPython pin definitions, while simialr to other boards represent a slight departure from just the typical `A` and `D` pin definitions. The majority of general pins are labled as `G` (or alternatively, `BUS`,) as the MicroMod system they build on uses those names to specify pins that may not be specficially analog or digital. +CircuitPython pin definitions, while similar to other boards represent a slight departure from just the typical `A` and `D` pin definitions. The majority of general pins are labeled as `G` (or alternatively, `BUS`,) as the MicroMod system they build on uses those names to specify pins that may not be specficially analog or digital. This can be somewhat confusing, especially around the analog pins. Here's a quick pin-map: -MicroMod Pin # | ATP Pin Label | Pin Definition | Additional Definitons | Pin/Port Reference | Notes +MicroMod Pin # | ATP Pin Label | Pin Definition | Additional Definitions | Pin/Port Reference | Notes :--------------|:--------------|:--------------|:-----------------------|:-------------------|:------ 8 | G11 | | | (Not Connected) | 10 | D0 | D0 | | P0_27 | diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 1c3c829c5b..828ff8806d 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -190,7 +190,7 @@ STATIC uint32_t ble_stack_enable(void) { return err_code; } - // Increase the GATT Server attribute size to accomodate both the CircuitPython built-in service + // Increase the GATT Server attribute size to accommodate both the CircuitPython built-in service // and anything the user does. memset(&ble_conf, 0, sizeof(ble_conf)); // Each increment to the BLE_GATTS_ATTR_TAB_SIZE_DEFAULT multiplier costs 1408 bytes. @@ -529,7 +529,7 @@ STATIC bool scan_on_ble_evt(ble_evt_t *ble_evt, void *scan_results_in) { mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t *prefixes, size_t prefix_length, bool extended, mp_int_t buffer_size, mp_float_t timeout, mp_float_t interval, mp_float_t window, mp_int_t minimum_rssi, bool active) { if (self->scan_results != NULL) { if (!shared_module_bleio_scanresults_get_done(self->scan_results)) { - mp_raise_bleio_BluetoothError(translate("Scan already in progess. Stop with stop_scan.")); + mp_raise_bleio_BluetoothError(translate("Scan already in progress. Stop with stop_scan.")); } self->scan_results = NULL; } diff --git a/ports/nrf/common-hal/_bleio/Characteristic.c b/ports/nrf/common-hal/_bleio/Characteristic.c index df86654c70..e911e5a1e3 100644 --- a/ports/nrf/common-hal/_bleio/Characteristic.c +++ b/ports/nrf/common-hal/_bleio/Characteristic.c @@ -283,7 +283,7 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, } // Write with response will return NRF_ERROR_BUSY if the response has not been received. - // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. + // Write without response will return NRF_ERROR_RESOURCES if too many writes are pending. if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { // We could wait for an event indicating the write is complete, but just retrying is easier. RUN_BACKGROUND_TASKS; diff --git a/ports/nrf/common-hal/_bleio/Connection.c b/ports/nrf/common-hal/_bleio/Connection.c index 0d8d8c32f0..69e6945d21 100644 --- a/ports/nrf/common-hal/_bleio/Connection.c +++ b/ports/nrf/common-hal/_bleio/Connection.c @@ -528,7 +528,7 @@ STATIC void on_char_discovery_rsp(ble_gattc_evt_char_disc_rsp_t *response, bleio (gattc_char->char_props.write ? CHAR_PROP_WRITE : 0) | (gattc_char->char_props.write_wo_resp ? CHAR_PROP_WRITE_NO_RESPONSE : 0); - // Call common_hal_bleio_characteristic_construct() to initalize some fields and set up evt handler. + // Call common_hal_bleio_characteristic_construct() to initialize some fields and set up evt handler. common_hal_bleio_characteristic_construct( characteristic, m_char_discovery_service, gattc_char->handle_value, uuid, props, SECURITY_MODE_OPEN, SECURITY_MODE_OPEN, diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index 718b28c7fe..75bfb60342 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -249,7 +249,7 @@ void common_hal_bleio_gattc_write(uint16_t handle, uint16_t conn_handle, mp_buff } // Write with response will return NRF_ERROR_BUSY if the response has not been received. - // Write without reponse will return NRF_ERROR_RESOURCES if too many writes are pending. + // Write without response will return NRF_ERROR_RESOURCES if too many writes are pending. if (err_code == NRF_ERROR_BUSY || err_code == NRF_ERROR_RESOURCES) { // We could wait for an event indicating the write is complete, but just retrying is easier. MICROPY_VM_HOOK_LOOP; diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index cd4114dcfb..7824175605 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -55,7 +55,7 @@ void common_hal_mcu_disable_interrupts() { // Unlike __disable_irq(), this should only be called the first time // "is_nested_critical_region" is sd's equivalent of our nesting count // so a nested call would store 0 in the global and make the later - // exit call not actually reenable interrupts + // exit call not actually re-enable interrupts // // This only disables interrupts of priority 2 through 7; levels 0, 1, // and 4, are exclusive to softdevice and should never be used, so diff --git a/ports/nrf/common-hal/pwmio/PWMOut.c b/ports/nrf/common-hal/pwmio/PWMOut.c index f73e3d3952..6171f5eb76 100644 --- a/ports/nrf/common-hal/pwmio/PWMOut.c +++ b/ports/nrf/common-hal/pwmio/PWMOut.c @@ -94,7 +94,7 @@ STATIC void reset_single_pwmout(uint8_t i) { for (int ch = 0; ch < CHANNELS_PER_PWM; ch++) { pwm_seq[i][ch] = (1 << 15); // polarity = 0 - pwm->PSEL.OUT[ch] = 0xFFFFFFFF; // disconnnect from I/O + pwm->PSEL.OUT[ch] = 0xFFFFFFFF; // disconnect from I/O } } diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 99effcea2f..4726d51c55 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -65,7 +65,7 @@ // This also includes mpconfigboard.h. #include "py/circuitpy_mpconfig.h" -// Definitions that might be overriden by mpconfigboard.h +// Definitions that might be overridden by mpconfigboard.h #ifndef CIRCUITPY_INTERNAL_NVM_SIZE #define CIRCUITPY_INTERNAL_NVM_SIZE (8 * 1024) diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c index df80671e64..2ae166d3ad 100644 --- a/ports/nrf/supervisor/qspi_flash.c +++ b/ports/nrf/supervisor/qspi_flash.c @@ -59,7 +59,7 @@ static int sck_delay_saved = 0; void qspi_disable(void) { // If VBUS is detected, no need to disable QSPI if (NRF_QSPI->ENABLE && !(NRF_POWER->USBREGSTATUS & POWER_USBREGSTATUS_VBUSDETECT_Msk)) { - // Keep CS high when QSPI is diabled + // Keep CS high when QSPI is disabled nrf_gpio_cfg_output(MICROPY_QSPI_CS); nrf_gpio_pin_write(MICROPY_QSPI_CS, 1); diff --git a/ports/raspberrypi/bindings/cyw43/__init__.c b/ports/raspberrypi/bindings/cyw43/__init__.c index 778da1ab62..520d10263c 100644 --- a/ports/raspberrypi/bindings/cyw43/__init__.c +++ b/ports/raspberrypi/bindings/cyw43/__init__.c @@ -84,7 +84,7 @@ const mp_obj_type_t cyw43_pin_type = { //| The low 4 bits, ``m``, are the power management mode: //| * 0: disabled //| * 1: aggressive power saving which reduces wifi throughput -//| * 2: Power saving with high througput +//| * 2: Power saving with high throughput //| //| The next 8 bits, ``r``, specify "the maximum time to wait before going back to sleep" for power management mode 2. The units of ``r`` are 10ms. //| diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h index 06cfaf37f6..55b69b4ad8 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h @@ -1,7 +1,7 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040 DVI" #define MICROPY_HW_MCU_NAME "rp2040" -#define MICROPY_HW_NEOPIXEL (&pin_GPIO16) +#define MICROPY_HW_NEOPIXEL (&pin_GPIO4) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c index e014ace05a..c8b4e3474f 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c @@ -9,21 +9,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO24) }, { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, - - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, - - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, - { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, - - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, @@ -31,10 +17,29 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_CKN), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_CKP), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_D0N), MP_ROM_PTR(&pin_GPIO18) }, diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/board.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.h new file mode 100644 index 0000000000..356f0f5b54 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.h @@ -0,0 +1,15 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040 EPD" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO20) +#define MICROPY_HW_NEOPIXEL (&pin_GPIO21) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO14) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO15) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO8) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.mk b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.mk new file mode 100644 index 0000000000..3b457b93cb --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x239A +USB_PID = 0x812C +USB_PRODUCT = "Feather RP2040 EPD" +USB_MANUFACTURER = "Adafruit" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pico-sdk-configboard.h @@ -0,0 +1,4 @@ +// Put board-specific pico-sdk definitions here. This file must exist. + +// Allow extra time for xosc to start. +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pins.c new file mode 100644 index 0000000000..22ae43adad --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_epd/pins.c @@ -0,0 +1,51 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_EPD_BUSY), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_EPD_RESET), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_EPD_DC), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_EPD_CS), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_EPD_SCK), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_EPD_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h new file mode 100644 index 0000000000..fff88cc1fa --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h @@ -0,0 +1,14 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040 RFM" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO4) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO14) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO15) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO8) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk new file mode 100644 index 0000000000..161a2b5c2e --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x239A +USB_PID = 0x812E +USB_PRODUCT = "Feather RP2040 RFM" +USB_MANUFACTURER = "Adafruit" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h @@ -0,0 +1,4 @@ +// Put board-specific pico-sdk definitions here. This file must exist. + +// Allow extra time for xosc to start. +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c new file mode 100644 index 0000000000..71679fb53b --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c @@ -0,0 +1,57 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_RFM_CS), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_RFM_RST), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO5), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO3), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO4), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO0), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO2), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/common-hal/socketpool/Socket.c b/ports/raspberrypi/common-hal/socketpool/Socket.c index e2b82264ba..0696cc7ae9 100644 --- a/ports/raspberrypi/common-hal/socketpool/Socket.c +++ b/ports/raspberrypi/common-hal/socketpool/Socket.c @@ -706,8 +706,6 @@ bool socketpool_socket(socketpool_socketpool_obj_t *self, case MOD_NETWORK_SOCK_STREAM: { // Register the socket object as our callback argument. tcp_arg(socket->pcb.tcp, (void *)socket); - // Register our error callback. - tcp_err(socket->pcb.tcp, _lwip_tcp_error); break; } case MOD_NETWORK_SOCK_DGRAM: { @@ -916,10 +914,11 @@ void socketpool_socket_close(socketpool_socket_obj_t *socket) { case SOCKETPOOL_SOCK_STREAM: { // Deregister callback (pcb.tcp is set to NULL below so must deregister now) tcp_arg(socket->pcb.tcp, NULL); - tcp_err(socket->pcb.tcp, NULL); - tcp_recv(socket->pcb.tcp, NULL); if (socket->pcb.tcp->state != LISTEN) { + tcp_err(socket->pcb.tcp, NULL); + tcp_recv(socket->pcb.tcp, NULL); + // Schedule a callback to abort the connection if it's not cleanly closed after // the given timeout. The callback must be set before calling tcp_close since // the latter may free the pcb; if it doesn't then the callback will be active. @@ -977,6 +976,7 @@ void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *socket, // Register our receive callback. MICROPY_PY_LWIP_ENTER tcp_recv(socket->pcb.tcp, _lwip_tcp_recv); + tcp_err(socket->pcb.tcp, _lwip_tcp_error); socket->state = STATE_CONNECTING; err = tcp_connect(socket->pcb.tcp, &dest, port, _lwip_tcp_connected); if (err != ERR_OK) { @@ -1109,7 +1109,7 @@ int socketpool_socket_recv_into(socketpool_socket_obj_t *socket, break; } if (ret == (unsigned)-1) { - mp_raise_OSError(_errno); + return -_errno; } return ret; } diff --git a/ports/raspberrypi/common-hal/ssl/SSLSocket.c b/ports/raspberrypi/common-hal/ssl/SSLSocket.c index 67508f16c8..06fe350cb6 100644 --- a/ports/raspberrypi/common-hal/ssl/SSLSocket.c +++ b/ports/raspberrypi/common-hal/ssl/SSLSocket.c @@ -257,7 +257,7 @@ mp_uint_t common_hal_ssl_sslsocket_recv_into(ssl_sslsocket_obj_t *self, uint8_t } else if (ret == MBEDTLS_ERR_SSL_WANT_WRITE) { // If handshake is not finished, read attempt may end up in protocol // wanting to write next handshake message. The same may happen with - // renegotation. + // renegotiation. ret = MP_EWOULDBLOCK; } DEBUG("raising errno [error case] %d\n", ret); @@ -276,7 +276,7 @@ mp_uint_t common_hal_ssl_sslsocket_send(ssl_sslsocket_obj_t *self, const uint8_t } else if (ret == MBEDTLS_ERR_SSL_WANT_READ) { // If handshake is not finished, write attempt may end up in protocol // wanting to read next handshake message. The same may happen with - // renegotation. + // renegotiation. ret = MP_EWOULDBLOCK; } DEBUG("raising errno [error case] %d\n", ret); diff --git a/ports/raspberrypi/common-hal/wifi/Radio.c b/ports/raspberrypi/common-hal/wifi/Radio.c index ae14d29ade..2ed19a96e7 100644 --- a/ports/raspberrypi/common-hal/wifi/Radio.c +++ b/ports/raspberrypi/common-hal/wifi/Radio.c @@ -176,7 +176,7 @@ void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_ common_hal_wifi_radio_stop_ap(self); - // Channel can only be changed after inital powerup and config of ap. + // Channel can only be changed after initial powerup and config of ap. // Defaults to 1 if not set or invalid (i.e. 13) cyw43_wifi_ap_set_channel(&cyw43_state, (const uint32_t)channel); diff --git a/ports/raspberrypi/common-hal/wifi/__init__.c b/ports/raspberrypi/common-hal/wifi/__init__.c index e5a646f88f..91a45e8d92 100644 --- a/ports/raspberrypi/common-hal/wifi/__init__.c +++ b/ports/raspberrypi/common-hal/wifi/__init__.c @@ -107,7 +107,7 @@ void raise_cyw_error(int err) { mp_errno = MP_ETIMEDOUT; break; default: - mp_raise_OSError_msg_varg(translate("Unkown error code %d"), err); + mp_raise_OSError_msg_varg(translate("Unknown error code %d"), err); } mp_raise_OSError(mp_errno); } diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index c5de2a439d..21dde6d239 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -21,11 +21,11 @@ CIRCUITPY_ROTARYIO ?= 1 CIRCUITPY_ROTARYIO_SOFTENCODER = 1 # Things that need to be implemented. -# Use PWM interally +# Use PWM internally CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CTARGET = 1 CIRCUITPY_NVM = 1 -# Use PIO interally +# Use PIO internally CIRCUITPY_PULSEIO ?= 1 CIRCUITPY_WATCHDOG ?= 1 diff --git a/ports/stm/boards/common_default.ld b/ports/stm/boards/common_default.ld index 0c7efd01d4..7c96a42bc5 100644 --- a/ports/stm/boards/common_default.ld +++ b/ports/stm/boards/common_default.ld @@ -24,7 +24,7 @@ SECTIONS . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ - /* This first flash block is 16K annd the isr vectors only take up + /* This first flash block is 16K and the isr vectors only take up about 400 bytes. Micropython pads this with files, but this didn't work with the size of Circuitpython's ff object. */ diff --git a/ports/stm/boards/common_nvm.ld b/ports/stm/boards/common_nvm.ld index 91e453bfd9..1d10db8a31 100644 --- a/ports/stm/boards/common_nvm.ld +++ b/ports/stm/boards/common_nvm.ld @@ -26,7 +26,7 @@ SECTIONS . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ - /* This first flash block is 16K annd the isr vectors only take up + /* This first flash block is 16K and the isr vectors only take up about 400 bytes. Micropython pads this with files, but this didn't work with the size of Circuitpython's ff object. */ diff --git a/ports/stm/boards/common_tcm.ld b/ports/stm/boards/common_tcm.ld index 9e677862d3..d7be64d667 100644 --- a/ports/stm/boards/common_tcm.ld +++ b/ports/stm/boards/common_tcm.ld @@ -26,7 +26,7 @@ SECTIONS . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ - /* This first flash block is 16K annd the isr vectors only take up + /* This first flash block is 16K and the isr vectors only take up about 400 bytes. Micropython pads this with files, but this didn't work with the size of Circuitpython's ff object. */ diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 6e4da86dd7..0ed5b161a1 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -14,7 +14,7 @@ LD_COMMON = boards/common_default.ld LD_FILE = boards/STM32F401xd_fs.ld # Disable ulab as we're nearly out of space on this board due to -# INTERNAL_FLASH_FILESYSTEM. It can probably be reenabled if we enable +# INTERNAL_FLASH_FILESYSTEM. It can probably be re-enabled if we enable # lto for this port, and if other stuff hasn't been added in the # meantime CIRCUITPY_AESIO = 0 diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index e4d362bbfa..0edf3d40e4 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -54,7 +54,7 @@ uint8_t display_init_sequence[] = { 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x20, 0, // _INVOFF //MISMATCh 0x2a vs 0x20 0x36, 1, 0x60, // _MADCTL bottom to top refresh - // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, + // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 cycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color 0xe0, 0x10, 0x02, 0x1c, 0x07, 0x12, diff --git a/ports/stm/boards/swan_r5/tests/enable_3v3.py b/ports/stm/boards/swan_r5/tests/enable_3v3.py index ba955c4f58..c32bbc58b8 100644 --- a/ports/stm/boards/swan_r5/tests/enable_3v3.py +++ b/ports/stm/boards/swan_r5/tests/enable_3v3.py @@ -5,7 +5,7 @@ import digitalio import supervisor import time -# Scenario: Enable 3V3 pin defintiion +# Scenario: Enable 3V3 pin definition # Then the symbol "board.ENABLE_3V3" is defined assert board.ENABLE_3V3 is not None diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio.h b/ports/stm/common-hal/audiobusio/MEMS_Audio.h index 2f670c8505..77f11dc82f 100644 --- a/ports/stm/common-hal/audiobusio/MEMS_Audio.h +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio.h @@ -35,7 +35,7 @@ extern "C" { /** * @brief How many milliseconds of audio can fit in the audio buffer(s). - * Interrupts for recieved data fire at half this duration / twice the frequency. + * Interrupts for received data fire at half this duration / twice the frequency. */ #ifndef MEMS_AUDIO_MS_BUFFER #define MEMS_AUDIO_MS_BUFFER (1) diff --git a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h index ce2c397d47..31a8133b63 100644 --- a/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h +++ b/ports/stm/common-hal/audiobusio/MEMS_Audio_ll_stm32l4.h @@ -148,7 +148,7 @@ typedef struct MemsAudio_STM32L4SAIPDM_t { pdm_data_available_t pdm_data_available; /** - * @brief A cound of the number of PDM clients in use. + * @brief A count of the number of PDM clients in use. */ uint32_t SAI1_client; diff --git a/ports/stm/common-hal/neopixel_write/__init__.c b/ports/stm/common-hal/neopixel_write/__init__.c index 99529793fa..9eb30a4509 100644 --- a/ports/stm/common-hal/neopixel_write/__init__.c +++ b/ports/stm/common-hal/neopixel_write/__init__.c @@ -67,7 +67,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, uint32_t p_mask = pin_mask(digitalinout->pin->number); __disable_irq(); - // Enable DWT in debug core. Useable when interrupts disabled, as opposed to Systick->VAL + // Enable DWT in debug core. Usable when interrupts disabled, as opposed to Systick->VAL CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; DWT->CYCCNT = 0; diff --git a/ports/unix/coverage.c b/ports/unix/coverage.c index 0e4c6dbd48..b04bc2158c 100644 --- a/ports/unix/coverage.c +++ b/ports/unix/coverage.c @@ -456,7 +456,7 @@ STATIC mp_obj_t extra_coverage(void) { { mp_printf(&mp_plat_print, "# VM\n"); - // call mp_execute_bytecode with invalide bytecode (should raise NotImplementedError) + // call mp_execute_bytecode with invalid bytecode (should raise NotImplementedError) mp_obj_fun_bc_t fun_bc; fun_bc.bytecode = (const byte *)"\x01"; // just needed for n_state mp_code_state_t *code_state = m_new_obj_var(mp_code_state_t, mp_obj_t, 1); diff --git a/ports/unix/modos.c b/ports/unix/modos.c index a6365aa6a3..8373c07a5c 100644 --- a/ports/unix/modos.c +++ b/ports/unix/modos.c @@ -147,7 +147,7 @@ STATIC mp_obj_t mod_os_remove(mp_obj_t path_in) { const char *path = mp_obj_str_get_str(path_in); // Note that POSIX requires remove() to be able to delete a directory - // too (act as rmdir()). This is POSIX extenstion to ANSI C semantics + // too (act as rmdir()). This is POSIX extension to ANSI C semantics // of that function. But Python remove() follows ANSI C, and explicitly // required to raise exception on attempt to remove a directory. Thus, // call POSIX unlink() here. diff --git a/ports/unix/modtermios.c b/ports/unix/modtermios.c index 7a578becb9..4adef8a380 100644 --- a/ports/unix/modtermios.c +++ b/ports/unix/modtermios.c @@ -73,7 +73,7 @@ STATIC mp_obj_t mod_termios_tcsetattr(mp_obj_t fd_in, mp_obj_t when_in, mp_obj_t // We don't export TCSANOW and friends to save on code space. Then // common lazy sense says that passing 0 should be godo enough, and // it is e.g. for glibc. But for other libc's it's not, so set just - // treat 0 as defauling to TCSANOW. + // treat 0 as defaulting to TCSANOW. when = TCSANOW; } diff --git a/py/asmthumb.c b/py/asmthumb.c index 547e5bedc1..1b1923370b 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -281,7 +281,7 @@ bool asm_thumb_b_n_label(asm_thumb_t *as, uint label) { #define OP_BCC_N(cond, byte_offset) (0xd000 | ((cond) << 8) | (((byte_offset) >> 1) & 0x00ff)) -// all these bit arithmetics need coverage testing! +// all these bit arithmetic need coverage testing! #define OP_BCC_W_HI(cond, byte_offset) (0xf000 | ((cond) << 6) | (((byte_offset) >> 10) & 0x0400) | (((byte_offset) >> 14) & 0x003f)) #define OP_BCC_W_LO(byte_offset) (0x8000 | ((byte_offset) & 0x2000) | (((byte_offset) >> 1) & 0x0fff)) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 4de29880d9..5f140413bb 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -393,7 +393,7 @@ extern const struct _mp_obj_module_t nvm_module; // Native modules that are weak links can be accessed directly // by prepending their name with an underscore. This list should correspond to // MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS, assuming you want the native modules -// to be accessible when overriden. +// to be accessible when overridden. #define MICROPY_PORT_BUILTIN_MODULE_ALT_NAMES diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index d002ab4d43..b8e2178870 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -526,7 +526,7 @@ CFLAGS += -DUSB_NUM_ENDPOINT_PAIRS=$(USB_NUM_ENDPOINT_PAIRS) CIRCUITPY_USTACK ?= 0 CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) -# for decompressing utlities +# for decompressing utilities CIRCUITPY_ZLIB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ZLIB=$(CIRCUITPY_ZLIB) diff --git a/py/compile.c b/py/compile.c index 432aeca561..3668bee320 100644 --- a/py/compile.c +++ b/py/compile.c @@ -3477,7 +3477,7 @@ mp_raw_code_t *mp_compile_to_raw_code(mp_parse_tree_t *parse_tree, qstr source_f } } - // update maximim number of labels needed + // update maximum number of labels needed if (comp->next_label > max_num_labels) { max_num_labels = comp->next_label; } diff --git a/py/emitbc.c b/py/emitbc.c index 8f7b1d5b72..80d0bf489b 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -253,7 +253,7 @@ STATIC void emit_write_bytecode_byte_obj(emit_t *emit, int stack_adj, byte b, mp emit_write_bytecode_byte(emit, stack_adj, b); emit->bytecode_offset = (size_t)MP_ALIGN(emit->bytecode_offset, sizeof(mp_obj_t)); mp_obj_t *c = (mp_obj_t *)emit_get_cur_to_write_bytecode(emit, sizeof(mp_obj_t)); - // Verify thar c is already uint-aligned + // Verify that c is already uint-aligned assert(c == MP_ALIGN(c, sizeof(mp_obj_t))); *c = obj; #endif @@ -269,7 +269,7 @@ STATIC void emit_write_bytecode_byte_raw_code(emit_t *emit, int stack_adj, byte emit_write_bytecode_byte(emit, stack_adj, b); emit->bytecode_offset = (size_t)MP_ALIGN(emit->bytecode_offset, sizeof(void *)); void **c = (void **)emit_get_cur_to_write_bytecode(emit, sizeof(void *)); - // Verify thar c is already uint-aligned + // Verify that c is already uint-aligned assert(c == MP_ALIGN(c, sizeof(void *))); *c = rc; #endif diff --git a/py/emitnative.c b/py/emitnative.c index 5946fcd341..7d615d5816 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -944,7 +944,7 @@ STATIC void emit_access_stack(emit_t *emit, int pos, vtype_kind_t *vtype, int re } // does an efficient X=pop(); discard(); push(X) -// needs a (non-temp) register in case the poped element was stored in the stack +// needs a (non-temp) register in case the popped element was stored in the stack STATIC void emit_fold_stack_top(emit_t *emit, int reg_dest) { stack_info_t *si = &emit->stack_info[emit->stack_size - 2]; si[0] = si[1]; diff --git a/py/formatfloat.c b/py/formatfloat.c index d75cfc6658..4671f3348b 100644 --- a/py/formatfloat.c +++ b/py/formatfloat.c @@ -39,7 +39,7 @@ Routine for converting a arbitrary floating point number into a string. - The code in this funcion was inspired from Fred Bayer's pdouble.c. + The code in this function was inspired from Fred Bayer's pdouble.c. Since pdouble.c was released as Public Domain, I'm releasing this code as public domain as well. @@ -390,7 +390,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch --dec; --num_digits_left; if (digit_index <= 0) { - // Once we get below 1.0, we scale up f instead of calculting + // Once we get below 1.0, we scale up f instead of calculating // negative powers of 10 in u_base. This provides better // renditions of exact decimals like 1/16 etc. f *= FPCONST(10.0); diff --git a/py/makecompresseddata.py b/py/makecompresseddata.py index 9603de8713..1bce3e8e83 100644 --- a/py/makecompresseddata.py +++ b/py/makecompresseddata.py @@ -24,7 +24,7 @@ def check_non_ascii(msg): # Replace with . -# Trival scheme to demo/test. +# Trivial scheme to demo/test. def space_compression(error_strings): for line in error_strings: check_non_ascii(line) diff --git a/py/mkrules.mk b/py/mkrules.mk index ef0f66117d..09ed82ac5b 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -13,7 +13,7 @@ OBJ_EXTRA_ORDER_DEPS = # tree. # # So for example, py/map.c would have an object file name py/map.o -# The object files will go into the build directory and mantain the same +# The object files will go into the build directory and maintain the same # directory structure as the source tree. So the final dependency will look # like this: # @@ -142,7 +142,7 @@ endif ifneq ($(PROG),) # Build a standalone executable (unix does this) -# The executable should have an .exe extension for builds targetting 'pure' +# The executable should have an .exe extension for builds targeting 'pure' # Windows, i.e. msvc or mingw builds, but not when using msys or cygwin's gcc. COMPILER_TARGET := $(shell $(CC) -dumpmachine) ifneq (,$(findstring mingw,$(COMPILER_TARGET))) diff --git a/py/objexcept.c b/py/objexcept.c index 24fb564e23..e05c3ca8d7 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -176,7 +176,7 @@ mp_obj_t mp_obj_exception_make_new(const mp_obj_type_t *type, size_t n_args, siz mp_obj_tuple_t *o_tuple; if (n_args == 0) { - // No args, can use the empty tuple straightaway + // No args, can use the empty tuple straight away o_tuple = (mp_obj_tuple_t *)&mp_const_empty_tuple_obj; } else { // Try to allocate memory for the tuple containing the args diff --git a/py/objtype.c b/py/objtype.c index 76b9551be8..5b04c361e1 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -649,7 +649,7 @@ STATIC void mp_obj_instance_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *des mp_obj_t member = dest[0]; if (member != MP_OBJ_NULL) { if (!(self->base.type->flags & MP_TYPE_FLAG_HAS_SPECIAL_ACCESSORS)) { - // Class doesn't have any special accessors to check so return straightaway + // Class doesn't have any special accessors to check so return straight away return; } diff --git a/py/runtime.c b/py/runtime.c index 91d9eb1c6d..804b955e07 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -414,7 +414,7 @@ mp_obj_t MICROPY_WRAP_MP_BINARY_OP(mp_binary_op)(mp_binary_op_t op, mp_obj_t lhs } else { // standard precision is enough for right-shift if (rhs_val >= (mp_int_t)(sizeof(lhs_val) * MP_BITS_PER_BYTE)) { - // Shifting to big amounts is underfined behavior + // Shifting to big amounts is undefined behavior // in C and is CPU-dependent; propagate sign bit. rhs_val = sizeof(lhs_val) * MP_BITS_PER_BYTE - 1; } diff --git a/py/scope.h b/py/scope.h index 8b05421072..b189260a37 100644 --- a/py/scope.h +++ b/py/scope.h @@ -49,7 +49,7 @@ typedef struct _id_info_t { uint8_t kind; uint8_t flags; // when it's an ID_INFO_KIND_LOCAL this is the unique number of the local - // whet it's an ID_INFO_KIND_CELL/FREE this is the unique number of the closed over variable + // when it's an ID_INFO_KIND_CELL/FREE this is the unique number of the closed over variable uint16_t local_num; qstr qst; } id_info_t; diff --git a/py/sequence.c b/py/sequence.c index 7befc85763..42a9a4a0ae 100644 --- a/py/sequence.c +++ b/py/sequence.c @@ -171,7 +171,7 @@ bool mp_seq_cmp_objs(mp_uint_t op, const mp_obj_t *items1, size_t len1, const mp continue; } - // Othewise, if they are not equal, we can have final decision based on them + // Otherwise, if they are not equal, we can have final decision based on them if (op == MP_BINARY_OP_EQUAL) { // In particular, if we are checking for equality, here're the answer return false; diff --git a/requirements-doc.txt b/requirements-doc.txt index 43e99fa32f..0489dc0b9f 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -13,6 +13,7 @@ sphinx!=5.2.0.post0 sphinx-autoapi sphinx-rtd-theme sphinxcontrib-svg2pdfconverter +sphinxcontrib-jquery readthedocs-sphinx-search myst-parser diff --git a/shared-bindings/alarm/__init__.c b/shared-bindings/alarm/__init__.c index 29c9b49d3f..94879e14d4 100644 --- a/shared-bindings/alarm/__init__.c +++ b/shared-bindings/alarm/__init__.c @@ -71,7 +71,7 @@ //| wake_alarm: Optional[circuitpython_typing.Alarm] //| """The most recently triggered alarm. If CircuitPython was sleeping, the alarm that woke it from sleep. -//| If no alarm occured since the last hard reset or soft restart, value is ``None``. +//| If no alarm occurred since the last hard reset or soft restart, value is ``None``. //| """ //| diff --git a/shared-bindings/alarm/__init__.h b/shared-bindings/alarm/__init__.h index 82bfae4286..c47f482e74 100644 --- a/shared-bindings/alarm/__init__.h +++ b/shared-bindings/alarm/__init__.h @@ -33,7 +33,7 @@ #include "common-hal/digitalio/DigitalInOut.h" // Light sleep fully self-contained and does not exit user code. It will return -// the same alarm object that was orignally passed in, unlike deep sleep, which +// the same alarm object that was originally passed in, unlike deep sleep, which // must create an identical copy due to the VM reset extern mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj_t *alarms); diff --git a/shared-bindings/audiomp3/__init__.c b/shared-bindings/audiomp3/__init__.c index 948910c45e..9fe525dfe2 100644 --- a/shared-bindings/audiomp3/__init__.c +++ b/shared-bindings/audiomp3/__init__.c @@ -33,7 +33,7 @@ //| """Support for MP3-compressed audio files //| -//| For more infomration about working with MP3 files in CircuitPython, +//| For more information about working with MP3 files in CircuitPython, //| see `this CircuitPython Essentials Learn guide page //| `_. //| """ diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index b4cea75184..f05fbfdfe9 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -56,6 +56,10 @@ //| :param int quiescent_value: The output value when no signal is present. Samples should start //| and end with this value to prevent audible popping. //| +//| **Limitations:** On mimxrt10xx, low sample rates may have an audible +//| "carrier" frequency. The manufacturer datasheet states that the "MQS" peripheral +//| is intended for 44 kHz or 48kHz input signals. +//| //| Simple 8ksps 440 Hz sin wave:: //| //| import audiocore @@ -114,7 +118,12 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_ validate_obj_is_free_pin_or_none(args[ARG_right_channel].u_obj, MP_QSTR_right_channel); // create AudioOut object from the given pin - audiopwmio_pwmaudioout_obj_t *self = m_new_obj(audiopwmio_pwmaudioout_obj_t); + // The object is made long-lived because many implementations keep + // a pointer to the object (e.g., for the interrupt handler), which + // will not work properly if the object is moved. It is created + // with a finaliser as some ports use these (rather than 'reset' functions) + // to ensure resources are collected at interpreter shutdown. + audiopwmio_pwmaudioout_obj_t *self = m_new_ll_obj_with_finaliser(audiopwmio_pwmaudioout_obj_t); self->base.type = &audiopwmio_pwmaudioout_type; common_hal_audiopwmio_pwmaudioout_construct(self, left_channel_pin, right_channel_pin, args[ARG_quiescent_value].u_int); @@ -249,6 +258,7 @@ MP_PROPERTY_GETTER(audiopwmio_pwmaudioout_paused_obj, STATIC const mp_rom_map_elem_t audiopwmio_pwmaudioout_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiopwmio_pwmaudioout_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&audiopwmio_pwmaudioout_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&audiopwmio_pwmaudioout___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_play), MP_ROM_PTR(&audiopwmio_pwmaudioout_play_obj) }, diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index e377d40031..2a23a2c05d 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -530,14 +530,14 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_draw_line_obj, 0, bitmaptools_obj_draw_li //| value: int, //| close: Optional[bool] = True, //| ) -> None: -//| """Draw a polygon conecting points on provided bitmap with provided value +//| """Draw a polygon connecting points on provided bitmap with provided value //| //| :param bitmap dest_bitmap: Destination bitmap that will be written into //| :param ReadableBuffer xs: x-pixel position of the polygon's vertices //| :param ReadableBuffer ys: y-pixel position of the polygon's vertices //| :param int value: Bitmap palette index that will be written into the //| line in the destination bitmap -//| :param bool close: (Optional) Wether to connect first and last point. (True) +//| :param bool close: (Optional) Whether to connect first and last point. (True) //| //| .. code-block:: Python //| @@ -630,7 +630,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_draw_polygon_obj, 0, bitmaptools_obj_draw //| """Inserts pixels from ``data`` into the rectangle of width×height pixels with the upper left corner at ``(x,y)`` //| //| The values from ``data`` are taken modulo the number of color values -//| avalable in the destination bitmap. +//| available in the destination bitmap. //| //| If x1 or y1 are not specified, they are taken as 0. If x2 or y2 //| are not specified, or are given as -1, they are taken as the width @@ -722,7 +722,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_arrayblit_obj, 0, bitmaptools_arrayblit); //| :param typing.BinaryIO file: A file opened in binary mode //| :param int bits_per_pixel: Number of bits per pixel. Values 1, 2, 4, 8, 16, 24, and 32 are supported; //| :param int element_size: Number of bytes per element. Values of 1, 2, and 4 are supported, except that 24 ``bits_per_pixel`` requires 1 byte per element. -//| :param bool reverse_pixels_in_element: If set, the first pixel in a word is taken from the Most Signficant Bits; otherwise, it is taken from the Least Significant Bits. +//| :param bool reverse_pixels_in_element: If set, the first pixel in a word is taken from the Most Significant Bits; otherwise, it is taken from the Least Significant Bits. //| :param bool swap_bytes_in_element: If the ``element_size`` is not 1, then reverse the byte order of each element read. //| :param bool reverse_rows: Reverse the direction of the row loading (required for some bitmap images). //| """ @@ -782,7 +782,7 @@ STATIC mp_obj_t bitmaptools_readinto(size_t n_args, const mp_obj_t *pos_args, mp MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_readinto_obj, 0, bitmaptools_readinto); //| class DitherAlgorithm: -//| """Identifies the algorith for dither to use""" +//| """Identifies the algorithm for dither to use""" //| //| Atkinson: "DitherAlgorithm" //| """The classic Atkinson dither, often associated with the Hypercard esthetic""" diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 971ed2f676..99b99b37ea 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -43,7 +43,7 @@ //| Common container for board base pin names. These will vary from board to //| board so don't expect portability when using this module. //| -//| Another common use of this module is to use serial communciation buses with +//| Another common use of this module is to use serial communication buses with //| the default pins and settings. For more information about serial communcication //| in CircuitPython, see the :mod:`busio`. //| diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 77d7036c2e..a10dc8efad 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -157,7 +157,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si // Always initially allocate the UART object within the long-lived heap. // This is needed to avoid crashes with certain UART implementations which - // cannot accomodate being moved after creation. (See + // cannot accommodate being moved after creation. (See // https://github.com/adafruit/circuitpython/issues/1056) busio_uart_obj_t *self = m_new_ll_obj_with_finaliser(busio_uart_obj_t); self->base.type = &busio_uart_type; diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index 4f0e0a692f..fc60994f5c 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -57,7 +57,7 @@ STATIC mp_obj_t countio_counter_make_new(const mp_obj_type_t *type, size_t n_arg const countio_edge_t edge = validate_edge(args[ARG_edge].u_obj, MP_QSTR_edge); const digitalio_pull_t pull = validate_pull(args[ARG_pull].u_obj, MP_QSTR_pull); // Make long-lived because some implementations use a pointer to the object as interrupt-handler data. - countio_counter_obj_t *self = m_new_ll_obj(countio_counter_obj_t); + countio_counter_obj_t *self = m_new_ll_obj_with_finaliser(countio_counter_obj_t); self->base.type = &countio_counter_type; common_hal_countio_counter_construct(self, pin, edge, pull); @@ -134,6 +134,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(countio_counter_reset_obj, countio_counter_reset); STATIC const mp_rom_map_elem_t countio_counter_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&countio_counter_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&countio_counter_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&countio_counter___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&countio_counter_count_obj) }, diff --git a/shared-bindings/countio/__init__.c b/shared-bindings/countio/__init__.c index 25e9c7d630..0d412cc17f 100644 --- a/shared-bindings/countio/__init__.c +++ b/shared-bindings/countio/__init__.c @@ -11,7 +11,7 @@ //| """Support for edge counting //| -//| The `countio` module contains logic to read and count edge transistions +//| The `countio` module contains logic to read and count edge transitions //| //| For more information on the applications of counting edges, see //| `this Learn Guide on sequential circuits diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 65551f4e0d..12aee30b19 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -62,14 +62,11 @@ //| ... STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { mp_arg_check_num(n_args, n_kw, 3, 3, false); - uint32_t width = mp_obj_get_int(all_args[0]); - uint32_t height = mp_obj_get_int(all_args[1]); - uint32_t value_count = mp_obj_get_int(all_args[2]); + uint32_t width = mp_arg_validate_int_range(mp_obj_get_int(all_args[0]), 1, 32767, MP_QSTR_width); + uint32_t height = mp_arg_validate_int_range(mp_obj_get_int(all_args[1]), 1, 32767, MP_QSTR_height); + uint32_t value_count = mp_arg_validate_int_range(mp_obj_get_int(all_args[2]), 1, 65535, MP_QSTR_value_count); uint32_t bits = 1; - if (value_count == 0) { - mp_raise_ValueError(translate("value_count must be > 0")); - } while ((value_count - 1) >> bits) { if (bits < 8) { bits <<= 1; @@ -84,11 +81,19 @@ STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_ar return MP_OBJ_FROM_PTR(self); } + +STATIC void check_for_deinit(displayio_bitmap_t *self) { + if (common_hal_displayio_bitmap_deinited(self)) { + raise_deinited_error(); + } +} + //| width: int //| """Width of the bitmap. (read only)""" STATIC mp_obj_t displayio_bitmap_obj_get_width(mp_obj_t self_in) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_bitmap_get_width(self)); } @@ -102,6 +107,7 @@ MP_PROPERTY_GETTER(displayio_bitmap_width_obj, STATIC mp_obj_t displayio_bitmap_obj_get_height(mp_obj_t self_in) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_bitmap_get_height(self)); } @@ -134,6 +140,7 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val } displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); if (mp_obj_is_type(index_obj, &mp_type_slice)) { // TODO(tannewt): Implement subscr after slices support start, stop and step tuples. @@ -144,28 +151,24 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val uint16_t x = 0; uint16_t y = 0; if (mp_obj_is_small_int(index_obj)) { - mp_int_t i = MP_OBJ_SMALL_INT_VALUE(index_obj); + mp_int_t i = mp_arg_validate_int_min(MP_OBJ_SMALL_INT_VALUE(index_obj), 0, MP_QSTR_index); uint16_t width = common_hal_displayio_bitmap_get_width(self); x = i % width; y = i / width; } else { mp_obj_t *items; mp_obj_get_array_fixed_n(index_obj, 2, &items); - x = mp_obj_get_int(items[0]); - y = mp_obj_get_int(items[1]); - if (x >= common_hal_displayio_bitmap_get_width(self) || y >= common_hal_displayio_bitmap_get_height(self)) { - mp_raise_IndexError(translate("pixel coordinates out of bounds")); - } + x = mp_arg_validate_int_range(mp_obj_get_int(items[0]), 0, self->width - 1, MP_QSTR_x); + y = mp_arg_validate_int_range(mp_obj_get_int(items[1]), 0, self->height - 1, MP_QSTR_y); } if (value_obj == MP_OBJ_SENTINEL) { // load return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_bitmap_get_pixel(self, x, y)); } else { - mp_uint_t value = (mp_uint_t)mp_obj_get_int(value_obj); - if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { - mp_raise_ValueError(translate("pixel value requires too many bits")); - } + mp_uint_t value = (mp_uint_t)mp_arg_validate_int_range( + mp_obj_get_int(value_obj), 0, + (UINT32_MAX >> (32 - common_hal_displayio_bitmap_get_bits_per_value(self))), MP_QSTR_value); common_hal_displayio_bitmap_set_pixel(self, x, y, value); } return mp_const_none; @@ -214,9 +217,11 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); - int16_t x = args[ARG_x].u_int; - int16_t y = args[ARG_y].u_int; + // Check x,y are within self (target) bitmap boundary + int16_t x = mp_arg_validate_int_range(args[ARG_x].u_int, 0, self->width - 1, MP_QSTR_x); + int16_t y = mp_arg_validate_int_range(args[ARG_y].u_int, 0, self->height - 1, MP_QSTR_y); displayio_bitmap_t *source = mp_arg_validate_type(args[ARG_source].u_obj, &displayio_bitmap_type, MP_QSTR_source_bitmap); @@ -226,32 +231,21 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg mp_raise_ValueError(translate("source palette too large")); } - int16_t x1 = args[ARG_x1].u_int; - int16_t y1 = args[ARG_y1].u_int; + // Check x1,y1,x2,y2 are within source bitmap boundary + int16_t x1 = mp_arg_validate_int_range(args[ARG_x1].u_int, 0, source->width - 1, MP_QSTR_x1); + int16_t y1 = mp_arg_validate_int_range(args[ARG_y1].u_int, 0, source->height - 1, MP_QSTR_y1); int16_t x2, y2; // if x2 or y2 is None, then set as the maximum size of the source bitmap if (args[ARG_x2].u_obj == mp_const_none) { x2 = source->width; } else { - x2 = mp_obj_get_int(args[ARG_x2].u_obj); + x2 = mp_arg_validate_int_range(mp_obj_get_int(args[ARG_x2].u_obj), 0, source->width, MP_QSTR_x2); } // int16_t y2; if (args[ARG_y2].u_obj == mp_const_none) { y2 = source->height; } else { - y2 = mp_obj_get_int(args[ARG_y2].u_obj); - } - - // Check x,y are within self (target) bitmap boundary - if ((x < 0) || (y < 0) || (x > self->width) || (y > self->height)) { - mp_raise_ValueError(translate("out of range of target")); - } - // Check x1,y1,x2,y2 are within source bitmap boundary - if ((x1 < 0) || (x1 > source->width) || - (y1 < 0) || (y1 > source->height) || - (x2 < 0) || (x2 > source->width) || - (y2 < 0) || (y2 > source->height)) { - mp_raise_ValueError(translate("out of range of source")); + y2 = mp_arg_validate_int_range(mp_obj_get_int(args[ARG_y2].u_obj), 0, source->height, MP_QSTR_y2); } // Ensure x1 < x2 and y1 < y2 @@ -288,11 +282,9 @@ MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 1, displayio_bitmap_obj_bl //| ... STATIC mp_obj_t displayio_bitmap_obj_fill(mp_obj_t self_in, mp_obj_t value_obj) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); - mp_uint_t value = (mp_uint_t)mp_obj_get_int(value_obj); - if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { - mp_raise_ValueError(translate("pixel value requires too many bits")); - } + mp_uint_t value = (mp_uint_t)mp_arg_validate_int_range(mp_obj_get_int(value_obj), 0,(1u << common_hal_displayio_bitmap_get_bits_per_value(self)) - 1,MP_QSTR_value); common_hal_displayio_bitmap_fill(self, value); return mp_const_none; @@ -318,9 +310,10 @@ MP_DEFINE_CONST_FUN_OBJ_2(displayio_bitmap_fill_obj, displayio_bitmap_obj_fill); //| notified of the "dirty rectangle" that encloses all modified //| pixels.""" //| ... -//| STATIC mp_obj_t displayio_bitmap_obj_dirty(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + enum { ARG_x1, ARG_y1, ARG_x2, ARG_y2 }; static const mp_arg_t allowed_args[] = { { MP_QSTR_x1, MP_ARG_INT, {.u_int = 0} }, @@ -344,13 +337,24 @@ STATIC mp_obj_t displayio_bitmap_obj_dirty(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_dirty_obj, 0, displayio_bitmap_obj_dirty); +//| def deinit(self) -> None: +//| """Release resources allocated by Bitmap.""" +//| ... +//| +STATIC mp_obj_t displayio_bitmap_obj_deinit(mp_obj_t self_in) { + displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_displayio_bitmap_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(displayio_bitmap_deinit_obj, displayio_bitmap_obj_deinit); + STATIC const mp_rom_map_elem_t displayio_bitmap_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&displayio_bitmap_height_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_bitmap_width_obj) }, { MP_ROM_QSTR(MP_QSTR_blit), MP_ROM_PTR(&displayio_bitmap_blit_obj) }, { MP_ROM_QSTR(MP_QSTR_fill), MP_ROM_PTR(&displayio_bitmap_fill_obj) }, { MP_ROM_QSTR(MP_QSTR_dirty), MP_ROM_PTR(&displayio_bitmap_dirty_obj) }, - + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&displayio_bitmap_deinit_obj) }, }; STATIC MP_DEFINE_CONST_DICT(displayio_bitmap_locals_dict, displayio_bitmap_locals_dict_table); diff --git a/shared-bindings/displayio/Bitmap.h b/shared-bindings/displayio/Bitmap.h index 074f7dfa5c..b35f4eadbc 100644 --- a/shared-bindings/displayio/Bitmap.h +++ b/shared-bindings/displayio/Bitmap.h @@ -48,5 +48,7 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16 uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *bitmap, int16_t x, int16_t y); void common_hal_displayio_bitmap_fill(displayio_bitmap_t *bitmap, uint32_t value); int common_hal_displayio_bitmap_get_buffer(displayio_bitmap_t *self, mp_buffer_info_t *bufinfo, mp_uint_t flags); +void common_hal_displayio_bitmap_deinit(displayio_bitmap_t *self); +bool common_hal_displayio_bitmap_deinited(displayio_bitmap_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_BITMAP_H diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 3e4569b271..24064a74c1 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -56,7 +56,7 @@ STATIC mp_obj_t displayio_group_make_new(const mp_obj_type_t *type, size_t n_arg mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_int_t scale = mp_arg_validate_int_min(args[ARG_scale].u_int, 1, MP_QSTR_scale); + mp_int_t scale = mp_arg_validate_int_range(args[ARG_scale].u_int, 1, 32767,MP_QSTR_scale); displayio_group_t *self = m_new_obj(displayio_group_t); self->base.type = &displayio_group_type; diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index 50deff5748..0c44ed0f60 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -61,7 +61,7 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a displayio_palette_t *self = m_new_obj(displayio_palette_t); self->base.type = &displayio_palette_type; - common_hal_displayio_palette_construct(self, args[ARG_color_count].u_int, args[ARG_dither].u_bool); + common_hal_displayio_palette_construct(self, mp_arg_validate_int_range(args[ARG_color_count].u_int, 1, 32767, MP_QSTR_color_count), args[ARG_dither].u_bool); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index 3fcd1d082b..77dc8aecee 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -61,7 +61,7 @@ //| //| def release_displays() -> None: -//| """Releases any actively used displays so their busses and pins can be used again. This will also +//| """Releases any actively used displays so their buses and pins can be used again. This will also //| release the builtin display on boards that have one. You will need to reinitialize it yourself //| afterwards. This may take seconds to complete if an active EPaperDisplay is refreshing. //| diff --git a/shared-bindings/gifio/OnDiskGif.c b/shared-bindings/gifio/OnDiskGif.c index ca77459ac8..f6acccfabf 100644 --- a/shared-bindings/gifio/OnDiskGif.c +++ b/shared-bindings/gifio/OnDiskGif.c @@ -30,6 +30,8 @@ #include "py/runtime.h" #include "py/objproperty.h" +#include "shared/runtime/context_manager_helpers.h" +#include "shared-bindings/util.h" #include "supervisor/shared/translate/translate.h" #include "shared-bindings/gifio/OnDiskGif.h" @@ -95,7 +97,15 @@ //| //| display_bus.send(42, struct.pack(">hh", 0, odg.bitmap.width - 1)) //| display_bus.send(43, struct.pack(">hh", 0, odg.bitmap.height - 1)) -//| display_bus.send(44, d.bitmap) +//| display_bus.send(44, odg.bitmap) +//| +//| # The following optional code will free the OnDiskGif and allocated resources +//| # after use. This may be required before loading a new GIF in situations +//| # where RAM is limited and the first GIF took most of the RAM. +//| odg.deinit() +//| odg = None +//| gc.collect() +//| //| """ //| //| def __init__(self, file: str) -> None: @@ -125,11 +135,34 @@ STATIC mp_obj_t gifio_ondiskgif_make_new(const mp_obj_type_t *type, size_t n_arg return MP_OBJ_FROM_PTR(self); } +STATIC void check_for_deinit(gifio_ondiskgif_t *self) { + if (common_hal_gifio_ondiskgif_deinited(self)) { + raise_deinited_error(); + } +} + +//| def __enter__(self) -> OnDiskGif: +//| """No-op used by Context Managers.""" +//| ... +// Provided by context manager helper. + +//| def __exit__(self) -> None: +//| """Automatically deinitializes the GIF when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +STATIC mp_obj_t gifio_ondiskgif_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_gifio_ondiskgif_deinit(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(gifio_ondiskgif___exit___obj, 4, 4, gifio_ondiskgif_obj___exit__); + //| width: int //| """Width of the gif. (read only)""" STATIC mp_obj_t gifio_ondiskgif_obj_get_width(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return MP_OBJ_NEW_SMALL_INT(common_hal_gifio_ondiskgif_get_width(self)); } @@ -143,6 +176,7 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_width_obj, STATIC mp_obj_t gifio_ondiskgif_obj_get_height(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return MP_OBJ_NEW_SMALL_INT(common_hal_gifio_ondiskgif_get_height(self)); } @@ -155,6 +189,8 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_height_obj, //| """The bitmap used to hold the current frame.""" STATIC mp_obj_t gifio_ondiskgif_obj_get_bitmap(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + + check_for_deinit(self); return common_hal_gifio_ondiskgif_get_bitmap(self); } @@ -168,6 +204,7 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_bitmap_obj, STATIC mp_obj_t gifio_ondiskgif_obj_next_frame(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return mp_obj_new_float((float)common_hal_gifio_ondiskgif_next_frame(self, true) / 1000); } @@ -179,6 +216,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(gifio_ondiskgif_next_frame_obj, gifio_ondiskgif_obj_ne STATIC mp_obj_t gifio_ondiskgif_obj_get_duration(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return mp_obj_new_float((float)common_hal_gifio_ondiskgif_get_duration(self) / 1000); } @@ -192,6 +230,7 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_duration_obj, STATIC mp_obj_t gifio_ondiskgif_obj_get_frame_count(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return MP_OBJ_NEW_SMALL_INT(common_hal_gifio_ondiskgif_get_frame_count(self)); } @@ -205,6 +244,7 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_frame_count_obj, STATIC mp_obj_t gifio_ondiskgif_obj_get_min_delay(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return mp_obj_new_float((float)common_hal_gifio_ondiskgif_get_min_delay(self) / 1000); } @@ -219,6 +259,7 @@ MP_PROPERTY_GETTER(gifio_ondiskgif_min_delay_obj, STATIC mp_obj_t gifio_ondiskgif_obj_get_max_delay(mp_obj_t self_in) { gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); return mp_obj_new_float((float)common_hal_gifio_ondiskgif_get_max_delay(self) / 1000); } @@ -227,7 +268,21 @@ MP_DEFINE_CONST_FUN_OBJ_1(gifio_ondiskgif_get_max_delay_obj, gifio_ondiskgif_obj MP_PROPERTY_GETTER(gifio_ondiskgif_max_delay_obj, (mp_obj_t)&gifio_ondiskgif_get_max_delay_obj); +//| def deinit(self) -> None: +//| """Release resources allocated by OnDiskGif.""" +//| ... +//| +STATIC mp_obj_t gifio_ondiskgif_obj_deinit(mp_obj_t self_in) { + gifio_ondiskgif_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_gifio_ondiskgif_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(gifio_ondiskgif_deinit_obj, gifio_ondiskgif_obj_deinit); + STATIC const mp_rom_map_elem_t gifio_ondiskgif_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gifio_ondiskgif_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&gifio_ondiskgif___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&gifio_ondiskgif_height_obj) }, { MP_ROM_QSTR(MP_QSTR_bitmap), MP_ROM_PTR(&gifio_ondiskgif_bitmap_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&gifio_ondiskgif_width_obj) }, diff --git a/shared-bindings/gifio/OnDiskGif.h b/shared-bindings/gifio/OnDiskGif.h index 4ecbfca495..6776466e8d 100644 --- a/shared-bindings/gifio/OnDiskGif.h +++ b/shared-bindings/gifio/OnDiskGif.h @@ -45,4 +45,6 @@ int32_t common_hal_gifio_ondiskgif_get_duration(gifio_ondiskgif_t *self); int32_t common_hal_gifio_ondiskgif_get_frame_count(gifio_ondiskgif_t *self); int32_t common_hal_gifio_ondiskgif_get_min_delay(gifio_ondiskgif_t *self); int32_t common_hal_gifio_ondiskgif_get_max_delay(gifio_ondiskgif_t *self); +void common_hal_gifio_ondiskgif_deinit(gifio_ondiskgif_t *self); +bool common_hal_gifio_ondiskgif_deinited(gifio_ondiskgif_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_ONDISKGIF_H diff --git a/shared-bindings/keypad/Event.c b/shared-bindings/keypad/Event.c index c8d24294f8..8264ebe612 100644 --- a/shared-bindings/keypad/Event.c +++ b/shared-bindings/keypad/Event.c @@ -64,7 +64,7 @@ STATIC mp_obj_t keypad_event_make_new(const mp_obj_type_t *type, size_t n_args, timestamp = supervisor_ticks_ms(); } - (void)mp_obj_get_int_truncated(timestamp); // ensure that timesamp is an integer + (void)mp_obj_get_int_truncated(timestamp); // ensure that timestamp is an integer common_hal_keypad_event_construct(self, key_number, args[ARG_pressed].u_bool, timestamp); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/keypad/KeyMatrix.c b/shared-bindings/keypad/KeyMatrix.c index 49723dbb9e..1c623f4bed 100644 --- a/shared-bindings/keypad/KeyMatrix.c +++ b/shared-bindings/keypad/KeyMatrix.c @@ -56,7 +56,7 @@ //| An `EventQueue` is created when this object is created and is available in the `events` attribute. //| //| :param Sequence[microcontroller.Pin] row_pins: The pins attached to the rows. -//| :param Sequence[microcontroller.Pin] column_pins: The pins attached to the colums. +//| :param Sequence[microcontroller.Pin] column_pins: The pins attached to the columns. //| :param bool columns_to_anodes: Default ``True``. //| If the matrix uses diodes, the diode anodes are typically connected to the column pins, //| and the cathodes should be connected to the row pins. If your diodes are reversed, diff --git a/shared-bindings/microcontroller/ResetReason.c b/shared-bindings/microcontroller/ResetReason.c index 13a8f25e6d..6f8ac8f42b 100644 --- a/shared-bindings/microcontroller/ResetReason.c +++ b/shared-bindings/microcontroller/ResetReason.c @@ -39,31 +39,31 @@ MAKE_ENUM_VALUE(mcu_reset_reason_type, reset_reason, UNKNOWN, RESET_REASON_UNKNO MAKE_ENUM_VALUE(mcu_reset_reason_type, reset_reason, RESCUE_DEBUG, RESET_REASON_RESCUE_DEBUG); //| class ResetReason: -//| """The reason the microntroller was last reset""" +//| """The reason the microcontroller was last reset""" //| //| POWER_ON: object //| """The microcontroller was started from power off.""" //| //| BROWNOUT: object -//| """The microntroller was reset due to too low a voltage.""" +//| """The microcontroller was reset due to too low a voltage.""" //| //| SOFTWARE: object -//| """The microntroller was reset from software.""" +//| """The microcontroller was reset from software.""" //| //| DEEP_SLEEP_ALARM: object -//| """The microntroller was reset for deep sleep and restarted by an alarm.""" +//| """The microcontroller was reset for deep sleep and restarted by an alarm.""" //| //| RESET_PIN: object -//| """The microntroller was reset by a signal on its reset pin. The pin might be connected to a reset button.""" +//| """The microcontroller was reset by a signal on its reset pin. The pin might be connected to a reset button.""" //| //| WATCHDOG: object //| """The microcontroller was reset by its watchdog timer.""" //| //| UNKNOWN: object -//| """The microntroller restarted for an unknown reason.""" +//| """The microcontroller restarted for an unknown reason.""" //| //| RESCUE_DEBUG: object -//| """The microntroller was reset by the rescue debug port.""" +//| """The microcontroller was reset by the rescue debug port.""" //| MAKE_ENUM_MAP(mcu_reset_reason) { MAKE_ENUM_MAP_ENTRY(reset_reason, POWER_ON), diff --git a/shared-bindings/paralleldisplay/ParallelBus.c b/shared-bindings/paralleldisplay/ParallelBus.c index 42b4c788c7..ad9a1efdce 100644 --- a/shared-bindings/paralleldisplay/ParallelBus.c +++ b/shared-bindings/paralleldisplay/ParallelBus.c @@ -39,7 +39,7 @@ //| class ParallelBus: //| """Manage updating a display over 8-bit parallel bus in the background while Python code runs. This -//| protocol may be refered to as 8080-I Series Parallel Interface in datasheets. It doesn't handle +//| protocol may be referred to as 8080-I Series Parallel Interface in datasheets. It doesn't handle //| display initialization.""" //| //| def __init__( diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 81edc48bfd..3510f11289 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -89,7 +89,7 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj, MP_QSTR_pin); // Make object long-lived to avoid moving between imports - pulseio_pulsein_obj_t *self = m_new_ll_obj(pulseio_pulsein_obj_t); + pulseio_pulsein_obj_t *self = m_new_ll_obj_with_finaliser(pulseio_pulsein_obj_t); self->base.type = &pulseio_pulsein_type; common_hal_pulseio_pulsein_construct(self, pin, args[ARG_maxlen].u_int, @@ -277,6 +277,7 @@ STATIC mp_obj_t pulsein_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t va STATIC const mp_rom_map_elem_t pulseio_pulsein_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&pulseio_pulsein_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&pulseio_pulsein_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&pulseio_pulsein___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_pause), MP_ROM_PTR(&pulseio_pulsein_pause_obj) }, diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index fae55db317..6b671194f6 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -42,7 +42,7 @@ //| ) -> None: //| """Create an IncrementalEncoder object associated with the given pins. It tracks the positional //| state of an incremental rotary encoder (also known as a quadrature encoder.) Position is -//| relative to the position when the object is contructed. +//| relative to the position when the object is constructed. //| //| :param ~microcontroller.Pin pin_a: First pin to read pulses from. //| :param ~microcontroller.Pin pin_b: Second pin to read pulses from. @@ -76,7 +76,7 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, const mcu_pin_obj_t *pin_b = validate_obj_is_free_pin(args[ARG_pin_b].u_obj, MP_QSTR_pin_b); // Make long-lived because some implementations use a pointer to the object as interrupt-handler data. - rotaryio_incrementalencoder_obj_t *self = m_new_ll_obj(rotaryio_incrementalencoder_obj_t); + rotaryio_incrementalencoder_obj_t *self = m_new_ll_obj_with_finaliser(rotaryio_incrementalencoder_obj_t); self->base.type = &rotaryio_incrementalencoder_type; common_hal_rotaryio_incrementalencoder_construct(self, pin_a, pin_b); @@ -171,6 +171,7 @@ MP_PROPERTY_GETSET(rotaryio_incrementalencoder_position_obj, STATIC const mp_rom_map_elem_t rotaryio_incrementalencoder_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&rotaryio_incrementalencoder_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&rotaryio_incrementalencoder_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&rotaryio_incrementalencoder___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_position), MP_ROM_PTR(&rotaryio_incrementalencoder_position_obj) }, diff --git a/shared-module/bitmaptools/__init__.c b/shared-module/bitmaptools/__init__.c index 778d0629a7..449815533d 100644 --- a/shared-module/bitmaptools/__init__.c +++ b/shared-module/bitmaptools/__init__.c @@ -784,7 +784,7 @@ void common_hal_bitmaptools_dither(displayio_bitmap_t *dest_bitmap, displayio_bi bitmaptools_dither_algorithm_info_t *info = algorithms[algorithm]; // rowdata holds 3 rows of data. Each one is larger than the input - // bitmap's width, beacuse `mx` extra pixels are allocated at the start and + // bitmap's width, because `mx` extra pixels are allocated at the start and // end of the row so that no conditionals are needed when storing the error data. int16_t rowdata[(width + 2 * info->mx) * 3]; int16_t *rows[3] = { diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index dc82d04e05..c9212f6a85 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -29,6 +29,7 @@ #include #include "py/runtime.h" +#include "py/gc.h" enum { ALIGN_BITS = 8 * sizeof(uint32_t) }; @@ -48,8 +49,10 @@ void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, self->width = width; self->height = height; self->stride = stride(width, bits_per_value); + self->data_alloc = false; if (!data) { data = m_malloc(self->stride * height * sizeof(uint32_t), false); + self->data_alloc = true; } self->data = data; self->read_only = read_only; @@ -79,6 +82,16 @@ void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, self->dirty_area.y2 = height; } +void common_hal_displayio_bitmap_deinit(displayio_bitmap_t *self) { + if (self->data_alloc) { + gc_free(self->data); + } + self->data = NULL; +} + +bool common_hal_displayio_bitmap_deinited(displayio_bitmap_t *self) { + return self->data == NULL; +} uint16_t common_hal_displayio_bitmap_get_height(displayio_bitmap_t *self) { return self->height; @@ -128,6 +141,9 @@ void displayio_bitmap_set_dirty_area(displayio_bitmap_t *self, const displayio_a } void displayio_bitmap_write_pixel(displayio_bitmap_t *self, int16_t x, int16_t y, uint32_t value) { + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only")); + } // Writes the color index value into a pixel position // Must update the dirty area separately @@ -160,6 +176,9 @@ void displayio_bitmap_write_pixel(displayio_bitmap_t *self, int16_t x, int16_t y void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t skip_index, bool skip_index_none) { + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only")); + } // Copy region of "source" bitmap into "self" bitmap at location x,y in the "self" // If skip_value is encountered in the source bitmap, it will not be copied. // If skip_value is `None`, then all pixels are copied. @@ -213,6 +232,9 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16 } void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *self, int16_t x, int16_t y, uint32_t value) { + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only")); + } // update the dirty region displayio_area_t a = {x, y, x + 1, y + 1, NULL}; displayio_bitmap_set_dirty_area(self, &a); @@ -223,7 +245,7 @@ void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *self, int16_t x, } displayio_area_t *displayio_bitmap_get_refresh_areas(displayio_bitmap_t *self, displayio_area_t *tail) { - if (self->dirty_area.x1 == self->dirty_area.x2) { + if (self->dirty_area.x1 == self->dirty_area.x2 || self->read_only) { return tail; } self->dirty_area.next = tail; @@ -231,11 +253,17 @@ displayio_area_t *displayio_bitmap_get_refresh_areas(displayio_bitmap_t *self, d } void displayio_bitmap_finish_refresh(displayio_bitmap_t *self) { + if (self->read_only) { + return; + } self->dirty_area.x1 = 0; self->dirty_area.x2 = 0; } void common_hal_displayio_bitmap_fill(displayio_bitmap_t *self, uint32_t value) { + if (self->read_only) { + mp_raise_RuntimeError(translate("Read-only")); + } displayio_area_t a = {0, 0, self->width, self->height, NULL}; displayio_bitmap_set_dirty_area(self, &a); diff --git a/shared-module/displayio/Bitmap.h b/shared-module/displayio/Bitmap.h index 0373ae80c5..2025e56282 100644 --- a/shared-module/displayio/Bitmap.h +++ b/shared-module/displayio/Bitmap.h @@ -45,6 +45,7 @@ typedef struct { displayio_area_t dirty_area; uint16_t bitmask; bool read_only; + bool data_alloc; // did bitmap allocate data or someone else } displayio_bitmap_t; void displayio_bitmap_finish_refresh(displayio_bitmap_t *self); diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 289fc47a68..74f828aea8 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -60,6 +60,7 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t const mcu_pin_obj_t *busy_pin, bool busy_state, mp_float_t seconds_per_frame, bool chip_select, bool grayscale, bool acep, bool two_byte_sequence_length) { uint16_t color_depth = 1; + bool core_grayscale = true; if (highlight_color != 0x000000) { self->core.colorspace.tricolor = true; self->core.colorspace.tricolor_hue = displayio_colorconverter_compute_hue(highlight_color); @@ -70,9 +71,10 @@ void common_hal_displayio_epaperdisplay_construct(displayio_epaperdisplay_obj_t color_depth = 4; // bits. 7 colors + clean self->acep = acep; grayscale = false; + core_grayscale = false; } - displayio_display_core_construct(&self->core, bus, width, height, ram_width, ram_height, colstart, rowstart, rotation, color_depth, grayscale, true, 1, true, true); + displayio_display_core_construct(&self->core, bus, width, height, ram_width, ram_height, colstart, rowstart, rotation, color_depth, core_grayscale, true, 1, true, true); self->set_column_window_command = set_column_window_command; self->set_row_window_command = set_row_window_command; @@ -340,7 +342,7 @@ STATIC bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t * memset(mask, 0, mask_length * sizeof(mask[0])); memset(buffer, 0, buffer_size * sizeof(buffer[0])); - if (self->grayscale) { + if (!self->acep) { self->core.colorspace.grayscale = true; self->core.colorspace.grayscale_bit = 7; } diff --git a/shared-module/displayio/Palette.c b/shared-module/displayio/Palette.c index a2ddc285fd..c61b9ebc82 100644 --- a/shared-module/displayio/Palette.c +++ b/shared-module/displayio/Palette.c @@ -81,7 +81,13 @@ void displayio_palette_get_color(displayio_palette_t *self, const _displayio_col } // Cache results when not dithering. - if (!self->dither && self->colors[palette_index].cached_colorspace == colorspace) { + _displayio_color_t *color = &self->colors[palette_index]; + // Check the grayscale settings because EPaperDisplay will change them on + // the same object. + if (!self->dither && + color->cached_colorspace == colorspace && + color->cached_colorspace_grayscale_bit == colorspace->grayscale_bit && + color->cached_colorspace_grayscale == colorspace->grayscale) { output_color->pixel = self->colors[palette_index].cached_color; return; } @@ -90,8 +96,10 @@ void displayio_palette_get_color(displayio_palette_t *self, const _displayio_col rgb888_pixel.pixel = self->colors[palette_index].rgb888; displayio_convert_color(colorspace, self->dither, &rgb888_pixel, output_color); if (!self->dither) { - self->colors[palette_index].cached_colorspace = colorspace; - self->colors[palette_index].cached_color = output_color->pixel; + color->cached_colorspace = colorspace; + color->cached_color = output_color->pixel; + color->cached_colorspace_grayscale = colorspace->grayscale; + color->cached_colorspace_grayscale_bit = colorspace->grayscale_bit; } } diff --git a/shared-module/displayio/Palette.h b/shared-module/displayio/Palette.h index e9b449c4e7..050423d052 100644 --- a/shared-module/displayio/Palette.h +++ b/shared-module/displayio/Palette.h @@ -51,6 +51,8 @@ typedef struct { uint32_t rgb888; const _displayio_colorspace_t *cached_colorspace; uint32_t cached_color; + uint8_t cached_colorspace_grayscale_bit; + bool cached_colorspace_grayscale; bool transparent; // This may have additional bits added later for blending. } _displayio_color_t; diff --git a/shared-module/gifio/OnDiskGif.c b/shared-module/gifio/OnDiskGif.c index 234b7f8198..aeb4f7bb74 100644 --- a/shared-module/gifio/OnDiskGif.c +++ b/shared-module/gifio/OnDiskGif.c @@ -32,6 +32,7 @@ #include "py/mperrno.h" #include "py/runtime.h" + static int32_t GIFReadFile(GIFFILE *pFile, uint8_t *pBuf, int32_t iLen) { // mp_printf(&mp_plat_print, "GifReadFile len %d ", iLen); uint32_t iBytesRead; @@ -153,8 +154,16 @@ void common_hal_gifio_ondiskgif_construct(gifio_ondiskgif_t *self, pyb_file_obj_ self->frame_count = info.iFrameCount; self->min_delay = info.iMinDelay; self->max_delay = info.iMaxDelay; +} - // mp_printf(&mp_plat_print, "GIF_init returned %d %x\n", result, bitmap->data); +void common_hal_gifio_ondiskgif_deinit(gifio_ondiskgif_t *self) { + self->file = NULL; + common_hal_displayio_bitmap_deinit(self->bitmap); + self->bitmap = NULL; +} + +bool common_hal_gifio_ondiskgif_deinited(gifio_ondiskgif_t *self) { + return self->bitmap == NULL; } uint16_t common_hal_gifio_ondiskgif_get_height(gifio_ondiskgif_t *self) { diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index d32550722c..3a34731d77 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -102,6 +102,16 @@ STATIC uint32_t read4(msgpack_stream_t *s) { return res; } +STATIC uint64_t read8(msgpack_stream_t *s) { + uint64_t res = 0; + read(s, &res, 8); + int n = 1; + if (*(char *)&n == 1) { + res = __builtin_bswap64(res); + } + return res; +} + STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { size_t res = 0; switch (len_index) { @@ -207,7 +217,7 @@ STATIC void pack_bin(msgpack_stream_t *s, const uint8_t *data, size_t len) { } } -STATIC void pack_ext(msgpack_stream_t *s, int8_t code, const uint8_t *data, size_t len) { +STATIC void pack_ext(msgpack_stream_t *s, int8_t code, const uint8_t *data, size_t len) { if (len == 1) { write1(s, 0xd4); } else if (len == 2) { @@ -424,22 +434,39 @@ STATIC mp_obj_t unpack(msgpack_stream_t *s, mp_obj_t ext_hook, bool use_list) { return unpack_bytes(s, read_size(s, code - 0xc4)); } case 0xcc: // uint8 + return MP_OBJ_NEW_SMALL_INT((uint8_t)read1(s)); case 0xd0: // int8 return MP_OBJ_NEW_SMALL_INT((int8_t)read1(s)); case 0xcd: // uint16 + return MP_OBJ_NEW_SMALL_INT((uint16_t)read2(s)); case 0xd1: // int16 return MP_OBJ_NEW_SMALL_INT((int16_t)read2(s)); case 0xce: // uint32 + return mp_obj_new_int_from_uint((uint32_t)read4(s)); case 0xd2: // int32 - return MP_OBJ_NEW_SMALL_INT((int32_t)read4(s)); - case 0xca: { - union Float { mp_float_t f; - uint32_t u; + return mp_obj_new_int((int32_t)read4(s)); + case 0xcf: // uint 64 + return mp_obj_new_int_from_ull((uint64_t)read8(s)); + case 0xd3: // int 64 + return mp_obj_new_int_from_ll((int64_t)read8(s)); + case 0xca: { // float + union Float { + mp_float_t f; + uint32_t u; }; union Float data; data.u = read4(s); return mp_obj_new_float(data.f); } + case 0xcb: { // double + union Double { + uint64_t u; + double d; + }; + union Double data; + data.u = read8(s); + return mp_obj_new_float_from_d(data.d); + } case 0xd9: case 0xda: case 0xdb: { @@ -483,11 +510,8 @@ STATIC mp_obj_t unpack(msgpack_stream_t *s, mp_obj_t ext_hook, bool use_list) { // ext 8, 16, 32 return unpack_ext(s, read_size(s, code - 0xc7), ext_hook); case 0xc1: // never used - case 0xcb: // float 64 - case 0xcf: // uint 64 - case 0xd3: // int 64 default: - mp_raise_NotImplementedError(translate("64 bit types")); + mp_raise_ValueError(translate("Invalid format")); } } diff --git a/shared-module/os/getenv.c b/shared-module/os/getenv.c index 870973c5d2..76cbf48dae 100644 --- a/shared-module/os/getenv.c +++ b/shared-module/os/getenv.c @@ -72,7 +72,7 @@ STATIC void close_file(file_arg *active_file) { // nothing } STATIC bool is_eof(file_arg *active_file) { - return f_eof(active_file); + return f_eof(active_file) || f_error(active_file); } // Return 0 if there is no next character (EOF). diff --git a/shared-module/struct/__init__.c b/shared-module/struct/__init__.c index b595504969..11e122915c 100644 --- a/shared-module/struct/__init__.c +++ b/shared-module/struct/__init__.c @@ -167,7 +167,7 @@ void shared_modules_struct_pack_into(mp_obj_t fmt_in, byte *p, byte *end_p, size } fmt++; } - (void)mp_arg_validate_length(n_args, i, MP_QSTR_args); + (void)mp_arg_validate_length(n_args, i, MP_QSTR_values); } mp_obj_tuple_t *shared_modules_struct_unpack_from(mp_obj_t fmt_in, byte *p, byte *end_p, bool exact_size) { diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index 680bb83893..6f530bfef8 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -293,24 +293,40 @@ uint16_t tud_hid_get_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t // Callback invoked when we receive Set_Report request through control endpoint void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t const *buffer, uint16_t bufsize) { (void)itf; - if (report_type == HID_REPORT_TYPE_INVALID) { - report_id = buffer[0]; - buffer++; - bufsize--; + + usb_hid_device_obj_t *hid_device = NULL; + size_t id_idx; + + if (report_id == 0 && report_type == HID_REPORT_TYPE_INVALID) { + // This could be a report with a non-zero report ID in the first byte, or + // it could be for report ID 0. + // Heuristic: see if there's a device with report ID 0, and if its report length matches + // the size of the incoming buffer. In that case, assume the first byte is not the report ID, + // but is data. Otherwise use the first byte as the report id. + if (usb_hid_get_device_with_report_id(0, &hid_device, &id_idx) && + hid_device && + hid_device->out_report_buffers[id_idx] && + hid_device->out_report_lengths[id_idx] == bufsize) { + // Use as is, with report_id 0. + } else { + // No matching report ID 0, so use the first byte as the report ID. + report_id = buffer[0]; + buffer++; + bufsize--; + } } else if (report_type != HID_REPORT_TYPE_OUTPUT && report_type != HID_REPORT_TYPE_FEATURE) { return; } - usb_hid_device_obj_t *hid_device; - size_t id_idx; - // Find device with this report id, and get the report id index. - if (usb_hid_get_device_with_report_id(report_id, &hid_device, &id_idx)) { + // report_id might be changed due to parsing above, so test again. + if ((report_id == 0 && report_type == HID_REPORT_TYPE_INVALID) || + // Fetch the matching device if we don't already have the report_id 0 device. + (usb_hid_get_device_with_report_id(report_id, &hid_device, &id_idx) && + hid_device && + hid_device->out_report_buffers[id_idx] && + hid_device->out_report_lengths[id_idx] == bufsize)) { // If a report of the correct size has been read, save it in the proper OUT report buffer. - if (hid_device && - hid_device->out_report_buffers[id_idx] && - hid_device->out_report_lengths[id_idx] >= bufsize) { - memcpy(hid_device->out_report_buffers[id_idx], buffer, bufsize); - hid_device->out_report_buffers_updated[id_idx] = true; - } + memcpy(hid_device->out_report_buffers[id_idx], buffer, bufsize); + hid_device->out_report_buffers_updated[id_idx] = true; } } diff --git a/shared/netutils/dhcpserver.c b/shared/netutils/dhcpserver.c index d396a2ba56..3f90a06e46 100644 --- a/shared/netutils/dhcpserver.c +++ b/shared/netutils/dhcpserver.c @@ -277,8 +277,8 @@ static void dhcp_server_process(void *arg, struct udp_pcb *upcb, struct pbuf *p, opt_write_n(&opt, DHCP_OPT_SERVER_ID, 4, &d->ip.addr); opt_write_n(&opt, DHCP_OPT_SUBNET_MASK, 4, &d->nm.addr); - opt_write_n(&opt, DHCP_OPT_ROUTER, 4, &d->ip.addr); // aka gateway; can have mulitple addresses - opt_write_u32(&opt, DHCP_OPT_DNS, DEFAULT_DNS); // can have mulitple addresses + opt_write_n(&opt, DHCP_OPT_ROUTER, 4, &d->ip.addr); // aka gateway; can have multiple addresses + opt_write_u32(&opt, DHCP_OPT_DNS, DEFAULT_DNS); // can have multiple addresses opt_write_u32(&opt, DHCP_OPT_IP_LEASE_TIME, DEFAULT_LEASE_TIME_S); *opt++ = DHCP_OPT_END; dhcp_socket_sendto(&d->udp, &dhcp_msg, opt - (uint8_t *)&dhcp_msg, 0xffffffff, PORT_DHCP_CLIENT); diff --git a/shared/runtime/pyexec.c b/shared/runtime/pyexec.c index 87219d18f5..aeb92f59d3 100644 --- a/shared/runtime/pyexec.c +++ b/shared/runtime/pyexec.c @@ -643,7 +643,7 @@ friendly_repl_reset: // If the user gets to here and interrupts are disabled then // they'll never see the prompt, traceback etc. The USB REPL needs // interrupts to be enabled or no transfers occur. So we try to - // do the user a favor and reenable interrupts. + // do the user a favor and re-enable interrupts. if (query_irq() == IRQ_STATE_DISABLED) { enable_irq(IRQ_STATE_ENABLED); mp_hal_stdout_tx_str("MPY: enabling IRQs\r\n"); diff --git a/supervisor/port.h b/supervisor/port.h index 70bdcb0170..b50179e4de 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -128,4 +128,8 @@ void port_post_boot_py(bool heap_valid); // A default weak implementation is provided that does nothing. void port_boot_info(void); +// Some ports want to mark additional pointers as gc roots. +// A default weak implementation is provided that does nothing. +void port_gc_collect(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_PORT_H diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 141ad7e5f8..f72518ac50 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -97,7 +97,7 @@ static bool write_flash(uint32_t address, const uint8_t *data, uint32_t data_len if (flash_device == NULL) { return false; } - // Don't bother writing if the data is all 1s. Thats equivalent to the flash + // Don't bother writing if the data is all 1s. That's equivalent to the flash // state after an erase. if (!flash_device->no_erase_cmd) { // Only do this if the device has an erase command diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index d3a31de71a..0ab97fc9a9 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -117,7 +117,7 @@ safe_mode_t wait_for_safe_mode_reset(void) { if (boot_in_safe_mode) { return SAFE_MODE_USER; } - // Restore the original state of the saved word if no reset occured during our wait period. + // Restore the original state of the saved word if no reset occurred during our wait period. port_set_saved_word(reset_state); return SAFE_MODE_NONE; } diff --git a/supervisor/shared/translate/compressed_string.h b/supervisor/shared/translate/compressed_string.h index e331a5866f..f524010db5 100644 --- a/supervisor/shared/translate/compressed_string.h +++ b/supervisor/shared/translate/compressed_string.h @@ -62,7 +62,7 @@ // // The "data" / "tail" construct is so that the struct's last member is a // "flexible array". However, the _only_ member is not permitted to be -// a flexible member, so we have to declare the first byte as a separte +// a flexible member, so we have to declare the first byte as a separate // member of the structure. // // For translations where length needs 8 bits, this saves about 1.5 diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c index 2caacbd39b..75ab78bf03 100644 --- a/supervisor/shared/web_workflow/web_workflow.c +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -261,6 +261,7 @@ void supervisor_start_web_workflow(void) { const mcu_reset_reason_t reset_reason = common_hal_mcu_processor_get_reset_reason(); if (reset_reason != RESET_REASON_POWER_ON && reset_reason != RESET_REASON_RESET_PIN && + reset_reason != RESET_REASON_DEEP_SLEEP_ALARM && reset_reason != RESET_REASON_UNKNOWN && reset_reason != RESET_REASON_SOFTWARE) { return; diff --git a/tests/basics/annotate_var.py b/tests/basics/annotate_var.py index 3f767e4a73..a359b229b1 100644 --- a/tests/basics/annotate_var.py +++ b/tests/basics/annotate_var.py @@ -1,4 +1,4 @@ -# test PEP 526, varible annotations +# test PEP 526, variable annotations x: int print("x" in globals()) diff --git a/tests/basics/int_big1.py b/tests/basics/int_big1.py index 40d16c455b..f6e4b61d1d 100644 --- a/tests/basics/int_big1.py +++ b/tests/basics/int_big1.py @@ -1,4 +1,4 @@ -# to test arbitrariy precision integers +# to test arbitrary precision integers x = 1000000000000000000000000000000 xn = -1000000000000000000000000000000 diff --git a/tests/basics/struct1.py b/tests/basics/struct1.py index ec29ea9080..2ac900bbc7 100644 --- a/tests/basics/struct1.py +++ b/tests/basics/struct1.py @@ -79,7 +79,7 @@ try: except: print("Unknown type") -# Initially repitition counters were supported only for strings, +# Initially repetition counters were supported only for strings, # but later were implemented for all. print(struct.unpack("<3B2h", b"foo\x12\x34\xff\xff")) print(struct.pack("<3B", 1, 2, 3)) diff --git a/tests/basics/with_return.py b/tests/basics/with_return.py index fd848f1331..af65a5b984 100644 --- a/tests/basics/with_return.py +++ b/tests/basics/with_return.py @@ -30,7 +30,7 @@ def f(): return (i, j) print(f()) -# multiple for loops within nested withs +# multiple for loops within nested with statements def f(): with CtxMgr(1): for i in [1, 2]: @@ -41,7 +41,7 @@ def f(): return (i, j, k, l) print(f()) -# multiple for loops that are optimised, and nested withs +# multiple for loops that are optimised, and nested with statements def f(): with CtxMgr(1): for i in range(1, 3): diff --git a/tests/cpydiff/core_fstring_repr.py b/tests/cpydiff/core_fstring_repr.py index fcadcbf1b9..df80abf795 100644 --- a/tests/cpydiff/core_fstring_repr.py +++ b/tests/cpydiff/core_fstring_repr.py @@ -2,7 +2,7 @@ categories: Core description: f-strings don't support the !r, !s, and !a conversions cause: MicroPython is optimised for code space. -workaround: Use repr(), str(), and ascii() explictly. +workaround: Use repr(), str(), and ascii() explicitly. """ diff --git a/tests/cpydiff/core_import_path.py b/tests/cpydiff/core_import_path.py index 04fc4bd5bb..959fd571f5 100644 --- a/tests/cpydiff/core_import_path.py +++ b/tests/cpydiff/core_import_path.py @@ -1,7 +1,7 @@ """ categories: Core,import description: __path__ attribute of a package has a different type (single string instead of list of strings) in MicroPython -cause: MicroPython does't support namespace packages split across filesystem. Beyond that, MicroPython's import system is highly optimized for minimal memory usage. +cause: MicroPython doesn't support namespace packages split across filesystem. Beyond that, MicroPython's import system is highly optimized for minimal memory usage. workaround: Details of import handling is inherently implementation dependent. Don't rely on such details in portable applications. """ import modules diff --git a/tests/cpydiff/core_import_split_ns_pkgs.py b/tests/cpydiff/core_import_split_ns_pkgs.py index 62bf337a22..5c92b63124 100644 --- a/tests/cpydiff/core_import_split_ns_pkgs.py +++ b/tests/cpydiff/core_import_split_ns_pkgs.py @@ -1,6 +1,6 @@ """ categories: Core,import -description: MicroPython does't support namespace packages split across filesystem. +description: MicroPython doesn't support namespace packages split across filesystem. cause: MicroPython's import system is highly optimized for simplicity, minimal memory usage, and minimal filesystem search overhead. workaround: Don't install modules belonging to the same namespace package in different directories. For MicroPython, it's recommended to have at most 3-component module search paths: for your current application, per-user (writable), system-wide (non-writable). """ diff --git a/tests/extmod/framebuf_palette.py b/tests/extmod/framebuf_palette.py index 84db834c15..f5b15fda73 100644 --- a/tests/extmod/framebuf_palette.py +++ b/tests/extmod/framebuf_palette.py @@ -30,6 +30,6 @@ fbd.blit(fbc, 0, 0, -1, palette) print(fbd.pixel(0, 0) == fg) print(fbd.pixel(7, 7) == fg) -print(fbd.pixel(8, 8) == 0) # Ouside blit +print(fbd.pixel(8, 8) == 0) # Outside blit print(fbd.pixel(0, 1) == bg) print(fbd.pixel(1, 0) == bg) diff --git a/tests/extmod/uctypes_sizeof_layout.py b/tests/extmod/uctypes_sizeof_layout.py index 2108e81502..c710ecde95 100644 --- a/tests/extmod/uctypes_sizeof_layout.py +++ b/tests/extmod/uctypes_sizeof_layout.py @@ -13,7 +13,7 @@ desc = { # uctypes.NATIVE is default print(uctypes.sizeof(desc) == uctypes.sizeof(desc, uctypes.NATIVE)) -# Here we assume that that we run on a platform with convential ABI +# Here we assume that that we run on a platform with conventional ABI # (which rounds up structure size based on max alignment). For platforms # where that doesn't hold, this tests should be just disabled in the runner. print(uctypes.sizeof(desc, uctypes.NATIVE) > uctypes.sizeof(desc, uctypes.LITTLE_ENDIAN)) diff --git a/tests/extmod/utimeq1.py b/tests/extmod/utimeq1.py index ddbc969afb..688e5b834f 100644 --- a/tests/extmod/utimeq1.py +++ b/tests/extmod/utimeq1.py @@ -125,7 +125,7 @@ assert edge_case(MODULO_HALF - 1, -100) == diff # We expect diff to be always positive, per the definition of heappop() which should return # the smallest value. -# This is the edge case where this invariant breaks, due to assymetry of two's-complement +# This is the edge case where this invariant breaks, due to asymmetry of two's-complement # range - there's one more negative integer than positive, so heappushing values like below # will then make ticks_diff() return the minimum negative value. We could make heappop # return them in a different order, but ticks_diff() result would be the same. Conclusion: diff --git a/tests/feature_check/README b/tests/feature_check/README index 3b7b6cba41..0f55e7ece4 100644 --- a/tests/feature_check/README +++ b/tests/feature_check/README @@ -1,4 +1,4 @@ This directory doesn't contain real tests, but code snippets to detect -various interpreter features, which can't be/inconvenient to detecte by +various interpreter features, which can't be/inconvenient to detected by other means. Scripts here are executed by run-tests.py at the beginning of testsuite to decide what other test groups to run/exclude. diff --git a/tests/misc/non_compliant.py b/tests/misc/non_compliant.py index 1c3706ec33..ecd4f10391 100644 --- a/tests/misc/non_compliant.py +++ b/tests/misc/non_compliant.py @@ -39,7 +39,7 @@ try: except NotImplementedError: print("NotImplementedError") -# uPy raises TypeError, shold be ValueError +# uPy raises TypeError, should be ValueError try: "%c" % b"\x01\x02" except (TypeError, ValueError): diff --git a/tests/thread/thread_lock1.py b/tests/thread/thread_lock1.py index e7066402ca..f49f57ce83 100644 --- a/tests/thread/thread_lock1.py +++ b/tests/thread/thread_lock1.py @@ -32,7 +32,7 @@ print(lock.locked()) with lock: print(lock.locked()) -# test that lock is unlocked if an error is rasied +# test that lock is unlocked if an error is raised try: with lock: print(lock.locked()) diff --git a/tools/analyze_heap_dump.py b/tools/analyze_heap_dump.py index d9b3dda599..ede990929d 100755 --- a/tools/analyze_heap_dump.py +++ b/tools/analyze_heap_dump.py @@ -446,7 +446,7 @@ def do_all_the_things( current_allocation = 1 elif block_state == AT_TAIL and current_allocation > 0: # In gc_free the logging happens before the tail is freed. So checking - # current_allocation > 0 ensures we only extend an allocation thats started. + # current_allocation > 0 ensures we only extend an allocation that's started. current_allocation += 1 longest_free = max(longest_free, current_free) # if current_free > 0: diff --git a/tools/gendoc.py b/tools/gendoc.py index f3df853e49..e7eb011b7c 100644 --- a/tools/gendoc.py +++ b/tools/gendoc.py @@ -523,7 +523,7 @@ def main(): description="Generate documentation for pyboard API from C files." ) cmd_parser.add_argument( - "--outdir", metavar="", default="gendoc-out", help="ouput directory" + "--outdir", metavar="", default="gendoc-out", help="output directory" ) cmd_parser.add_argument("--format", default="html", help="output format: html or rst") cmd_parser.add_argument("files", nargs="+", help="input files") diff --git a/tools/makemanifest.py b/tools/makemanifest.py index 8cdc3eb774..b2856889b9 100644 --- a/tools/makemanifest.py +++ b/tools/makemanifest.py @@ -164,7 +164,7 @@ def system(cmd): def convert_path(path): - # Perform variable substituion. + # Perform variable substitution. for name, value in VARS.items(): path = path.replace("$({})".format(name), value) # Convert to absolute path (so that future operations don't rely on diff --git a/tools/preprocess_frozen_modules.py b/tools/preprocess_frozen_modules.py index 6c41c4cd43..eb835961f6 100755 --- a/tools/preprocess_frozen_modules.py +++ b/tools/preprocess_frozen_modules.py @@ -21,10 +21,10 @@ def version_string(path=None, *, valid_semver=False): version = tag.strip().decode("utf-8", "strict") except subprocess.CalledProcessError: describe = subprocess.check_output("git describe --tags", shell=True, cwd=path) - tag, additional_commits, commitish = ( + tag, additional_commits, commit_ish = ( describe.strip().decode("utf-8", "strict").rsplit("-", maxsplit=2) ) - commitish = commitish[1:] + commit_ish = commit_ish[1:] if valid_semver: version_info = semver.parse_version_info(tag) if not version_info.prerelease: @@ -33,12 +33,12 @@ def version_string(path=None, *, valid_semver=False): + "-alpha.0.plus." + additional_commits + "+" - + commitish + + commit_ish ) else: - version = tag + ".plus." + additional_commits + "+" + commitish + version = tag + ".plus." + additional_commits + "+" + commit_ish else: - version = commitish + version = commit_ish return version diff --git a/tools/pydfu.py b/tools/pydfu.py index ce34b08a58..57a8708e5d 100755 --- a/tools/pydfu.py +++ b/tools/pydfu.py @@ -483,7 +483,7 @@ def get_memory_layout(device): def list_dfu_devices(*args, **kwargs): - """Prints a lits of devices detected in DFU mode.""" + """Prints a list of devices detected in DFU mode.""" devices = get_dfu_devices(*args, **kwargs) if not devices: raise SystemExit("No DFU capable devices found") diff --git a/tools/uncrustify.cfg b/tools/uncrustify.cfg index 88127112e8..a92530fd93 100644 --- a/tools/uncrustify.cfg +++ b/tools/uncrustify.cfg @@ -1323,7 +1323,7 @@ indent_using_block = true # true/false # 2: When the `:` is a continuation, indent it under `?` indent_ternary_operator = 0 # unsigned number -# Whether to indent the statments inside ternary operator. +# Whether to indent the statements inside ternary operator. indent_inside_ternary_operator = false # true/false # If true, the indentation of the chunks after a `return` sequence will be set at return indentation column. @@ -1779,7 +1779,7 @@ nl_func_call_args_multi_line = false # true/false # different lines. nl_func_call_end_multi_line = false # true/false -# Whether to respect nl_func_call_XXX option incase of closure args. +# Whether to respect nl_func_call_XXX option in case of closure args. nl_func_call_args_multi_line_ignore_closures = false # true/false # Whether to add a newline after '<' of a template parameter list. @@ -2570,7 +2570,7 @@ align_oc_decl_colon = false # true/false # (OC) Whether to not align parameters in an Objectve-C message call if first # colon is not on next line of the message call (the same way Xcode does -# aligment) +# alignment) align_oc_msg_colon_xcode_like = false # true/false # @@ -2916,28 +2916,28 @@ pp_define_at_level = false # true/false pp_ignore_define_body = false # true/false # Whether to indent case statements between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the case statements +# Only applies to the indent of the preprocessor that the case statements # directly inside of. # # Default: true pp_indent_case = true # true/false # Whether to indent whole function definitions between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the function definition +# Only applies to the indent of the preprocessor that the function definition # is directly inside of. # # Default: true pp_indent_func_def = true # true/false # Whether to indent extern C blocks between #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the extern block is +# Only applies to the indent of the preprocessor that the extern block is # directly inside of. # # Default: true pp_indent_extern = true # true/false # Whether to indent braces directly inside #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the braces are directly +# Only applies to the indent of the preprocessor that the braces are directly # inside of. # # Default: true diff --git a/tools/verifygitlog.py b/tools/verifygitlog.py index cc4b80f4a9..24171f9c68 100755 --- a/tools/verifygitlog.py +++ b/tools/verifygitlog.py @@ -101,7 +101,7 @@ def run(args): def show_help(): print("usage: verifygitlog.py [-v -n -h] ...") - print("-v : increase verbosity, can be speficied multiple times") + print("-v : increase verbosity, can be specified multiple times") print("-n : do not print multi-line suggestions") print("-h : print this help message and exit") print("... : arguments passed to git log to retrieve commits to verify")