diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f260117ad..84224a1c1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -143,7 +143,7 @@ jobs: mpy-cross-mac: - runs-on: macos-10.15 + runs-on: macos-11 steps: - name: Dump GitHub context env: @@ -176,27 +176,25 @@ jobs: run: make -C mpy-cross -j2 - uses: actions/upload-artifact@v2 with: - name: mpy-cross-macos-catalina + name: mpy-cross-macos-11-x64 path: mpy-cross/mpy-cross - - name: Select SDK for M1 build - run: sudo xcode-select -switch /Applications/Xcode_12.3.app - name: Build mpy-cross (arm64) run: make -C mpy-cross -j2 -f Makefile.m1 V=2 - uses: actions/upload-artifact@v2 with: - name: mpy-cross-macos-bigsur-arm64 + name: mpy-cross-macos-11-arm64 path: mpy-cross/mpy-cross-arm64 - name: Make universal binary run: lipo -create -output mpy-cross-macos-universal mpy-cross/mpy-cross mpy-cross/mpy-cross-arm64 - uses: actions/upload-artifact@v2 with: - name: mpy-cross-macos-universal + name: mpy-cross-macos-11-universal path: mpy-cross-macos-universal - name: Upload mpy-cross build to S3 run: | - [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross-macos-universal s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-universal-${{ env.CP_VERSION }} --no-progress --region us-east-1 - [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross-arm64 s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-bigsur-${{ env.CP_VERSION }}-arm64 --no-progress --region us-east-1 - [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-catalina-${{ env.CP_VERSION }} --no-progress --region us-east-1 + [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross-macos-universal s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-11-${{ env.CP_VERSION }}-universal --no-progress --region us-east-1 + [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross-arm64 s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-11-${{ env.CP_VERSION }}-arm64 --no-progress --region us-east-1 + [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-11-${{ env.CP_VERSION }}-x64 --no-progress --region us-east-1 env: AWS_PAGER: '' AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -287,12 +285,13 @@ jobs: fetch-depth: 1 - name: Get CP deps run: python tools/ci_fetch_deps.py ${{ matrix.board }} ${{ github.sha }} + - uses: carlosperate/arm-none-eabi-gcc-action@v1 + with: + release: '10-2020-q4' - name: Install dependencies run: | sudo apt-get install -y gettext pip install -r requirements-ci.txt -r requirements-dev.txt - wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 - sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 - name: Versions run: | gcc --version @@ -382,7 +381,8 @@ jobs: if: ${{ needs.test.outputs.boards-espressif != '[]' }} steps: - name: Set up Python 3 - uses: actions/setup-python@v2 + id: py3 + uses: actions/setup-python@v4 with: python-version: "3.x" - uses: actions/checkout@v2.2.0 @@ -400,7 +400,7 @@ jobs: id: idf-cache with: path: ${{ github.workspace }}/.idf_tools - key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20220404 + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-${{ steps.py3.outputs.python-path }}-20220404 - name: Clone IDF submodules run: | (cd $IDF_PATH && git submodule update --init) @@ -486,8 +486,9 @@ jobs: pip install -r requirements-ci.txt -r requirements-dev.txt wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz sudo tar -C /usr --strip-components=1 -xaf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz - wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 - sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 + - uses: carlosperate/arm-none-eabi-gcc-action@v1 + with: + release: '10-2020-q4' - name: Install mkfs.fat run: | wget https://github.com/dosfstools/dosfstools/releases/download/v4.2/dosfstools-4.2.tar.gz diff --git a/.github/workflows/create_website_pr.yml b/.github/workflows/create_website_pr.yml index 2f171fe054..2367b6c475 100644 --- a/.github/workflows/create_website_pr.yml +++ b/.github/workflows/create_website_pr.yml @@ -42,5 +42,5 @@ jobs: working-directory: tools env: RELEASE_TAG: ${{ github.event.release.tag_name }} - ADABOT_GITHUB_ACCESS_TOKEN: ${{ secrets.BLINKA_GITHUB_ACCESS_TOKEN }} + ADABOT_GITHUB_ACCESS_TOKEN: ${{ secrets.ADABOT_GITHUB_ACCESS_TOKEN }} if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested') diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 52e2d2b714..28f8ccb6f1 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -14,7 +14,7 @@ concurrency: jobs: pre-commit: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2.2.0 - name: Set up Python 3 @@ -23,7 +23,6 @@ jobs: python-version: "3.x" - name: Install deps run: | - sudo apt-add-repository -y -u ppa:pybricks/ppa sudo apt-get install -y gettext uncrustify pip3 install black polib pyyaml - name: Populate selected submodules diff --git a/.gitmodules b/.gitmodules index 4d67837a2d..e0d0a262ca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -145,8 +145,8 @@ url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git [submodule "ports/espressif/esp-idf"] path = ports/espressif/esp-idf - url = https://github.com/espressif/esp-idf.git - branch = release/v4.4 + url = https://github.com/adafruit/esp-idf.git + branch = circuitpython8 [submodule "ports/espressif/certificates/nina-fw"] path = ports/espressif/certificates/nina-fw url = https://github.com/adafruit/nina-fw.git @@ -196,6 +196,9 @@ url = https://github.com/raspberrypi/rpi-firmware.git branch = master shallow = true +[submodule "lib/adafruit_floppy"] + path = lib/adafruit_floppy + url = https://github.com/adafruit/Adafruit_Floppy [submodule "ports/stm/st_driver/cmsis_device_f4"] path = ports/stm/st_driver/cmsis_device_f4 url = https://github.com/STMicroelectronics/cmsis_device_f4.git @@ -283,3 +286,27 @@ [submodule "frozen/Adafruit_CircuitPython_FakeRequests"] path = frozen/Adafruit_CircuitPython_FakeRequests url = https://github.com/adafruit/Adafruit_CircuitPython_FakeRequests.git +[submodule "frozen/pew-pewpew-lcd"] + path = frozen/pew-pewpew-lcd + url = https://github.com/pypewpew/pew-pewpew-lcd.git +[submodule "frozen/mixgo_cp_lib"] + path = frozen/mixgo_cp_lib + url = https://github.com/dahanzimin/circuitpython_lib.git +[submodule "frozen/Adafruit_CircuitPython_IS31FL3731"] + path = frozen/Adafruit_CircuitPython_IS31FL3731 + url = https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731.git +[submodule "frozen/Adafruit_CircuitPython_Ticks"] + path = frozen/Adafruit_CircuitPython_Ticks + url = https://github.com/adafruit/Adafruit_CircuitPython_Ticks.git +[submodule "frozen/Adafruit_CircuitPython_asyncio"] + path = frozen/Adafruit_CircuitPython_asyncio + url = https://github.com/adafruit/Adafruit_CircuitPython_asyncio.git +[submodule "frozen/circuitpython_ef_music"] + path = frozen/circuitpython_ef_music + url = https://github.com/elecfreaks/circuitpython_ef_music.git +[submodule "frozen/circuitpython_picoed"] + path = frozen/circuitpython_picoed + url = https://github.com/elecfreaks/circuitpython_picoed.git +[submodule "ports/espressif/esp32-camera"] + path = ports/espressif/esp32-camera + url = https://github.com/adafruit/esp32-camera/ diff --git a/.readthedocs.yml b/.readthedocs.yml index 9743a70494..94ba8750b0 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,16 +9,15 @@ version: 2 build: - os: ubuntu-20.04 - tools: - python: "3" - -submodules: - include: - - extmod/ulab + os: ubuntu-20.04 + tools: + python: "3" + jobs: + post_install: + - python tools/ci_fetch_deps.py docs HEAD formats: - - pdf + - pdf python: install: diff --git a/BUILDING.md b/BUILDING.md index fc7b116595..37800e689f 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -70,7 +70,7 @@ The test suite in the top level `tests` directory. It needs the unix port to ru Then you can run the test suite: cd ../../tests - ./run-tests + ./run-tests.py A successful run will say something like diff --git a/LICENSE b/LICENSE index 2b9a64b89a..5b8797814f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2013-2022 Damien P. George +Copyright (c) 2013-2022 Damien P. George and others Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9,77 +9,13 @@ 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 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. - --------------------------------------------------------------------------------- - -Unless specified otherwise (see below), the above license and copyright applies -to all files in this repository. - -Individual files may include additional copyright holders. - -The various ports of MicroPython may include third-party software that is -licensed under different terms. These licenses are summarised in the tree -below, please refer to these files and directories for further license and -copyright information. Note that (L)GPL-licensed code listed below is only -used during the build process and is not part of the compiled source code. - -/ (MIT) - /drivers - /cc3000 (BSD-3-clause) - /cc3100 (BSD-3-clause) - /wiznet5k (BSD-3-clause) - /lib - /asf4 (Apache-2.0) - /axtls (BSD-3-clause) - /config - /scripts - /config (GPL-2.0-or-later) - /Rules.mak (GPL-2.0) - /berkeley-db-1xx (BSD-4-clause) - /btstack (See btstack/LICENSE) - /cmsis (BSD-3-clause) - /crypto-algorithms (NONE) - /libhydrogen (ISC) - /littlefs (BSD-3-clause) - /lwip (BSD-3-clause) - /mynewt-nimble (Apache-2.0) - /nrfx (BSD-3-clause) - /nxp_driver (BSD-3-Clause) - /oofatfs (BSD-1-clause) - /pico-sdk (BSD-3-clause) - /re15 (BSD-3-clause) - /stm32lib (BSD-3-clause) - /tinytest (BSD-3-clause) - /tinyusb (MIT) - /uzlib (Zlib) - /logo (uses OFL-1.1) - /ports - /cc3200 - /hal (BSD-3-clause) - /simplelink (BSD-3-clause) - /FreeRTOS (GPL-2.0 with FreeRTOS exception) - /stm32 - /usbd*.c (MCD-ST Liberty SW License Agreement V2) - /stm32_it.* (MIT + BSD-3-clause) - /system_stm32*.c (MIT + BSD-3-clause) - /boards - /startup_stm32*.s (BSD-3-clause) - /*/stm32*.h (BSD-3-clause) - /usbdev (MCD-ST Liberty SW License Agreement V2) - /usbhost (MCD-ST Liberty SW License Agreement V2) - /teensy - /core (PJRC.COM) - /zephyr - /src (Apache-2.0) - /tools - /dfu.py (LGPL-3.0-only) +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/LICENSE_MicroPython b/LICENSE_MicroPython new file mode 100644 index 0000000000..2b9a64b89a --- /dev/null +++ b/LICENSE_MicroPython @@ -0,0 +1,85 @@ +The MIT License (MIT) + +Copyright (c) 2013-2022 Damien P. George + +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. + +-------------------------------------------------------------------------------- + +Unless specified otherwise (see below), the above license and copyright applies +to all files in this repository. + +Individual files may include additional copyright holders. + +The various ports of MicroPython may include third-party software that is +licensed under different terms. These licenses are summarised in the tree +below, please refer to these files and directories for further license and +copyright information. Note that (L)GPL-licensed code listed below is only +used during the build process and is not part of the compiled source code. + +/ (MIT) + /drivers + /cc3000 (BSD-3-clause) + /cc3100 (BSD-3-clause) + /wiznet5k (BSD-3-clause) + /lib + /asf4 (Apache-2.0) + /axtls (BSD-3-clause) + /config + /scripts + /config (GPL-2.0-or-later) + /Rules.mak (GPL-2.0) + /berkeley-db-1xx (BSD-4-clause) + /btstack (See btstack/LICENSE) + /cmsis (BSD-3-clause) + /crypto-algorithms (NONE) + /libhydrogen (ISC) + /littlefs (BSD-3-clause) + /lwip (BSD-3-clause) + /mynewt-nimble (Apache-2.0) + /nrfx (BSD-3-clause) + /nxp_driver (BSD-3-Clause) + /oofatfs (BSD-1-clause) + /pico-sdk (BSD-3-clause) + /re15 (BSD-3-clause) + /stm32lib (BSD-3-clause) + /tinytest (BSD-3-clause) + /tinyusb (MIT) + /uzlib (Zlib) + /logo (uses OFL-1.1) + /ports + /cc3200 + /hal (BSD-3-clause) + /simplelink (BSD-3-clause) + /FreeRTOS (GPL-2.0 with FreeRTOS exception) + /stm32 + /usbd*.c (MCD-ST Liberty SW License Agreement V2) + /stm32_it.* (MIT + BSD-3-clause) + /system_stm32*.c (MIT + BSD-3-clause) + /boards + /startup_stm32*.s (BSD-3-clause) + /*/stm32*.h (BSD-3-clause) + /usbdev (MCD-ST Liberty SW License Agreement V2) + /usbhost (MCD-ST Liberty SW License Agreement V2) + /teensy + /core (PJRC.COM) + /zephyr + /src (Apache-2.0) + /tools + /dfu.py (LGPL-3.0-only) diff --git a/Makefile b/Makefile index 55a35082b7..b35b5c66b9 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,7 @@ TRANSLATE_SOURCES_EXC = -path "ports/*/build-*" \ help: @echo "Please use \`make ' where is one of" + @echo " fetch-submodules to fetch dependencies from submodules, run this right after you clone the repo" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" diff --git a/README.rst b/README.rst index 801466cbad..66ad78f6eb 100644 --- a/README.rst +++ b/README.rst @@ -90,9 +90,11 @@ If you'd like to use the term "CircuitPython" and Blinka for your product here i * Your product is listed on `circuitpython.org `__ (source `here `_). This is to ensure that a user of your product can always download the latest version of CircuitPython from the standard place. -* Your product has a user accessible USB plug which appears as a CIRCUITPY drive when plugged in - AND/OR provides file and serial access over Bluetooth Low Energy. Boards that do not support USB - should be clearly marked as BLE-only CircuitPython. +* Your product supports at least one standard "`Workflow `__" for serial and file access: + * With a user accessible USB plug which appears as a CIRCUITPY drive when plugged in. + * With file and serial access over Bluetooth Low Energy using the BLE Workflow. + * With file access over WiFi using the WiFi Workflow with serial access over USB and/or WebSocket. +* Boards that do not support the USB Workflow should be clearly marked. If you choose not to meet these requirements, then we ask you call your version of CircuitPython something else (for example, SuperDuperPython) and not use the Blinka logo. You can say it is @@ -120,7 +122,7 @@ Behavior make each file independent from each other. - ``boot.py`` runs only once on start up before - USB is initialized. This lays the ground work for configuring USB at + workflows are initialized. This lays the ground work for configuring USB at startup rather than it being fixed. Since serial is not available, output is written to ``boot_out.txt``. - ``code.py`` (or ``main.py``) is run after every reload until it @@ -135,7 +137,10 @@ Behavior possible to fix code that causes nasty crashes by making it available through mass storage after the crash. A reset (the button) is needed after it's fixed to get back into normal mode. - RGB status LED indicating CircuitPython state. -- Re-runs ``code.py`` or other main file after file system writes over USB mass storage. (Disable with + - One green flash - code completed without error. + - Two red flashes - code ended due to an exception. + - Three yellow flashes - safe mode. May be due to CircuitPython internal error. +- Re-runs ``code.py`` or other main file after file system writes by a workflow. (Disable with ``supervisor.disable_autoreload()``) - Autoreload is disabled while the REPL is active. - Main is one of these: ``code.txt``, ``code.py``, ``main.py``, diff --git a/conf.py b/conf.py index 7818d78917..ad35596d7a 100644 --- a/conf.py +++ b/conf.py @@ -52,10 +52,14 @@ subprocess.check_output(["make", "stubs"]) #modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards() modules_support_matrix = shared_bindings_matrix.support_matrix_by_board() modules_support_matrix_reverse = defaultdict(list) -for board, modules in modules_support_matrix.items(): - for module in modules: +for board, matrix_info in modules_support_matrix.items(): + for module in matrix_info["modules"]: modules_support_matrix_reverse[module].append(board) -modules_support_matrix_reverse = dict((module, sorted(boards)) for module, boards in modules_support_matrix_reverse.items()) + +modules_support_matrix_reverse = dict( + (module, sorted(boards)) + for module, boards in modules_support_matrix_reverse.items() +) html_context = { 'support_matrix': modules_support_matrix, @@ -83,7 +87,7 @@ extensions = [ ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['templates'] +templates_path = ['templates', "docs/templates"] # The suffix of source filenames. source_suffix = { @@ -195,6 +199,7 @@ exclude_patterns = ["**/build*", "ports/cxd56/spresense-exported-sdk", "ports/espressif/certificates", "ports/espressif/esp-idf", + "ports/espressif/esp32-camera", "ports/espressif/.idf_tools", "ports/espressif/peripherals", "ports/litex/hw", diff --git a/data/nvm.toml b/data/nvm.toml index 266ea20ed8..2d292ad4e6 160000 --- a/data/nvm.toml +++ b/data/nvm.toml @@ -1 +1 @@ -Subproject commit 266ea20ed80104c315dcb124b482fa5f9f48cdec +Subproject commit 2d292ad4e67890d4b85b027431ba9fef7bf561fd diff --git a/devices/ble_hci/common-hal/_bleio/Adapter.c b/devices/ble_hci/common-hal/_bleio/Adapter.c index 839519dc33..8c7b8f67eb 100644 --- a/devices/ble_hci/common-hal/_bleio/Adapter.c +++ b/devices/ble_hci/common-hal/_bleio/Adapter.c @@ -49,6 +49,10 @@ #include "shared-bindings/_bleio/ScanEntry.h" #include "shared-bindings/time/__init__.h" +#if CIRCUITPY_DOTENV +#include "shared-module/dotenv/__init__.h" +#endif + #define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION)) #define SEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000000) / (RESOLUTION)) #define UNITS_TO_SEC(TIME, RESOLUTION) (((TIME)*(RESOLUTION)) / 1000000) @@ -278,17 +282,27 @@ char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0 // Get various values and limits set by the adapter. // Set event mask. STATIC void bleio_adapter_hci_init(bleio_adapter_obj_t *self) { + mp_int_t name_len = 0; - const size_t len = sizeof(default_ble_name); + #if CIRCUITPY_DOTENV + char ble_name[32]; + name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1); + if (name_len > 0) { + self->name = mp_obj_new_str(ble_name, (size_t)name_len); + } + #endif - bt_addr_t addr; - hci_check_error(hci_read_bd_addr(&addr)); + if (name_len <= 0) { + name_len = sizeof(default_ble_name); + bt_addr_t addr; + hci_check_error(hci_read_bd_addr(&addr)); - default_ble_name[len - 4] = nibble_to_hex_lower[addr.val[1] >> 4 & 0xf]; - default_ble_name[len - 3] = nibble_to_hex_lower[addr.val[1] & 0xf]; - default_ble_name[len - 2] = nibble_to_hex_lower[addr.val[0] >> 4 & 0xf]; - default_ble_name[len - 1] = nibble_to_hex_lower[addr.val[0] & 0xf]; - self->name = mp_obj_new_str(default_ble_name, len); + default_ble_name[name_len - 4] = nibble_to_hex_lower[addr.val[1] >> 4 & 0xf]; + default_ble_name[name_len - 3] = nibble_to_hex_lower[addr.val[1] & 0xf]; + default_ble_name[name_len - 2] = nibble_to_hex_lower[addr.val[0] >> 4 & 0xf]; + default_ble_name[name_len - 1] = nibble_to_hex_lower[addr.val[0] & 0xf]; + self->name = mp_obj_new_str(default_ble_name, (uint8_t)name_len); + } // Get version information. if (hci_read_local_version(&self->hci_version, &self->hci_revision, &self->lmp_version, diff --git a/devices/ble_hci/common-hal/_bleio/Characteristic.c b/devices/ble_hci/common-hal/_bleio/Characteristic.c index e2f9cad0ef..b6e144f191 100644 --- a/devices/ble_hci/common-hal/_bleio/Characteristic.c +++ b/devices/ble_hci/common-hal/_bleio/Characteristic.c @@ -57,9 +57,9 @@ void common_hal_bleio_characteristic_construct(bleio_characteristic_obj_t *self, self->value = mp_obj_new_bytes(initial_value_bufinfo->buf, initial_value_bufinfo->len); const mp_int_t max_length_max = 512; - if (max_length < 0 || max_length > max_length_max) { - mp_raise_ValueError(translate("max_length must be <= 512")); - } + + mp_arg_validate_int_range(max_length, 0, max_length_max, MP_QSTR_max_length); + self->max_length = max_length; self->fixed_length = fixed_length; diff --git a/devices/ble_hci/common-hal/_bleio/__init__.c b/devices/ble_hci/common-hal/_bleio/__init__.c index d8a222ecfe..a22bcfb082 100644 --- a/devices/ble_hci/common-hal/_bleio/__init__.c +++ b/devices/ble_hci/common-hal/_bleio/__init__.c @@ -57,6 +57,11 @@ bool vm_used_ble; // } // } +void bleio_user_reset() { + // HCI doesn't support the BLE workflow so just do a full reset. + bleio_reset(); +} + // Turn off BLE on a reset or reload. void bleio_reset() { // Create a UUID object for all CCCD's. diff --git a/devices/ble_hci/common-hal/_bleio/att.c b/devices/ble_hci/common-hal/_bleio/att.c index abfe7429f4..f649967ca9 100644 --- a/devices/ble_hci/common-hal/_bleio/att.c +++ b/devices/ble_hci/common-hal/_bleio/att.c @@ -44,6 +44,7 @@ #include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" #include "supervisor/shared/tick.h" +#include "supervisor/shared/translate/translate.h" STATIC uint16_t max_mtu = BT_ATT_DEFAULT_LE_MTU; // 23 STATIC unsigned long timeout = 5000; diff --git a/license.rst b/docs/LICENSE.md similarity index 78% rename from license.rst rename to docs/LICENSE.md index 7e97341cda..a63dd7c965 100644 --- a/license.rst +++ b/docs/LICENSE.md @@ -1,9 +1,8 @@ -MicroPython & CircuitPython license information -=============================================== +# MicroPython & CircuitPython License -The MIT License (MIT) +MIT License -Copyright (c) 2013-2017 Damien P. George, and others +Copyright (c) 2013-2022 Damien P. George and others Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -12,13 +11,13 @@ 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 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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/docs/design_guide.rst b/docs/design_guide.rst index fdb8f9b019..b68398827d 100644 --- a/docs/design_guide.rst +++ b/docs/design_guide.rst @@ -141,7 +141,7 @@ statement will ensure hardware isn't enabled longer than needed. Verify your device -------------------------------------------------------------------------------- -Whenever possible, make sure device you are talking to is the device you expect. +Whenever possible, make sure the device you are talking to is the device you expect. If not, raise a RuntimeError. Beware that I2C addresses can be identical on different devices so read registers you know to make sure they match your expectation. Validating this upfront will help catch mistakes. @@ -202,7 +202,7 @@ interchangeably with the CPython name. This is confusing. Instead, think up a new name that is related to the extra functionality you are adding. For example, storage mounting and unmounting related functions were moved from -``uos`` into a new `storage` module. Terminal related functions were moved into +``uos`` into a new `storage` module. Terminal-related functions were moved into `multiterminal`. These names better match their functionality and do not conflict with CPython names. Make sure to check that you don't conflict with CPython libraries too. That way we can port the API to CPython in the future. @@ -213,7 +213,7 @@ Example When adding extra functionality to CircuitPython to mimic what a normal operating system would do, either copy an existing CPython API (for example file writing) or create a separate module to achieve what you want. For example, -mounting and unmount drives is not a part of CPython so it should be done in a +mounting and unmounting drives is not a part of CPython so it should be done in a module, such as a new ``storage`` module, that is only available in CircuitPython. That way when someone moves the code to CPython they know what parts need to be adapted. @@ -494,6 +494,45 @@ backticks ``:class:`~adafruit_motor.servo.Servo```. You must also add the refer "adafruit_motor": ("https://circuitpython.readthedocs.io/projects/motor/en/latest/", None,), +Use ``adafruit_register`` when possible +-------------------------------------------------------------------------------- +`Register `_ is +a foundational library that manages packing and unpacking data from I2C device +registers. There is also `Register SPI `_ +for SPI devices. When possible, use one of these libraries for unpacking and +packing registers. This ensures the packing code is shared amongst all +registers (even across drivers). Furthermore, it simplifies device definitions +by making them declarative (only data.) + +Values with non-consecutive bits in a register or that represent FIFO endpoints +may not map well to existing register classes. In unique cases like these, it is +ok to read and write the register directly. + +*Do not* add all registers from a datasheet upfront. Instead, only add the ones +necessary for the functionality the driver exposes. Adding them all will lead to +unnecessary file size and API clutter. See `this video about outside-in design +from @tannewt `_. + +I2C Example +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: python + + from adafruit_register import i2c_bit + from adafruit_bus_device import i2c_device + + class HelloWorldDevice: + """Device with two bits to control when the words 'hello' and 'world' are lit.""" + + hello = i2c_bit.RWBit(0x0, 0x0) + """Bit to indicate if hello is lit.""" + + world = i2c_bit.RWBit(0x1, 0x0) + """Bit to indicate if world is lit.""" + + def __init__(self, i2c, device_address=0x0): + self.i2c_device = i2c_device.I2CDevice(i2c, device_address) + Use BusDevice -------------------------------------------------------------------------------- @@ -668,8 +707,24 @@ when using ``const()``, keep in mind these general guide lines: - Always use via an import, ex: ``from micropython import const`` - Limit use to global (module level) variables only. -- If user will not need access to variable, prefix name with a leading - underscore, ex: ``_SOME_CONST``. +- Only used when the user will not need access to variable and prefix name with + a leading underscore, ex: ``_SOME_CONST``. + +Example +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: python + + from adafruit_bus_device import i2c_device + from micropython import const + + _DEFAULT_I2C_ADDR = const(0x42) + + class Widget: + """A generic widget.""" + + def __init__(self, i2c, address=_DEFAULT_I2C_ADDR): + self.i2c_device = i2c_device.I2CDevice(i2c, address) Libraries Examples ------------------ @@ -751,6 +806,16 @@ properties. | ``sound_level`` | float | non-unit-specific sound level (monotonic but not actual decibels) | +-----------------------+-----------------------+-------------------------------------------------------------------------+ +Driver constant naming +-------------------------------------------------------------------------------- + +When adding variables for constant values for a driver. Do not include the +device's name in the variable name. For example, in ``adafruit_fancy123.py``, +variables should not start with ``FANCY123_``. Adding this prefix increases RAM +usage and .mpy file size because variable names are preserved. User code should +refer to these constants as ``adafruit_fancy123.HELLO_WORLD`` for clarity. +``adafruit_fancy123.FANCY123_HELLO_WORLD`` would be overly verbose. + Adding native modules -------------------------------------------------------------------------------- diff --git a/docs/environment.rst b/docs/environment.rst new file mode 100644 index 0000000000..5766b54380 --- /dev/null +++ b/docs/environment.rst @@ -0,0 +1,58 @@ +Environment Variables +===================== + +CircuitPython 8.0.0 introduces support for environment variables. Environment +variables are commonly used to store "secrets" such as Wi-Fi passwords and API +keys. This method *does not* make them secure. It only separates them from the +code. + +CircuitPython supports these by mimicking the `dotenv `_ +CPython library. Other languages such as Javascript, PHP and Ruby also have +dotenv libraries. + +These libraries store environment variables in a ``.env`` file. Here is a simple +example: + +.. code-block:: bash + + KEY1='value1' + # Comment + KEY2='value2 + is multiple lines' + +CircuitPython uses the ``.env`` at the drive root (no folder) as the environment. +User code can access the values from the file using `os.getenv()`. It is +recommended to save any values used repeatedly in a variable because `os.getenv()` +will parse the ``/.env`` on every access. + +CircuitPython behavior +---------------------- + +CircuitPython will also read the environment to configure its behavior. Other +keys are ignored by CircuitPython. Here are the keys it uses: + +CIRCUITPY_BLE_NAME +~~~~~~~~~~~~~~~~~~ +Default BLE name the board advertises as, including for the BLE workflow. + +CIRCUITPY_RESERVED_PSRAM +~~~~~~~~~~~~~~~~~~~~~~~~ +On boards with Espressif microcontrollers with PSRAM (also called SPIRAM), permanently reserve a portion of PSRAM for use by esp-idf. +This storage is removed from the CircuitPython "heap" and is available for allocation by esp-idf routines in the core instead. +Generally, only set this to a non-zero value when it is required by a specific core module. + +CIRCUITPY_WEB_API_PASSWORD +~~~~~~~~~~~~~~~~~~~~~~~~~~ +Password required to make modifications to the board from the Web Workflow. + +CIRCUITPY_WEB_API_PORT +~~~~~~~~~~~~~~~~~~~~~~ +TCP port number used for the web HTTP API. Defaults to 80 when omitted. + +CIRCUITPY_WIFI_PASSWORD +~~~~~~~~~~~~~~~~~~~~~~~ +Wi-Fi password used to auto connect to CIRCUITPY_WIFI_SSID. + +CIRCUITPY_WIFI_SSID +~~~~~~~~~~~~~~~~~~~ +Wi-Fi SSID to auto-connect to even if user code is not running. diff --git a/docs/index.rst b/docs/index.rst index 6e9789852e..abc0236995 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -22,6 +22,8 @@ Full Table of Contents supported_ports.rst troubleshooting.rst drivers.rst + workflows + environment.rst .. toctree:: :maxdepth: 1 @@ -46,7 +48,7 @@ Full Table of Contents ../CONTRIBUTING ../BUILDING ../CODE_OF_CONDUCT - ../license.rst + ../docs/LICENSE ../WEBUSB_README Indices and tables diff --git a/docs/library/builtins.rst b/docs/library/builtins.rst index 8532dc2531..a3be5ae16e 100644 --- a/docs/library/builtins.rst +++ b/docs/library/builtins.rst @@ -4,11 +4,18 @@ All builtin functions and exceptions are described here. They are also available via ``builtins`` module. +For more information about built-ins, see the following CPython documentation: + +* `Builtin CPython Functions `_ +* `Builtin CPython Exceptions `_ +* `Builtin CPython Constants `_ + +.. note:: Not all of these functions, types, exceptions, and constants are turned + on in all CircuitPython ports, for space reasons. + Functions and types ------------------- -Not all of these functions and types are turned on in all CircuitPython ports, for space reasons. - .. function:: abs() .. function:: all() @@ -160,46 +167,77 @@ Not all of these functions and types are turned on in all CircuitPython ports, f Exceptions ---------- +.. exception:: ArithmeticError + .. exception:: AssertionError .. exception:: AttributeError +.. exception:: BaseException + +.. exception:: BrokenPipeError + +.. exception:: ConnectionError + +.. exception:: EOFError + .. exception:: Exception .. exception:: ImportError +.. exception:: IndentationError + .. exception:: IndexError .. exception:: KeyboardInterrupt .. exception:: KeyError +.. exception:: LookupError + .. exception:: MemoryError +.. exception:: MpyError + + Not a part of the CPython standard library + .. exception:: NameError .. exception:: NotImplementedError .. exception:: OSError +.. exception:: OverflowError + .. exception:: RuntimeError .. exception:: ReloadException `ReloadException` is used internally to deal with soft restarts. + Not a part of the CPython standard library + +.. exception:: StopAsyncIteration + .. exception:: StopIteration .. exception:: SyntaxError .. exception:: SystemExit - |see_cpython| :py:class:`cpython:SystemExit`. +.. exception:: TimeoutError .. exception:: TypeError - |see_cpython| :py:class:`cpython:TypeError`. +.. exception:: UnicodeError .. exception:: ValueError .. exception:: ZeroDivisionError + +Constants +--------- + +.. data:: Ellipsis + +.. data:: NotImplemented diff --git a/docs/library/hashlib.rst b/docs/library/hashlib.rst index 8e5ebc2d1a..061f9fd1e0 100644 --- a/docs/library/hashlib.rst +++ b/docs/library/hashlib.rst @@ -5,6 +5,7 @@ .. module:: hashlib :synopsis: hashing algorithms + :noindex: |see_cpython_module| :mod:`cpython:hashlib`. diff --git a/docs/library/zlib.rst b/docs/library/zlib.rst index 8f69f4b7c8..514b787bc4 100644 --- a/docs/library/zlib.rst +++ b/docs/library/zlib.rst @@ -5,6 +5,7 @@ .. module:: zlib :synopsis: zlib decompression + :noindex: |see_cpython_module| :mod:`cpython:zlib`. @@ -26,6 +27,7 @@ Functions CPython and is ignored. .. class:: DecompIO(stream, wbits=0, /) + :noindex: Create a ``stream`` wrapper which allows transparent decompression of compressed data in another *stream*. This allows to process compressed diff --git a/docs/porting.rst b/docs/porting.rst index 013c367291..f4ed2ab4cc 100644 --- a/docs/porting.rst +++ b/docs/porting.rst @@ -71,7 +71,7 @@ as a natural "TODO" list. An example minimal build list is shown below: CIRCUITPY_SDCARDIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_FREQUENCYIO = 0 - CIRCUITPY_I2CPERIPHERAL = 0 + CIRCUITPY_I2CTARGET = 0 # Requires SPI, PulseIO (stub ok): CIRCUITPY_DISPLAYIO = 0 @@ -79,8 +79,6 @@ as a natural "TODO" list. An example minimal build list is shown below: # any port once their prerequisites in common-hal are complete. # Requires DigitalIO: CIRCUITPY_BITBANGIO = 0 - # Requires DigitalIO - CIRCUITPY_GAMEPADSHIFT = 0 # Requires neopixel_write or SPI (dotstar) CIRCUITPY_PIXELBUF = 0 # Requires OS diff --git a/docs/redirects.txt b/docs/redirects.txt index 248a042e7a..2817bb14e5 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -45,12 +45,10 @@ shared-bindings/audiomp3/__init__.rst shared-bindings/audiomp3/ shared-bindings/audiopwmio/PWMAudioOut.rst shared-bindings/audiopwmio/#audiopwmio.PWMAudioOut shared-bindings/audiopwmio/__init__.rst shared-bindings/audiopwmio/ shared-bindings/bitbangio/I2C.rst shared-bindings/bitbangio/#bitbangio.I2C -shared-bindings/bitbangio/OneWire.rst shared-bindings/bitbangio/#bitbangio.OneWire shared-bindings/bitbangio/SPI.rst shared-bindings/bitbangio/#bitbangio.SPI shared-bindings/bitbangio/__init__.rst shared-bindings/bitbangio/ shared-bindings/board/__init__.rst shared-bindings/board/ shared-bindings/busio/I2C.rst shared-bindings/busio/#busio.I2C -shared-bindings/busio/OneWire.rst shared-bindings/busio/#busio.OneWire shared-bindings/busio/Parity.rst shared-bindings/busio/#busio.Parity shared-bindings/busio/SPI.rst shared-bindings/busio/#busio.SPI shared-bindings/busio/UART.rst shared-bindings/busio/#busio.UART @@ -82,10 +80,6 @@ shared-bindings/framebufferio/FramebufferDisplay.rst shared-bindings/framebuffer shared-bindings/framebufferio/__init__.rst shared-bindings/framebufferio/ shared-bindings/frequencyio/FrequencyIn.rst shared-bindings/frequencyio/#frequencyio.FrequencyIn shared-bindings/frequencyio/__init__.rst shared-bindings/frequencyio/ -shared-bindings/gamepad/GamePad.rst shared-bindings/gamepad/#gamepad.GamePad -shared-bindings/gamepad/__init__.rst shared-bindings/gamepad/ -shared-bindings/gamepadshift/GamePadShift.rst shared-bindings/gamepadshift/#gamepadshift.GamePadShift -shared-bindings/gamepadshift/__init__.rst shared-bindings/gamepadshift/ shared-bindings/gnss/__init__.rst shared-bindings/gnss/ shared-bindings/i2cperipheral/__init__.rst shared-bindings/i2cperipheral/ shared-bindings/i2csecondary/__init__.rst shared-bindings/i2csecondary/ @@ -101,6 +95,7 @@ shared-bindings/neopixel_write/__init__.rst shared-bindings/neopixel_write/ shared-bindings/network/__init__.rst shared-bindings/network/ shared-bindings/nvm/ByteArray.rst shared-bindings/nvm/#nvm.ByteArray shared-bindings/nvm/__init__.rst shared-bindings/nvm/ +shared-bindings/onewireio/OneWire.rst shared-bindings/onewireio/#onewireio.OneWire shared-bindings/os/__init__.rst shared-bindings/os/ shared-bindings/protomatter/__init__.rst shared-bindings/protomatter/ shared-bindings/ps2io/Ps2.rst shared-bindings/ps2io/#ps2io.Ps2 diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index 44554e1ad7..c4bf105898 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -32,7 +32,7 @@ from concurrent.futures import ThreadPoolExecutor SUPPORTED_PORTS = ['atmel-samd', 'broadcom', 'cxd56', 'espressif', 'litex', 'mimxrt10xx', 'nrf', 'raspberrypi', 'stm'] -aliases_by_board = { +ALIASES_BY_BOARD = { "circuitplayground_express": [ "circuitplayground_express_4h", "circuitplayground_express_digikey_pycon2019", @@ -40,10 +40,9 @@ aliases_by_board = { "pybadge": ["edgebadge"], "pyportal": ["pyportal_pynt"], "gemma_m0": ["gemma_m0_pycon2018"], - "pewpew10": ["pewpew13"], } -aliases_brand_names = { +ALIASES_BRAND_NAMES = { "circuitplayground_express_4h": "Adafruit Circuit Playground Express 4-H", "circuitplayground_express_digikey_pycon2019": @@ -54,19 +53,25 @@ aliases_brand_names = { "Adafruit PyPortal Pynt", "gemma_m0_pycon2018": "Adafruit Gemma M0 PyCon 2018", - "pewpew13": - "PewPew 13", } -additional_modules = { +ADDITIONAL_MODULES = { "fontio": "CIRCUITPY_DISPLAYIO", "terminalio": "CIRCUITPY_DISPLAYIO", "adafruit_bus_device": "CIRCUITPY_BUSDEVICE", - "adafruit_pixelbuf": "CIRCUITPY_PIXELBUF" + "adafruit_pixelbuf": "CIRCUITPY_PIXELBUF", + "usb": "CIRCUITPY_USB_HOST", } +FROZEN_EXCLUDES = ["examples", "docs", "tests", "utils", "conf.py", "setup.py"] +"""Files and dirs at the root of a frozen directory that should be ignored. +This is the same list as in the preprocess_frozen_modules script.""" + +repository_urls = {} +"""Cache of repository URLs for frozen modules.""" + def get_circuitpython_root_dir(): - """ The path to the root './circuitpython' directory + """ The path to the root './circuitpython' directory. """ file_path = pathlib.Path(__file__).resolve() root_dir = file_path.parent.parent @@ -74,12 +79,40 @@ def get_circuitpython_root_dir(): return root_dir def get_shared_bindings(): - """ Get a list of modules in shared-bindings based on folder names + """ Get a list of modules in shared-bindings based on folder names. """ shared_bindings_dir = get_circuitpython_root_dir() / "shared-bindings" return [item.name for item in shared_bindings_dir.iterdir()] + ["binascii", "errno", "json", "re", "ulab"] +def get_board_mapping(): + """ + Compiles the list of boards from the directories, with aliases and mapping + to the port. + """ + boards = {} + for port in SUPPORTED_PORTS: + board_path = os.path.join("../ports", port, "boards") + for board_path in os.scandir(board_path): + if board_path.is_dir(): + board_files = os.listdir(board_path.path) + board_id = board_path.name + aliases = ALIASES_BY_BOARD.get(board_path.name, []) + boards[board_id] = { + "port": port, + "download_count": 0, + "aliases": aliases, + } + for alias in aliases: + boards[alias] = { + "port": port, + "download_count": 0, + "alias": True, + "aliases": [], + } + return boards + + def read_mpconfig(): """ Open 'circuitpy_mpconfig.mk' and return the contents. """ @@ -104,8 +137,8 @@ def build_module_map(): full_build = False for module in modules: full_name = module - if module in additional_modules: - search_identifier = additional_modules[module] + if module in ADDITIONAL_MODULES: + search_identifier = ADDITIONAL_MODULES[module] else: search_identifier = 'CIRCUITPY_'+module.lstrip("_").upper() re_pattern = f"{re.escape(search_identifier)}\s*\??=\s*(.+)" @@ -162,6 +195,69 @@ def get_settings_from_makefile(port_dir, board_name): return settings +def get_repository_url(directory): + if directory in repository_urls: + return repository_urls[directory] + readme = None + for readme_path in ( + os.path.join(directory, "README.rst"), + os.path.join(os.path.dirname(directory), "README.rst") + ): + if os.path.exists(readme_path): + readme = readme_path + break + path = None + if readme: + with open(readme, "r") as fp: + for line in fp.readlines(): + if m := re.match("\s+:target:\s+(http\S+(docs.circuitpython|readthedocs)\S+)\s*", line): + path = m.group(1) + break + if m := re.search("<(http[^>]+)>", line): + path = m.group(1) + break + if path is None: + contents = subprocess.run( + ["git", "remote", "get-url", "origin"], + encoding="utf-8", + errors="replace", + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + cwd=directory + ) + path = contents.stdout.strip() + repository_urls[directory] = path + return path + +def frozen_modules_from_dirs(frozen_mpy_dirs, withurl): + """ + Go through the list of frozen directories and extract the python modules. + Paths are of the type: + $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground + $(TOP)/frozen/circuitpython-stage/meowbit + Python modules are at the root of the path, and are python files or directories + containing python files. Except the ones in the FROZEN_EXCLUDES list. + """ + frozen_modules = [] + for frozen_path in filter(lambda x: x, frozen_mpy_dirs.split(" ")): + source_dir = get_circuitpython_root_dir() / frozen_path[7:] + url_repository = get_repository_url(source_dir) + for sub in source_dir.glob("*"): + if sub.name in FROZEN_EXCLUDES: + continue + if sub.name.endswith(".py"): + if withurl: + frozen_modules.append((sub.name[:-3], url_repository)) + else: + frozen_modules.append(sub.name[:-3]) + continue + if next(sub.glob("**/*.py"), None): # tests if not empty + if withurl: + frozen_modules.append((sub.name, url_repository)) + else: + frozen_modules.append(sub.name) + return frozen_modules + def lookup_setting(settings, key, default=''): while True: value = settings.get(key, default) @@ -179,7 +275,7 @@ def all_ports_all_boards(ports=SUPPORTED_PORTS): continue yield (port, entry) -def support_matrix_by_board(use_branded_name=True): +def support_matrix_by_board(use_branded_name=True, withurl=True): """ Compiles a list of the available core modules available for each board. """ @@ -207,25 +303,50 @@ def support_matrix_by_board(use_branded_name=True): board_modules.append(base[module]['name']) board_modules.sort() + if "CIRCUITPY_BUILD_EXTENSIONS" in settings: + board_extensions = [ + extension.strip() for extension in + settings["CIRCUITPY_BUILD_EXTENSIONS"].split(",") + ] + else: + raise OSError(f"Board extensions undefined: {board_name}.") + + frozen_modules = [] + if "FROZEN_MPY_DIRS" in settings: + frozen_modules = frozen_modules_from_dirs(settings["FROZEN_MPY_DIRS"], withurl) + if frozen_modules: + frozen_modules.sort() + # generate alias boards too - board_matrix = [(board_name, board_modules)] - if entry.name in aliases_by_board: - for alias in aliases_by_board[entry.name]: + board_matrix = [( + board_name, { + "modules": board_modules, + "frozen_libraries": frozen_modules, + "extensions": board_extensions, + } + )] + if entry.name in ALIASES_BY_BOARD: + for alias in ALIASES_BY_BOARD[entry.name]: if use_branded_name: - if alias in aliases_brand_names: - alias = aliases_brand_names[alias] + if alias in ALIASES_BRAND_NAMES: + alias = ALIASES_BRAND_NAMES[alias] else: alias = alias.replace("_"," ").title() - board_matrix.append( (alias, board_modules) ) + board_matrix.append(( + alias, { + "modules": board_modules, + "frozen_libraries": frozen_modules, + "extensions": board_extensions, + }, + )) return board_matrix # this is now a list of (board,modules) executor = ThreadPoolExecutor(max_workers=os.cpu_count()) mapped_exec = executor.map(support_matrix, all_ports_all_boards()) # flatmap with comprehensions - boards = dict(sorted([board for matrix in mapped_exec for board in matrix])) + boards = dict(sorted([board for matrix in mapped_exec for board in matrix], key=lambda x: x[0])) - # print(json.dumps(boards, indent=2)) return boards if __name__ == '__main__': diff --git a/docs/static/filter.css b/docs/static/filter.css index 12efe14a40..021f850f4b 100644 --- a/docs/static/filter.css +++ b/docs/static/filter.css @@ -7,8 +7,21 @@ right: 10px; top: 4px; } -.support-matrix-table .this_module code, -.support-matrix-table .this_module span { + +.support-matrix-table .reference.external { + box-sizing: border-box; + font-weight: 700; + color: #404040; + font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace; + padding: 2px 5px; + background: white; + border: 1px solid #e1e4e5; + font-size: 75%; +} + +.support-matrix-table .this_module, +.support-matrix-table .this_module.reference.external, +.support-matrix-table .this_module * { background: black; color: white; } diff --git a/docs/static/filter.js b/docs/static/filter.js index 9dc46a9eed..034c9cb463 100644 --- a/docs/static/filter.js +++ b/docs/static/filter.js @@ -44,14 +44,14 @@ $(() => { var nvisible = 0; $(".support-matrix-table tbody tr").each( (index,item) => { var name = $(item).find("td:first-child p").html(); - var modules = $(item).find("a.reference.internal"); + var modules = $(item).find("code, a.reference.external"); var matching_all = true; // list_search.forEach((sstring) => { var matching = (sstring[0] == "-"); for(var modi = 0; modi < modules.length; ++modi) { module = modules[modi]; - var mod_name = module.firstChild.firstChild.textContent; + var mod_name = module.firstChild.textContent; if(sstring[0] == "-") { if(mod_name.match(sstring.substr(1))) { matching = false; diff --git a/docs/workflows.md b/docs/workflows.md new file mode 100644 index 0000000000..26f5179b51 --- /dev/null +++ b/docs/workflows.md @@ -0,0 +1,430 @@ +# Workflows + +Workflows are the process used to 1) manipulate files on the CircuitPython device and 2) interact +with the serial connection to CircuitPython. The serial connection is usually used to access the +REPL. + +Starting with CircuitPython 3.x we moved to a USB-only workflow. Prior to that, we used the serial +connection alone to do the whole workflow. In CircuitPython 7.x, a BLE workflow was added with the +advantage of working with mobile devices. CircuitPython 8.x added a web workflow that works over the +local network (usually Wi-Fi) and a web browser. Other clients can also use the Web REST API. Boards +should clearly document which workflows are supported. + +Code for workflows lives in `supervisor/shared`. + +The workflow APIs are documented here. + +## USB + +These USB interfaces are enabled by default on boards with USB support. They are usable once the +device has been plugged into a host. + +### CIRCUITPY drive +CircuitPython exposes a standard mass storage (MSC) interface to enable file manipulation over a +standard interface. This interface works underneath the file system at the block level so using it +excludes other types of workflows from manipulating the file system at the same time. + +### CDC serial +CircuitPython exposes one CDC USB interface for CircuitPython serial. This is a standard serial +USB interface. + +TODO: Document how it designates itself from the user CDC. + +Setting baudrate 1200 and disconnecting will reboot into a bootloader. (Used by Arduino to trigger +a reset into bootloader.) + +## BLE + +The BLE workflow is enabled for nRF boards. By default, to prevent malicious access, it is disabled. +To connect to the BLE workflow, press the reset button while the status led blinks blue quickly +after the safe mode blinks. The board will restart and broadcast the file transfer service UUID +(`0xfebb`) along with the board's [Creation IDs](https://github.com/creationid/creators). This +public broadcast is done at a lower transmit level so the devices must be closer. On connection, the +device will need to pair and bond. Once bonded, the device will broadcast whenever disconnected +using a rotating key rather than a static one. Non-bonded devices won't be able to resolve it. After +connection, the central device can discover two default services. One for file transfer and one for +CircuitPython specifically that includes serial characteristics. + +To change the default BLE advertising name without (or before) running user code, the desired name +can be put in the `/.env` file. The key is `CIRCUITPY_BLE_NAME`. It's limited to approximately +30 characters depending on the port's settings and will be truncated if longer. + +### File Transfer API + +CircuitPython uses [an open File Transfer API](https://github.com/adafruit/Adafruit_CircuitPython_BLE_File_Transfer) +to enable file system access. + +### CircuitPython Service + +The base UUID for the CircuitPython service is `ADAFXXXX-4369-7263-7569-7450794686e`. The `XXXX` is +replaced by the four specific digits below. The service itself is `0001`. + +#### TX - `0002` / RX - `0003` + +These characteristic work just like the Nordic Uart Service (NUS) but have different UUIDs to prevent +conflicts with user created NUS services. + +#### Version - `0100` +Read-only characteristic that returns the UTF-8 encoded version string. + +## Web + +The web workflow is depends on adding Wi-Fi credentials into the `/.env` file. The keys are +`CIRCUITPY_WIFI_SSID` and `CIRCUITPY_WIFI_PASSWORD`. Once these are defined, CircuitPython will +automatically connect to the network and start the webserver used for the workflow. The webserver +is on port 80 unless overridden by `CIRCUITPY_WEB_API_PORT`. It also enables MDNS. + +Here is an example `/.env`: + +```bash +# To auto-connect to Wi-Fi +CIRCUITPY_WIFI_SSID='scottswifi' +CIRCUITPY_WIFI_PASSWORD='secretpassword' + +# To enable modifying files from the web. Change this too! +# Leave the User field blank in the browser. +CIRCUITPY_WEB_API_PASSWORD='passw0rd' + +CIRCUITPY_WEB_API_PORT=80 +``` + +MDNS is used to resolve [`circuitpython.local`](http://circuitpython.local) to a device specific +hostname of the form `cpy-XXXXXX.local`. The `XXXXXX` is based on network MAC address. The device +also provides the MDNS service with service type `_circuitpython` and protocol `_tcp`. + +### HTTP +The web server is HTTP 1.1 and may use chunked responses so that it doesn't need to precompute +content length. + +The API generally consists of an HTTP method such as GET or PUT and a path. Requests and responses +also have headers. Responses will contain a status code and status text such as `404 Not Found`. +This API tries to use standard status codes to encode the status of the various operations. The +[Mozilla Developer Network HTTP docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP) +are a great reference. + +#### Examples +The examples use `curl`, a common command line program for issuing HTTP requests. The examples below +use `circuitpython.local` as the easiest way to work. If you have multiple active devices, you'll +want to use the specific `cpy-XXXXXX.local` version. + +The examples also use `passw0rd` as the password placeholder. Replace it with your password before +running the example. + +### `/` +The root welcome page links to the file system page and also displays other CircuitPython devices +found using MDNS service discovery. This allows web browsers to find other devices from one. (All +devices will respond to `circuitpython.local` so the device redirected to may vary.) + +### CORS +The web server will allow requests from `cpy-XXXXXX.local`, `127.0.0.1`, the device's IP and +`code.circuitpython.org`. (`circuitpython.local` requests will be redirected to `cpy-XXXXXX.local`.) + +### File REST API +All file system related APIs are protected by HTTP basic authentication. It is *NOT* secure but will +hopefully prevent some griefing in shared settings. The password is sent unencrypted so do not reuse +a password with something important. The user field is left blank. + +The password is taken from `/.env` with the key `CIRCUITPY_WEB_API_PASSWORD`. If this is unset, the +server will respond with `403 Forbidden`. When a password is set, but not provided in a request, it +will respond `401 Unauthorized`. + +#### `/fs/` + +The `/fs/` page will respond with a directory browsing HTML once authenticated. This page is always +gzipped. If the `Accept: application/json` header is provided, then the JSON representation of the +root will be returned. + +##### OPTIONS +When requested with the `OPTIONS` method, the server will respond with CORS related headers. Most +aren't needed for API use. They are there for the web browser. + +* `Access-Control-Allow-Methods` - Varies with USB state. `GET, OPTIONS` when USB is active. `GET, OPTIONS, PUT, DELETE, MOVE` otherwise. + +Example: + +```sh +curl -v -u :passw0rd -X OPTIONS -L --location-trusted http://circuitpython.local/fs/ +``` + +#### `/fs//` +Directory paths must end with a /. Otherwise, the path is assumed to be a file. + +##### GET +Returns a JSON representation of the directory. + +* `200 OK` - Directory exists and JSON returned +* `401 Unauthorized` - Incorrect password +* `403 Forbidden` - No `CIRCUITPY_WEB_API_PASSWORD` set +* `404 Not Found` - Missing directory + +Returns information about each file in the directory: + +* `name` - File name. No trailing `/` on directory names +* `directory` - `true` when a directory. `false` otherwise +* `modified_ns` - File modification time in nanoseconds since January 1st, 1970. May not use full resolution +* `file_size` - File size in bytes. `0` for directories + +Example: + +```sh +curl -v -u :passw0rd -H "Accept: application/json" -L --location-trusted http://circuitpython.local/fs/lib/hello/ +``` + +```json +[ + { + "name": "world.txt", + "directory": false, + "modified_ns": 946934328000000000, + "file_size": 12 + } +] +``` + +##### PUT +Tries to make a directory at the given path. Request body is ignored. The custom `X-Timestamp` +header can provide a timestamp in milliseconds since January 1st, 1970 (to match JavaScript's file +time resolution) used for the directories modification time. The RTC time will used otherwise. + +Returns: + +* `204 No Content` - Directory exists +* `201 Created` - Directory created +* `401 Unauthorized` - Incorrect password +* `403 Forbidden` - No `CIRCUITPY_WEB_API_PASSWORD` set +* `409 Conflict` - USB is active and preventing file system modification +* `404 Not Found` - Missing parent directory +* `500 Server Error` - Other, unhandled error + +Example: + +```sh +curl -v -u :passw0rd -X PUT -L --location-trusted http://circuitpython.local/fs/lib/hello/world/ +``` + +##### Move +Moves the directory at the given path to ``X-Destination``. Also known as rename. + +The custom `X-Destination` header stores the destination path of the directory. + +* `201 Created` - Directory renamed +* `401 Unauthorized` - Incorrect password +* `403 Forbidden` - No `CIRCUITPY_WEB_API_PASSWORD` set +* `404 Not Found` - Source directory not found or destination path is missing +* `409 Conflict` - USB is active and preventing file system modification +* `412 Precondition Failed` - The destination path is already in use + +Example: + +```sh +curl -v -u :passw0rd -X MOVE -H "X-Destination: /fs/lib/hello2/" -L --location-trusted http://circuitpython.local/fs/lib/hello/ +``` + +##### DELETE +Deletes the directory and all of its contents. + +* `204 No Content` - Directory and its contents deleted +* `401 Unauthorized` - Incorrect password +* `403 Forbidden` - No `CIRCUITPY_WEB_API_PASSWORD` set +* `404 Not Found` - No directory +* `409 Conflict` - USB is active and preventing file system modification + +Example: + +```sh +curl -v -u :passw0rd -X DELETE -L --location-trusted http://circuitpython.local/fs/lib/hello2/world/ +``` + + +#### `/fs/` + +##### PUT +Stores the provided content to the file path. + +The custom `X-Timestamp` header can provide a timestamp in milliseconds since January 1st, 1970 +(to match JavaScript's file time resolution) used for the directories modification time. The RTC +time will used otherwise. + +Returns: + +* `201 Created` - File created and saved +* `204 No Content` - File existed and overwritten +* `401 Unauthorized` - Incorrect password +* `403 Forbidden` - No `CIRCUITPY_WEB_API_PASSWORD` set +* `404 Not Found` - Missing parent directory +* `409 Conflict` - USB is active and preventing file system modification +* `413 Payload Too Large` - `Expect` header not sent and file is too large +* `417 Expectation Failed` - `Expect` header sent and file is too large +* `500 Server Error` - Other, unhandled error + +If the client sends the `Expect` header, the server will reply with `100 Continue` when ok. + +Example: + +```sh +echo "Hello world" >> test.txt +curl -v -u :passw0rd -T test.txt -L --location-trusted http://circuitpython.local/fs/lib/hello/world.txt +``` + +##### GET +Returns the raw file contents. `Content-Type` will be set based on extension: + +* `text/plain` - `.py`, `.txt` +* `text/javascript` - `.js` +* `text/html` - `.html` +* `application/json` - `.json` +* `application/octet-stream` - Everything else + +Will return: +* `200 OK` - File exists and file returned +* `401 Unauthorized` - Incorrect password +* `403 Forbidden` - No `CIRCUITPY_WEB_API_PASSWORD` set +* `404 Not Found` - Missing file + +Example: + +```sh +curl -v -u :passw0rd -L --location-trusted http://circuitpython.local/fs/lib/hello/world.txt +``` + + +##### Move +Moves the file at the given path to the ``X-Destination``. Also known as rename. + +The custom `X-Destination` header stores the destination path of the file. + +* `201 Created` - File renamed +* `401 Unauthorized` - Incorrect password +* `403 Forbidden` - No `CIRCUITPY_WEB_API_PASSWORD` set +* `404 Not Found` - Source file not found or destination path is missing +* `409 Conflict` - USB is active and preventing file system modification +* `412 Precondition Failed` - The destination path is already in use + +Example: + +```sh +curl -v -u :passw0rd -X MOVE -H "X-Destination: /fs/lib/hello/world2.txt" -L --location-trusted http://circuitpython.local/fs/lib/hello/world.txt +``` + + +##### DELETE +Deletes the file. + + +* `204 No Content` - File existed and deleted +* `401 Unauthorized` - Incorrect password +* `403 Forbidden` - No `CIRCUITPY_WEB_API_PASSWORD` set +* `404 Not Found` - File not found +* `409 Conflict` - USB is active and preventing file system modification + +Example: + +```sh +curl -v -u :passw0rd -X DELETE -L --location-trusted http://circuitpython.local/fs/lib/hello/world2.txt +``` + +### `/cp/` + +`/cp/` serves basic info about the CircuitPython device and others discovered through MDNS. It is +not protected by basic auth in case the device is someone elses. + +Only `GET` requests are supported and will return `405 Method Not Allowed` otherwise. + +#### `/cp/devices.json` + +Returns information about other devices found on the network using MDNS. + +* `total`: Total MDNS response count. May be more than in `devices` if internal limits were hit. +* `devices`: List of discovered devices. + * `hostname`: MDNS hostname + * `instance_name`: MDNS instance name. Defaults to human readable board name. + * `port`: Port of CircuitPython Web API + * `ip`: IP address + +Example: +```sh +curl -v -L http://circuitpython.local/cp/devices.json +``` + +```json +{ + "total": 1, + "devices": [ + { + "hostname": "cpy-951032", + "instance_name": "Adafruit Feather ESP32-S2 TFT", + "port": 80, + "ip": "192.168.1.235" + } + ] +} +``` + +#### `/cp/serial/` + + +Serves a basic serial terminal program when a `GET` request is received without the +`Upgrade: websocket` header. Otherwise the socket is upgraded to a WebSocket. See WebSockets below for more detail. + +This is an authenticated endpoint in both modes. + +#### `/cp/version.json` + +Returns information about the device. + +* `web_api_version`: Always `1`. This versions the rest of the API and new versions may not be backwards compatible. +* `version`: CircuitPython build version. +* `build_date`: CircuitPython build date. +* `board_name`: Human readable name of the board. +* `mcu_name`: Human readable name of the microcontroller. +* `board_id`: Board id used in code and on circuitpython.org. +* `creator_id`: Creator ID for the board. +* `creation_id`: Creation ID for the board, set by the creator. +* `hostname`: MDNS hostname. +* `port`: Port of CircuitPython Web Service. +* `ip`: IP address of the device. + +Example: +```sh +curl -v -L http://circuitpython.local/cp/version.json +``` + +```json +{ + "web_api_version": 1, + "version": "8.0.0-alpha.1-20-ge1d4518a9-dirty", + "build_date": "2022-06-24", + "board_name": "ESP32-S3-USB-OTG-N8", + "mcu_name": "ESP32S3", + "board_id": "espressif_esp32s3_usb_otg_n8", + "creator_id": 12346, + "creation_id": 28683, + "hostname": "cpy-f57ce8", + "port": 80, + "ip": "192.168.1.94" +} +``` + +#### `/code/` + +The `/code/` page returns a small static html page that will pull in and load the full code editor from +[code.circuitpython.org](https://code.circuitpython.org) for a full code editor experience. Because most +of the resources reside online instead of the device, an active internet connection is required. + +### Static files + +* `/favicon.ico` - Blinka +* `/directory.js` - JavaScript for `/fs/` +* `/welcome.js` - JavaScript for `/` + +### WebSocket + +The CircuitPython serial interactions are available over a WebSocket. A WebSocket begins as a +special HTTP request that gets upgraded to a WebSocket. Authentication happens before upgrading. + +WebSockets are *not* bare sockets once upgraded. Instead they have their own framing format for data. +CircuitPython can handle PING and CLOSE opcodes. All others are treated as TEXT. Data to +CircuitPython is expected to be masked UTF-8, as the spec requires. Data from CircuitPython to the +client is unmasked. It is also unbuffered so the client will get a variety of frame sizes. + +Only one WebSocket at a time is supported. diff --git a/extmod/moduasyncio.c b/extmod/moduasyncio.c index 016ffcbc99..c4c4d36ad8 100644 --- a/extmod/moduasyncio.c +++ b/extmod/moduasyncio.c @@ -33,6 +33,8 @@ #include "shared-bindings/supervisor/__init__.h" #endif +#include "supervisor/shared/translate/translate.h" + #if MICROPY_PY_UASYNCIO // Used when task cannot be guaranteed to be non-NULL. diff --git a/extmod/modubinascii.c b/extmod/modubinascii.c index 7157be31fa..5aa9eacefd 100644 --- a/extmod/modubinascii.c +++ b/extmod/modubinascii.c @@ -11,6 +11,8 @@ #include "py/runtime.h" #include "py/binary.h" +#include "supervisor/shared/translate/translate.h" + static void check_not_unicode(const mp_obj_t arg) { #if MICROPY_CPYTHON_COMPAT if (mp_obj_is_str(arg)) { diff --git a/extmod/moductypes.c b/extmod/moductypes.c index 265cbd6d5d..f770ead006 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -11,7 +11,7 @@ #include "py/objtuple.h" #include "py/binary.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UCTYPES diff --git a/extmod/moduhashlib.c b/extmod/moduhashlib.c index 741f43c74c..a84254c566 100644 --- a/extmod/moduhashlib.c +++ b/extmod/moduhashlib.c @@ -8,7 +8,7 @@ #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UHASHLIB diff --git a/extmod/moduheapq.c b/extmod/moduheapq.c index 34867a5838..0200245f86 100644 --- a/extmod/moduheapq.c +++ b/extmod/moduheapq.c @@ -6,7 +6,7 @@ #include "py/objlist.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UHEAPQ diff --git a/extmod/modujson.c b/extmod/modujson.c index 9a4db7c273..cff02ae95c 100644 --- a/extmod/modujson.c +++ b/extmod/modujson.c @@ -13,7 +13,7 @@ #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UJSON diff --git a/extmod/modutimeq.c b/extmod/modutimeq.c index 495675ad1d..fcef14ce98 100644 --- a/extmod/modutimeq.c +++ b/extmod/modutimeq.c @@ -10,7 +10,7 @@ #include "py/runtime.h" #include "py/smallint.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UTIMEQ diff --git a/extmod/moduzlib.c b/extmod/moduzlib.c index b1eeac934b..6a1a2d6111 100644 --- a/extmod/moduzlib.c +++ b/extmod/moduzlib.c @@ -10,7 +10,7 @@ #include "py/stream.h" #include "py/mperrno.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_UZLIB diff --git a/extmod/ulab b/extmod/ulab index 5d01882c41..346c936e14 160000 --- a/extmod/ulab +++ b/extmod/ulab @@ -1 +1 @@ -Subproject commit 5d01882c41dbc4115bc94f0b61c093d5a6b812b6 +Subproject commit 346c936e14c6ea3a8d3d65cb1fa46202dc92999d diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c index ce71d74b88..d19a53a9ef 100644 --- a/extmod/vfs_fat.c +++ b/extmod/vfs_fat.c @@ -20,7 +20,7 @@ #include "extmod/vfs_fat.h" #include "shared/timeutils/timeutils.h" #include "supervisor/filesystem.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if FF_MAX_SS == FF_MIN_SS #define SECSIZE(fs) (FF_MIN_SS) @@ -30,6 +30,11 @@ #define mp_obj_fat_vfs_t fs_user_mount_t +// Factoring this common call saves about 90 bytes. +STATIC NORETURN void mp_raise_OSError_fresult(FRESULT res) { + mp_raise_OSError(fresult_to_errno_table[res]); +} + STATIC mp_import_stat_t fat_vfs_import_stat(void *vfs_in, const char *path) { fs_user_mount_t *vfs = vfs_in; FILINFO fno; @@ -64,7 +69,7 @@ STATIC mp_obj_t fat_vfs_make_new(const mp_obj_type_t *type, size_t n_args, size_ // don't error out if no filesystem, to let mkfs()/mount() create one if wanted vfs->blockdev.flags |= MP_BLOCKDEV_FLAG_NO_FILESYSTEM; } else if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return MP_OBJ_FROM_PTR(vfs); @@ -97,7 +102,7 @@ STATIC mp_obj_t fat_vfs_mkfs(mp_obj_t bdev_in) { res = f_mkfs(&vfs->fatfs, FM_FAT32, 0, working_buf, sizeof(working_buf)); } if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_const_none; @@ -172,7 +177,7 @@ STATIC mp_obj_t fat_vfs_ilistdir_func(size_t n_args, const mp_obj_t *args) { iter->is_str = is_str_type; FRESULT res = f_opendir(&self->fatfs, &iter->dir, path); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return MP_OBJ_FROM_PTR(iter); @@ -188,7 +193,7 @@ STATIC mp_obj_t fat_vfs_remove_internal(mp_obj_t vfs_in, mp_obj_t path_in, mp_in FRESULT res = f_stat(&self->fatfs, path, &fno); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } // check if path is a file or directory @@ -196,7 +201,7 @@ STATIC mp_obj_t fat_vfs_remove_internal(mp_obj_t vfs_in, mp_obj_t path_in, mp_in res = f_unlink(&self->fatfs, path); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_const_none; } else { @@ -226,7 +231,7 @@ STATIC mp_obj_t fat_vfs_rename(mp_obj_t vfs_in, mp_obj_t path_in, mp_obj_t path_ FILINFO fno; FRESULT res = f_stat(&self->fatfs, old_path, &fno); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } if ((fno.fattrib & AM_DIR) != 0 && strlen(new_path) > strlen(old_path) && @@ -245,7 +250,7 @@ STATIC mp_obj_t fat_vfs_rename(mp_obj_t vfs_in, mp_obj_t path_in, mp_obj_t path_ if (res == FR_OK) { return mp_const_none; } else { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } } @@ -259,7 +264,7 @@ STATIC mp_obj_t fat_vfs_mkdir(mp_obj_t vfs_in, mp_obj_t path_o) { if (res == FR_OK) { return mp_const_none; } else { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } } STATIC MP_DEFINE_CONST_FUN_OBJ_2(fat_vfs_mkdir_obj, fat_vfs_mkdir); @@ -273,7 +278,7 @@ STATIC mp_obj_t fat_vfs_chdir(mp_obj_t vfs_in, mp_obj_t path_in) { FRESULT res = f_chdir(&self->fatfs, path); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_const_none; @@ -286,7 +291,7 @@ STATIC mp_obj_t fat_vfs_getcwd(mp_obj_t vfs_in) { char buf[MICROPY_ALLOC_PATH_MAX + 1]; FRESULT res = f_getcwd(&self->fatfs, buf, sizeof(buf)); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_obj_new_str(buf, strlen(buf)); } @@ -307,7 +312,7 @@ STATIC mp_obj_t fat_vfs_stat(mp_obj_t vfs_in, mp_obj_t path_in) { } else { FRESULT res = f_stat(&self->fatfs, path, &fno); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } } @@ -357,7 +362,7 @@ STATIC mp_obj_t fat_vfs_statvfs(mp_obj_t vfs_in, mp_obj_t path_in) { FATFS *fatfs = &self->fatfs; FRESULT res = f_getfree(fatfs, &nclst); if (FR_OK != res) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } mp_obj_tuple_t *t = MP_OBJ_TO_PTR(mp_obj_new_tuple(10, NULL)); @@ -395,7 +400,7 @@ STATIC mp_obj_t vfs_fat_mount(mp_obj_t self_in, mp_obj_t readonly, mp_obj_t mkfs res = f_mkfs(&self->fatfs, FM_FAT | FM_SFD, 0, working_buf, sizeof(working_buf)); } if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } self->blockdev.flags &= ~MP_BLOCKDEV_FLAG_NO_FILESYSTEM; @@ -416,7 +421,7 @@ STATIC mp_obj_t vfs_fat_getlabel(mp_obj_t self_in) { char working_buf[12]; FRESULT res = f_getlabel(&self->fatfs, working_buf, NULL); if (res != FR_OK) { - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_obj_new_str(working_buf, strlen(working_buf)); } @@ -431,7 +436,7 @@ STATIC mp_obj_t vfs_fat_setlabel(mp_obj_t self_in, mp_obj_t label_in) { if (res == FR_WRITE_PROTECTED) { mp_raise_msg(&mp_type_OSError, MP_ERROR_TEXT("Read-only filesystem")); } - mp_raise_OSError(fresult_to_errno_table[res]); + mp_raise_OSError_fresult(res); } return mp_const_none; } @@ -440,7 +445,7 @@ STATIC const mp_obj_property_t fat_vfs_label_obj = { .base.type = &mp_type_property, .proxy = {(mp_obj_t)&fat_vfs_getlabel_obj, (mp_obj_t)&fat_vfs_setlabel_obj, - (mp_obj_t)MP_ROM_NONE}, + MP_ROM_NONE}, }; #endif diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 65ee5f9024..2415f7d3c1 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -182,7 +182,7 @@ STATIC mp_obj_t file_open(fs_user_mount_t *vfs, const mp_obj_type_t *type, mp_ar } if (rwxa_count != 1 || plus_count > 1 || bt_count > 1 || bad_mode) { - mp_raise_ValueError(translate("Invalid mode")); + mp_arg_error_invalid(MP_QSTR_mode); } assert(vfs != NULL); diff --git a/extmod/vfs_posix_file.c b/extmod/vfs_posix_file.c index a984ace4a2..94ddbe5f7b 100644 --- a/extmod/vfs_posix_file.c +++ b/extmod/vfs_posix_file.c @@ -8,7 +8,7 @@ #include "py/runtime.h" #include "py/stream.h" #include "extmod/vfs_posix.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if (defined(MICROPY_VFS_POSIX) && MICROPY_VFS_POSIX) || (defined(MICROPY_VFS_POSIX_FILE) && MICROPY_VFS_POSIX_FILE) diff --git a/frozen/Adafruit_CircuitPython_APDS9960 b/frozen/Adafruit_CircuitPython_APDS9960 index baab505fd4..f91ffb1a3e 160000 --- a/frozen/Adafruit_CircuitPython_APDS9960 +++ b/frozen/Adafruit_CircuitPython_APDS9960 @@ -1 +1 @@ -Subproject commit baab505fd4dcc54d8e9d45e6463c68bdc6d100eb +Subproject commit f91ffb1a3e77802349f233964e0faed9708a04fe diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE index beec030657..5c1a51f8ad 160000 --- a/frozen/Adafruit_CircuitPython_BLE +++ b/frozen/Adafruit_CircuitPython_BLE @@ -1 +1 @@ -Subproject commit beec03065712cd62f79e839d5cf8f7c9847fc3b1 +Subproject commit 5c1a51f8ad505e90a6c1b58c4d7926c59dd627d6 diff --git a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center index 859a7d403e..810232a6df 160000 --- a/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center +++ b/frozen/Adafruit_CircuitPython_BLE_Apple_Notification_Center @@ -1 +1 @@ -Subproject commit 859a7d403e4e79ec1c8915c81ba581dbaab8a4ac +Subproject commit 810232a6df1c5342b9c89268893025bca2645a0f diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index a8abc3aa8d..5f6ac40707 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit a8abc3aa8dece6c4d0152b001dfca7d2c279f899 +Subproject commit 5f6ac407074c61806c9bf0b78987e1c0ed234dd0 diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index b04042addd..f5351add4b 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit b04042addd47c2645e139032b02a3b9ddeeb3425 +Subproject commit f5351add4bfc2aae1ba8f9078f4a734a0893e8ba diff --git a/frozen/Adafruit_CircuitPython_Crickit b/frozen/Adafruit_CircuitPython_Crickit index 938f6bb335..62113618a0 160000 --- a/frozen/Adafruit_CircuitPython_Crickit +++ b/frozen/Adafruit_CircuitPython_Crickit @@ -1 +1 @@ -Subproject commit 938f6bb335ba5e4c56a8062c591ff9f3c18c4297 +Subproject commit 62113618a07dd4f33310e8454bd59915b376e3cb diff --git a/frozen/Adafruit_CircuitPython_DRV2605 b/frozen/Adafruit_CircuitPython_DRV2605 index 8e7e111a9f..f7bc753d37 160000 --- a/frozen/Adafruit_CircuitPython_DRV2605 +++ b/frozen/Adafruit_CircuitPython_DRV2605 @@ -1 +1 @@ -Subproject commit 8e7e111a9ff39d3f4311caa7babeb451422c759f +Subproject commit f7bc753d37b840d0c1dcbdd977a97d1f68fac306 diff --git a/frozen/Adafruit_CircuitPython_DS3231 b/frozen/Adafruit_CircuitPython_DS3231 index df24498154..f70254c588 160000 --- a/frozen/Adafruit_CircuitPython_DS3231 +++ b/frozen/Adafruit_CircuitPython_DS3231 @@ -1 +1 @@ -Subproject commit df2449815433e05ea0f89c19518ccde7a10a2faa +Subproject commit f70254c588e4be37d92960c8067905ac57243aa2 diff --git a/frozen/Adafruit_CircuitPython_Display_Shapes b/frozen/Adafruit_CircuitPython_Display_Shapes index 708bb0c82c..bcd9e5c085 160000 --- a/frozen/Adafruit_CircuitPython_Display_Shapes +++ b/frozen/Adafruit_CircuitPython_Display_Shapes @@ -1 +1 @@ -Subproject commit 708bb0c82c7b075bd6912c97231aea880b1a1cb8 +Subproject commit bcd9e5c085081175f2dc1b2ce1eba75cfe4be062 diff --git a/frozen/Adafruit_CircuitPython_Display_Text b/frozen/Adafruit_CircuitPython_Display_Text index 0bd04a2355..c82b8138e1 160000 --- a/frozen/Adafruit_CircuitPython_Display_Text +++ b/frozen/Adafruit_CircuitPython_Display_Text @@ -1 +1 @@ -Subproject commit 0bd04a235556979bd13a373821a6602445fe132b +Subproject commit c82b8138e13f4e3d580081929fb34afdb56f59fc diff --git a/frozen/Adafruit_CircuitPython_DotStar b/frozen/Adafruit_CircuitPython_DotStar index eb6124fdff..1b39a6990c 160000 --- a/frozen/Adafruit_CircuitPython_DotStar +++ b/frozen/Adafruit_CircuitPython_DotStar @@ -1 +1 @@ -Subproject commit eb6124fdff59b98d7d49dd86072df99c0e97167b +Subproject commit 1b39a6990c7d18a1c883b5721f2e49cd5fbfc64e diff --git a/frozen/Adafruit_CircuitPython_ESP32SPI b/frozen/Adafruit_CircuitPython_ESP32SPI index 13775b0584..9cca65bd52 160000 --- a/frozen/Adafruit_CircuitPython_ESP32SPI +++ b/frozen/Adafruit_CircuitPython_ESP32SPI @@ -1 +1 @@ -Subproject commit 13775b058422085762874fde8e587f2e9f066855 +Subproject commit 9cca65bd52f1b0be672fa8c1ea74b278366851a9 diff --git a/frozen/Adafruit_CircuitPython_FakeRequests b/frozen/Adafruit_CircuitPython_FakeRequests index f6cdec74b6..3198742a78 160000 --- a/frozen/Adafruit_CircuitPython_FakeRequests +++ b/frozen/Adafruit_CircuitPython_FakeRequests @@ -1 +1 @@ -Subproject commit f6cdec74b64112016c459abe4a5d31a3b34caeb3 +Subproject commit 3198742a78996db3118e0e4db3d142e37b7f58a1 diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch index bccbe3da75..04608edb68 160000 --- a/frozen/Adafruit_CircuitPython_FocalTouch +++ b/frozen/Adafruit_CircuitPython_FocalTouch @@ -1 +1 @@ -Subproject commit bccbe3da75f42b540b3faebb9d5a2d1ccf5e7147 +Subproject commit 04608edb68bc72c015de570b6edf6cc598920acc diff --git a/frozen/Adafruit_CircuitPython_HID b/frozen/Adafruit_CircuitPython_HID index 2fddabcaf0..4d68643dcd 160000 --- a/frozen/Adafruit_CircuitPython_HID +++ b/frozen/Adafruit_CircuitPython_HID @@ -1 +1 @@ -Subproject commit 2fddabcaf0df1763111ed9dbf9e2d4cdb5b0434e +Subproject commit 4d68643dcd779e63b4eada09fa84b1ad43c83362 diff --git a/frozen/Adafruit_CircuitPython_IRRemote b/frozen/Adafruit_CircuitPython_IRRemote index 9771c9369c..9464b4cad1 160000 --- a/frozen/Adafruit_CircuitPython_IRRemote +++ b/frozen/Adafruit_CircuitPython_IRRemote @@ -1 +1 @@ -Subproject commit 9771c9369c7e251f514eb26abcfcea1e891e6f27 +Subproject commit 9464b4cad1f252807cd431a39984182bdd7a0cce diff --git a/frozen/Adafruit_CircuitPython_IS31FL3731 b/frozen/Adafruit_CircuitPython_IS31FL3731 new file mode 160000 index 0000000000..8e2069de65 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_IS31FL3731 @@ -0,0 +1 @@ +Subproject commit 8e2069de65e1b2002ca375e9046ba6e608052c87 diff --git a/frozen/Adafruit_CircuitPython_LC709203F b/frozen/Adafruit_CircuitPython_LC709203F index 29816fbe98..80f1d250f4 160000 --- a/frozen/Adafruit_CircuitPython_LC709203F +++ b/frozen/Adafruit_CircuitPython_LC709203F @@ -1 +1 @@ -Subproject commit 29816fbe98c012ea0a1b5cae7f07aeae7ebf8b52 +Subproject commit 80f1d250f4caef3e81760dc7df56bd250210f29b diff --git a/frozen/Adafruit_CircuitPython_LIS3DH b/frozen/Adafruit_CircuitPython_LIS3DH index acc4bdd73f..0a26239184 160000 --- a/frozen/Adafruit_CircuitPython_LIS3DH +++ b/frozen/Adafruit_CircuitPython_LIS3DH @@ -1 +1 @@ -Subproject commit acc4bdd73fdceb74d75cd5a1f261ae157ee32613 +Subproject commit 0a262391849fa75671c999e9374bf6b160771246 diff --git a/frozen/Adafruit_CircuitPython_LSM6DS b/frozen/Adafruit_CircuitPython_LSM6DS index 75e9ec62e4..87f8b1ddff 160000 --- a/frozen/Adafruit_CircuitPython_LSM6DS +++ b/frozen/Adafruit_CircuitPython_LSM6DS @@ -1 +1 @@ -Subproject commit 75e9ec62e4fe47a7212a69fb84aa1cfa7848e2b3 +Subproject commit 87f8b1ddff699b98e7b58d1c969c0c3633661a08 diff --git a/frozen/Adafruit_CircuitPython_MIDI b/frozen/Adafruit_CircuitPython_MIDI index 6641509ef4..1107fe1520 160000 --- a/frozen/Adafruit_CircuitPython_MIDI +++ b/frozen/Adafruit_CircuitPython_MIDI @@ -1 +1 @@ -Subproject commit 6641509ef43b672a82addf41f02b6466d6c67f01 +Subproject commit 1107fe1520406c20bc561535d72df9ac6ae4d172 diff --git a/frozen/Adafruit_CircuitPython_Motor b/frozen/Adafruit_CircuitPython_Motor index fd478fda7a..b0aca1110b 160000 --- a/frozen/Adafruit_CircuitPython_Motor +++ b/frozen/Adafruit_CircuitPython_Motor @@ -1 +1 @@ -Subproject commit fd478fda7adbd254282b8cad5000f06a96760c91 +Subproject commit b0aca1110b4446bc7952d66233b559256cd4377d diff --git a/frozen/Adafruit_CircuitPython_NeoPixel b/frozen/Adafruit_CircuitPython_NeoPixel index a115fc30df..a4e11ce3a7 160000 --- a/frozen/Adafruit_CircuitPython_NeoPixel +++ b/frozen/Adafruit_CircuitPython_NeoPixel @@ -1 +1 @@ -Subproject commit a115fc30df1c230c09c8a533ca77f3a4afd9f6c3 +Subproject commit a4e11ce3a7f5886c706da5778baf1dd653172c94 diff --git a/frozen/Adafruit_CircuitPython_PortalBase b/frozen/Adafruit_CircuitPython_PortalBase index 77ba8eedf8..b9201eb175 160000 --- a/frozen/Adafruit_CircuitPython_PortalBase +++ b/frozen/Adafruit_CircuitPython_PortalBase @@ -1 +1 @@ -Subproject commit 77ba8eedf89b96c85a6194e5da2061c9d5c20242 +Subproject commit b9201eb175823b82d56168b0b539847093866090 diff --git a/frozen/Adafruit_CircuitPython_ProgressBar b/frozen/Adafruit_CircuitPython_ProgressBar index 011acd627f..0af8820605 160000 --- a/frozen/Adafruit_CircuitPython_ProgressBar +++ b/frozen/Adafruit_CircuitPython_ProgressBar @@ -1 +1 @@ -Subproject commit 011acd627fc24342c397fc640b204a798f7b69dd +Subproject commit 0af8820605c0858f50f3242fbd1ce3a576bec819 diff --git a/frozen/Adafruit_CircuitPython_RFM69 b/frozen/Adafruit_CircuitPython_RFM69 index c58defd709..2fc2bfb8f5 160000 --- a/frozen/Adafruit_CircuitPython_RFM69 +++ b/frozen/Adafruit_CircuitPython_RFM69 @@ -1 +1 @@ -Subproject commit c58defd70947531c5a9c37ddcb569f240567a78b +Subproject commit 2fc2bfb8f52afc2ec1f31e8d860358547b2f8a9a diff --git a/frozen/Adafruit_CircuitPython_RFM9x b/frozen/Adafruit_CircuitPython_RFM9x index 742ac7c8fb..6b018cbeb6 160000 --- a/frozen/Adafruit_CircuitPython_RFM9x +++ b/frozen/Adafruit_CircuitPython_RFM9x @@ -1 +1 @@ -Subproject commit 742ac7c8fb52bb85d9fd367b60a7f80475d7ed14 +Subproject commit 6b018cbeb60d6a30088c866a9b1bc46166209735 diff --git a/frozen/Adafruit_CircuitPython_Register b/frozen/Adafruit_CircuitPython_Register index 49ab415d6b..9c71a86d54 160000 --- a/frozen/Adafruit_CircuitPython_Register +++ b/frozen/Adafruit_CircuitPython_Register @@ -1 +1 @@ -Subproject commit 49ab415d6b601c99979262f9e91c21dcb3a927a7 +Subproject commit 9c71a86d54015260bd40ad4bc8d0258c930bcc64 diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index 270565665a..9ad59c3bc5 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit 270565665ada26fe8d7a99a3cb5941b452444471 +Subproject commit 9ad59c3bc5e2fdc341779ccbbe2d78560c5d681f diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD index 9dd51fecfc..ab504a86af 160000 --- a/frozen/Adafruit_CircuitPython_SD +++ b/frozen/Adafruit_CircuitPython_SD @@ -1 +1 @@ -Subproject commit 9dd51fecfcbb15cb2a00eeadbd66b36ce0c09ee2 +Subproject commit ab504a86afb583bbe9008884bc01b33f0654a0dd diff --git a/frozen/Adafruit_CircuitPython_ST7789 b/frozen/Adafruit_CircuitPython_ST7789 index 79c70a4928..4a094ea8e0 160000 --- a/frozen/Adafruit_CircuitPython_ST7789 +++ b/frozen/Adafruit_CircuitPython_ST7789 @@ -1 +1 @@ -Subproject commit 79c70a49285be8b6548de3f5ca20aa5ac1fafa22 +Subproject commit 4a094ea8e0ca902e7c61822060e149d73fa18ce5 diff --git a/frozen/Adafruit_CircuitPython_SimpleIO b/frozen/Adafruit_CircuitPython_SimpleIO index 272d225365..60d9df0ca0 160000 --- a/frozen/Adafruit_CircuitPython_SimpleIO +++ b/frozen/Adafruit_CircuitPython_SimpleIO @@ -1 +1 @@ -Subproject commit 272d225365eed46916390cf1f393dd08bc00b7d4 +Subproject commit 60d9df0ca09b5005ea0c03b94daae854983d79bd diff --git a/frozen/Adafruit_CircuitPython_SimpleMath b/frozen/Adafruit_CircuitPython_SimpleMath index fad0f89e76..1156062b06 160000 --- a/frozen/Adafruit_CircuitPython_SimpleMath +++ b/frozen/Adafruit_CircuitPython_SimpleMath @@ -1 +1 @@ -Subproject commit fad0f89e760829a76f553ef8459f61001597a846 +Subproject commit 1156062b06771afd37da54d0b690a84ef611a78b diff --git a/frozen/Adafruit_CircuitPython_Thermistor b/frozen/Adafruit_CircuitPython_Thermistor index e86f258e43..79ff12be05 160000 --- a/frozen/Adafruit_CircuitPython_Thermistor +++ b/frozen/Adafruit_CircuitPython_Thermistor @@ -1 +1 @@ -Subproject commit e86f258e43591ce4a04661277e77e9fdf6fec27e +Subproject commit 79ff12be057ff5975e52ad273e087d74deb147ab diff --git a/frozen/Adafruit_CircuitPython_Ticks b/frozen/Adafruit_CircuitPython_Ticks new file mode 160000 index 0000000000..704cac4af3 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_Ticks @@ -0,0 +1 @@ +Subproject commit 704cac4af3dccf8e452e69eb8f9f22fe8db26f83 diff --git a/frozen/Adafruit_CircuitPython_asyncio b/frozen/Adafruit_CircuitPython_asyncio new file mode 160000 index 0000000000..339e037bf6 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_asyncio @@ -0,0 +1 @@ +Subproject commit 339e037bf6cf30e03fab6fa5b1b9f669821f7685 diff --git a/frozen/Adafruit_CircuitPython_seesaw b/frozen/Adafruit_CircuitPython_seesaw index c89c868916..73b78e2424 160000 --- a/frozen/Adafruit_CircuitPython_seesaw +++ b/frozen/Adafruit_CircuitPython_seesaw @@ -1 +1 @@ -Subproject commit c89c8689161e5b35bfe4fa8355615696e03f0648 +Subproject commit 73b78e242424b865785d5e66ccef949bdacf7214 diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index 3bdd335452..4124dfbdaa 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit 3bdd335452ff14a53d1e840de043e3159cb3b829 +Subproject commit 4124dfbdaadce1966f457d7d6c6984e9832999bf diff --git a/frozen/circuitpython_ef_music b/frozen/circuitpython_ef_music new file mode 160000 index 0000000000..6e8eedb147 --- /dev/null +++ b/frozen/circuitpython_ef_music @@ -0,0 +1 @@ +Subproject commit 6e8eedb1475e2b91f8dea7bceebb20e44d70b171 diff --git a/frozen/circuitpython_picoed b/frozen/circuitpython_picoed new file mode 160000 index 0000000000..53f1560246 --- /dev/null +++ b/frozen/circuitpython_picoed @@ -0,0 +1 @@ +Subproject commit 53f15602460329f69fef95498e6b8293aebb513a diff --git a/frozen/mixgo_cp_lib b/frozen/mixgo_cp_lib new file mode 160000 index 0000000000..d5e3e809d7 --- /dev/null +++ b/frozen/mixgo_cp_lib @@ -0,0 +1 @@ +Subproject commit d5e3e809d7aa938b233b49526c55bfd2e314272c diff --git a/frozen/pew-pewpew-lcd b/frozen/pew-pewpew-lcd new file mode 160000 index 0000000000..6452f2a78f --- /dev/null +++ b/frozen/pew-pewpew-lcd @@ -0,0 +1 @@ +Subproject commit 6452f2a78f32cf3b5d07e699f26d25e9c4d10d09 diff --git a/lib/adafruit_floppy b/lib/adafruit_floppy new file mode 160000 index 0000000000..e36a6127b9 --- /dev/null +++ b/lib/adafruit_floppy @@ -0,0 +1 @@ +Subproject commit e36a6127b957ab2f602e031ba3583de9c571582e diff --git a/lib/uzlib/uzlib.h b/lib/uzlib/uzlib.h index 3a4a1ad160..7d8949543e 100644 --- a/lib/uzlib/uzlib.h +++ b/lib/uzlib/uzlib.h @@ -83,6 +83,8 @@ typedef struct { } TINF_TREE; struct uzlib_uncomp { + /* Point to the CircuitPython object that owns this decompression stream */ + void *self; /* Pointer to the next byte in the input buffer */ const unsigned char *source; /* Pointer to the next byte past the input buffer (source_limit = source + len) */ diff --git a/locale/ID.po b/locale/ID.po index 448a289a24..d7044bf74e 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -72,10 +72,27 @@ msgid "" msgstr "" "%d pin alamat, %d rgb pin dan %d ubin menunjukkan ketinggian %d, bukan %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q dan %q berisi pin duplikat" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q berisi pin duplikat" @@ -88,12 +105,7 @@ msgstr "%q gagal: %d" msgid "%q in use" msgstr "%q sedang digunakan" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indeks di luar batas" @@ -101,18 +113,42 @@ msgstr "%q indeks di luar batas" msgid "%q indices must be integers, not %s" msgstr "indeks %q harus bilangan bulat, bukan %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q panjang harus %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "%q panjang harus >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q harus %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q harus <= %d" @@ -121,30 +157,26 @@ msgstr "%q harus <= %d" msgid "%q must be >= %d" msgstr "%q harus >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q harus >= 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q harus >= 1" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "%q harus berupa string" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q harus berupa tuple dengan panjang 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q harus antara %d dan %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -162,7 +194,11 @@ msgstr "%q harus pangkat 2" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q di luar jangkauan" @@ -171,10 +207,6 @@ msgstr "%q di luar jangkauan" msgid "%q pin invalid" msgstr "pin %q tidak valid" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q harus berupa int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -187,7 +219,11 @@ msgstr "%q() mengambil posisi argumen %d tapi %d yang diberikan" msgid "%q, %q, and %q must all be the same length" msgstr "%q, %q, dan %q semuanya harus memiliki panjang yang sama" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s kesalahan 0x%x" @@ -337,10 +373,6 @@ msgstr "'yield from' di dalam fungsi async" msgid "'yield' outside function" msgstr "'yield' diluar fungsi" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x harus menjadi target assignment" @@ -376,16 +408,12 @@ msgstr "ADC2 sedang digunakan oleh WiFi" msgid "Address must be %d bytes long" msgstr "Alamat harus sepanjang %d byte" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Jenis alamat di luar batas" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" @@ -422,7 +450,6 @@ msgstr "" msgid "All event channels in use" msgstr "Semua channel event sedang digunakan" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -470,25 +497,6 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn tidak didukung pada pin yang diberikan" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "fungsionalitas AnalogOut tidak didukung" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut hanya 16 bit. Nilai harus kurang dari 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "pin yang dipakai tidak mendukung AnalogOut" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -527,7 +535,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "" @@ -560,11 +568,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock dan word harus memiliki kesamaan pada clock unit" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Kedalaman bit harus kelipatan 8." @@ -606,11 +609,6 @@ msgstr "Buffer + offset terlalu kecil %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Ukuran buffer salah. Seharusnya %d byte." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffer bukan bytearray." @@ -620,7 +618,6 @@ msgstr "Buffer bukan bytearray." msgid "Buffer is too small" msgstr "Buffer terlalu kecil" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -631,14 +628,10 @@ msgstr "Panjang buffer %d terlalu besar. Itu harus kurang dari %d" msgid "Buffer length must be a multiple of 512" msgstr "Panjang buffer harus kelipatan 512" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Penyangga harus memiliki panjang setidaknya 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -660,10 +653,6 @@ msgstr "Pin bus %d sudah digunakan" msgid "Byte buffer must be 16 bytes." msgstr "Byte buffer harus 16 byte." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes harus di antara 0 dan 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Blok CBC harus merupakan kelipatan 16 byte" @@ -672,7 +661,7 @@ msgstr "Blok CBC harus merupakan kelipatan 16 byte" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -680,6 +669,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "Panggil super().__init__() sebelum mengakses objek asli." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -729,20 +722,10 @@ msgstr "" "Tidak dapat memiliki respon pindaian untuk penyebaran yang terhubung dan " "diperluas." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "" -"Tidak dapat menggunakan output di kedua channel dengan menggunakan pin yang " -"sama" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Tidak dapat membaca tanpa pin MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Tidak dapat merekam ke file" @@ -754,10 +737,8 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" -"Tidak dapat melakukan reset ke bootloader karena tidak ada bootloader yang " -"terisi" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -777,8 +758,8 @@ msgid "Cannot subclass slice" msgstr "Tidak dapat membuat subkelas dari irisan" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Tidak dapat transfer tanpa pin MOSI dan MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" @@ -786,14 +767,13 @@ msgstr "" "Tidak dapat membuat variasi frekuensi pada penghitung waktu yang sudah " "digunakan" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Tidak dapat menulis tanpa pin MOSI." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -807,10 +787,6 @@ msgstr "Kode inti CircuitPython mengalami crash. Aduh!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Init pin clock gagal." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Peregangan clock terlalu panjang" @@ -819,11 +795,6 @@ msgstr "Peregangan clock terlalu panjang" msgid "Clock unit in use" msgstr "Clock unit sedang digunakan" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Perintah harus berupa int di antara 0 dan 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -835,35 +806,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "File .mpy rusak" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Tidak dapat menginisialisasi UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Tidak dapat menginisialisasi ulang kanal" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Tidak dapat menginisialisasi ulang timer" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Tidak dapat memulai ulang PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -884,20 +826,6 @@ msgstr "Tidak dapat memulai interupsi, RX sibuk" msgid "Couldn't allocate decoder" msgstr "Tidak dapat mengalokasikan dekoder" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Tidak dapat mengalokasikan penyangga pertama" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Tidak dapat mengalokasikan penyangga masukan" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Tidak dapat mengalokasikan penyangga kedua" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Gagal ke HardFault_Handler." @@ -945,10 +873,6 @@ msgstr "Kapasitas tujuan lebih kecil dari destination_length." msgid "Device in use" msgstr "Perangkat sedang digunakan" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut tidak didukung pada pin yang diberikan" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -960,6 +884,10 @@ msgstr "Tampilan harus memiliki ruang warna 16 bit." msgid "Display rotation must be in 90 degree increments" msgstr "Rotasi tampilan harus dalam kelipatan 90 derajat" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "Mode kendara tidak digunakan saat arah input." @@ -995,20 +923,16 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Diharapkan %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" +msgid "Expected an %q" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Diharapkan tuple dengan panjang %d, didapatkan %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1035,21 +959,9 @@ msgstr "Gagal mengirim perintah." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Gagal memperoleh mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Gagal untuk mengalokasikan buffer RX" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1072,10 +984,6 @@ msgstr "Gagal terhubung: kesalahan internal" msgid "Failed to connect: timeout" msgstr "Gagal terhubung: habis waktu" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Gagal mengurai file MP3" @@ -1119,9 +1027,9 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" #: shared-bindings/pwmio/PWMOut.c @@ -1133,7 +1041,11 @@ msgstr "Frekuensi harus cocok dengan PWMOut yang ada menggunakan timer ini" msgid "Function requires lock" msgstr "Fungsinya membutuhkan kunci" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1160,19 +1072,16 @@ msgstr "Perangkat keras sibuk, coba pin alternatif" msgid "Hardware in use, try alternative pins" msgstr "Perangkat keras sedang digunakan, coba pin alternatif" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "operasi I/O pada file tertutup" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "Gagal Inisialisasi I2C" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1279,75 +1188,37 @@ msgstr "" msgid "Internal error #%d" msgstr "Kesalahan internal #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "%q pada tidak valid" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Nilai Unit ADC tidak valid" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "File BMP tidak valid" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Pin DAC yang diberikan tidak valid" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Frekuensi PWM tidak valid" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Argumen tidak valid" @@ -1355,42 +1226,11 @@ msgstr "Argumen tidak valid" msgid "Invalid bits per value" msgstr "Bit per nilai tidak valid" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Ukuran buffer tidak valid" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "String byteorder tidak valid" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Periode penangkapan tidak valid. Kisaran yang valid: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Jumlah kanal tidak valid" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Arah tidak valid." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "File tidak valid" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ukuran potongan format tidak valid" @@ -1399,79 +1239,15 @@ msgstr "Ukuran potongan format tidak valid" msgid "Invalid memory access." msgstr "Akses memori tidak valid." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Jumlah bit tidak valid" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Fase tidak valid" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Pin tidak valid" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Pin untuk channel kiri tidak valid" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Pin untuk channel kanan tidak valid" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Pin-pin tidak valid" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Polaritas tidak valid" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Properti tidak valid" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Mode operasi tidak valid." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "security_mode tidak valid" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1479,27 +1255,10 @@ msgstr "" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Suara tidak valid" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Hitungan suara tidak valid" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "File wave tidak valid" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Panjang kata/bit tidak valid" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Panjang kunci harus 16, 24, atau 32 byte" @@ -1513,24 +1272,16 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS dari keyword arg harus menjadi sebuah id" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Layer sudah ada dalam grup." - -#: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer harus sebuah Grup atau subklas dari TileGrid." - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c -msgid "MAC address was invalid" +msgid "Layer already in a group" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "Pin MISO gagal inisialisasi." +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Pin MOSI gagal inisialisasi." +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +msgid "MAC address was invalid" +msgstr "" #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" @@ -1541,18 +1292,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "Nilai x maksimum ketika dicerminkan adalah %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Penundaan mulai mikrofon harus dalam kisaran 0,0 hingga 1,0" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Tidak menemukan Pin MISO atau MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1588,11 +1348,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Harus berupa subclass %q." @@ -1618,6 +1373,10 @@ msgstr "" msgid "Name too long" msgstr "Nama terlalu panjang" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1648,16 +1407,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Tidak ada Pin MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Tidak ada Pin MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1696,16 +1467,6 @@ msgstr "Tidak ada GCLK yang kosong" msgid "No hardware random available" msgstr "Tidak ada perangkat keras acak yang tersedia" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Tidak ada dukungan perangkat keras pada pin clk" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Tidak ada dukungan hardware untuk pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1750,6 +1511,10 @@ msgstr "Tidak ada pull-down pada pin; 1Mohm direkomendasikan" msgid "No space left on device" msgstr "Tidak ada ruang yang tersisa di perangkat" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Tidak ada file/direktori" @@ -1800,6 +1565,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Parity ganjil tidak didukung" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1809,7 +1582,7 @@ msgstr "Hanya 8 atau 16 bit mono dengan " msgid "Only IPv4 addresses supported" msgstr "Hanya alamat IPv4 yang didukung" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "Hanysa socket IPv4 yang didukung" @@ -1846,15 +1619,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1862,19 +1639,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Waktu habis" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Kehabisan memori" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "Kehabisan socket" @@ -1882,11 +1663,6 @@ msgstr "Kehabisan socket" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Sampel berlebihan harus kelipatan 8." @@ -1895,11 +1671,6 @@ msgstr "Sampel berlebihan harus kelipatan 8." msgid "PDMIn not available" msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "PWM duty_cycle harus antara 0 dan 65535 inklusif (resolusi 16 bit)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1907,6 +1678,10 @@ msgstr "" "Frekuensi PWM tidak dapat ditulis ketika variabel_frequency Salah pada " "konstruksi." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1923,29 +1698,14 @@ msgstr "Periferal sedang digunakan" msgid "Permission denied" msgstr "Izin ditolak" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Jumlah pin terlalu besar" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2017,18 +1777,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull tidak digunakan saat arah output." @@ -2050,8 +1802,9 @@ msgstr "Kesalahan DeInit RNG" msgid "RNG Init Error" msgstr "Kesalahan Init RNG" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2059,21 +1812,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "Pembalikan RS485 ditentukan saat tidak dalam mode RS485" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "Kalibrasi RTC tidak didukung pada board ini" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC tidak didukung di board ini" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS/CTS/RS485 Belum didukung pada perangkat ini" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Kesalahan pembuatan nomor acak" @@ -2091,10 +1833,14 @@ msgstr "sistem file (filesystem) bersifat Read-only" msgid "Read-only object" msgstr "Objek Read-only" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "Segarkan terlalu cepat" @@ -2107,7 +1853,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "Mode AES yang diminta tidak didukung" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2125,6 +1871,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2135,30 +1885,21 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "Kesalahan Init SPI" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "Kesalahan Inisialisasi ulang SPI" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Tingkat sampel harus positif" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Nilai sampel terlalu tinggi. Nilai harus kurang dari %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2178,14 +1919,6 @@ msgstr "Serializer sedang digunakan" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2221,10 +1954,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Memisahkan dengan menggunakan sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Ukuran stack minimal harus 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2310,10 +2039,6 @@ msgstr "Tinggi tile harus persis membagi tinggi bitmap" msgid "Tile index out of bounds" msgstr "Indeks ubin di luar batas" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Nilai ubin di luar batas" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Lebar ubin harus persis membagi lebar bitmap" @@ -2333,6 +2058,9 @@ msgid "To exit, please reset the board without " msgstr "Untuk keluar, silahkan reset board tanpa " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Terlalu banyak channel dalam sampel" @@ -2365,24 +2093,21 @@ msgid "Tuple or struct_time argument required" msgstr "Diperlukan argumen Tuple atau struct_time" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "Kesalahan alokasi Buffer UART" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "Kesalahan UART De-init" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "Kesalahan Init UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "Kesalahan Re-init UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "Kesalahan penulisan UART" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2520,12 +2245,6 @@ msgstr "" "Masalah yang tidak ditentukan. Bisa jadi permintaan pemasangan pada " "perangkat lain ditolak atau diabaikan." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Baudrate tidak didukung" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2538,9 +2257,9 @@ msgstr "Tipe bus tampilan tidak didukung" msgid "Unsupported format" msgstr "Format tidak didukung" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operasi yang tidak didukung" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2560,7 +2279,7 @@ msgstr "Panjang nilai != Panjang tetap yang dibutuhkan" msgid "Value length > max_length" msgstr "Panjang nilai > max_length" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2590,10 +2309,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2604,8 +2319,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2646,11 +2361,11 @@ msgstr "__new__ arg harus berupa user-type" msgid "a bytes-like object is required" msgstr "sebuah objek menyerupai byte (bytes-like) dibutuhkan" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "alamat di luar batas" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "alamatnya kosong" @@ -2699,6 +2414,10 @@ msgstr "argumen harus berupa ndarrays" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2760,10 +2479,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2801,11 +2516,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "byte > 8 bit tidak didukung" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2814,7 +2524,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "kalibrasi keluar dari jangkauan" @@ -2822,12 +2532,9 @@ msgstr "kalibrasi keluar dari jangkauan" msgid "calibration is read only" msgstr "kalibrasi adalah read only" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "nilai kalibrasi keluar dari jangkauan +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2850,7 +2557,7 @@ msgstr "tidak dapat menetapkan ke ekspresi" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -2998,6 +2705,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3010,10 +2721,6 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3078,6 +2785,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3161,10 +2872,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3173,6 +2880,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap kosong" @@ -3202,6 +2913,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "error = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "" @@ -3276,7 +2993,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3312,6 +3029,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" @@ -3420,7 +3141,7 @@ msgstr "" msgid "incorrect padding" msgstr "lapisan (padding) tidak benar" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3438,6 +3159,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3483,6 +3208,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3491,11 +3220,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3575,6 +3300,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "micropython decorator tidak valid" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "" @@ -3688,10 +3417,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3699,12 +3424,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3838,7 +3559,7 @@ msgstr "" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "" @@ -3949,7 +3670,11 @@ msgstr "" msgid "odd-length string" msgstr "panjang data string memiliki keganjilan (odd-length)" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4074,10 +3799,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "Muncul dari PulseIn yang kosong" @@ -4103,63 +3824,23 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4179,14 +3860,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "antrian meluap (overflow)" @@ -4238,12 +3911,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4341,10 +4008,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" @@ -4357,10 +4020,6 @@ msgstr "" msgid "step must be non-zero" msgstr "" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4409,10 +4068,6 @@ msgstr "sintaksis error pada pendeskripsi uctypes" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4432,10 +4087,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "waktu habis harus >= 0,0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4444,6 +4095,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4614,6 +4269,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4635,13 +4298,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4661,7 +4318,17 @@ msgstr "indeks sumbu salah" msgid "wrong axis specified" msgstr "sumbu yang ditentukan salah" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "tipe input salah" @@ -4669,6 +4336,10 @@ msgstr "tipe input salah" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "jumlah argumen salah" @@ -4713,6 +4384,249 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "Zi harus berbentuk (n_section, 2)" +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q harus berupa tuple dengan panjang 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q harus antara %d dan %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q harus berupa int" + +#~ msgid "Address type out of range" +#~ msgstr "Jenis alamat di luar batas" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn tidak didukung pada pin yang diberikan" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "fungsionalitas AnalogOut tidak didukung" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut hanya 16 bit. Nilai harus kurang dari 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "pin yang dipakai tidak mendukung AnalogOut" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Ukuran buffer salah. Seharusnya %d byte." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Penyangga harus memiliki panjang setidaknya 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes harus di antara 0 dan 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "" +#~ "Tidak dapat menggunakan output di kedua channel dengan menggunakan pin " +#~ "yang sama" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Tidak dapat membaca tanpa pin MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Tidak dapat melakukan reset ke bootloader karena tidak ada bootloader " +#~ "yang terisi" + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Tidak dapat transfer tanpa pin MOSI dan MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Tidak dapat menulis tanpa pin MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Init pin clock gagal." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Perintah harus berupa int di antara 0 dan 255" + +#~ msgid "Could not initialize UART" +#~ msgstr "Tidak dapat menginisialisasi UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Tidak dapat menginisialisasi ulang kanal" + +#~ msgid "Could not re-init timer" +#~ msgstr "Tidak dapat menginisialisasi ulang timer" + +#~ msgid "Could not restart PWM" +#~ msgstr "Tidak dapat memulai ulang PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Tidak dapat mengalokasikan penyangga pertama" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Tidak dapat mengalokasikan penyangga masukan" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Tidak dapat mengalokasikan penyangga kedua" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut tidak didukung pada pin yang diberikan" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Diharapkan tuple dengan panjang %d, didapatkan %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Gagal untuk mengalokasikan buffer RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" + +#~ msgid "I2C Init Error" +#~ msgstr "Gagal Inisialisasi I2C" + +#~ msgid "Invalid BMP file" +#~ msgstr "File BMP tidak valid" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Pin DAC yang diberikan tidak valid" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Frekuensi PWM tidak valid" + +#~ msgid "Invalid buffer size" +#~ msgstr "Ukuran buffer tidak valid" + +#~ msgid "Invalid byteorder string" +#~ msgstr "String byteorder tidak valid" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Periode penangkapan tidak valid. Kisaran yang valid: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Jumlah kanal tidak valid" + +#~ msgid "Invalid direction." +#~ msgstr "Arah tidak valid." + +#~ msgid "Invalid file" +#~ msgstr "File tidak valid" + +#~ msgid "Invalid number of bits" +#~ msgstr "Jumlah bit tidak valid" + +#~ msgid "Invalid phase" +#~ msgstr "Fase tidak valid" + +#~ msgid "Invalid pin" +#~ msgstr "Pin tidak valid" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Pin untuk channel kiri tidak valid" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Pin untuk channel kanan tidak valid" + +#~ msgid "Invalid polarity" +#~ msgstr "Polaritas tidak valid" + +#~ msgid "Invalid properties" +#~ msgstr "Properti tidak valid" + +#~ msgid "Invalid run mode." +#~ msgstr "Mode operasi tidak valid." + +#~ msgid "Invalid security_mode" +#~ msgstr "security_mode tidak valid" + +#~ msgid "Invalid voice" +#~ msgstr "Suara tidak valid" + +#~ msgid "Invalid voice count" +#~ msgstr "Hitungan suara tidak valid" + +#~ msgid "Invalid wave file" +#~ msgstr "File wave tidak valid" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Panjang kata/bit tidak valid" + +#~ msgid "Layer already in a group." +#~ msgstr "Layer sudah ada dalam grup." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer harus sebuah Grup atau subklas dari TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "Pin MISO gagal inisialisasi." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Pin MOSI gagal inisialisasi." + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Tidak ada dukungan perangkat keras pada pin clk" + +#~ msgid "No hardware support on pin" +#~ msgstr "Tidak ada dukungan hardware untuk pin" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "PWM duty_cycle harus antara 0 dan 65535 inklusif (resolusi 16 bit)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "Kalibrasi RTC tidak didukung pada board ini" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 Belum didukung pada perangkat ini" + +#~ msgid "SPI Init Error" +#~ msgstr "Kesalahan Init SPI" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "Kesalahan Inisialisasi ulang SPI" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Tingkat sampel harus positif" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Nilai sampel terlalu tinggi. Nilai harus kurang dari %d" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Ukuran stack minimal harus 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Nilai ubin di luar batas" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "Kesalahan alokasi Buffer UART" + +#~ msgid "UART De-init error" +#~ msgstr "Kesalahan UART De-init" + +#~ msgid "UART Init Error" +#~ msgstr "Kesalahan Init UART" + +#~ msgid "UART Re-init error" +#~ msgstr "Kesalahan Re-init UART" + +#~ msgid "UART write error" +#~ msgstr "Kesalahan penulisan UART" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Baudrate tidak didukung" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "byte > 8 bit tidak didukung" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "nilai kalibrasi keluar dari jangkauan +/-127" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "waktu habis harus >= 0,0" + +#~ msgid "Unsupported operation" +#~ msgstr "Operasi yang tidak didukung" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 0ce564f1f7..52f1bdb5ad 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -66,10 +66,27 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -82,12 +99,7 @@ msgstr "" msgid "%q in use" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "" @@ -95,18 +107,42 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -115,29 +151,25 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -156,7 +188,11 @@ msgstr "" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -165,10 +201,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -181,7 +213,11 @@ msgstr "" msgid "%q, %q, and %q must all be the same length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -331,10 +367,6 @@ msgstr "" msgid "'yield' outside function" msgstr "" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -370,16 +402,12 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" @@ -416,7 +444,6 @@ msgstr "" msgid "All event channels in use" msgstr "" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -464,25 +491,6 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -521,7 +529,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "" @@ -552,11 +560,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" @@ -598,11 +601,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -612,7 +610,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -623,14 +620,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -652,10 +645,6 @@ msgstr "" msgid "Byte buffer must be 16 bytes." msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "" - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "" @@ -664,7 +653,7 @@ msgstr "" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -672,6 +661,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -719,18 +712,10 @@ msgstr "" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "" @@ -742,7 +727,7 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -763,20 +748,19 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -791,10 +775,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -803,11 +783,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -818,35 +793,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -867,20 +813,6 @@ msgstr "" msgid "Couldn't allocate decoder" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -928,10 +860,6 @@ msgstr "" msgid "Device in use" msgstr "" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -943,6 +871,10 @@ msgstr "" msgid "Display rotation must be in 90 degree increments" msgstr "" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "" @@ -978,18 +910,14 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" +msgid "Expected an %q" msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c @@ -1018,20 +946,8 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" msgstr "" #: ports/espressif/common-hal/wifi/__init__.c @@ -1055,10 +971,6 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -1102,9 +1014,9 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" #: shared-bindings/pwmio/PWMOut.c @@ -1116,7 +1028,11 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1143,19 +1059,16 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1260,75 +1173,37 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1336,42 +1211,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -1380,79 +1224,15 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "" - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1460,27 +1240,10 @@ msgstr "" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1494,25 +1257,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1522,18 +1277,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1569,11 +1333,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1599,6 +1358,10 @@ msgstr "" msgid "Name too long" msgstr "" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1629,16 +1392,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" -#: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c -msgid "No MISO Pin" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1677,16 +1452,6 @@ msgstr "" msgid "No hardware random available" msgstr "" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1731,6 +1496,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1780,6 +1549,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1789,7 +1566,7 @@ msgstr "" msgid "Only IPv4 addresses supported" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1822,15 +1599,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1838,19 +1619,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1858,11 +1643,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1873,12 +1653,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1897,29 +1676,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -1986,18 +1750,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2019,8 +1775,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2028,21 +1785,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "" @@ -2060,10 +1806,14 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "" @@ -2076,7 +1826,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2092,6 +1842,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2102,29 +1856,20 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2145,14 +1890,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2188,10 +1925,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2277,10 +2010,6 @@ msgstr "" msgid "Tile index out of bounds" msgstr "" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "" @@ -2300,6 +2029,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2332,23 +2064,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2485,12 +2214,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2503,8 +2226,8 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c @@ -2525,7 +2248,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2555,10 +2278,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2569,8 +2288,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2611,11 +2330,11 @@ msgstr "" msgid "a bytes-like object is required" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "" @@ -2664,6 +2383,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2725,10 +2448,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2766,11 +2485,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2779,7 +2493,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2787,12 +2501,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2815,7 +2526,7 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -2963,6 +2674,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -2975,10 +2690,6 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3043,6 +2754,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3126,10 +2841,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3138,6 +2849,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3167,6 +2882,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "" @@ -3241,7 +2962,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3277,6 +2998,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" @@ -3385,7 +3110,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3403,6 +3128,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3448,6 +3177,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3456,11 +3189,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3540,6 +3269,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "" @@ -3653,10 +3386,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3664,12 +3393,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3803,7 +3528,7 @@ msgstr "" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "" @@ -3914,7 +3639,11 @@ msgstr "" msgid "odd-length string" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4038,10 +3767,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4067,63 +3792,23 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4143,14 +3828,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4202,12 +3879,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4305,10 +3976,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" @@ -4321,10 +3988,6 @@ msgstr "" msgid "step must be non-zero" msgstr "" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4373,10 +4036,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4396,10 +4055,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4408,6 +4063,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4578,6 +4237,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4599,13 +4266,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4625,7 +4286,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4633,6 +4304,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index b9fa742cc1..27f426e658 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -6,15 +6,15 @@ 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: 2021-12-23 01:53+0000\n" -"Last-Translator: dronecz \n" +"PO-Revision-Date: 2022-06-11 10:17+0000\n" +"Last-Translator: Matěj Soukup \n" "Language-Team: LANGUAGE \n" "Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 4.10.1\n" +"X-Generator: Weblate 4.13-dev\n" #: main.c msgid "" @@ -29,6 +29,8 @@ msgid "" "\n" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +"\n" +"Kód byl zastaven kvůli automatickému načtení. K načtení dojde brzy.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -71,10 +73,27 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "%d adresní pin, %d rgb pin a %d dlaždice indikuje výšku %d, ne %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "%q" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q a %q obsahují duplicitní piny" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "%q a %q musí být rozdílné" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q obsahuje duplicitní piny" @@ -87,12 +106,7 @@ msgstr "%q: selhání %d" msgid "%q in use" msgstr "%q se právě používá" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Index %q je mimo rozsah" @@ -100,18 +114,42 @@ msgstr "Index %q je mimo rozsah" msgid "%q indices must be integers, not %s" msgstr "Indexy %q musí být celá čísla, nikoli %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "Inicializace %q selhala" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "Délka %q musí být %d" + #: py/argcheck.c msgid "%q length must be %d-%d" -msgstr "%q délka musí být %d-%d" +msgstr "%q délka musí být %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "Délka %q musí být <= %d" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "Délka %q musí být >= %d" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" -msgstr "%q délka musí být >= 1" +msgstr "%q délka musí být >= 1" + +#: py/argcheck.c +msgid "%q must be %d" +msgstr "%q musí být %d" #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q musí být %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "%q musí být 1, pokud %q je True" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q musí být <= %d" @@ -120,30 +158,26 @@ msgstr "%q musí být <= %d" msgid "%q must be >= %d" msgstr "%q musí být >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q musí být >= 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q musí být > = 1" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "%q musí být string" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q musí být n-tice délky 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q musí být mezi %d a %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "%q musí být int" #: py/argcheck.c msgid "%q must be of type %q" @@ -151,7 +185,7 @@ msgstr "%q musí být typu %q" #: shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" -msgstr "" +msgstr "%q musí být typu %q nebo None" #: ports/atmel-samd/common-hal/busio/UART.c msgid "%q must be power of 2" @@ -161,7 +195,11 @@ msgstr "%q musí být mocnina 2" msgid "%q out of bounds" msgstr "%q je mimo hranice" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q je mimo rozsah" @@ -170,10 +208,6 @@ msgstr "%q je mimo rozsah" msgid "%q pin invalid" msgstr "pin %q není platný" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q by měl být int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q s ID 0 musím být délky 1" @@ -186,7 +220,11 @@ msgstr "%q() vyžaduje %d pozičních argumentů, ale %d jich bylo zadáno" msgid "%q, %q, and %q must all be the same length" msgstr "%q, %q, a %q musí mít všechny shodnou délku" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s chyba 0x%x" @@ -219,17 +257,17 @@ msgstr "'%s' očekává popisek" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format msgid "'%s' expects a register" -msgstr "'%s' očekává register" +msgstr "'%s' očekává registr" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects a special register" -msgstr "'%s' očekává speciální register" +msgstr "'%s' očekává speciální registr" #: py/emitinlinethumb.c #, c-format msgid "'%s' expects an FPU register" -msgstr "'%s' očekává register FPU" +msgstr "'%s' očekává registr FPU" #: py/emitinlinethumb.c #, c-format @@ -286,59 +324,55 @@ msgstr "" #: shared-module/struct/__init__.c msgid "'S' and 'O' are not supported format types" -msgstr "" +msgstr "'S' a 'O' nejsou podporované typy formátů" #: py/compile.c msgid "'align' requires 1 argument" -msgstr "" +msgstr "'align' vyžaduje 1 argument" #: py/compile.c msgid "'await' outside function" -msgstr "" +msgstr "'await' je volán mimo funkci" #: py/compile.c msgid "'await', 'async for' or 'async with' outside async function" -msgstr "" +msgstr "'await', 'async for' nebo 'async' je volán mimo async" #: py/compile.c msgid "'break' outside loop" -msgstr "" +msgstr "'break' je volán vně cyklu" #: py/compile.c msgid "'continue' outside loop" -msgstr "" +msgstr "'continue' je volán vně cyklu" #: py/objgenerator.c msgid "'coroutine' object is not an iterator" -msgstr "" +msgstr "Objekt 'coroutine' není iterátor" #: py/compile.c msgid "'data' requires at least 2 arguments" -msgstr "" +msgstr "'data' vyžaduje nejméně 2 argumenty" #: py/compile.c msgid "'data' requires integer arguments" -msgstr "" +msgstr "'data' vyžaduje celočíselné argumenty" #: py/compile.c msgid "'label' requires 1 argument" -msgstr "" +msgstr "'label' vyžaduje 1 argument" #: py/compile.c msgid "'return' outside function" -msgstr "" +msgstr "'return' je volán mimo funkci" #: py/compile.c msgid "'yield from' inside async function" -msgstr "" +msgstr "'yield from' volán uvnitř funkce async" #: py/compile.c msgid "'yield' outside function" -msgstr "" - -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" +msgstr "'yield' je volán mimo funkci" #: py/compile.c msgid "*x must be assignment target" @@ -346,7 +380,7 @@ msgstr "" #: py/obj.c msgid ", in %q\n" -msgstr ", v %q\n" +msgstr ", v% q\n" #: py/objcomplex.c msgid "0.0 to a complex power" @@ -354,74 +388,69 @@ msgstr "" #: py/modbuiltins.c msgid "3-arg pow() not supported" -msgstr "" +msgstr "pow() nepodporuje 3 argumenty" #: shared-module/msgpack/__init__.c msgid "64 bit types" -msgstr "" +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 msgid "A hardware interrupt channel is already in use" -msgstr "" +msgstr "Kanál hardwarového přerušení je již používán" #: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" -msgstr "" +msgstr "WiFi používá ADC2" #: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c #, c-format msgid "Address must be %d bytes long" -msgstr "" - -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" +msgstr "Adresa musí být %d bajtů dlouhá" #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" -msgstr "" +msgstr "Všechny CAN periferie jsou používány" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" -msgstr "" +msgstr "Všechny I2C periferie jsou používány" #: ports/espressif/common-hal/countio/Counter.c #: ports/espressif/common-hal/frequencyio/FrequencyIn.c #: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c msgid "All PCNT units in use" -msgstr "" +msgstr "Všechny PCNT jednotky jsou používány" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "All RX FIFOs in use" -msgstr "" +msgstr "Všechny RX FIFO jsou používány" #: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" -msgstr "" +msgstr "Všechny SPI periferie jsou používány" #: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c msgid "All UART peripherals are in use" -msgstr "" +msgstr "Všechny UART periferie jsou používány" #: ports/nrf/common-hal/countio/Counter.c #: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/nrf/common-hal/rotaryio/IncrementalEncoder.c #: shared-bindings/pwmio/PWMOut.c msgid "All channels in use" -msgstr "" +msgstr "Všechny kanály jsou používány" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "All event channels in use" -msgstr "" +msgstr "Všechny kanály událostí jsou již používány" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -432,7 +461,7 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "All timers for this pin are in use" -msgstr "" +msgstr "Všechny časovače pro tento pin jsou používány" #: ports/atmel-samd/common-hal/_pew/PewPew.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -449,12 +478,12 @@ msgstr "" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c msgid "All timers in use" -msgstr "" +msgstr "Všechny časovače jsou použity" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Already advertising." -msgstr "" +msgstr "Již propagujeme." #: ports/atmel-samd/common-hal/canio/Listener.c msgid "Already have all-matches listener" @@ -463,189 +492,155 @@ msgstr "" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c msgid "Already running" -msgstr "" +msgstr "Již běží" #: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" -msgstr "" - -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "" +msgstr "Již skenuje wifi sítě" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" -msgstr "" +msgstr "Jiný PWMAudioOut je již aktivní" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c msgid "Another send is already active" -msgstr "" +msgstr "Další odesílání je již aktivní" #: shared-bindings/pulseio/PulseOut.c msgid "Array must contain halfwords (type 'H')" -msgstr "" +msgstr "Pole musí obsahovat poloviční slova (typ „H“)" #: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c msgid "Array values should be single bytes." -msgstr "" +msgstr "Hodnoty pole by měly být jednoduché bajty." #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "Lze zadat maximálně %d %q (nikoli %d)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format msgid "Attempt to allocate %d blocks" -msgstr "" +msgstr "Pokus o alokování %d bloků" #: supervisor/shared/safe_mode.c msgid "Attempted heap allocation when VM not running." -msgstr "" +msgstr "Pokus o alokaci haldy, když neběží VM." #: ports/raspberrypi/audio_dma.c msgid "Audio conversion not implemented" -msgstr "" +msgstr "Konverze audia není implementována" #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" -msgstr "" +msgstr "AuthMode.OPEN nepoužívá heslo" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" -msgstr "" +msgstr "Autentizace selhala" #: main.c msgid "Auto-reload is off.\n" -msgstr "Automatické načtení je vypnuté.\n" +msgstr "Automatické načtení je vypnuto.\n" #: main.c msgid "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" msgstr "" -"Automatické načtení je zapnuté. Stačí uložit soubory na USB nebo vstoupit " -"do REPLu pro jeho zakázání.\n" +"Automatické opětovné načtení je zapnuto. Jednoduše uložte soubory přes USB a " +"spusťte je, nebo vypněte REPL.\n" #: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" -msgstr "" +msgstr "Baudrate není podporován periférií" #: shared-module/displayio/Display.c #: shared-module/framebufferio/FramebufferDisplay.c msgid "Below minimum frame rate" -msgstr "" +msgstr "Pod minimální obnovovací frekvencí" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must be sequential pins" -msgstr "" +msgstr "Bitové hodiny a výběr slov musí být sekvenční piny" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" -msgstr "" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" +msgstr "Výběr bitových hodin a slov musí sdílet jednotku hodin" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "" +msgstr "Bitová hloubka musí být násobkem 8." #: shared-bindings/bitmaptools/__init__.c msgid "Bitmap size and bits per value must match" -msgstr "" +msgstr "Velikost bitmapy a počet bitů na hodnotu se musí shodovat" #: supervisor/shared/safe_mode.c msgid "Boot device must be first device (interface #0)." -msgstr "" +msgstr "Bootovací zařízení musí být první (rozhraní #0)." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "RX a TX jsou vyžadovány pro kontrolu toku" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" -msgstr "" +msgstr "Oba piny musí podporovat hardwarové přerušení" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c #: shared-bindings/is31fl3741/FrameBuffer.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "Jas musí být 0-1,0" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Jas není nastavitelný" #: shared-bindings/_bleio/UUID.c #, c-format msgid "Buffer + offset too small %d %d %d" -msgstr "" +msgstr "Vyrovnávací paměť + offset je příliš malý %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Buffer elements must be 4 bytes long or less" -msgstr "" - -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" +msgstr "Prvky bufferu musí být 4 bajty dlouhé nebo méně" #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Buffer není bytearray." #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "Vyrovnávací paměť je příliš malá" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "Délka vyrovnávací paměti %d je příliš velká. Musí být menší než %d" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "Délka vyrovnávací paměti musí být násobkem 512" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" -msgstr "" - -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "" +msgstr "Buffer musí být násobkem 512 bajtů" #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" -msgstr "" +msgstr "Buffer je příliš krátký o %d bajtů" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "Buffers must be same size" -msgstr "" +msgstr "Buffery musí mít stejnou velikost" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c @@ -653,31 +648,31 @@ msgstr "" #: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" -msgstr "" +msgstr "Sběrnicový pin %d je již používán" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." -msgstr "" - -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "" +msgstr "Bajtový buffer musí být 16 bajtů." #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "Bloky CBC musí být násobky 16 bajtů" #: supervisor/shared/safe_mode.c msgid "CIRCUITPY drive could not be found or created." -msgstr "" +msgstr "Disk CIRCUITPY nelze nalézt nebo vytvořit." -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "" +msgstr "Volání super().__init__() před přístupem k nativnímu objektu." + +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "Inizializace kamery" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." @@ -694,63 +689,56 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "Can't set CCCD on local Characteristic" -msgstr "" +msgstr "Nelze nastavit CCCD na místní charakteristiku" #: shared-bindings/storage/__init__.c shared-bindings/usb_cdc/__init__.c #: shared-bindings/usb_hid/__init__.c shared-bindings/usb_midi/__init__.c msgid "Cannot change USB devices now" -msgstr "" +msgstr "Nelze změnit USB zařízení" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "Není možné vytvořit nový adaptér; použití _bleio.adapter;" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" -msgstr "" +msgstr "Nelze odstranit hodnoty" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c #: ports/nrf/common-hal/digitalio/DigitalInOut.c #: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c msgid "Cannot get pull while in output mode" -msgstr "" +msgstr "Nelze získat ve výstupním režimu" #: ports/nrf/common-hal/microcontroller/Processor.c msgid "Cannot get temperature" -msgstr "" +msgstr "Nelze získat teplotu" #: shared-bindings/_bleio/Adapter.c msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" -msgstr "" +msgstr "Nelze nahrávat do souboru" #: shared-module/storage/__init__.c msgid "Cannot remount '/' when visible via USB." -msgstr "" +msgstr "Není možné znovu připojit '/', pokud je viditelné pomocí USB." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" +"Reset do bootloaderu není možný, protože žádný bootloader není přítomen" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -758,101 +746,63 @@ msgstr "" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "" +msgstr "Nelze nastavit hodnotu, když směr je vstup." #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" -msgstr "" +msgstr "Nelze určit RTS nebo CTS v režimu RS485" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "" +msgstr "Nelze použít řez podtřídy" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" +msgstr "Nelze měnit frekvenci časovače, který je již používán" + +#: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" msgstr "" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "" - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" -msgstr "" +msgstr "CharacteristicBuffer psaní není poskytováno" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "" +msgstr "Jádro kódu CircuitPython tvrdě havarovalo. Jejda!\n" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" +msgstr "CircuitPython nedokázal alokovat haldu." #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" -msgstr "" +msgstr "Hodiny jsou příliš dlouhé" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Clock unit in use" -msgstr "" - -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "" +msgstr "Jednotka hodin je používána" #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " "connection." msgstr "" +"Připojení bylo odpojeno a nelze jej dále používat. Vytvořte nové připojení." #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "" - -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" +msgstr "Poškozený soubor .mpy" #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" @@ -860,58 +810,44 @@ msgstr "" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" -msgstr "" +msgstr "Není možné nastavit adresu" #: shared-bindings/pwmio/PWMOut.c msgid "Could not start PWM" -msgstr "" +msgstr "Nelze spustit PWM" #: ports/stm/common-hal/busio/UART.c msgid "Could not start interrupt, RX busy" -msgstr "" +msgstr "Nelze začít přerušení, RX je zaneprázdněn" #: shared-module/audiomp3/MP3Decoder.c msgid "Couldn't allocate decoder" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "" +msgstr "Dekodér nelze přiřadit" #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." -msgstr "" +msgstr "Pád do HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "" +msgstr "Chyba inicializace kanálu DAC" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" -msgstr "" +msgstr "Chyba inicializace zařízení DAC" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" -msgstr "" +msgstr "DAC se již používá" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" -msgstr "" +msgstr "Datový pin 0 musí být zarovnán na bajty" #: shared-module/audiocore/WaveFile.c msgid "Data chunk must follow fmt chunk" -msgstr "" +msgstr "Datový blok musí následovat fmt blok" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -921,7 +857,7 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Data too large for advertisement packet" -msgstr "" +msgstr "Data jsou příliš velká pro propagovaný paket" #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Deep sleep pins must use a rising edge with pulldown" @@ -929,25 +865,25 @@ msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." -msgstr "" +msgstr "Cílová kapacita je menší než destination_length." #: ports/nrf/common-hal/audiobusio/I2SOut.c msgid "Device in use" -msgstr "" - -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "" +msgstr "Zařízení je používáno" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." -msgstr "" +msgstr "Displej musí mít 16bitový barevný prostor." #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display rotation must be in 90 degree increments" +msgstr "Otočení displeje musí být po 90 stupních" + +#: main.c +msgid "Done" msgstr "" #: shared-bindings/digitalio/DigitalInOut.c @@ -956,7 +892,7 @@ msgstr "" #: shared-bindings/aesio/aes.c msgid "ECB only operates on 16 bytes at a time" -msgstr "" +msgstr "ECB operuje najednou pouze 16 bajtů" #: ports/espressif/common-hal/busio/SPI.c #: ports/espressif/common-hal/canio/CAN.c @@ -968,16 +904,16 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/cxd56/common-hal/pulseio/PulseIn.c msgid "EXTINT channel already in use" -msgstr "" +msgstr "EXTINT kanál se již používá" #: shared-module/synthio/MidiTrack.c #, c-format msgid "Error in MIDI stream at position %d" -msgstr "" +msgstr "Chyba v MIDI přenosu na pozici %d" #: extmod/modure.c msgid "Error in regex" -msgstr "" +msgstr "Chyba v regulárním výrazu" #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "Error: Failure to bind" @@ -985,18 +921,14 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" -msgstr "" +msgstr "Očekává se %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" +msgid "Expected an %q" msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c @@ -1010,7 +942,7 @@ msgstr "" #: extmod/ulab/code/numpy/fft/fft_tools.c msgid "FFT is implemented for linear arrays only" -msgstr "" +msgstr "FFT je implementován pouze pro lineární pole" #: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" @@ -1018,32 +950,20 @@ msgstr "" #: shared-bindings/ps2io/Ps2.c msgid "Failed sending command." -msgstr "" +msgstr "Nepodařilo se odeslat příkaz." #: ports/nrf/sd_mutex.c #, c-format msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "Chyba alokace %q bufferu" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" -msgstr "" +msgstr "Chyba alokace paměti WiFi" #: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" @@ -1056,19 +976,15 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" -msgstr "" +msgstr "Připojení se nezdařilo: interní chyba" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: timeout" -msgstr "" - -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" +msgstr "Nepodařilo se připojit: časový limit" #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" -msgstr "" +msgstr "Soubor MP3 se nepodařilo analyzovat" #: ports/nrf/sd_mutex.c #, c-format @@ -1077,15 +993,15 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "Failed to write internal flash." -msgstr "" +msgstr "Nepodařilo se zapsat do interní paměti." #: supervisor/shared/safe_mode.c msgid "Fatal error." -msgstr "" +msgstr "Fatální chyba." #: py/moduerrno.c msgid "File exists" -msgstr "" +msgstr "soubor existuje" #: ports/atmel-samd/common-hal/canio/Listener.c #: ports/espressif/common-hal/canio/Listener.c @@ -1095,7 +1011,7 @@ msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" -msgstr "" +msgstr "Obraz firmwaru je nevalidní" #: shared-bindings/bitmaptools/__init__.c msgid "For L8 colorspace, input bitmap must have 8 bits per pixel" @@ -1107,12 +1023,14 @@ msgstr "" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" -msgstr "" +msgstr "Formát není podporován" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" +"Frekvence musí být 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 nebo 1008 " +"Mhz" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1121,17 +1039,21 @@ msgstr "" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" -msgstr "" +msgstr "Funkce vyžaduje zámek" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "Inicializace GNSS" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" -msgstr "" +msgstr "Základní chyba" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Group already used" -msgstr "" +msgstr "Skupina již byla použita" #: ports/atmel-samd/common-hal/busio/SPI.c ports/cxd56/common-hal/busio/SPI.c #: ports/espressif/common-hal/busio/SPI.c @@ -1144,27 +1066,24 @@ msgstr "" #: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c #: ports/stm/common-hal/sdioio/SDCard.c msgid "Hardware busy, try alternative pins" -msgstr "" +msgstr "Hardware je zaneprázdněn, zkuste alternativní piny" #: ports/mimxrt10xx/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "Hardware in use, try alternative pins" -msgstr "" - -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" +msgstr "Hardware je používán, zkuste alternativní piny" #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "" +msgid "I2C init error" +msgstr "Chyba inicializace I2C" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" -msgstr "" +msgstr "Periférie I2C je používána" #: shared-bindings/audiobusio/I2SOut.c msgid "I2SOut not available" @@ -1173,7 +1092,7 @@ msgstr "" #: shared-bindings/aesio/aes.c #, c-format msgid "IV must be %d bytes long" -msgstr "" +msgstr "IV musí být dlouhé %d bajtů" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "In-buffer elements must be <= 4 bytes long" @@ -1184,10 +1103,12 @@ msgid "" "Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/" "mpy-update for more info." msgstr "" +"Nekompatibilní soubor .mpy. Aktualizujte prosím všechny soubory .mpy. Další " +"informace naleznete na adrese http://adafru.it/mpy-update." #: shared-bindings/_pew/PewPew.c msgid "Incorrect buffer size" -msgstr "" +msgstr "Nesprávná velikost vyrovnávací paměti" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Init program size invalid" @@ -1212,11 +1133,11 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c msgid "Input taking too long" -msgstr "" +msgstr "Vstup trval příliš dlouho" #: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" -msgstr "" +msgstr "Vstupně/výstupní chyba" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format @@ -1240,11 +1161,11 @@ msgstr "" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient authentication" -msgstr "" +msgstr "Nedostatečná autentizace" #: ports/nrf/common-hal/_bleio/__init__.c msgid "Insufficient encryption" -msgstr "" +msgstr "Nedostatečné šifrování" #: ports/espressif/common-hal/wifi/Radio.c msgid "Interface must be started" @@ -1260,265 +1181,107 @@ msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Internal error" -msgstr "" +msgstr "Interní chyba" #: shared-module/rgbmatrix/RGBMatrix.c #, c-format msgid "Internal error #%d" +msgstr "Vnitřní chyba #%d" + +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" -msgstr "" - -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" +msgstr "Neplatný pin %q" #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" -msgstr "" - -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" +msgstr "Neplatná hodnota jednotky ADC" #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" -msgstr "" - -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" +msgstr "Chybný BLE parametr" #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" +msgstr "Chybné BSSID" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" -msgstr "" +msgstr "Chybná MAC adresa" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" -msgstr "" +msgstr "Neplatný argument" #: shared-module/displayio/Bitmap.c msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" -msgstr "" - -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "" +msgstr "Chybný data_pin[%d]" #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" -msgstr "" +msgstr "Neplatná velikost bloku" #: supervisor/shared/safe_mode.c msgid "Invalid memory access." -msgstr "" - -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" +msgstr "Neplatný přístup k paměti." #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" -msgstr "" +msgstr "Chybná multicastová MAC adresa" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" -msgstr "" +msgstr "Neplatné piny" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "" - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" -msgstr "" +msgstr "Chybná velikost" #: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" -msgstr "" +msgstr "Chybný soket pro TLS" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" +msgstr "Chybný stav" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" -msgstr "" +msgstr "Klíč musí být dlouhý 16, 24 nebo 32 bajtů" #: shared-module/is31fl3741/FrameBuffer.c msgid "LED mappings must match display size" -msgstr "" +msgstr "Mapování LED musí korespondovat s velikostí displeje" #: py/compile.c msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" +msgstr "MAC adresa byla chybná" #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" @@ -1527,20 +1290,29 @@ msgstr "" #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" -msgstr "" - -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" +msgstr "Maximální hodnota x při zrcadlení je %d" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c -msgid "Missing MISO or MOSI Pin" +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI Pin" +msgstr "Chybí pin MISO nebo MOSI" + +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "Chybějící MISO nebo MOSI pin" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1576,23 +1348,18 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." -msgstr "" +msgstr "Musí být podtřída %q." #: ports/mimxrt10xx/common-hal/busio/SPI.c shared-bindings/busio/SPI.c msgid "Must provide MISO or MOSI pin" -msgstr "" +msgstr "Musí poskytnout pin MISO nebo MOSI" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "Must use a multiple of 6 rgb pins, not %d" -msgstr "" +msgstr "Je nutné použít několik kolíků 6 rgb, nikoli %d" #: supervisor/shared/safe_mode.c msgid "NLR jump failed. Likely memory corruption." @@ -1600,11 +1367,15 @@ msgstr "" #: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" -msgstr "" +msgstr "Chyba NVS" #: py/qstr.c msgid "Name too long" -msgstr "" +msgstr "Jméno je příliš dlouhé" + +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "Nová bitmapa musí mít stejnou velikost jako původní bitmapa" #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" @@ -1613,19 +1384,19 @@ msgstr "" #: ports/espressif/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Characteristic.c msgid "No CCCD for this Characteristic" -msgstr "" +msgstr "Žádné CCCD pro tuto charakteristiku" #: ports/atmel-samd/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "No DAC on chip" -msgstr "" +msgstr "Žádný DAC na čipu" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA channel found" -msgstr "" +msgstr "Nebyl nalezen žádný kanál DMA" #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "No DMA pacing timer found" @@ -1634,35 +1405,47 @@ msgstr "" #: shared-module/adafruit_bus_device/i2c_device/I2CDevice.c #, c-format msgid "No I2C device at address: 0x%x" +msgstr "Žádné I2C zařízení na adrese: 0x%x" + +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" -msgstr "" +msgstr "Žádný pin MISO" + +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "Žádný MISO pin" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" -msgstr "" +msgstr "Žádný pin MOSI" + +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "Žádný MOSI pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "No RX pin" -msgstr "" +msgstr "Žádný RX pin" #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c msgid "No TX pin" -msgstr "" +msgstr "Žádný TX pin" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "No available clocks" -msgstr "" +msgstr "Žádné dostupné hodiny" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "No capture in progress" @@ -1670,30 +1453,20 @@ msgstr "" #: shared-bindings/_bleio/PacketBuffer.c msgid "No connection: length cannot be determined" -msgstr "" +msgstr "Žádné připojení: nelze určit délku" #: shared-bindings/board/__init__.c msgid "No default %q bus" -msgstr "" +msgstr "Žádná výchozí sběrnice %q" #: ports/atmel-samd/common-hal/touchio/TouchIn.c msgid "No free GCLKs" -msgstr "" +msgstr "Žádné volné GCLK" #: shared-bindings/os/__init__.c msgid "No hardware random available" msgstr "" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1704,7 +1477,7 @@ msgstr "" #: shared-bindings/aesio/aes.c msgid "No key was specified" -msgstr "" +msgstr "Nebyl zadán klíč" #: shared-bindings/time/__init__.c msgid "No long integer support" @@ -1713,11 +1486,11 @@ msgstr "" #: shared-module/usb_hid/__init__.c #, c-format msgid "No more than %d HID devices allowed" -msgstr "" +msgstr "Ne více než %d HID zařízení je povoleno" #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" -msgstr "" +msgstr "Žádná síť s takovým SSID" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No out in program" @@ -1732,19 +1505,23 @@ msgstr "" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" -msgstr "" +msgstr "Žádný pulldown na pinu; doporučeno 1Mohm" #: py/moduerrno.c msgid "No space left on device" -msgstr "" +msgstr "Na zařízení nezůstal žádný prostor" + +#: py/moduerrno.c +msgid "No such device" +msgstr "Žádné takové zařízení" #: py/moduerrno.c msgid "No such file/directory" -msgstr "" +msgstr "Žádný takový soubor / adresář" #: shared-module/rgbmatrix/RGBMatrix.c msgid "No timer available" -msgstr "" +msgstr "Není k dispozici žádný časovač" #: supervisor/shared/safe_mode.c msgid "Nordic system firmware failure assertion." @@ -1756,18 +1533,18 @@ msgstr "" #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" -msgstr "" +msgstr "Nevalidní IP string" #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" -msgstr "" +msgstr "Nepřipojený" #: shared-bindings/audiobusio/I2SOut.c shared-bindings/audioio/AudioOut.c #: shared-bindings/audiopwmio/PWMAudioOut.c msgid "Not playing" -msgstr "" +msgstr "Nehraje" #: shared-bindings/_bleio/__init__.c msgid "Not settable" @@ -1776,17 +1553,26 @@ msgstr "" #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Number of data_pins must be 8 or 16, not %d" -msgstr "" +msgstr "Počet data_pins musí být 8 nebo 16, nikoli %d" #: shared-bindings/util.c msgid "" "Object has been deinitialized and can no longer be used. Create a new object." msgstr "" +"Objekt byl deinicializován a nelze jej dále používat. Vytvořte nový objekt." #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1794,11 +1580,11 @@ msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" -msgstr "" +msgstr "Pouze IPv4 adresy podporovány" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" -msgstr "" +msgstr "Pouze IPv4 sokety podporovány" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1829,15 +1615,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1845,19 +1635,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1865,11 +1659,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1880,12 +1669,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1904,29 +1692,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -1995,18 +1768,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2028,8 +1793,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2037,21 +1803,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "" @@ -2069,10 +1824,14 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "" @@ -2085,7 +1844,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2101,6 +1860,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2111,29 +1874,20 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2154,14 +1908,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2197,10 +1943,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2286,10 +2028,6 @@ msgstr "" msgid "Tile index out of bounds" msgstr "" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "" @@ -2309,6 +2047,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2341,23 +2082,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2494,12 +2232,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2512,8 +2244,8 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c @@ -2534,7 +2266,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2564,10 +2296,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2578,8 +2306,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2620,11 +2348,11 @@ msgstr "" msgid "a bytes-like object is required" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "" @@ -2673,6 +2401,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2734,10 +2466,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2775,11 +2503,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2788,7 +2511,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2796,12 +2519,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2824,7 +2544,7 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -2972,6 +2692,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -2984,10 +2708,6 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3052,6 +2772,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3135,10 +2859,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3147,6 +2867,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3176,6 +2900,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "" @@ -3250,7 +2980,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3286,6 +3016,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" @@ -3394,7 +3128,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3412,6 +3146,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3457,6 +3195,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3465,11 +3207,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3549,6 +3287,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "" @@ -3662,10 +3404,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3673,12 +3411,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3812,7 +3546,7 @@ msgstr "" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "" @@ -3923,7 +3657,11 @@ msgstr "" msgid "odd-length string" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4047,10 +3785,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4076,63 +3810,23 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4152,14 +3846,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4211,12 +3897,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4314,10 +3994,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" @@ -4330,10 +4006,6 @@ msgstr "" msgid "step must be non-zero" msgstr "" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4382,10 +4054,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4405,10 +4073,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4417,6 +4081,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4587,6 +4255,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4608,13 +4284,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4634,7 +4304,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4642,6 +4322,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -4686,6 +4370,18 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "Failed to init wifi" +#~ msgstr "Chyba inicializace WiFi" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q musí být n-tice délky 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q musí být mezi %d a %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q by měl být int" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/de_DE.po b/locale/de_DE.po index 0b2269c461..4e109a41cf 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: 2022-03-24 15:57+0000\n" -"Last-Translator: Fabian Affolter \n" +"PO-Revision-Date: 2022-08-14 12:14+0000\n" +"Last-Translator: Can Kocyigit \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.12-dev\n" +"X-Generator: Weblate 4.14-dev\n" #: main.c msgid "" @@ -74,10 +74,27 @@ msgstr "" "%d Adress-Pins, %d RGB-Pins und %d Kacheln indizieren eine Höhe von %d, " "nicht %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "%q" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q und %q enthalten doppelte Pins" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "%q und %q müssen unterschiedlich sein" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q enthält doppelte Pins" @@ -90,12 +107,7 @@ msgstr "%q Fehler: %d" msgid "%q in use" msgstr "%q in Benutzung" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Der Index %q befindet sich außerhalb des Bereiches" @@ -103,18 +115,42 @@ msgstr "Der Index %q befindet sich außerhalb des Bereiches" msgid "%q indices must be integers, not %s" msgstr "%q Indizes müssen Integer sein, nicht %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "%q Initialisierung ist gescheitert" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "%q länge muss %d betragen" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q Länge muss %d-%d sein" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "%q länge muss kleiner oder gleich %d sein" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "%q länge muss größer oder gleich %d sein" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "%q Länge muss >= 1 sein" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "%q muss %d entsprechen" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q muss %d-%d sein" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "%q muss 1 sein, wenn %q wahr ist" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q muss <= %d sein" @@ -123,30 +159,26 @@ msgstr "%q muss <= %d sein" msgid "%q must be >= %d" msgstr "%q muss >= %d sein" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q muss >= 0 sein" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q muss >= 1 sein" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "%q muss ein String sein" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q muss ein Tupel der Länge 2 sein" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q muss zwischen %d und %d sein" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "%q muss vom Typ Integer sein" #: py/argcheck.c msgid "%q must be of type %q" @@ -164,7 +196,11 @@ msgstr "%q muss eine Potenz von 2 sein" msgid "%q out of bounds" msgstr "%q außerhalb der Grenzen" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q außerhalb des Bereichs" @@ -173,10 +209,6 @@ msgstr "%q außerhalb des Bereichs" msgid "%q pin invalid" msgstr "%q Pin ungültig" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q sollte ein integer sein" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q mit Berichts-ID von 0 muss von Länge 1 sein" @@ -190,7 +222,11 @@ msgstr "" msgid "%q, %q, and %q must all be the same length" msgstr "%q, %q und %q müssen alle die gleiche Länge haben" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "%q=%q" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s Fehler 0x%x" @@ -340,10 +376,6 @@ msgstr "'yield from' innerhalb einer async Funktion" msgid "'yield' outside function" msgstr "'yield' außerhalb einer Funktion" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "(x,y) Integer benötigt" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x muss Zuordnungsziel sein" @@ -379,16 +411,12 @@ msgstr "ADC2 wird vom WiFi benutzt" msgid "Address must be %d bytes long" msgstr "Die Adresse muss %d Bytes lang sein" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Adresstyp außerhalb des zulässigen Bereichs" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Alle CAN-Schnittstellen sind in Benutzung" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" @@ -425,7 +453,6 @@ msgstr "Alle Kanäle werden verwendet" msgid "All event channels in use" msgstr "Alle Event-Kanäle werden benutzt" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "Alle State-Maschinen in Verwendung" @@ -473,25 +500,6 @@ msgstr "Läuft bereits" msgid "Already scanning for wifi networks" msgstr "Sucht bereits nach Wifi-Netzwerken" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn ist an diesem Pin nicht unterstützt" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut-Funktion wird nicht unterstützt" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut kann nur 16 Bit. Der Wert muss unter 65536 liegen." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut ist an diesem Pin nicht unterstützt" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Ein anderer PWMAudioOut ist bereits aktiv" @@ -530,7 +538,7 @@ msgstr "Audio-Konvertierung nicht implementiert" msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN wird mit Passwort nicht verwendet" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Authentifizierungsfehler" @@ -563,11 +571,6 @@ msgstr "Bit clock und word select müssen geordnete Pins sein" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock und word select müssen eine clock unit teilen" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bittiefe muss zwischen 1 und 6 liegen, nicht %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit depth muss ein Vielfaches von 8 sein." @@ -609,11 +612,6 @@ msgstr "Buffer + Offset zu klein %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Puffer-Elemente müssen 4 Bytes lang oder kürzer sein" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Der Puffergröße ist inkorrekt. Sie sollte %d bytes haben." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Der Buffer ist kein Byte-Array." @@ -623,7 +621,6 @@ msgstr "Der Buffer ist kein Byte-Array." msgid "Buffer is too small" msgstr "Der Puffer ist zu klein" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -634,14 +631,10 @@ msgstr "Die Pufferlänge %d ist zu groß. Sie muss kleiner als %d sein" msgid "Buffer length must be a multiple of 512" msgstr "Die Pufferlänge muss ein vielfaches von 512 sein" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "Der Puffer muss ein vielfaches von 512 bytes sein" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -663,10 +656,6 @@ msgstr "Bus-Pin %d wird schon benutzt" msgid "Byte buffer must be 16 bytes." msgstr "Der Puffer muss 16 Bytes lang sein." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Ein Bytes kann nur Werte zwischen 0 und 255 annehmen." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC-Blöcke müssen ein Vielfaches von 16 Bytes sein" @@ -675,7 +664,7 @@ msgstr "CBC-Blöcke müssen ein Vielfaches von 16 Bytes sein" msgid "CIRCUITPY drive could not be found or created." msgstr "CIRCUITPY-Laufwerk konnte nicht gefunden oder erzeugt werden." -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC oder Checksumme ungültig" @@ -683,6 +672,10 @@ msgstr "CRC oder Checksumme ungültig" msgid "Call super().__init__() before accessing native object." msgstr "Rufe super().__init__() vor dem Zugriff auf ein natives Objekt auf." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "Kamera Initialiserung" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "Alarm der RTC IO kann nur im deep sleep ausgeführt werden." @@ -733,18 +726,10 @@ msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" "Es können keine Scanantworten für erweiterte, verbindbare Anzeigen vorliegen." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Kann nicht beite Kanäle auf dem gleichen Pin ausgeben" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Kann nicht 'pull' an einem 'input-only' pin." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Kann ohne MISO-Pin nicht lesen." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Aufnahme in eine Datei nicht möglich" @@ -756,8 +741,8 @@ msgstr "'/' kann nicht wiedereingehängt werden, wenn per USB sichtbar." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Reset zum Bootloader nicht möglich, da Bootloader nicht vorhanden." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "Kann nicht in den Bootloader resetten, weil keiner vorhanden ist" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -777,23 +762,23 @@ msgid "Cannot subclass slice" msgstr "Slice kann keine sub-klasse sein" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Übertragung ohne MOSI- und MISO-Pins nicht möglich." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "Kann nicht ohne MISO und MOSI Pins transferieren" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" "Die Frequenz eines bereits verwendeten Timers kann nicht variiert werden" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: 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\"" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Kann nicht auf Flanke wecken, nur auf Level." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Kann nicht ohne MOSI-Pin schreiben." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Schreiben von CharacteristicBuffer ist nicht vorgesehen" @@ -806,10 +791,6 @@ msgstr "Der CircuitPython-Kerncode ist hart abgestürzt. Hoppla!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython war es nicht möglich heap-Speicher zu allozieren." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Clock pin init fehlgeschlagen." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Clock stretch zu lang" @@ -818,11 +799,6 @@ msgstr "Clock stretch zu lang" msgid "Clock unit in use" msgstr "Clock unit wird benutzt" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Der Befehl muss ein int zwischen 0 und 255 sein" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -835,35 +811,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Beschädigte .mpy Datei" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Konnte Kamera nicht initialisieren" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "GNSS konnte nicht initialisiert werden" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Konnte SDKarte nicht initialisieren" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Konnte UART nicht initialisieren" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Kanal konnte nicht neu initiiert werden" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Timer konnte nicht neu gestartet werden" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "PWM konnte nicht neu gestartet werden" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Clock konnte nicht ermittelt werden" @@ -884,27 +831,13 @@ msgstr "Interrupt konnte nicht gestartet werden, RX beschäftigt" msgid "Couldn't allocate decoder" msgstr "Decoder konnte nicht zugeordnet werden" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Konnte first buffer nicht zuteilen" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Eingabepuffer konnte nicht reserviert werden" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Konnte second buffer nicht zuteilen" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Absturz in den HardFault_Handler." #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Channel Init Error" -msgstr "DAC Kanal Initialisierungsfehler" +msgstr "DAC-Kanal-Initialisierungsfehler" #: ports/stm/common-hal/analogio/AnalogOut.c msgid "DAC Device Init Error" @@ -945,10 +878,6 @@ msgstr "Die Zielkapazität ist kleiner als destination_length." msgid "Device in use" msgstr "Gerät in Benutzung" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut wird auf dem angegebenen Pin nicht unterstützt" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -960,6 +889,10 @@ msgstr "Display muss einen 16 Bit Farbraum haben." msgid "Display rotation must be in 90 degree increments" msgstr "Die Rotation der Anzeige muss in 90-Grad-Schritten erfolgen" +#: main.c +msgid "Done" +msgstr "Fertig" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." @@ -995,19 +928,15 @@ msgstr "Error: Bind Fehler" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Erwartet ein(e) %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "Alarm erwartet" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" +msgid "Expected an %q" +msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1036,21 +965,9 @@ msgstr "Kommando nicht gesendet." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Mutex konnte nicht akquiriert werden. Status: 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Konnte keinen RX Buffer allozieren" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Konnte keine RX Buffer mit %d allozieren" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "Allokieren des %q Buffers ist fehlgeschlagen" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1073,10 +990,6 @@ msgstr "Verbindung fehlgeschlagen: interner Fehler" msgid "Failed to connect: timeout" msgstr "Verbindung nicht erfolgreich: timeout" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "Wifi Initialisierung ist fehlgeschlagen" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "MP3-Datei konnte nicht analysiert werden" @@ -1120,10 +1033,12 @@ msgstr "Für RGB-Farbräume muss die Eingabe-Bitmap 16 Bit pro Pixel haben" msgid "Format not supported" msgstr "Format nicht unterstützt" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Framepuffer benötigt %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" +"Die Frequenz muss 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 oder 1008 " +"MHz betragen" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1136,7 +1051,11 @@ msgstr "" msgid "Function requires lock" msgstr "Die Funktion erwartet, dass der 'lock'-Befehl zuvor ausgeführt wurde" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "GNSS Initialisierung" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Generischer Fehler" @@ -1163,19 +1082,16 @@ msgstr "Hardware beschäftigt, versuchen Sie alternative Pins" msgid "Hardware in use, try alternative pins" msgstr "Hardware in Benutzung, probiere alternative Pins" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "Der Hostname muss zwischen 1 und 253 Zeichen haben" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Lese/Schreibe-operation an geschlossener Datei" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C-Init-Fehler" +msgid "I2C init error" +msgstr "I2C Initialisierungsfehler" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "I2C Peripherie in Verwendung" @@ -1286,75 +1202,37 @@ msgstr "Interner Fehler" msgid "Internal error #%d" msgstr "Interner Fehler #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "Der Interne WatchDog Timer ist abgelaufen." + +#: py/argcheck.c msgid "Invalid %q" msgstr "Ungültiger %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Ungültiger %q Pin" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Ungültige %q Pin-Auswahl" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Ungültiger ADC-Einheitenwert" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "Ungültiges AuthMode" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Ungültiges BLE Parameter" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Ungültige BMP-Datei" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Ungültige BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Ungültiger DAC-Pin angegeben" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "Ungültige MAC-Adresse" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Ungültige MIDI Datei" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Ungültige PWM Frequenz" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Ungültiger Pin" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Ungültiges Argument" @@ -1362,42 +1240,11 @@ msgstr "Ungültiges Argument" msgid "Invalid bits per value" msgstr "Ungültige Bits pro Wert" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Ungültige Puffergröße" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Ungültige Byteorder-String" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Ungültiger Aufnahmezeitraum. Gültiger Bereich: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Ungültige Anzahl von Kanälen" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "Ungültiger data_count %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "Ungültige data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Ungültige Richtung." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Ungültige Datei" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ungültige format chunk size" @@ -1406,79 +1253,15 @@ msgstr "Ungültige format chunk size" msgid "Invalid memory access." msgstr "Ungültiger Speicherzugriff." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "Ungültiger Modus" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "Ungültige Multicast-MAC-Adresse" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Ungültige Anzahl von Bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Ungültige Phase" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Ungültiger Pin" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Ungültiger Pin für linken Kanal" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Ungültiger Pin für rechten Kanal" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Ungültige Pins" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Ungültige Polarität" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Ungültige Eigenschaften" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Ungültiger Ausführungsmodus." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Ungültiger security_mode" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Ungültige Größe" @@ -1486,27 +1269,10 @@ msgstr "Ungültige Größe" msgid "Invalid socket for TLS" msgstr "Ungültiges Socket für TLS" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Ungültiger Zustand" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Ungültige Stimme" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Ungültige Anzahl von Stimmen" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Ungültige wave Datei" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Ungültige Wort- / Bitlänge" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Der Schlüssel muss 16, 24 oder 32 Byte lang sein" @@ -1520,25 +1286,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS des Schlüsselwortarguments muss eine id sein" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Layer ist bereits in einer Gruppe." +msgid "Layer already in a group" +msgstr "Ebene ist bereits in der Gruppe" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer muss eine Group- oder TileGrid-Unterklasse sein." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "Ebene muss eine Gruppe oder eine TileGrid Subklasse sein" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC Adresse war ungültig" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISO pin Initialisierung fehlgeschlagen." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSI pin Initialisierung fehlgeschlagen." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "Zuordnung muss ein Tupel sein" @@ -1548,19 +1306,28 @@ msgstr "Zuordnung muss ein Tupel sein" msgid "Maximum x value when mirrored is %d" msgstr "Maximaler x-Wert beim Spiegeln ist %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Meldungen auf 8 Bytes limitiert" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" "Die Startverzögerung des Mikrofons muss im Bereich von 0,0 bis 1,0 liegen" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "Nicht übereinstimmende Datengröße" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "Nicht übereinstimmendes Swap-Flag" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Fehlender MISO- oder MOSI-Pin" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "MISO oder MOSI Pin fehlt" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1596,11 +1363,6 @@ msgstr "Fehlender first_set_pin. Instruktion %d setzt Pin(s)" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "jmp_pin fehlt. Befehl %d springt auf Pin" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "Mehr als %d Berichts-IDs werden nicht unterstützt" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Muss eine %q Unterklasse sein." @@ -1626,6 +1388,10 @@ msgstr "NVS-Fehler" msgid "Name too long" msgstr "Name zu lang" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "Neue Bitmap muss die gleiche Größe wie alte Bitmap haben" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "Kein Speicher mehr für Nible vorhanden" @@ -1656,16 +1422,28 @@ msgstr "Kein DMA-Pacing Timer gefunden" msgid "No I2C device at address: 0x%x" msgstr "Kein I2C-Gerät an Adresse: 0x%x" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "Keine IP" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Kein MISO-Pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "Miso Pin fehlt" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Kein MOSI-Pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "MOSI Pin fehlt" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1704,16 +1482,6 @@ msgstr "Keine freien GCLKs" msgid "No hardware random available" msgstr "Kein hardware random verfügbar" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Keine Hardwareunterstützung am clk Pin" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Keine Hardwareunterstützung an diesem Pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "Nicht in Programm" @@ -1758,6 +1526,10 @@ msgstr "Kein Pulldown-Widerstand am Pin; 1 MOhm wird vorgeschlagen" msgid "No space left on device" msgstr "Kein Speicherplatz mehr verfügbar auf dem Gerät" +#: py/moduerrno.c +msgid "No such device" +msgstr "Kein solches Gerät" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Keine solche Datei/Verzeichnis" @@ -1809,6 +1581,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Eine ungerade Parität wird nicht unterstützt" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "Aus" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "Ok" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1818,7 +1598,7 @@ msgstr "Nur 8 oder 16 bit mono mit " msgid "Only IPv4 addresses supported" msgstr "Nur IPv4-Adressen werden unterstützt" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "Nur IPv4-Sockets werden unterstützt" @@ -1855,15 +1635,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "Nur ein TouchAlarm kann in Deep Sleep gesetzt werden." -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "Nur eine Adresse ist erlaubt" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "Nur ein alarm.time Alarm kann gesetzt werden" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Nur eine alarm-time kann gesetzt werden." @@ -1871,19 +1655,23 @@ msgstr "Nur eine alarm-time kann gesetzt werden." msgid "Only one color can be transparent at a time" msgstr "Nur eine Farbe kann transparent sein zu einer Zeit" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "Operation nicht erlaubt" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Vorgang oder Funktion wird nicht unterstützt" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Zeit für Vorgang abgelaufen" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Kein Speicher mehr verfügbar" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "Keine Sockets mehr verfügbar" @@ -1891,11 +1679,6 @@ msgstr "Keine Sockets mehr verfügbar" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Out-Buffer-Elemente müssen <= 4 bytes lang sein" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "Ausgabe-Buffer muss mindestens %d Bytes sein" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample muss ein Vielfaches von 8 sein." @@ -1904,16 +1687,15 @@ msgstr "Oversample muss ein Vielfaches von 8 sein." msgid "PDMIn not available" msgstr "PDMIn nicht verfügbar" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "PWM duty_cycle muss zwischen 0 und 65535 (16 Bit-Auflösung) liegen" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Die PWM-Frequenz ist nicht schreibbar, wenn variable_Frequenz = False." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "PWM Neustart" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "PWM-Stück wird bereits verwendet" @@ -1930,29 +1712,14 @@ msgstr "Peripheriegerät wird bereits verwendet" msgid "Permission denied" msgstr "Zugriff verweigert" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "Pin kann nicht aus Deep Sleep aufwachen" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "Pin-Anzahl muss mindestens 1 sein" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Pin-Anzahl zu gross" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin hat keine ADC-Funktionalität" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2025,18 +1792,10 @@ msgstr "Programm macht IN ohne Laden von ISR" msgid "Program does OUT without loading OSR" msgstr "Programm macht OUT ohne Laden von OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "Programm muss mindestens eine 16-Bit-Instruktion enthalten." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "Programm-Größe ist ungültig" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "Das Programm ist zu groß" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull wird nicht verwendet, wenn die Richtung output ist." @@ -2058,30 +1817,20 @@ msgstr "RNG DeInit-Fehler" msgid "RNG Init Error" msgstr "RNG Init-Fehler" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 wird von diesem Gerät nicht unterstützt" +#: 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 +msgid "RS485" +msgstr "RS485" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "RS485-Inversion angegeben, wenn nicht im RS485-Modus" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "Die RTC-Kalibrierung wird auf diesem Board nicht unterstützt" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "Eine RTC wird auf diesem Board nicht unterstützt" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS / CTS / RS485 Wird von diesem Gerät noch nicht unterstützt" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Fehler bei der Erzeugung von Zufallszahlen" @@ -2099,10 +1848,14 @@ msgstr "Schreibgeschützte Dateisystem" msgid "Read-only object" msgstr "Schreibgeschützte Objekt" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Erhaltene Antwort ist ungültig" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "Wiederherstellung der Verbindungen" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "Zu früh neu geladen" @@ -2115,7 +1868,7 @@ msgstr "RemoteTransmissionRequests limitiert auf 8 Bytes" msgid "Requested AES mode is unsupported" msgstr "Der angeforderte AES-Modus wird nicht unterstützt" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Angefragte Ressource nicht gefunden" @@ -2131,6 +1884,10 @@ msgstr "Sicherheitsmodus aktiv! Gespeicherter Code wird nicht ausgeführt\n" msgid "SD card CSD format not supported" msgstr "SD-Card CSD-Format nicht unterstützt" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "SDCard Initialisierung" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2141,30 +1898,21 @@ msgstr "SDIO GetCardInfo-Fehler %d" msgid "SDIO Init Error %d" msgstr "SDIO-Init-Fehler %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI-Init-Fehler" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI-Neuinitialisierungsfehler" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "SPI-Konfiguration fehlgeschlagen" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "SPI Initialisierungsfehler" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "SPI-Peripheriegeräte wird bereits verwendet" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Abtastrate muss positiv sein" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Abtastrate zu hoch. Wert muss unter %d liegen" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "SPI wird erneut initialisiert" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2184,14 +1932,6 @@ msgstr "Serializer wird benutzt" msgid "Server side context cannot have hostname" msgstr "Serverseitiger Kontext kann keinen Hostnamen haben" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "Die Anzahl der Pins muss zwischen 1 und 5 liegen" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "Die Anzahl der Pins für Side set muss zwischen 1 und 5 liegen" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Größe nicht unterstützt" @@ -2227,10 +1967,6 @@ msgstr "Geben Sie genau einen von data0 oder data_pins an" msgid "Splitting with sub-captures" msgstr "Splitting mit sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Die Stackgröße sollte mindestens 256 sein" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "Stereo links muss sich auf PWM-Kanal A befinden" @@ -2328,10 +2064,6 @@ msgstr "Die Kachelhöhe muss die Bitmaphöhe genau teilen" msgid "Tile index out of bounds" msgstr "Kachel index außerhalb der Grenzen" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Kachelwert außerhalb der Grenzen" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Die Kachelbreite muss die Bitmap-Breite genau teilen" @@ -2352,6 +2084,9 @@ msgid "To exit, please reset the board without " msgstr "Zum beenden, resette bitte das board ohne " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "Zu viele Kanäle im Beispiel" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zu viele Kanäle im sample." @@ -2384,24 +2119,21 @@ msgid "Tuple or struct_time argument required" msgstr "Tuple- oder struct_time-Argument erforderlich" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART Buffer reservierungs Fehler" +msgid "UART de-init" +msgstr "UART wird de-initialisiert" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "UART Initialisierung" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART De-Init-Fehler" +msgid "UART re-init" +msgstr "UART wird wieder Initialisiert" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART Init Fehler" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART Re-Init-Fehler" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART-Schreibfehler" +msgid "UART write" +msgstr "UART wird geschrieben" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2541,12 +2273,6 @@ msgstr "" "Nicht näher bezeichnetes Problem. Möglicherweise wurde die Pairing-" "Eingabeaufforderung auf dem anderen Gerät abgelehnt oder ignoriert." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Baudrate wird nicht unterstützt" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "Nicht unterstützter Farbraum" @@ -2559,9 +2285,9 @@ msgstr "Nicht unterstützter display bus type" msgid "Unsupported format" msgstr "Nicht unterstütztes Format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Nicht unterstützte Operation" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "Hash Algorithmus wird nicht unterstützt" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2581,7 +2307,7 @@ msgstr "Wert Länge != Erforderliche feste Länge" msgid "Value length > max_length" msgstr "Länge des Wertes > max_length" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "Version ist ungültig" @@ -2616,10 +2342,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "WatchDogTimer.timeout muss größer als 0 sein" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "Watchdog timer abgelaufen." - #: py/builtinhelp.c #, c-format msgid "" @@ -2635,9 +2357,9 @@ msgstr "" "\n" "Um die vorhandenen Module anzuzeigen, gebe `help(\"modules\")` ein.\n" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFi Passwort muss zwischen 8 und 63 Zeichen lang sein" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "Wi-Fi: " #: main.c msgid "Woken up by alarm.\n" @@ -2679,11 +2401,11 @@ msgstr "__new__ arg muss user-type sein" msgid "a bytes-like object is required" msgstr "ein Byte-ähnliches Objekt ist erforderlich" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "Adresse außerhalb der Grenzen" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "addresses ist leer" @@ -2732,6 +2454,10 @@ msgstr "Argumente müssen ndarrays sein" msgid "array and index length must be equal" msgstr "Array- und Indexlänge müssen gleich sein" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "Das Array hat zu viele Dimensionen" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2793,10 +2519,6 @@ msgstr "Bitmap-Größen müssen übereinstimmen" msgid "bits must be 32 or less" msgstr "bits müssen 32 oder kleiner sein" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "bits müssen zwischen 5 und 9 liegen" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "Es müssen 8 oder 16 bits_per_sample sein" @@ -2834,11 +2556,6 @@ msgstr "Der Puffer ist zu klein für die angefragten Bytes" msgid "byteorder is not a string" msgstr "Byteorder ist kein String" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "Byte-Länge ist kein vielfaches der Item-Größe" @@ -2847,7 +2564,7 @@ msgstr "Byte-Länge ist kein vielfaches der Item-Größe" msgid "bytes value out of range" msgstr "Byte-Wert außerhalb des Bereichs" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "Kalibrierung ist außerhalb der Reichweite" @@ -2855,13 +2572,10 @@ msgstr "Kalibrierung ist außerhalb der Reichweite" msgid "calibration is read only" msgstr "Kalibrierung ist Schreibgeschützt" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "Kalibrierwert nicht im Bereich von +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" -msgstr "kann nur bei einem Elternteil registriert werden" +msgid "can only have one parent" +msgstr "kann nur ein Elternteil haben" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -2885,7 +2599,7 @@ msgstr "kann keinem Ausdruck zuweisen" msgid "can't cancel self" msgstr "kann self nicht abbrechen" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "kann %q nicht zu %q konvertieren" @@ -3039,6 +2753,10 @@ msgstr "Kann nicht eindeutig die Größe (sizeof) des Skalars ermitteln" msgid "casting" msgstr "Umwandlung (cast)" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "Kanal wird erneut initialisiert" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "(char) Zeichenpuffer zu klein" @@ -3051,10 +2769,6 @@ msgstr "chr() arg ist nicht in range(0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg ist nicht in range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "Kreis kann nur in einem Elternteil registriert werden" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "clip Punkt muss ein (x,y) Tupel sein" @@ -3121,6 +2835,10 @@ msgstr "Convolve-Argumente müssen ndarrays sein" msgid "convolve arguments must not be empty" msgstr "Convolve Argumente dürfen nicht leer sein" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "Korrupte Datei" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "Vandermonde-Matrix konnte nicht invertiert werden" @@ -3206,10 +2924,6 @@ msgstr "durch Null dividieren" msgid "division by zero" msgstr "Division durch Null" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "Teiler muss 4 sein" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "dtype muss Float oder komplex sein" @@ -3218,6 +2932,10 @@ msgstr "dtype muss Float oder komplex sein" msgid "empty" msgstr "leer" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "Leere Datei" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "leerer heap" @@ -3247,6 +2965,12 @@ msgstr "epoch_time wird auf diesem Board nicht unterstützt" msgid "error = 0x%08lX" msgstr "Fehler = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "Exceptions müssen von BaseException abgeleitet sein" @@ -3321,7 +3045,7 @@ msgstr "das erste Argument muss eine Funktion sein" msgid "first argument must be a tuple of ndarrays" msgstr "das erste Argument muss ein Tupel von ndarrays sein" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "Das erste Argument muss ein Ndarray sein" @@ -3357,6 +3081,10 @@ msgstr "Die Schriftart (font) muss 2048 Byte lang sein" msgid "format requires a dict" msgstr "Format erfordert ein Wörterbuch (dict)" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "Frequenz ist für dieses Board schreibgeschützt" + #: py/objdeque.c msgid "full" msgstr "voll" @@ -3467,7 +3195,7 @@ msgstr "unvollständiger Formatschlüssel" msgid "incorrect padding" msgstr "padding ist inkorrekt" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "Index ist außerhalb der Grenzen" @@ -3485,6 +3213,10 @@ msgstr "Indizes müssen Integer sein" msgid "indices must be integers, slices, or Boolean lists" msgstr "Indizes müssen Integer, Slices oder Boolesche Listen sein" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "initialisiere I2C" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "Ausgangswerte müssen iterierbar sein" @@ -3530,6 +3262,10 @@ msgstr "Eingabematrix ist asymmetrisch" msgid "input matrix is singular" msgstr "Eingabematrix ist singulär" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "Eingabe muss 1- oder 2-d sein" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "Eingabe muss ein 1D ndarray sein" @@ -3538,11 +3274,7 @@ msgstr "Eingabe muss ein 1D ndarray sein" msgid "input must be a dense ndarray" msgstr "Eingabe muss ein dichtes ndarray sein" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "Eingabe muss ein Tensor von Rang 2 sein" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "Eingabe muss ein ndarray sein" @@ -3622,6 +3354,10 @@ msgstr "ungültiger Hostname" msgid "invalid micropython decorator" msgstr "ungültiger micropython decorator" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "Invalide Einstellung" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "ungültiger Schritt (step)" @@ -3741,10 +3477,6 @@ msgstr "Mathe-Domain-Fehler" msgid "matrix is not positive definite" msgstr "Matrix ist nicht positiv definitiv" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "max_connections muss zwischen 0 und 10 liegen" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3752,13 +3484,9 @@ msgstr "max_connections muss zwischen 0 und 10 liegen" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length muss 0-%d sein, wenn fixed_length %s ist" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "max_length muss >= 0 sein" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "die maximale Anzahl der Dimensionen beträgt 4" +msgid "maximum number of dimensions is " +msgstr "Maximale Anzahl an Dimensionen ist " #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3891,7 +3619,7 @@ msgstr "kein Reset Pin verfügbar" msgid "no response from SD card" msgstr "keine Antwort von der SD-Karte" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "kein solches Attribut" @@ -4003,7 +3731,11 @@ msgstr "Objekt mit Pufferprotokoll (buffer protocol) erforderlich" msgid "odd-length string" msgstr "String mit ungerader Länge" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "aus" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "Offset ist zu groß" @@ -4131,10 +3863,6 @@ msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" msgid "poll on file not available on win32" msgstr "Abfrage der Datei unter Win32 nicht verfügbar" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop von einem leeren PulseIn" @@ -4160,63 +3888,23 @@ msgstr "pow() drittes Argument darf nicht 0 sein" msgid "pow() with 3 arguments requires integers" msgstr "pow() mit 3 Argumenten erfordert Integer" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "BOOT Taste wird beim Starten gedrückt.\n" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "SW38 Taste wird beim Starten gedrückt.\n" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "VOLUME Taste wird beim Starten gedrückt.\n" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "Drücken der Boot-Taste beim Start.\n" @@ -4236,14 +3924,6 @@ msgstr "Drücken der linken Taste beim Einschalten\n" msgid "pull masks conflict with direction masks" msgstr "Pull-Masken kollidieren mit Richtungsmasken" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "pull_threshold muss zwischen 1 und 32 liegen" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "push_threshold muss zwischen 1 und 32 liegen" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "Warteschlangenüberlauf" @@ -4295,14 +3975,6 @@ msgstr "Roll-Argument muss ein ndarray sein" msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"sample_source buffer muss ein Bytearray oder ein Array vom Typ 'h', 'H', 'b' " -"oder 'B' sein" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4400,10 +4072,6 @@ msgstr "source_bitmap muss value_count von 65536 haben" msgid "source_bitmap must have value_count of 8" msgstr "source_bitmap muss value_count von 8 haben" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "ssid kann nicht mehr als 32 Bytes lang sein" - #: py/objstr.c msgid "start/end indices" msgstr "start/end Indizes" @@ -4416,10 +4084,6 @@ msgstr "start_x sollte ein int sein" msgid "step must be non-zero" msgstr "Schritt (step) darf nicht Null sein" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop muss 1 oder 2 sein" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop ist von start aus nicht erreichbar" @@ -4469,10 +4133,6 @@ msgstr "Syntaxfehler in uctypes Deskriptor" msgid "threshold must be in the range 0-65536" msgstr "threshold muss im Intervall 0-65536 liegen" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "Kachel muss größer als Null sein" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() nimmt eine 9-Sequenz an" @@ -4492,10 +4152,6 @@ msgstr "Das Zeitlimit muss 0,0-100,0 Sekunden betragen" msgid "timeout must be < 655.35 secs" msgstr "timeout muss kleiner als 655.35 Sekunden sein" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "timeout muss >= 0.0 sein" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "Zeitlimit beim warten auf v1 Karte" @@ -4504,6 +4160,10 @@ msgstr "Zeitlimit beim warten auf v1 Karte" msgid "timeout waiting for v2 card" msgstr "Zeitlimit beim warten auf v2 Karte" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "Timer wird neu initialisiert" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "Zeitstempel außerhalb des Bereichs für Plattform time_t" @@ -4676,6 +4336,14 @@ msgstr "nicht unterstützter Typ für Operator" msgid "unsupported types for %q: '%q', '%q'" msgstr "nicht unterstützte Typen für %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "usecols ist zu hoch/groß" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "usecols muss definiert sein" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4697,13 +4365,7 @@ msgstr "watchdog nicht initialisiert" msgid "watchdog timeout must be greater than 0" msgstr "watchdog Zeitlimit muss größer als 0 sein" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "breite muss zwischen (inklusive) 2 und 8 liegen, nicht %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "Breite muss größer als 0 sein" @@ -4723,7 +4385,17 @@ msgstr "falscher Achsenindex" msgid "wrong axis specified" msgstr "falsche Achse gewählt" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "Falsches dtype" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "falscher Indextyp" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "falscher Eingabetyp" @@ -4731,6 +4403,10 @@ msgstr "falscher Eingabetyp" msgid "wrong length of condition array" msgstr "falsche Länge des Array von Bedingungen" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "Falsche Länge des Index Arrays" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "falsche Anzahl an Argumenten" @@ -4775,6 +4451,384 @@ 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 "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "sample_source buffer muss ein Bytearray oder ein Array vom Typ 'h', 'H', " +#~ "'b' oder 'B' sein" + +#~ msgid "Expected an alarm" +#~ msgstr "Alarm erwartet" + +#~ msgid "All I2C targets are in use" +#~ msgstr "Alle I2C-Ziele sind in Verwendung" + +#~ msgid "Failed to init wifi" +#~ msgstr "Wifi Initialisierung ist fehlgeschlagen" + +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "Eingabe muss ein Tensor von Rang 2 sein" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "die maximale Anzahl der Dimensionen beträgt 4" + +#~ msgid "Watchdog timer expired." +#~ msgstr "Watchdog timer abgelaufen." + +#~ msgid "ssid can't be more than 32 bytes" +#~ msgstr "ssid kann nicht mehr als 32 Bytes lang sein" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q muss ein Tupel der Länge 2 sein" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q muss zwischen %d und %d sein" + +#~ msgid "%q should be an int" +#~ msgstr "%q sollte ein integer sein" + +#~ msgid "(x,y) integers required" +#~ msgstr "(x,y) Integer benötigt" + +#~ msgid "Address type out of range" +#~ msgstr "Adresstyp außerhalb des zulässigen Bereichs" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn ist an diesem Pin nicht unterstützt" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut-Funktion wird nicht unterstützt" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut kann nur 16 Bit. Der Wert muss unter 65536 liegen." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut ist an diesem Pin nicht unterstützt" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bittiefe muss zwischen 1 und 6 liegen, nicht %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Der Puffergröße ist inkorrekt. Sie sollte %d bytes haben." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Ein Bytes kann nur Werte zwischen 0 und 255 annehmen." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Kann nicht beite Kanäle auf dem gleichen Pin ausgeben" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Kann ohne MISO-Pin nicht lesen." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Reset zum Bootloader nicht möglich, da Bootloader nicht vorhanden." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Übertragung ohne MOSI- und MISO-Pins nicht möglich." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Kann nicht ohne MOSI-Pin schreiben." + +#~ msgid "Clock pin init failed." +#~ msgstr "Clock pin init fehlgeschlagen." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Der Befehl muss ein int zwischen 0 und 255 sein" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Konnte Kamera nicht initialisieren" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "GNSS konnte nicht initialisiert werden" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Konnte SDKarte nicht initialisieren" + +#~ msgid "Could not initialize UART" +#~ msgstr "Konnte UART nicht initialisieren" + +#~ msgid "Could not re-init channel" +#~ msgstr "Kanal konnte nicht neu initiiert werden" + +#~ msgid "Could not re-init timer" +#~ msgstr "Timer konnte nicht neu gestartet werden" + +#~ msgid "Could not restart PWM" +#~ msgstr "PWM konnte nicht neu gestartet werden" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Konnte first buffer nicht zuteilen" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Eingabepuffer konnte nicht zugewiesen werden" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Konnte second buffer nicht zuteilen" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut wird auf dem angegebenen Pin nicht unterstützt" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Habe ein Tupel der Länge %d erwartet aber %d erhalten" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Konnte keinen RX Buffer allozieren" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Konnte keine RX Buffer mit %d allozieren" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Framepuffer benötigt %d bytes" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Der Hostname muss zwischen 1 und 253 Zeichen haben" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C-Init-Fehler" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Ungültige %q Pin-Auswahl" + +#~ msgid "Invalid AuthMode" +#~ msgstr "Ungültiges AuthMode" + +#~ msgid "Invalid BMP file" +#~ msgstr "Ungültige BMP-Datei" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Ungültiger DAC-Pin angegeben" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Ungültige MIDI Datei" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Ungültige PWM Frequenz" + +#~ msgid "Invalid Pin" +#~ msgstr "Ungültiger Pin" + +#~ msgid "Invalid buffer size" +#~ msgstr "Ungültige Puffergröße" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Ungültige Byteorder-String" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Ungültiger Aufnahmezeitraum. Gültiger Bereich: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Ungültige Anzahl von Kanälen" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "Ungültiger data_count %d" + +#~ msgid "Invalid direction." +#~ msgstr "Ungültige Richtung." + +#~ msgid "Invalid file" +#~ msgstr "Ungültige Datei" + +#~ msgid "Invalid mode" +#~ msgstr "Ungültiger Modus" + +#~ msgid "Invalid number of bits" +#~ msgstr "Ungültige Anzahl von Bits" + +#~ msgid "Invalid phase" +#~ msgstr "Ungültige Phase" + +#~ msgid "Invalid pin" +#~ msgstr "Ungültiger Pin" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Ungültiger Pin für linken Kanal" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Ungültiger Pin für rechten Kanal" + +#~ msgid "Invalid polarity" +#~ msgstr "Ungültige Polarität" + +#~ msgid "Invalid properties" +#~ msgstr "Ungültige Eigenschaften" + +#~ msgid "Invalid run mode." +#~ msgstr "Ungültiger Ausführungsmodus." + +#~ msgid "Invalid security_mode" +#~ msgstr "Ungültiger security_mode" + +#~ msgid "Invalid voice" +#~ msgstr "Ungültige Stimme" + +#~ msgid "Invalid voice count" +#~ msgstr "Ungültige Anzahl von Stimmen" + +#~ msgid "Invalid wave file" +#~ msgstr "Ungültige wave Datei" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Ungültige Wort- / Bitlänge" + +#~ msgid "Layer already in a group." +#~ msgstr "Layer ist bereits in einer Gruppe." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer muss eine Group- oder TileGrid-Unterklasse sein." + +#~ msgid "MISO pin init failed." +#~ msgstr "MISO pin Initialisierung fehlgeschlagen." + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSI pin Initialisierung fehlgeschlagen." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Meldungen auf 8 Bytes limitiert" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "Mehr als %d Berichts-IDs werden nicht unterstützt" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Keine Hardwareunterstützung am clk Pin" + +#~ msgid "No hardware support on pin" +#~ msgstr "Keine Hardwareunterstützung an diesem Pin" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "Ausgabe-Buffer muss mindestens %d Bytes sein" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "PWM duty_cycle muss zwischen 0 und 65535 (16 Bit-Auflösung) liegen" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "Pin-Anzahl muss mindestens 1 sein" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin hat keine ADC-Funktionalität" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "Programm muss mindestens eine 16-Bit-Instruktion enthalten." + +#~ msgid "Program too large" +#~ msgstr "Das Programm ist zu groß" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 wird von diesem Gerät nicht unterstützt" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "Die RTC-Kalibrierung wird auf diesem Board nicht unterstützt" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS / CTS / RS485 Wird von diesem Gerät noch nicht unterstützt" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI-Init-Fehler" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI-Neuinitialisierungsfehler" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Abtastrate muss positiv sein" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Abtastrate zu hoch. Wert muss unter %d liegen" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "Die Anzahl der Pins muss zwischen 1 und 5 liegen" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "Die Anzahl der Pins für Side set muss zwischen 1 und 5 liegen" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Die Stackgröße sollte mindestens 256 sein" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Kachelwert außerhalb der Grenzen" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART Buffer reservierungs Fehler" + +#~ msgid "UART De-init error" +#~ msgstr "UART De-Init-Fehler" + +#~ msgid "UART Init Error" +#~ msgstr "UART Init Fehler" + +#~ msgid "UART Re-init error" +#~ msgstr "UART Re-Init-Fehler" + +#~ msgid "UART write error" +#~ msgstr "UART-Schreibfehler" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Baudrate wird nicht unterstützt" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFi Passwort muss zwischen 8 und 63 Zeichen lang sein" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "bits müssen zwischen 5 und 9 liegen" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "bytes mit mehr als 8 bits werden nicht unterstützt" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "Kalibrierwert nicht im Bereich von +/-127" + +#~ msgid "can only be registered in one parent" +#~ msgstr "kann nur bei einem Elternteil registriert werden" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "Kreis kann nur in einem Elternteil registriert werden" + +#~ msgid "max_connections must be between 0 and 10" +#~ msgstr "max_connections muss zwischen 0 und 10 liegen" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length muss >= 0 sein" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "pull_threshold muss zwischen 1 und 32 liegen" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "push_threshold muss zwischen 1 und 32 liegen" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop muss 1 oder 2 sein" + +#~ msgid "tile must be greater than zero" +#~ msgstr "Kachel muss größer als Null sein" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeout muss >= 0.0 sein" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "breite muss zwischen (inklusive) 2 und 8 liegen, nicht %d" + +#~ msgid "Unsupported operation" +#~ msgstr "Nicht unterstützte Operation" + +#~ msgid "divisor must be 4" +#~ msgstr "Teiler muss 4 sein" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" @@ -5182,9 +5236,6 @@ msgstr "zi muss die Form (n_section, 2) haben" #~ msgid "wrong argument type" #~ msgstr "falscher Argumenttyp" -#~ msgid "wrong index type" -#~ msgstr "falscher Indextyp" - #~ msgid "" #~ "\n" #~ "To exit, please reset the board without " diff --git a/locale/el.po b/locale/el.po index 7d43824e4e..05c36779f8 100644 --- a/locale/el.po +++ b/locale/el.po @@ -66,10 +66,27 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -82,12 +99,7 @@ msgstr "" msgid "%q in use" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "" @@ -95,18 +107,42 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -115,29 +151,25 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -156,7 +188,11 @@ msgstr "" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -165,10 +201,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -181,7 +213,11 @@ msgstr "" msgid "%q, %q, and %q must all be the same length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -331,10 +367,6 @@ msgstr "" msgid "'yield' outside function" msgstr "" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -370,16 +402,12 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" @@ -416,7 +444,6 @@ msgstr "" msgid "All event channels in use" msgstr "" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -464,25 +491,6 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -521,7 +529,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "" @@ -552,11 +560,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" @@ -598,11 +601,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -612,7 +610,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -623,14 +620,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -652,10 +645,6 @@ msgstr "" msgid "Byte buffer must be 16 bytes." msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "" - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "" @@ -664,7 +653,7 @@ msgstr "" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -672,6 +661,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -719,18 +712,10 @@ msgstr "" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "" @@ -742,7 +727,7 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -763,20 +748,19 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -791,10 +775,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -803,11 +783,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -818,35 +793,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -867,20 +813,6 @@ msgstr "" msgid "Couldn't allocate decoder" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -928,10 +860,6 @@ msgstr "" msgid "Device in use" msgstr "" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -943,6 +871,10 @@ msgstr "" msgid "Display rotation must be in 90 degree increments" msgstr "" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "" @@ -978,18 +910,14 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" +msgid "Expected an %q" msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c @@ -1018,20 +946,8 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" msgstr "" #: ports/espressif/common-hal/wifi/__init__.c @@ -1055,10 +971,6 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -1102,9 +1014,9 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" #: shared-bindings/pwmio/PWMOut.c @@ -1116,7 +1028,11 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1143,19 +1059,16 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1260,75 +1173,37 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1336,42 +1211,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -1380,79 +1224,15 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "" - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1460,27 +1240,10 @@ msgstr "" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1494,25 +1257,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1522,18 +1277,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1569,11 +1333,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1599,6 +1358,10 @@ msgstr "" msgid "Name too long" msgstr "" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1629,16 +1392,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" -#: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c -msgid "No MISO Pin" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1677,16 +1452,6 @@ msgstr "" msgid "No hardware random available" msgstr "" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1731,6 +1496,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1780,6 +1549,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1789,7 +1566,7 @@ msgstr "" msgid "Only IPv4 addresses supported" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1822,15 +1599,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1838,19 +1619,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1858,11 +1643,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1873,12 +1653,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1897,29 +1676,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -1986,18 +1750,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2019,8 +1775,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2028,21 +1785,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "" @@ -2060,10 +1806,14 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "" @@ -2076,7 +1826,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2092,6 +1842,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2102,29 +1856,20 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2145,14 +1890,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2188,10 +1925,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2277,10 +2010,6 @@ msgstr "" msgid "Tile index out of bounds" msgstr "" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "" @@ -2300,6 +2029,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2332,23 +2064,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2485,12 +2214,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2503,8 +2226,8 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c @@ -2525,7 +2248,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2555,10 +2278,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2569,8 +2288,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2611,11 +2330,11 @@ msgstr "" msgid "a bytes-like object is required" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "" @@ -2664,6 +2383,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2725,10 +2448,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2766,11 +2485,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2779,7 +2493,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2787,12 +2501,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2815,7 +2526,7 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -2963,6 +2674,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -2975,10 +2690,6 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3043,6 +2754,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3126,10 +2841,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3138,6 +2849,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3167,6 +2882,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "" @@ -3241,7 +2962,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3277,6 +2998,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" @@ -3385,7 +3110,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3403,6 +3128,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3448,6 +3177,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3456,11 +3189,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3540,6 +3269,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "" @@ -3653,10 +3386,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3664,12 +3393,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3803,7 +3528,7 @@ msgstr "" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "" @@ -3914,7 +3639,11 @@ msgstr "" msgid "odd-length string" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4038,10 +3767,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4067,63 +3792,23 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4143,14 +3828,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4202,12 +3879,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4305,10 +3976,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" @@ -4321,10 +3988,6 @@ msgstr "" msgid "step must be non-zero" msgstr "" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4373,10 +4036,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4396,10 +4055,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4408,6 +4063,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4578,6 +4237,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4599,13 +4266,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4625,7 +4286,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4633,6 +4304,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index cd600837c1..92b83cd7aa 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -7,15 +7,15 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2021-09-21 03:37+0000\n" -"Last-Translator: James Carr \n" +"PO-Revision-Date: 2022-05-22 00:18+0000\n" +"Last-Translator: Dan Halbert \n" "Language-Team: none\n" "Language: en_GB\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.9-dev\n" +"X-Generator: Weblate 4.13-dev\n" #: main.c msgid "" @@ -26,10 +26,13 @@ msgstr "" "Code done running.\n" #: main.c +#, fuzzy msgid "" "\n" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +"\n" +"Code stopped by auto-reload. Reloading soon.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -73,10 +76,27 @@ msgid "" msgstr "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q and %q contain duplicate pins" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q contains duplicate pins" @@ -89,12 +109,7 @@ msgstr "%q failure: %d" msgid "%q in use" msgstr "%q in use" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q index out of range" @@ -102,18 +117,42 @@ msgstr "%q index out of range" msgid "%q indices must be integers, not %s" msgstr "%q indices must be integers, not %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q length must be %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "%q length must be >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q must be %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -122,30 +161,26 @@ msgstr "" msgid "%q must be >= %d" msgstr "%q must be >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q must be >= 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q must be >= 1" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "%q must be a string" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q must be a tuple of length 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -163,7 +198,11 @@ msgstr "%q must be power of 2" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q out of range" @@ -172,10 +211,6 @@ msgstr "%q out of range" msgid "%q pin invalid" msgstr "%q pin invalid" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q should be an int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -188,7 +223,11 @@ msgstr "%q() takes %d positional arguments but %d were given" msgid "%q, %q, and %q must all be the same length" msgstr "%q, %q, and %q must all be the same length" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s error 0x%x" @@ -338,10 +377,6 @@ msgstr "'yield from' inside async function" msgid "'yield' outside function" msgstr "'yield' outside function" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "(x,y) integers required" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x must be assignment target" @@ -377,16 +412,12 @@ msgstr "ADC2 is being used by WiFi" msgid "Address must be %d bytes long" msgstr "Address must be %d bytes long" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Address type out of range" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "All CAN peripherals are in use" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "All I2C peripherals are in use" @@ -423,7 +454,6 @@ msgstr "All channels in use" msgid "All event channels in use" msgstr "All event channels in use" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "All state machines in use" @@ -471,25 +501,6 @@ msgstr "Already running" msgid "Already scanning for wifi networks" msgstr "Already scanning for WiFi networks" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn not supported on given pin" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut functionality not supported" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut is only 16 bits. Value must be less than 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut not supported on given pin" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Another PWMAudioOut is already active" @@ -528,7 +539,7 @@ msgstr "Audio conversion not implemented" msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN is not used with password" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Authentication failure" @@ -561,11 +572,6 @@ msgstr "Bit clock and word select must be sequential pins" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock and word select must share a clock unit" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bit depth must be from 1 to 6 inclusive, not %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit depth must be multiple of 8." @@ -607,11 +613,6 @@ msgstr "Buffer + offset too small %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Buffer elements must be 4 bytes long or less" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Buffer incorrect size. Should be %d bytes." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffer is not a bytearray." @@ -621,7 +622,6 @@ msgstr "Buffer is not a bytearray." msgid "Buffer is too small" msgstr "Buffer is too small" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -632,14 +632,10 @@ msgstr "Buffer length %d too big. It must be less than %d" msgid "Buffer length must be a multiple of 512" msgstr "Buffer length must be a multiple of 512" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "Buffer must be a multiple of 512 bytes" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Buffer must be at least length 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -661,10 +657,6 @@ msgstr "Bus pin %d is already in use" msgid "Byte buffer must be 16 bytes." msgstr "Byte buffer must be 16 bytes." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes must be between 0 and 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC blocks must be multiples of 16 bytes" @@ -673,7 +665,7 @@ msgstr "CBC blocks must be multiples of 16 bytes" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC or checksum was invalid" @@ -681,6 +673,10 @@ msgstr "CRC or checksum was invalid" msgid "Call super().__init__() before accessing native object." msgstr "Call super().__init__() before accessing native object." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "Can only alarm on RTC IO from deep sleep." @@ -728,18 +724,10 @@ msgstr "Cannot get temperature" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "Cannot have scan responses for extended, connectable advertisements." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Cannot output both channels on the same pin" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Cannot pull on input-only pin." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Cannot read without MISO pin." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Cannot record to a file" @@ -751,8 +739,8 @@ msgstr "Cannot remount '/' when visible via USB." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -772,22 +760,21 @@ msgid "Cannot subclass slice" msgstr "Cannot subclass slice" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Cannot vary frequency on a timer that is already in use" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Cannot wake on pin edge. Only level." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Cannot write without MOSI pin." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "CharacteristicBuffer writing not provided" @@ -800,10 +787,6 @@ msgstr "CircuitPython core code crashed hard. Crikey!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython was unable to allocate the heap." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Clock pin init failed." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Clock stretch too long" @@ -812,11 +795,6 @@ msgstr "Clock stretch too long" msgid "Clock unit in use" msgstr "Clock unit in use" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Command must be an int between 0 and 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -829,35 +807,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Corrupt .mpy file" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Could not initialise camera" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Could not initialise GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Could not initialise SDCard" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Could not initialise UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Could not reinit channel" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Could not reinit timer" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Could not restart PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Could not retrieve clock" @@ -878,20 +827,6 @@ msgstr "Could not start interrupt, RX busy" msgid "Couldn't allocate decoder" msgstr "Couldn't allocate decoder" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Couldn't allocate first buffer" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Couldn't allocate input buffer" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Couldn't allocate second buffer" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Crash into the HardFault_Handler." @@ -939,10 +874,6 @@ msgstr "Destination capacity is smaller than destination_length." msgid "Device in use" msgstr "Device in use" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut not supported on given pin" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -954,6 +885,10 @@ msgstr "Display must have a 16 bit colourspace." msgid "Display rotation must be in 90 degree increments" msgstr "Display rotation must be in 90 degree increments" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "Drive mode not used when direction is input." @@ -989,19 +924,15 @@ msgstr "Error: Failure to bind" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Expected a %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "Expected an alarm" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Expected tuple of length %d, got %d" +msgid "Expected an %q" +msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1029,21 +960,9 @@ msgstr "Failed sending command." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Failed to acquire mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Failed to allocate RX buffer" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Failed to allocate RX buffer of %d bytes" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1066,10 +985,6 @@ msgstr "Failed to connect: internal error" msgid "Failed to connect: timeout" msgstr "Failed to connect: timeout" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "Failed to init WiFi" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Failed to parse MP3 file" @@ -1113,10 +1028,10 @@ msgstr "" msgid "Format not supported" msgstr "Format not supported" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1127,7 +1042,11 @@ msgstr "Frequency must match existing PWMOut using this timer" msgid "Function requires lock" msgstr "Function requires lock" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Generic Failure" @@ -1154,19 +1073,16 @@ msgstr "Hardware busy, try alternative pins" msgid "Hardware in use, try alternative pins" msgstr "Hardware in use, try alternative pins" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "Hostname must be between 1 and 253 characters" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O operation on closed file" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C init error" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "I2C peripheral in use" @@ -1273,75 +1189,37 @@ msgstr "" msgid "Internal error #%d" msgstr "Internal error #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "Invalid %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Invalid %q pin" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Invalid %q pin selection" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Invalid ADC unit value" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "Invalid AuthMode" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Invalid BLE parameter" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Invalid BMP file" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Invalid BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Invalid DAC pin supplied" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Invalid MIDI file" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Invalid PWM frequency" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Invalid pin" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Invalid argument" @@ -1349,42 +1227,11 @@ msgstr "Invalid argument" msgid "Invalid bits per value" msgstr "Invalid bits per value" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Invalid buffer size" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Invalid byteorder string" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Invalid capture period. Valid range: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Invalid channel count" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "Invalid data_count %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "Invalid data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Invalid direction." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Invalid file" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Invalid format chunk size" @@ -1393,79 +1240,15 @@ msgstr "Invalid format chunk size" msgid "Invalid memory access." msgstr "Invalid memory access." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Invalid number of bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Invalid phase" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Invalid pin" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Invalid pin for left channel" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Invalid pin for right channel" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Invalid pins" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Invalid polarity" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Invalid properties" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Invalid run mode." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Invalid security_mode" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Invalid size" @@ -1473,27 +1256,10 @@ msgstr "Invalid size" msgid "Invalid socket for TLS" msgstr "Invalid socket for TLS" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Invalid state" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Invalid voice" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Invalid voice count" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Invalid wave file" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Invalid word/bit length" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Key must be 16, 24, or 32 bytes long" @@ -1507,25 +1273,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS of keyword arg must be an id" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Layer already in a group." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC address was invalid" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISO pin init failed." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSI pin init failed." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1535,18 +1293,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "Maximum x value when mirrored is %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Messages limited to 8 bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Microphone startup delay must be in range 0.0 to 1.0" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Missing MISO or MOSI pin" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1582,11 +1349,6 @@ msgstr "Missing first_set_pin. Instruction %d sets pin(s)" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "Missing jmp_pin. Instruction %d jumps on pin" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "More than %d report ids not supported" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Must be a %q subclass." @@ -1612,6 +1374,10 @@ msgstr "NVS Error" msgid "Name too long" msgstr "Name too long" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1642,16 +1408,28 @@ msgstr "No DMA pacing timer found" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "No MISO pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "No MOSI pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1690,16 +1468,6 @@ msgstr "No free GCLKs" msgid "No hardware random available" msgstr "No hardware random available" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "No hardware support on clk pin" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "No hardware support on pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "No in in program" @@ -1744,6 +1512,10 @@ msgstr "No pulldown on pin; 1Mohm recommended" msgid "No space left on device" msgstr "No space left on device" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "No such file/directory" @@ -1794,6 +1566,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Odd parity is not supported" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1803,7 +1583,7 @@ msgstr "Only 8 or 16 bit mono with " msgid "Only IPv4 addresses supported" msgstr "Only IPv4 addresses supported" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "Only IPv4 sockets supported" @@ -1839,15 +1619,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "Only one TouchAlarm can be set in deep sleep." -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Only one alarm.time alarm can be set." @@ -1855,19 +1639,23 @@ msgstr "Only one alarm.time alarm can be set." msgid "Only one color can be transparent at a time" msgstr "Only one colour can be transparent at a time" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operation or feature not supported" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Operation timed out" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Out of memory" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "Out of sockets" @@ -1875,11 +1663,6 @@ msgstr "Out of sockets" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Out-buffer elements must be <= 4 bytes long" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "Output buffer must be at least %d bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample must be multiple of 8." @@ -1890,15 +1673,13 @@ msgstr "PDMIn not available" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" -"PWM frequency not writable when variable_frequency is False on construction." #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" @@ -1916,29 +1697,14 @@ msgstr "Peripheral in use" msgid "Permission denied" msgstr "Permission denied" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "Pin cannot wake from Deep Sleep" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "Pin count must be at least 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Pin count too large" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin does not have ADC capabilities" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2008,18 +1774,10 @@ msgstr "Program does IN without loading ISR" msgid "Program does OUT without loading OSR" msgstr "Program does OUT without loading OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "Program must contain at least one 16-bit instruction." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "Program size invalid" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "Program too large" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull not used when direction is output." @@ -2041,30 +1799,20 @@ msgstr "RNG deinit Error" msgid "RNG Init Error" msgstr "RNG init Error" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 not yet supported on this device" +#: 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 +msgid "RS485" +msgstr "" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "RS485 inversion specified when not in RS485 mode" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "RTC calibration is not supported on this board" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC is not supported on this board" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS/CTS/RS485 not yet supported on this device" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Random number generation error" @@ -2082,10 +1830,14 @@ msgstr "Read-only filesystem" msgid "Read-only object" msgstr "Read-only object" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Received response was invalid" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "Refresh too soon" @@ -2098,7 +1850,7 @@ msgstr "RemoteTransmissionRequests limited to 8 bytes" msgid "Requested AES mode is unsupported" msgstr "Requested AES mode is unsupported" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Requested resource not found" @@ -2114,6 +1866,10 @@ msgstr "Running in safe mode! Not running saved code.\n" msgid "SD card CSD format not supported" msgstr "SD card CSD format not supported" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2124,30 +1880,21 @@ msgstr "SDIO GetCardInfo error %d" msgid "SDIO Init Error %d" msgstr "SDIO init error %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI init error" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI reinitialisation error" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "SPI configuration failed" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "SPI peripheral in use" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Sample rate must be positive" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2167,14 +1914,6 @@ msgstr "Serialiser in use" msgid "Server side context cannot have hostname" msgstr "Server side context cannot have hostname" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "Set pin count must be between 1 and 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "Side set pin count must be between 1 and 5" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Size not supported" @@ -2210,10 +1949,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Splitting with sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Stack size must be at least 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "Stereo left must be on PWM channel A" @@ -2306,10 +2041,6 @@ msgstr "Tile height must exactly divide bitmap height" msgid "Tile index out of bounds" msgstr "Tile index out of bounds" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Tile value out of bounds" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Tile width must exactly divide bitmap width" @@ -2329,6 +2060,9 @@ msgid "To exit, please reset the board without " msgstr "To exit, please reset the board without " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Too many channels in sample." @@ -2361,24 +2095,21 @@ msgid "Tuple or struct_time argument required" msgstr "Tuple or struct_time argument required" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART deinit error" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART init Error" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART reinit error" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART write error" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2516,12 +2247,6 @@ msgstr "" "Unspecified issue. Can be that the pairing prompt on the other device was " "declined or ignored." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Unsupported baudrate" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2534,9 +2259,9 @@ msgstr "Unsupported display bus type" msgid "Unsupported format" msgstr "Unsupported format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Unsupported operation" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2556,7 +2281,7 @@ msgstr "Value length != required fixed length" msgid "Value length > max_length" msgstr "Value length > max_length" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "Version was invalid" @@ -2586,10 +2311,6 @@ msgstr "WatchDogTimer.mode cannot be changed once set to WatchDogMode.RESET" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "WatchDogTimer.timeout must be greater than 0" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "WatchDog timer expired." - #: py/builtinhelp.c #, c-format msgid "" @@ -2600,9 +2321,9 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" #: main.c msgid "Woken up by alarm.\n" @@ -2643,11 +2364,11 @@ msgstr "__new__ arg must be a user-type" msgid "a bytes-like object is required" msgstr "a bytes-like object is required" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "address out of bounds" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "addresses is empty" @@ -2696,6 +2417,10 @@ msgstr "arguments must be ndarrays" msgid "array and index length must be equal" msgstr "array and index length must be equal" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2757,10 +2482,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "bits must be 32 or less" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "bits must be in range 5 to 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample must be 8 or 16" @@ -2798,11 +2519,6 @@ msgstr "Buffer too small for requested bytes" msgid "byteorder is not a string" msgstr "Byteorder is not a string" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "Bytes > 8 bits not supported" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "Bytes length not a multiple of item size" @@ -2811,7 +2527,7 @@ msgstr "Bytes length not a multiple of item size" msgid "bytes value out of range" msgstr "Bytes value out of range" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "Calibration is out of range" @@ -2819,12 +2535,9 @@ msgstr "Calibration is out of range" msgid "calibration is read only" msgstr "Calibration is read only" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "Calibration value out of range +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2847,7 +2560,7 @@ msgstr "Can't assign to expression" msgid "can't cancel self" msgstr "can't cancel self" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "Can't convert %q to %q" @@ -2997,6 +2710,10 @@ msgstr "cannot unambiguously get sizeof scalar" msgid "casting" msgstr "casting" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "chars buffer too small" @@ -3009,10 +2726,6 @@ msgstr "chr() arg not in range(0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg not in range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "circle can only be registered in one parent" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "clip point must be (x,y) tuple" @@ -3077,6 +2790,10 @@ msgstr "convolve arguments must be ndarrays" msgid "convolve arguments must not be empty" msgstr "convolve arguments must not be empty" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "could not invert Vandermonde matrix" @@ -3161,10 +2878,6 @@ msgstr "divide by zero" msgid "division by zero" msgstr "division by zero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3173,6 +2886,10 @@ msgstr "" msgid "empty" msgstr "empty" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "empty heap" @@ -3202,6 +2919,12 @@ msgstr "epoch_time not supported on this board" msgid "error = 0x%08lX" msgstr "error = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "exceptions must derive from BaseException" @@ -3276,7 +2999,7 @@ msgstr "first argument must be a function" msgid "first argument must be a tuple of ndarrays" msgstr "first argument must be a tuple of ndarrays" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "first argument must be an ndarray" @@ -3312,6 +3035,10 @@ msgstr "font must be 2048 bytes long" msgid "format requires a dict" msgstr "format requires a dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "full" @@ -3420,7 +3147,7 @@ msgstr "incomplete format key" msgid "incorrect padding" msgstr "incorrect padding" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "index is out of bounds" @@ -3438,6 +3165,10 @@ msgstr "indices must be integers" msgid "indices must be integers, slices, or Boolean lists" msgstr "indices must be integers, slices, or Boolean lists" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "initial values must be iterable" @@ -3483,6 +3214,10 @@ msgstr "input matrix is asymmetric" msgid "input matrix is singular" msgstr "input matrix is singular" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3491,11 +3226,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "input must be a dense ndarray" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "input must be a tensor of rank 2" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "input must be an ndarray" @@ -3575,6 +3306,10 @@ msgstr "invalid hostname" msgid "invalid micropython decorator" msgstr "invalid micropython decorator" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "invalid step" @@ -3688,10 +3423,6 @@ msgstr "math domain error" msgid "matrix is not positive definite" msgstr "matrix is not positive definite" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3699,13 +3430,9 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length must be 0-%d when fixed_length is %s" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "max_length must be >= 0" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3838,7 +3565,7 @@ msgstr "no reset pin available" msgid "no response from SD card" msgstr "no response from SD card" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "no such attribute" @@ -3949,7 +3676,11 @@ msgstr "object with buffer protocol required" msgid "odd-length string" msgstr "odd-length string" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset is too large" @@ -4073,10 +3804,6 @@ msgstr "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "polygon can only be registered in one parent" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop from an empty PulseIn" @@ -4102,63 +3829,23 @@ msgstr "pow() 3rd argument cannot be 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() with 3 arguments requires integers" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "pressing boot button at start up.\n" @@ -4178,14 +3865,6 @@ msgstr "pressing the left button at start up\n" msgid "pull masks conflict with direction masks" msgstr "pull masks conflict with direction masks" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "pull_threshold must be between 1 and 32" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "push_threshold must be between 1 and 32" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "queue overflow" @@ -4237,14 +3916,6 @@ msgstr "roll argument must be an ndarray" msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4342,10 +4013,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "start/end indices" @@ -4358,10 +4025,6 @@ msgstr "start_x should be an int" msgid "step must be non-zero" msgstr "step must be non-zero" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop must be 1 or 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop not reachable from start" @@ -4410,10 +4073,6 @@ msgstr "syntax error in uctypes descriptor" msgid "threshold must be in the range 0-65536" msgstr "threshold must be in the range 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "tile must be greater than zero" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() takes a 9-sequence" @@ -4433,10 +4092,6 @@ msgstr "timeout must be 0.0-100.0 seconds" msgid "timeout must be < 655.35 secs" msgstr "timeout must be < 655.35 secs" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "timeout must be >= 0.0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "timeout waiting for v1 card" @@ -4445,6 +4100,10 @@ msgstr "timeout waiting for v1 card" msgid "timeout waiting for v2 card" msgstr "timeout waiting for v2 card" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp out of range for platform time_t" @@ -4615,6 +4274,14 @@ msgstr "unsupported type for operator" msgid "unsupported types for %q: '%q', '%q'" msgstr "unsupported types for %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4636,13 +4303,7 @@ msgstr "WatchDog not initialised" msgid "watchdog timeout must be greater than 0" msgstr "WatchDog timeout must be greater than 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "width must be from 2 to 8 (inclusive), not %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "width must be greater than zero" @@ -4662,7 +4323,17 @@ msgstr "wrong axis index" msgid "wrong axis specified" msgstr "wrong axis specified" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "wrong input type" @@ -4670,6 +4341,10 @@ msgstr "wrong input type" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "wrong number of arguments" @@ -4714,6 +4389,367 @@ 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 "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" + +#~ msgid "Expected an alarm" +#~ msgstr "Expected an alarm" + +#~ msgid "Failed to init wifi" +#~ msgstr "Failed to init WiFi" + +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "input must be a tensor of rank 2" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "maximum number of dimensions is 4" + +#~ msgid "Watchdog timer expired." +#~ msgstr "WatchDog timer expired." + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q must be a tuple of length 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q must be between %d and %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q should be an int" + +#~ msgid "(x,y) integers required" +#~ msgstr "(x,y) integers required" + +#~ msgid "Address type out of range" +#~ msgstr "Address type out of range" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn not supported on given pin" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut functionality not supported" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut is only 16 bits. Value must be less than 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut not supported on given pin" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bit depth must be from 1 to 6 inclusive, not %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Buffer incorrect size. Should be %d bytes." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Buffer must be at least length 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes must be between 0 and 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Cannot output both channels on the same pin" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Cannot read without MISO pin." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Cannot reset into bootloader because no bootloader is present." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Cannot transfer without MOSI and MISO pins." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Cannot write without MOSI pin." + +#~ msgid "Clock pin init failed." +#~ msgstr "Clock pin init failed." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Command must be an int between 0 and 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Could not initialise camera" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Could not initialise GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Could not initialise SDCard" + +#~ msgid "Could not initialize UART" +#~ msgstr "Could not initialise UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Could not reinit channel" + +#~ msgid "Could not re-init timer" +#~ msgstr "Could not reinit timer" + +#~ msgid "Could not restart PWM" +#~ msgstr "Could not restart PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Couldn't allocate first buffer" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Couldn't allocate input buffer" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Couldn't allocate second buffer" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut not supported on given pin" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Expected tuple of length %d, got %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Failed to allocate RX buffer" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Failed to allocate RX buffer of %d bytes" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Framebuffer requires %d bytes" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Hostname must be between 1 and 253 characters" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C init error" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Invalid %q pin selection" + +#~ msgid "Invalid AuthMode" +#~ msgstr "Invalid AuthMode" + +#~ msgid "Invalid BMP file" +#~ msgstr "Invalid BMP file" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Invalid DAC pin supplied" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Invalid MIDI file" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Invalid PWM frequency" + +#~ msgid "Invalid Pin" +#~ msgstr "Invalid pin" + +#~ msgid "Invalid buffer size" +#~ msgstr "Invalid buffer size" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Invalid byteorder string" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Invalid capture period. Valid range: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Invalid channel count" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "Invalid data_count %d" + +#~ msgid "Invalid direction." +#~ msgstr "Invalid direction." + +#~ msgid "Invalid file" +#~ msgstr "Invalid file" + +#~ msgid "Invalid number of bits" +#~ msgstr "Invalid number of bits" + +#~ msgid "Invalid phase" +#~ msgstr "Invalid phase" + +#~ msgid "Invalid pin" +#~ msgstr "Invalid pin" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Invalid pin for left channel" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Invalid pin for right channel" + +#~ msgid "Invalid polarity" +#~ msgstr "Invalid polarity" + +#~ msgid "Invalid properties" +#~ msgstr "Invalid properties" + +#~ msgid "Invalid run mode." +#~ msgstr "Invalid run mode." + +#~ msgid "Invalid security_mode" +#~ msgstr "Invalid security_mode" + +#~ msgid "Invalid voice" +#~ msgstr "Invalid voice" + +#~ msgid "Invalid voice count" +#~ msgstr "Invalid voice count" + +#~ msgid "Invalid wave file" +#~ msgstr "Invalid wave file" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Invalid word/bit length" + +#~ msgid "Layer already in a group." +#~ msgstr "Layer already in a group." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer must be a Group or TileGrid subclass." + +#~ msgid "MISO pin init failed." +#~ msgstr "MISO pin init failed." + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSI pin init failed." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Messages limited to 8 bytes" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "More than %d report ids not supported" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "No hardware support on clk pin" + +#~ msgid "No hardware support on pin" +#~ msgstr "No hardware support on pin" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "Output buffer must be at least %d bytes" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "Pin count must be at least 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin does not have ADC capabilities" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "Program must contain at least one 16-bit instruction." + +#~ msgid "Program too large" +#~ msgstr "Program too large" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 not yet supported on this device" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "RTC calibration is not supported on this board" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 not yet supported on this device" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI init error" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI reinitialisation error" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Sample rate must be positive" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Sample rate too high. It must be less than %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "Set pin count must be between 1 and 5" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "Side set pin count must be between 1 and 5" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Stack size must be at least 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Tile value out of bounds" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART buffer allocation error" + +#~ msgid "UART De-init error" +#~ msgstr "UART deinit error" + +#~ msgid "UART Init Error" +#~ msgstr "UART init Error" + +#~ msgid "UART Re-init error" +#~ msgstr "UART reinit error" + +#~ msgid "UART write error" +#~ msgstr "UART write error" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Unsupported baudrate" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFi password must be between 8 and 63 characters" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "bits must be in range 5 to 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "Bytes > 8 bits not supported" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "Calibration value out of range +/-127" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "circle can only be registered in one parent" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length must be >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "polygon can only be registered in one parent" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "pull_threshold must be between 1 and 32" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "push_threshold must be between 1 and 32" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop must be 1 or 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "tile must be greater than zero" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeout must be >= 0.0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "width must be from 2 to 8 (inclusive), not %d" + +#~ msgid "Unsupported operation" +#~ msgstr "Unsupported operation" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/es.po b/locale/es.po index 995919bc8a..3ef0d2f6e9 100644 --- a/locale/es.po +++ b/locale/es.po @@ -75,10 +75,27 @@ msgstr "" "%d pines de dirección, %d pines rgb y %d tiles indican una altura de %d, y " "no de %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -91,12 +108,7 @@ msgstr "%q fallo: %d" msgid "%q in use" msgstr "%q está siendo utilizado" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indice fuera de rango" @@ -104,18 +116,42 @@ msgstr "%q indice fuera de rango" msgid "%q indices must be integers, not %s" msgstr "%q indices deben ser enteros, no %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q debe ser %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -124,30 +160,26 @@ msgstr "" msgid "%q must be >= %d" msgstr "%q debe ser >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q debe ser >= 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q debe ser >= 1" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "%q debe ser una cadena" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q debe ser una tupla de longitud 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q debe estar entre %d y %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -165,7 +197,11 @@ msgstr "" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q fuera de rango" @@ -174,10 +210,6 @@ msgstr "%q fuera de rango" msgid "%q pin invalid" msgstr "pin inválido %q" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q debe ser un int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -190,7 +222,11 @@ msgstr "%q() toma %d argumentos posicionales pero %d fueron dados" msgid "%q, %q, and %q must all be the same length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s error 0x%x" @@ -340,10 +376,6 @@ msgstr "'yield from' dentro de una función asincrónica" msgid "'yield' outside function" msgstr "'yield' fuera de una función" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x debe ser objetivo de la tarea" @@ -379,16 +411,12 @@ msgstr "ADC2 está siendo usado por WiFi" msgid "Address must be %d bytes long" msgstr "La dirección debe tener %d bytes de largo" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Tipo de dirección fuera de rango" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Todos los periféricos CAN están en uso" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Todos los periféricos I2C están siendo usados" @@ -425,7 +453,6 @@ msgstr "Todos los canales esta en uso" msgid "All event channels in use" msgstr "Todos los canales de eventos estan siendo usados" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "Todas las máquinas de estado en uso" @@ -475,25 +502,6 @@ msgstr "Ya está en ejecución" msgid "Already scanning for wifi networks" msgstr "Ya se están buscando redes wifi" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "El pin proporcionado no soporta AnalogIn" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Funcionalidad AnalogOut no soportada" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut es solo de 16 bits. El valor debe ser menor que 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "El pin proporcionado no soporta AnalogOut" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Otra salida PWMAudioOut esta ya activada" @@ -532,7 +540,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN no se usa con contraseña" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Fallo de autenticación" @@ -565,11 +573,6 @@ msgstr "Le reloj de bit y de selector de palabra deben ser pines secuenciales" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock y word select deben compartir una unidad de reloj" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bit depth tiene que ser de 1 a 6 inclusivo, no %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bits depth debe ser múltiplo de 8." @@ -612,11 +615,6 @@ msgid "Buffer elements must be 4 bytes long or less" msgstr "" "Los elementos del búfer deben de ser de una longitud de 4 bytes o menos" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Tamaño de buffer incorrecto. Debe ser de %d bytes." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffer no es un bytearray." @@ -626,7 +624,6 @@ msgstr "Buffer no es un bytearray." msgid "Buffer is too small" msgstr "El buffer es muy pequeño" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -637,14 +634,10 @@ msgstr "Longitud del buffer %d es demasiado grande. Tiene que ser menor a %d" msgid "Buffer length must be a multiple of 512" msgstr "El tamaño del búfer debe ser múltiplo de 512" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "Búfer deber ser un múltiplo de 512 bytes" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Buffer debe ser de longitud 1 como minimo" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -666,10 +659,6 @@ msgstr "Bus pin %d ya está siendo utilizado" msgid "Byte buffer must be 16 bytes." msgstr "Búfer Byte debe de ser 16 bytes." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes debe estar entre 0 y 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Los bloques CBC deben ser múltiplos de 16 bytes" @@ -678,7 +667,7 @@ msgstr "Los bloques CBC deben ser múltiplos de 16 bytes" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC o suma de comprobación inválida" @@ -686,6 +675,10 @@ msgstr "CRC o suma de comprobación inválida" msgid "Call super().__init__() before accessing native object." msgstr "Llame a super().__init__() antes de acceder al objeto nativo." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "Solo puede alertar en RTC IO de deep sleep." @@ -737,18 +730,10 @@ msgstr "" "No se pueden obtener respuestas de exploración para anuncios extendidos y " "conectables." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "No se puede tener ambos canales en el mismo pin" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "No puede hacer pull en un pin de entrada sola." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "No se puede leer sin pin MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "No se puede grabar en un archivo" @@ -760,8 +745,8 @@ msgstr "No se puede remountar '/' cuanto se es visible vía USB." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "No se puede reiniciar a bootloader porque no hay bootloader presente." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -781,22 +766,21 @@ msgid "Cannot subclass slice" msgstr "No se puede manejar la partición en una subclase" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "No se puede transmitir sin pines MOSI y MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "No puede variar la frecuencia en un temporizador que ya está en uso" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "No puede despertar en pin edge, solo en nivel." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "No se puede escribir sin pin MOSI." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "CharateristicBuffer escritura no proporcionada" @@ -809,10 +793,6 @@ msgstr "El código central de CircuitPython se estrelló con fuerza. ¡Whoops!\n msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython no puedo encontrar el montículo." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Iniciado de pin de reloj fallido." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Estirado de reloj demasiado largo" @@ -821,11 +801,6 @@ msgstr "Estirado de reloj demasiado largo" msgid "Clock unit in use" msgstr "Clock unit está siendo utilizado" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Command debe ser un int entre 0 y 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -838,35 +813,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Archivo .mpy corrupto" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "No se puede inicializar Camera" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "No se pudo inicializar el GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "No se pudo inicializar SDCard" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "No se puede inicializar la UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "No se pudo reiniciar el canal" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "No se pudo reiniciar el temporizador" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "No se pudo reiniciar el PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "No puedo traer el reloj" @@ -887,20 +833,6 @@ msgstr "No se pudo iniciar la interrupción, RX ocupado" msgid "Couldn't allocate decoder" msgstr "No se pudo encontrar el decodificador" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "No se pudo asignar el primer buffer" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "No se pudo encontrar el buffer de entrada" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "No se pudo asignar el segundo buffer" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Choque contra el HardFault_Handler." @@ -949,10 +881,6 @@ msgstr "Capacidad de destino es mas pequeña que destination_length." msgid "Device in use" msgstr "Dispositivo en uso" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut no es compatible con un pin dado" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -964,6 +892,10 @@ msgstr "La pantalla debe tener un espacio de color de 16 bits." msgid "Display rotation must be in 90 degree increments" msgstr "Rotación de display debe ser en incrementos de 90 grados" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "Modo Drive no se usa cuando la dirección es input." @@ -999,19 +931,15 @@ msgstr "Error: fallo al vincular" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Se espera un %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "Un objecto alarm era esperado" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Se esperaba un tuple de %d, se obtuvo %d" +msgid "Expected an %q" +msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1039,21 +967,9 @@ msgstr "Fallo enviando comando." msgid "Failed to acquire mutex, err 0x%04x" msgstr "No se puede adquirir el mutex, error 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Ha fallado la asignación del buffer RX" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Falló la asignación del buffer RX de %d bytes" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1076,10 +992,6 @@ msgstr "Error al conectar: error interno" msgid "Failed to connect: timeout" msgstr "Error al conectar: tiempo de espera agotado" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "Fallo al inicializar wifi" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Error al analizar el archivo MP3" @@ -1123,10 +1035,10 @@ msgstr "" msgid "Format not supported" msgstr "Sin capacidades para el formato" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Framebuffer requiere %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1138,7 +1050,11 @@ msgstr "" msgid "Function requires lock" msgstr "La función requiere lock" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Fallo Genérico" @@ -1165,19 +1081,16 @@ msgstr "Hardware ocupado, pruebe pines alternativos" msgid "Hardware in use, try alternative pins" msgstr "Hardware en uso, pruebe pines alternativos" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "Hostname debe ser entre 1 y 253 caracteres" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operación I/O en archivo cerrado" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C Error de inicio" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "Dispositivo I2C en uso" @@ -1291,75 +1204,37 @@ msgstr "" msgid "Internal error #%d" msgstr "Error interno #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "%q inválido" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Pin %q inválido" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "selección inválida de pin %q" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Valor de unidad de ADC no válido" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "AuthMode invalido" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Parámetro BLE invalido" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Archivo BMP inválido" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "BSSID inválido" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Pin suministrado inválido para DAC" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Archivo MIDI inválido" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Frecuencia PWM inválida" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Pin inválido" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -1367,42 +1242,11 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "Inválido bits por valor" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Tamaño de buffer inválido" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Cadena de byteorder inválida" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Inválido periodo de captura. Rango válido: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Cuenta de canales inválida" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "data_count inválido %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "Inválidos los data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Dirección inválida." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Archivo inválido" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Formato de fragmento de formato no válido" @@ -1411,79 +1255,15 @@ msgstr "Formato de fragmento de formato no válido" msgid "Invalid memory access." msgstr "Acceso a memoria no válido." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Numero inválido de bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Fase inválida" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Pin inválido" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Pin inválido para canal izquierdo" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Pin inválido para canal derecho" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "pines inválidos" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Polaridad inválida" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Propiedades inválidas" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Modo de ejecución inválido." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "'security_mode' no válido" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Tamaño incorrecto" @@ -1491,27 +1271,10 @@ msgstr "Tamaño incorrecto" msgid "Invalid socket for TLS" msgstr "socket invalido para TLS" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Estado invalido" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Voz inválida" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Cuenta de voces inválida" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Archivo wave inválido" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Tamaño no válido de palabra/bit" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "La llave debe tener 16, 24 o 32 bytes de longitud" @@ -1525,25 +1288,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS del agumento por palabra clave deberia ser un identificador" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "La capa ya pertenece a un grupo." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer debe ser una subclase de Group o TileGrid." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "La dirección MAC es incorrecta" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISO pin init fallido." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSI pin init fallido." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1553,18 +1308,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "Valor máximo de x cuando se refleja es %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Mensajes limitados a 8 bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Micrófono demora de inicio debe estar en el rango 0.0 a 1.0" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Falta el pin MISO o MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1604,11 +1368,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Debe de ser una subclase de %q." @@ -1634,6 +1393,10 @@ msgstr "Error NVS" msgid "Name too long" msgstr "Nombre muy largo" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1664,16 +1427,28 @@ msgstr "timer por establecedor de paso DMA no encontrado" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Sin pin MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Sin pin MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1712,16 +1487,6 @@ msgstr "Sin GCLKs libres" msgid "No hardware random available" msgstr "No hay hardware random disponible" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Sin soporte de hardware en el pin clk" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Sin soporte de hardware en pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "No hay \"in\" en el programa" @@ -1766,6 +1531,10 @@ msgstr "No hay pulldown en el pin; 1Mohm recomendado" msgid "No space left on device" msgstr "No queda espacio en el dispositivo" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "No existe el archivo/directorio" @@ -1817,6 +1586,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Paridad impar no soportada" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1826,7 +1603,7 @@ msgstr "Solo mono de 8 ó 16 bit con " msgid "Only IPv4 addresses supported" msgstr "Solo hay capacidad para direcciones IPv4" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "Solo se admiten sockets IPv4" @@ -1863,15 +1640,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "Solamente una TouchAlarm puede ser configurada durante deep sleep." -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Solamente una alarm.time puede ser configurada." @@ -1879,19 +1660,23 @@ msgstr "Solamente una alarm.time puede ser configurada." msgid "Only one color can be transparent at a time" msgstr "Solo un color puede ser transparente a la vez" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operación no característica no soportada" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Tiempo de espera agotado" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Memoria agotada" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "Se acabaron los enchufes" @@ -1899,11 +1684,6 @@ msgstr "Se acabaron los enchufes" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Los elementos del búfer de salida deben ser de una longitud <= 4 bytes" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "buffer de salida debe ser de por lo menos %d bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "El sobremuestreo debe ser un múltiplo de 8." @@ -1912,11 +1692,6 @@ msgstr "El sobremuestreo debe ser un múltiplo de 8." msgid "PDMIn not available" msgstr "PDMIn no esta disponible" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "PWM duty_cycle debe ser entre 0 y 65535 inclusivo (16 bit resolution)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1924,6 +1699,10 @@ msgstr "" "La frecuencia de PWM no se puede escribir variable_frequency es False en la " "construcción." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "Segmento PWM ya esta en uso" @@ -1940,29 +1719,14 @@ msgstr "Periférico en uso" msgid "Permission denied" msgstr "Permiso denegado" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "El Pin no se puede despertar de un sueño profundo" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "El total de pines debe ser por lo menos 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Total de pines demasiado grande" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin no tiene capacidad ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2035,18 +1799,10 @@ msgstr "El programa hace un IN sin cargar ISR" msgid "Program does OUT without loading OSR" msgstr "El programa hace OUT sin cargar OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "El programa debe contener por lo menos una instrucción de 16 bits." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "El tamaño del programa no es correcto" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "Programa demasiado grande" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull no se usa cuando la dirección es output." @@ -2068,30 +1824,20 @@ msgstr "Error de desinicialización de RNG" msgid "RNG Init Error" msgstr "Error de inicialización de RNG" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 no esta soportado todavía en este dispositivo" +#: 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 +msgid "RS485" +msgstr "" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "Se especifica inversión de RS485 si no está en modo RS485" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "Calibración de RTC no es soportada en esta placa" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC no soportado en esta placa" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "Sin capacidad de RTS/CTS/RS485 para este dispositivo" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Error de generación de números aleatorios" @@ -2109,10 +1855,14 @@ msgstr "Sistema de archivos de solo-Lectura" msgid "Read-only object" msgstr "Objeto de solo-lectura" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "La respuesta recibida es invalida" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "Refresco demasiado pronto" @@ -2125,7 +1875,7 @@ msgstr "RemoteTransmissionRequests limitado a 8 bytes" msgid "Requested AES mode is unsupported" msgstr "El modo AES solicitado no es compatible" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Recurso solicitado no encontrado" @@ -2142,6 +1892,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "Sin capacidad para formato CSD para tarjeta SD" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2152,30 +1906,21 @@ msgstr "Error SDIO GetCardInfo %d" msgid "SDIO Init Error %d" msgstr "Error de iniciado de SDIO %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "Error de inicio de SPI" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "Error de reinicialización de SPI" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "Configuración de SPI fallida" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "Periférico SPI en uso" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Sample rate debe ser positivo" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Frecuencia de muestreo demasiado alta. Debe ser menor a %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2195,14 +1940,6 @@ msgstr "Serializer está siendo utilizado" msgid "Server side context cannot have hostname" msgstr "El contexto del lado del servidor no puede tener un hostname" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "La suma de pines configurados debe estar entre 1 y 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "El conteo de pines de Side set debe estar entre 1 y 5" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Sin capacidades para el tamaño" @@ -2238,10 +1975,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Dividiendo con sub-capturas" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "El tamaño de la pila debe ser de al menos 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "Estéreo izquierdo debe estar en el canal PWM A" @@ -2335,10 +2068,6 @@ msgstr "La altura del Tile debe dividir exacto la altura del bitmap" msgid "Tile index out of bounds" msgstr "Índice de mosaico fuera de límites" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Valor de mosaico fuera de límites" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Ancho del Tile debe dividir exactamente el ancho de mapa de bits" @@ -2360,6 +2089,9 @@ msgid "To exit, please reset the board without " msgstr "Para salir, por favor reinicia la tarjeta sin " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Demasiados canales en sample." @@ -2392,24 +2124,21 @@ msgid "Tuple or struct_time argument required" msgstr "Argumento tuple o struct_time requerido" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "No se pudo encontrar el búfer para UART" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "Error de desinicialización de UART" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "Error de inicialización de UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "Error de reinicialización de UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "Error de escritura UART" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2547,12 +2276,6 @@ msgstr "" "Problema no especificado. Puede ser que la señal de emparejamiento del otro " "dispositivo fue denegada o ignorada." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Baudrate no soportado" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2565,9 +2288,9 @@ msgstr "Sin capacidad de bus tipo display" msgid "Unsupported format" msgstr "Formato no soportado" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operación no soportada" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2587,7 +2310,7 @@ msgstr "Tamaño del valor != del tamaño fijo requerido" msgid "Value length > max_length" msgstr "Tamaño de valor > max_length" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "La versión era invalida" @@ -2620,10 +2343,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "WatchDogTimer.timeout debe ser mayor a 0" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "Temporizador de perro guardián expirado." - #: py/builtinhelp.c #, c-format msgid "" @@ -2634,9 +2353,9 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "La clave de WiFi debe ser entre 8 y 63 caracteres" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" #: main.c msgid "Woken up by alarm.\n" @@ -2678,11 +2397,11 @@ msgstr "__new__ arg debe ser un user-type" msgid "a bytes-like object is required" msgstr "se requiere un objeto bytes-like" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "address fuera de límites" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "addresses esta vacío" @@ -2731,6 +2450,10 @@ msgstr "argumentos deben ser ndarrays" msgid "array and index length must be equal" msgstr "Longitud del array e índice tienen que ser iguales" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2792,10 +2515,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "los bits deben ser 32 o menos" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "los bits deben estar en el rango de 5 a 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample debe ser 8 ó 16" @@ -2833,11 +2552,6 @@ msgstr "búfer muy pequeño para los bytes solicitados" msgid "byteorder is not a string" msgstr "byteorder no es una cadena" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "bytes > 8 bits no soportados" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "el tamaño en bytes no es un múltiplo del tamaño del item" @@ -2846,7 +2560,7 @@ msgstr "el tamaño en bytes no es un múltiplo del tamaño del item" msgid "bytes value out of range" msgstr "valor de bytes fuera de rango" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "calibration esta fuera de rango" @@ -2854,12 +2568,9 @@ msgstr "calibration esta fuera de rango" msgid "calibration is read only" msgstr "calibration es de solo lectura" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "Valor de calibración fuera del rango +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2882,7 +2593,7 @@ msgstr "no se puede asignar a la expresión" msgid "can't cancel self" msgstr "no se puede cancelar a si mismo" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "no puede convertir %q a %q" @@ -3035,6 +2746,10 @@ msgstr "no se puede sin ambiguedades traer el sizeof del escalar" msgid "casting" msgstr "convirtiendo tipo" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "chars buffer es demasiado pequeño" @@ -3047,10 +2762,6 @@ msgstr "El argumento de chr() esta fuera de rango(0x110000)" msgid "chr() arg not in range(256)" msgstr "El argumento de chr() no esta en el rango(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "circulo solo puede ser registrado con un pariente" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "El punto de recorte debe ser una tupla (x, y)" @@ -3115,6 +2826,10 @@ msgstr "los argumentos para convolve deben ser ndarrays" msgid "convolve arguments must not be empty" msgstr "los argumentos para convolve no deben estar vacíos" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "no se pudo invertir la matriz de Vandermonde" @@ -3200,10 +2915,6 @@ msgstr "divide por cero" msgid "division by zero" msgstr "división por cero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3212,6 +2923,10 @@ msgstr "" msgid "empty" msgstr "vacío" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap vacío" @@ -3241,6 +2956,12 @@ msgstr "epoch_time no esta soportado en esta tarjeta" msgid "error = 0x%08lX" msgstr "error = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "las excepciones deben derivar de BaseException" @@ -3315,7 +3036,7 @@ msgstr "el primer argumento debe ser una función" msgid "first argument must be a tuple of ndarrays" msgstr "Primer argumento tiene que ser una tupla de ndarrays" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "el primer argumento debe ser ndarray" @@ -3351,6 +3072,10 @@ msgstr "font debe ser 2048 bytes de largo" msgid "format requires a dict" msgstr "format requiere un dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "lleno" @@ -3459,7 +3184,7 @@ msgstr "formato de llave incompleto" msgid "incorrect padding" msgstr "relleno (padding) incorrecto" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "el índice está fuera de límites" @@ -3477,6 +3202,10 @@ msgstr "indices deben ser enteros" msgid "indices must be integers, slices, or Boolean lists" msgstr "los índices deben ser enteros, particiones o listas de booleanos" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "los valores iniciales deben permitir iteración" @@ -3522,6 +3251,10 @@ msgstr "la matriz de entrada es asimétrica" msgid "input matrix is singular" msgstr "la matriz de entrada es singular" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3530,11 +3263,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "Entrada tiene que ser un ndarray denso" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "Entrada tiene que ser un tensor de rango 2" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "Entrada tiene que ser un ndarray" @@ -3614,6 +3343,10 @@ msgstr "hostname inválido" msgid "invalid micropython decorator" msgstr "decorador de micropython inválido" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "paso inválido" @@ -3730,10 +3463,6 @@ msgstr "error de dominio matemático" msgid "matrix is not positive definite" msgstr "matrix no es definida positiva" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3741,13 +3470,9 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length debe ser 0-%d cuando fixed_length es %s" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "max_length debe ser >= 0" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "Máximo número de dimensiones es 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3881,7 +3606,7 @@ msgstr "no hay pin de reinicio disponible" msgid "no response from SD card" msgstr "no hay respuesta de la tarjeta SD" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "no hay tal atributo" @@ -3995,7 +3720,11 @@ msgstr "objeto con protocolo de buffer requerido" msgid "odd-length string" msgstr "string de longitud impar" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset es demasiado grande" @@ -4119,10 +3848,6 @@ msgstr "pixel_shader debe ser displayio.Palette o displayio.ColorConverter" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "el polígono solo se puede registrar en uno de los padres" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop de un PulseIn vacío" @@ -4148,63 +3873,23 @@ msgstr "el 3er argumento de pow() no puede ser 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argumentos requiere enteros" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "presionando botón de arranque al inicio.\n" @@ -4224,14 +3909,6 @@ msgstr "presione el botón izquierdo al arranque\n" msgid "pull masks conflict with direction masks" msgstr "máscara de pull en conflicto con máscara de dirección" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "pull_threshold debe esta entre 1 y 32" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "push_threshold debe esta entre 1 y 32" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "desbordamiento de cola(queue)" @@ -4283,14 +3960,6 @@ msgstr "Argumento enrolado tiene que ser un ndarray" msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"sample_source buffer debe ser un bytearray o un array de tipo 'h', 'H', 'b' " -"o'B'" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4388,10 +4057,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "índices inicio/final" @@ -4404,10 +4069,6 @@ msgstr "start_x deberia ser un int" msgid "step must be non-zero" msgstr "paso debe ser numero no cero" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop debe ser 1 ó 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop no se puede alcanzar del principio" @@ -4456,10 +4117,6 @@ msgstr "error de sintaxis en el descriptor uctypes" msgid "threshold must be in the range 0-65536" msgstr "limite debe ser en el rango 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "tile debe sera mas grande que cero" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" @@ -4480,10 +4137,6 @@ msgstr "el tiempo de espera debe ser 0.0-100.0 segundos" msgid "timeout must be < 655.35 secs" msgstr "timeout debe ser < 655.35 segundos" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "tiempo muerto debe ser >= 0.0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "tiempo de espera agotado esperando por tarjeta v1" @@ -4492,6 +4145,10 @@ msgstr "tiempo de espera agotado esperando por tarjeta v1" msgid "timeout waiting for v2 card" msgstr "tiempo de espera agotado esperando a tarjeta v2" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp fuera de rango para plataform time_t" @@ -4662,6 +4319,14 @@ msgstr "tipo de operador no soportado" msgid "unsupported types for %q: '%q', '%q'" msgstr "tipos no soportados para %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4683,13 +4348,7 @@ msgstr "watchdog no inicializado" msgid "watchdog timeout must be greater than 0" msgstr "el tiempo de espera del perro guardián debe ser mayor a 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "ancho debe estar entre 2 y 8 (inclusivamente), no %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "el ancho debe ser mayor que cero" @@ -4709,7 +4368,17 @@ msgstr "indice de eje erróneo" msgid "wrong axis specified" msgstr "eje especificado erróneo" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "tipo de índice incorrecto" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "tipo de entrada incorrecta" @@ -4717,6 +4386,10 @@ msgstr "tipo de entrada incorrecta" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "numero erroneo de argumentos" @@ -4761,6 +4434,361 @@ 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 "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "sample_source buffer debe ser un bytearray o un array de tipo 'h', 'H', " +#~ "'b' o'B'" + +#~ msgid "Expected an alarm" +#~ msgstr "Un objecto alarm era esperado" + +#~ msgid "Failed to init wifi" +#~ msgstr "Fallo al inicializar wifi" + +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "Entrada tiene que ser un tensor de rango 2" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "Máximo número de dimensiones es 4" + +#~ msgid "Watchdog timer expired." +#~ msgstr "Temporizador de perro guardián expirado." + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q debe ser una tupla de longitud 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q debe estar entre %d y %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q debe ser un int" + +#~ msgid "Address type out of range" +#~ msgstr "Tipo de dirección fuera de rango" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "El pin proporcionado no soporta AnalogIn" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Funcionalidad AnalogOut no soportada" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut es solo de 16 bits. El valor debe ser menor que 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "El pin proporcionado no soporta AnalogOut" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bit depth tiene que ser de 1 a 6 inclusivo, no %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Tamaño de buffer incorrecto. Debe ser de %d bytes." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Buffer debe ser de longitud 1 como minimo" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes debe estar entre 0 y 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "No se puede tener ambos canales en el mismo pin" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "No se puede leer sin pin MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "No se puede reiniciar a bootloader porque no hay bootloader presente." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "No se puede transmitir sin pines MOSI y MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "No se puede escribir sin pin MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Iniciado de pin de reloj fallido." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Command debe ser un int entre 0 y 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "No se puede inicializar Camera" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "No se pudo inicializar el GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "No se pudo inicializar SDCard" + +#~ msgid "Could not initialize UART" +#~ msgstr "No se puede inicializar la UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "No se pudo reiniciar el canal" + +#~ msgid "Could not re-init timer" +#~ msgstr "No se pudo reiniciar el temporizador" + +#~ msgid "Could not restart PWM" +#~ msgstr "No se pudo reiniciar el PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "No se pudo asignar el primer buffer" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "No se pudo encontrar el buffer de entrada" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "No se pudo asignar el segundo buffer" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut no es compatible con un pin dado" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Se esperaba un tuple de %d, se obtuvo %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Ha fallado la asignación del buffer RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Falló la asignación del buffer RX de %d bytes" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Framebuffer requiere %d bytes" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Hostname debe ser entre 1 y 253 caracteres" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C Error de inicio" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "selección inválida de pin %q" + +#~ msgid "Invalid AuthMode" +#~ msgstr "AuthMode invalido" + +#~ msgid "Invalid BMP file" +#~ msgstr "Archivo BMP inválido" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Pin suministrado inválido para DAC" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Archivo MIDI inválido" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Frecuencia PWM inválida" + +#~ msgid "Invalid Pin" +#~ msgstr "Pin inválido" + +#~ msgid "Invalid buffer size" +#~ msgstr "Tamaño de buffer inválido" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Cadena de byteorder inválida" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Inválido periodo de captura. Rango válido: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Cuenta de canales inválida" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "data_count inválido %d" + +#~ msgid "Invalid direction." +#~ msgstr "Dirección inválida." + +#~ msgid "Invalid file" +#~ msgstr "Archivo inválido" + +#~ msgid "Invalid number of bits" +#~ msgstr "Numero inválido de bits" + +#~ msgid "Invalid phase" +#~ msgstr "Fase inválida" + +#~ msgid "Invalid pin" +#~ msgstr "Pin inválido" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Pin inválido para canal izquierdo" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Pin inválido para canal derecho" + +#~ msgid "Invalid polarity" +#~ msgstr "Polaridad inválida" + +#~ msgid "Invalid properties" +#~ msgstr "Propiedades inválidas" + +#~ msgid "Invalid run mode." +#~ msgstr "Modo de ejecución inválido." + +#~ msgid "Invalid security_mode" +#~ msgstr "'security_mode' no válido" + +#~ msgid "Invalid voice" +#~ msgstr "Voz inválida" + +#~ msgid "Invalid voice count" +#~ msgstr "Cuenta de voces inválida" + +#~ msgid "Invalid wave file" +#~ msgstr "Archivo wave inválido" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Tamaño no válido de palabra/bit" + +#~ msgid "Layer already in a group." +#~ msgstr "La capa ya pertenece a un grupo." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer debe ser una subclase de Group o TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "MISO pin init fallido." + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSI pin init fallido." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Mensajes limitados a 8 bytes" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Sin soporte de hardware en el pin clk" + +#~ msgid "No hardware support on pin" +#~ msgstr "Sin soporte de hardware en pin" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "buffer de salida debe ser de por lo menos %d bytes" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "PWM duty_cycle debe ser entre 0 y 65535 inclusivo (16 bit resolution)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "El total de pines debe ser por lo menos 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin no tiene capacidad ADC" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "El programa debe contener por lo menos una instrucción de 16 bits." + +#~ msgid "Program too large" +#~ msgstr "Programa demasiado grande" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 no esta soportado todavía en este dispositivo" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "Calibración de RTC no es soportada en esta placa" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "Sin capacidad de RTS/CTS/RS485 para este dispositivo" + +#~ msgid "SPI Init Error" +#~ msgstr "Error de inicio de SPI" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "Error de reinicialización de SPI" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Sample rate debe ser positivo" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Frecuencia de muestreo demasiado alta. Debe ser menor a %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "La suma de pines configurados debe estar entre 1 y 5" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "El conteo de pines de Side set debe estar entre 1 y 5" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "El tamaño de la pila debe ser de al menos 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Valor de mosaico fuera de límites" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "No se pudo encontrar el búfer para UART" + +#~ msgid "UART De-init error" +#~ msgstr "Error de desinicialización de UART" + +#~ msgid "UART Init Error" +#~ msgstr "Error de inicialización de UART" + +#~ msgid "UART Re-init error" +#~ msgstr "Error de reinicialización de UART" + +#~ msgid "UART write error" +#~ msgstr "Error de escritura UART" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Baudrate no soportado" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "La clave de WiFi debe ser entre 8 y 63 caracteres" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "los bits deben estar en el rango de 5 a 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "bytes > 8 bits no soportados" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "Valor de calibración fuera del rango +/-127" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "circulo solo puede ser registrado con un pariente" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length debe ser >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "el polígono solo se puede registrar en uno de los padres" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "pull_threshold debe esta entre 1 y 32" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "push_threshold debe esta entre 1 y 32" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop debe ser 1 ó 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "tile debe sera mas grande que cero" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "tiempo muerto debe ser >= 0.0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "ancho debe estar entre 2 y 8 (inclusivamente), no %d" + +#~ msgid "Unsupported operation" +#~ msgstr "Operación no soportada" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" @@ -5283,9 +5311,6 @@ msgstr "zi debe ser una forma (n_section,2)" #~ msgid "wrong argument type" #~ msgstr "tipo de argumento incorrecto" -#~ msgid "wrong index type" -#~ msgstr "tipo de índice incorrecto" - #~ msgid "specify size or data, but not both" #~ msgstr "especifique o tamaño o datos, pero no ambos" diff --git a/locale/fil.po b/locale/fil.po index 193bc0c88e..63f5990a0a 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -67,10 +67,27 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -83,12 +100,7 @@ msgstr "" msgid "%q in use" msgstr "%q ay ginagamit" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indeks wala sa sakop" @@ -96,18 +108,42 @@ msgstr "%q indeks wala sa sakop" msgid "%q indices must be integers, not %s" msgstr "%q indeks ay dapat integers, hindi %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -116,30 +152,26 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c #, fuzzy msgid "%q must be >= 1" msgstr "aarehas na haba dapat ang buffer slices" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -158,7 +190,11 @@ msgstr "" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -167,11 +203,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/fontio/BuiltinFont.c -#, fuzzy -msgid "%q should be an int" -msgstr "y ay dapat int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -185,7 +216,11 @@ msgstr "" msgid "%q, %q, and %q must all be the same length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -335,10 +370,6 @@ msgstr "" msgid "'yield' outside function" msgstr "'yield' sa labas ng function" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x ay dapat na assignment target" @@ -374,16 +405,12 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "ang palette ay dapat 32 bytes ang haba" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" @@ -421,7 +448,6 @@ msgstr "" msgid "All event channels in use" msgstr "Lahat ng event channels ginagamit" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -469,25 +495,6 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Hindi supportado ang AnalogOut" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut ay 16 bits. Value ay dapat hindi hihigit pa sa 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "Hindi supportado ang AnalogOut sa ibinigay na pin" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -526,7 +533,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "" @@ -559,11 +566,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "Ang bit clock at word select dapat makibahagi sa isang clock unit" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit depth ay dapat multiple ng 8." @@ -605,11 +607,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Mali ang size ng buffer. Dapat %d bytes." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -619,7 +616,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -630,14 +626,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Buffer dapat ay hindi baba sa 1 na haba" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -660,10 +652,6 @@ msgstr "Ginagamit na ang DAC" msgid "Byte buffer must be 16 bytes." msgstr "buffer ay dapat bytes-like object" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Sa gitna ng 0 o 255 dapat ang bytes." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "" @@ -672,7 +660,7 @@ msgstr "" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -680,6 +668,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -728,18 +720,10 @@ msgstr "Hindi makuha ang temperatura. status 0x%02x" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Hindi maaaring output ang mga parehong channel sa parehong pin" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Hindi maaring mabasa kapag walang MISO pin." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Hindi ma-record sa isang file" @@ -751,8 +735,8 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Hindi ma-reset sa bootloader dahil walang bootloader." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -772,21 +756,20 @@ msgid "Cannot subclass slice" msgstr "Hindi magawa ang sublcass slice" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Hindi maaaring ilipat kapag walang MOSI at MISO pin." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Hindi maaring isulat kapag walang MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -800,10 +783,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Nabigo sa pag init ng Clock pin." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Masyadong mahaba ang Clock stretch" @@ -812,12 +791,6 @@ msgstr "Masyadong mahaba ang Clock stretch" msgid "Clock unit in use" msgstr "Clock unit ginagamit" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -#, fuzzy -msgid "Command must be an int between 0 and 255" -msgstr "Sa gitna ng 0 o 255 dapat ang bytes." - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -828,35 +801,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Hindi ma-initialize ang UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -877,20 +821,6 @@ msgstr "" msgid "Couldn't allocate decoder" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Hindi ma-iallocate ang first buffer" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Hindi ma-iallocate ang second buffer" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -941,10 +871,6 @@ msgstr "" msgid "Device in use" msgstr "" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -956,6 +882,10 @@ msgstr "" msgid "Display rotation must be in 90 degree increments" msgstr "" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." @@ -991,18 +921,14 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Umasa ng %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" +msgid "Expected an %q" msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c @@ -1031,21 +957,9 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Nabigo sa pag kuha ng mutex, status: 0x%08lX" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Nabigong ilaan ang RX buffer" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Nabigong ilaan ang RX buffer ng %d bytes" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1068,10 +982,6 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -1115,9 +1025,9 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" #: shared-bindings/pwmio/PWMOut.c @@ -1129,7 +1039,11 @@ msgstr "" msgid "Function requires lock" msgstr "Function nangangailangan ng lock" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1156,19 +1070,16 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O operasyon sa saradong file" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1275,75 +1186,37 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Mali ang %q pin" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Mali ang BMP file" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Mali ang PWM frequency" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Maling argumento" @@ -1351,42 +1224,11 @@ msgstr "Maling argumento" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Mali ang buffer size" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Maling bilang ng channel" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Mali ang direksyon." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Mali ang file" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Mali ang format ng chunk size" @@ -1395,79 +1237,15 @@ msgstr "Mali ang format ng chunk size" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Mali ang bilang ng bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Mali ang phase" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Mali ang pin" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Mali ang pin para sa kaliwang channel" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Mali ang pin para sa kanang channel" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Mali ang pins" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Mali ang polarity" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Mali ang run mode." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1475,27 +1253,10 @@ msgstr "" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Maling bilang ng voice" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "May hindi tama sa wave file" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1509,25 +1270,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS ng keyword arg ay dapat na id" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "Hindi ma-initialize ang MISO pin." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Hindi ma-initialize ang MOSI pin." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1537,18 +1290,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Ang delay ng startup ng mikropono ay dapat na nasa 0.0 hanggang 1.0" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1584,11 +1346,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1614,6 +1371,10 @@ msgstr "" msgid "Name too long" msgstr "" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1644,16 +1405,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" -#: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c -msgid "No MISO Pin" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1692,16 +1465,6 @@ msgstr "Walang libreng GCLKs" msgid "No hardware random available" msgstr "Walang magagamit na hardware random" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Walang support sa hardware ang pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1746,6 +1509,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Walang file/directory" @@ -1798,6 +1565,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Odd na parity ay hindi supportado" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1807,7 +1582,7 @@ msgstr "Tanging 8 o 16 na bit mono na may " msgid "Only IPv4 addresses supported" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1840,15 +1615,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1856,19 +1635,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1876,11 +1659,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample ay dapat multiple ng 8." @@ -1889,17 +1667,16 @@ msgstr "Oversample ay dapat multiple ng 8." msgid "PDMIn not available" msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "PWM duty_cycle ay dapat sa loob ng 0 at 65535 (16 bit resolution)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "" "PWM frequency hindi writable kapag variable_frequency ay False sa pag buo." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1916,29 +1693,14 @@ msgstr "" msgid "Permission denied" msgstr "Walang pahintulot" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Ang pin ay walang kakayahan sa ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2005,18 +1767,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull hindi ginagamit kapag ang direksyon ay output." @@ -2038,8 +1792,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2047,21 +1802,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "RTC calibration ay hindi supportado ng board na ito" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "Hindi supportado ang RTC sa board na ito" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "" @@ -2080,10 +1824,14 @@ msgstr "Basahin-lamang mode" msgid "Read-only object" msgstr "Basahin-lamang" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "" @@ -2096,7 +1844,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2112,6 +1860,10 @@ msgstr "Tumatakbo sa safe mode! Hindi tumatakbo ang nai-save na code.\n" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2122,30 +1874,21 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Sample rate ay dapat positibo" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Sample rate ay masyadong mataas. Ito ay dapat hindi hiigit sa %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2165,14 +1908,6 @@ msgstr "Serializer ginagamit" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2208,10 +1943,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Binibiyak gamit ang sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2297,10 +2028,6 @@ msgstr "" msgid "Tile index out of bounds" msgstr "" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "" @@ -2320,6 +2047,9 @@ msgid "To exit, please reset the board without " msgstr "Para lumabas, paki-reset ang board na wala ang " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Sobra ang channels sa sample." @@ -2352,23 +2082,20 @@ msgid "Tuple or struct_time argument required" msgstr "Tuple o struct_time argument kailangan" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2506,12 +2233,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Hindi supportadong baudrate" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2525,9 +2246,9 @@ msgstr "Hindi supportadong tipo ng bitmap" msgid "Unsupported format" msgstr "Hindi supportadong format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Hindi sinusuportahang operasyon" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2547,7 +2268,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2577,10 +2298,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2591,8 +2308,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2633,11 +2350,11 @@ msgstr "__new__ arg ay dapat na user-type" msgid "a bytes-like object is required" msgstr "a bytes-like object ay kailangan" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "wala sa sakop ang address" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "walang laman ang address" @@ -2686,6 +2403,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2747,10 +2468,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample ay dapat 8 o 16" @@ -2789,11 +2506,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "hindi sinusuportahan ang bytes > 8 bits" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2802,7 +2514,7 @@ msgstr "" msgid "bytes value out of range" msgstr "bytes value wala sa sakop" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "kalibrasion ay wala sa sakop" @@ -2810,12 +2522,9 @@ msgstr "kalibrasion ay wala sa sakop" msgid "calibration is read only" msgstr "pagkakalibrate ay basahin lamang" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "ang halaga ng pagkakalibrate ay wala sa sakop +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2839,7 +2548,7 @@ msgstr "hindi ma i-assign sa expression" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -2992,6 +2701,10 @@ msgstr "" msgid "casting" msgstr "casting" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "masyadong maliit ang buffer" @@ -3004,10 +2717,6 @@ msgstr "chr() arg wala sa sakop ng range(0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg wala sa sakop ng range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3072,6 +2781,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3159,10 +2872,6 @@ msgstr "" msgid "division by zero" msgstr "dibisyon ng zero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3171,6 +2880,10 @@ msgstr "" msgid "empty" msgstr "walang laman" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "walang laman ang heap" @@ -3201,6 +2914,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "ang mga exceptions ay dapat makuha mula sa BaseException" @@ -3275,7 +2994,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3311,6 +3030,10 @@ msgstr "font ay dapat 2048 bytes ang haba" msgid "format requires a dict" msgstr "kailangan ng format ng dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "puno" @@ -3420,7 +3143,7 @@ msgstr "hindi kumpleto ang format key" msgid "incorrect padding" msgstr "mali ang padding" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3438,6 +3161,10 @@ msgstr "ang mga indeks ay dapat na integer" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3483,6 +3210,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3491,11 +3222,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3575,6 +3302,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "mali ang micropython decorator" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "mali ang step" @@ -3692,10 +3423,6 @@ msgstr "may pagkakamali sa math domain" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3703,12 +3430,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3842,7 +3565,7 @@ msgstr "" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "walang ganoon na attribute" @@ -3953,7 +3676,11 @@ msgstr "object na may buffer protocol kinakailangan" msgid "odd-length string" msgstr "odd-length string" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4079,10 +3806,6 @@ msgstr "pixel_shader ay dapat displayio.Palette o displayio.ColorConverter" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop mula sa walang laman na PulseIn" @@ -4108,63 +3831,23 @@ msgstr "pow() 3rd argument ay hindi maaring 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() na may 3 argumento kailangan ng integers" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4184,14 +3867,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "puno na ang pila (overflow)" @@ -4243,14 +3918,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"ang sample_source buffer ay dapat na isang bytearray o array ng uri na 'h', " -"'H', 'b' o'B'" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4348,10 +4015,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "start/end indeks" @@ -4365,10 +4028,6 @@ msgstr "y ay dapat int" msgid "step must be non-zero" msgstr "step ay dapat hindi zero" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop dapat 1 o 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop hindi maabot sa simula" @@ -4417,10 +4076,6 @@ msgstr "may pagkakamali sa sintaks sa uctypes descriptor" msgid "threshold must be in the range 0-65536" msgstr "ang threshold ay dapat sa range 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" @@ -4440,11 +4095,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#, fuzzy -msgid "timeout must be >= 0.0" -msgstr "bits ay dapat walo (8)" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4453,6 +4103,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "wala sa sakop ng timestamp ang platform time_t" @@ -4623,6 +4277,14 @@ msgstr "hindi sinusuportahang type para sa operator" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4644,13 +4306,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4670,7 +4326,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4678,6 +4344,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "mali ang bilang ng argumento" @@ -4724,6 +4394,167 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "ang sample_source buffer ay dapat na isang bytearray o array ng uri na " +#~ "'h', 'H', 'b' o'B'" + +#, fuzzy +#~ msgid "%q should be an int" +#~ msgstr "y ay dapat int" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Hindi supportado ang AnalogOut" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut ay 16 bits. Value ay dapat hindi hihigit pa sa 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "Hindi supportado ang AnalogOut sa ibinigay na pin" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Mali ang size ng buffer. Dapat %d bytes." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Buffer dapat ay hindi baba sa 1 na haba" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Sa gitna ng 0 o 255 dapat ang bytes." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Hindi maaaring output ang mga parehong channel sa parehong pin" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Hindi maaring mabasa kapag walang MISO pin." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Hindi ma-reset sa bootloader dahil walang bootloader." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Hindi maaaring ilipat kapag walang MOSI at MISO pin." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Hindi maaring isulat kapag walang MOSI pin." + +#~ msgid "Clock pin init failed." +#~ msgstr "Nabigo sa pag init ng Clock pin." + +#, fuzzy +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Sa gitna ng 0 o 255 dapat ang bytes." + +#~ msgid "Could not initialize UART" +#~ msgstr "Hindi ma-initialize ang UART" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Hindi ma-iallocate ang first buffer" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Hindi ma-iallocate ang second buffer" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Nabigong ilaan ang RX buffer" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Nabigong ilaan ang RX buffer ng %d bytes" + +#~ msgid "Invalid BMP file" +#~ msgstr "Mali ang BMP file" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Mali ang PWM frequency" + +#~ msgid "Invalid buffer size" +#~ msgstr "Mali ang buffer size" + +#~ msgid "Invalid channel count" +#~ msgstr "Maling bilang ng channel" + +#~ msgid "Invalid direction." +#~ msgstr "Mali ang direksyon." + +#~ msgid "Invalid file" +#~ msgstr "Mali ang file" + +#~ msgid "Invalid number of bits" +#~ msgstr "Mali ang bilang ng bits" + +#~ msgid "Invalid phase" +#~ msgstr "Mali ang phase" + +#~ msgid "Invalid pin" +#~ msgstr "Mali ang pin" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Mali ang pin para sa kaliwang channel" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Mali ang pin para sa kanang channel" + +#~ msgid "Invalid polarity" +#~ msgstr "Mali ang polarity" + +#~ msgid "Invalid run mode." +#~ msgstr "Mali ang run mode." + +#~ msgid "Invalid voice count" +#~ msgstr "Maling bilang ng voice" + +#~ msgid "Invalid wave file" +#~ msgstr "May hindi tama sa wave file" + +#~ msgid "MISO pin init failed." +#~ msgstr "Hindi ma-initialize ang MISO pin." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Hindi ma-initialize ang MOSI pin." + +#~ msgid "No hardware support on pin" +#~ msgstr "Walang support sa hardware ang pin" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "PWM duty_cycle ay dapat sa loob ng 0 at 65535 (16 bit resolution)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Ang pin ay walang kakayahan sa ADC" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "RTC calibration ay hindi supportado ng board na ito" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Sample rate ay dapat positibo" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Sample rate ay masyadong mataas. Ito ay dapat hindi hiigit sa %d" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Hindi supportadong baudrate" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "hindi sinusuportahan ang bytes > 8 bits" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "ang halaga ng pagkakalibrate ay wala sa sakop +/-127" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop dapat 1 o 2" + +#, fuzzy +#~ msgid "timeout must be >= 0.0" +#~ msgstr "bits ay dapat walo (8)" + +#~ msgid "Unsupported operation" +#~ msgstr "Hindi sinusuportahang operasyon" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Ang liwanag ay dapat sa gitna ng 0 o 255" diff --git a/locale/fr.po b/locale/fr.po index 05ec1209de..9c7ce445ae 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-12-13 05:53+0000\n" -"Last-Translator: Jeff Epler \n" +"PO-Revision-Date: 2022-08-29 18:20+0000\n" +"Last-Translator: Maxime Leroy \n" "Language: fr\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.10-dev\n" +"X-Generator: Weblate 4.14.1-dev\n" #: main.c msgid "" @@ -30,6 +30,9 @@ msgid "" "\n" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +"\n" +"Le code a été arrêté par l'actualisation automatique. Rechargement " +"prochain.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -75,10 +78,27 @@ msgstr "" "%d broches d'adresse, %d broches RGB et %d pour tile indique une hauteur de " "%d, et non %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "%q" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q et %q contiennent des broches en double" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "%q et %q doivent être différents" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q contient des broches en double" @@ -91,12 +111,7 @@ msgstr "Échec de %q : %d" msgid "%q in use" msgstr "%q en cours d'utilisation" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "index %q hors de portée" @@ -104,18 +119,42 @@ msgstr "index %q hors de portée" msgid "%q indices must be integers, not %s" msgstr "les indices %q doivent être des entiers, pas %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "échec de l'initialisation %q" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "La longeur de %q doit être %d" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "La longueur de %q doit être %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "La longeur de %q doit être <= %d" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "La longeur de %q doit être >= %d" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "La longueur de %q doit être >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "%q doit être %d" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q doit être %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "%q doit être 1 quand %q est True" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q doit être <= %d" @@ -124,30 +163,26 @@ msgstr "%q doit être <= %d" msgid "%q must be >= %d" msgstr "%q doit être >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q doit être >= 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q doit être >= 1" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "%q doit être une chaîne de caractères" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q doit être un tuple de longueur 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q doit être entre %d et %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "%q doit être un entier" #: py/argcheck.c msgid "%q must be of type %q" @@ -155,7 +190,7 @@ msgstr "%q doit être du type %q" #: shared-bindings/digitalio/Pull.c msgid "%q must be of type %q or None" -msgstr "" +msgstr "%q doit être du type %q ou None" #: ports/atmel-samd/common-hal/busio/UART.c msgid "%q must be power of 2" @@ -165,7 +200,11 @@ msgstr "%q doit être une puissance de 2" msgid "%q out of bounds" msgstr "%q est hors limites" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q est hors de porté" @@ -174,10 +213,6 @@ msgstr "%q est hors de porté" msgid "%q pin invalid" msgstr "broche %q invalide" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q doit être un chiffre entier (int)" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q avec un identifiant de rapport à 0 doit être de longueur 1" @@ -190,7 +225,11 @@ msgstr "%q() prend %d paramètres positionnels mais %d ont été donnés" msgid "%q, %q, and %q must all be the same length" msgstr "%q, %q, et %q doivent tous être de la même longueur" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "%q=%q" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s erreur 0x%x" @@ -340,10 +379,6 @@ msgstr "'yield from' dans une fonction async" msgid "'yield' outside function" msgstr "'yield' dehors d'une fonction" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "Des entiers (x,y) requis" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x doit être la cible de l'assignement" @@ -379,16 +414,12 @@ msgstr "ADC2 est utilisé pars le Wifi" msgid "Address must be %d bytes long" msgstr "L'adresse doit être longue de %d octets" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Type d'adresse hors portée" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Tous les périphériques CAN sont utilisés" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tous les périphériques I2C sont utilisés" @@ -425,7 +456,6 @@ msgstr "Tout les canaux sont utilisés" msgid "All event channels in use" msgstr "Tous les canaux d'événements sont utilisés" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "Tous les automates finis sont utilisés" @@ -473,27 +503,6 @@ msgstr "Déjà en cours d'exécution" msgid "Already scanning for wifi networks" msgstr "Déjà à la recherche des réseaux wifi" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Fonctionnalité AnalogOut non supportée" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" -"AnalogOut est seulement 16 bits. Les valeurs doivent être inférieures à " -"65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Un autre PWMAudioOut est déjà actif" @@ -534,7 +543,7 @@ msgstr "La conversion audio n'est pas implémentée" msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN n'est pas utilisé avec un mot de passe" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Échec d'authentification" @@ -561,17 +570,14 @@ msgstr "Au-dessous de la fréquence d'images minimale" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must be sequential pins" -msgstr "Bit clock et word select doivent êtres sur des broches séquentielles" +msgstr "" +"La sélection du bit d'horloge et de mot doit être sur des broches " +"séquentielles" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Bit clock and word select must share a clock unit" msgstr "'bit clock' et 'word select' doivent partager une horloge" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bit depth doit être entre 1 et 6 inclusivement, et non %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "La profondeur de bit doit être un multiple de 8." @@ -611,12 +617,7 @@ msgstr "Tampon + décalage trop petit %d %d %d" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Buffer elements must be 4 bytes long or less" -msgstr "Éléments du tampon doit être 4 octets ou moins" - -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Tampon de taille incorrect. Devrait être de %d octets." +msgstr "Les éléments du tampon doivent faire 4 octets ou moins" #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." @@ -627,7 +628,6 @@ msgstr "Le tampon n'est pas un 'bytearray'." msgid "Buffer is too small" msgstr "Le tampon est trop petit" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -638,14 +638,10 @@ msgstr "La longueur du tampon %d est trop grande. Il doit être inférieur à %d msgid "Buffer length must be a multiple of 512" msgstr "La longueur de la mémoire tampon doit être un multiple de 512" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "La mémoire tampon doit être un multiple de 512" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Le tampon doit être de longueur au moins 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -667,19 +663,15 @@ msgstr "La broche %d du bus est déjà utilisée" msgid "Byte buffer must be 16 bytes." msgstr "Le tampon doit être de 16 octets." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Les octets 'bytes' doivent être entre 0 et 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Les blocs CBC doivent être des multiples de 16 octets" #: supervisor/shared/safe_mode.c msgid "CIRCUITPY drive could not be found or created." -msgstr "" +msgstr "L’appareil CIRCUITPY ne peut pas être trouvé ou créé." -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC ou somme de contrôle invalide" @@ -687,20 +679,24 @@ msgstr "CRC ou somme de contrôle invalide" msgid "Call super().__init__() before accessing native object." msgstr "Appelez super().__init__() avant d'accéder à l'objet natif." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "Initialisation de la caméra" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." -msgstr "L'alarme peut seulement être depuis TRC IO depuis le someil profond." +msgstr "L'alarme ne peut être que sur TRC IO depuis un sommeil profond." #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" "L'alarme peut seulement être sur une broche basse tandis que d'autres " -"alarment sont sur des broches hautes depuis le someil profond." +"alarment sont sur des broches hautes depuis le sommeil profond." #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" -"L'alarme peut seulement être sur deux broches basses depuis le someil " +"L'alarme peut seulement être sur deux broches basses depuis le sommeil " "profond." #: ports/espressif/common-hal/_bleio/Characteristic.c @@ -741,18 +737,10 @@ msgstr "" "Impossible d'avoir des réponses d'analyse pour les publicités étendues et " "connectables." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Les 2 canaux de sortie ne peuvent être sur la même broche" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Ne peut tirer ('pull') sur une broche d'entrée ('input') seule." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Impossible de lire sans broche MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Impossible d'enregistrer vers un fichier" @@ -764,9 +752,9 @@ msgstr "Ne peut démonter '/' quand est visible par USB." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" -"Ne peut être redémarré vers le bootloader car il n'y a pas de bootloader." +"Impossible de redémarrer dans le bootloader puisque aucun n'est présent" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -787,21 +775,23 @@ msgid "Cannot subclass slice" msgstr "On ne peut faire de sous-classes de tranches" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Pas de transfert sans broches MOSI et MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "Impossible de transférer sans une broche MOSI ou MISO" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Impossible de faire varier la fréquence sur un minuteur déjà utilisée" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." -msgstr "Ne peut reveillé sur le board de broche. Seuleument à niveau." +msgid "Cannot wake on pin edge, only level" +msgstr "" +"Impossible de réveiller via une bordure d'une broche, seulement via un niveau" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Impossible d'écrire sans broche MOSI." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" +"Impossible de réveiller via une bordure d'une broche. Seulement via un " +"niveau." #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -809,16 +799,12 @@ msgstr "Ecriture sur 'CharacteristicBuffer' non fournie" #: supervisor/shared/safe_mode.c msgid "CircuitPython core code crashed hard. Whoops!\n" -msgstr "Le code principal de CircuitPython s'est écrasé durement. Oups !\n" +msgstr "Le code principal de CircuitPython s'est complètement planté. Oups !\n" #: supervisor/shared/safe_mode.c msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython n'as pu faire l'allocation de la pile." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Échec de l'initialization de la broche d'horloge." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Période de l'horloge trop longue" @@ -827,11 +813,6 @@ msgstr "Période de l'horloge trop longue" msgid "Clock unit in use" msgstr "Horloge en cours d'utilisation" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "La commande doit être un chiffre entier entre 0 et 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -844,35 +825,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Fichier .mpy corrompu" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Impossible d'initialiser Camera" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Impossible d'initialiser GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Impossible d'initialiser la carte SD" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Impossible d'initialiser UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Impossible de réinitialiser le canal" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Impossible de réinitialiser le minuteur" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Impossible de redémarrer PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Impossible d’obtenir l’horloge" @@ -893,20 +845,6 @@ msgstr "Impossible de démarrer l'interruption, RX occupé" msgid "Couldn't allocate decoder" msgstr "Impossible d'allouer le décodeur" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Impossible d'allouer le premier tampon" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Impossible d'allouer le tampon d'entrée" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Impossible d'allouer le deuxième tampon" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Échec vers le HardFault_Handler." @@ -955,10 +893,6 @@ msgstr "La capacité de destination est plus petite que 'destination_length'." msgid "Device in use" msgstr "Appareil utilisé" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut non pris en charge sur la broche donnée" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -970,6 +904,10 @@ msgstr "L'affichage doit avoir un espace colorimétrique de 16 bits." msgid "Display rotation must be in 90 degree increments" msgstr "La rotation d'affichage doit se faire par incréments de 90 degrés" +#: main.c +msgid "Done" +msgstr "OK" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "" @@ -1006,19 +944,15 @@ msgstr "Erreur : Impossible de lier" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Attendu un %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "Une alarme était prévue" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Tuple de longueur %d attendu, obtenu %d" +msgid "Expected an %q" +msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1047,21 +981,9 @@ msgstr "Échec de l'envoi de la commande." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Echec de l'obtention de mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Echec de l'allocation du tampon RX" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Echec de l'allocation de %d octets du tampon RX" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "Échec d'allocation du tampon %q" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1084,10 +1006,6 @@ msgstr "Impossible de se connecter : erreur interne" msgid "Failed to connect: timeout" msgstr "Impossible de se connecter: délai dépassé" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "Echec de l'initialisation du Wifi" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Impossible d'analyser le fichier MP3" @@ -1127,16 +1045,18 @@ msgstr "" #: shared-bindings/bitmaptools/__init__.c msgid "For RGB colorspaces, input bitmap must have 16 bits per pixel" msgstr "" -"Avec l'espace de couleur RGB, l'image d'entrée doit avoir 16 bits par pixel" +"Avec l'espace de couleur RVB, l'image d'entrée doit avoir 16 bits par pixel" #: ports/cxd56/common-hal/camera/Camera.c msgid "Format not supported" msgstr "Format non supporté" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "FrameBuffer nécessite %d octets" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" +"La fréquence doit être 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 ou " +"1008 MHz" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1149,7 +1069,11 @@ msgstr "" msgid "Function requires lock" msgstr "La fonction nécessite un verrou ('lock')" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "Initialisation GNSS" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Échec génerique" @@ -1163,8 +1087,9 @@ msgstr "Groupe déjà utilisé" #: ports/espressif/common-hal/busio/SPI.c #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c #: ports/raspberrypi/common-hal/busio/SPI.c +#, fuzzy msgid "Half duplex SPI is not implemented" -msgstr "" +msgstr "Le half duplex du SPI n'est pas implémenté" #: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/I2C.c #: ports/stm/common-hal/busio/SPI.c ports/stm/common-hal/canio/CAN.c @@ -1176,19 +1101,16 @@ msgstr "Matériel occupé, essayez d'autres broches" msgid "Hardware in use, try alternative pins" msgstr "Matériel utilisé, essayez d'autres broches" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "Hostname doit être entre 1 et 253 caractères" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Opération d'E/S sur un fichier fermé" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "Erreur d'initialisation I2C" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "périphérique I2C utilisé" @@ -1304,75 +1226,38 @@ msgstr "Erreur interne" msgid "Internal error #%d" msgstr "Erreur interne #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +#, fuzzy +msgid "Internal watchdog timer expired." +msgstr "Le minuteur du watchdog interne a expiré." + +#: py/argcheck.c msgid "Invalid %q" msgstr "%q invalide" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Broche invalide pour '%q'" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Sélection de broche %q invalide" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Valeur d'unité ADC non valide" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "AuthMode invalide" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Paramètre BLE invalide" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Fichier BMP invalide" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "BSSID invalide" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Broche DAC non valide fournie" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "Adresse MAC invalide" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Fichier MIDI invalide" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Fréquence de PWM invalide" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Broche invalide" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Paramètre invalide" @@ -1380,42 +1265,11 @@ msgstr "Paramètre invalide" msgid "Invalid bits per value" msgstr "Bits par valeur invalides" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Longueur de tampon invalide" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Chaîne byteorder non valide" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Période de capture invalide. Portée valide : 1 à 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Nombre de canaux invalide" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "data_count invalide %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "data_pins[%d] invalide" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Direction invalide." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Fichier invalide" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Taille de bloc de formatage invalide" @@ -1424,79 +1278,15 @@ msgstr "Taille de bloc de formatage invalide" msgid "Invalid memory access." msgstr "Accès à la mémoire invalide." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "Adresse MAC multicast invalide" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Nombre de bits invalide" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Phase invalide" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Broche invalide" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Broche invalide pour le canal gauche" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Broche invalide pour le canal droit" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Broches invalides" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Polarité invalide" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Propriétés invalides" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Mode de lancement invalide." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "'security_mode' invalide" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Taille invalide" @@ -1504,27 +1294,10 @@ msgstr "Taille invalide" msgid "Invalid socket for TLS" msgstr "Socket non valide pour TLS" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "État invalide" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Voix invalide" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Nombre de voix invalide" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Fichier WAVE invalide" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Longueur de mot / bit invalide" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "La clé doit comporter 16, 24 ou 32 octets" @@ -1538,46 +1311,48 @@ msgid "LHS of keyword arg must be an id" msgstr "La partie gauche de l'argument nommé doit être un identifiant" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Couche déjà dans un groupe." +msgid "Layer already in a group" +msgstr "Ce calque est déjà dans un groupe" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "'Layer' doit être un 'Group' ou une sous-classe 'TileGrid'." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "Le calque doit être une sous-classe de Group ou TileGrid" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "Adresse physique (MAC) invalide" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "Échec de l'initialization de la broche MISO." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Échec de l'initialization de la broche MOSI." - #: shared-bindings/is31fl3741/IS31FL3741.c +#, fuzzy msgid "Mapping must be a tuple" -msgstr "" +msgstr "Le mapping doit être un tuple" #: shared-module/displayio/Shape.c #, c-format msgid "Maximum x value when mirrored is %d" msgstr "La valeur maximale de x est %d lors d'une opération miroir" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Messages limités à 8 octets" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Le délais au démarrage du micro doit être entre 0.0 et 1.0" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "La taille des données ne correspond pas" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "Le drapeau d'échange ne correspond pas" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Broche MISO ou MOSI manquante" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "La broche MISO ou MOSI est manquante" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1615,11 +1390,6 @@ msgstr "first_set_pin manquant. L'instruction %d règle la/les broche(s)" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "jmp_pin manquant. L'instruction %d va passer à la broche" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "Plus de %d identifiants de rapport ne sont pas supportés" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Doit être une sous-classe de %q." @@ -1645,9 +1415,14 @@ msgstr "Erreur NVS" msgid "Name too long" msgstr "Nom trop long" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "La taille du nouveau bitmap doit être la même que l'ancien" + #: ports/espressif/common-hal/_bleio/__init__.c +#, fuzzy msgid "Nimble out of memory" -msgstr "" +msgstr "Nimble n'a plus de mémoire" #: ports/espressif/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Characteristic.c @@ -1673,18 +1448,30 @@ msgstr "Aucun minuteur de rythme DMA trouvé" #: shared-module/adafruit_bus_device/i2c_device/I2CDevice.c #, c-format msgid "No I2C device at address: 0x%x" -msgstr "" +msgstr "Aucun périphérique I2S à l'adresse : 0x%x" + +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "Aucune IP" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Pas de broche MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "Aucune broche MISO" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Pas de broche MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "Aucune broche MOSI" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1723,16 +1510,6 @@ msgstr "Pas de GCLK libre" msgid "No hardware random available" msgstr "Aucunes source de valeurs aléatoire matérielle disponible" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Pas de support matériel sur la broche clk" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Pas de support matériel pour cette broche" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "Programme n'a pas de \"in\"" @@ -1767,7 +1544,7 @@ msgstr "Aucun out dans le programme" #: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c #: ports/raspberrypi/common-hal/busio/I2C.c msgid "No pull up found on SDA or SCL; check your wiring" -msgstr "Aucun pull up trouvé sur SDA ou SCL; vérifiez votre cablage" +msgstr "Aucun pull up trouvé sur SDA ou SCL; vérifiez votre câblage" #: shared-module/touchio/TouchIn.c msgid "No pulldown on pin; 1Mohm recommended" @@ -1777,6 +1554,10 @@ msgstr "Pas de pulldown sur la broche ; 1Mohm recommandé" msgid "No space left on device" msgstr "Aucun espace libre sur le dispositif" +#: py/moduerrno.c +msgid "No such device" +msgstr "Aucun périphérique correspondant" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Fichier/répertoire introuvable" @@ -1821,13 +1602,21 @@ msgstr "Le nombre de data_pins doit être 8 ou 16, et non %d" msgid "" "Object has been deinitialized and can no longer be used. Create a new object." msgstr "" -"L'objet a été désinitialisé et ne peut plus être utilisé. Créez un nouvel " +"L'objet a été dés-initialisé et ne peut plus être utilisé. Créez un nouvel " "objet." #: ports/nrf/common-hal/busio/UART.c msgid "Odd parity is not supported" msgstr "Parité impaire non supportée" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "Inactif" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "OK" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1837,7 +1626,7 @@ msgstr "Uniquement 8 ou 16 bit mono avec " msgid "Only IPv4 addresses supported" msgstr "Seulement les adresses IPv4 sont supportées" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "Seulement les sockets IPv4 sont supportés" @@ -1872,17 +1661,21 @@ msgstr "" #: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." -msgstr "Seulement une TouchAlarm peu être réglée en someil profond." +msgstr "Seulement une TouchAlarm peu être réglée en sommeil profond." -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "Seulement une adresse est autorisée" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "Seule une alarme alarm.time peut être définie" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Seulement une alarme alarm.time peut être réglée." @@ -1890,19 +1683,23 @@ msgstr "Seulement une alarme alarm.time peut être réglée." msgid "Only one color can be transparent at a time" msgstr "Une seule couleur peut être transparente à la fois" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "Cette opération n'est pas permise" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Opération ou fonction non supportée" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Timeout de l'opération" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Hors de mémoire" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "Plus de sockets" @@ -1910,11 +1707,6 @@ msgstr "Plus de sockets" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Éléments du tampon de sortie doivent être <= à 4 octets" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "Tampon de sortie doit être au moins %d octets" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Le sur-échantillonage doit être un multiple de 8." @@ -1923,13 +1715,6 @@ msgstr "Le sur-échantillonage doit être un multiple de 8." msgid "PDMIn not available" msgstr "PDMIn non disponible" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" -"La valeur de duty_cycle de PWM doit être entre 0 et 65535 inclusivement " -"(résolution de 16 bits)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1937,6 +1722,10 @@ msgstr "" "La fréquence de PWM n'est pas modifiable quand variable_frequency est False " "à la construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "Redémarrage PWM" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "PWM slice déja utilisée" @@ -1953,29 +1742,14 @@ msgstr "Périphérique en utilisation" msgid "Permission denied" msgstr "Permission refusée" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "La broche ne peut être réveillée depuis un sommeil profond" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "Nombre de broches doit être au moins 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Nombre de broches trop élevé" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "La broche 'pin' ne supporte pas les capacitées ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2038,7 +1812,8 @@ msgstr "" #: main.c msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n" msgstr "" -"Feinte de someil profond jusqu'à l'alarme, CTRL-C ou écriture au fichier.\n" +"Feinte un sommeil profond jusqu'à l'alarme, CTRL-C ou l'écriture d'un " +"fichier.\n" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Program does IN without loading ISR" @@ -2048,18 +1823,10 @@ msgstr "Le programme fait des entrées sans charger d'ISR" msgid "Program does OUT without loading OSR" msgstr "Le programme fait des sorties sans charger d'OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "Le programme doit contenir au moins une instruction de 16 bits." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "Taille du programme invalide" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "Programme trop grand" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'." @@ -2071,7 +1838,7 @@ msgstr "Mode RAISE n'est pas implémenté" #: ports/raspberrypi/common-hal/countio/Counter.c msgid "RISE_AND_FALL not available on this chip" -msgstr "" +msgstr "RISE_AND_FALL n'est pas disponible sur cette puce" #: ports/stm/common-hal/os/__init__.c msgid "RNG DeInit Error" @@ -2081,30 +1848,20 @@ msgstr "Erreur de désinitialisation du RNG" msgid "RNG Init Error" msgstr "Erreur d'initialisation du RNG" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 n'est pas encore supporté sur cet appareil" +#: 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 +msgid "RS485" +msgstr "RS485" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "Inversion RS485 spécifiée sans être en mode RS485" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "La calibration du RTC non supportée sur cette carte" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC non supporté sur cette carte" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS / CTS / RS485 Pas encore supporté sur cet appareil" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Erreur de génération de chiffres aléatoires" @@ -2122,10 +1879,14 @@ msgstr "Système de fichier en lecture seule" msgid "Read-only object" msgstr "Objet en lecture seule" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Réponse reçue invalide" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "Reconnexion" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "Rafraîchissement trop tôt" @@ -2138,7 +1899,7 @@ msgstr "RemoteTransmissionRequests limité à 8 octets" msgid "Requested AES mode is unsupported" msgstr "Le mode AES demandé n'est pas supporté" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Resource demandée non trouvée" @@ -2154,6 +1915,10 @@ msgstr "Mode sans-échec ! Le code sauvegardé n'est pas éxecuté.\n" msgid "SD card CSD format not supported" msgstr "Le format de carte SD CSD n'est pas supporté" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "Initialisation SDCard" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2164,30 +1929,21 @@ msgstr "Erreur de SDIO GetCardInfo %d" msgid "SDIO Init Error %d" msgstr "Erreur d'initialisation SDIO %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "Erreur d'initialisation SPI" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "Erreur de réinitialisation SPI" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "La configuration SPI a échoué" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "Erreur d'initialisation SPI" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "Périphérique SPI utilisé" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Le taux d'échantillonage doit être positif" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Taux d'échantillonage trop élevé. Doit être inférieur à %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "Ré-initialisation du SPI" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2207,14 +1963,6 @@ msgstr "Sérialiseur en cours d'utilisation" msgid "Server side context cannot have hostname" msgstr "Un contexte niveau serveur ne peut avoir de hostname" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "Nombre de broches configurées doit être entre 1 et 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "Nombre de broches Side configurées doit être entre 1 et 5" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Taille n'est pas supportée" @@ -2250,10 +1998,6 @@ msgstr "Spécifiez une unique broche parmi data0 ou data_pins" msgid "Splitting with sub-captures" msgstr "Fractionnement avec des sous-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "La pile doit être au moins de 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "Canal stéréo gauche doit être sur le canal PWM A" @@ -2350,10 +2094,6 @@ msgstr "La hauteur de la tuile doit diviser exactement la hauteur de l'image" msgid "Tile index out of bounds" msgstr "Index des tuiles hors limites" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Valeur de tuile hors limites" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "La largeur de la tuile doit diviser exactement la largeur de l'image" @@ -2373,6 +2113,9 @@ msgid "To exit, please reset the board without " msgstr "Pour quitter, SVP redémarrez la carte sans " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "Trop de canaux dans l'échantillon" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Trop de canaux dans l'échantillon." @@ -2405,24 +2148,21 @@ msgid "Tuple or struct_time argument required" msgstr "Paramètre de type tuple ou struct_time requis" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "Erreur d'allocation de tampon UART" +msgid "UART de-init" +msgstr "Dé-initialisation du UART" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "Initialisation UART" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "Erreur de désactivation UART" +msgid "UART re-init" +msgstr "Ré-initialisation du UART" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "Erreur d'initialisation UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "Erreur de réinitialisation UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "Erreur d'écriture UART" +msgid "UART write" +msgstr "Écriture UART" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2486,7 +2226,7 @@ msgstr "Impossible de lire les données de la palette de couleurs" #: ports/espressif/common-hal/mdns/Server.c msgid "Unable to start mDNS query" -msgstr "" +msgstr "Impossible de lancer la requête mDNS" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -2508,12 +2248,12 @@ msgstr "Erreur ESP TLS non gérée %d %d %x %d" #: ports/espressif/common-hal/_bleio/__init__.c #, c-format msgid "Unknown BLE error at %s:%d: %d" -msgstr "" +msgstr "Erreur BLE inconnue à %s:%d : %d" #: ports/espressif/common-hal/_bleio/__init__.c #, c-format msgid "Unknown BLE error: %d" -msgstr "" +msgstr "Erreur BLE inconnue : %d" #: shared-bindings/wifi/Radio.c #, c-format @@ -2538,7 +2278,7 @@ msgstr "Erreur de sécurité inconnue : 0x%04x" #: ports/espressif/common-hal/_bleio/__init__.c #, c-format msgid "Unknown system firmware error at %s:%d: %d" -msgstr "" +msgstr "Erreur du firmware système inconnue à %s:%d : %d" #: ports/nrf/common-hal/_bleio/__init__.c #, c-format @@ -2548,7 +2288,7 @@ msgstr "Faute inconnue du logiciel systême : %04x" #: ports/espressif/common-hal/_bleio/__init__.c #, c-format msgid "Unknown system firmware error: %d" -msgstr "" +msgstr "Erreur du firmware système inconnue : %d" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #, c-format @@ -2564,12 +2304,6 @@ msgstr "" "Problème non spécifié. Il se peut que l'invite d'association sur l'autre " "appareil ait été refusée ou ignorée." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Débit en bauds non supporté" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "Espace de couleur non supporté" @@ -2582,9 +2316,9 @@ msgstr "Type de bus d'affichage non supporté" msgid "Unsupported format" msgstr "Format non supporté" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Opération non supportée" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "Algorithme de hachage non supporté" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2604,7 +2338,7 @@ msgstr "Longueur de valeur != Longueur fixe requise" msgid "Value length > max_length" msgstr "Longueur de la valeur > max_length" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "Version est invalide" @@ -2621,7 +2355,7 @@ msgstr "ATTENTION : le nom de fichier de votre code a deux extensions\n" #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET" msgstr "" -"WatchDogTimer ne peut pas être désinitialisé une fois que le mode est réglé " +"WatchDogTimer ne peut pas être dés-initialisé une fois que le mode est réglé " "sur RESET" #: shared-bindings/watchdog/WatchDogTimer.c @@ -2638,10 +2372,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "WatchDogTimer.timeout doit être supérieur à 0" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "Le minuteur Watchdog a expiré." - #: py/builtinhelp.c #, c-format msgid "" @@ -2657,9 +2387,9 @@ msgstr "" "\n" "Pour lister les modules internes, entrez `help(\"modules\")`.\n" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "Le mot de passe WiFi doit faire entre 8 et 63 caractères" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "Wi-Fi : " #: main.c msgid "Woken up by alarm.\n" @@ -2678,8 +2408,8 @@ msgstr "Vous êtres en mode sûr parce que :\n" msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" -"Vous avez pressé le bouton de reset pendant le démarrage. Pressez le à " -"nouveau pour sortir du mode sûr." +"Vous avez pressé le bouton reset pendant le démarrage. Pressez-le à nouveau " +"pour sortir du mode sûr." #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2701,11 +2431,11 @@ msgstr "l'argument __new__ doit être d'un type défini par l'utilisateur" msgid "a bytes-like object is required" msgstr "un objet 'bytes-like' est requis" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "adresse hors limites" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "adresses vides" @@ -2754,6 +2484,10 @@ msgstr "les paramètres doivent être des ndarrays" msgid "array and index length must be equal" msgstr "la taille de la matrice et de l'index doivent être égaux" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "la tableau à trop de dimensions" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2815,10 +2549,6 @@ msgstr "Les tailles des images doivent correspondre" msgid "bits must be 32 or less" msgstr "Les bits doivent être 32 ou moins" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "les bits doivent être compris entre 5 et 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "'bits_per_sample' doivent être 8 ou 16" @@ -2833,7 +2563,7 @@ msgstr "tampon est plus petit que la taille demandée" #: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c msgid "buffer size must be a multiple of element size" -msgstr "taille du tampon doit être un multiple de la taille de l'élement" +msgstr "taille du tampon doit être un multiple de la taille de l’élément" #: shared-module/struct/__init__.c msgid "buffer size must match format" @@ -2856,11 +2586,6 @@ msgstr "tampon trop petit pour le nombre d'octets demandé" msgid "byteorder is not a string" msgstr "byteorder n'est pas une chaîne" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "octets > 8 bits non supporté" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "bytes length n'est pas un multiple de la taille d'un élément" @@ -2869,7 +2594,7 @@ msgstr "bytes length n'est pas un multiple de la taille d'un élément" msgid "bytes value out of range" msgstr "valeur des octets hors bornes" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "étalonnage hors bornes" @@ -2877,21 +2602,18 @@ msgstr "étalonnage hors bornes" msgid "calibration is read only" msgstr "étalonnage en lecture seule" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "valeur de étalonnage hors bornes +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" -msgstr "" +msgid "can only have one parent" +msgstr "ne peut avoir qu'un seul parent" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" -msgstr "il peut y avoir jusqu'à 4 paramètres pour l'assemblage Thumb" +msgstr "il ne peut pas y avoir plus de 4 paramètres pour l'assemblage Thumb" #: py/emitinlinextensa.c msgid "can only have up to 4 parameters to Xtensa assembly" -msgstr "maximum 4 paramètres pour l'assembleur Xtensa" +msgstr "il ne peut pas y avoir plus de 4 paramètres pour l'assemblage Xtensa" #: py/objtype.c msgid "can't add special method to already-subclassed class" @@ -2906,7 +2628,7 @@ msgstr "ne peut pas assigner à une expression" msgid "can't cancel self" msgstr "ne peut pas s'annuler soi-même" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "impossible de convertir %q en %q" @@ -2926,7 +2648,7 @@ msgstr "impossible de convertir l'objet '%q' en '%q' implicitement" #: extmod/ulab/code/numpy/vector.c msgid "can't convert complex to float" -msgstr "" +msgstr "ne peut convertir un complexe en flottant" #: py/obj.c msgid "can't convert to %q" @@ -2982,7 +2704,7 @@ msgstr "impossible de charger avec l'indice '%q'" #: py/builtinimport.c msgid "can't perform relative import" -msgstr "" +msgstr "ne peut importer relativement" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" @@ -3034,11 +2756,11 @@ msgstr "output ne peut être projeté sans règle de projection" #: extmod/ulab/code/ndarray.c msgid "cannot convert complex to dtype" -msgstr "" +msgstr "ne peut convertir un complexe en dtype" #: extmod/ulab/code/ndarray.c msgid "cannot convert complex type" -msgstr "" +msgstr "ne peut convertir un type complexe" #: py/objtype.c msgid "cannot create '%q' instances" @@ -3060,6 +2782,10 @@ msgstr "ne peut récupérer sans ambigüité le sizeof d'un scalaire" msgid "casting" msgstr "typage" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "Ré-initialisation du canal" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "tampon de caractères trop petit" @@ -3072,10 +2798,6 @@ msgstr "paramètre de chr() hors les bornes de range(0x11000)" msgid "chr() arg not in range(256)" msgstr "paramètre de chr() hors les bornes de range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "le cercle ne peut être enregistré que dans un seul parent" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "point de coupure doît être un tuple (x,y)" @@ -3095,7 +2817,9 @@ msgstr "" #: shared-bindings/displayio/Palette.c msgid "color buffer must be a bytearray or array of type 'b' or 'B'" -msgstr "tampon color doit être un bytearray ou une matrice de type 'b' ou 'B'" +msgstr "" +"le tampon de couleurs doit être un bytearray ou une matrice de type 'b' ou " +"'B'" #: shared-bindings/displayio/Palette.c msgid "color must be between 0x000000 and 0xffffff" @@ -3141,6 +2865,10 @@ msgstr "les paramêtres pour convolve doivent être des ndarrays" msgid "convolve arguments must not be empty" msgstr "les arguments convolve ne doivent pas être vides" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "fichier corrompu" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "n'a pas pu inverser la matrice Vandermonde" @@ -3227,18 +2955,18 @@ msgstr "division par zéro" msgid "division by zero" msgstr "division par zéro" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "le diviseur doit être 4" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" -msgstr "" +msgstr "le dtype doit être un flottant, ou un complexe" #: py/objdeque.c msgid "empty" msgstr "vide" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "fichier vide" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "tas vide" @@ -3268,6 +2996,12 @@ msgstr "epoch_time n'est pas supporté sur ce panneau" msgid "error = 0x%08lX" msgstr "erreur = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "les exceptions doivent dériver de 'BaseException'" @@ -3342,7 +3076,7 @@ msgstr "le premier argument doit être une fonction" msgid "first argument must be a tuple of ndarrays" msgstr "le premier paramêtre doit être un tuple de ndarrays" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "le premier paramêtre doit être un ndarray" @@ -3378,6 +3112,10 @@ msgstr "la police doit être longue de 2048 octets" msgid "format requires a dict" msgstr "le format nécessite un dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "la fréquence est en lecture seule pour cette carte" + #: py/objdeque.c msgid "full" msgstr "plein" @@ -3405,7 +3143,7 @@ msgstr "fonction définie que pour les ndarrays" #: extmod/ulab/code/numpy/carray/carray.c msgid "function is implemented for ndarrays only" -msgstr "" +msgstr "la fonction n'est implémentée que pour les ndarrays" #: py/argcheck.c #, c-format @@ -3486,7 +3224,7 @@ msgstr "clé de format incomplète" msgid "incorrect padding" msgstr "espacement incorrect" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "l'index est hors limites" @@ -3505,6 +3243,10 @@ msgid "indices must be integers, slices, or Boolean lists" msgstr "" "les indices doivent être des entiers, des tranches ou des listes booléennes" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "initialisation I2C" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "les valeurs initiales doivent être itérables" @@ -3539,7 +3281,7 @@ msgstr "les données d'entrée doivent être un itérable" #: extmod/ulab/code/numpy/vector.c msgid "input dtype must be float or complex" -msgstr "" +msgstr "le dtype d'entrée doit être un flottant ou un complexe" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "input matrix is asymmetric" @@ -3550,25 +3292,25 @@ msgstr "la matrice d'entrée est asymétrique" msgid "input matrix is singular" msgstr "la matrice d'entrée est singulière" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "l'entrée doit être 1D ou 2D" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" -msgstr "" +msgstr "l'entrée doit être un ndarray 1D" #: extmod/ulab/code/scipy/linalg/linalg.c extmod/ulab/code/user/user.c msgid "input must be a dense ndarray" msgstr "l'entrée doit être un ndarray dense" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "l'entrée doit être un tenseur de rang 2" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "l'entrée doit être un ndarray" #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be an ndarray, or a scalar" -msgstr "" +msgstr "l'entrée doit être un ndarray, ou un scalaire" #: extmod/ulab/code/scipy/signal/signal.c msgid "input must be one-dimensional" @@ -3592,7 +3334,7 @@ msgstr "les entrées ne sont pas itérables" #: py/parsenum.c msgid "int() arg 2 must be >= 2 and <= 36" -msgstr "l'argument 2 de int() doit être >=2 et <=36" +msgstr "Le deuxième argument de int() doit être compris entre 2 et 36 inclus" #: extmod/ulab/code/numpy/approx.c msgid "interp is defined for 1D iterables of equal length" @@ -3643,6 +3385,10 @@ msgstr "hostname incorrect" msgid "invalid micropython decorator" msgstr "décorateur micropython invalide" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "réglage invalide" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "pas invalide" @@ -3675,7 +3421,8 @@ msgstr "l'argument 1 de issubclass() doit être une classe" #: py/objtype.c msgid "issubclass() arg 2 must be a class or a tuple of classes" msgstr "" -"l'argument 2 de issubclass() doit être une classe ou un tuple de classes" +"le deuxième argument de issubclass() doit être une classe ou un tuple de " +"classes" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "iterations did not converge" @@ -3738,11 +3485,11 @@ msgstr "loopback + silent mode non pris en charge par le périphérique" #: ports/espressif/common-hal/mdns/Server.c msgid "mDNS already initialized" -msgstr "" +msgstr "mDNS a déjà été initialisé" #: ports/espressif/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" -msgstr "" +msgstr "mDNS ne fonctionne que avec le WiFi intégré" #: py/parse.c msgid "malformed f-string" @@ -3760,10 +3507,6 @@ msgstr "erreur de domaine math" msgid "matrix is not positive definite" msgstr "la matrice n'est pas définie positive" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3771,13 +3514,9 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length doit être 0-%d lorsque fixed_length est %s" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "max_length doit être >= 0" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "nombre maximal de dimensions est 4" +msgid "maximum number of dimensions is " +msgstr "le nombre maximal de dimensions est " #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3910,7 +3649,7 @@ msgstr "pas de broche de réinitialisation disponible" msgid "no response from SD card" msgstr "pas de réponse de la carte SD" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "pas de tel attribut" @@ -3963,7 +3702,7 @@ msgstr "pas assez d'arguments pour la chaîne de format" #: extmod/ulab/code/numpy/carray/carray_tools.c msgid "not implemented for complex dtype" -msgstr "" +msgstr "n'est pas implémenté pour les dtype complexes" #: extmod/ulab/code/numpy/create.c msgid "number of points must be at least 2" @@ -4023,7 +3762,11 @@ msgstr "un objet avec un protocole de tampon est nécessaire" msgid "odd-length string" msgstr "chaîne de longueur impaire" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "inactif" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset est trop large" @@ -4033,7 +3776,8 @@ msgstr "offset doit être >= 0" #: extmod/ulab/code/numpy/create.c msgid "offset must be non-negative and no greater than buffer length" -msgstr "offset doit être non-négatif, et au plus la taille du tampon" +msgstr "" +"offset ne doit pas être négatif, et pas plus grand que la taille du tampon" #: py/objstr.c py/objstrunicode.c msgid "offset out of bounds" @@ -4089,8 +3833,7 @@ msgstr "ord attend un caractère" #, c-format msgid "ord() expected a character, but string of length %d found" msgstr "" -"ord() attend un caractère mais une chaîne de caractère de longueur %d a été " -"trouvée" +"ord() attend un caractère mais une chaîne de %d caractères a été trouvée" #: extmod/ulab/code/utils/utils.c msgid "out array is too small" @@ -4148,11 +3891,7 @@ msgstr "" #: extmod/vfs_posix_file.c msgid "poll on file not available on win32" -msgstr "" - -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "le polygone ne peut être enregistré que dans un parent" +msgstr "le polling sur un fichier n'est pas disponible sous win32" #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" @@ -4179,63 +3918,23 @@ msgstr "le 3e argument de pow() ne peut être 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() avec 3 arguments nécessite des entiers" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "presser le bouton BOOT au démarrage.\n" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "presser le bouton SW38 au démarrage.\n" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "presser le bouton VOLUME au démarrage.\n" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "bouton boot appuyé lors du démarrage.\n" @@ -4255,14 +3954,6 @@ msgstr "appuyer le bouton de gauche au démarage\n" msgid "pull masks conflict with direction masks" msgstr "masque pull est en conflit avec les masques de direction" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "pull_threshold doit être entre 1 et 32" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "push_threshold doit être entre 1 et 32" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "dépassement de file" @@ -4314,14 +4005,6 @@ msgstr "paramêtre roll doit être un ndarray" msgid "rsplit(None,n)" msgstr "rsplit(None, n)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"tampon sample_source doit être un bytearray ou une matrice de type 'h', 'H', " -"'b' ou 'B'" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4419,10 +4102,6 @@ msgstr "source_bitmap doit avoir une value_count de 65536" msgid "source_bitmap must have value_count of 8" msgstr "source_bitmap doit avoir une value_count de 8" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "un ssid ne peut pas faire plus de 32 octets" - #: py/objstr.c msgid "start/end indices" msgstr "indices de début/fin" @@ -4435,10 +4114,6 @@ msgstr "'start_x' doit être un entier 'int'" msgid "step must be non-zero" msgstr "le pas 'step' doit être non nul" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop doit être 1 ou 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop n'est pas accessible au démarrage" @@ -4488,10 +4163,6 @@ msgstr "erreur de syntaxe dans le descripteur d'uctypes" msgid "threshold must be in the range 0-65536" msgstr "le seuil doit être dans la portée 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "tile doit être plus que zéro" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() prend une séquence de longueur 9" @@ -4511,10 +4182,6 @@ msgstr "le délai doit être compris entre 0.0 et 100.0 secondes" msgid "timeout must be < 655.35 secs" msgstr "le délai (timeout) doit être < 655.35 secondes" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "'timeout' doit être >= 0.0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "Délai d’expiration dépassé en attendant une carte v1" @@ -4523,6 +4190,10 @@ msgstr "Délai d’expiration dépassé en attendant une carte v1" msgid "timeout waiting for v2 card" msgstr "Délai d’expiration dépassé en attendant une carte v2" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "Ré-initialisation du miniteur" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp hors bornes pour 'time_t' de la plateforme" @@ -4693,6 +4364,14 @@ msgstr "type non supporté pour l'opérateur" msgid "unsupported types for %q: '%q', '%q'" msgstr "types non supportés pour %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "usecols est trop grand" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "le mot-clé \"usecols\" doit être spécifié" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4714,13 +4393,7 @@ msgstr "chien de garde (watchdog) non initialisé" msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout doit être supérieur à 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "width doit être entre 2 et 8 (inclusivement), non %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "width doit être plus que zero" @@ -4740,13 +4413,27 @@ msgstr "index d'axe incorrecte" msgid "wrong axis specified" msgstr "axe incorrecte spécifiée" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "dtype invalide" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "type d'index incorrect" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "type d'entrée incorrect" #: extmod/ulab/code/numpy/transform.c msgid "wrong length of condition array" -msgstr "" +msgstr "mauvaise taille du tableau de condition" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "mauvaise longueur du tableau d'indices" #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" @@ -4792,6 +4479,380 @@ 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 "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "tampon sample_source doit être un bytearray ou une matrice de type 'h', " +#~ "'H', 'b' ou 'B'" + +#~ msgid "Expected an alarm" +#~ msgstr "Une alarme était prévue" + +#~ msgid "All I2C targets are in use" +#~ msgstr "Toutes les cibles I2C sont utilisées" + +#~ msgid "Failed to init wifi" +#~ msgstr "Echec de l'initialisation du Wifi" + +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "l'entrée doit être un tenseur de rang 2" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "nombre maximal de dimensions est 4" + +#~ msgid "Watchdog timer expired." +#~ msgstr "Le minuteur Watchdog a expiré." + +#~ msgid "ssid can't be more than 32 bytes" +#~ msgstr "un ssid ne peut pas faire plus de 32 octets" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q doit être un tuple de longueur 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q doit être entre %d et %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q doit être un chiffre entier (int)" + +#~ msgid "(x,y) integers required" +#~ msgstr "Des entiers (x,y) requis" + +#~ msgid "Address type out of range" +#~ msgstr "Type d'adresse hors portée" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Fonctionnalité AnalogOut non supportée" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "" +#~ "AnalogOut est seulement 16 bits. Les valeurs doivent être inférieures à " +#~ "65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bit depth doit être entre 1 et 6 inclusivement, et non %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Tampon de taille incorrect. Devrait être de %d octets." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Le tampon doit être de longueur au moins 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Les octets 'bytes' doivent être entre 0 et 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Les 2 canaux de sortie ne peuvent être sur la même broche" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Impossible de lire sans broche MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Ne peut être redémarré vers le bootloader car il n'y a pas de bootloader." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Pas de transfert sans broches MOSI et MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Impossible d'écrire sans broche MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Échec de l'initialization de la broche d'horloge." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "La commande doit être un chiffre entier entre 0 et 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Impossible d'initialiser Camera" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Impossible d'initialiser GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Impossible d'initialiser la carte SD" + +#~ msgid "Could not initialize UART" +#~ msgstr "Impossible d'initialiser UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Impossible de réinitialiser le canal" + +#~ msgid "Could not re-init timer" +#~ msgstr "Impossible de réinitialiser le minuteur" + +#~ msgid "Could not restart PWM" +#~ msgstr "Impossible de redémarrer PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Impossible d'allouer le premier tampon" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Impossible d'allouer le tampon d'entrée" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Impossible d'allouer le deuxième tampon" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut non pris en charge sur la broche donnée" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Tuple de longueur %d attendu, obtenu %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Echec de l'allocation du tampon RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Echec de l'allocation de %d octets du tampon RX" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "FrameBuffer nécessite %d octets" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Hostname doit être entre 1 et 253 caractères" + +#~ msgid "I2C Init Error" +#~ msgstr "Erreur d'initialisation I2C" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Sélection de broche %q invalide" + +#~ msgid "Invalid AuthMode" +#~ msgstr "AuthMode invalide" + +#~ msgid "Invalid BMP file" +#~ msgstr "Fichier BMP invalide" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Broche DAC non valide fournie" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Fichier MIDI invalide" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Fréquence de PWM invalide" + +#~ msgid "Invalid Pin" +#~ msgstr "Broche invalide" + +#~ msgid "Invalid buffer size" +#~ msgstr "Longueur de tampon invalide" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Chaîne byteorder non valide" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Période de capture invalide. Portée valide : 1 à 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Nombre de canaux invalide" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "data_count invalide %d" + +#~ msgid "Invalid direction." +#~ msgstr "Direction invalide." + +#~ msgid "Invalid file" +#~ msgstr "Fichier invalide" + +#~ msgid "Invalid number of bits" +#~ msgstr "Nombre de bits invalide" + +#~ msgid "Invalid phase" +#~ msgstr "Phase invalide" + +#~ msgid "Invalid pin" +#~ msgstr "Broche invalide" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Broche invalide pour le canal gauche" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Broche invalide pour le canal droit" + +#~ msgid "Invalid polarity" +#~ msgstr "Polarité invalide" + +#~ msgid "Invalid properties" +#~ msgstr "Propriétés invalides" + +#~ msgid "Invalid run mode." +#~ msgstr "Mode de lancement invalide." + +#~ msgid "Invalid security_mode" +#~ msgstr "'security_mode' invalide" + +#~ msgid "Invalid voice" +#~ msgstr "Voix invalide" + +#~ msgid "Invalid voice count" +#~ msgstr "Nombre de voix invalide" + +#~ msgid "Invalid wave file" +#~ msgstr "Fichier WAVE invalide" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Longueur de mot / bit invalide" + +#~ msgid "Layer already in a group." +#~ msgstr "Couche déjà dans un groupe." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "'Layer' doit être un 'Group' ou une sous-classe 'TileGrid'." + +#~ msgid "MISO pin init failed." +#~ msgstr "Échec de l'initialization de la broche MISO." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Échec de l'initialization de la broche MOSI." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Messages limités à 8 octets" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "Plus de %d identifiants de rapport ne sont pas supportés" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Pas de support matériel sur la broche clk" + +#~ msgid "No hardware support on pin" +#~ msgstr "Pas de support matériel pour cette broche" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "Tampon de sortie doit être au moins %d octets" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "La valeur de duty_cycle de PWM doit être entre 0 et 65535 inclusivement " +#~ "(résolution de 16 bits)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "Nombre de broches doit être au moins 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "La broche 'pin' ne supporte pas les capacitées ADC" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "Le programme doit contenir au moins une instruction de 16 bits." + +#~ msgid "Program too large" +#~ msgstr "Programme trop grand" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 n'est pas encore supporté sur cet appareil" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "La calibration du RTC non supportée sur cette carte" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS / CTS / RS485 Pas encore supporté sur cet appareil" + +#~ msgid "SPI Init Error" +#~ msgstr "Erreur d'initialisation SPI" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "Erreur de réinitialisation SPI" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Le taux d'échantillonage doit être positif" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Taux d'échantillonage trop élevé. Doit être inférieur à %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "Nombre de broches configurées doit être entre 1 et 5" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "Nombre de broches Side configurées doit être entre 1 et 5" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "La pile doit être au moins de 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Valeur de tuile hors limites" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "Erreur d'allocation de tampon UART" + +#~ msgid "UART De-init error" +#~ msgstr "Erreur de désactivation UART" + +#~ msgid "UART Init Error" +#~ msgstr "Erreur d'initialisation UART" + +#~ msgid "UART Re-init error" +#~ msgstr "Erreur de réinitialisation UART" + +#~ msgid "UART write error" +#~ msgstr "Erreur d'écriture UART" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Débit en bauds non supporté" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "Le mot de passe WiFi doit faire entre 8 et 63 caractères" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "les bits doivent être compris entre 5 et 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "octets > 8 bits non supporté" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "valeur de étalonnage hors bornes +/-127" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "le cercle ne peut être enregistré que dans un seul parent" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length doit être >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "le polygone ne peut être enregistré que dans un parent" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "pull_threshold doit être entre 1 et 32" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "push_threshold doit être entre 1 et 32" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop doit être 1 ou 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "tile doit être plus que zéro" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "'timeout' doit être >= 0.0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "width doit être entre 2 et 8 (inclusivement), non %d" + +#~ msgid "Unsupported operation" +#~ msgstr "Opération non supportée" + +#~ msgid "divisor must be 4" +#~ msgstr "le diviseur doit être 4" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" @@ -5313,9 +5374,6 @@ msgstr "zi doit être de forme (n_section, 2)" #~ msgid "wrong argument type" #~ msgstr "type d'argument incorrect" -#~ msgid "wrong index type" -#~ msgstr "type d'index incorrect" - #~ msgid "Must provide SCK pin" #~ msgstr "Vous devez fournir un code PIN SCK" diff --git a/locale/hi.po b/locale/hi.po index 12671ffb38..65d430d860 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -66,10 +66,27 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -82,12 +99,7 @@ msgstr "" msgid "%q in use" msgstr "" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "" @@ -95,18 +107,42 @@ msgstr "" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -115,29 +151,25 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -156,7 +188,11 @@ msgstr "" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -165,10 +201,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -181,7 +213,11 @@ msgstr "" msgid "%q, %q, and %q must all be the same length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -331,10 +367,6 @@ msgstr "" msgid "'yield' outside function" msgstr "" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -370,16 +402,12 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" @@ -416,7 +444,6 @@ msgstr "" msgid "All event channels in use" msgstr "" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -464,25 +491,6 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -521,7 +529,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "" @@ -552,11 +560,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" @@ -598,11 +601,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -612,7 +610,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -623,14 +620,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -652,10 +645,6 @@ msgstr "" msgid "Byte buffer must be 16 bytes." msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "" - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "" @@ -664,7 +653,7 @@ msgstr "" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -672,6 +661,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -719,18 +712,10 @@ msgstr "" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "" @@ -742,7 +727,7 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -763,20 +748,19 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -791,10 +775,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -803,11 +783,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -818,35 +793,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -867,20 +813,6 @@ msgstr "" msgid "Couldn't allocate decoder" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -928,10 +860,6 @@ msgstr "" msgid "Device in use" msgstr "" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -943,6 +871,10 @@ msgstr "" msgid "Display rotation must be in 90 degree increments" msgstr "" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "" @@ -978,18 +910,14 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" +msgid "Expected an %q" msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c @@ -1018,20 +946,8 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" msgstr "" #: ports/espressif/common-hal/wifi/__init__.c @@ -1055,10 +971,6 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -1102,9 +1014,9 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" #: shared-bindings/pwmio/PWMOut.c @@ -1116,7 +1028,11 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1143,19 +1059,16 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1260,75 +1173,37 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1336,42 +1211,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -1380,79 +1224,15 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "" - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1460,27 +1240,10 @@ msgstr "" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1494,25 +1257,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1522,18 +1277,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1569,11 +1333,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1599,6 +1358,10 @@ msgstr "" msgid "Name too long" msgstr "" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1629,16 +1392,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" -#: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c -msgid "No MISO Pin" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1677,16 +1452,6 @@ msgstr "" msgid "No hardware random available" msgstr "" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1731,6 +1496,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1780,6 +1549,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1789,7 +1566,7 @@ msgstr "" msgid "Only IPv4 addresses supported" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1822,15 +1599,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1838,19 +1619,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1858,11 +1643,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1873,12 +1653,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1897,29 +1676,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -1986,18 +1750,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2019,8 +1775,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2028,21 +1785,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "" @@ -2060,10 +1806,14 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "" @@ -2076,7 +1826,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2092,6 +1842,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2102,29 +1856,20 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2145,14 +1890,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2188,10 +1925,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2277,10 +2010,6 @@ msgstr "" msgid "Tile index out of bounds" msgstr "" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "" @@ -2300,6 +2029,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2332,23 +2064,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2485,12 +2214,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2503,8 +2226,8 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c @@ -2525,7 +2248,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2555,10 +2278,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2569,8 +2288,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2611,11 +2330,11 @@ msgstr "" msgid "a bytes-like object is required" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "" @@ -2664,6 +2383,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2725,10 +2448,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2766,11 +2485,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2779,7 +2493,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2787,12 +2501,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2815,7 +2526,7 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -2963,6 +2674,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -2975,10 +2690,6 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3043,6 +2754,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3126,10 +2841,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3138,6 +2849,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3167,6 +2882,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "" @@ -3241,7 +2962,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3277,6 +2998,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" @@ -3385,7 +3110,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3403,6 +3128,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3448,6 +3177,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3456,11 +3189,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3540,6 +3269,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "" @@ -3653,10 +3386,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3664,12 +3393,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3803,7 +3528,7 @@ msgstr "" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "" @@ -3914,7 +3639,11 @@ msgstr "" msgid "odd-length string" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4038,10 +3767,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4067,63 +3792,23 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4143,14 +3828,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4202,12 +3879,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4305,10 +3976,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" @@ -4321,10 +3988,6 @@ msgstr "" msgid "step must be non-zero" msgstr "" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4373,10 +4036,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4396,10 +4055,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4408,6 +4063,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4578,6 +4237,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4599,13 +4266,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4625,7 +4286,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4633,6 +4304,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 29415e59f9..c2f0018256 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -73,10 +73,27 @@ msgid "" msgstr "" "%d pin indirizzo, %d pin rgb e %d tessere indicano l'altezza di %d, non %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -89,12 +106,7 @@ msgstr "%q fallito: %d" msgid "%q in use" msgstr "%q in uso" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "indice %q fuori intervallo" @@ -102,18 +114,42 @@ msgstr "indice %q fuori intervallo" msgid "%q indices must be integers, not %s" msgstr "gli indici %q devono essere interi, non %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -122,30 +158,26 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q deve essere >= 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c #, fuzzy msgid "%q must be >= 1" msgstr "slice del buffer devono essere della stessa lunghezza" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q deve essere una tupla di lunghezza 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -164,7 +196,11 @@ msgstr "" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q oltre il limite" @@ -173,10 +209,6 @@ msgstr "%q oltre il limite" msgid "%q pin invalid" msgstr "%q pin non valido" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q dovrebbe essere un int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -189,7 +221,11 @@ msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d" msgid "%q, %q, and %q must all be the same length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s errore 0x%x" @@ -340,10 +376,6 @@ msgstr "'yield from' è nella funzione sincronizzazione" msgid "'yield' outside function" msgstr "'yield' al di fuori della funzione" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x deve essere il bersaglio del assegnamento" @@ -379,16 +411,12 @@ msgstr "ADC2 sta usando il WiFi" msgid "Address must be %d bytes long" msgstr "L'indirizzo deve essere lungo %d byte" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Tipo di indirizzo fuori intervallo" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Tutte le periferiche CAN sono in uso" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" @@ -426,7 +454,6 @@ msgstr "" msgid "All event channels in use" msgstr "Tutti i canali eventi utilizati" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "Tutte le state machines sono in uso" @@ -474,25 +501,6 @@ msgstr "Già in funzione" msgid "Already scanning for wifi networks" msgstr "Già in ricerca di collegamenti WiFi" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "funzionalità AnalogOut non supportata" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut ha solo 16 bit. Il valore deve essere meno di 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut non supportato sul pin scelto" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -531,7 +539,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Autenticazione Fallita" @@ -565,11 +573,6 @@ msgid "Bit clock and word select must share a clock unit" msgstr "" "Clock di bit e selezione parola devono condividere la stessa unità di clock" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "La profondità dei bit deve essere inclusiva da 1 a 6, non %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "La profondità di bit deve essere un multiplo di 8." @@ -611,11 +614,6 @@ msgstr "Buffer + offset troppo piccolo %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Buffer di lunghezza non valida. Dovrebbe essere di %d bytes." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffer non è un array di bites." @@ -625,7 +623,6 @@ msgstr "Buffer non è un array di bites." msgid "Buffer is too small" msgstr "Buffer troppo piccolo" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -636,14 +633,10 @@ msgstr "Lunghezza Buffer %d troppo grande. Deve essere meno di %d" msgid "Buffer length must be a multiple of 512" msgstr "La lunghezza del buffer deve essere un multiplo di 512" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "Il buffer deve essere un multiplo di 512 bytes" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Il buffer deve essere lungo almeno 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -665,10 +658,6 @@ msgstr "Bus pin %d è già in uso" msgid "Byte buffer must be 16 bytes." msgstr "I buffer byte devono essere di almeno 16 bytes." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "I byte devono essere compresi tra 0 e 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "I blocchi CBC devono essere multipli di 16 bytes" @@ -677,7 +666,7 @@ msgstr "I blocchi CBC devono essere multipli di 16 bytes" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC o controllo totale è risultato non valido" @@ -685,6 +674,10 @@ msgstr "CRC o controllo totale è risultato non valido" msgid "Call super().__init__() before accessing native object." msgstr "Chiama super().__init__() prima di accedere ad un oggetto nativo." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -733,18 +726,10 @@ msgstr "Impossibile leggere la temperatura. status: 0x%02x" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Impossibile dare in output entrambi i canal sullo stesso pin" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Impossibile leggere senza pin MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Impossibile registrare in un file" @@ -756,9 +741,8 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" -"Impossibile resettare nel bootloader poiché nessun bootloader è presente." #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -778,21 +762,20 @@ msgid "Cannot subclass slice" msgstr "Impossibile subclasare slice" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Impossibile trasferire senza i pin MOSI e MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Impossibile scrivere senza pin MOSI." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -806,10 +789,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Inizializzazione del pin di clock fallita." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Orologio e troppo allungato" @@ -818,12 +797,6 @@ msgstr "Orologio e troppo allungato" msgid "Clock unit in use" msgstr "Unità di clock in uso" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -#, fuzzy -msgid "Command must be an int between 0 and 255" -msgstr "I byte devono essere compresi tra 0 e 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -834,35 +807,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Impossibile inizializzare l'UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -883,20 +827,6 @@ msgstr "" msgid "Couldn't allocate decoder" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Impossibile allocare il primo buffer" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Impossibile allocare il secondo buffer" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -946,10 +876,6 @@ msgstr "La capacità di destinazione è più piccola di destination_length." msgid "Device in use" msgstr "" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -961,6 +887,10 @@ msgstr "" msgid "Display rotation must be in 90 degree increments" msgstr "" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "" @@ -996,18 +926,14 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Atteso un %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" +msgid "Expected an %q" msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c @@ -1036,21 +962,9 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "Impossibile acquisire il mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Impossibile allocare buffer RX" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Fallita allocazione del buffer RX di %d byte" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1073,10 +987,6 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -1120,9 +1030,9 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" #: shared-bindings/pwmio/PWMOut.c @@ -1134,7 +1044,11 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1161,19 +1075,16 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "operazione I/O su file chiuso" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1280,75 +1191,37 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Pin %q non valido" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "File BMP non valido" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Frequenza PWM non valida" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Argomento non valido" @@ -1356,44 +1229,11 @@ msgstr "Argomento non valido" msgid "Invalid bits per value" msgstr "bits per valore invalido" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -#, fuzzy -msgid "Invalid buffer size" -msgstr "lunghezza del buffer non valida" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "periodo di cattura invalido. Zona valida: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -#, fuzzy -msgid "Invalid channel count" -msgstr "Argomento non valido" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Direzione non valida." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "File non valido" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -1402,79 +1242,15 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Numero di bit non valido" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Fase non valida" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Pin non valido" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Pin non valido per il canale sinistro" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Pin non valido per il canale destro" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Pin non validi" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Polarità non valida" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Modalità di esecuzione non valida." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1482,28 +1258,10 @@ msgstr "" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -#, fuzzy -msgid "Invalid voice count" -msgstr "Tipo di servizio non valido" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "File wave non valido" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1517,24 +1275,16 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer deve essere un Group o TileGrid subclass" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c -msgid "MAC address was invalid" +msgid "Layer must be a Group or TileGrid subclass" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "inizializzazione del pin MISO fallita." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "inizializzazione del pin MOSI fallita." +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +msgid "MAC address was invalid" +msgstr "" #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" @@ -1545,19 +1295,28 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "Valore massimo di x quando rispachiato è %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" "Il ritardo di avvio del microfono deve essere nell'intervallo tra 0.0 e 1.0" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1593,11 +1352,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1623,6 +1377,10 @@ msgstr "" msgid "Name too long" msgstr "" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1653,16 +1411,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" -#: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c -msgid "No MISO Pin" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1701,16 +1471,6 @@ msgstr "Nessun GCLK libero" msgid "No hardware random available" msgstr "Nessun generatore hardware di numeri casuali disponibile" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Nessun supporto hardware sul pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1755,6 +1515,10 @@ msgstr "" msgid "No space left on device" msgstr "Non che spazio sul dispositivo" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Nessun file/directory esistente" @@ -1808,6 +1572,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "operazione I2C non supportata" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1817,7 +1589,7 @@ msgstr "" msgid "Only IPv4 addresses supported" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1850,15 +1622,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1866,19 +1642,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1886,11 +1666,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "L'oversampling deve essere multiplo di 8." @@ -1899,13 +1674,6 @@ msgstr "L'oversampling deve essere multiplo di 8." msgid "PDMIn not available" msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" -"duty_cycle del PWM deve essere compresa tra 0 e 65535 inclusiva (risoluzione " -"a 16 bit)" - #: shared-bindings/pwmio/PWMOut.c #, fuzzy msgid "" @@ -1914,6 +1682,10 @@ msgstr "" "frequenza PWM frequency non è scrivibile quando variable_frequency è " "impostato nel costruttore a False." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1930,29 +1702,14 @@ msgstr "" msgid "Permission denied" msgstr "Permesso negato" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Il pin non ha capacità di ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2020,18 +1777,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2053,8 +1802,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2062,21 +1812,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "calibrazione RTC non supportata su questa scheda" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC non supportato su questa scheda" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "" @@ -2095,10 +1834,14 @@ msgstr "Filesystem in sola lettura" msgid "Read-only object" msgstr "Sola lettura" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "" @@ -2111,7 +1854,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2127,6 +1870,10 @@ msgstr "Modalità sicura in esecuzione! Codice salvato non in esecuzione.\n" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2137,32 +1884,21 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -#, fuzzy -msgid "Sample rate must be positive" -msgstr "STA deve essere attiva" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" -"Frequenza di campionamento troppo alta. Il valore deve essere inferiore a %d" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2182,14 +1918,6 @@ msgstr "Serializer in uso" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2225,10 +1953,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Suddivisione con sotto-catture" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "La dimensione dello stack deve essere almeno 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2314,10 +2038,6 @@ msgstr "" msgid "Tile index out of bounds" msgstr "" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "" @@ -2337,6 +2057,9 @@ msgid "To exit, please reset the board without " msgstr "Per uscire resettare la scheda senza " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2369,23 +2092,20 @@ msgid "Tuple or struct_time argument required" msgstr "Tupla o struct_time richiesto come argomento" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2523,12 +2243,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "baudrate non supportato" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2542,9 +2256,9 @@ msgstr "tipo di bitmap non supportato" msgid "Unsupported format" msgstr "Formato non supportato" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operazione non supportata" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2564,7 +2278,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2594,10 +2308,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2608,8 +2318,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2650,11 +2360,11 @@ msgstr "" msgid "a bytes-like object is required" msgstr "un oggetto byte-like è richiesto" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "indirizzo fuori limite" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "gli indirizzi sono vuoti" @@ -2703,6 +2413,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2764,10 +2478,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c #, fuzzy msgid "bits_per_sample must be 8 or 16" @@ -2808,11 +2518,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "byte > 8 bit non supportati" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2821,7 +2526,7 @@ msgstr "" msgid "bytes value out of range" msgstr "valore byte fuori intervallo" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "la calibrazione è fuori intervallo" @@ -2829,12 +2534,9 @@ msgstr "la calibrazione è fuori intervallo" msgid "calibration is read only" msgstr "la calibrazione è in sola lettura" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "valore di calibrazione fuori intervallo +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2858,7 +2560,7 @@ msgstr "impossibile assegnare all'espressione" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3006,6 +2708,10 @@ msgstr "" msgid "casting" msgstr "casting" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "buffer dei caratteri troppo piccolo" @@ -3018,10 +2724,6 @@ msgstr "argomento di chr() non è in range(0x110000)" msgid "chr() arg not in range(256)" msgstr "argomento di chr() non è in range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3088,6 +2790,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3174,10 +2880,6 @@ msgstr "" msgid "division by zero" msgstr "divisione per zero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3186,6 +2888,10 @@ msgstr "" msgid "empty" msgstr "vuoto" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "heap vuoto" @@ -3216,6 +2922,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "errore = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "le eccezioni devono derivare da BaseException" @@ -3290,7 +3002,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3326,6 +3038,10 @@ msgstr "il font deve essere lungo 2048 byte" msgid "format requires a dict" msgstr "la formattazione richiede un dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "pieno" @@ -3435,7 +3151,7 @@ msgstr "" msgid "incorrect padding" msgstr "padding incorretto" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3453,6 +3169,10 @@ msgstr "gli indici devono essere interi" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3498,6 +3218,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3506,11 +3230,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3590,6 +3310,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "decoratore non valido in micropython" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "step non valida" @@ -3708,10 +3432,6 @@ msgstr "errore di dominio matematico" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3719,12 +3439,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3858,7 +3574,7 @@ msgstr "" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "attributo inesistente" @@ -3971,7 +3687,11 @@ msgstr "" msgid "odd-length string" msgstr "stringa di lunghezza dispari" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4099,10 +3819,6 @@ msgstr "pixel_shader deve essere displayio.Palette o displayio.ColorConverter" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop sun un PulseIn vuoto" @@ -4128,63 +3844,23 @@ msgstr "il terzo argomento di pow() non può essere 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() con 3 argomenti richiede interi" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4204,14 +3880,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "overflow della coda" @@ -4263,14 +3931,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"il buffer sample_source deve essere un bytearray o un array di tipo 'h', " -"'H', 'b' o 'B'" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4368,10 +4028,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" @@ -4385,10 +4041,6 @@ msgstr "y dovrebbe essere un int" msgid "step must be non-zero" msgstr "step deve essere non zero" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop non raggiungibile dall'inizio" @@ -4437,10 +4089,6 @@ msgstr "errore di sintassi nel descrittore uctypes" msgid "threshold must be in the range 0-65536" msgstr "la soglia deve essere nell'intervallo 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4460,11 +4108,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#, fuzzy -msgid "timeout must be >= 0.0" -msgstr "i bit devono essere 8" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4473,6 +4116,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp è fuori intervallo per il time_t della piattaforma" @@ -4643,6 +4290,14 @@ msgstr "tipo non supportato per l'operando" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4664,13 +4319,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4690,7 +4339,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4698,6 +4357,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "numero di argomenti errato" @@ -4744,6 +4407,188 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "il buffer sample_source deve essere un bytearray o un array di tipo 'h', " +#~ "'H', 'b' o 'B'" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q deve essere una tupla di lunghezza 2" + +#~ msgid "%q should be an int" +#~ msgstr "%q dovrebbe essere un int" + +#~ msgid "Address type out of range" +#~ msgstr "Tipo di indirizzo fuori intervallo" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "funzionalità AnalogOut non supportata" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut ha solo 16 bit. Il valore deve essere meno di 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut non supportato sul pin scelto" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "La profondità dei bit deve essere inclusiva da 1 a 6, non %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Buffer di lunghezza non valida. Dovrebbe essere di %d bytes." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Il buffer deve essere lungo almeno 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "I byte devono essere compresi tra 0 e 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Impossibile dare in output entrambi i canal sullo stesso pin" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Impossibile leggere senza pin MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Impossibile resettare nel bootloader poiché nessun bootloader è presente." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Impossibile trasferire senza i pin MOSI e MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Impossibile scrivere senza pin MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Inizializzazione del pin di clock fallita." + +#, fuzzy +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "I byte devono essere compresi tra 0 e 255" + +#~ msgid "Could not initialize UART" +#~ msgstr "Impossibile inizializzare l'UART" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Impossibile allocare il primo buffer" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Impossibile allocare il secondo buffer" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Impossibile allocare buffer RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Fallita allocazione del buffer RX di %d byte" + +#~ msgid "Invalid BMP file" +#~ msgstr "File BMP non valido" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Frequenza PWM non valida" + +#, fuzzy +#~ msgid "Invalid buffer size" +#~ msgstr "lunghezza del buffer non valida" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "periodo di cattura invalido. Zona valida: 1 - 500" + +#, fuzzy +#~ msgid "Invalid channel count" +#~ msgstr "Argomento non valido" + +#~ msgid "Invalid direction." +#~ msgstr "Direzione non valida." + +#~ msgid "Invalid file" +#~ msgstr "File non valido" + +#~ msgid "Invalid number of bits" +#~ msgstr "Numero di bit non valido" + +#~ msgid "Invalid phase" +#~ msgstr "Fase non valida" + +#~ msgid "Invalid pin" +#~ msgstr "Pin non valido" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Pin non valido per il canale sinistro" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Pin non valido per il canale destro" + +#~ msgid "Invalid polarity" +#~ msgstr "Polarità non valida" + +#~ msgid "Invalid run mode." +#~ msgstr "Modalità di esecuzione non valida." + +#, fuzzy +#~ msgid "Invalid voice count" +#~ msgstr "Tipo di servizio non valido" + +#~ msgid "Invalid wave file" +#~ msgstr "File wave non valido" + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer deve essere un Group o TileGrid subclass" + +#~ msgid "MISO pin init failed." +#~ msgstr "inizializzazione del pin MISO fallita." + +#~ msgid "MOSI pin init failed." +#~ msgstr "inizializzazione del pin MOSI fallita." + +#~ msgid "No hardware support on pin" +#~ msgstr "Nessun supporto hardware sul pin" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "duty_cycle del PWM deve essere compresa tra 0 e 65535 inclusiva " +#~ "(risoluzione a 16 bit)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Il pin non ha capacità di ADC" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "calibrazione RTC non supportata su questa scheda" + +#, fuzzy +#~ msgid "Sample rate must be positive" +#~ msgstr "STA deve essere attiva" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "" +#~ "Frequenza di campionamento troppo alta. Il valore deve essere inferiore a " +#~ "%d" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "La dimensione dello stack deve essere almeno 256" + +#~ msgid "Unsupported baudrate" +#~ msgstr "baudrate non supportato" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "byte > 8 bit non supportati" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "valore di calibrazione fuori intervallo +/-127" + +#, fuzzy +#~ msgid "timeout must be >= 0.0" +#~ msgstr "i bit devono essere 8" + +#~ msgid "Unsupported operation" +#~ msgstr "Operazione non supportata" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/ja.po b/locale/ja.po index 20f41e546d..495c7ca978 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -71,10 +71,27 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -87,12 +104,7 @@ msgstr "%q 失敗: %d" msgid "%q in use" msgstr "%qは使用中" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q インデックスは範囲外" @@ -100,18 +112,42 @@ msgstr "%q インデックスは範囲外" msgid "%q indices must be integers, not %s" msgstr "" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -120,29 +156,25 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%qは0以上でなければなりません" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%qは1以上でなければなりません" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%qは長さ2のタプルでなければなりません" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -161,7 +193,11 @@ msgstr "" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q が範囲外" @@ -170,10 +206,6 @@ msgstr "%q が範囲外" msgid "%q pin invalid" msgstr "%q ピンは無効" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%qはint型でなければなりません" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -186,7 +218,11 @@ msgstr "%q() は %d 個の位置引数を取りますが、%d 個与えられま msgid "%q, %q, and %q must all be the same length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -336,10 +372,6 @@ msgstr "" msgid "'yield' outside function" msgstr "関数外でのyield" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*xは代入先でなければなりません" @@ -375,16 +407,12 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "アドレスは、%dバイト長でなければなりません" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "address_typeが範囲外" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "全てのCAN周辺機器が使用中" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "全てのI2C周辺機器が使用中" @@ -421,7 +449,6 @@ msgstr "" msgid "All event channels in use" msgstr "全てのイベントチャネルが使用中" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -469,25 +496,6 @@ msgstr "すでに実行中" msgid "Already scanning for wifi networks" msgstr "" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "指定のピンはAnalogInに対応していません" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut機能に対応していません" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOutは16ビットです。値は65536以下でなければなりません" - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "指定のピンはAnalogOutに対応していません" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -526,7 +534,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "認証失敗" @@ -559,11 +567,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "bit clockとword selectはクロックユニットを共有しなければなりません" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "ビット深度は8の倍数でなければなりません" @@ -605,11 +608,6 @@ msgstr "buffer + offsetが小さすぎます %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "バッファサイズが不正です。%dバイトでなければなりません" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "バッファがbytearrayではありません" @@ -619,7 +617,6 @@ msgstr "バッファがbytearrayではありません" msgid "Buffer is too small" msgstr "バッファが小さすぎます" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -630,14 +627,10 @@ msgstr "バッファ長%dは大きすぎます。%d以下でなければなり msgid "Buffer length must be a multiple of 512" msgstr "バッファ長は512の倍数でなければなりません" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "バッファは512の倍数でなければなりません" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "バッファ長は少なくとも1以上でなければなりません" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -659,10 +652,6 @@ msgstr "Busピン%dはすでに使用中" msgid "Byte buffer must be 16 bytes." msgstr "バッファは16バイトでなければなりません" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "バイト値は0から255の間でなければなりません" - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBCブロックは16バイトの整数倍でなければなりません" @@ -671,7 +660,7 @@ msgstr "CBCブロックは16バイトの整数倍でなければなりません" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -681,6 +670,10 @@ msgstr "" "ネイティブオブジェクトにアクセスする前にsuper().__init__()を呼び出してくださ" "い" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -728,18 +721,10 @@ msgstr "温度を取得できません" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "同じピン上の両チャネルに出力できません" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "MISOピンなしで読み込めません" - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "ファイルへ記録できません" @@ -751,8 +736,8 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "ブートローダが存在しないためブートローダへとリセットできません" +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -772,21 +757,20 @@ msgid "Cannot subclass slice" msgstr "sliceをサブクラス化することはできません" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "MOSIピンとMISOピンなしに転送できません" +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "使用中のタイマー上では周波数を変えられません" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "MOSIピンなしで書き込みできません" +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -800,10 +784,6 @@ msgstr "CircuitPythonのコアコードが激しくクラッシュしました msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPythonはヒープを確保できませんでした" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "クロックピン初期化に失敗" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "クロックのストレッチが長すぎ" @@ -812,11 +792,6 @@ msgstr "クロックのストレッチが長すぎ" msgid "Clock unit in use" msgstr "クロックユニットは使用中" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "commandは0から255の間の整数でなければなりません" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -827,35 +802,6 @@ msgstr "接続は切断済みでもう使えません。新しい接続を作成 msgid "Corrupt .mpy file" msgstr "破損した .mpy ファイル" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "カメラを初期化できません" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "GNSSを初期化できません" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "SDカードを初期化できません" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "UARTを初期化できません" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "チャネルを再初期化できません" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "タイマーを再初期化できません" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "PWMを再スタートできません" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -876,20 +822,6 @@ msgstr "割り込みをスタートできません。RXビジー" msgid "Couldn't allocate decoder" msgstr "デコーダを確保できません" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "1つ目のバッファを確保できません" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "入力バッファを確保できません" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "2つ目のバッファを確保できません" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "クラッシュしてHardFault_Handlerに入りました" @@ -937,10 +869,6 @@ msgstr "宛先バッファがdestination_lengthより小さい" msgid "Device in use" msgstr "デバイス使用中" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "指定されたピンはDigitalInOutに対応していません" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -952,6 +880,10 @@ msgstr "ディスプレイは16ビット色空間を持たなければなりま msgid "Display rotation must be in 90 degree increments" msgstr "ディスプレイの回転は90度の倍数でなければなりません" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "方向がinputのときドライブモードは使われません" @@ -987,18 +919,14 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "%qが必要" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" +msgid "Expected an %q" msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c @@ -1027,21 +955,9 @@ msgstr "コマンド送信に失敗" msgid "Failed to acquire mutex, err 0x%04x" msgstr "ミューテックスの取得に失敗。エラー 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "RXバッファの確保に失敗" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "%dバイトのRXバッファの確保に失敗" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1064,10 +980,6 @@ msgstr "接続失敗: 内部エラー" msgid "Failed to connect: timeout" msgstr "接続失敗: タイムアウト" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "MP3ファイルのパーズに失敗" @@ -1111,9 +1023,9 @@ msgstr "" msgid "Format not supported" msgstr "非対応の形式" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" #: shared-bindings/pwmio/PWMOut.c @@ -1125,7 +1037,11 @@ msgstr "このタイマーを使う既存のPWMOutと周波数を一致させる msgid "Function requires lock" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1152,19 +1068,16 @@ msgstr "ハードウェアビジー。代替のピンを試してください" msgid "Hardware in use, try alternative pins" msgstr "ハードウェア使用中。代わりのピンを試してください" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "閉じられたファイルへのI/O操作" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C初期化エラー" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1271,75 +1184,37 @@ msgstr "" msgid "Internal error #%d" msgstr "内部エラー #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "不正な %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "不正な%qピン" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "不正な%qピン選択" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "不正なADCユニット値" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "不正なBMPファイル" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "不正なBSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "不正なDACピンが与えられました" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "無効なPWM周波数" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "不正な引数" @@ -1347,42 +1222,11 @@ msgstr "不正な引数" msgid "Invalid bits per value" msgstr "不正なbits per value" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "不正なバッファサイズ" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "不正なバイトオーダー文字列" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "不正なキャプチャ周期。有効な周期は1-500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "不正なチャンネル数" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "不正な方向" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "不正なファイル" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "フォーマットチャンクのサイズが不正" @@ -1391,79 +1235,15 @@ msgstr "フォーマットチャンクのサイズが不正" msgid "Invalid memory access." msgstr "不正なメモリアクセス" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "不正なビット数" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "不正なphase" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "不正なピン" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "左チャネルのピンが不正" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "右チャネルのピンが不正" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "ピンが不正" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "不正な極性" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "不正なプロパティ" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "不正なrun mode" - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "不正なsecurity_mode" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1471,27 +1251,10 @@ msgstr "" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "不正なボイス" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "不正なボイス数" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "不正なwaveファイル" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "不正なワード/ビット長" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Keyの長さは、16, 24, 32バイトのいずれかでなければなりません" @@ -1505,24 +1268,16 @@ msgid "LHS of keyword arg must be an id" msgstr "キーワード引数の左辺には識別子が必要" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "レイヤはすでにグループに含まれています" - -#: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "レイヤはGroupかTileGridのサブクラスでなければなりません" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c -msgid "MAC address was invalid" +msgid "Layer already in a group" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISOピン初期化に失敗" +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSIピン初期化に失敗" +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +msgid "MAC address was invalid" +msgstr "" #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" @@ -1533,18 +1288,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "マイクのスタートアップディレイは 0.0 から 1.0 の間でなければなりません" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "MISOまたはMOSIピンがありません" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1580,11 +1344,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "%q のサブクラスでなければなりません" @@ -1610,6 +1369,10 @@ msgstr "" msgid "Name too long" msgstr "名前が長すぎます" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1640,16 +1403,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "MISOピンなし" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "MOSIピンがありません" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1688,16 +1463,6 @@ msgstr "使われていないGCLKがありません" msgid "No hardware random available" msgstr "利用可能なハードウェア乱数なし" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "clkピンにハードウェア対応がありません" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "ピンにハードウェア対応がありません" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1742,6 +1507,10 @@ msgstr "ピンにプルダウンがありません。1Mオーム推奨" msgid "No space left on device" msgstr "デバイスに空き容量が残っていません" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "指定されたファイル/ディレクトリはありません" @@ -1793,6 +1562,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "奇数パリティには対応していません" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1802,7 +1579,7 @@ msgstr "8または16ビットの " msgid "Only IPv4 addresses supported" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1835,15 +1612,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1851,19 +1632,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1871,11 +1656,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "オーバーサンプルは8の倍数でなければなりません" @@ -1884,17 +1664,15 @@ msgstr "オーバーサンプルは8の倍数でなければなりません" msgid "PDMIn not available" msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" -"PWMのduty_cycle値は0から65535の間でなければなりません(16ビット解像度)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "PWM周波数は生成時のvariable_frequencyがFalseのとき書き換え不可" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1911,29 +1689,14 @@ msgstr "" msgid "Permission denied" msgstr "パーミッション拒否" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "ピンにADCの能力がありません" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2000,18 +1763,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "方向がoutputのときpullは使われません" @@ -2033,8 +1788,9 @@ msgstr "RNG解体エラー" msgid "RNG Init Error" msgstr "乱数生成器の初期化エラー" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2042,21 +1798,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "このボードはRTCのキャリブレーションに非対応" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "このボードはRTCに対応していません" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS/CTS/RS485はこのデバイスでは未対応" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "乱数生成エラー" @@ -2074,10 +1819,14 @@ msgstr "読み込み専用のファイルシステム" msgid "Read-only object" msgstr "読み込み専用のオブジェクト" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "リフレッシュが早すぎます" @@ -2090,7 +1839,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "要求のAESモードは非対応" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2106,6 +1855,10 @@ msgstr "セーフモードで実行中! 保存されたコードは実行し msgid "SD card CSD format not supported" msgstr "SDカードのCSDフォーマットは非対応" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2116,30 +1869,21 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "SDIO初期化エラー %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI初期化エラー" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI再初期化エラー" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "サンプルレートは正数でなければなりません" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "サンプルレートは%d以下でなければなりません" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2159,14 +1903,6 @@ msgstr "シリアライザは使用中" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "サイズは対応していません" @@ -2202,10 +1938,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "スタックサイズは少なくとも256以上でなければなりません" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2291,10 +2023,6 @@ msgstr "タイルの高さはビットマップの高さを割り切れる値で msgid "Tile index out of bounds" msgstr "タイルのインデクスが範囲外" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "タイル値が範囲外" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "タイルの幅はビットマップの幅を割り切れる値でなければなりません" @@ -2314,6 +2042,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "サンプルのチャンネル数が多すぎます" @@ -2346,24 +2077,21 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UARTバッファの確保エラー" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART解放エラー" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UARTの初期化エラー" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UARTの再初期化エラー" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART書き込みエラー" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2500,12 +2228,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "非対応のbaudrate" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2518,9 +2240,9 @@ msgstr "" msgid "Unsupported format" msgstr "非対応の形式" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "非対応の操作" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2540,7 +2262,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2570,10 +2292,6 @@ msgstr "WatchDogTimer.modeはいったんWatchDogMode.RESETに設定すると変 msgid "WatchDogTimer.timeout must be greater than 0" msgstr "WatchDogTimer.timeoutは0以上でなければなりません" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2584,9 +2302,9 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFiパスワードは8〜63文字でなければなりません" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" #: main.c msgid "Woken up by alarm.\n" @@ -2626,11 +2344,11 @@ msgstr "__new__の引数はユーザ型でなければなりません" msgid "a bytes-like object is required" msgstr "bytes-likeオブジェクトが必要" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "アドレスが範囲外" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "" @@ -2679,6 +2397,10 @@ msgstr "引数はndarrayでなければなりません" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2740,10 +2462,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sampleは8または16でなければなりません" @@ -2781,11 +2499,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "byteorderが文字列ではありません" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2794,7 +2507,7 @@ msgstr "" msgid "bytes value out of range" msgstr "範囲外のバイト値" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "キャリブレーションが範囲外" @@ -2802,12 +2515,9 @@ msgstr "キャリブレーションが範囲外" msgid "calibration is read only" msgstr "calibrationは読み込み専用" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2830,7 +2540,7 @@ msgstr "式には代入できません" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "%qを%qに変換できません" @@ -2978,6 +2688,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -2990,10 +2704,6 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3060,6 +2770,10 @@ msgstr "convolve引数はndarrayでなければなりません" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "ヴァンデルモンド行列の逆行列を求められません" @@ -3145,10 +2859,6 @@ msgstr "" msgid "division by zero" msgstr "ゼロ除算 (division by zero)" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3157,6 +2867,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3186,6 +2900,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "error = 0x1%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "例外はBaseExceptionから派生していなければなりません" @@ -3260,7 +2980,7 @@ msgstr "1つ目の引数は関数でなければなりません" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "1つ目の引数はndarrayでなければなりません" @@ -3296,6 +3016,10 @@ msgstr "fontは2048バイト長でなければなりません" msgid "format requires a dict" msgstr "formatにはdictが必要" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" @@ -3404,7 +3128,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3423,6 +3147,10 @@ msgid "indices must be integers, slices, or Boolean lists" msgstr "" "インデクスは、整数、スライス、boolのリストのいずれかでなければなりません" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3468,6 +3196,10 @@ msgstr "入力行列が非対称" msgid "input matrix is singular" msgstr "入力が非正則行列" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3476,11 +3208,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3560,6 +3288,10 @@ msgstr "不正なホスト名" msgid "invalid micropython decorator" msgstr "不正なmicropythonデコレータ" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "不正なステップ" @@ -3673,10 +3405,6 @@ msgstr "定義域エラー" msgid "matrix is not positive definite" msgstr "正定値行列ではありません" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3684,12 +3412,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3823,7 +3547,7 @@ msgstr "利用可能なリセットピンがありません" msgid "no response from SD card" msgstr "SDカードからの応答がありません" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "指定の属性はありません" @@ -3934,7 +3658,11 @@ msgstr "" msgid "odd-length string" msgstr "奇数長の文字列" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4060,10 +3788,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4089,63 +3813,23 @@ msgstr "pow()の3つ目の引数は0にできません" msgid "pow() with 3 arguments requires integers" msgstr "pow()の第3引数には整数が必要" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4165,14 +3849,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "キューがオーバーフローしました" @@ -4224,13 +3900,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"sample_source バッファには bytearray または 'h','H','b','B'型のarrayが必要" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4328,10 +3997,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" @@ -4344,10 +4009,6 @@ msgstr "" msgid "step must be non-zero" msgstr "stepは非ゼロ値でなければなりません" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stopは1または2のいずれか" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4396,10 +4057,6 @@ msgstr "uctypedディスクリプタの構文エラー" msgid "threshold must be in the range 0-65536" msgstr "threshouldは0から65536まで" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time()は9要素のシーケンスを受け取ります" @@ -4419,10 +4076,6 @@ msgstr "timeoutは0.0〜100.0秒でなければなりません" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "timeoutは0.0以上でなければなりません" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "v1カードの待機がタイムアウト" @@ -4431,6 +4084,10 @@ msgstr "v1カードの待機がタイムアウト" msgid "timeout waiting for v2 card" msgstr "v2カードの待機がタイムアウトしました" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestampがプラットフォームのtime_tの範囲外" @@ -4601,6 +4258,14 @@ msgstr "演算子が対応していない型" msgid "unsupported types for %q: '%q', '%q'" msgstr "%q が対応していない型: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4622,13 +4287,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "watchdogのtimeoutは0以上でなければなりません" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4648,7 +4307,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "インデクスの型が不正" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4656,6 +4325,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -4700,6 +4373,257 @@ msgstr "ziはfloat値でなければなりません" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "sample_source バッファには bytearray または 'h','H','b','B'型のarrayが必要" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%qは長さ2のタプルでなければなりません" + +#~ msgid "%q should be an int" +#~ msgstr "%qはint型でなければなりません" + +#~ msgid "Address type out of range" +#~ msgstr "address_typeが範囲外" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "指定のピンはAnalogInに対応していません" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut機能に対応していません" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOutは16ビットです。値は65536以下でなければなりません" + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "指定のピンはAnalogOutに対応していません" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "バッファサイズが不正です。%dバイトでなければなりません" + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "バッファ長は少なくとも1以上でなければなりません" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "バイト値は0から255の間でなければなりません" + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "同じピン上の両チャネルに出力できません" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "MISOピンなしで読み込めません" + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "ブートローダが存在しないためブートローダへとリセットできません" + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "MOSIピンとMISOピンなしに転送できません" + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "MOSIピンなしで書き込みできません" + +#~ msgid "Clock pin init failed." +#~ msgstr "クロックピン初期化に失敗" + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "commandは0から255の間の整数でなければなりません" + +#~ msgid "Could not initialize Camera" +#~ msgstr "カメラを初期化できません" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "GNSSを初期化できません" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "SDカードを初期化できません" + +#~ msgid "Could not initialize UART" +#~ msgstr "UARTを初期化できません" + +#~ msgid "Could not re-init channel" +#~ msgstr "チャネルを再初期化できません" + +#~ msgid "Could not re-init timer" +#~ msgstr "タイマーを再初期化できません" + +#~ msgid "Could not restart PWM" +#~ msgstr "PWMを再スタートできません" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "1つ目のバッファを確保できません" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "入力バッファを確保できません" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "2つ目のバッファを確保できません" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "指定されたピンはDigitalInOutに対応していません" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "RXバッファの確保に失敗" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "%dバイトのRXバッファの確保に失敗" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C初期化エラー" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "不正な%qピン選択" + +#~ msgid "Invalid BMP file" +#~ msgstr "不正なBMPファイル" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "不正なDACピンが与えられました" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "無効なPWM周波数" + +#~ msgid "Invalid buffer size" +#~ msgstr "不正なバッファサイズ" + +#~ msgid "Invalid byteorder string" +#~ msgstr "不正なバイトオーダー文字列" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "不正なキャプチャ周期。有効な周期は1-500" + +#~ msgid "Invalid channel count" +#~ msgstr "不正なチャンネル数" + +#~ msgid "Invalid direction." +#~ msgstr "不正な方向" + +#~ msgid "Invalid file" +#~ msgstr "不正なファイル" + +#~ msgid "Invalid number of bits" +#~ msgstr "不正なビット数" + +#~ msgid "Invalid phase" +#~ msgstr "不正なphase" + +#~ msgid "Invalid pin" +#~ msgstr "不正なピン" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "左チャネルのピンが不正" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "右チャネルのピンが不正" + +#~ msgid "Invalid polarity" +#~ msgstr "不正な極性" + +#~ msgid "Invalid properties" +#~ msgstr "不正なプロパティ" + +#~ msgid "Invalid run mode." +#~ msgstr "不正なrun mode" + +#~ msgid "Invalid security_mode" +#~ msgstr "不正なsecurity_mode" + +#~ msgid "Invalid voice" +#~ msgstr "不正なボイス" + +#~ msgid "Invalid voice count" +#~ msgstr "不正なボイス数" + +#~ msgid "Invalid wave file" +#~ msgstr "不正なwaveファイル" + +#~ msgid "Invalid word/bit length" +#~ msgstr "不正なワード/ビット長" + +#~ msgid "Layer already in a group." +#~ msgstr "レイヤはすでにグループに含まれています" + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "レイヤはGroupかTileGridのサブクラスでなければなりません" + +#~ msgid "MISO pin init failed." +#~ msgstr "MISOピン初期化に失敗" + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSIピン初期化に失敗" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "clkピンにハードウェア対応がありません" + +#~ msgid "No hardware support on pin" +#~ msgstr "ピンにハードウェア対応がありません" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "PWMのduty_cycle値は0から65535の間でなければなりません(16ビット解像度)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "ピンにADCの能力がありません" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "このボードはRTCのキャリブレーションに非対応" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485はこのデバイスでは未対応" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI初期化エラー" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI再初期化エラー" + +#~ msgid "Sample rate must be positive" +#~ msgstr "サンプルレートは正数でなければなりません" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "サンプルレートは%d以下でなければなりません" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "スタックサイズは少なくとも256以上でなければなりません" + +#~ msgid "Tile value out of bounds" +#~ msgstr "タイル値が範囲外" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UARTバッファの確保エラー" + +#~ msgid "UART De-init error" +#~ msgstr "UART解放エラー" + +#~ msgid "UART Init Error" +#~ msgstr "UARTの初期化エラー" + +#~ msgid "UART Re-init error" +#~ msgstr "UARTの再初期化エラー" + +#~ msgid "UART write error" +#~ msgstr "UART書き込みエラー" + +#~ msgid "Unsupported baudrate" +#~ msgstr "非対応のbaudrate" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFiパスワードは8〜63文字でなければなりません" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stopは1または2のいずれか" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeoutは0.0以上でなければなりません" + +#~ msgid "Unsupported operation" +#~ msgstr "非対応の操作" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Brightnessは0から255の間でなければなりません" @@ -4997,9 +4921,6 @@ msgstr "" #~ msgid "wrong argument type" #~ msgstr "引数の型が不正" -#~ msgid "wrong index type" -#~ msgstr "インデクスの型が不正" - #~ msgid "Must provide SCK pin" #~ msgstr "SCKピンが必要" diff --git a/locale/ko.po b/locale/ko.po index 9ebbf36eb1..aa3d738f01 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -67,10 +67,27 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -83,12 +100,7 @@ msgstr "" msgid "%q in use" msgstr "%q 사용 중입니다" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q 인덱스 범위를 벗어났습니다" @@ -96,18 +108,42 @@ msgstr "%q 인덱스 범위를 벗어났습니다" msgid "%q indices must be integers, not %s" msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -116,29 +152,25 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q 는 >=1이어야합니다" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -157,7 +189,11 @@ msgstr "" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "" @@ -166,10 +202,6 @@ msgstr "" msgid "%q pin invalid" msgstr "" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q 는 정수(int) 여야합니다" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -182,7 +214,11 @@ msgstr "" msgid "%q, %q, and %q must all be the same length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -332,10 +368,6 @@ msgstr "" msgid "'yield' outside function" msgstr "'yield' 는 함수 외부에 존재합니다" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -371,16 +403,12 @@ msgstr "" msgid "Address must be %d bytes long" msgstr "" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "사용중인 모든 I2C주변 기기" @@ -417,7 +445,6 @@ msgstr "" msgid "All event channels in use" msgstr "" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -465,25 +492,6 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "" - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -522,7 +530,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "" @@ -555,11 +563,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "" @@ -601,11 +604,6 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "잘못된 크기의 버퍼. %d 바이트 여야합니다." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -615,7 +613,6 @@ msgstr "" msgid "Buffer is too small" msgstr "" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -626,14 +623,10 @@ msgstr "" msgid "Buffer length must be a multiple of 512" msgstr "" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "잘못된 크기의 버퍼. >1 여야합니다" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -655,10 +648,6 @@ msgstr "" msgid "Byte buffer must be 16 bytes." msgstr "잘못된 크기의 버퍼. 16 바이트 여야합니다." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "바이트는 0에서 255 사이 여야합니다." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "" @@ -667,7 +656,7 @@ msgstr "" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -675,6 +664,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -722,18 +715,10 @@ msgstr "온도 데이터를 수신 할 수 없습니다" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "MISO핀이 없으면 읽을 수 없습니다" - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "파일에 녹음 할 수 없습니다" @@ -745,7 +730,7 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -766,20 +751,19 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -794,10 +778,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -806,11 +786,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "명령은 0에서 255 사이의 정수(int) 여야합니다" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -821,35 +796,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -870,20 +816,6 @@ msgstr "" msgid "Couldn't allocate decoder" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -931,10 +863,6 @@ msgstr "" msgid "Device in use" msgstr "" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -946,6 +874,10 @@ msgstr "" msgid "Display rotation must be in 90 degree increments" msgstr "" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "" @@ -981,18 +913,14 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "%q 이 예상되었습니다." #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" +msgid "Expected an %q" msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c @@ -1021,20 +949,8 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" msgstr "" #: ports/espressif/common-hal/wifi/__init__.c @@ -1058,10 +974,6 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -1105,9 +1017,9 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" #: shared-bindings/pwmio/PWMOut.c @@ -1119,7 +1031,11 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1146,19 +1062,16 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1263,75 +1176,37 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1339,42 +1214,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "파일이 유효하지 않습니다" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "형식 청크 크기가 잘못되었습니다" @@ -1383,79 +1227,15 @@ msgstr "형식 청크 크기가 잘못되었습니다" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "비트 수가 유효하지 않습니다" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "단계가 잘못되었습니다" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "핀이 잘못되었습니다" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "왼쪽 채널 핀이 유효하지 않습니다" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "오른쪽 채널 핀이 잘못되었습니다" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "핀이 유효하지 않습니다" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "" - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1463,27 +1243,10 @@ msgstr "" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1497,25 +1260,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1525,18 +1280,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1572,11 +1336,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1602,6 +1361,10 @@ msgstr "" msgid "Name too long" msgstr "" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1632,16 +1395,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" -#: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c -msgid "No MISO Pin" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1680,16 +1455,6 @@ msgstr "" msgid "No hardware random available" msgstr "" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1734,6 +1499,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1783,6 +1552,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1792,7 +1569,7 @@ msgstr "" msgid "Only IPv4 addresses supported" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1825,15 +1602,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1841,19 +1622,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1861,11 +1646,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1876,12 +1656,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1900,29 +1679,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -1989,18 +1753,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2022,8 +1778,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2031,21 +1788,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "" @@ -2063,10 +1809,14 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "" @@ -2079,7 +1829,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2095,6 +1845,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2105,29 +1859,20 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2148,14 +1893,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2191,10 +1928,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2280,10 +2013,6 @@ msgstr "" msgid "Tile index out of bounds" msgstr "" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "" @@ -2303,6 +2032,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2335,23 +2067,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2489,12 +2218,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2507,8 +2230,8 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c @@ -2529,7 +2252,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2559,10 +2282,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2573,8 +2292,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2615,11 +2334,11 @@ msgstr "" msgid "a bytes-like object is required" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "" @@ -2668,6 +2387,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2729,10 +2452,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample은 8 또는 16이어야합니다." @@ -2770,11 +2489,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2783,7 +2497,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2791,12 +2505,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2819,7 +2530,7 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -2967,6 +2678,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -2979,10 +2694,6 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3047,6 +2758,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3130,10 +2845,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3142,6 +2853,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3171,6 +2886,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "" @@ -3245,7 +2966,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3281,6 +3002,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "완전한(full)" @@ -3389,7 +3114,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3407,6 +3132,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3452,6 +3181,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3460,11 +3193,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3544,6 +3273,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "단계(step)가 유효하지 않습니다" @@ -3657,10 +3390,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3668,12 +3397,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3807,7 +3532,7 @@ msgstr "" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "" @@ -3918,7 +3643,11 @@ msgstr "" msgid "odd-length string" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4042,10 +3771,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4071,63 +3796,23 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4147,14 +3832,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4206,12 +3883,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4309,10 +3980,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" @@ -4325,10 +3992,6 @@ msgstr "" msgid "step must be non-zero" msgstr "" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4377,10 +4040,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4400,10 +4059,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4412,6 +4067,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4582,6 +4241,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4603,13 +4270,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4629,7 +4290,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4637,6 +4308,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -4681,6 +4356,43 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "%q should be an int" +#~ msgstr "%q 는 정수(int) 여야합니다" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "잘못된 크기의 버퍼. %d 바이트 여야합니다." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "잘못된 크기의 버퍼. >1 여야합니다" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "바이트는 0에서 255 사이 여야합니다." + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "MISO핀이 없으면 읽을 수 없습니다" + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "명령은 0에서 255 사이의 정수(int) 여야합니다" + +#~ msgid "Invalid file" +#~ msgstr "파일이 유효하지 않습니다" + +#~ msgid "Invalid number of bits" +#~ msgstr "비트 수가 유효하지 않습니다" + +#~ msgid "Invalid phase" +#~ msgstr "단계가 잘못되었습니다" + +#~ msgid "Invalid pin" +#~ msgstr "핀이 잘못되었습니다" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "왼쪽 채널 핀이 유효하지 않습니다" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "오른쪽 채널 핀이 잘못되었습니다" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "밝기는 0에서 255 사이 여야합니다" diff --git a/locale/nl.po b/locale/nl.po index 098bb276ba..76577117fa 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -69,10 +69,27 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -85,12 +102,7 @@ msgstr "%q fout: %d" msgid "%q in use" msgstr "%q in gebruik" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q index buiten bereik" @@ -98,18 +110,42 @@ msgstr "%q index buiten bereik" msgid "%q indices must be integers, not %s" msgstr "%q indexen moeten integers zijn, niet %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -118,29 +154,25 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q moet >= 0 zijn" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q moet >= 1 zijn" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q moet een tuple van lengte 2 zijn" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -159,7 +191,11 @@ msgstr "" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q buiten bereik" @@ -168,10 +204,6 @@ msgstr "%q buiten bereik" msgid "%q pin invalid" msgstr "%q pin onjuist" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q moet een int zijn" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -184,7 +216,11 @@ msgstr "%q() verwacht %d positionele argumenten maar kreeg %d" msgid "%q, %q, and %q must all be the same length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -334,10 +370,6 @@ msgstr "'yield from' binnen asynchrone functie" msgid "'yield' outside function" msgstr "'yield' buiten de functie" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x moet een assignment target zijn" @@ -373,16 +405,12 @@ msgstr "ADC2 wordt gebruikt door WiFi" msgid "Address must be %d bytes long" msgstr "Adres moet %d bytes lang zijn" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Adres type buiten bereik" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Alle CAN-peripherals zijn in gebruik" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" @@ -419,7 +447,6 @@ msgstr "" msgid "All event channels in use" msgstr "Alle event kanalen zijn in gebruik" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -467,25 +494,6 @@ msgstr "Wordt al uitgevoerd" msgid "Already scanning for wifi networks" msgstr "Zoekt al naar WiFi netwerken" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn niet ondersteund door gegeven pin" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut functionaliteit niet ondersteund" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut is slechts 16 bits. Waarde moet minder dan 65536 zijn." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut niet ondersteund door gegeven pin" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -524,7 +532,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Authenticatiefout" @@ -557,11 +565,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "Bit clock en word select moeten een clock eenheid delen" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bitdiepte moet tussen 1 en 6 liggen, niet %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bit diepte moet een meervoud van 8 zijn." @@ -603,11 +606,6 @@ msgstr "Buffer + offset te klein %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Buffer heeft incorrect grootte. Moet %d bytes zijn." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffer is geen bytearray." @@ -617,7 +615,6 @@ msgstr "Buffer is geen bytearray." msgid "Buffer is too small" msgstr "Buffer is te klein" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -628,14 +625,10 @@ msgstr "Buffer lengte %d te groot. Het moet kleiner zijn dan %d" msgid "Buffer length must be a multiple of 512" msgstr "Buffer lengte moet een veelvoud van 512 zijn" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "Buffer moet een veelvoud van 512 bytes zijn" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Buffer moet op zijn minst lengte 1 zijn" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -657,10 +650,6 @@ msgstr "Bus pin %d al in gebruik" msgid "Byte buffer must be 16 bytes." msgstr "Byte buffer moet 16 bytes zijn." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes moeten tussen 0 en 255 liggen." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC blocks moeten meervouden van 16 bytes zijn" @@ -669,7 +658,7 @@ msgstr "CBC blocks moeten meervouden van 16 bytes zijn" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -677,6 +666,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "Roep super().__init__() aan voor toegang native object." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -725,18 +718,10 @@ msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" "Kan geen scan responses voor extended, connectable advertisements hebben." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Output van beide kanalen kan niet op dezelfde pin" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Kan niet lezen zonder MISO pin." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Kan niet opnemen naar een bestand" @@ -748,9 +733,8 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" -"Kan niet resetten naar bootloader omdat er geen bootloader aanwezig is." #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -770,21 +754,20 @@ msgid "Cannot subclass slice" msgstr "Kan slice niet subclasseren" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Kan niet overdragen zonder MOSI en MISO pinnen." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Kan de frequentie van een timer die al in gebruik is niet variëren" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Kan niet schrijven zonder MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -798,10 +781,6 @@ msgstr "CircuitPython core code is hard gecrashed. Ojee!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython kon het heap geheugen niet toewijzen." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Clock pin init mislukt." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Clock stretch is te lang" @@ -810,11 +789,6 @@ msgstr "Clock stretch is te lang" msgid "Clock unit in use" msgstr "Clock unit in gebruik" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Command moet een int tussen 0 en 255 zijn" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -827,35 +801,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Corrupt .mpy bestand" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Kon camera niet initialiseren" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Kan GNSS niet initialiseren" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Kan SDCard niet initialiseren" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Kan UART niet initialiseren" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Kan kanaal niet her-initialiseren" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Kan timer niet her-initialiseren" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Kan PWM niet herstarten" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Kon klok niet ophalen" @@ -876,20 +821,6 @@ msgstr "Kan interrupt niet starten, RX is bezig" msgid "Couldn't allocate decoder" msgstr "Kan decoder niet alloceren" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Kan eerste buffer niet alloceren" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Kan input buffer niet alloceren" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Kan tweede buffer niet alloceren" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Crash naar de HardFault_Handler." @@ -937,10 +868,6 @@ msgstr "Bestemming grootte is kleiner dan destination_length." msgid "Device in use" msgstr "Apparaat al in gebruik" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut niet ondersteund door gegeven pin" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -952,6 +879,10 @@ msgstr "Beeldscherm moet een 16bit kleurruimte hebben." msgid "Display rotation must be in 90 degree increments" msgstr "Beeldscherm rotatie moet in stappen van 90 graden" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "Drive modus niet gebruikt als de richting input is." @@ -987,19 +918,15 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Verwacht een %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "Verwachtte een alarm" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Verwachtte een tuple met lengte %d, maar kreeg %d" +msgid "Expected an %q" +msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1027,21 +954,9 @@ msgstr "Commando verzenden mislukt." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Fout tijdens verkrijgen mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "RX buffer alloceren mislukt" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Mislukt een RX buffer van %d bytes te alloceren" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1064,10 +979,6 @@ msgstr "Verbinding mislukt: interne fout" msgid "Failed to connect: timeout" msgstr "Verbinding mislukt: timeout" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "Kon WiFi niet initialiseren" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Mislukt om MP3 bestand te ontleden" @@ -1111,10 +1022,10 @@ msgstr "" msgid "Format not supported" msgstr "Formaat wordt niet ondersteund" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Framebuffer benodigd %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1126,7 +1037,11 @@ msgstr "" msgid "Function requires lock" msgstr "Functie vereist lock" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1153,19 +1068,16 @@ msgstr "Hardware bezig, probeer alternatieve pinnen" msgid "Hardware in use, try alternative pins" msgstr "Hardware in gebruik, probeer alternatieve pinnen" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "Hostnaam moet tussen 1 en 253 karakters zijn" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O actie op gesloten bestand" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C Init Fout" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1272,75 +1184,37 @@ msgstr "" msgid "Internal error #%d" msgstr "Interne fout #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "Ongeldige %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Ongeldige %q pin" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Ongeldige %q pin selectie" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Ongeldige ADC Unit waarde" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Ongeldig BMP bestand" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Ongeldig BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Ongeldige DAC pin opgegeven" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Ongeldige PWM frequentie" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Ongeldige Pin" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Ongeldig argument" @@ -1348,42 +1222,11 @@ msgstr "Ongeldig argument" msgid "Invalid bits per value" msgstr "Ongeldige bits per waarde" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Ongeldige buffer grootte" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Ongeldige byteorder string" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Ongeldige vastlegging periode. Geldig bereik: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Ongeldige kanaal aantallen" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Ongeldige richting." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Ongeldig bestand" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ongeldig formaat stuk grootte" @@ -1392,79 +1235,15 @@ msgstr "Ongeldig formaat stuk grootte" msgid "Invalid memory access." msgstr "Ongeldig geheugen adres." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Ongeldig aantal bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Ongeldige fase" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Ongeldige pin" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Ongeldige pin voor linker kanaal" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Ongeldige pin voor rechter kanaal" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Ongeldige pinnen" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Ongeldige polariteit" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Ongeldige eigenschappen" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Ongeldige run modus." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Ongeldige security_mode" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1472,27 +1251,10 @@ msgstr "" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Ongeldige stem" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Ongeldig stem aantal" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Ongeldig wave bestand" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Ongeldig woord/bit lengte" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Sleutel moet 16, 24, of 32 bytes lang zijn" @@ -1506,24 +1268,16 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS van sleutelwoord arg moet een id zijn" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Laag al in groep." - -#: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Laag moet een Groep of TileGrid subklasse zijn." - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c -msgid "MAC address was invalid" +msgid "Layer already in a group" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISO pin init mislukt." +#: shared-module/displayio/Group.c +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSI pin init mislukt." +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +msgid "MAC address was invalid" +msgstr "" #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" @@ -1534,18 +1288,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "Maximale x waarde indien gespiegeld is %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Berichten zijn beperkt tot 8 bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Microfoon opstart vertraging moet in bereik van 0.0 tot 1.0 zijn" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Ontbrekende MISO of MOSI Pin" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1581,11 +1344,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "%q moet een subklasse zijn." @@ -1611,6 +1369,10 @@ msgstr "NVS-fout" msgid "Name too long" msgstr "Naam te lang" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1641,16 +1403,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Geen MISO pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Geen MOSI pin" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1689,16 +1463,6 @@ msgstr "Geen vrije GCLKs" msgid "No hardware random available" msgstr "Geen hardware random beschikbaar" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Geen hardware ondersteuning beschikbaar op clk pin" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Geen hardware ondersteuning op pin" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1743,6 +1507,10 @@ msgstr "Geen pulldown op pin; 1MOhm aangeraden" msgid "No space left on device" msgstr "Geen ruimte meer beschikbaar op apparaat" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Bestand/map bestaat niet" @@ -1794,6 +1562,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Oneven pariteit is niet ondersteund" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1803,7 +1579,7 @@ msgstr "Alleen 8 of 16 bit mono met " msgid "Only IPv4 addresses supported" msgstr "Alleen IPv4 adressen worden ondersteund" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "Alleen IPv4-sockets ondersteund" @@ -1840,15 +1616,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Slechts één alarm.time alarm kan worden ingesteld." @@ -1856,19 +1636,23 @@ msgstr "Slechts één alarm.time alarm kan worden ingesteld." msgid "Only one color can be transparent at a time" msgstr "Er kan maar één kleur per keer transparant zijn" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "Geen sockets meer beschikbaar" @@ -1876,11 +1660,6 @@ msgstr "Geen sockets meer beschikbaar" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Oversample moet een meervoud van 8 zijn." @@ -1889,12 +1668,6 @@ msgstr "Oversample moet een meervoud van 8 zijn." msgid "PDMIn not available" msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" -"PWM duty_cycle moet tussen 0 en 65535 inclusief zijn (16 bit resolutie)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1902,6 +1675,10 @@ msgstr "" "PWM frequentie is niet schrijfbaar wanneer de variable_frequency False is " "tijdens constructie." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1918,29 +1695,14 @@ msgstr "" msgid "Permission denied" msgstr "Toegang geweigerd" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin heeft geen ADC mogelijkheden" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2012,18 +1774,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull niet gebruikt wanneer de richting output is." @@ -2045,8 +1799,9 @@ msgstr "RNG DeInit Fout" msgid "RNG Init Error" msgstr "RNG Init Fout" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2054,21 +1809,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "RS485 inversie gespecificeerd terwijl niet in RS485 modus" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "RTC calibratie niet ondersteund door dit board" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC is niet ondersteund door dit board" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS/CTS/RS485 Nog niet ondersteund door dit apparaat" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Random number generatie fout" @@ -2086,10 +1830,14 @@ msgstr "Alleen-lezen bestandssysteem" msgid "Read-only object" msgstr "Alleen-lezen object" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "Verversing te snel" @@ -2102,7 +1850,7 @@ msgstr "RemoteTransmissionRequests is beperkt tot 8 bytes" msgid "Requested AES mode is unsupported" msgstr "Gevraagde AES modus is niet ondersteund" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2118,6 +1866,10 @@ msgstr "Draaiende in veilige modus! Opgeslagen code wordt niet uitgevoerd.\n" msgid "SD card CSD format not supported" msgstr "SD kaart CSD formaat niet ondersteund" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2128,30 +1880,21 @@ msgstr "SDIO GetCardInfo Fout %d" msgid "SDIO Init Error %d" msgstr "SDIO Init Fout %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI Init Fout" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI Herinitialisatie Fout" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Sample rate moet positief zijn" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Sample rate is te hoog. Moet minder dan %d zijn" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2171,14 +1914,6 @@ msgstr "Serializer in gebruik" msgid "Server side context cannot have hostname" msgstr "Context aan de serverkant kan geen hostnaam hebben" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Afmeting niet ondersteund" @@ -2214,10 +1949,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Splitting met sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Stack grootte moet op zijn minst 256 zijn" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2303,10 +2034,6 @@ msgstr "Tile hoogte moet exact de bitmap hoogte verdelen" msgid "Tile index out of bounds" msgstr "Tile index buiten bereik" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Tile waarde buiten bereik" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Tile breedte moet exact de bitmap breedte verdelen" @@ -2326,6 +2053,9 @@ msgid "To exit, please reset the board without " msgstr "Om te beëindigen, reset het bord zonder " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Teveel kanalen in sample." @@ -2358,24 +2088,21 @@ msgid "Tuple or struct_time argument required" msgstr "Tuple of struct_time argument vereist" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART Buffer allocatie fout" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART De-init fout" +msgid "UART re-init" +msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART Init Fout" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART Re-init Fout" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART schrijf fout" +msgid "UART write" +msgstr "" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2513,12 +2240,6 @@ msgstr "" "Ongespecificeerd probleem. Kan zijn dat de pariteit prompt op het andere " "apparaat geweigerd of genegeerd werd." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Niet-ondersteunde baudsnelheid" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2531,9 +2252,9 @@ msgstr "Niet-ondersteund beeldscherm bus type" msgid "Unsupported format" msgstr "Niet-ondersteunde format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Niet-ondersteunde operatie" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2553,7 +2274,7 @@ msgstr "Waarde lengte != vereist vaste lengte" msgid "Value length > max_length" msgstr "Waarde length > max_length" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2587,10 +2308,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "WatchDogTimer.timeout moet groter dan 0 zijn" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "Watchdog-timer verstreken." - #: py/builtinhelp.c #, c-format msgid "" @@ -2601,9 +2318,9 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFi wachtwoord moet tussen 8 en 63 karakters bevatten" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "" #: main.c msgid "Woken up by alarm.\n" @@ -2643,11 +2360,11 @@ msgstr "__new__ arg moet een user-type zijn" msgid "a bytes-like object is required" msgstr "een bytes-achtig object is vereist" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "adres buiten bereik" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "adressen zijn leeg" @@ -2696,6 +2413,10 @@ msgstr "argumenten moeten ndarrays zijn" msgid "array and index length must be equal" msgstr "array en indexlengte moeten gelijk zijn" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2757,10 +2478,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample moet 8 of 16 zijn" @@ -2798,11 +2515,6 @@ msgstr "buffer te klein voor gevraagde bytes" msgid "byteorder is not a string" msgstr "byteorder is geen string" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "butes > 8 niet ondersteund" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "bytes lengte is geen veelvoud van itemgrootte" @@ -2811,7 +2523,7 @@ msgstr "bytes lengte is geen veelvoud van itemgrootte" msgid "bytes value out of range" msgstr "bytes waarde buiten bereik" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "calibration is buiten bereik" @@ -2819,12 +2531,9 @@ msgstr "calibration is buiten bereik" msgid "calibration is read only" msgstr "calibration is alleen-lezen" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "calibration waarde buiten bereik +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2848,7 +2557,7 @@ msgstr "kan niet toewijzen aan expressie" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "kan %q niet naar %q converteren" @@ -2996,6 +2705,10 @@ msgstr "" msgid "casting" msgstr "casting" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "chars buffer te klein" @@ -3008,11 +2721,6 @@ msgstr "chr() arg niet binnen bereik (0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg niet binnen bereik (256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" -"cirkel kan slechts bij één object van een hoger niveau worden geregistreerd" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3077,6 +2785,10 @@ msgstr "convolutie argumenten moeten ndarrays zijn" msgid "convolve arguments must not be empty" msgstr "convolutie argumenten mogen niet leeg zijn" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "kon de Vandermonde matrix niet omkeren" @@ -3162,10 +2874,6 @@ msgstr "" msgid "division by zero" msgstr "deling door nul" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3174,6 +2882,10 @@ msgstr "" msgid "empty" msgstr "leeg" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "lege heap" @@ -3203,6 +2915,12 @@ msgstr "epoch_time niet ondersteund op dit bord" msgid "error = 0x%08lX" msgstr "fout = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "uitzonderingen moeten afleiden van BaseException" @@ -3277,7 +2995,7 @@ msgstr "eerste argument moet een functie zijn" msgid "first argument must be a tuple of ndarrays" msgstr "eerste argument moet een tupel van ndarrays zijn" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "eerst argument moet een ndarray zijn" @@ -3313,6 +3031,10 @@ msgstr "lettertype moet 2048 bytes lang zijn" msgid "format requires a dict" msgstr "format vereist een dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "vol" @@ -3422,7 +3144,7 @@ msgstr "incomplete formaatsleutel" msgid "incorrect padding" msgstr "vulling (padding) is onjuist" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "index is buiten bereik" @@ -3440,6 +3162,10 @@ msgstr "indices moeten integers zijn" msgid "indices must be integers, slices, or Boolean lists" msgstr "indices moeten integers, segmenten (slices) of Boolean lijsten zijn" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "oorspronkelijke waarden moeten itereerbaar zijn" @@ -3485,6 +3211,10 @@ msgstr "invoermatrix is asymmetrisch" msgid "input matrix is singular" msgstr "invoermatrix is singulier" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3493,11 +3223,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "invoer moet een gesloten ndarray zijn" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "invoer moet een tensor van rang 2 zijn" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "invoer moet een ndarray zijn" @@ -3577,6 +3303,10 @@ msgstr "onjuiste hostnaam" msgid "invalid micropython decorator" msgstr "ongeldige micropython decorator" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "ongeldige stap" @@ -3693,10 +3423,6 @@ msgstr "fout in het wiskundig domein (math domain error)" msgid "matrix is not positive definite" msgstr "matrix is niet positief-definiet" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3704,13 +3430,9 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length moet 0-%d zijn als fixed_length %s is" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "maximaal aantal dimensies is 4" +msgid "maximum number of dimensions is " +msgstr "" #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3843,7 +3565,7 @@ msgstr "geen reset pin beschikbaar" msgid "no response from SD card" msgstr "geen antwoord van SD kaart" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "niet zo'n attribuut" @@ -3954,7 +3676,11 @@ msgstr "object met buffer protocol vereist" msgid "odd-length string" msgstr "string met oneven lengte" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "compensatie is te groot" @@ -4078,11 +3804,6 @@ msgstr "pixel_shader moet displayio.Palette of displayio.ColorConverter zijn" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" -"polygoon kan slechts bij één object van een hoger niveau worden geregistreerd" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop van een lege PulseIn" @@ -4108,63 +3829,23 @@ msgstr "derde argument van pow() mag geen 0 zijn" msgid "pow() with 3 arguments requires integers" msgstr "pow() met 3 argumenten vereist integers" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "druk bootknop in bij opstarten.\n" @@ -4184,14 +3865,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "wachtrij overloop" @@ -4243,14 +3916,6 @@ msgstr "roll argument moet een ndarray zijn" msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"sample_source buffer moet een bytearray of array van type 'h', 'H', 'b' of " -"'B' zijn" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4348,10 +4013,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "start/stop indices" @@ -4364,10 +4025,6 @@ msgstr "start_x moet een int zijn" msgid "step must be non-zero" msgstr "step mag geen nul zijn" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop moet 1 of 2 zijn" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop is niet bereikbaar vanaf start" @@ -4416,10 +4073,6 @@ msgstr "syntaxisfout in uctypes aanduiding" msgid "threshold must be in the range 0-65536" msgstr "drempelwaarde moet in het bereik 0-65536 liggen" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() accepteert een 9-rij" @@ -4439,10 +4092,6 @@ msgstr "timeout moet tussen 0.0 en 100.0 seconden zijn" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "timeout moet groter dan 0.0 zijn" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "timeout bij wachten op v1 kaart" @@ -4451,6 +4100,10 @@ msgstr "timeout bij wachten op v1 kaart" msgid "timeout waiting for v2 card" msgstr "timeout bij wachten op v2 kaart" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp buiten bereik voor platform time_t" @@ -4621,6 +4274,14 @@ msgstr "niet ondersteund type voor operator" msgid "unsupported types for %q: '%q', '%q'" msgstr "niet ondersteunde types voor %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4642,13 +4303,7 @@ msgstr "watchdog niet geïnitialiseerd" msgid "watchdog timeout must be greater than 0" msgstr "watchdog time-out moet groter zijn dan 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "breedte moet groter dan nul zijn" @@ -4668,7 +4323,17 @@ msgstr "foute index voor as" msgid "wrong axis specified" msgstr "onjuiste as gespecificeerd" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "onjuist indextype" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "onjuist invoertype" @@ -4676,6 +4341,10 @@ msgstr "onjuist invoertype" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "onjuist aantal argumenten" @@ -4720,6 +4389,311 @@ 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 "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "sample_source buffer moet een bytearray of array van type 'h', 'H', 'b' " +#~ "of 'B' zijn" + +#~ msgid "Expected an alarm" +#~ msgstr "Verwachtte een alarm" + +#~ msgid "Failed to init wifi" +#~ msgstr "Kon WiFi niet initialiseren" + +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "invoer moet een tensor van rang 2 zijn" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "maximaal aantal dimensies is 4" + +#~ msgid "Watchdog timer expired." +#~ msgstr "Watchdog-timer verstreken." + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q moet een tuple van lengte 2 zijn" + +#~ msgid "%q should be an int" +#~ msgstr "%q moet een int zijn" + +#~ msgid "Address type out of range" +#~ msgstr "Adres type buiten bereik" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn niet ondersteund door gegeven pin" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut functionaliteit niet ondersteund" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut is slechts 16 bits. Waarde moet minder dan 65536 zijn." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut niet ondersteund door gegeven pin" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bitdiepte moet tussen 1 en 6 liggen, niet %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Buffer heeft incorrect grootte. Moet %d bytes zijn." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Buffer moet op zijn minst lengte 1 zijn" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes moeten tussen 0 en 255 liggen." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Output van beide kanalen kan niet op dezelfde pin" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Kan niet lezen zonder MISO pin." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Kan niet resetten naar bootloader omdat er geen bootloader aanwezig is." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Kan niet overdragen zonder MOSI en MISO pinnen." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Kan niet schrijven zonder MOSI pin." + +#~ msgid "Clock pin init failed." +#~ msgstr "Clock pin init mislukt." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Command moet een int tussen 0 en 255 zijn" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Kon camera niet initialiseren" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Kan GNSS niet initialiseren" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Kan SDCard niet initialiseren" + +#~ msgid "Could not initialize UART" +#~ msgstr "Kan UART niet initialiseren" + +#~ msgid "Could not re-init channel" +#~ msgstr "Kan kanaal niet her-initialiseren" + +#~ msgid "Could not re-init timer" +#~ msgstr "Kan timer niet her-initialiseren" + +#~ msgid "Could not restart PWM" +#~ msgstr "Kan PWM niet herstarten" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Kan eerste buffer niet alloceren" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Kan input buffer niet alloceren" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Kan tweede buffer niet alloceren" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut niet ondersteund door gegeven pin" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Verwachtte een tuple met lengte %d, maar kreeg %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "RX buffer alloceren mislukt" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Mislukt een RX buffer van %d bytes te alloceren" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Framebuffer benodigd %d bytes" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Hostnaam moet tussen 1 en 253 karakters zijn" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C Init Fout" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Ongeldige %q pin selectie" + +#~ msgid "Invalid BMP file" +#~ msgstr "Ongeldig BMP bestand" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Ongeldige DAC pin opgegeven" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Ongeldige PWM frequentie" + +#~ msgid "Invalid Pin" +#~ msgstr "Ongeldige Pin" + +#~ msgid "Invalid buffer size" +#~ msgstr "Ongeldige buffer grootte" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Ongeldige byteorder string" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Ongeldige vastlegging periode. Geldig bereik: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Ongeldige kanaal aantallen" + +#~ msgid "Invalid direction." +#~ msgstr "Ongeldige richting." + +#~ msgid "Invalid file" +#~ msgstr "Ongeldig bestand" + +#~ msgid "Invalid number of bits" +#~ msgstr "Ongeldig aantal bits" + +#~ msgid "Invalid phase" +#~ msgstr "Ongeldige fase" + +#~ msgid "Invalid pin" +#~ msgstr "Ongeldige pin" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Ongeldige pin voor linker kanaal" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Ongeldige pin voor rechter kanaal" + +#~ msgid "Invalid polarity" +#~ msgstr "Ongeldige polariteit" + +#~ msgid "Invalid properties" +#~ msgstr "Ongeldige eigenschappen" + +#~ msgid "Invalid run mode." +#~ msgstr "Ongeldige run modus." + +#~ msgid "Invalid security_mode" +#~ msgstr "Ongeldige security_mode" + +#~ msgid "Invalid voice" +#~ msgstr "Ongeldige stem" + +#~ msgid "Invalid voice count" +#~ msgstr "Ongeldig stem aantal" + +#~ msgid "Invalid wave file" +#~ msgstr "Ongeldig wave bestand" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Ongeldig woord/bit lengte" + +#~ msgid "Layer already in a group." +#~ msgstr "Laag al in groep." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Laag moet een Groep of TileGrid subklasse zijn." + +#~ msgid "MISO pin init failed." +#~ msgstr "MISO pin init mislukt." + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSI pin init mislukt." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Berichten zijn beperkt tot 8 bytes" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Geen hardware ondersteuning beschikbaar op clk pin" + +#~ msgid "No hardware support on pin" +#~ msgstr "Geen hardware ondersteuning op pin" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "PWM duty_cycle moet tussen 0 en 65535 inclusief zijn (16 bit resolutie)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin heeft geen ADC mogelijkheden" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "RTC calibratie niet ondersteund door dit board" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 Nog niet ondersteund door dit apparaat" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI Init Fout" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI Herinitialisatie Fout" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Sample rate moet positief zijn" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Sample rate is te hoog. Moet minder dan %d zijn" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Stack grootte moet op zijn minst 256 zijn" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Tile waarde buiten bereik" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART Buffer allocatie fout" + +#~ msgid "UART De-init error" +#~ msgstr "UART De-init fout" + +#~ msgid "UART Init Error" +#~ msgstr "UART Init Fout" + +#~ msgid "UART Re-init error" +#~ msgstr "UART Re-init Fout" + +#~ msgid "UART write error" +#~ msgstr "UART schrijf fout" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Niet-ondersteunde baudsnelheid" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFi wachtwoord moet tussen 8 en 63 karakters bevatten" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "butes > 8 niet ondersteund" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "calibration waarde buiten bereik +/-127" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "" +#~ "cirkel kan slechts bij één object van een hoger niveau worden " +#~ "geregistreerd" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "" +#~ "polygoon kan slechts bij één object van een hoger niveau worden " +#~ "geregistreerd" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop moet 1 of 2 zijn" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeout moet groter dan 0.0 zijn" + +#~ msgid "Unsupported operation" +#~ msgstr "Niet-ondersteunde operatie" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Helderheid moet tussen de 0 en 255 liggen" @@ -5164,9 +5138,6 @@ msgstr "zi moet vorm (n_section, 2) hebben" #~ msgid "wrong argument type" #~ msgstr "onjuist argumenttype" -#~ msgid "wrong index type" -#~ msgstr "onjuist indextype" - #~ msgid "Must provide SCK pin" #~ msgstr "SCK pin moet opgegeven worden" diff --git a/locale/pl.po b/locale/pl.po index 054e175527..bdda99d827 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -71,10 +71,27 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "" @@ -87,12 +104,7 @@ msgstr "%q niepowodzenie: %d" msgid "%q in use" msgstr "%q w użyciu" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q poza zakresem" @@ -100,18 +112,42 @@ msgstr "%q poza zakresem" msgid "%q indices must be integers, not %s" msgstr "%q indeks musi być liczbą całkowitą, a nie %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "" @@ -120,29 +156,25 @@ msgstr "" msgid "%q must be >= %d" msgstr "" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q musi być >= 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q musi być >= 1" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q musi być krotką o długości 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" +#: py/argcheck.c +msgid "%q must be an int" msgstr "" #: py/argcheck.c @@ -161,7 +193,11 @@ msgstr "" msgid "%q out of bounds" msgstr "" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q poza zakresem" @@ -170,10 +206,6 @@ msgstr "%q poza zakresem" msgid "%q pin invalid" msgstr "nieprawidłowy pin %q" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q powinno być typu int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "" @@ -186,7 +218,11 @@ msgstr "%q() bierze %d argumentów pozycyjnych, lecz podano %d" msgid "%q, %q, and %q must all be the same length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -336,10 +372,6 @@ msgstr "'yield from' wewnątrz funkcji asynchronicznej" msgid "'yield' outside function" msgstr "'yield' poza funkcją" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x musi być obiektem przypisania" @@ -375,16 +407,12 @@ msgstr "ADC2 jest używany przez WiFi" msgid "Address must be %d bytes long" msgstr "Adres musi mieć %d bajtów" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Typ adresu poza zakresem" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" @@ -421,7 +449,6 @@ msgstr "" msgid "All event channels in use" msgstr "Wszystkie kanały zdarzeń w użyciu" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "" @@ -469,25 +496,6 @@ msgstr "" msgid "Already scanning for wifi networks" msgstr "" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn nie jest obsługiwany na danym pinie" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut jest niewspierane" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut ma 16 bitów. Wartość musi być mniejsza od 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut niewspierany na tej nóżce" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "" @@ -526,7 +534,7 @@ msgstr "" msgid "AuthMode.OPEN is not used with password" msgstr "" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Błąd autoryzacji" @@ -559,11 +567,6 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "Zegar bitowy i wybór słowa muszą współdzielić jednostkę zegara" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Głębia musi być wielokrotnością 8." @@ -605,11 +608,6 @@ msgstr "Bufor + przesunięcie za małe %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Zła wielkość bufora. Powinno być %d bajtów." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "" @@ -619,7 +617,6 @@ msgstr "" msgid "Buffer is too small" msgstr "Bufor jest za mały" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -630,14 +627,10 @@ msgstr "Długość %d bufora jest za duża. Musi być mniejsza niż %d" msgid "Buffer length must be a multiple of 512" msgstr "Długość bufora musi być wielokrotnością 512" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "Bufor musi być wielokrotnością 512 bajtów" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Bufor musi mieć długość 1 lub więcej" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -659,10 +652,6 @@ msgstr "Nóżka magistrali %d jest w użyciu" msgid "Byte buffer must be 16 bytes." msgstr "Bufor musi mieć 16 bajtów." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes musi być między 0 a 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Bloki CBC muszą być wielokrotnościami 16 bajtów" @@ -671,7 +660,7 @@ msgstr "Bloki CBC muszą być wielokrotnościami 16 bajtów" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -679,6 +668,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -726,18 +719,10 @@ msgstr "Nie można odczytać temperatury" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Nie można mieć obu kanałów na tej samej nóżce" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Nie można czytać bez nóżki MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Nie można nagrać do pliku" @@ -749,8 +734,8 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Nie można zrestartować -- nie ma bootloadera." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -770,21 +755,20 @@ msgid "Cannot subclass slice" msgstr "Nie można dziedziczyć ze slice" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Nie można przesyłać bez nóżek MOSI i MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Nie można zmieniać częstotliwości timera, który jest już używany" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Nie można pisać bez nóżki MOSI." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." +msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" @@ -798,10 +782,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython nie mógł przydzielić sterty." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Inicjalizacja nóżki zegara nie powiodła się." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Rozciągnięcie zegara zbyt duże" @@ -810,11 +790,6 @@ msgstr "Rozciągnięcie zegara zbyt duże" msgid "Clock unit in use" msgstr "Jednostka zegara w użyciu" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Komenda musi być int pomiędzy 0 a 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -827,35 +802,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Uszkodzony plik .mpy" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Nie można zainicjować GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Nie można zainicjować SDCard" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Ustawienie UART nie powiodło się" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Nie można ponownie zainicjować kanału" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Nie można ponownie zainicjować timera" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Nie można ponownie uruchomić PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -876,20 +822,6 @@ msgstr "Nie można rozpocząć przerwania, RX jest zajęty" msgid "Couldn't allocate decoder" msgstr "Nie udało się przydzielić dekodera" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Nie udała się alokacja pierwszego bufora" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Nie można przydzielić bufora wejściowego" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Nie udała się alokacja drugiego bufora" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -937,10 +869,6 @@ msgstr "Pojemność celu mniejsza od destination_length." msgid "Device in use" msgstr "Urządzenie w użyciu" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut nie jest obsługiwany na podanym pinie" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -952,6 +880,10 @@ msgstr "Wyświetlacz musi mieć 16-bitową przestrzeń kolorów." msgid "Display rotation must be in 90 degree increments" msgstr "Wyświetlacz można obracać co 90 stopni" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "Tryb sterowania nieużywany w trybie wejścia." @@ -987,20 +919,16 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Oczekiwano %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" +msgid "Expected an %q" msgstr "" -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Oczekiwano krotkę długości %d, otrzymano %d" - #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Extended advertisements with scan response not supported." @@ -1027,21 +955,9 @@ msgstr "Nie udało się wysłać polecenia." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Nie udało się uzyskać blokady, błąd 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Nie udała się alokacja bufora RX" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Nie udała się alokacja %d bajtów na bufor RX" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1064,10 +980,6 @@ msgstr "Nie udało się połączyć: błąd wewnętrzny" msgid "Failed to connect: timeout" msgstr "Nie udało się połączyć: upłynął limit czasu" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Nie można przeanalizować pliku MP3" @@ -1111,10 +1023,10 @@ msgstr "" msgid "Format not supported" msgstr "Nie wspierany format" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Bufor ramki wymaga %d bajtów" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1125,7 +1037,11 @@ msgstr "" msgid "Function requires lock" msgstr "Funkcja wymaga blokady" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1152,19 +1068,16 @@ msgstr "Sprzęt zajęty, wypróbuj alternatywne piny" msgid "Hardware in use, try alternative pins" msgstr "Sprzęt w użyciu, wypróbuj alternatywne piny" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operacja I/O na zamkniętym pliku" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "Błąd inicjalizacji I2C" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1271,75 +1184,37 @@ msgstr "" msgid "Internal error #%d" msgstr "Błąd wewnętrzny #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "Nieprawidłowe %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Zła nóżka %q" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Zły BMP" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Zła częstotliwość PWM" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Zły argument" @@ -1347,42 +1222,11 @@ msgstr "Zły argument" msgid "Invalid bits per value" msgstr "Zła liczba bitów wartości" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Zła wielkość bufora" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Zły okres. Poprawny zakres to: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Zła liczba kanałów" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Nieprawidłowy kierunek." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Zły plik" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Zła wielkość fragmentu formatu" @@ -1391,79 +1235,15 @@ msgstr "Zła wielkość fragmentu formatu" msgid "Invalid memory access." msgstr "Nieprawidłowy dostęp do pamięci." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Zła liczba bitów" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Zła faza" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Zła nóżka" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Zła nóżka dla lewego kanału" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Zła nóżka dla prawego kanału" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Złe nóżki" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Zła polaryzacja" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Nieprawidłowe właściwości" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Zły tryb uruchomienia." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Nieprawidłowy security_mode" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Nieprawidłowy rozmiar" @@ -1471,27 +1251,10 @@ msgstr "Nieprawidłowy rozmiar" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Nieprawidłowy stan" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Zła liczba głosów" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Zły plik wave" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Niepoprawna długość słowa/bitu" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Klucz musi mieć długość 16, 24 lub 32 bajtów" @@ -1505,24 +1268,16 @@ msgid "LHS of keyword arg must be an id" msgstr "Lewa strona argumentu nazwanego musi być nazwą" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer musi dziedziczyć z Group albo TileGrid." - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c -msgid "MAC address was invalid" +msgid "Layer must be a Group or TileGrid subclass" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "Nie powiodło się ustawienie pinu MISO." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Nie powiodło się ustawienie pinu MOSI." +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +msgid "MAC address was invalid" +msgstr "" #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" @@ -1533,18 +1288,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "Największa wartość x przy odwróceniu to %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Wiadomości ograniczone do 8 bajtów" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Brak pinu MISO lub MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1580,11 +1344,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1610,6 +1369,10 @@ msgstr "" msgid "Name too long" msgstr "Za długa nazwa" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1640,16 +1403,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Brak pinu MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Brak pinu MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1688,16 +1463,6 @@ msgstr "Brak wolnych GLCK" msgid "No hardware random available" msgstr "Brak generatora liczb losowych" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Brak sprzętowej obsługi na nóżce" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1742,6 +1507,10 @@ msgstr "" msgid "No space left on device" msgstr "Brak miejsca" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Brak pliku/katalogu" @@ -1791,6 +1560,14 @@ msgstr "Obiekt został zwolniony i nie można go już używać. Utwórz nowy obi msgid "Odd parity is not supported" msgstr "Nieparzysta parzystość nie jest wspierana" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1800,7 +1577,7 @@ msgstr "Tylko 8 lub 16 bitów mono z " msgid "Only IPv4 addresses supported" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1833,15 +1610,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1849,19 +1630,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "W danym momencie przezroczysty może być tylko jeden kolor" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Brak pamięci" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1869,11 +1654,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Nadpróbkowanie musi być wielokrotnością 8." @@ -1882,16 +1662,15 @@ msgstr "Nadpróbkowanie musi być wielokrotnością 8." msgid "PDMIn not available" msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "duty_cycle musi być pomiędzy 0 a 65535 włącznie (rozdzielczość 16 bit)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Nie można zmienić częstotliwości PWM gdy variable_frequency=False." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "" @@ -1908,29 +1687,14 @@ msgstr "" msgid "Permission denied" msgstr "Odmowa dostępu" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Nóżka nie obsługuje ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -1997,18 +1761,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Podciągnięcie nieużywane w trybie wyjścia." @@ -2030,8 +1786,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2039,21 +1796,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "Brak obsługi kalibracji RTC" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "Brak obsługi RTC" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Błąd generowania liczb losowych" @@ -2071,10 +1817,14 @@ msgstr "System plików tylko do odczytu" msgid "Read-only object" msgstr "Obiekt tylko do odczytu" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Otrzymana odpowiedź była nieprawidłowa" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "Zbyt wczesne odświeżenie" @@ -2087,7 +1837,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "Żądany tryb AES nie jest obsługiwany" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Nie znaleziono żądanego zasobu" @@ -2103,6 +1853,10 @@ msgstr "Uruchomiony tryb bezpieczeństwa! Zapisany kod nie jest uruchamiany.\n" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2113,30 +1867,21 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "Błąd inicjowania SPI" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "Błąd ponownej inicjalizacji SPI" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Częstotliwość próbkowania musi być dodatnia" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Zbyt wysoka częstotliwość próbkowania. Musi być mniejsza niż %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2156,14 +1901,6 @@ msgstr "Serializator w użyciu" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2199,10 +1936,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "Podział z podgrupami" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Stos musi mieć co najmniej 256 bajtów" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2288,10 +2021,6 @@ msgstr "Wysokość bitmapy musi być wielokrotnością wysokości kafelka" msgid "Tile index out of bounds" msgstr "" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Szerokość bitmapy musi być wielokrotnością szerokości kafelka" @@ -2311,6 +2040,9 @@ msgid "To exit, please reset the board without " msgstr "By wyjść, proszę zresetować płytkę bez " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zbyt wiele kanałów." @@ -2343,25 +2075,22 @@ msgid "Tuple or struct_time argument required" msgstr "Wymagana krotka lub struct_time" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "Błąd alokacji bufora UART" +msgid "UART de-init" +msgstr "" -#: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" +msgid "UART write" msgstr "" -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "Błąd zapisu UART" - #: shared-module/usb_hid/Device.c msgid "USB busy" msgstr "" @@ -2496,12 +2225,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Zła szybkość transmisji" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2514,9 +2237,9 @@ msgstr "Zły typ magistrali wyświetlaczy" msgid "Unsupported format" msgstr "Zły format" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Zła operacja" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2536,7 +2259,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2566,10 +2289,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "WatchDogTimer.timeout musi być większe od 0" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2580,8 +2299,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2622,11 +2341,11 @@ msgstr "Argument __new__ musi być typu użytkownika" msgid "a bytes-like object is required" msgstr "wymagany obiekt typu bytes" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "adres poza zakresem" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "adres jest pusty" @@ -2675,6 +2394,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2736,10 +2459,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample musi być 8 lub 16" @@ -2777,11 +2496,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "bajty większe od 8 bitów są niewspierane" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2790,7 +2504,7 @@ msgstr "" msgid "bytes value out of range" msgstr "wartość bytes poza zakresem" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "kalibracja poza zakresem" @@ -2798,12 +2512,9 @@ msgstr "kalibracja poza zakresem" msgid "calibration is read only" msgstr "kalibracja tylko do odczytu" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "wartość kalibracji poza zakresem +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2826,7 +2537,7 @@ msgstr "przypisanie do wyrażenia" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "nie można dokonać konwersji %q na %q" @@ -2974,6 +2685,10 @@ msgstr "" msgid "casting" msgstr "rzutowanie" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "bufor chars zbyt mały" @@ -2986,10 +2701,6 @@ msgstr "argument chr() poza zakresem range(0x110000)" msgid "chr() arg not in range(256)" msgstr "argument chr() poza zakresem range(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3054,6 +2765,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3138,10 +2853,6 @@ msgstr "" msgid "division by zero" msgstr "dzielenie przez zero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3150,6 +2861,10 @@ msgstr "" msgid "empty" msgstr "puste" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "pusta sterta" @@ -3179,6 +2894,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "błąd = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "wyjątki muszą dziedziczyć po BaseException" @@ -3253,7 +2974,7 @@ msgstr "pierwszy argument musi być funkcją" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3289,6 +3010,10 @@ msgstr "font musi mieć 2048 bajtów długości" msgid "format requires a dict" msgstr "format wymaga słownika" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "pełny" @@ -3397,7 +3122,7 @@ msgstr "niepełny klucz formatu" msgid "incorrect padding" msgstr "złe wypełnienie" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "indeks jest poza zakresem" @@ -3415,6 +3140,10 @@ msgstr "indeksy muszą być całkowite" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "wartości początkowe muszą być iterowalne" @@ -3460,6 +3189,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3468,11 +3201,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3552,6 +3281,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "zły dekorator micropythona" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "zły krok" @@ -3665,10 +3398,6 @@ msgstr "błąd domeny" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3676,12 +3405,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3815,7 +3540,7 @@ msgstr "" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "nie ma takiego atrybutu" @@ -3926,7 +3651,11 @@ msgstr "wymagany obiekt z protokołem buforu" msgid "odd-length string" msgstr "łańcuch o nieparzystej długości" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4051,10 +3780,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop z pustego PulseIn" @@ -4080,63 +3805,23 @@ msgstr "trzeci argument pow() nie może być 0" msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb całkowitych" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4156,14 +3841,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "przepełnienie kolejki" @@ -4215,13 +3892,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"bufor sample_source musi być bytearray lub tablicą typu 'h', 'H', 'b' lub 'B'" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4319,10 +3989,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "początkowe/końcowe indeksy" @@ -4335,10 +4001,6 @@ msgstr "start_x powinien być całkowity" msgid "step must be non-zero" msgstr "step nie może być zerowe" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop musi być 1 lub 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop nie jest osiągalne ze start" @@ -4387,10 +4049,6 @@ msgstr "błąd składni w deskryptorze uctypes" msgid "threshold must be in the range 0-65536" msgstr "threshold musi być w zakresie 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" @@ -4410,10 +4068,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "timeout musi być >= 0.0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4422,6 +4076,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp poza zakresem dla time_t na tej platformie" @@ -4592,6 +4250,14 @@ msgstr "zły typ dla operatora" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4613,13 +4279,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "szerokość musi być większa niż zero" @@ -4639,7 +4299,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "zły typ indeksu" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "nieprawidłowy typ wejścia" @@ -4647,6 +4317,10 @@ msgstr "nieprawidłowy typ wejścia" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "zła liczba argumentów" @@ -4691,6 +4365,236 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "bufor sample_source musi być bytearray lub tablicą typu 'h', 'H', 'b' lub " +#~ "'B'" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q musi być krotką o długości 2" + +#~ msgid "%q should be an int" +#~ msgstr "%q powinno być typu int" + +#~ msgid "Address type out of range" +#~ msgstr "Typ adresu poza zakresem" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn nie jest obsługiwany na danym pinie" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut jest niewspierane" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut ma 16 bitów. Wartość musi być mniejsza od 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut niewspierany na tej nóżce" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Zła wielkość bufora. Powinno być %d bajtów." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Bufor musi mieć długość 1 lub więcej" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes musi być między 0 a 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Nie można mieć obu kanałów na tej samej nóżce" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Nie można czytać bez nóżki MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Nie można zrestartować -- nie ma bootloadera." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Nie można przesyłać bez nóżek MOSI i MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Nie można pisać bez nóżki MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Inicjalizacja nóżki zegara nie powiodła się." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Komenda musi być int pomiędzy 0 a 255" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Nie można zainicjować GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Nie można zainicjować SDCard" + +#~ msgid "Could not initialize UART" +#~ msgstr "Ustawienie UART nie powiodło się" + +#~ msgid "Could not re-init channel" +#~ msgstr "Nie można ponownie zainicjować kanału" + +#~ msgid "Could not re-init timer" +#~ msgstr "Nie można ponownie zainicjować timera" + +#~ msgid "Could not restart PWM" +#~ msgstr "Nie można ponownie uruchomić PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Nie udała się alokacja pierwszego bufora" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Nie można przydzielić bufora wejściowego" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Nie udała się alokacja drugiego bufora" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut nie jest obsługiwany na podanym pinie" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Oczekiwano krotkę długości %d, otrzymano %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Nie udała się alokacja bufora RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Nie udała się alokacja %d bajtów na bufor RX" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Bufor ramki wymaga %d bajtów" + +#~ msgid "I2C Init Error" +#~ msgstr "Błąd inicjalizacji I2C" + +#~ msgid "Invalid BMP file" +#~ msgstr "Zły BMP" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Zła częstotliwość PWM" + +#~ msgid "Invalid buffer size" +#~ msgstr "Zła wielkość bufora" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Zły okres. Poprawny zakres to: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Zła liczba kanałów" + +#~ msgid "Invalid direction." +#~ msgstr "Nieprawidłowy kierunek." + +#~ msgid "Invalid file" +#~ msgstr "Zły plik" + +#~ msgid "Invalid number of bits" +#~ msgstr "Zła liczba bitów" + +#~ msgid "Invalid phase" +#~ msgstr "Zła faza" + +#~ msgid "Invalid pin" +#~ msgstr "Zła nóżka" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Zła nóżka dla lewego kanału" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Zła nóżka dla prawego kanału" + +#~ msgid "Invalid polarity" +#~ msgstr "Zła polaryzacja" + +#~ msgid "Invalid properties" +#~ msgstr "Nieprawidłowe właściwości" + +#~ msgid "Invalid run mode." +#~ msgstr "Zły tryb uruchomienia." + +#~ msgid "Invalid security_mode" +#~ msgstr "Nieprawidłowy security_mode" + +#~ msgid "Invalid voice count" +#~ msgstr "Zła liczba głosów" + +#~ msgid "Invalid wave file" +#~ msgstr "Zły plik wave" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Niepoprawna długość słowa/bitu" + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer musi dziedziczyć z Group albo TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "Nie powiodło się ustawienie pinu MISO." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Nie powiodło się ustawienie pinu MOSI." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Wiadomości ograniczone do 8 bajtów" + +#~ msgid "No hardware support on pin" +#~ msgstr "Brak sprzętowej obsługi na nóżce" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "duty_cycle musi być pomiędzy 0 a 65535 włącznie (rozdzielczość 16 bit)" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Nóżka nie obsługuje ADC" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "Brak obsługi kalibracji RTC" + +#~ msgid "SPI Init Error" +#~ msgstr "Błąd inicjowania SPI" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "Błąd ponownej inicjalizacji SPI" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Częstotliwość próbkowania musi być dodatnia" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Zbyt wysoka częstotliwość próbkowania. Musi być mniejsza niż %d" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Stos musi mieć co najmniej 256 bajtów" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "Błąd alokacji bufora UART" + +#~ msgid "UART write error" +#~ msgstr "Błąd zapisu UART" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Zła szybkość transmisji" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "bajty większe od 8 bitów są niewspierane" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "wartość kalibracji poza zakresem +/-127" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop musi być 1 lub 2" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeout musi być >= 0.0" + +#~ msgid "Unsupported operation" +#~ msgstr "Zła operacja" + #~ msgid "Brightness must be between 0 and 255" #~ msgstr "Jasność musi być pomiędzy 0 a 255" @@ -4933,9 +4837,6 @@ msgstr "" #~ msgid "wrong argument type" #~ msgstr "zły typ argumentu" -#~ msgid "wrong index type" -#~ msgstr "zły typ indeksu" - #~ msgid "Must provide SCK pin" #~ msgstr "Należy podać pin SCK" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index ea3ffae29f..c78044a1bf 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: 2022-03-21 22:57+0000\n" +"PO-Revision-Date: 2022-09-19 21:21+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.12-dev\n" +"X-Generator: Weblate 4.14.1\n" #: main.c msgid "" @@ -75,10 +75,27 @@ msgstr "" "%d pinos de endereço, %d pinos rgb e %d blocos indicam uma altura com %d, " "não %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "%q" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q e %q contêm pinos duplicados" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "%q e %q devem ser diferentes" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q contém pinos duplicados" @@ -91,12 +108,7 @@ msgstr "%q falha: %d" msgid "%q in use" msgstr "%q em uso" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "O índice %q está fora do intervalo" @@ -104,18 +116,42 @@ msgstr "O índice %q está fora do intervalo" msgid "%q indices must be integers, not %s" msgstr "Os índices %q devem ser inteiros, e não %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "a inicialização do %q falhou" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "O comprimento de %q deve ser %d" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "o comprimento %q deve ser %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "o comprimento de %q deve ser <= %d" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "o comprimento de %q deve ser >= %d" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "o comprimento %q deve ser >=1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "%q deve ser %d" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "o %q deve ser %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "%q deve ser 1 quando %q for verdadeiro" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q deve ser <= %d" @@ -124,30 +160,26 @@ msgstr "%q deve ser <= %d" msgid "%q must be >= %d" msgstr "o %q deve ser >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q deve ser >= 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q deve ser >= 1" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +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'" + #: py/argcheck.c msgid "%q must be a string" msgstr "%q deve ser uma string" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q deve ser uma tupla de comprimento 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q deve estar entre %d e %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "%q deve ser um inteiro" #: py/argcheck.c msgid "%q must be of type %q" @@ -165,7 +197,11 @@ msgstr "%q deve ser a potência de 2" msgid "%q out of bounds" msgstr "%q fora dos limites" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q fora do alcance" @@ -174,10 +210,6 @@ msgstr "%q fora do alcance" msgid "%q pin invalid" msgstr "%q pino inválido" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q deve ser um int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q com um relatório com ID de 0 deve ter comprimento 1" @@ -190,7 +222,11 @@ msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados" msgid "%q, %q, and %q must all be the same length" msgstr "todos os %q, %q, e %q devem ter mesmo comprimento" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "%q=%q" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s erro 0x%x" @@ -344,10 +380,6 @@ msgstr "'yield a partir' de dentro da função async" msgid "'yield' outside function" msgstr "função externa 'yield'" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "(x,y) é obrigatório o uso de números inteiros" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x deve ser o destino da atribuição" @@ -383,16 +415,12 @@ msgstr "O ADC2 está sendo usado pelo WiFi" msgid "Address must be %d bytes long" msgstr "O endereço deve ter %d bytes de comprimento" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "O tipo do endereço está fora do alcance" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Todos os periféricos CAN estão em uso" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Todos os periféricos I2C estão em uso" @@ -429,7 +457,6 @@ msgstr "Todos os canais estão em uso" msgid "All event channels in use" msgstr "Todos os canais de eventos em uso" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "O estado de todas as máquinas em uso" @@ -477,25 +504,6 @@ msgstr "Já está em execução" msgid "Already scanning for wifi networks" msgstr "Já está em busca das redes de wifi" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "O AnalogIn não é compatível no pino informado" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Funcionalidade AnalogOut não suportada" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "O AnalogOut é de apenas 16 bits. O valor deve ser menor que 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "Saída analógica não suportada no pino fornecido" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Um outro PWMAudioOut já está ativo" @@ -535,7 +543,7 @@ msgstr "A conversão de áudio ainda não foi implementada" msgid "AuthMode.OPEN is not used with password" msgstr "O AuthMode.OPEN não é usado com senha" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Houve um falha na autenticação" @@ -570,11 +578,6 @@ msgstr "" "O clock de bits e a seleção de palavras devem compartilhar uma unidade de " "clock" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "A profundidade dos bits deve ser de 1 até 6 inclusive, porém não %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "A profundidade de bits deve ser o múltiplo de 8." @@ -618,11 +621,6 @@ msgstr "O buffer + desvio é muito pequeno %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Os elementos do buffer devem ter 4 bytes de comprimento ou menos" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Buffer de tamanho incorreto. Deve ser %d bytes." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "O buffer não é um bytearray." @@ -632,7 +630,6 @@ msgstr "O buffer não é um bytearray." msgid "Buffer is too small" msgstr "O buffer é muito pequeno" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -643,14 +640,10 @@ msgstr "O tamanho do buffer %d é muito grande. Deve ser menor que %d" msgid "Buffer length must be a multiple of 512" msgstr "O comprimento do Buffer deve ser um múltiplo de 512" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "O buffer deve ser um múltiplo de 512 bytes" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "O comprimento do buffer deve ter pelo menos 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -672,10 +665,6 @@ msgstr "O pino bus %d já está em uso" msgid "Byte buffer must be 16 bytes." msgstr "O buffer deve ter 16 bytes." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Os bytes devem estar entre 0 e 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Os blocos CBC devem ter múltiplos de 16 bytes" @@ -684,7 +673,7 @@ msgstr "Os blocos CBC devem ter múltiplos de 16 bytes" msgid "CIRCUITPY drive could not be found or created." msgstr "A unidade CIRCUITPY não pôde ser encontrada nem criada." -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC ou checksum inválido" @@ -692,6 +681,10 @@ msgstr "CRC ou checksum inválido" msgid "Call super().__init__() before accessing native object." msgstr "Chame super().__init__() antes de acessar o objeto nativo." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "Inicialização da câmera" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "O alarme só pode acontecer no RTC IO a partir do deep sleep." @@ -744,18 +737,10 @@ msgstr "" "Não é possível ter respostas da verificação para os anúncios estendidos e " "conectáveis." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Não é possível emitir os dois canais no mesmo pino" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Não é possível obter (pull) nos pinos somente de entrada." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Não é possível ler sem o pino MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Não é possível gravar em um arquivo" @@ -767,9 +752,9 @@ msgstr "Não é possível montar '/' quando estiver visível pelo USB." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" -"Não é possível redefinir para o bootloader porque o mesmo não está presente." +"Não é possível redefinir no bootloader pois nenhum bootloader está presente" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -789,22 +774,21 @@ msgid "Cannot subclass slice" msgstr "Não é possível subclassificar a fatia" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Não é possível transferir sem os pinos MOSI e MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "Não é possível transferir sem os pinos MOSI e MISO" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Não é possível variar a frequência em um timer que já esteja em uso" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "Não é possível acordar na borda do pino, nível apenas" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Não é possível acordar (wake) no pino edge. Nível apenas." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Não é possível fazer a escrita sem um pino MOSI." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Escrita CharacteristicBuffer não informada" @@ -817,10 +801,6 @@ msgstr "O núcleo principal do CircuitPython falhou feio. Ops!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "O CircuitPython não conseguiu alocar o heap." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Inicialização do pino de Clock falhou." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Clock se estendeu por tempo demais" @@ -829,11 +809,6 @@ msgstr "Clock se estendeu por tempo demais" msgid "Clock unit in use" msgstr "Unidade de Clock em uso" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "O comando deve ser um int entre 0 e 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -845,35 +820,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Arquivo .mpy corrompido" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Não foi possível inicializar a Câmera" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Não foi possível inicializar o GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Não foi possível inicializar o SDCard" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Não foi possível inicializar o UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Não foi possível reiniciar o canal" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Não foi possível reiniciar o temporizador" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Não foi possível reiniciar o PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Não foi possível recuperar o clock" @@ -894,20 +840,6 @@ msgstr "Não foi possível iniciar a interrupção, RX ocupado" msgid "Couldn't allocate decoder" msgstr "Não foi possível alocar o decodificador" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Não pôde alocar primeiro buffer" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Não foi possível alocar o buffer de entrada" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Não pôde alocar segundo buffer" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Falha no HardFault_Handler." @@ -955,10 +887,6 @@ msgstr "A capacidade do destino é menor que destination_length." msgid "Device in use" msgstr "Dispositivo em uso" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "O DigitalInOut não é compatível em um determinado pino" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -970,6 +898,10 @@ msgstr "O monitor deve ter um espaço de cores com 16 bits." msgid "Display rotation must be in 90 degree increments" msgstr "A rotação da tela deve estar em incrementos de 90 graus" +#: main.c +msgid "Done" +msgstr "Feito" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "O modo do controlador não é usado quando a direção for inserida." @@ -1005,19 +937,15 @@ msgstr "Erro: Falha na vinculação" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Esperado um" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "Um alarme era esperado" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Tupla esperada com comprimento %d, obteve %d" +msgid "Expected an %q" +msgstr "Esperava-se um(a) %q" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1045,21 +973,9 @@ msgstr "Falha ao enviar comando." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Houve uma falha na aquisição do mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Falha ao alocar buffer RX" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Falha ao alocar buffer RX de %d bytes" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "Houve uma falha ao alocar o buffer %q" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1082,10 +998,6 @@ msgstr "Falha ao conectar: erro interno" msgid "Failed to connect: timeout" msgstr "Falha ao conectar: tempo limite" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "Houve uma falha ao iniciar o wifi" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Falha ao analisar o arquivo MP3" @@ -1130,10 +1042,12 @@ msgstr "" msgid "Format not supported" msgstr "O formato não é suportado" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "O Framebuffer requer %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" +"A frequência deve ser 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 ou " +"1008 Mhz" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1145,7 +1059,11 @@ msgstr "" msgid "Function requires lock" msgstr "A função requer bloqueio" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "Inicialização do GNSS" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Falha Genérica" @@ -1172,19 +1090,16 @@ msgstr "O hardware está ocupado, tente os pinos alternativos" msgid "Hardware in use, try alternative pins" msgstr "O hardware está em uso, tente os pinos alternativos" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "O nome do host deve ter entre 1 e 253 caracteres" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Operação I/O no arquivo fechado" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "Erro de inicialização do I2C" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "Periférico I2C em uso" @@ -1297,75 +1212,37 @@ msgstr "Erro interno" msgid "Internal error #%d" msgstr "Erro interno #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "O temporizador do watchdog interno expirou." + +#: py/argcheck.c msgid "Invalid %q" msgstr "%q Inválido" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Pino do %q inválido" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Seleção inválida dos pinos %q" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Valor inválido da unidade ADC" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "AuthMode inválido" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Parâmetro BLE inválido" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Arquivo BMP inválido" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "BSSID Inválido" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "O pino DAC informado é inválido" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "Endereço MAC inválido" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "O arquivo MIDI é inválido" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Frequência PWM inválida" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Pino inválido" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -1373,42 +1250,11 @@ msgstr "Argumento inválido" msgid "Invalid bits per value" msgstr "Os valores por bits são inválidos" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "O tamanho do buffer é inválido" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "A cadeia de bytes é inválida" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "O período de captura é inválido. O intervalo válido é: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "A contagem do canal é inválido" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "data_count %d inválido" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "data_pins[%d] inválido" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Direção inválida." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Arquivo inválido" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Tamanho do pedaço de formato inválido" @@ -1417,79 +1263,15 @@ msgstr "Tamanho do pedaço de formato inválido" msgid "Invalid memory access." msgstr "O acesso da memória é inválido." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "Modo inválido" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "Endereço MAC multicast inválido" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Número inválido de bits" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Fase Inválida" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Pino inválido" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Pino inválido para canal esquerdo" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Pino inválido para canal direito" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Pinos inválidos" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Polaridade inválida" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Propriedades inválidas" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "O modo de execução é inválido." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "O Security_mode é inválido" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Tamanho inválido" @@ -1497,27 +1279,10 @@ msgstr "Tamanho inválido" msgid "Invalid socket for TLS" msgstr "Soquete inválido para o TLS" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Estado inválido" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "A voz é inválida" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "A contagem da voz é inválida" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Aqruivo de ondas inválido" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "O comprimento do bit/palavra são inválidos" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "A chave deve ter 16, 24 ou 32 bytes de comprimento" @@ -1531,25 +1296,17 @@ msgid "LHS of keyword arg must be an id" msgstr "O LHS da palavra-chave arg deve ser um ID" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "A camada já existe em um grupo." +msgid "Layer already in a group" +msgstr "Camada já está num grupo" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "A camada deve ser uma subclasse Group ou TileGrid." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "A camada deve ser uma subclasse Group ou TileGrid" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "Endereço MAC inválido" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "A inicialização do pino MISO falhou." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Inicialização do pino MOSI falhou." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "O mapeamento deve ser uma tupla" @@ -1559,18 +1316,27 @@ msgstr "O mapeamento deve ser uma tupla" msgid "Maximum x value when mirrored is %d" msgstr "O valor máximo de x quando espelhado é %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "As mensagens estão limitadas a 8 bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "O atraso na inicialização do microfone deve estar entre 0,0 e 1,0" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "O tamanho dos dados é incompatível" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "Sinalizador de troca incompatível" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "O pino MISO ou MOSI está ausente" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "Falta o pino MISO ou o MOSI" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1606,11 +1372,6 @@ msgstr "Faltando first_set_pin. A instrução %d define os pinos(s)" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "Falta o jmp_pin. A instrução %d salta no pino" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "Mais de %d reportam ids não compatíveis" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Deve ser uma subclasse %q." @@ -1636,6 +1397,10 @@ msgstr "Erro NVS" msgid "Name too long" msgstr "Nome muito longo" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "O novo bitmap deve ter o mesmo tamanho que o bitmap antigo" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "Ágil fora da memória" @@ -1666,16 +1431,28 @@ msgstr "Nenhum temporizador DMA foi encontrado" msgid "No I2C device at address: 0x%x" msgstr "Não há nenhum dispositivo I2C no endereço: 0x%x" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "Sem IP" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Nenhum pino MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "Nenhum pino MISO" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Nenhum pino MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "Nenhum pino MOSI" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1714,16 +1491,6 @@ msgstr "Não há GCLKs livre" msgid "No hardware random available" msgstr "Nenhum hardware aleatório está disponível" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Sem suporte de hardware no pino de clock" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Nenhum suporte de hardware no pino" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "Sem entrada no programa" @@ -1770,6 +1537,10 @@ msgstr "Não há pulldown no pino; É recomendável utilizar um resistor de 1M o msgid "No space left on device" msgstr "Não resta espaço no dispositivo" +#: py/moduerrno.c +msgid "No such device" +msgstr "Não existe tal dispositivo" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Este arquivo/diretório não existe" @@ -1820,6 +1591,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "A paridade ímpar não é compatível" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "Desligado" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "Ok" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1829,7 +1608,7 @@ msgstr "Apenas mono com 8 ou 16 bits com " msgid "Only IPv4 addresses supported" msgstr "Somente os endereços IPv4 são suportados" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "Apenas soquetes IPv4 são suportados" @@ -1866,15 +1645,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "Apenas um TouchAlarm pode ser colocado em deep sleep." -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "Apenas um endereço é permitido" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "Apenas um alarme alarm.time pode ser definido" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Apenas um alarme alarm.time pode ser definido." @@ -1882,19 +1665,23 @@ msgstr "Apenas um alarme alarm.time pode ser definido." msgid "Only one color can be transparent at a time" msgstr "Apenas uma cor pode ser transparente de cada vez" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "A operação não é permitida" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "A operação ou o recurso não é suportado" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "A operação expirou" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Sem memória" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "Sem soquetes" @@ -1902,11 +1689,6 @@ msgstr "Sem soquetes" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Os elementos Out-buffer devem ter um comprimento de <= 4 bytes" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "O buffer de saída deve ter ao menos %d bytes" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "A superamostragem deve ser um múltiplo de 8." @@ -1915,13 +1697,6 @@ msgstr "A superamostragem deve ser um múltiplo de 8." msgid "PDMIn not available" msgstr "O PDMIn não está disponível" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" -"O duty_cycle do PWM deve estar entre 0 e inclusive 65535 (com resolução de " -"16 bits)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1929,6 +1704,10 @@ msgstr "" "A frequência do PWM não pode ser gravada quando variable_frequency for False " "na construção." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "Reinício do PWM" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "A fatia do PWM já está em uso" @@ -1945,29 +1724,14 @@ msgstr "O periférico está em uso" msgid "Permission denied" msgstr "Permissão negada" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "O pinto não pode acordar do deep sleep" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "A contagem dos pinos deve ser com pelo menos 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "A contagem dos pinos é muito grande" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "O pino não tem recursos de ADC" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2042,18 +1806,10 @@ msgstr "O programa faz IN sem carregar o ISR" msgid "Program does OUT without loading OSR" msgstr "O programa faz OUT sem carregar o OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "O programa deve conter pelo menos uma instrução com 16 bits." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "O tamanho do programa é inválido" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "O programa é muito grande" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "O Pull não foi usado quando a direção for gerada." @@ -2075,30 +1831,20 @@ msgstr "Erro DeInit RNG" msgid "RNG Init Error" msgstr "Houve um erro na inicialização do RNG" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "Ainda não há suporte para o RS485 neste dispositivo" +#: 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 +msgid "RS485" +msgstr "RS485" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "A definição da inversão do RS485 quando não está no modo RS485" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "A calibração RTC não é suportada nesta placa" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "O RTC não é suportado nesta placa" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS/CTS/RS485 Ainda não é compatível neste dispositivo" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Houve um erro na geração do número aleatório" @@ -2116,10 +1862,14 @@ msgstr "Sistema de arquivos somente leitura" msgid "Read-only object" msgstr "Objeto de leitura apenas" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "A resposta recebida foi inválida" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "Reconectando" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "A recarga foi cedo demais" @@ -2132,7 +1882,7 @@ msgstr "As requisições de transmissões remotas é limitada a 8 bytes" msgid "Requested AES mode is unsupported" msgstr "O modo AES solicitado não é compatível" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "O recurso solicitado não foi encontrado" @@ -2148,6 +1898,10 @@ msgstr "Rodando em modo seguro! O código salvo não está em execução.\n" msgid "SD card CSD format not supported" msgstr "O formato CSD do Cartão SD não é compatível" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "Inicialização do cartão SD" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2158,30 +1912,21 @@ msgstr "Erro SDIO GetCardInfo %d" msgid "SDIO Init Error %d" msgstr "Erro SDIO Init %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "Houve um erro na inicialização SPI" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "Houve um erro na reinicialização SPI" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "A configuração SPI falhou" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "Erro de inicialização do SPI" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "O periférico SPI está em uso" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "A taxa de amostragem deve ser positiva" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Taxa de amostragem muito alta. Deve ser menor que %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "Reinicialização do SPI" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2201,15 +1946,6 @@ msgstr "Serializer em uso" msgid "Server side context cannot have hostname" msgstr "O contexto do lado do servidor não pode ter nome de host" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "A definição da contagem dos pinos deve estar entre 1 e 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" -"A definição da contagem dos pinos do conjunto lateral deve estar entre 1 e 5" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "O tamanho não é suportado" @@ -2245,10 +1981,6 @@ msgstr "Especifique exatamente um do data0 ou do data_pins" msgid "Splitting with sub-captures" msgstr "Divisão com sub-capturas" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "O tamanho da pilha deve ser pelo menos 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "O estéreo à esquerda deve estar no canal PWM A" @@ -2345,10 +2077,6 @@ msgstr "A altura do bloco deve dividir exatamente com a altura do bitmap" msgid "Tile index out of bounds" msgstr "O índice do bloco está fora dos limites" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "O valor do bloco está fora dos limites" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "A largura do bloco deve dividir exatamente com a largura do bitmap" @@ -2370,6 +2098,9 @@ msgid "To exit, please reset the board without " msgstr "Para sair, por favor, reinicie a placa sem " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "Muitos canais na amostra" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Muitos canais na amostra." @@ -2402,24 +2133,21 @@ msgid "Tuple or struct_time argument required" msgstr "O argumento de tupla ou struct_time é necessário" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "Houve um erro na alocação do Buffer UART" +msgid "UART de-init" +msgstr "descontinuar o início UART" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "inicialização do UART" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "Houve um erro da não inicialização do UART" +msgid "UART re-init" +msgstr "Reinicialização do UART" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "Houve um erro na inicialização do UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "Houve um erro na reinicialização do UART" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "Houve um erro na gravação UART" +msgid "UART write" +msgstr "Escrita UART" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2558,12 +2286,6 @@ msgstr "" "Problema desconhecido. Pode ser que o prompt de emparelhamento no outro " "dispositivo tenha sido recusado ou ignorado." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Taxa de transmissão não suportada" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "Espaço de cor não compatível" @@ -2576,9 +2298,9 @@ msgstr "Não há suporte para o tipo do display bus" msgid "Unsupported format" msgstr "Formato não suportado" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Operação não suportada" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "Sem compatibilidade com o algoritmo de hash" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2598,7 +2320,7 @@ msgstr "Comprimento do valor != comprimento fixo necessário" msgid "Value length > max_length" msgstr "O comprimento do valor é > max_length" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "A versão era inválida" @@ -2632,10 +2354,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "O WatchDogTimer.timeout deve ser maior que 0" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "O temporizador Watchdog expirou." - #: py/builtinhelp.c #, c-format msgid "" @@ -2651,9 +2369,9 @@ msgstr "" "\n" "Para listar os módulos existente digite `help(\"modules\")`.\n" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "A senha do Wi-Fi deve ter entre 8 e 63 caracteres" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "Wi-Fi: " #: main.c msgid "Woken up by alarm.\n" @@ -2695,11 +2413,11 @@ msgstr "O argumento __new__ deve ser um tipo usuário" msgid "a bytes-like object is required" msgstr "é necessário objetos tipo bytes" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "endereço fora dos limites" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "os endereços estão vazios" @@ -2748,6 +2466,10 @@ msgstr "os argumentos devem ser ndarrays" msgid "array and index length must be equal" msgstr "a matriz e comprimento do índice devem ser iguais" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "a matriz possui muitas dimensões" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2809,10 +2531,6 @@ msgstr "os tamanhos do bitmap devem coincidir" msgid "bits must be 32 or less" msgstr "bits deve ser 32 ou menos" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "os bits devem estar na faixa entre 5 a 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample deve ser 8 ou 16" @@ -2850,11 +2568,6 @@ msgstr "o buffer é pequeno demais para os bytes requisitados" msgid "byteorder is not a string" msgstr "a ordem dos bytes não é uma cadeia de caracteres" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "bytes > 8 bits não suportado" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "o comprimento dos bytes não é um múltiplo do tamanho do item" @@ -2863,7 +2576,7 @@ msgstr "o comprimento dos bytes não é um múltiplo do tamanho do item" msgid "bytes value out of range" msgstr "o valor dos bytes estão fora do alcance" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "Calibração está fora do intervalo" @@ -2871,13 +2584,10 @@ msgstr "Calibração está fora do intervalo" msgid "calibration is read only" msgstr "Calibração é somente leitura" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "Valor de calibração fora do intervalo +/- 127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" -msgstr "pode ser registrado apenas numa principal" +msgid "can only have one parent" +msgstr "pode ter apenas um principal" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -2899,7 +2609,7 @@ msgstr "a expressão não pode ser atribuída" msgid "can't cancel self" msgstr "não é possível cancelar a si mesmo" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "não é possível converter %q para %q" @@ -3051,6 +2761,10 @@ msgstr "Não é possível obter de forma inequívoca a escala do sizeof" msgid "casting" msgstr "fundição" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "reinício do canal" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "o buffer dos caracteres é muito pequeno" @@ -3063,10 +2777,6 @@ msgstr "o arg chr() está fora do intervalo(0x110000)" msgid "chr() arg not in range(256)" msgstr "o arg chr() está fora do intervalo(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "o círculo só pode ser registrado em um pai" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "O ponto do clipe deve ser uma tupla (x, y)" @@ -3133,6 +2843,10 @@ msgstr "os argumentos convolutivos devem ser ndarrays" msgid "convolve arguments must not be empty" msgstr "os argumentos convolutivos não devem estar vazios" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "arquivo corrompido" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "não foi possível inverter a matriz Vandermonde" @@ -3219,10 +2933,6 @@ msgstr "divido por zero" msgid "division by zero" msgstr "divisão por zero" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "o divisor deve ser 4" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "dtype deve ser flutuante ou complexo" @@ -3231,6 +2941,10 @@ msgstr "dtype deve ser flutuante ou complexo" msgid "empty" msgstr "vazio" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "arquivo vazio" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "a área de alocação dinâmica de variáveis (heap) está vazia" @@ -3260,6 +2974,14 @@ msgstr "O epoch_time não é compatível com esta placa" msgid "error = 0x%08lX" msgstr "erro = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" +"esp32_camera.Camera requer que uma reserva PSRAM seja configurada. Consulte " +"a documentação para obter mais informações." + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "as exceções devem derivar a partir do BaseException" @@ -3334,7 +3056,7 @@ msgstr "o primeiro argumento deve ser uma função" msgid "first argument must be a tuple of ndarrays" msgstr "o primeiro argumento deve ser um tuple de ndarrays" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "o primeiro argumento deve ser um ndarray" @@ -3370,6 +3092,10 @@ msgstr "a fonte deve ter 2048 bytes de comprimento" msgid "format requires a dict" msgstr "formato requer um dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "nesta placa, a frequência é de apenas leitura" + #: py/objdeque.c msgid "full" msgstr "cheio" @@ -3478,7 +3204,7 @@ msgstr "a chave do formato está incompleto" msgid "incorrect padding" msgstr "preenchimento incorreto" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "o índice está fora dos limites" @@ -3496,6 +3222,10 @@ msgstr "os índices devem ser inteiros" msgid "indices must be integers, slices, or Boolean lists" msgstr "os índices devem ser números inteiros, fatias ou listas booleanas" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "inicialização do I2C" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "os valores iniciais devem ser iteráveis" @@ -3542,6 +3272,10 @@ msgstr "a matriz da entrada é assimétrica" msgid "input matrix is singular" msgstr "a matriz da entrada é singular" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "a entrada deve ser 1- ou 2-d" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "a entrada deve ser um 1D ndarray" @@ -3550,11 +3284,7 @@ msgstr "a entrada deve ser um 1D ndarray" msgid "input must be a dense ndarray" msgstr "a entrada deve ser um ndarray denso" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "a entrada dos dados deve ser um tensor de nível 2" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "a entrada deve ser um ndarray" @@ -3634,6 +3364,10 @@ msgstr "o nome do host é inválido" msgid "invalid micropython decorator" msgstr "o decorador micropython é inválido" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "configuração inválida" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "passo inválido" @@ -3750,10 +3484,6 @@ msgstr "erro de domínio matemático" msgid "matrix is not positive definite" msgstr "a matriz não é definitiva positiva" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "max_connections deve estar entre 0 e 10" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3761,13 +3491,9 @@ msgstr "max_connections deve estar entre 0 e 10" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "o max_length deve ser 0-%d quando Fixed_length for %s" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "max_length deve ser >= 0" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "O número máximo de dimensões são 4" +msgid "maximum number of dimensions is " +msgstr "a quantidade máxima de dimensões é " #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3902,7 +3628,7 @@ msgstr "nenhum pino de redefinição está disponível" msgid "no response from SD card" msgstr "não houve resposta do cartão SD" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "não há tal atributo" @@ -4013,7 +3739,11 @@ msgstr "é necessário objeto com protocolo do buffer" msgid "odd-length string" msgstr "sequência com comprimento ímpar" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "desligado" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "o offset é muito grande" @@ -4142,10 +3872,6 @@ msgstr "o pixel_shader deve ser displayio.Palette ou displayio.ColorConverter" msgid "poll on file not available on win32" msgstr "a sondagem no arquivo não está disponível no win32" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "o polígono só pode ser registrado em um pai" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop a partir de um PulseIn vazio" @@ -4171,63 +3897,23 @@ msgstr "O terceiro argumento pow() não pode ser 0" msgid "pow() with 3 arguments requires integers" msgstr "o pow() com 3 argumentos requer números inteiros" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "pressionando o botão BOOT na inicialização.\n" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "pressionando o botão SW38 na inicialização.\n" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "pressionando o botão VOLUME na inicialização.\n" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "pressionando o botão de boot na inicialização.\n" @@ -4247,14 +3933,6 @@ msgstr "pressionando o botão esquerdo durante a inicialização\n" msgid "pull masks conflict with direction masks" msgstr "puxe as máscaras em conflito com as máscaras de direção" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "O pull_threshold deve ser entre 1 e 32" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "O pull_threshold deve ser entre 1 e 32" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "estouro de fila" @@ -4306,14 +3984,6 @@ msgstr "argumento de enrolar deve ser um ndarray" msgid "rsplit(None,n)" msgstr "rsplit(Nenhum,n)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"O buffer sample_source deve ser um bytearray ou matriz do tipo 'h', 'H', 'b' " -"ou 'B'" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4411,10 +4081,6 @@ msgstr "o source_bitmap deve ter o value_count de 65536" msgid "source_bitmap must have value_count of 8" msgstr "o source_bitmap deve ter o value_count de 8" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "O ssid não pode ter mais do que 32 bytes" - #: py/objstr.c msgid "start/end indices" msgstr "os índices de início/fim" @@ -4427,10 +4093,6 @@ msgstr "start_x deve ser um int" msgid "step must be non-zero" msgstr "o passo deve ser diferente de zero" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "o stop deve ser 1 ou 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop não está acessível a partir do início" @@ -4479,10 +4141,6 @@ msgstr "houve um erro de sintaxe no descritor uctypes" msgid "threshold must be in the range 0-65536" msgstr "Limite deve estar no alcance de 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "o bloco deve ser maior que zero" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() leva uma sequência com 9" @@ -4502,10 +4160,6 @@ msgstr "o tempo limite deve ser entre 0.0 a 100.0 segundos" msgid "timeout must be < 655.35 secs" msgstr "o tempo limite deve ser < 655.35 seg" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "o tempo limite deve ser >= 0,0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "o tempo limite na espera pelo cartão v1" @@ -4514,6 +4168,10 @@ msgstr "o tempo limite na espera pelo cartão v1" msgid "timeout waiting for v2 card" msgstr "o tempo limite na espera pelo cartão v2" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "reinicialização do temporizador" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp fora do intervalo para a plataforma time_t" @@ -4684,6 +4342,14 @@ msgstr "tipo não compatível para o operador" msgid "unsupported types for %q: '%q', '%q'" msgstr "tipo sem suporte para %q: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "usecols é muito alto" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "palavra-chave para o usecols deve ser definida" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4705,13 +4371,7 @@ msgstr "o watchdog não foi inicializado" msgid "watchdog timeout must be greater than 0" msgstr "o tempo limite do watchdog deve ser maior que 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "a largura deve ser entre 2 a 8 (inclusive), não %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "a largura deve ser maior que zero" @@ -4731,7 +4391,17 @@ msgstr "índice do eixo errado" msgid "wrong axis specified" msgstr "um eixo errado foi definido" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "dtype errado" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "tipo do índice errado" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "tipo da entrada incorreta" @@ -4739,6 +4409,10 @@ msgstr "tipo da entrada incorreta" msgid "wrong length of condition array" msgstr "comprimento errado na condição da matriz" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "comprimento errado do índice da matriz" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "quantidade errada dos argumentos" @@ -4783,6 +4457,390 @@ 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 "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "O buffer sample_source deve ser um bytearray ou matriz do tipo 'h', 'H', " +#~ "'b' ou 'B'" + +#~ msgid "Expected an alarm" +#~ msgstr "Um alarme era esperado" + +#~ msgid "All I2C targets are in use" +#~ msgstr "Todos os alvos I2C já estão em uso" + +#~ msgid "Failed to init wifi" +#~ msgstr "Houve uma falha ao iniciar o wifi" + +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "a entrada dos dados deve ser um tensor de nível 2" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "O número máximo de dimensões são 4" + +#~ msgid "Watchdog timer expired." +#~ msgstr "O temporizador Watchdog expirou." + +#~ msgid "ssid can't be more than 32 bytes" +#~ msgstr "O ssid não pode ter mais do que 32 bytes" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q deve ser uma tupla de comprimento 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q deve estar entre %d e %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q deve ser um int" + +#~ msgid "(x,y) integers required" +#~ msgstr "(x,y) é obrigatório o uso de números inteiros" + +#~ msgid "Address type out of range" +#~ msgstr "O tipo do endereço está fora do alcance" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "O AnalogIn não é compatível no pino informado" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Funcionalidade AnalogOut não suportada" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "O AnalogOut é de apenas 16 bits. O valor deve ser menor que 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "Saída analógica não suportada no pino fornecido" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "A profundidade dos bits deve ser de 1 até 6 inclusive, porém não %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Buffer de tamanho incorreto. Deve ser %d bytes." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "O comprimento do buffer deve ter pelo menos 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Os bytes devem estar entre 0 e 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Não é possível emitir os dois canais no mesmo pino" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Não é possível ler sem o pino MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Não é possível redefinir para o bootloader porque o mesmo não está " +#~ "presente." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Não é possível transferir sem os pinos MOSI e MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Não é possível fazer a escrita sem um pino MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Inicialização do pino de Clock falhou." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "O comando deve ser um int entre 0 e 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Não foi possível inicializar a Câmera" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Não foi possível inicializar o GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Não foi possível inicializar o SDCard" + +#~ msgid "Could not initialize UART" +#~ msgstr "Não foi possível inicializar o UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Não foi possível reiniciar o canal" + +#~ msgid "Could not re-init timer" +#~ msgstr "Não foi possível reiniciar o temporizador" + +#~ msgid "Could not restart PWM" +#~ msgstr "Não foi possível reiniciar o PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Não pôde alocar primeiro buffer" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Não foi possível alocar o buffer de entrada" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Não pôde alocar segundo buffer" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "O DigitalInOut não é compatível em um determinado pino" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Tupla esperada com comprimento %d, obteve %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Falha ao alocar buffer RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Falha ao alocar buffer RX de %d bytes" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "O Framebuffer requer %d bytes" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "O nome do host deve ter entre 1 e 253 caracteres" + +#~ msgid "I2C Init Error" +#~ msgstr "Erro de inicialização do I2C" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Seleção inválida dos pinos %q" + +#~ msgid "Invalid AuthMode" +#~ msgstr "AuthMode inválido" + +#~ msgid "Invalid BMP file" +#~ msgstr "Arquivo BMP inválido" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "O pino DAC informado é inválido" + +#~ msgid "Invalid MIDI file" +#~ msgstr "O arquivo MIDI é inválido" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Frequência PWM inválida" + +#~ msgid "Invalid Pin" +#~ msgstr "Pino inválido" + +#~ msgid "Invalid buffer size" +#~ msgstr "O tamanho do buffer é inválido" + +#~ msgid "Invalid byteorder string" +#~ msgstr "A cadeia de bytes é inválida" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "O período de captura é inválido. O intervalo válido é: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "A contagem do canal é inválido" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "data_count %d inválido" + +#~ msgid "Invalid direction." +#~ msgstr "Direção inválida." + +#~ msgid "Invalid file" +#~ msgstr "Arquivo inválido" + +#~ msgid "Invalid mode" +#~ msgstr "Modo inválido" + +#~ msgid "Invalid number of bits" +#~ msgstr "Número inválido de bits" + +#~ msgid "Invalid phase" +#~ msgstr "Fase Inválida" + +#~ msgid "Invalid pin" +#~ msgstr "Pino inválido" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Pino inválido para canal esquerdo" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Pino inválido para canal direito" + +#~ msgid "Invalid polarity" +#~ msgstr "Polaridade inválida" + +#~ msgid "Invalid properties" +#~ msgstr "Propriedades inválidas" + +#~ msgid "Invalid run mode." +#~ msgstr "O modo de execução é inválido." + +#~ msgid "Invalid security_mode" +#~ msgstr "O Security_mode é inválido" + +#~ msgid "Invalid voice" +#~ msgstr "A voz é inválida" + +#~ msgid "Invalid voice count" +#~ msgstr "A contagem da voz é inválida" + +#~ msgid "Invalid wave file" +#~ msgstr "Aqruivo de ondas inválido" + +#~ msgid "Invalid word/bit length" +#~ msgstr "O comprimento do bit/palavra são inválidos" + +#~ msgid "Layer already in a group." +#~ msgstr "A camada já existe em um grupo." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "A camada deve ser uma subclasse Group ou TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "A inicialização do pino MISO falhou." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Inicialização do pino MOSI falhou." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "As mensagens estão limitadas a 8 bytes" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "Mais de %d reportam ids não compatíveis" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Sem suporte de hardware no pino de clock" + +#~ msgid "No hardware support on pin" +#~ msgstr "Nenhum suporte de hardware no pino" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "O buffer de saída deve ter ao menos %d bytes" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "O duty_cycle do PWM deve estar entre 0 e inclusive 65535 (com resolução " +#~ "de 16 bits)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "A contagem dos pinos deve ser com pelo menos 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "O pino não tem recursos de ADC" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "O programa deve conter pelo menos uma instrução com 16 bits." + +#~ msgid "Program too large" +#~ msgstr "O programa é muito grande" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "Ainda não há suporte para o RS485 neste dispositivo" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "A calibração RTC não é suportada nesta placa" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 Ainda não é compatível neste dispositivo" + +#~ msgid "SPI Init Error" +#~ msgstr "Houve um erro na inicialização SPI" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "Houve um erro na reinicialização SPI" + +#~ msgid "Sample rate must be positive" +#~ msgstr "A taxa de amostragem deve ser positiva" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Taxa de amostragem muito alta. Deve ser menor que %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "A definição da contagem dos pinos deve estar entre 1 e 5" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "" +#~ "A definição da contagem dos pinos do conjunto lateral deve estar entre 1 " +#~ "e 5" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "O tamanho da pilha deve ser pelo menos 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "O valor do bloco está fora dos limites" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "Houve um erro na alocação do Buffer UART" + +#~ msgid "UART De-init error" +#~ msgstr "Houve um erro da não inicialização do UART" + +#~ msgid "UART Init Error" +#~ msgstr "Houve um erro na inicialização do UART" + +#~ msgid "UART Re-init error" +#~ msgstr "Houve um erro na reinicialização do UART" + +#~ msgid "UART write error" +#~ msgstr "Houve um erro na gravação UART" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Taxa de transmissão não suportada" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "A senha do Wi-Fi deve ter entre 8 e 63 caracteres" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "os bits devem estar na faixa entre 5 a 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "bytes > 8 bits não suportado" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "Valor de calibração fora do intervalo +/- 127" + +#~ msgid "can only be registered in one parent" +#~ msgstr "pode ser registrado apenas numa principal" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "o círculo só pode ser registrado em um pai" + +#~ msgid "max_connections must be between 0 and 10" +#~ msgstr "max_connections deve estar entre 0 e 10" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length deve ser >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "o polígono só pode ser registrado em um pai" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "O pull_threshold deve ser entre 1 e 32" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "O pull_threshold deve ser entre 1 e 32" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "o stop deve ser 1 ou 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "o bloco deve ser maior que zero" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "o tempo limite deve ser >= 0,0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "a largura deve ser entre 2 a 8 (inclusive), não %d" + +#~ msgid "Unsupported operation" +#~ msgstr "Operação não suportada" + +#~ msgid "divisor must be 4" +#~ msgstr "o divisor deve ser 4" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" @@ -5343,9 +5401,6 @@ msgstr "zi deve estar na forma (n_section, 2)" #~ msgid "wrong argument type" #~ msgstr "tipo do argumento errado" -#~ msgid "wrong index type" -#~ msgstr "tipo do índice errado" - #~ msgid "specify size or data, but not both" #~ msgstr "defina o tamanho ou os dados, porém não ambos" diff --git a/locale/ru.po b/locale/ru.po index cc26975101..7ee166c7ed 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-02-14 18:08+0000\n" -"Last-Translator: Clay \n" +"PO-Revision-Date: 2022-04-06 13:37+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: none\n" "Language: ru\n" "MIME-Version: 1.0\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.11-dev\n" +"X-Generator: Weblate 4.12-dev\n" #: main.c msgid "" @@ -74,10 +74,27 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "%d адресные пины, %d rgb пины и %d плитки указывают высоту %d а не %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q и %q содержат пины-дупликаты" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q содержит пины-дупликаты" @@ -90,12 +107,7 @@ msgstr "%q сбой: %d" msgid "%q in use" msgstr "%q используется" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Индекс %q вне диапазона" @@ -103,18 +115,42 @@ msgstr "Индекс %q вне диапазона" msgid "%q indices must be integers, not %s" msgstr "Индексы %q должны быть целыми числами, а не %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "Длинна %q должна быть %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "Длинна %q должна быть >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q должен быть %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q должен быть <= %d" @@ -123,30 +159,26 @@ msgstr "%q должен быть <= %d" msgid "%q must be >= %d" msgstr "%q должен быть >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q должен быть >= 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q должен быть >= 1" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "%q должен быть строкой" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q должен быть кортежем длинной 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q должен быть между %d и %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "" #: py/argcheck.c msgid "%q must be of type %q" @@ -164,7 +196,11 @@ msgstr "%q должен быть во 2-й степени" msgid "%q out of bounds" msgstr "%q за пределом" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q вне диапазона" @@ -173,10 +209,6 @@ msgstr "%q вне диапазона" msgid "%q pin invalid" msgstr "Пин %q не допустим" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q должен быть int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q с идентификатором отчёта 0 должен иметь длину 1" @@ -189,7 +221,11 @@ msgstr "%q() принимает %d позиционных аргументов, msgid "%q, %q, and %q must all be the same length" msgstr "%q, %q, и %q должны быть одной длинны" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s ошибка 0x%x" @@ -212,7 +248,7 @@ msgstr "Объект '%q' не является вызываемым" #: py/runtime.c msgid "'%q' object is not iterable" -msgstr "Объект '%q'не является итерируемым" +msgstr "Объект '%q' не является итерируемым" #: py/emitinlinethumb.c py/emitinlinextensa.c #, c-format @@ -339,10 +375,6 @@ msgstr "'yield from' внутри асинхронной функции" msgid "'yield' outside function" msgstr "'yield' вне функции" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "Требуются целые числа (x,y)" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x должно быть целью назначения" @@ -378,16 +410,12 @@ msgstr "ADC2 используется WiFi" msgid "Address must be %d bytes long" msgstr "Адрес должен быть длиной %d байт" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Тип адреса вне диапазона" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Все периферийные устройства CAN уже используются" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Все периферийные устройства I2C уже используются" @@ -424,7 +452,6 @@ msgstr "Все каналы уже используются" msgid "All event channels in use" msgstr "Все каналы событий уже используются" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "Все машины состояний уже используются" @@ -472,25 +499,6 @@ msgstr "Уже запущен" msgid "Already scanning for wifi networks" msgstr "Поиск сетей wifi уже происходит" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn не поддерживается на данном пине" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Функциональность AnalogOut не поддерживается" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut имеет только 16 бит. Значение должно быть меньше 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut не поддерживается на данном пине" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Другой PWMAudioOut уже активен" @@ -529,7 +537,7 @@ msgstr "Преобразование звука не реализовано" msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN не используется с паролем" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Ошибка аутентификации" @@ -566,11 +574,6 @@ msgstr "" "Битовый тактовый генератор и выбор слова должны использовать один источник " "тактирования" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Битовая глубина должна быть от 1 до 6 включительно, а не %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Битовая глубина должна быть кратна 8." @@ -612,11 +615,6 @@ msgstr "Буфер + сдвиг слишком малы %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Элементы буфера должны иметь длину не более 4 байт" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Неправильный размер буфера. Должен быть %d байт." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Буфер не является байтовым массивом (bytearray)." @@ -626,7 +624,6 @@ msgstr "Буфер не является байтовым массивом (byte msgid "Buffer is too small" msgstr "Буфер слишком мал" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -637,14 +634,10 @@ msgstr "Размер буфера %d слишком большой. Он дол msgid "Buffer length must be a multiple of 512" msgstr "Размер буфера должен быть кратен 512" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "Буфер должен быть кратен 512" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Буфер должен быть размером не менее 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -666,10 +659,6 @@ msgstr "Пин шины %d уже используется" msgid "Byte buffer must be 16 bytes." msgstr "Буфер байтов должен быть размером 16 байтам." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes должен быть в диапазоне от 0 до 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "Блоки CBC должны быть кратны 16 байтам" @@ -678,7 +667,7 @@ msgstr "Блоки CBC должны быть кратны 16 байтам" msgid "CIRCUITPY drive could not be found or created." msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC или контрольная сумма неправильная" @@ -686,6 +675,10 @@ msgstr "CRC или контрольная сумма неправильная" msgid "Call super().__init__() before accessing native object." msgstr "Вызовите super().__init__() перед обращением к родному объекту." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "Сигнал из глубокого сна может подаваться только на пине RTC IO." @@ -739,19 +732,11 @@ msgstr "" "Невозможно иметь ответы сканирования для расширенных, подключаемых " "объявлений (advertisements)." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Невозможно вывести оба канала на один пин" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" "Невозможно установить подтяжку на пине, предназначенном только для ввода." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Считывание невозможно без пина MISO." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Невозможно записать в файл" @@ -763,8 +748,8 @@ msgstr "Невозможно перемонтировать '/' пока он в #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Невозможно перезагрузится в загрузчик так как он отсутствует." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -784,22 +769,21 @@ msgid "Cannot subclass slice" msgstr "Срез субкласса невозможен" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Передача данных невозможна без пинов MOSI и MISO." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Невозможно изменить частоту на таймере, который уже используется" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Невозможно проснуться по спаду/росту на пине. Только по уровню." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Запись невозможна без пина MOSI." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Запись в CharacteristicBuffer не предусмотрена" @@ -812,10 +796,6 @@ msgstr "Код ядра CircuitPython сильно крашнулся. Упс!\n msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython не смог выделить heap." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Не удалось инициализировать пин Clock." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Длинна такта слишком велика" @@ -824,11 +804,6 @@ msgstr "Длинна такта слишком велика" msgid "Clock unit in use" msgstr "Источник тактирования уже используется" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Команда должна быть целым числом (int) от 0 до 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -841,35 +816,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Файл .mpy поврежден" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Не удалось инициализировать камеру" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Не удалось инициализировать GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Не удалось инициализировать SD карту" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Не удалось инициализировать UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Не удалось повторно инициализировать канал" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Не удалось повторно инициализировать таймер" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Не удалось перезапустить ШИМ" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Не удалось извлечь тактирование" @@ -890,20 +836,6 @@ msgstr "Не удалось запустить прерывание, RX заня msgid "Couldn't allocate decoder" msgstr "Не удалось выделить место для декодера" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Не удалось выделить первый буфер" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Не удалось выделить входной буфер" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Не удалось выделить второй буфер" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Крашнулся в HardFault_Handler." @@ -953,10 +885,6 @@ msgstr "Емкость destination меньше, чем destination_length." msgid "Device in use" msgstr "Устройство используется" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut не поддерживается на данном пине" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -968,6 +896,10 @@ msgstr "Дисплей должен иметь 16-битное цветовое msgid "Display rotation must be in 90 degree increments" msgstr "Поворот дисплея должен осуществляться с шагом 90 градусов" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "Drive mode не используется, когда направление является входным." @@ -1003,19 +935,15 @@ msgstr "Ошибка: Сбой привязки" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Ожидалось(ся) %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "Ожидался сигнал" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Ожидался кортеж длины %d, получен %d" +msgid "Expected an %q" +msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1043,21 +971,9 @@ msgstr "Не удалось отправить команду." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Не удалось получить mutex, ошибка 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Не удалось выделить буфер RX" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Не удалось выделить буфер RX размером %d байт" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1080,10 +996,6 @@ msgstr "Не удалось подключиться: внутренняя ош msgid "Failed to connect: timeout" msgstr "Не удалось подключиться: тайм-аут" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "Не удалось инициировать wifi" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Не удалось распарсить файл MP3" @@ -1129,10 +1041,10 @@ msgstr "" msgid "Format not supported" msgstr "Формат не поддерживается" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Фреймбуфер требует %d байт" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1145,7 +1057,11 @@ msgstr "" msgid "Function requires lock" msgstr "Функция требует блокировки" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Общий сбой" @@ -1172,19 +1088,16 @@ msgstr "Оборудование занято, попробуйте исполь msgid "Hardware in use, try alternative pins" msgstr "Оборудование используется, попробуйте использовать другие пины" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "Имя хоста должно содержать от 1 до 253 символов" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Операция ввода-вывода на закрытом файле" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "Ошибка инициализации I2C" +msgid "I2C init error" +msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "Периферийное устройство I2C уже используется" @@ -1296,75 +1209,37 @@ msgstr "Внутренняя ошибка" msgid "Internal error #%d" msgstr "Внутренняя ошибка #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "Недопустимый %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Недопустимый пин %q" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Неверный выбор пина %q" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Недопустимое значение единицы АЦП" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "Недопустимый AuthMode" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Недопустимый параметр BLE" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Неправилный файл BMP" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Неверный BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Передан неверный пин ЦАП" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "Неверный MAC-адрес" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Неверный MIDI-файл" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Недопустимая частота ШИМ" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Неверный пин" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Недопустимый аргумент" @@ -1372,42 +1247,11 @@ msgstr "Недопустимый аргумент" msgid "Invalid bits per value" msgstr "Недопустимое бит-на-значение" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Неверный размер буфера" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Недействительная строка byteorder" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Неверный период захвата. Допустимый диапазон: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Недействительное количество каналов" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "Недействительный data_count %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "Неверный data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Неверное направление." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Неверный файл" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Неверный размер блока формата" @@ -1416,79 +1260,15 @@ msgstr "Неверный размер блока формата" msgid "Invalid memory access." msgstr "Неправильный доступ к памяти." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "Неверный MAC-адрес multicast" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Неверное количество бит" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Неверная фаза" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Недопустимый пин" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Недопустимый пин для левого канала" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Недопустимый пин для правого канала" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Недопустимые пины" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Неправильная полярность" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Недопустимые свойства" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Неверный режим работы." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Неверный security_mode" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Неверный размер" @@ -1496,27 +1276,10 @@ msgstr "Неверный размер" msgid "Invalid socket for TLS" msgstr "Неверный сокет для TLS" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Неверное состояние" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Неверный voice" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Неверный счетчик voice" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Неверный wave-файл" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Недопустимая длина слова/бита" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Ключ должен быть длинной 16, 24 или 32 байта" @@ -1530,25 +1293,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS ключевого слова arg должен быть идентификатором(id)" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Слой уже в группе." +msgid "Layer already in a group" +msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Слой должен быть группой (Group) или субклассом TileGrid." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC адрес был недействительным" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "Не удалось инициализировать пин MISO." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "Не удалось инициализировать пин MOSI." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1558,18 +1313,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "Максимальное значение x при зеркальном отображении - %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Сообщения ограничены 8 байтами" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Задержка включения микрофона должна быть в диапазоне от 0.0 до 1.0" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Отсутствует пин MISO или MOSI" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1606,11 +1370,6 @@ msgstr "Отсутствует first_set_pin. Инструкция %d устан msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "Отсутствует jmp_pin. Инструкция %d перепрыгивает на пин" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "Не поддерживается более %d идентификаторов отчетов (report ids)" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Должен быть субклассом %q." @@ -1636,6 +1395,10 @@ msgstr "Ошибка NVS" msgid "Name too long" msgstr "Имя слишком длинное" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1666,16 +1429,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Нет пина MISO" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Нет пина MOSI" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1714,16 +1489,6 @@ msgstr "Свободные GCLK отсутствуют" msgid "No hardware random available" msgstr "Отсутствует аппаратный генератор случайных чисел" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Отсутствует аппаратная поддержка пина clk" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Отсутствует аппаратная поддержка на пине" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "Нет in в программе" @@ -1769,6 +1534,10 @@ msgstr "Отсутствует подтяжка к земле на пине; Р msgid "No space left on device" msgstr "На устройстве не осталось свободного места" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Файл/директория не существует" @@ -1820,6 +1589,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1829,7 +1606,7 @@ msgstr "Только 8- или 16-битное моно с " msgid "Only IPv4 addresses supported" msgstr "Поддерживаются только адреса IPv4" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "Поддерживаются только сокеты IPv4" @@ -1864,15 +1641,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1880,19 +1661,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1900,11 +1685,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1915,12 +1695,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1939,29 +1718,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "Пин не может вывести из глубокого сна" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "Количество пинов должно быть не менее 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Слишком большое количество пинов" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Пин не имеет возможности АЦП" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2033,18 +1797,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2066,8 +1822,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2075,21 +1832,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "" @@ -2107,10 +1853,14 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "" @@ -2123,7 +1873,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2139,6 +1889,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2149,29 +1903,20 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2192,14 +1937,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "Число Set пинов должно быть от 1 до 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2235,10 +1972,6 @@ msgstr "Укажите точно один из data0 или data_pins" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2326,10 +2059,6 @@ msgstr "" msgid "Tile index out of bounds" msgstr "" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "" @@ -2349,6 +2078,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2381,23 +2113,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2534,12 +2263,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2552,8 +2275,8 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c @@ -2574,7 +2297,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2604,10 +2327,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2618,8 +2337,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2660,11 +2379,11 @@ msgstr "" msgid "a bytes-like object is required" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "" @@ -2713,6 +2432,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2774,10 +2497,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2815,11 +2534,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2828,7 +2542,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2836,12 +2550,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2864,7 +2575,7 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -3012,6 +2723,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -3024,10 +2739,6 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3092,6 +2803,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3175,10 +2890,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3187,6 +2898,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3216,6 +2931,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "" @@ -3290,7 +3011,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3326,6 +3047,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" @@ -3434,7 +3159,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3452,6 +3177,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3497,6 +3226,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3505,11 +3238,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3589,6 +3318,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "" @@ -3702,10 +3435,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3713,12 +3442,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3852,7 +3577,7 @@ msgstr "нет доступного контакта сброса" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "" @@ -3963,7 +3688,11 @@ msgstr "" msgid "odd-length string" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4087,10 +3816,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4116,63 +3841,23 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4192,14 +3877,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4251,12 +3928,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4354,10 +4025,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" @@ -4370,10 +4037,6 @@ msgstr "" msgid "step must be non-zero" msgstr "" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4422,10 +4085,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4445,10 +4104,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4457,6 +4112,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4627,6 +4286,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4648,13 +4315,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4674,7 +4335,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4682,6 +4353,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -4726,6 +4401,244 @@ msgstr "zi должно быть типа float" msgid "zi must be of shape (n_section, 2)" msgstr "zi должен иметь форму (n_section, 2)" +#~ msgid "Expected an alarm" +#~ msgstr "Ожидался сигнал" + +#~ msgid "Failed to init wifi" +#~ msgstr "Не удалось инициировать wifi" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q должен быть кортежем длинной 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q должен быть между %d и %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q должен быть int" + +#~ msgid "(x,y) integers required" +#~ msgstr "Требуются целые числа (x,y)" + +#~ msgid "Address type out of range" +#~ msgstr "Тип адреса вне диапазона" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn не поддерживается на данном пине" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Функциональность AnalogOut не поддерживается" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut имеет только 16 бит. Значение должно быть меньше 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut не поддерживается на данном пине" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Битовая глубина должна быть от 1 до 6 включительно, а не %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Неправильный размер буфера. Должен быть %d байт." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Буфер должен быть размером не менее 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes должен быть в диапазоне от 0 до 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Невозможно вывести оба канала на один пин" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Считывание невозможно без пина MISO." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Невозможно перезагрузится в загрузчик так как он отсутствует." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Передача данных невозможна без пинов MOSI и MISO." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Запись невозможна без пина MOSI." + +#~ msgid "Clock pin init failed." +#~ msgstr "Не удалось инициализировать пин Clock." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Команда должна быть целым числом (int) от 0 до 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Не удалось инициализировать камеру" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Не удалось инициализировать GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Не удалось инициализировать SD карту" + +#~ msgid "Could not initialize UART" +#~ msgstr "Не удалось инициализировать UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Не удалось повторно инициализировать канал" + +#~ msgid "Could not re-init timer" +#~ msgstr "Не удалось повторно инициализировать таймер" + +#~ msgid "Could not restart PWM" +#~ msgstr "Не удалось перезапустить ШИМ" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Не удалось выделить первый буфер" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Не удалось выделить входной буфер" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Не удалось выделить второй буфер" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut не поддерживается на данном пине" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Ожидался кортеж длины %d, получен %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Не удалось выделить буфер RX" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Не удалось выделить буфер RX размером %d байт" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Фреймбуфер требует %d байт" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Имя хоста должно содержать от 1 до 253 символов" + +#~ msgid "I2C Init Error" +#~ msgstr "Ошибка инициализации I2C" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Неверный выбор пина %q" + +#~ msgid "Invalid AuthMode" +#~ msgstr "Недопустимый AuthMode" + +#~ msgid "Invalid BMP file" +#~ msgstr "Неправилный файл BMP" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Передан неверный пин ЦАП" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Неверный MIDI-файл" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Недопустимая частота ШИМ" + +#~ msgid "Invalid Pin" +#~ msgstr "Неверный пин" + +#~ msgid "Invalid buffer size" +#~ msgstr "Неверный размер буфера" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Недействительная строка byteorder" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Неверный период захвата. Допустимый диапазон: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Недействительное количество каналов" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "Недействительный data_count %d" + +#~ msgid "Invalid direction." +#~ msgstr "Неверное направление." + +#~ msgid "Invalid file" +#~ msgstr "Неверный файл" + +#~ msgid "Invalid number of bits" +#~ msgstr "Неверное количество бит" + +#~ msgid "Invalid phase" +#~ msgstr "Неверная фаза" + +#~ msgid "Invalid pin" +#~ msgstr "Недопустимый пин" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Недопустимый пин для левого канала" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Недопустимый пин для правого канала" + +#~ msgid "Invalid polarity" +#~ msgstr "Неправильная полярность" + +#~ msgid "Invalid properties" +#~ msgstr "Недопустимые свойства" + +#~ msgid "Invalid run mode." +#~ msgstr "Неверный режим работы." + +#~ msgid "Invalid security_mode" +#~ msgstr "Неверный security_mode" + +#~ msgid "Invalid voice" +#~ msgstr "Неверный voice" + +#~ msgid "Invalid voice count" +#~ msgstr "Неверный счетчик voice" + +#~ msgid "Invalid wave file" +#~ msgstr "Неверный wave-файл" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Недопустимая длина слова/бита" + +#~ msgid "Layer already in a group." +#~ msgstr "Слой уже в группе." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Слой должен быть группой (Group) или субклассом TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "Не удалось инициализировать пин MISO." + +#~ msgid "MOSI pin init failed." +#~ msgstr "Не удалось инициализировать пин MOSI." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Сообщения ограничены 8 байтами" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "Не поддерживается более %d идентификаторов отчетов (report ids)" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Отсутствует аппаратная поддержка пина clk" + +#~ msgid "No hardware support on pin" +#~ msgstr "Отсутствует аппаратная поддержка на пине" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "Количество пинов должно быть не менее 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Пин не имеет возможности АЦП" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "Число Set пинов должно быть от 1 до 5" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/sv.po b/locale/sv.po index 9a2925f6f6..03c918a6be 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: 2022-03-23 08:58+0000\n" +"PO-Revision-Date: 2022-09-16 18:51+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.12-dev\n" +"X-Generator: Weblate 4.14.1-dev\n" #: main.c msgid "" @@ -74,10 +74,27 @@ msgid "" msgstr "" "%d adresspinnar, %d rgb-pinnar och %d brickor anger en höjd på %d, inte %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "%q" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q och %q innehåller duplicerade pinnar" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "%q och %q måste vara olika" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q innehåller dubblettstift" @@ -90,12 +107,7 @@ msgstr "%q-fel: %d" msgid "%q in use" msgstr "%q används redan" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "Index %q ligger utanför intervallet" @@ -103,18 +115,42 @@ msgstr "Index %q ligger utanför intervallet" msgid "%q indices must be integers, not %s" msgstr "Indexet %q måste vara ett heltal, inte %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "%q init misslyckades" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "längden på %q måste vara %d" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "längden på %q måste vara %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "längden på %q måste vara <= %d" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "längden på %q måste vara >= %d" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "längden på %q måste vara >= 1" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "%q måste vara %d" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q måste vara %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "%q måste vara 1 när %q är sann" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q måste vara <= %d" @@ -123,30 +159,28 @@ msgstr "%q måste vara <= %d" msgid "%q must be >= %d" msgstr "%q måste vara >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q måste vara >= 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q måste vara >= 1" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" +"%q måste vara en bytearray eller en array av typen \"h\", \"H\", \"b\" eller " +"\"B\"" + #: py/argcheck.c msgid "%q must be a string" msgstr "%q måste vara en sträng" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q måste vara en tuple av längd 2" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q måste vara mellan %d och %d" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "%q måste vara en int" #: py/argcheck.c msgid "%q must be of type %q" @@ -164,7 +198,11 @@ msgstr "%q måste vara en potens av 2" msgid "%q out of bounds" msgstr "%q är utanför gränserna" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q utanför intervallet" @@ -173,10 +211,6 @@ msgstr "%q utanför intervallet" msgid "%q pin invalid" msgstr "Pinne %q ogiltig" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q ska vara en int" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "%q med report-ID 0 måste ha längd 1" @@ -189,7 +223,11 @@ msgstr "% q() tar %d positionsargument men %d gavs" msgid "%q, %q, and %q must all be the same length" msgstr "%q, %q och %q måste vara lika långa" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "%q=%q" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s fel 0x%x" @@ -339,10 +377,6 @@ msgstr "'yield from' i async-funktion" msgid "'yield' outside function" msgstr "'yield' utanför funktion" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "(x,y) heltal krävs" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x måste vara mål för tilldelning" @@ -378,16 +412,12 @@ msgstr "ADC2 används av WiFi" msgid "Address must be %d bytes long" msgstr "Adressen måste vara %d byte lång" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Adresstyp utanför intervallet" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "All I2C-kringutrustning används" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" @@ -424,7 +454,6 @@ msgstr "Alla kanaler används" msgid "All event channels in use" msgstr "Alla händelsekanaler används" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "Alla tillståndsmaskiner används" @@ -472,25 +501,6 @@ msgstr "Kör redan" msgid "Already scanning for wifi networks" msgstr "Skannar redan efter wifi-nätverk" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "AnalogIn stöds inte på angiven pinne" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut-funktionalitet stöds inte" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut hanterar bara 16 bitar. Värdet måste vara mindre än 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "AnalogOut stöds inte på angiven pinne" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "En annan PWMAudioOut är redan aktiv" @@ -529,7 +539,7 @@ msgstr "Ljudkonvertering inte implementerad" msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN används inte med lösenord" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Autentiseringsfel" @@ -562,11 +572,6 @@ msgstr "Bitklocka och word select måste vara sekventiella pinnar" msgid "Bit clock and word select must share a clock unit" msgstr "Bitklocka och ordval måste dela en klockenhet" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "Bitdjup måste vara inom 1 till 6, inte %d" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "Bitdjup måste vara multipel av 8." @@ -608,11 +613,6 @@ msgstr "Buffert + offset för liten %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "Buffertelement måste vara fyra byte långa eller mindre" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Buffert har felaktig storlek. Ska vara %d byte." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Buffert är inte en bytearray." @@ -622,7 +622,6 @@ msgstr "Buffert är inte en bytearray." msgid "Buffer is too small" msgstr "Bufferten är för liten" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -633,14 +632,10 @@ msgstr "Buffertlängd %d för stor. Den måste vara mindre än %d" msgid "Buffer length must be a multiple of 512" msgstr "Buffertlängd måste vara en multipel av 512" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "Bufferten måste vara en multipel av 512 byte" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Bufferten måste ha minst längd 1" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -662,10 +657,6 @@ msgstr "Busspinne %d används redan" msgid "Byte buffer must be 16 bytes." msgstr "Byte-buffert måste vara 16 byte." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Bytes måste vara mellan 0 och 255." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC-block måste vara multiplar om 16 byte" @@ -674,7 +665,7 @@ msgstr "CBC-block måste vara multiplar om 16 byte" msgid "CIRCUITPY drive could not be found or created." msgstr "CIRCUITPY-enheten kunde inte hittas eller skapas." -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC eller checksumma var ogiltig" @@ -682,6 +673,10 @@ msgstr "CRC eller checksumma var ogiltig" msgid "Call super().__init__() before accessing native object." msgstr "Anropa super().__init__() innan du använder det ursprungliga objektet." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "Kamera init" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "Kan bara larma på RTC-IO från djupsömn." @@ -731,18 +726,10 @@ msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" "Det går inte att ha skanningssvar för utökade, anslutningsbara aviseringar." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Det går inte att mata ut båda kanalerna på samma pinne" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Kan bara använda pull på pinne för input." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Kan inte läsa utan MISO-pinne." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Det går inte att spela in till en fil" @@ -754,9 +741,8 @@ msgstr "Det går inte att montera om '/' när den är synlig via USB." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "" -"Det går inte att återställa till bootloader eftersom bootloader saknas." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "Kan inte återställa till bootloader eftersom ingen bootloader finns" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" @@ -776,22 +762,21 @@ msgid "Cannot subclass slice" msgstr "Det går inte att subklassa slice" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Kan inte överföra utan MOSI- och MISO-pinnar." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "Det går inte att överföra utan MOSI- och MISO-pinnar" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Det går inte att ändra frekvensen på en timer som redan används" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "Kan inte vakna på pin edge, bara nivå" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "Kan inte vakna på nivåskift, enbart nivå." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Kan inte skriva utan MOSI-pinne." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Skrivning för CharacteristicBuffer är inte tillhandahållen" @@ -804,10 +789,6 @@ msgstr "CircuitPython kärnkod kraschade hårt. Hoppsan!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython kunde inte allokera heap." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Initiering av klockpinne misslyckades." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Klockförlängning för lång" @@ -816,11 +797,6 @@ msgstr "Klockförlängning för lång" msgid "Clock unit in use" msgstr "Klockenhet används" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Kommandot måste vara en int mellan 0 och 255" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -833,35 +809,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "Skadad .mpy-fil" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Kunde inte initiera Camera" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "Kan inte initiera GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "Kan inte initiera SD-kort" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Det gick inte att initiera UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Det gick inte att återinitiera kanalen" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Det gick inte att återinitiera timern" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Det gick inte att starta om PWM" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Kunde inte hämta klocka" @@ -882,20 +829,6 @@ msgstr "Det gick inte att starta avbrott, RX upptagen" msgid "Couldn't allocate decoder" msgstr "Det gick inte att allokera avkodaren" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Det gick inte att allokera den första bufferten" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Det gick inte att allokera indatabufferten" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Det gick inte att allokera den andra bufferten" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Krasch in i HardFault_Handler." @@ -943,10 +876,6 @@ msgstr "Målkapaciteten är mindre än destination_length." msgid "Device in use" msgstr "Enheten används redan" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "DigitalInOut stöds inte på given pinne" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -958,6 +887,10 @@ msgstr "Displayen måste ha en 16-bitars färgrymd." msgid "Display rotation must be in 90 degree increments" msgstr "Displayens rotation måste vara i steg om 90 grader" +#: main.c +msgid "Done" +msgstr "Klar" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "Drivläge används inte när riktning är input." @@ -993,19 +926,15 @@ msgstr "Fel: Bind misslyckades" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Förväntade %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "Förväntade ett larm" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Förväntad tupel med längd %d, fick %d" +msgid "Expected an %q" +msgstr "Förväntade en %q" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1033,21 +962,9 @@ msgstr "Det gick inte att skicka kommandot." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Det gick inte att förvärva mutex, fel 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Det gick inte att tilldela RX-buffert" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Det gick inte att allokera RX-bufferten på %d byte" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "Det gick inte att allokera buffert för %q" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1070,10 +987,6 @@ msgstr "Det gick inte att ansluta: internt fel" msgid "Failed to connect: timeout" msgstr "Det gick inte att ansluta: timeout" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "Kunde inte initiera WiFi" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Det gick inte att tolka MP3-filen" @@ -1117,23 +1030,29 @@ msgstr "För RGB-färgrymder måste indatabitmappen ha 16 bitar per pixel" msgid "Format not supported" msgstr "Formatet stöds inte" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "Framebuffer kräver %d byte" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" +"Frekvens måste vara en av 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 " +"eller 1008 Mhz" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" -msgstr "Frekvensen måste matcha befintlig PWMOut med denna timer" +msgstr "Frekvensen måste matcha befintlig PWMOut med den här timern" #: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c #: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c msgid "Function requires lock" -msgstr "Funktion kräver lås" +msgstr "Funktionen kräver lås" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "GNSS start" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" -msgstr "Generiskt fel" +msgstr "Allmänt fel" #: shared-bindings/displayio/Display.c #: shared-bindings/displayio/EPaperDisplay.c @@ -1158,19 +1077,16 @@ msgstr "Hårdvaran är upptagen, prova alternativa pinnar" msgid "Hardware in use, try alternative pins" msgstr "Hårdvaran används redan, prova alternativa pinnar" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "Hostname måste vara mellan 1 och 253 tecken" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "I/O-operation på stängd fil" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C init-fel" +msgid "I2C init error" +msgstr "I2C-initieringsfel" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "I2C-enhet används redan" @@ -1279,75 +1195,37 @@ msgstr "Internt fel" msgid "Internal error #%d" msgstr "Internt fel #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "Intern watchdog-timer har löpt ut." + +#: py/argcheck.c msgid "Invalid %q" msgstr "Ogiltig %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Ogiltig %q-pinne" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "Ogiltigt val av %q pinne" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Ogiltigt ADC-enhetsvärde" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "Ogiltig AuthMode" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "Ogiltig BLE-parameter" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Ogiltig BMP-fil" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Ogiltig BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Ogiltig DAC-pinne angiven" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "Ogiltig MAC-adress" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "Ogiltig MIDI-fil" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Ogiltig PWM-frekvens" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "Ogiltig pinne" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Ogiltigt argument" @@ -1355,42 +1233,11 @@ msgstr "Ogiltigt argument" msgid "Invalid bits per value" msgstr "Ogiltigt värde för bitar per värde" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Ogiltig buffertstorlek" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Ogiltig byteorder-sträng" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Ogiltig inspelningsperiod. Giltigt intervall: 1 - 500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Ogiltigt kanalantal" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "Ogiltig data_count %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "Ogiltig data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Ogiltig riktning." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Felaktig fil" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ogiltig formatsegmentstorlek" @@ -1399,79 +1246,15 @@ msgstr "Ogiltig formatsegmentstorlek" msgid "Invalid memory access." msgstr "Ogiltig minnesåtkomst." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "Ogiltigt läge" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "Ogiltig MAC-adress för multicast" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Ogiltigt antal bitar" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Ogiltig fas" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Ogiltig pinne" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Ogiltig pinne för vänster kanal" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Ogiltig pinne för höger kanal" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Ogiltiga pinnar" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Ogiltig polaritet" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Ogiltiga egenskaper" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Ogiltigt körläge." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Ogiltigt säkerhetsläge" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Ogiltig storlek" @@ -1479,27 +1262,10 @@ msgstr "Ogiltig storlek" msgid "Invalid socket for TLS" msgstr "Ogiltig socket för TLS" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Ogiltigt tillstånd" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Ogiltig kanal" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Ogiltigt kanalantal" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Ogiltig wave-fil" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Ogiltig word-/bitlängd" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "Nyckeln måste vara 16, 24 eller 32 byte lång" @@ -1513,25 +1279,17 @@ msgid "LHS of keyword arg must be an id" msgstr "LHS av keword arg måste vara ett id" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Lagret finns redan i en grupp." +msgid "Layer already in a group" +msgstr "Layer är redan med i en grupp" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer måste vara en subklass av Group eller TileGrid." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "Layer måste vara en underklass av Group eller TileGrid" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC-adressen var ogiltig" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "init för MISO-pinne misslyckades." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "init för MOSI-pinne misslyckades." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "Mappning måste vara en tuple" @@ -1541,19 +1299,28 @@ msgstr "Mappning måste vara en tuple" msgid "Maximum x value when mirrored is %d" msgstr "Maximum x-värde vid spegling är %d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Meddelanden begränsad till 8 byte" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" "Startfördröjningen för mikrofonen måste vara i intervallet 0,0 till 1,0" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "Datastorlek matchar inte" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "Felaktig swapflagga" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "MISO- eller MOSI-pinne saknas" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "Saknad MISO- eller MOSI-pinne" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1589,11 +1356,6 @@ msgstr "Saknad first_set_pin. Instruktion %d sätter pinnar" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "Saknar jmp_pin. Instruktion %d hoppar på pin" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "Fler än %d rapport-id stöds inte" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Måste vara en %q-subklass." @@ -1619,6 +1381,10 @@ msgstr "NVS-fel" msgid "Name too long" msgstr "Name är för långt" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "Ny bitmapp måste ha samma storlek som tidigare bitmapp" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "Nimble har inget minne kvar" @@ -1649,16 +1415,28 @@ msgstr "Ingen DMA pacing timer hittades" msgid "No I2C device at address: 0x%x" msgstr "Ingen I2C-enhet på adress: 0x%x" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "Ingen IP" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Ingen MISO-pinne" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "Ingen MISO-pinne" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Ingen MOSI-pinne" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "Ingen MOSI-pinne" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1697,16 +1475,6 @@ msgstr "Inga fria GCLK: er" msgid "No hardware random available" msgstr "Ingen hårdvaru-random tillgänglig" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Inget hårdvarustöd på clk-pinne" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Inget hårdvarustöd på pinne" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "Inget in i programmet" @@ -1751,6 +1519,10 @@ msgstr "Ingen pulldown på pinnen; 1Mohm rekommenderas" msgid "No space left on device" msgstr "Inget utrymme kvar på enheten" +#: py/moduerrno.c +msgid "No such device" +msgstr "Ingen sådan enhet" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Ingen sådan fil/katalog" @@ -1802,6 +1574,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Udda paritet stöds inte" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "Av" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "OK" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1811,7 +1591,7 @@ msgstr "Endast 8 eller 16 bitars mono med " msgid "Only IPv4 addresses supported" msgstr "Endast IPv4-adresser stöds" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "Endast IPv4-socket stöds" @@ -1847,15 +1627,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "Endast ett TouchAlarm kan ställas in för djupsömn." -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "Endast en adress är tillåten" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "Endast ett alarm.time-larm kan ställas in" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "Endast ett alarm.time kan ställas in." @@ -1863,19 +1647,23 @@ msgstr "Endast ett alarm.time kan ställas in." msgid "Only one color can be transparent at a time" msgstr "Bara en färg kan vara genomskinlig i taget" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "Åtgärden inte tillåten" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operation eller funktion stöds inte" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Åtgärden orsakade timeout" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Slut på minne" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "Slut på sockets" @@ -1883,11 +1671,6 @@ msgstr "Slut på sockets" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "Element i utbuffer måste vara <= 4 byte långa" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "Utdatabuffert måste vara minst %d byte" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Översampling måste vara multipel av 8." @@ -1896,11 +1679,6 @@ msgstr "Översampling måste vara multipel av 8." msgid "PDMIn not available" msgstr "PDMIn inte tillgänglig" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "PWM duty_cykel måste vara mellan 0 och 65535 (16 bitars upplösning)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." @@ -1908,6 +1686,10 @@ msgstr "" "PWM-frekvensen är inte skrivbar när variable_frequency är falsk vid " "skapandet." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "PWM omstart" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "PWM-segment används redan" @@ -1924,29 +1706,14 @@ msgstr "Periferi i bruk" msgid "Permission denied" msgstr "Åtkomst nekad" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "Pinnen kan inte väcka från djup sömn" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "Antalet pinnar måste vara minst 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "Antal pinnar för stort" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pinnen har inte ADC-funktionalitet" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2018,18 +1785,10 @@ msgstr "Program gör IN utan att ladda ISR" msgid "Program does OUT without loading OSR" msgstr "Program gör OUT utan att läsa in OSR" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "Programmet måste innehålla minst en 16-bitars instruktion." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "Programstorlek ogiltig" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "Programmet är för stort" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Pull används inte när riktningen är output." @@ -2051,30 +1810,20 @@ msgstr "RNG DeInit-fel" msgid "RNG Init Error" msgstr "RNG Init-fel" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 stöds ännu inte på den här enheten" +#: 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 +msgid "RS485" +msgstr "RS485" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "RS485-inversion specificerad när den inte är i RS485-läge" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "RTC-kalibrering stöds inte av detta kort" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "RTC stöds inte av detta kort" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS/CTS/RS485 Stöds ännu inte på den här enheten" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Fel vid generering av slumptal" @@ -2092,10 +1841,14 @@ msgstr "Skrivskyddat filsystem" msgid "Read-only object" msgstr "Skrivskyddat objekt" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Mottaget svar var ogiltigt" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "Återansluter" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "Uppdaterad för tidigt" @@ -2108,7 +1861,7 @@ msgstr "RemoteTransmissionRequests begränsad till 8 byte" msgid "Requested AES mode is unsupported" msgstr "Det begärda AES-läget stöds inte" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Begärd resurs hittades inte" @@ -2124,6 +1877,10 @@ msgstr "Kör i säkert läge! Sparad kod körs inte.\n" msgid "SD card CSD format not supported" msgstr "SD-kort CSD-format stöds inte" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "SDCard start" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2134,30 +1891,21 @@ msgstr "SDIO GetCardInfo-fel %d" msgid "SDIO Init Error %d" msgstr "SDIO Init-fel %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI Init-fel" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI reinitialiseringsfel" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "SPI-konfigurationen misslyckades" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "SPI-initieringsfel" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "SPI-enhet används redan" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Samplingsfrekvensen måste vara positiv" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Samplingsfrekvensen är för hög. Den måste vara mindre än %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "SPI omstart" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2177,14 +1925,6 @@ msgstr "Serializern används redan" msgid "Server side context cannot have hostname" msgstr "Serversidans kontext kan inte ha värdnamn" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "Inställt antal pinnar måste vara mellan 1 och 5" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "Sido-setets antal pinnar måste vara mellan 1 och 5" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "Storleken stöds inte" @@ -2220,10 +1960,6 @@ msgstr "Ange en av data0 eller data_pins" msgid "Splitting with sub-captures" msgstr "Splitting med sub-captures" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Stackstorleken måste vara minst 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "Vänster stereokanal måste använda PWM kanal A" @@ -2319,10 +2055,6 @@ msgstr "Tile-höjden måste vara jämnt delbar med höjd på bitmap" msgid "Tile index out of bounds" msgstr "Tile-index utanför gräns" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Tile-värde utanför intervall" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Tile-bredd måste vara jämnt delbar med bredd på bitmap" @@ -2342,6 +2074,9 @@ msgid "To exit, please reset the board without " msgstr "För att avsluta, gör reset på kortet utan " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "För många kanaler i urvalet" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "För många kanaler i sampling." @@ -2374,24 +2109,21 @@ msgid "Tuple or struct_time argument required" msgstr "Tuple- eller struct_time-argument krävs" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART-buffertallokeringsfel" +msgid "UART de-init" +msgstr "UART omstart" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "UART start" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART deinit-fel" +msgid "UART re-init" +msgstr "UART omstart" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART Init-fel" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART reinit-fel" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART skrivfel" +msgid "UART write" +msgstr "UART-skrivning" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2529,12 +2261,6 @@ msgstr "" "Ospecificerat problem. Kan vara att parningen på den andra enheten avvisades " "eller ignorerades." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Baudrate stöd inte" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "Färgrymd stöds inte" @@ -2547,9 +2273,9 @@ msgstr "Busstyp för display stöds inte" msgid "Unsupported format" msgstr "Formatet stöds inte" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Åtgärd som inte stöds" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "Hash-algoritmen stöds inte" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2569,7 +2295,7 @@ msgstr "Värdets längde ! = krävd fast längd" msgid "Value length > max_length" msgstr "Värdets längd > max_length" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "Versionen var ogiltig" @@ -2600,10 +2326,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "WatchDogTimer.timeout måste vara större än 0" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "Watchdog-timern har löpt ut." - #: py/builtinhelp.c #, c-format msgid "" @@ -2619,9 +2341,9 @@ msgstr "" "\n" "För att lista inbyggda moduler skriver du `help(\"modules\")`.\n" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFi-lösenord måste vara mellan 8 och 63 tecken" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "Wi-Fi: " #: main.c msgid "Woken up by alarm.\n" @@ -2663,11 +2385,11 @@ msgstr "__new__ arg måste vara en användartyp" msgid "a bytes-like object is required" msgstr "ett bytesliknande objekt krävs" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "adress utanför gränsen" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "adresserna är tomma" @@ -2716,6 +2438,10 @@ msgstr "argumenten måste vara ndarray" msgid "array and index length must be equal" msgstr "array och indexlängd måste vara lika" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "array har för många dimensioner" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2777,10 +2503,6 @@ msgstr "bitmappsstorlekar måste matcha" msgid "bits must be 32 or less" msgstr "bits måste vara 32 eller färre" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "bits måste mellan 5 och 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "bits_per_sample måste vara 8 eller 16" @@ -2818,11 +2540,6 @@ msgstr "buffert för liten för begärd längd" msgid "byteorder is not a string" msgstr "byteorder är inte en sträng" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "bytes> 8 bitar stöds inte" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "bytelängd inte en multipel av storlek" @@ -2831,7 +2548,7 @@ msgstr "bytelängd inte en multipel av storlek" msgid "bytes value out of range" msgstr "bytevärde utanför intervallet" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "kalibrering är utanför intervallet" @@ -2839,13 +2556,10 @@ msgstr "kalibrering är utanför intervallet" msgid "calibration is read only" msgstr "kalibrering är skrivskyddad" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "kalibreringsvärde utanför intervallet +/- 127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" -msgstr "kan endast registreras med en förälder" +msgid "can only have one parent" +msgstr "kan bara ha en förälder" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -2867,7 +2581,7 @@ msgstr "kan inte tilldela uttryck" msgid "can't cancel self" msgstr "kan inte avbryta sig själv" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "kan inte konvertera %q till %q" @@ -3017,6 +2731,10 @@ msgstr "Kan inte entydigt få sizeof scalar" msgid "casting" msgstr "casting inte implementerad" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "kanal återstart" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "teckenbuffert för liten" @@ -3029,10 +2747,6 @@ msgstr "chr() arg är inte i intervallet(0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() arg är inte i intervallet(256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "circle kan endast registreras i en förälder" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "klipppunkten måste vara en tuple (x,y)" @@ -3097,6 +2811,10 @@ msgstr "Argumenten convolve måste vara ndarray:er" msgid "convolve arguments must not be empty" msgstr "Argumenten convolve kan inte vara tomma" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "korrupt fil" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "kan inte invertera Vandermonde-matris" @@ -3183,10 +2901,6 @@ msgstr "division med noll" msgid "division by zero" msgstr "division med noll" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "divisor måste vara 4" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "dtype måste vara float eller complex" @@ -3195,6 +2909,10 @@ msgstr "dtype måste vara float eller complex" msgid "empty" msgstr "tom" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "tom fil" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "tom heap" @@ -3224,6 +2942,14 @@ msgstr "epoch_time stöds inte av detta kort" msgid "error = 0x%08lX" msgstr "fel = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" +"esp32_camera.Camera kräver reserverad PSRAM att konfigureras. Se " +"dokumentationen för instruktioner." + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "exceptions måste ärvas från BaseException" @@ -3298,7 +3024,7 @@ msgstr "första argumentet måste vara en funktion" msgid "first argument must be a tuple of ndarrays" msgstr "första argumentet måste vara en tupel av ndarray" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "första argumentet måste vara en ndarray" @@ -3334,6 +3060,10 @@ msgstr "typsnitt måste vara 2048 bytes långt" msgid "format requires a dict" msgstr "formatet kräver en dict" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "frekvens är skrivskyddad för detta kort" + #: py/objdeque.c msgid "full" msgstr "full" @@ -3442,7 +3172,7 @@ msgstr "ofullständig formatnyckel" msgid "incorrect padding" msgstr "felaktig utfyllnad" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "index är utanför gränserna" @@ -3460,6 +3190,10 @@ msgstr "index måste vara heltal" msgid "indices must be integers, slices, or Boolean lists" msgstr "index måste vara heltal, slices, eller Boolean-listor" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "I2C start" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "initialvärden måste vara iterable" @@ -3505,6 +3239,10 @@ msgstr "indatamatrisen är asymmetrisk" msgid "input matrix is singular" msgstr "indatamatrisen är singulär" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "input måste vara 1- eller 2-d" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "indata måste vara en 1D ndarray" @@ -3513,11 +3251,7 @@ msgstr "indata måste vara en 1D ndarray" msgid "input must be a dense ndarray" msgstr "indata måste vara en dense ndarray" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "indata måste vara en tensor av rank 2" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "indata måste vara en ndarray" @@ -3597,6 +3331,10 @@ msgstr "Ogiltigt värdnamn" msgid "invalid micropython decorator" msgstr "ogiltig mikropython-dekorator" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "ogiltig inställning" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "ogiltigt steg" @@ -3713,10 +3451,6 @@ msgstr "matematikdomänfel" msgid "matrix is not positive definite" msgstr "matrisen är inte positiv bestämd" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "max_connections måste vara mellan 0 och 10" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3724,13 +3458,9 @@ msgstr "max_connections måste vara mellan 0 och 10" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "max_length måste vara 0-%d när fixed_length är %s" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "max_length måste vara >= 0" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "maximalt antal dimensioner är 4" +msgid "maximum number of dimensions is " +msgstr "maximalt antal dimensioner är " #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3863,7 +3593,7 @@ msgstr "ingen reset-pinne tillgänglig" msgid "no response from SD card" msgstr "inget svar från SD-kort" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "inget sådant attribut" @@ -3974,7 +3704,11 @@ msgstr "objekt med buffertprotokoll krävs" msgid "odd-length string" msgstr "sträng har udda längd" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "av" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "offset är för stor" @@ -4099,10 +3833,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "filbevakning är inte tillgänglig på win32" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "polygon kan endast registreras i en förälder" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop från en tom PulseIn" @@ -4128,63 +3858,23 @@ msgstr "pow() 3: e argument kan inte vara 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() med 3 argument kräver heltal" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "genom att trycka på BOOT-knappen vid start.\n" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "genom att trycka på SW38-knappen vid start.\n" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "genom att trycka på VOLUME-knappen vid start.\n" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "trycka på startknappen vid start.\n" @@ -4204,14 +3894,6 @@ msgstr "håll ner vänster knapp vid start\n" msgid "pull masks conflict with direction masks" msgstr "pull-mask är i konflikt med riktnings-mask" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "pull_threshold måste vara mellan 1 och 32" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "push_threshold måste vara mellan 1 och 32" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "köstorlek överskreds" @@ -4263,14 +3945,6 @@ msgstr "argumentet roll måste vara en ndarray" msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"sample_source buffert måste vara en bytearray eller matris av typ 'h', 'H', " -"'b' eller 'B'" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4368,10 +4042,6 @@ msgstr "source_bitmap måste ha value_count av 65536" msgid "source_bitmap must have value_count of 8" msgstr "source_bitmap måste ha value_count av 8" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "ssid kan vara max 32 bytes" - #: py/objstr.c msgid "start/end indices" msgstr "start-/slutindex" @@ -4384,10 +4054,6 @@ msgstr "start_x ska vara en int" msgid "step must be non-zero" msgstr "step måste vara icke-noll" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "stop måste vara 1 eller 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "stop kan inte nås från start" @@ -4436,10 +4102,6 @@ msgstr "syntaxfel i uctypes deskriptor" msgid "threshold must be in the range 0-65536" msgstr "tröskelvärdet måste ligga i intervallet 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "tile måste vara större än noll" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kräver en 9-sekvens" @@ -4459,10 +4121,6 @@ msgstr "timeout måste vara 0.0-100.0 sekunder" msgid "timeout must be < 655.35 secs" msgstr "timeout måste vara < 655,35 sekunder" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "timeout måste vara >= 0.0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "timeout för v1-kort" @@ -4471,6 +4129,10 @@ msgstr "timeout för v1-kort" msgid "timeout waiting for v2 card" msgstr "timeout för v2-kort" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "timer omstart" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "timestamp utom räckvidd för plattformens \"time_t\"" @@ -4641,6 +4303,14 @@ msgstr "typ stöds inte för operatören" msgid "unsupported types for %q: '%q', '%q'" msgstr "typen %q stöder inte '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "usecols är för hög" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "nyckelordet usecols måste anges" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4662,13 +4332,7 @@ msgstr "watchdog är inte initierad" msgid "watchdog timeout must be greater than 0" msgstr "watchdog timeout måste vara större än 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "width måste vara mellan 2 och 8, inte %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "width måste vara större än noll" @@ -4688,7 +4352,17 @@ msgstr "fel axelindex" msgid "wrong axis specified" msgstr "fel axel angiven" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "fel dtype" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "fel indextyp" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "fel indatatyp" @@ -4696,6 +4370,10 @@ msgstr "fel indatatyp" msgid "wrong length of condition array" msgstr "fel längd på villkorsmatrisen" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "fel längd av index array" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "fel antal argument" @@ -4740,6 +4418,391 @@ 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 "%q ``must`` be a bytearray or array of type 'h', 'H', 'b' or 'B'" +#~ msgstr "" +#~ "%q ``måste`` vara en bytearray eller matris av typen 'h', 'H', 'b' eller " +#~ "'B'" + +#~ msgid "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "sample_source buffert måste vara en bytearray eller matris av typ 'h', " +#~ "'H', 'b' eller 'B'" + +#~ msgid "Expected an alarm" +#~ msgstr "Förväntade ett larm" + +#~ msgid "All I2C targets are in use" +#~ msgstr "Alla I2C-mål används" + +#~ msgid "Failed to init wifi" +#~ msgstr "Kunde inte initiera WiFi" + +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "indata måste vara en tensor av rank 2" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "maximalt antal dimensioner är 4" + +#~ msgid "Watchdog timer expired." +#~ msgstr "Watchdog-timern har löpt ut." + +#~ msgid "ssid can't be more than 32 bytes" +#~ msgstr "ssid kan vara max 32 bytes" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q måste vara en tuple av längd 2" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q måste vara mellan %d och %d" + +#~ msgid "%q should be an int" +#~ msgstr "%q ska vara en int" + +#~ msgid "(x,y) integers required" +#~ msgstr "(x,y) heltal krävs" + +#~ msgid "Address type out of range" +#~ msgstr "Adresstyp utanför intervallet" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "AnalogIn stöds inte på angiven pinne" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut-funktionalitet stöds inte" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "" +#~ "AnalogOut hanterar bara 16 bitar. Värdet måste vara mindre än 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "AnalogOut stöds inte på angiven pinne" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bitdjup måste vara inom 1 till 6, inte %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Buffert har felaktig storlek. Ska vara %d byte." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Bufferten måste ha minst längd 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Bytes måste vara mellan 0 och 255." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Det går inte att mata ut båda kanalerna på samma pinne" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Kan inte läsa utan MISO-pinne." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "" +#~ "Det går inte att återställa till bootloader eftersom bootloader saknas." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Kan inte överföra utan MOSI- och MISO-pinnar." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Kan inte skriva utan MOSI-pinne." + +#~ msgid "Clock pin init failed." +#~ msgstr "Initiering av klockpinne misslyckades." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Kommandot måste vara en int mellan 0 och 255" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Kunde inte initiera Camera" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "Kan inte initiera GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "Kan inte initiera SD-kort" + +#~ msgid "Could not initialize UART" +#~ msgstr "Det gick inte att initiera UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Det gick inte att återinitiera kanalen" + +#~ msgid "Could not re-init timer" +#~ msgstr "Det gick inte att återinitiera timern" + +#~ msgid "Could not restart PWM" +#~ msgstr "Det gick inte att starta om PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Det gick inte att allokera den första bufferten" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Det gick inte att allokera indatabufferten" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Det gick inte att allokera den andra bufferten" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "DigitalInOut stöds inte på given pinne" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Förväntad tupel med längd %d, fick %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Det gick inte att tilldela RX-buffert" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Det gick inte att allokera RX-bufferten på %d byte" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "Framebuffer kräver %d byte" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "Hostname måste vara mellan 1 och 253 tecken" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C init-fel" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "Ogiltigt val av %q pinne" + +#~ msgid "Invalid AuthMode" +#~ msgstr "Ogiltig AuthMode" + +#~ msgid "Invalid BMP file" +#~ msgstr "Ogiltig BMP-fil" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Ogiltig DAC-pinne angiven" + +#~ msgid "Invalid MIDI file" +#~ msgstr "Ogiltig MIDI-fil" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Ogiltig PWM-frekvens" + +#~ msgid "Invalid Pin" +#~ msgstr "Ogiltig pinne" + +#~ msgid "Invalid buffer size" +#~ msgstr "Ogiltig buffertstorlek" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Ogiltig byteorder-sträng" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Ogiltig inspelningsperiod. Giltigt intervall: 1 - 500" + +#~ msgid "Invalid channel count" +#~ msgstr "Ogiltigt kanalantal" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "Ogiltig data_count %d" + +#~ msgid "Invalid direction." +#~ msgstr "Ogiltig riktning." + +#~ msgid "Invalid file" +#~ msgstr "Felaktig fil" + +#~ msgid "Invalid mode" +#~ msgstr "Ogiltigt läge" + +#~ msgid "Invalid number of bits" +#~ msgstr "Ogiltigt antal bitar" + +#~ msgid "Invalid phase" +#~ msgstr "Ogiltig fas" + +#~ msgid "Invalid pin" +#~ msgstr "Ogiltig pinne" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Ogiltig pinne för vänster kanal" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Ogiltig pinne för höger kanal" + +#~ msgid "Invalid polarity" +#~ msgstr "Ogiltig polaritet" + +#~ msgid "Invalid properties" +#~ msgstr "Ogiltiga egenskaper" + +#~ msgid "Invalid run mode." +#~ msgstr "Ogiltigt körläge." + +#~ msgid "Invalid security_mode" +#~ msgstr "Ogiltigt säkerhetsläge" + +#~ msgid "Invalid voice" +#~ msgstr "Ogiltig kanal" + +#~ msgid "Invalid voice count" +#~ msgstr "Ogiltigt kanalantal" + +#~ msgid "Invalid wave file" +#~ msgstr "Ogiltig wave-fil" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Ogiltig word-/bitlängd" + +#~ msgid "Layer already in a group." +#~ msgstr "Lagret finns redan i en grupp." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer måste vara en subklass av Group eller TileGrid." + +#~ msgid "MISO pin init failed." +#~ msgstr "init för MISO-pinne misslyckades." + +#~ msgid "MOSI pin init failed." +#~ msgstr "init för MOSI-pinne misslyckades." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Meddelanden begränsad till 8 byte" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "Fler än %d rapport-id stöds inte" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Inget hårdvarustöd på clk-pinne" + +#~ msgid "No hardware support on pin" +#~ msgstr "Inget hårdvarustöd på pinne" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "Utdatabuffert måste vara minst %d byte" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "PWM duty_cykel måste vara mellan 0 och 65535 (16 bitars upplösning)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "Antalet pinnar måste vara minst 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pinnen har inte ADC-funktionalitet" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "Programmet måste innehålla minst en 16-bitars instruktion." + +#~ msgid "Program too large" +#~ msgstr "Programmet är för stort" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 stöds ännu inte på den här enheten" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "RTC-kalibrering stöds inte av detta kort" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 Stöds ännu inte på den här enheten" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI Init-fel" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI reinitialiseringsfel" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Samplingsfrekvensen måste vara positiv" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Samplingsfrekvensen är för hög. Den måste vara mindre än %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "Inställt antal pinnar måste vara mellan 1 och 5" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "Sido-setets antal pinnar måste vara mellan 1 och 5" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Stackstorleken måste vara minst 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Tile-värde utanför intervall" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART-buffertallokeringsfel" + +#~ msgid "UART De-init error" +#~ msgstr "UART deinit-fel" + +#~ msgid "UART Init Error" +#~ msgstr "UART Init-fel" + +#~ msgid "UART Re-init error" +#~ msgstr "UART reinit-fel" + +#~ msgid "UART write error" +#~ msgstr "UART skrivfel" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Baudrate stöd inte" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFi-lösenord måste vara mellan 8 och 63 tecken" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "bits måste mellan 5 och 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "bytes> 8 bitar stöds inte" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "kalibreringsvärde utanför intervallet +/- 127" + +#~ msgid "can only be registered in one parent" +#~ msgstr "kan endast registreras med en förälder" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "circle kan endast registreras i en förälder" + +#~ msgid "max_connections must be between 0 and 10" +#~ msgstr "max_connections måste vara mellan 0 och 10" + +#~ msgid "max_length must be >= 0" +#~ msgstr "max_length måste vara >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "polygon kan endast registreras i en förälder" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "pull_threshold måste vara mellan 1 och 32" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "push_threshold måste vara mellan 1 och 32" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "stop måste vara 1 eller 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "tile måste vara större än noll" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "timeout måste vara >= 0.0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "width måste vara mellan 2 och 8, inte %d" + +#~ msgid "Unsupported operation" +#~ msgstr "Åtgärd som inte stöds" + +#~ msgid "divisor must be 4" +#~ msgstr "divisor måste vara 4" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" @@ -5286,9 +5349,6 @@ msgstr "zi måste vara i formen (n_section, 2)" #~ msgid "wrong argument type" #~ msgstr "fel typ av argument" -#~ msgid "wrong index type" -#~ msgstr "fel indextyp" - #~ msgid "specify size or data, but not both" #~ msgstr "ange storlek eller data, men inte båda" diff --git a/locale/tr.po b/locale/tr.po index 6966ee8ae9..bd1c3e73eb 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -7,15 +7,15 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-01-16 13:56+0000\n" -"Last-Translator: Gökhan Koçmarlı \n" +"PO-Revision-Date: 2022-08-29 18:20+0000\n" +"Last-Translator: Boran Roni \n" "Language-Team: none\n" "Language: tr\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.10.1\n" +"X-Generator: Weblate 4.14.1-dev\n" #: main.c msgid "" @@ -30,6 +30,9 @@ msgid "" "\n" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +"\n" +"Program otomatik yeniden yükleme tarafından durduruldu. Birazdan tekrar " +"yüklenecek.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -75,10 +78,27 @@ msgstr "" "%d adres pinleri, %d RGB pinleri ve %d döşemeleri %d'nin yüksekliği " "gösterir, %d'nin değil" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "%q" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q ve %q yinelenen pinler içeriyor" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "%q ve %q farklı olmalılar" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q yinelenen pinler içeriyor" @@ -91,12 +111,7 @@ msgstr "%q hata: %d" msgid "%q in use" msgstr "%q kullanımda" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q indeksi aralık dışında" @@ -104,18 +119,42 @@ msgstr "%q indeksi aralık dışında" msgid "%q indices must be integers, not %s" msgstr "%q indeksleri integer olmalı, %s değil" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "%q init başarısız oldu" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "%q boyutu %d olmalıdır" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q boyutları %d-%d olmalıdır" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "%q boyutu <= %d olmalıdır" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "%q boyutu >= %d olmalıdır" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" msgstr "%q boyutu >=1 olmalıdır" +#: py/argcheck.c +msgid "%q must be %d" +msgstr "%q, %d olmalıdır" + #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q, %d-%d olmalıdır" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "%q 1 olmalı, %q True olduğu zaman" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" msgstr "%q <= %d olmalıdır" @@ -124,30 +163,26 @@ msgstr "%q <= %d olmalıdır" msgid "%q must be >= %d" msgstr "%q >= %d olmalıdır" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" msgstr "%q >= 0 olmalıdır" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q >= 1 olmalıdır" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" msgstr "%q bir string olmalıdır" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q, boyutu 2 olan bir tuple olmalıdır" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q, %d ile %d arasında olmalıdır" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "%q bir tam sayı olmalıdır" #: py/argcheck.c msgid "%q must be of type %q" @@ -165,7 +200,11 @@ msgstr "%q, 2'nin kuvveti olmalıdır" msgid "%q out of bounds" msgstr "%q sınırların dışında" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q aralık dışında" @@ -174,10 +213,6 @@ msgstr "%q aralık dışında" msgid "%q pin invalid" msgstr "%q pini geçersiz" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q bir int olmalıdır" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "Rapor kimliği 0 olan %q, 1 uzunluğunda olmalıdır" @@ -190,7 +225,11 @@ msgstr "%q(), %d konumsal argümanını alır ancak %d verildi" msgid "%q, %q, and %q must all be the same length" msgstr "%q, %q ve %q aynı uzunlukta olmalıdır" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "%q=%q" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s hatası 0x%x" @@ -285,7 +324,6 @@ msgid "'%s' object isn't subscriptable" msgstr "'%s' nesnesi subscriptable özelliğe sahip değil" #: py/objstr.c -#, fuzzy msgid "'=' alignment not allowed in string format specifier" msgstr "'=' hizalamasına string biçiminde izin verilmez" @@ -342,10 +380,6 @@ msgstr "asenkron fonksiyon içinde 'yield from'" msgid "'yield' outside function" msgstr "fonksiyon dışında 'yield'" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "(x, y) integerları gereklidir" - #: py/compile.c msgid "*x must be assignment target" msgstr "" @@ -381,16 +415,12 @@ msgstr "ADC2, WiFi tarafından kullanılmaktadır" msgid "Address must be %d bytes long" msgstr "Adres %d byte uzunluğunda olmalıdır" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Adres tipi beklenen aralığın dışında" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Tüm CAN çevre birimleri kullanımda" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tüm I2C çevre birimleri kullanımda" @@ -427,7 +457,6 @@ msgstr "Tüm kanallar kullanımda" msgid "All event channels in use" msgstr "Tüm olay kanalları kullanımda" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "Tüm durum makineleri kullanımda" @@ -475,25 +504,6 @@ msgstr "Halihazırda çalışıyor" msgid "Already scanning for wifi networks" msgstr "Halihazırda wifi ağları için tarama yapılıyor" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "Verilen pin için AnalogIn desteklenmemektedir" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "AnalogOut işlevi desteklenmemektedir" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut yalnızca 16 bitlik. Değer 65536'dan küçük olmalıdır." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "Verilen pin için AnalogOut desteklenmemektedir" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "Başka bir PWMAudioOut zaten aktif durumda" @@ -513,7 +523,7 @@ msgstr "Dizi değerleri tekil bytelar olmalıdır." #: shared-bindings/microcontroller/Pin.c msgid "At most %d %q may be specified (not %d)" -msgstr "" +msgstr "En az %d %q belirtilmeli (%d değil)" #: shared-module/memorymonitor/AllocationAlarm.c #, c-format @@ -532,7 +542,7 @@ msgstr "Ses dönüşümü implemente edilmedi" msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN bir şifre ile kullanılmadı" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "Kimlik doğrulama hatası" @@ -565,26 +575,22 @@ msgstr "" msgid "Bit clock and word select must share a clock unit" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." -msgstr "" +msgstr "Bit derinliği 8'in katı olacak şekilde olmalı." #: shared-bindings/bitmaptools/__init__.c +#, fuzzy msgid "Bitmap size and bits per value must match" -msgstr "" +msgstr "Bitmap boyutu ve bit başına değer uyuşmalı" #: supervisor/shared/safe_mode.c msgid "Boot device must be first device (interface #0)." -msgstr "" +msgstr "Önyükleme cihazı ilk cihaz olmalı (arayüz #0)." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" -msgstr "" +msgstr "Hem RX hem de TX akış kontrolü için gerekli" #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c msgid "Both pins must support hardware interrupts" @@ -595,12 +601,12 @@ msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "Brightness must be 0-1.0" -msgstr "" +msgstr "Parlaklık 0-1.0 aralığında olmalı" #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Brightness not adjustable" -msgstr "" +msgstr "Parlaklık ayarlanabilir değil" #: shared-bindings/_bleio/UUID.c #, c-format @@ -611,39 +617,29 @@ msgstr "" msgid "Buffer elements must be 4 bytes long or less" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "" - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." -msgstr "" +msgstr "Arabellek bayt dizisi değil" #: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is too small" -msgstr "" +msgstr "Arabellek çok küçük" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" -msgstr "" +msgstr "Mevcut arabellek boyutu %d çok büyük. En fazla %d kadar olmalı" #: ports/atmel-samd/common-hal/sdioio/SDCard.c #: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c msgid "Buffer length must be a multiple of 512" -msgstr "" +msgstr "Arabellek boyutu 512'nin katı olmalı" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "" - #: shared-bindings/_bleio/PacketBuffer.c #, c-format msgid "Buffer too short by %d bytes" @@ -651,7 +647,7 @@ msgstr "" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "Buffers must be same size" -msgstr "" +msgstr "Arabellek boyutları aynı olmalı" #: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c #: ports/espressif/common-hal/paralleldisplay/ParallelBus.c @@ -659,25 +655,21 @@ msgstr "" #: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" -msgstr "" +msgstr "Veriyolu pini %d kullanımda" #: shared-bindings/_bleio/UUID.c msgid "Byte buffer must be 16 bytes." msgstr "" -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "" - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" -msgstr "" +msgstr "CBC blokları 16 baytın katları şeklinde olmalı" #: supervisor/shared/safe_mode.c msgid "CIRCUITPY drive could not be found or created." -msgstr "" +msgstr "CIRCUITPY sürücüsü bulunamadı veya oluşturulamadı" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -685,6 +677,10 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "" + #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" @@ -705,17 +701,17 @@ msgstr "" #: shared-bindings/storage/__init__.c shared-bindings/usb_cdc/__init__.c #: shared-bindings/usb_hid/__init__.c shared-bindings/usb_midi/__init__.c msgid "Cannot change USB devices now" -msgstr "" +msgstr "USB aygıtları şu an değiştirilemez" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" -msgstr "" +msgstr "Yeni Adapter oluşturulamaz, _bleio.adapter; kullanın" #: shared-bindings/displayio/Bitmap.c #: shared-bindings/memorymonitor/AllocationSize.c #: shared-bindings/pulseio/PulseIn.c msgid "Cannot delete values" -msgstr "" +msgstr "Değerler silinemez" #: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c #: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -732,18 +728,10 @@ msgstr "" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "" -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "" @@ -755,7 +743,7 @@ msgstr "" #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." +msgid "Cannot reset into bootloader because no bootloader is present" msgstr "" #: ports/espressif/common-hal/socketpool/Socket.c @@ -776,20 +764,19 @@ msgid "Cannot subclass slice" msgstr "" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." +msgid "Cannot transfer without MOSI and MISO pins" msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -msgid "Cannot wake on pin edge. Only level." +msgid "Cannot wake on pin edge, only level" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge. Only level." msgstr "" #: shared-bindings/_bleio/CharacteristicBuffer.c @@ -804,10 +791,6 @@ msgstr "" msgid "CircuitPython was unable to allocate the heap." msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "" - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "" @@ -816,11 +799,6 @@ msgstr "" msgid "Clock unit in use" msgstr "" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -831,35 +809,6 @@ msgstr "" msgid "Corrupt .mpy file" msgstr "" -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "" - #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -880,20 +829,6 @@ msgstr "" msgid "Couldn't allocate decoder" msgstr "" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "" @@ -941,10 +876,6 @@ msgstr "" msgid "Device in use" msgstr "" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -956,6 +887,10 @@ msgstr "" msgid "Display rotation must be in 90 degree increments" msgstr "" +#: main.c +msgid "Done" +msgstr "" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "" @@ -991,18 +926,14 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" +msgid "Expected an %q" msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c @@ -1031,20 +962,8 @@ msgstr "" msgid "Failed to acquire mutex, err 0x%04x" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" msgstr "" #: ports/espressif/common-hal/wifi/__init__.c @@ -1068,10 +987,6 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "" @@ -1115,9 +1030,9 @@ msgstr "" msgid "Format not supported" msgstr "" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" msgstr "" #: shared-bindings/pwmio/PWMOut.c @@ -1129,7 +1044,11 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1156,19 +1075,16 @@ msgstr "" msgid "Hardware in use, try alternative pins" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" +msgid "I2C init error" msgstr "" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "" @@ -1273,75 +1189,37 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "" + +#: py/argcheck.c msgid "Invalid %q" msgstr "" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "" @@ -1349,42 +1227,11 @@ msgstr "" msgid "Invalid bits per value" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -1393,79 +1240,15 @@ msgstr "" msgid "Invalid memory access." msgstr "" -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "" - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" @@ -1473,27 +1256,10 @@ msgstr "" msgid "Invalid socket for TLS" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "" @@ -1507,25 +1273,17 @@ msgid "LHS of keyword arg must be an id" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer already in a group." +msgid "Layer already in a group" msgstr "" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." +msgid "Layer must be a Group or TileGrid subclass" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "" - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "" - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "" @@ -1535,18 +1293,27 @@ msgstr "" msgid "Maximum x value when mirrored is %d" msgstr "" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1582,11 +1349,6 @@ msgstr "" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -1612,6 +1374,10 @@ msgstr "" msgid "Name too long" msgstr "" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "" @@ -1642,16 +1408,28 @@ msgstr "" msgid "No I2C device at address: 0x%x" msgstr "" -#: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c -msgid "No MISO Pin" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" msgstr "" #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c +msgid "No MISO Pin" +msgstr "" + +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "" + +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1690,16 +1468,6 @@ msgstr "" msgid "No hardware random available" msgstr "" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "" @@ -1744,6 +1512,10 @@ msgstr "" msgid "No space left on device" msgstr "" +#: py/moduerrno.c +msgid "No such device" +msgstr "" + #: py/moduerrno.c msgid "No such file/directory" msgstr "" @@ -1793,6 +1565,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1802,7 +1582,7 @@ msgstr "" msgid "Only IPv4 addresses supported" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1835,15 +1615,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "" @@ -1851,19 +1635,23 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "" @@ -1871,11 +1659,6 @@ msgstr "" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "" @@ -1886,12 +1669,11 @@ msgstr "" #: shared-bindings/pwmio/PWMOut.c msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +"PWM frequency not writable when variable_frequency is False on construction." msgstr "" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM frequency not writable when variable_frequency is False on construction." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" msgstr "" #: ports/raspberrypi/common-hal/countio/Counter.c @@ -1910,29 +1692,14 @@ msgstr "" msgid "Permission denied" msgstr "" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2002,18 +1769,10 @@ msgstr "" msgid "Program does OUT without loading OSR" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "" - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "" @@ -2035,8 +1794,9 @@ msgstr "" msgid "RNG Init Error" msgstr "" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" +#: 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 +msgid "RS485" msgstr "" #: ports/espressif/common-hal/busio/UART.c @@ -2044,21 +1804,10 @@ msgstr "" msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "" @@ -2076,10 +1825,14 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "" @@ -2092,7 +1845,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2108,6 +1861,10 @@ msgstr "" msgid "SD card CSD format not supported" msgstr "" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2118,29 +1875,20 @@ msgstr "" msgid "SDIO Init Error %d" msgstr "" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" msgstr "" #: shared-bindings/is31fl3741/FrameBuffer.c @@ -2161,14 +1909,6 @@ msgstr "" msgid "Server side context cannot have hostname" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "" @@ -2204,10 +1944,6 @@ msgstr "" msgid "Splitting with sub-captures" msgstr "" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "" @@ -2293,10 +2029,6 @@ msgstr "" msgid "Tile index out of bounds" msgstr "" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "" @@ -2316,6 +2048,9 @@ msgid "To exit, please reset the board without " msgstr "" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -2348,23 +2083,20 @@ msgid "Tuple or struct_time argument required" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" +msgid "UART de-init" +msgstr "" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" +msgid "UART re-init" msgstr "" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" +msgid "UART write" msgstr "" #: shared-module/usb_hid/Device.c @@ -2501,12 +2233,6 @@ msgid "" "declined or ignored." msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "" @@ -2519,8 +2245,8 @@ msgstr "" msgid "Unsupported format" msgstr "" -#: py/moduerrno.c -msgid "Unsupported operation" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" msgstr "" #: ports/espressif/common-hal/dualbank/__init__.c @@ -2541,7 +2267,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2571,10 +2297,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "" - #: py/builtinhelp.c #, c-format msgid "" @@ -2585,8 +2307,8 @@ msgid "" "To list built-in modules type `help(\"modules\")`.\n" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " msgstr "" #: main.c @@ -2627,11 +2349,11 @@ msgstr "" msgid "a bytes-like object is required" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "" @@ -2680,6 +2402,10 @@ msgstr "" msgid "array and index length must be equal" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2741,10 +2467,6 @@ msgstr "" msgid "bits must be 32 or less" msgstr "" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "" @@ -2782,11 +2504,6 @@ msgstr "" msgid "byteorder is not a string" msgstr "" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "" @@ -2795,7 +2512,7 @@ msgstr "" msgid "bytes value out of range" msgstr "" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "" @@ -2803,12 +2520,9 @@ msgstr "" msgid "calibration is read only" msgstr "" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" +msgid "can only have one parent" msgstr "" #: py/emitinlinethumb.c @@ -2831,7 +2545,7 @@ msgstr "" msgid "can't cancel self" msgstr "" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "" @@ -2979,6 +2693,10 @@ msgstr "" msgid "casting" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "" @@ -2991,10 +2709,6 @@ msgstr "" msgid "chr() arg not in range(256)" msgstr "" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "" @@ -3059,6 +2773,10 @@ msgstr "" msgid "convolve arguments must not be empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "" @@ -3142,10 +2860,6 @@ msgstr "" msgid "division by zero" msgstr "" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "" @@ -3154,6 +2868,10 @@ msgstr "" msgid "empty" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "" @@ -3183,6 +2901,12 @@ msgstr "" msgid "error = 0x%08lX" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "" @@ -3257,7 +2981,7 @@ msgstr "" msgid "first argument must be a tuple of ndarrays" msgstr "" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "" @@ -3293,6 +3017,10 @@ msgstr "" msgid "format requires a dict" msgstr "" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "" + #: py/objdeque.c msgid "full" msgstr "" @@ -3401,7 +3129,7 @@ msgstr "" msgid "incorrect padding" msgstr "" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "" @@ -3419,6 +3147,10 @@ msgstr "" msgid "indices must be integers, slices, or Boolean lists" msgstr "" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "" @@ -3464,6 +3196,10 @@ msgstr "" msgid "input matrix is singular" msgstr "" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "" @@ -3472,11 +3208,7 @@ msgstr "" msgid "input must be a dense ndarray" msgstr "" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "" @@ -3556,6 +3288,10 @@ msgstr "" msgid "invalid micropython decorator" msgstr "" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "" @@ -3669,10 +3405,6 @@ msgstr "" msgid "matrix is not positive definite" msgstr "" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c @@ -3680,12 +3412,8 @@ msgstr "" msgid "max_length must be 0-%d when fixed_length is %s" msgstr "" -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "" - #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" +msgid "maximum number of dimensions is " msgstr "" #: py/runtime.c @@ -3819,7 +3547,7 @@ msgstr "" msgid "no response from SD card" msgstr "" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "" @@ -3930,7 +3658,11 @@ msgstr "" msgid "odd-length string" msgstr "" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "" @@ -4054,10 +3786,6 @@ msgstr "" msgid "poll on file not available on win32" msgstr "" -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "" - #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -4083,63 +3811,23 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "" @@ -4159,14 +3847,6 @@ msgstr "" msgid "pull masks conflict with direction masks" msgstr "" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "" @@ -4218,12 +3898,6 @@ msgstr "" msgid "rsplit(None,n)" msgstr "" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4321,10 +3995,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "" - #: py/objstr.c msgid "start/end indices" msgstr "" @@ -4337,10 +4007,6 @@ msgstr "" msgid "step must be non-zero" msgstr "" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "" @@ -4389,10 +4055,6 @@ msgstr "" msgid "threshold must be in the range 0-65536" msgstr "" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "" @@ -4412,10 +4074,6 @@ msgstr "" msgid "timeout must be < 655.35 secs" msgstr "" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "" @@ -4424,6 +4082,10 @@ msgstr "" msgid "timeout waiting for v2 card" msgstr "" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "" @@ -4594,6 +4256,14 @@ msgstr "" msgid "unsupported types for %q: '%q', '%q'" msgstr "" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4615,13 +4285,7 @@ msgstr "" msgid "watchdog timeout must be greater than 0" msgstr "" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "" @@ -4641,7 +4305,17 @@ msgstr "" msgid "wrong axis specified" msgstr "" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "" @@ -4649,6 +4323,10 @@ msgstr "" msgid "wrong length of condition array" msgstr "" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "" @@ -4693,6 +4371,50 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "All I2C targets are in use" +#~ msgstr "Tüm I2C hedefleri kullanımda" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q, boyutu 2 olan bir tuple olmalıdır" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q, %d ile %d arasında olmalıdır" + +#~ msgid "%q should be an int" +#~ msgstr "%q bir int olmalıdır" + +#~ msgid "(x,y) integers required" +#~ msgstr "(x, y) integerları gereklidir" + +#~ msgid "Address type out of range" +#~ msgstr "Adres tipi beklenen aralığın dışında" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "Verilen pin için AnalogIn desteklenmemektedir" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "AnalogOut işlevi desteklenmemektedir" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut yalnızca 16 bitlik. Değer 65536'dan küçük olmalıdır." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "Verilen pin için AnalogOut desteklenmemektedir" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "Bit derinliği 1-6 aralığında olmalı, %d değil" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Geçersiz arabellek boyutu. %d kadar olmalı" + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Arabellek boyutu en az 1 olmalı" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Baytlar 0-255 aralığında olmalı" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 0ad1a11f80..ddb1dbd821 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2022-02-13 00:57+0000\n" +"PO-Revision-Date: 2022-08-20 14:09+0000\n" "Last-Translator: hexthat \n" "Language-Team: Chinese Hanyu Pinyin\n" "Language: zh_Latn_pinyin\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.11-dev\n" +"X-Generator: Weblate 4.14-dev\n" #: main.c msgid "" @@ -30,6 +30,9 @@ msgid "" "\n" "Code stopped by auto-reload. Reloading soon.\n" msgstr "" +"\n" +"dài mǎ yīn zì dòng chóng xīn jiā zǎi ér tíng zhǐ. jí jiāng chóng xīn jiā " +"zǎi.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -74,10 +77,27 @@ msgstr "" "%d de zhǐ yǐn jiǎo, %d rgb yǐn jiǎo hé %d qiē piàn biǎo shì %d de gāo dù, ér " "bù shì %d" +#: ports/atmel-samd/common-hal/alarm/__init__.c +#: ports/cxd56/common-hal/analogio/AnalogOut.c ports/cxd56/common-hal/rtc/RTC.c +#: ports/espressif/common-hal/rtc/RTC.c +#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/alarm/__init__.c +#: ports/nrf/common-hal/analogio/AnalogOut.c ports/nrf/common-hal/rtc/RTC.c +#: ports/raspberrypi/common-hal/alarm/__init__.c +#: ports/raspberrypi/common-hal/analogio/AnalogOut.c +#: ports/raspberrypi/common-hal/rtc/RTC.c ports/stm/common-hal/alarm/__init__.c +#: ports/stm/common-hal/rtc/RTC.c +msgid "%q" +msgstr "%q" + #: shared-bindings/microcontroller/Pin.c msgid "%q and %q contain duplicate pins" msgstr "%q hé %q bāo hán chóng fù yǐn jiǎo" +#: ports/atmel-samd/common-hal/audioio/AudioOut.c +msgid "%q and %q must be different" +msgstr "%q hé %q bìxū bùtóng" + #: shared-bindings/microcontroller/Pin.c msgid "%q contains duplicate pins" msgstr "%q bāo hán chóng fù de yǐn jiǎo" @@ -90,12 +110,7 @@ msgstr "%q Shībài: %d" msgid "%q in use" msgstr "%q zhèngzài bèi shǐyòng" -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c py/obj.c py/objstr.c -#: py/objstrunicode.c +#: py/obj.c py/objstr.c py/objstrunicode.c msgid "%q index out of range" msgstr "%q suǒyǐn chāochū fànwéi" @@ -103,50 +118,70 @@ msgstr "%q suǒyǐn chāochū fànwéi" msgid "%q indices must be integers, not %s" msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s" +#: shared-module/bitbangio/SPI.c +msgid "%q init failed" +msgstr "%q chūshǐhuà shībài" + +#: py/argcheck.c +msgid "%q length must be %d" +msgstr "%q de chángdù bìxū shì %d" + #: py/argcheck.c msgid "%q length must be %d-%d" msgstr "%q cháng dù bì xū wéi %d-%d" -#: shared-bindings/busio/I2C.c shared-bindings/usb_hid/Device.c +#: py/argcheck.c +msgid "%q length must be <= %d" +msgstr "%q chángdù bìxū <= %d" + +#: py/argcheck.c +msgid "%q length must be >= %d" +msgstr "%q chángdù bìxū >= %d" + +#: shared-bindings/busio/I2C.c msgid "%q length must be >= 1" -msgstr "%q cháng dù bì xū >= 1" +msgstr "%q cháng dù bìxū >= 1" + +#: py/argcheck.c +msgid "%q must be %d" +msgstr "%q bìxū %d" #: py/argcheck.c msgid "%q must be %d-%d" msgstr "%q bì xū wéi %d-%d" +#: shared-bindings/displayio/Display.c +msgid "%q must be 1 when %q is True" +msgstr "sāng %q wèi True shí, %q bìxū wèi 1" + #: py/argcheck.c shared-bindings/gifio/GifWriter.c msgid "%q must be <= %d" -msgstr "%q bì xū <= %d" +msgstr "%q bìxū <= %d" #: py/argcheck.c msgid "%q must be >= %d" -msgstr "%q bì xū >= %d" +msgstr "%q bìxū >= %d" -#: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c +#: py/argcheck.c msgid "%q must be >= 0" -msgstr "%q Bìxū > = 0" +msgstr "%q bìxū > = 0" -#: shared-bindings/_bleio/CharacteristicBuffer.c -#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c -#: shared-bindings/displayio/Shape.c -#: shared-bindings/memorymonitor/AllocationAlarm.c #: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c msgid "%q must be >= 1" msgstr "%q bìxū >= 1" +#: shared-bindings/analogbufio/BufferedIn.c +#: shared-bindings/audiocore/RawSample.c +msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" +msgstr "" + #: py/argcheck.c msgid "%q must be a string" -msgstr "%q bì xū shì yí gè zì fú chuàn" +msgstr "%q bìxū shì yí gè zì fú chuàn" -#: shared-module/vectorio/Polygon.c -msgid "%q must be a tuple of length 2" -msgstr "%q bìxū shì chángdù wèi 2 de yuánzǔ" - -#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c -#: shared-module/vectorio/VectorShape.c -msgid "%q must be between %d and %d" -msgstr "%q bì xū zài %d hé %d zhī jiān" +#: py/argcheck.c +msgid "%q must be an int" +msgstr "%q bìxū shì zhěng xíng" #: py/argcheck.c msgid "%q must be of type %q" @@ -164,7 +199,11 @@ msgstr "%q bì xū shì 2 de zhěng shù cì fāng" msgid "%q out of bounds" msgstr "%q chāo chū jiè xiàn" +#: ports/atmel-samd/common-hal/pulseio/PulseIn.c +#: ports/cxd56/common-hal/pulseio/PulseIn.c +#: ports/nrf/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#: ports/stm/common-hal/pulseio/PulseIn.c py/argcheck.c #: shared-bindings/canio/Match.c msgid "%q out of range" msgstr "%q chāochū fànwéi" @@ -173,10 +212,6 @@ msgstr "%q chāochū fànwéi" msgid "%q pin invalid" msgstr "%q yǐn jiǎo wúxiào" -#: shared-bindings/fontio/BuiltinFont.c -msgid "%q should be an int" -msgstr "%q yīnggāi shì yīgè zhěngshù (int)" - #: shared-bindings/usb_hid/Device.c msgid "%q with a report ID of 0 must be of length 1" msgstr "bào gào ID shì 0 de %q bì xū cháng dù wéi 1" @@ -189,7 +224,11 @@ msgstr "%q() yāoqiú shūrù %d gè wèizhì cānshù, dàn mùqián shūrù le msgid "%q, %q, and %q must all be the same length" msgstr "%q, %q, hé %q bì xū cháng dù xiāng tóng" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/objint.c +msgid "%q=%q" +msgstr "%q=%q" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s cuò wù 0x%x" @@ -339,10 +378,6 @@ msgstr "Yìbù hánshù zhōng cúnzài 'yield from'" msgid "'yield' outside function" msgstr "'yield' wèiyú hánshù zhīwài" -#: shared-module/vectorio/VectorShape.c -msgid "(x,y) integers required" -msgstr "xūyào zhěngshù (x,y)" - #: py/compile.c msgid "*x must be assignment target" msgstr "*x bìxū shì bèi fùzhí de duìxiàng" @@ -356,9 +391,8 @@ msgid "0.0 to a complex power" msgstr "0.0 de fùshù cì mì" #: py/modbuiltins.c -#, fuzzy msgid "3-arg pow() not supported" -msgstr "bù zhīchí 3-arg pow()" +msgstr "bù zhī chí 3-arg pow()" #: shared-module/msgpack/__init__.c msgid "64 bit types" @@ -379,16 +413,12 @@ msgstr "ADC2 zhèngzài bèi WiFi shǐ yòng" msgid "Address must be %d bytes long" msgstr "dìzhǐ chángdù bìxū shì %d zìjié" -#: shared-bindings/_bleio/Address.c -msgid "Address type out of range" -msgstr "Dìzhǐ lèixíng chāochū fànwéi" - #: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "suǒyǒu CAN wàishè dōu zài shǐyòng zhōng" #: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c #: ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "suǒyǒu I2C wàishè dōu zài shǐyòng zhōng" @@ -425,7 +455,6 @@ msgstr "suǒyǒu píndào dōu zài shǐyòng zhōng" msgid "All event channels in use" msgstr "suǒyǒu shìjiàn píndào dōu zài shǐyòng zhōng" -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "All state machines in use" msgstr "suǒyǒu zhuàngtàijī dōu zài shǐyòng zhōng" @@ -461,9 +490,8 @@ msgid "Already advertising." msgstr "Mùqián zhèngzài guǎngbō." #: ports/atmel-samd/common-hal/canio/Listener.c -#, fuzzy msgid "Already have all-matches listener" -msgstr "yǐjīng yǒu all-matches jiāntīngqì" +msgstr "yǐjīng yǒu all-matches jiāntīng qì" #: shared-module/memorymonitor/AllocationAlarm.c #: shared-module/memorymonitor/AllocationSize.c @@ -474,25 +502,6 @@ msgstr "yǐjīng zài yùnxíng" msgid "Already scanning for wifi networks" msgstr "yǐjīng zài sǎomiáo WIFI wǎngluò" -#: ports/cxd56/common-hal/analogio/AnalogIn.c -msgid "AnalogIn not supported on given pin" -msgstr "gěidìng de yǐnjiǎo bù zhīchí AnalogIn" - -#: ports/cxd56/common-hal/analogio/AnalogOut.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c -#: ports/nrf/common-hal/analogio/AnalogOut.c -#: ports/raspberrypi/common-hal/analogio/AnalogOut.c -msgid "AnalogOut functionality not supported" -msgstr "Bù zhīchí AnalogOut gōngnéng" - -#: shared-bindings/analogio/AnalogOut.c -msgid "AnalogOut is only 16 bits. Value must be less than 65536." -msgstr "AnalogOut jǐn wèi 16 wèi. Zhí bìxū xiǎoyú 65536." - -#: ports/atmel-samd/common-hal/analogio/AnalogOut.c -msgid "AnalogOut not supported on given pin" -msgstr "zhǐdìng de yǐn jiǎo bù zhīchí AnalogOut" - #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" msgstr "lìng yí gè PWMAudioOut yǐ jīng zài gōngzuò" @@ -531,7 +540,7 @@ msgstr "yīnpín zhuǎnhuàn wèi bèi shíxiàn" msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN wèi shǐyòng mìmǎ" -#: shared-bindings/wifi/Radio.c +#: shared-bindings/wifi/Radio.c supervisor/shared/web_workflow/web_workflow.c msgid "Authentication failure" msgstr "shēnfèn ren4zheng4 shībài" @@ -557,28 +566,20 @@ msgid "Below minimum frame rate" msgstr "dīyú zuìdī zhēnlǜ" #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c -#, fuzzy msgid "Bit clock and word select must be sequential pins" -msgstr "wèi shí zhōng hé dān cí xuǎn zé bì xū shì shùn xù yǐn jiǎo" +msgstr "wèi shízhōng hé zì xuǎnzé bìxū shì liánxù de yǐn jiǎo" #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#, fuzzy msgid "Bit clock and word select must share a clock unit" -msgstr "Bǐtè shízhōng hé dānzì xuǎnzé bìxū gòngxiǎng shízhōng dānwèi" - -#: shared-bindings/rgbmatrix/RGBMatrix.c -#, c-format -msgid "Bit depth must be from 1 to 6 inclusive, not %d" -msgstr "wèi shēndù bìxū shì 1 dào 6, ér búshì %d" +msgstr "wèi shízhōng hé zì xuǎnzé bìxū gòngxiǎng yīgè shízhōng dānyuán" #: shared-bindings/audiobusio/PDMIn.c msgid "Bit depth must be multiple of 8." msgstr "wèi shēndù bìxū shì 8 de zhěngshùbèi." #: shared-bindings/bitmaptools/__init__.c -#, fuzzy msgid "Bitmap size and bits per value must match" -msgstr "wèitú dàxiǎo hé měigè zhí de wèi bìxū pǐpèi" +msgstr "wèi tú dàxiǎo hé měi gè zhí de wèi shù bìxū pǐpèi" #: supervisor/shared/safe_mode.c msgid "Boot device must be first device (interface #0)." @@ -613,11 +614,6 @@ msgstr "huǎnchōngqū yǔ piānyíliàng de hé tài xiǎo %d %d %d" msgid "Buffer elements must be 4 bytes long or less" msgstr "huǎnchōngqū de yuánsù bìxū wéi 4 zìjié cháng huò gèngshǎo" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "Buffer incorrect size. Should be %d bytes." -msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè. Yīnggāi shì %d zì jié." - #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Buffer is not a bytearray." msgstr "Huǎnchōng qū bùshì bytearray." @@ -627,7 +623,6 @@ msgstr "Huǎnchōng qū bùshì bytearray." msgid "Buffer is too small" msgstr "Huǎnchōng qū tài xiǎo" -#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c #, c-format msgid "Buffer length %d too big. It must be less than %d" @@ -638,18 +633,14 @@ msgstr "Huǎnchōng qū chángdù%d tài dà. Tā bìxū xiǎoyú%d" msgid "Buffer length must be a multiple of 512" msgstr "Huǎnchōngqū chángdù bìxū wéi 512 de bèishù" -#: ports/stm/common-hal/sdioio/SDCard.c +#: ports/stm/common-hal/sdioio/SDCard.c shared-bindings/floppyio/__init__.c msgid "Buffer must be a multiple of 512 bytes" msgstr "Huǎnchōngqū bìxū shì 512 zìjié de bèishù" -#: shared-bindings/bitbangio/I2C.c -msgid "Buffer must be at least length 1" -msgstr "Huǎnchōng qū bìxū zhìshǎo chángdù wéi 1" - #: shared-bindings/_bleio/PacketBuffer.c -#, fuzzy, c-format +#, c-format msgid "Buffer too short by %d bytes" -msgstr "Huǎn chōng qū tài duǎn , àn %d zì jié" +msgstr "Huǎnchōngqū tàiduǎn , mùqián zhǐyǒu %d zìjié" #: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c msgid "Buffers must be same size" @@ -667,10 +658,6 @@ msgstr "Zǒngxiàn yǐnjiǎo %d yǐjīng zài shǐyòng zhōng" msgid "Byte buffer must be 16 bytes." msgstr "Zìjié huǎnchōng qū bìxū shì 16 zìjié." -#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c -msgid "Bytes must be between 0 and 255." -msgstr "Zìjié bìxū jiè yú 0 dào 255 zhījiān." - #: shared-bindings/aesio/aes.c msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC kuài bìxū shì 16 zìjié de bèishù" @@ -679,7 +666,7 @@ msgstr "CBC kuài bìxū shì 16 zìjié de bèishù" msgid "CIRCUITPY drive could not be found or created." msgstr "zhǎo bú dào huò chuàng jiàn CIRCUITPY qū dòng qì." -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC huò jiàoyàn hé wúxiào" @@ -687,22 +674,24 @@ msgstr "CRC huò jiàoyàn hé wúxiào" msgid "Call super().__init__() before accessing native object." msgstr "Zài fǎngwèn yuánshēn dùixiàng zhīqián diàoyòng super().__init__()." -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c -#, fuzzy -msgid "Can only alarm on RTC IO from deep sleep." -msgstr "zhǐ néng zài RTC IO shàng cóng shēndù shuìmián zhōng bào jǐng." +#: ports/cxd56/common-hal/camera/Camera.c +msgid "Camera init" +msgstr "xiàngjī chūshǐhuà" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c +msgid "Can only alarm on RTC IO from deep sleep." +msgstr "Zhǐ néng cóng shēndù shuìmián zhōng duì RTC IO jìnxíng bàojǐng." #: ports/espressif/common-hal/alarm/pin/PinAlarm.c -#, fuzzy msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -"Zhǐ néng zài yīgè dī diàn píng yǐn jiǎo shàng fāchū jǐngbào, ér qítā yǐn " -"jiǎo cóng shēndù shuìmián zhōng fāchū gāo diàn píng jǐngbào." +"Zhǐ néng zài yīgè dī yǐn jiǎo shàng bàojǐng, ér qítā yǐn jiǎo cóng shēndù " +"shuìmián zhōng fāchū gāo diàn píng bàojǐng." #: ports/espressif/common-hal/alarm/pin/PinAlarm.c -#, fuzzy msgid "Can only alarm on two low pins from deep sleep." -msgstr "zhǐ néng cóng shēn dù shuì mián zhōng bào jǐng liǎng gè dī yǐn jiǎo." +msgstr "" +"Zhǐ néng cóng shēndù shuìmián zhōng de liǎng gè dī yǐn jiǎo shàng bàojǐng." #: ports/espressif/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Characteristic.c @@ -739,18 +728,10 @@ msgstr "Wúfǎ huòqǔ wēndù" msgid "Cannot have scan responses for extended, connectable advertisements." msgstr "Nín wúfǎ sǎomiáo kuòzhǎn de, kě liánjiē de guǎnggào." -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Cannot output both channels on the same pin" -msgstr "Wúfǎ shūchū tóng yīgè yǐn jiǎo shàng de liǎng gè píndào" - #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "wú fǎ lā dòng jǐn shū rù yǐn jiǎo." -#: shared-module/bitbangio/SPI.c -msgid "Cannot read without MISO pin." -msgstr "Wúfǎ dòu qǔ méiyǒu MISO de yǐn jiǎo." - #: shared-bindings/audiobusio/PDMIn.c msgid "Cannot record to a file" msgstr "Wúfǎ jìlù dào wénjiàn" @@ -762,16 +743,16 @@ msgstr "tōng guò USB kě jiàn shí wú fǎ chóng xīn ān zhuāng '/'." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c #: ports/mimxrt10xx/common-hal/microcontroller/__init__.c -msgid "Cannot reset into bootloader because no bootloader is present." -msgstr "Wúfǎ chóng zhì wèi bootloader, yīnwèi méiyǒu bootloader cúnzài." +msgid "Cannot reset into bootloader because no bootloader is present" +msgstr "wúfǎ chóngxīn qǐdòng dào yǐdǎo chéngxù, yīnwéi yǐdǎo chéngxù bù cúnzài" #: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" -msgstr "wú fǎ shè zhì tào jiē zì xuǎn xiàng" +msgstr "wúfǎ shèzhì tàojiēzì xuǎnxiàng" #: shared-bindings/digitalio/DigitalInOut.c msgid "Cannot set value when direction is input." -msgstr "Dāng fāngxiàng xiàng nèi shí, bùnéng shèzhì gāi zhí." +msgstr "Dāng fāngxiàng wéi shūrù shí, bùnéng shèzhì zhí." #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c @@ -780,25 +761,24 @@ msgstr "wú fǎ zài RS485 mó shì xià zhǐ dìng RTS huò CTS" #: py/objslice.c msgid "Cannot subclass slice" -msgstr "Wúfǎ zi fēnlèi" +msgstr "bùnéng zi lèi huà qiēpiàn" #: shared-module/bitbangio/SPI.c -msgid "Cannot transfer without MOSI and MISO pins." -msgstr "Méiyǒu MOSI/MISO jiù wúfǎ zhuǎnyí." +msgid "Cannot transfer without MOSI and MISO pins" +msgstr "méiyǒu MOSI hé MISO yǐn jiǎo wúfǎ chuánshū" #: shared-bindings/pwmio/PWMOut.c msgid "Cannot vary frequency on a timer that is already in use" msgstr "Wúfǎ gēnggǎi yǐ zài shǐyòng de jìshí qì shàng de pínlǜ" -#: ports/espressif/common-hal/alarm/pin/PinAlarm.c #: ports/nrf/common-hal/alarm/pin/PinAlarm.c +msgid "Cannot wake on pin edge, only level" +msgstr "wúfǎ zài yǐn jiǎo biānyuán huànxǐng, zhǐ néng diàn píng" + +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." msgstr "wú fǎ zài yǐn jiǎo biān yuán huàn xǐng. jǐn jí bié." -#: shared-module/bitbangio/SPI.c -msgid "Cannot write without MOSI pin." -msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo." - #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "CharacteristicBuffer writing not provided" msgstr "Wèi tígōng zìfú huǎncún xiě rù" @@ -811,10 +791,6 @@ msgstr "CircuitPython de héxīn chūxiàn gùzhàng. Āiyā!\n" msgid "CircuitPython was unable to allocate the heap." msgstr "CircuitPython wúfǎ fēnpèi duī." -#: shared-module/bitbangio/SPI.c -msgid "Clock pin init failed." -msgstr "Shízhōng de yǐn jiǎo chūshǐhuà shībài." - #: shared-module/bitbangio/I2C.c msgid "Clock stretch too long" msgstr "Shízhōng shēnzhǎn tài zhǎng" @@ -823,11 +799,6 @@ msgstr "Shízhōng shēnzhǎn tài zhǎng" msgid "Clock unit in use" msgstr "Shǐyòng shízhōng dānwèi" -#: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/paralleldisplay/ParallelBus.c -msgid "Command must be an int between 0 and 255" -msgstr "Mìnglìng bìxū shì 0 dào 255 zhī jiān de int" - #: shared-bindings/_bleio/Connection.c msgid "" "Connection has been disconnected and can no longer be used. Create a new " @@ -836,40 +807,11 @@ msgstr "Liánjiē yǐ duàn kāi, wúfǎ zài shǐyòng. Chuàngjiàn yīgè xī #: py/persistentcode.c msgid "Corrupt .mpy file" -msgstr "Fǔbài de .mpy wénjiàn" - -#: ports/cxd56/common-hal/camera/Camera.c -msgid "Could not initialize Camera" -msgstr "Wúfǎ chūshǐhuà xiàngjī" - -#: ports/cxd56/common-hal/gnss/GNSS.c -msgid "Could not initialize GNSS" -msgstr "wú fǎ chū shǐ huà GNSS" - -#: ports/cxd56/common-hal/sdioio/SDCard.c -msgid "Could not initialize SDCard" -msgstr "wú fǎ chū shǐ huà SDCard" - -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "Could not initialize UART" -msgstr "Wúfǎ chūshǐhuà UART" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init channel" -msgstr "Wúfǎ chóngxīn chūshǐhuà píndào" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not re-init timer" -msgstr "Wúfǎ chóngxīn qǐdòng jìshí qì" - -#: ports/stm/common-hal/pwmio/PWMOut.c -msgid "Could not restart PWM" -msgstr "Wúfǎ chóngqǐ PWM" +msgstr "sǔnhuài de .mpy wénjiàn" #: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" -msgstr "Wúfǎ huòqǔ shízhōng" +msgstr "wúfǎ jiǎnsuǒ shízhōng" #: shared-bindings/_bleio/Adapter.c msgid "Could not set address" @@ -887,20 +829,6 @@ msgstr "Wúfǎ qǐdòng zhōngduàn,RX máng" msgid "Couldn't allocate decoder" msgstr "Zhǎo bù dào jiěmǎ qì" -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate first buffer" -msgstr "Wúfǎ fēnpèi dì yī gè huǎnchōng qū" - -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate input buffer" -msgstr "Wúfǎ fēnpèi shūrù huǎnchōng qū" - -#: shared-module/audiocore/WaveFile.c shared-module/audiomixer/Mixer.c -#: shared-module/audiomp3/MP3Decoder.c -msgid "Couldn't allocate second buffer" -msgstr "Wúfǎ fēnpèi dì èr gè huǎnchōng qū" - #: supervisor/shared/safe_mode.c msgid "Crash into the HardFault_Handler." msgstr "Zhuìhuǐ. Shūrù HardFault_Handler." @@ -949,10 +877,6 @@ msgstr "Mùbiāo róngliàng xiǎoyú mùdì de_chángdù." msgid "Device in use" msgstr "Zhèngzài shǐyòng de shèbèi" -#: ports/cxd56/common-hal/digitalio/DigitalInOut.c -msgid "DigitalInOut not supported on given pin" -msgstr "Gěi dìng de yǐn jiǎo bù zhīchí DigitalInOut" - #: shared-bindings/displayio/Display.c #: shared-bindings/framebufferio/FramebufferDisplay.c msgid "Display must have a 16 bit colorspace." @@ -964,6 +888,10 @@ msgstr "Xiǎnshì bìxū jùyǒu 16 wèi yánsè kōngjiān." msgid "Display rotation must be in 90 degree increments" msgstr "Xiǎnshì xuánzhuǎn bìxū 90 dù jiā xīn" +#: main.c +msgid "Done" +msgstr "zuò" + #: shared-bindings/digitalio/DigitalInOut.c msgid "Drive mode not used when direction is input." msgstr "Fāngxiàng shūrù shí qūdòng móshì méiyǒu shǐyòng." @@ -999,19 +927,15 @@ msgstr "cuò wù: bǎng dìng shī bài" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c #: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c -#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c +#: shared-bindings/alarm/__init__.c shared-bindings/busio/SPI.c +#: shared-bindings/microcontroller/Pin.c #: shared-bindings/neopixel_write/__init__.c msgid "Expected a %q" msgstr "Yùqí %q" #: shared-bindings/alarm/__init__.c -msgid "Expected an alarm" -msgstr "yù qī yǒu jǐng bào" - -#: shared-module/adafruit_pixelbuf/PixelBuf.c -#, c-format -msgid "Expected tuple of length %d, got %d" -msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" +msgid "Expected an %q" +msgstr "" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c @@ -1039,21 +963,9 @@ msgstr "Fāsòng mìnglìng shībài." msgid "Failed to acquire mutex, err 0x%04x" msgstr "Wúfǎ huòdé mutex, err 0x%04x" -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c -msgid "Failed to allocate RX buffer" -msgstr "Fēnpèi RX huǎnchōng shībài" - -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -#: ports/cxd56/common-hal/pulseio/PulseIn.c -#: ports/espressif/common-hal/pulseio/PulseIn.c -#: ports/nrf/common-hal/pulseio/PulseIn.c -#: ports/raspberrypi/common-hal/pulseio/PulseIn.c -#: ports/stm/common-hal/pulseio/PulseIn.c -#, c-format -msgid "Failed to allocate RX buffer of %d bytes" -msgstr "Fēnpèi RX huǎnchōng qū%d zì jié shībài" +#: shared-module/rgbmatrix/RGBMatrix.c +msgid "Failed to allocate %q buffer" +msgstr "wèi néng fēnpèi %q huǎnchōng qū" #: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" @@ -1076,10 +988,6 @@ msgstr "Liánjiē shībài: Nèibù cuòwù" msgid "Failed to connect: timeout" msgstr "Liánjiē shībài: Chāoshí" -#: ports/espressif/common-hal/wifi/__init__.c -msgid "Failed to init wifi" -msgstr "Wúfǎ chūshǐhuà wifi" - #: shared-module/audiomp3/MP3Decoder.c msgid "Failed to parse MP3 file" msgstr "Wúfǎ jiěxī MP3 wénjiàn" @@ -1126,10 +1034,11 @@ msgstr "" msgid "Format not supported" msgstr "Bù zhīyuán géshì" -#: shared-module/framebufferio/FramebufferDisplay.c -#, c-format -msgid "Framebuffer requires %d bytes" -msgstr "zhēn huǎn chōng qū xū yào %d zì jié" +#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c +msgid "" +"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz" +msgstr "" +"pín lǜ bì xū wéi 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 huò 1008 Mhz" #: shared-bindings/pwmio/PWMOut.c msgid "Frequency must match existing PWMOut using this timer" @@ -1140,7 +1049,11 @@ msgstr "Pínlǜ bìxū yǔ shǐyòng cǐ jìshí qì de xiàn yǒu PWMOut xiāng msgid "Function requires lock" msgstr "Hánshù xūyào suǒdìng" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/cxd56/common-hal/gnss/GNSS.c +msgid "GNSS init" +msgstr "GNSS chūshǐhuà" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "tōng yòng gù zhàng" @@ -1167,19 +1080,16 @@ msgstr "Yìngjiàn máng, qǐng chángshì qítā zhēnjiǎo" msgid "Hardware in use, try alternative pins" msgstr "Shǐyòng de yìngjiàn, qǐng chángshì qítā yǐn jiǎo" -#: shared-bindings/wifi/Radio.c -msgid "Hostname must be between 1 and 253 characters" -msgstr "zhǔ jī míng bì xū jiè yú 1 hé 253 gè zì fú zhī jiān" - #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" msgstr "Wénjiàn shàng de I/ O cāozuò" #: ports/stm/common-hal/busio/I2C.c -msgid "I2C Init Error" -msgstr "I2C chūshǐhuà cuòwù" +msgid "I2C init error" +msgstr "I2C qǐdòng cuòwù" #: ports/raspberrypi/common-hal/busio/I2C.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "I2C peripheral in use" msgstr "I2C wài shè zhèng zài shǐ yòng zhōng" @@ -1291,75 +1201,37 @@ msgstr "nèi bù cuò wù" msgid "Internal error #%d" msgstr "nèi bù cuò wù #%d" -#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c +#: supervisor/shared/safe_mode.c +msgid "Internal watchdog timer expired." +msgstr "Nèibù kān mén gǒu dìngshí qì chāoshí." + +#: py/argcheck.c msgid "Invalid %q" msgstr "wú xiào %q" -#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c -#: ports/atmel-samd/common-hal/audiobusio/PDMIn.c -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#: ports/mimxrt10xx/common-hal/busio/UART.c +#: shared-bindings/microcontroller/Pin.c msgid "Invalid %q pin" msgstr "Wúxiào de %q yǐn jiǎo" -#: ports/stm/common-hal/busio/I2C.c ports/stm/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/UART.c ports/stm/common-hal/canio/CAN.c -#: ports/stm/common-hal/sdioio/SDCard.c -msgid "Invalid %q pin selection" -msgstr "wú xiào %q yǐn jiǎo xuǎn zé" - #: ports/stm/common-hal/analogio/AnalogIn.c msgid "Invalid ADC Unit value" msgstr "Wúxiào de ADC dānwèi zhí" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "Invalid AuthMode" -msgstr "wú xiào AuthMode" - #: ports/espressif/common-hal/_bleio/__init__.c #: ports/nrf/common-hal/_bleio/__init__.c msgid "Invalid BLE parameter" msgstr "wú xiào BLE cān shù" -#: shared-module/displayio/OnDiskBitmap.c -msgid "Invalid BMP file" -msgstr "Wúxiào de BMP wénjiàn" - #: shared-bindings/wifi/Radio.c msgid "Invalid BSSID" msgstr "Wúxiào de BSSID" -#: ports/espressif/common-hal/analogio/AnalogOut.c -#: ports/stm/common-hal/analogio/AnalogOut.c -msgid "Invalid DAC pin supplied" -msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" - #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" msgstr "wú xiào de MAC dì zhǐ" -#: shared-bindings/synthio/__init__.c -msgid "Invalid MIDI file" -msgstr "wú xiào de MIDI wén jiàn" - -#: ports/atmel-samd/common-hal/pwmio/PWMOut.c -#: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/espressif/common-hal/pwmio/PWMOut.c -#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c -#: ports/nrf/common-hal/pwmio/PWMOut.c -#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c -msgid "Invalid PWM frequency" -msgstr "Wúxiào de PWM pínlǜ" - -#: ports/espressif/common-hal/analogio/AnalogIn.c -msgid "Invalid Pin" -msgstr "wú xiào yǐn jiǎo" - -#: ports/espressif/bindings/espidf/__init__.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/espressif/esp_error.c py/moduerrno.c -#: shared-module/rgbmatrix/RGBMatrix.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c msgid "Invalid argument" msgstr "Wúxiào de cānshù" @@ -1367,42 +1239,11 @@ msgstr "Wúxiào de cānshù" msgid "Invalid bits per value" msgstr "Měi gè zhí de wèi wúxiào" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "Invalid buffer size" -msgstr "Wúxiào de huǎnchōng qū dàxiǎo" - -#: shared-bindings/adafruit_pixelbuf/PixelBuf.c -msgid "Invalid byteorder string" -msgstr "Wúxiào de zì jié shùnxù zìfú chuàn" - -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/espressif/common-hal/frequencyio/FrequencyIn.c -msgid "Invalid capture period. Valid range: 1 - 500" -msgstr "Wúxiào de bǔhuò zhōuqí. Yǒuxiào fànwéi: 1-500" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid channel count" -msgstr "Wúxiào de tōngdào jìshù" - -#: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format -msgid "Invalid data_count %d" -msgstr "wú xiào data_count %d" - #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c #, c-format msgid "Invalid data_pins[%d]" msgstr "wú xiào data_pins[%d]" -#: shared-bindings/digitalio/DigitalInOut.c -msgid "Invalid direction." -msgstr "Wúxiào de fāngxiàng." - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid file" -msgstr "Wúxiào de wénjiàn" - #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Géshì kuài dàxiǎo wúxiào" @@ -1411,79 +1252,15 @@ msgstr "Géshì kuài dàxiǎo wúxiào" msgid "Invalid memory access." msgstr "Wúxiào de nèicún fǎngwèn." -#: extmod/vfs_fat_file.c -msgid "Invalid mode" -msgstr "wú xiào mó shì" - #: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid multicast MAC address" msgstr "wú xiào de duō bō MAC dì zhǐ" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -msgid "Invalid number of bits" -msgstr "Wèi shù wúxiào" - -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid phase" -msgstr "Jiēduàn wúxiào" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c -#: ports/espressif/common-hal/touchio/TouchIn.c -#: ports/nrf/common-hal/alarm/pin/PinAlarm.c shared-bindings/pwmio/PWMOut.c -#: shared-module/rgbmatrix/RGBMatrix.c -msgid "Invalid pin" -msgstr "Wúxiào de yǐn jiǎo" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for left channel" -msgstr "Zuǒ tōngdào de yǐn jiǎo wúxiào" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -msgid "Invalid pin for right channel" -msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" - -#: ports/atmel-samd/common-hal/busio/I2C.c -#: ports/atmel-samd/common-hal/busio/SPI.c -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/cxd56/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/SPI.c -#: ports/cxd56/common-hal/busio/UART.c ports/cxd56/common-hal/sdioio/SDCard.c -#: ports/espressif/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/SPI.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/espressif/common-hal/canio/CAN.c -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c -#: ports/mimxrt10xx/common-hal/busio/I2C.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/usb_host/Port.c ports/nrf/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/I2C.c -#: ports/raspberrypi/common-hal/busio/SPI.c -#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c #: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Wúxiào de yǐn jiǎo" -#: shared-bindings/bitbangio/SPI.c shared-bindings/busio/SPI.c -#: shared-bindings/displayio/FourWire.c -msgid "Invalid polarity" -msgstr "Wúxiào liǎng jí zhí" - -#: shared-bindings/_bleio/Characteristic.c -msgid "Invalid properties" -msgstr "Wúxiào de shǔxìng" - -#: shared-bindings/microcontroller/__init__.c -msgid "Invalid run mode." -msgstr "Wúxiào de yùnxíng móshì." - -#: shared-module/_bleio/Attribute.c -msgid "Invalid security_mode" -msgstr "Ānquán móshì wúxiào" - -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "dà xiǎo wú xiào" @@ -1491,27 +1268,10 @@ msgstr "dà xiǎo wú xiào" msgid "Invalid socket for TLS" msgstr "TLS de chā zuò wú xiào" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "wú xiào zhuàng tài" -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice" -msgstr "Yǔyīn wúxiào" - -#: shared-bindings/audiomixer/Mixer.c -msgid "Invalid voice count" -msgstr "Wúxiào de yǔyīn jìshù" - -#: shared-module/audiocore/WaveFile.c -msgid "Invalid wave file" -msgstr "Wúxiào de làng làngcháo wénjiàn" - -#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c -msgid "Invalid word/bit length" -msgstr "Wúxiào de zì/wèi chángdù" - #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" msgstr "mì yào bì xū wéi 16, 24 huò 32 zì jié cháng" @@ -1525,25 +1285,17 @@ msgid "LHS of keyword arg must be an id" msgstr "Guānjiàn zì arg de LHS bìxū shì id" #: shared-module/displayio/Group.c -msgid "Layer already in a group." -msgstr "Tú céng yǐjīng zài yīgè zǔ zhōng." +msgid "Layer already in a group" +msgstr "tú céng yǐ zài zǔ zhōng" #: shared-module/displayio/Group.c -msgid "Layer must be a Group or TileGrid subclass." -msgstr "Layer bìxū shì Group huò TileGrid zi lèi." +msgid "Layer must be a Group or TileGrid subclass" +msgstr "tú céng bìxū shì zǔ huò píng pū wǎng gé zi lèi" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC dì zhǐ wú xiào" -#: shared-module/bitbangio/SPI.c -msgid "MISO pin init failed." -msgstr "MISO yǐn jiǎo chūshǐhuà shībài." - -#: shared-module/bitbangio/SPI.c -msgid "MOSI pin init failed." -msgstr "MOSI yǐn jiǎo shūrù shībài." - #: shared-bindings/is31fl3741/IS31FL3741.c msgid "Mapping must be a tuple" msgstr "yìng shè bì xū shì yuán zǔ" @@ -1553,18 +1305,27 @@ msgstr "yìng shè bì xū shì yuán zǔ" msgid "Maximum x value when mirrored is %d" msgstr "Jìngxiàng shí de zuìdà X zhí wèi%d" -#: shared-bindings/canio/Message.c -msgid "Messages limited to 8 bytes" -msgstr "Yóujiàn xiànzhì wèi 8 gè zì jié" - #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" msgstr "Màikèfēng qǐdòng yánchí bìxū zài 0.0 Dào 1.0 De fànwéi nèi" -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/raspberrypi/bindings/rp2pio/StateMachine.c +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched data size" +msgstr "shùjù dàxiǎo bù pǐpèi" + +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +msgid "Mismatched swap flag" +msgstr "jiāohuàn biāozhì bù pǐpèi" + +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "Missing MISO or MOSI Pin" msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo" +#: ports/stm/common-hal/busio/SPI.c +msgid "Missing MISO or MOSI pin" +msgstr "quēshǎo MISO huò MOSI yǐn jiǎo" + #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Missing first_in_pin. Instruction %d reads pin(s)" @@ -1601,11 +1362,6 @@ msgstr "quē shǎo dì yī zǔ yǐn jiǎo. zhǐ lìng %d shè zhì yǐn jiǎo" msgid "Missing jmp_pin. Instruction %d jumps on pin" msgstr "shī zōng de jmp_pin. zhǐ lìng %d zài yǐn jiǎo shàng tiào yuè" -#: shared-module/usb_hid/Device.c -#, c-format -msgid "More than %d report ids not supported" -msgstr "chāo guò %d bào gào bù zhī chí de ID" - #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "Bìxū shì %q zi lèi." @@ -1631,6 +1387,10 @@ msgstr "NVS cuò wù" msgid "Name too long" msgstr "Míngchēng tài zhǎng" +#: shared-bindings/displayio/TileGrid.c +msgid "New bitmap must be same size as old bitmap" +msgstr "xīn wèi tú de dàxiǎo bìxū yǔ jiù wèi tú xiāngtóng" + #: ports/espressif/common-hal/_bleio/__init__.c msgid "Nimble out of memory" msgstr "líng huó de bǎi tuō jì yì" @@ -1661,16 +1421,28 @@ msgstr "wèi zhǎo dào DMA qǐ bó qì" msgid "No I2C device at address: 0x%x" msgstr "dì zhǐ: 0x%x shí méi yǒu I2C qì jiàn" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "No IP" +msgstr "wú IP" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MISO Pin" msgstr "Méiyǒu MISO yǐn jiǎo" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MISO pin" +msgstr "wú MISO pin" + #: ports/espressif/common-hal/busio/SPI.c -#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Méiyǒu MOSI yǐn jiǎo" +#: ports/stm/common-hal/busio/SPI.c shared-module/bitbangio/SPI.c +msgid "No MOSI pin" +msgstr "wú MOSI pin" + #: ports/atmel-samd/common-hal/busio/UART.c #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c @@ -1709,16 +1481,6 @@ msgstr "Méiyǒu miǎnfèi de GCLKs" msgid "No hardware random available" msgstr "Méiyǒu kěyòng de yìngjiàn suíjī" -#: ports/atmel-samd/common-hal/ps2io/Ps2.c -msgid "No hardware support on clk pin" -msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" - -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c -#: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/atmel-samd/common-hal/pulseio/PulseIn.c -msgid "No hardware support on pin" -msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "No in in program" msgstr "chéng xù zhōng méi yǒu" @@ -1763,6 +1525,10 @@ msgstr "Yǐn jiǎo shàng méiyǒu xiàlā; 1Mohm tuījiàn" msgid "No space left on device" msgstr "Shèbèi shàng méiyǒu kònggé" +#: py/moduerrno.c +msgid "No such device" +msgstr "wú cǐ shèbèi" + #: py/moduerrno.c msgid "No such file/directory" msgstr "Méiyǒu cǐ lèi wénjiàn/mùlù" @@ -1813,6 +1579,14 @@ msgstr "" msgid "Odd parity is not supported" msgstr "Bù zhīchí jīshù" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Off" +msgstr "guānbì" + +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Ok" +msgstr "hái hǎo" + #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "Only 8 or 16 bit mono with " @@ -1822,7 +1596,7 @@ msgstr "Zhǐyǒu 8 huò 16 wèi dānwèi " msgid "Only IPv4 addresses supported" msgstr "Jǐn zhīchí IPv4 dìzhǐ" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Only IPv4 sockets supported" msgstr "jǐn zhī chí IPv4 tào jiē zì" @@ -1859,15 +1633,19 @@ msgstr "" msgid "Only one TouchAlarm can be set in deep sleep." msgstr "zhǐ yǒu yí gè chù mō bì kě yǐ shè zhì zài shēn dù shuì mián." -#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +#: ports/espressif/common-hal/i2ctarget/I2CTarget.c +#: ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c msgid "Only one address is allowed" msgstr "zhǐ yǔn xǔ yí gè dì zhǐ" #: ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c -#: ports/espressif/common-hal/alarm/time/TimeAlarm.c #: ports/nrf/common-hal/alarm/time/TimeAlarm.c -#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c #: ports/stm/common-hal/alarm/time/TimeAlarm.c +msgid "Only one alarm.time alarm can be set" +msgstr "zhǐ néng shèzhì yīgè nào líng shíjiān nào líng" + +#: ports/espressif/common-hal/alarm/time/TimeAlarm.c +#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c msgid "Only one alarm.time alarm can be set." msgstr "zhǐ néng shè zhì yí gè bào jǐng." @@ -1875,19 +1653,23 @@ msgstr "zhǐ néng shè zhì yí gè bào jǐng." msgid "Only one color can be transparent at a time" msgstr "Yīcì zhǐ néng yǒuyī zhǒng yánsè shì tòumíng de" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: py/moduerrno.c +msgid "Operation not permitted" +msgstr "bù yǔnxǔ cāozuò" + +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "bù zhī chí cāo zuò huò gōng néng" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "cāo zuò yǐ fēn shí" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "nèi cún bù zú" -#: ports/espressif/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Out of sockets" msgstr "tào jiē zì wài" @@ -1895,11 +1677,6 @@ msgstr "tào jiē zì wài" msgid "Out-buffer elements must be <= 4 bytes long" msgstr "huǎn chōng wài yuán sù bì xū <= 4 zì jié cháng" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "Output buffer must be at least %d bytes" -msgstr "shū chū huǎn chōng qū bì xū zhì shǎo wéi %d zì jié" - #: shared-bindings/audiobusio/PDMIn.c msgid "Oversample must be multiple of 8." msgstr "Guò cǎiyàng bìxū shì 8 de bèishù." @@ -1908,17 +1685,15 @@ msgstr "Guò cǎiyàng bìxū shì 8 de bèishù." msgid "PDMIn not available" msgstr "PDMIn bù kě yòng" -#: shared-bindings/pwmio/PWMOut.c -msgid "" -"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" -msgstr "" -"PWM yìwù zhōuqí bìxū jiè yú 0 zhì 65535 de bāoróng xìng (16 wèi fēnbiàn lǜ)" - #: shared-bindings/pwmio/PWMOut.c msgid "" "PWM frequency not writable when variable_frequency is False on construction." msgstr "Dāng biànliàng_pínlǜ shì False zài jiànzhú shí PWM pínlǜ bùkě xiě." +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "PWM restart" +msgstr "PWM chóngqǐ" + #: ports/raspberrypi/common-hal/countio/Counter.c msgid "PWM slice already in use" msgstr "yǐ jīng zài shǐ yòng de PWM qiē piàn" @@ -1935,29 +1710,14 @@ msgstr "shǐ yòng zhōng de wài shè" msgid "Permission denied" msgstr "Quánxiàn bèi jùjué" -#: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/alarm/pin/PinAlarm.c msgid "Pin cannot wake from Deep Sleep" msgstr "yǐn jiǎo wú fǎ cóng shēn dù shuì mián zhōng huàn xǐng" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Pin count must be at least 1" -msgstr "yǐn jiǎo jì shù bì xū zhì shǎo wéi 1" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "Pin count too large" msgstr "yǐn jiǎo jì shù tài dà" -#: ports/atmel-samd/common-hal/analogio/AnalogIn.c -#: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/espressif/common-hal/analogio/AnalogIn.c -#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c -#: ports/nrf/common-hal/analogio/AnalogIn.c -#: ports/raspberrypi/common-hal/analogio/AnalogIn.c -#: ports/stm/common-hal/analogio/AnalogIn.c -msgid "Pin does not have ADC capabilities" -msgstr "Pin méiyǒu ADC nénglì" - #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c msgid "Pin interrupt already in use" @@ -2029,18 +1789,10 @@ msgstr "chéng xù zài bù jiā zǎi ISR de qíng kuàng xià wán chéng" msgid "Program does OUT without loading OSR" msgstr "chéng xù zài bù jiā zǎi Osr de qíng kuàng xià zhí xíng OUT" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program must contain at least one 16-bit instruction." -msgstr "chéng xù bì xū zhì shǎo bāo hán yí gè 16 wèi zhǐ lìng ." - #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program size invalid" msgstr "chéng xù dà xiǎo wú xiào" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Program too large" -msgstr "chéng xù tài dà" - #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng." @@ -2062,30 +1814,20 @@ msgstr "RNG qǔxiāo chūshǐhuà cuòwù" msgid "RNG Init Error" msgstr "RNG chūshǐhuà cuòwù" -#: ports/nrf/common-hal/busio/UART.c ports/raspberrypi/common-hal/busio/UART.c -msgid "RS485 Not yet supported on this device" -msgstr "RS485 cǐ shè bèi shàng bù zhī chí" +#: 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 +msgid "RS485" +msgstr "RS485" #: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "Wèi chǔyú RS485 móshì shí zhǐdìngle RS485 fǎn zhuǎn" -#: ports/cxd56/common-hal/rtc/RTC.c ports/espressif/common-hal/rtc/RTC.c -#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c -#: ports/raspberrypi/common-hal/rtc/RTC.c -msgid "RTC calibration is not supported on this board" -msgstr "Cǐ bǎn bù zhīchí RTC jiàozhǔn" - #: shared-bindings/alarm/time/TimeAlarm.c shared-bindings/time/__init__.c msgid "RTC is not supported on this board" msgstr "Cǐ bǎn bù zhīchí RTC" -#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/stm/common-hal/busio/UART.c -msgid "RTS/CTS/RS485 Not yet supported on this device" -msgstr "RTS/CTS/RS485 gāi shèbèi shàng bù zhīchí" - #: ports/stm/common-hal/os/__init__.c msgid "Random number generation error" msgstr "Suíjī shù shēngchéng cuòwù" @@ -2103,10 +1845,14 @@ msgstr "Zhǐ dú wénjiàn xìtǒng" msgid "Read-only object" msgstr "Zhǐ dú duìxiàng" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "shōu dào de xiǎng yìng wú xiào" +#: supervisor/shared/bluetooth/bluetooth.c +msgid "Reconnecting" +msgstr "chóngxīn liánjiē" + #: shared-bindings/displayio/EPaperDisplay.c msgid "Refresh too soon" msgstr "Shuāxīn tài kuàile" @@ -2119,7 +1865,7 @@ msgstr "RemoteTransmissionRequests xiànzhì wèi 8 gè zì jié" msgid "Requested AES mode is unsupported" msgstr "Qǐngqiú de AES móshì bù shòu zhīchí" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "wèi zhǎo dào qǐng qiú de zī yuán" @@ -2135,6 +1881,10 @@ msgstr "Zài ānquán móshì xià yùnxíng! Bù yùnxíng yǐ bǎocún de dài msgid "SD card CSD format not supported" msgstr "Bù zhīchí SD kǎ CSD géshì" +#: ports/cxd56/common-hal/sdioio/SDCard.c +msgid "SDCard init" +msgstr "SDCard chūshǐhuà" + #: ports/stm/common-hal/sdioio/SDCard.c #, c-format msgid "SDIO GetCardInfo Error %d" @@ -2145,30 +1895,21 @@ msgstr "SDIO GetCardInfo Cuòwù %d" msgid "SDIO Init Error %d" msgstr "SDIO Init Cuòwù %d" -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Init Error" -msgstr "SPI chūshǐhuà cuòwù" - -#: ports/stm/common-hal/busio/SPI.c -msgid "SPI Re-initialization error" -msgstr "SPI chóngxīn chūshǐhuà cuòwù" - #: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "SPI pèi zhì shī bài" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI init error" +msgstr "SPI chūshǐhuà cuòwù" + #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" msgstr "SPI wài shè zhèng zài shǐ yòng zhōng" -#: shared-bindings/audiomixer/Mixer.c -msgid "Sample rate must be positive" -msgstr "Cǎiyàng lǜ bìxū wèi zhèng shù" - -#: ports/atmel-samd/common-hal/audioio/AudioOut.c -#, c-format -msgid "Sample rate too high. It must be less than %d" -msgstr "Cǎiyàng lǜ tài gāo. Tā bìxū xiǎoyú %d" +#: ports/stm/common-hal/busio/SPI.c +msgid "SPI re-init" +msgstr "SPI chóngxīn qǐdòng" #: shared-bindings/is31fl3741/FrameBuffer.c msgid "Scale dimensions must divide by 3" @@ -2188,14 +1929,6 @@ msgstr "Xùliè huà yǐjīng shǐyòngguò" msgid "Server side context cannot have hostname" msgstr "Fúwùqì duān shàngxiàwén bùnéng jùyǒu zhǔjī míng" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Set pin count must be between 1 and 5" -msgstr "shè zhì yǐn jiǎo shù bì xū jiè yú 1 hé 5 zhī jiān" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "Side set pin count must be between 1 and 5" -msgstr "cè miàn shè zhì yǐn jiǎo shù bì xū jiè yú 1 hé 5 zhī jiān" - #: ports/cxd56/common-hal/camera/Camera.c msgid "Size not supported" msgstr "bù zhī chí dà xiǎo" @@ -2231,10 +1964,6 @@ msgstr "zhǐ dìng data0 huò data_pins zhōng de yí gè" msgid "Splitting with sub-captures" msgstr "Yǔ zi bǔhuò fēnliè" -#: shared-bindings/supervisor/__init__.c -msgid "Stack size must be at least 256" -msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" - #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c msgid "Stereo left must be on PWM channel A" msgstr "lì tǐ shēng zuǒ bì xū shì zài PWM tōng dào A" @@ -2329,10 +2058,6 @@ msgstr "Píng pū gāodù bìxū huàfēn wèi tú gāodù" msgid "Tile index out of bounds" msgstr "Píng pū zhǐshù chāochū fànwéi" -#: shared-bindings/displayio/TileGrid.c -msgid "Tile value out of bounds" -msgstr "Píng pū zhí chāochū fànwéi" - #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" msgstr "Píng pū kuāndù bìxū huàfēn wèi tú kuāndù" @@ -2352,6 +2077,9 @@ msgid "To exit, please reset the board without " msgstr "Yào tuìchū, qǐng chóng zhì bǎnkuài ér bùyòng " #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c +msgid "Too many channels in sample" +msgstr "yàngběn zhōng de tōngdào tài duō" + #: ports/raspberrypi/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Chōuyàng zhōng de píndào tài duō." @@ -2384,24 +2112,21 @@ msgid "Tuple or struct_time argument required" msgstr "Xūyào Tuple huò struct_time cānshù" #: ports/stm/common-hal/busio/UART.c -msgid "UART Buffer allocation error" -msgstr "UART huǎnchōng qū fēnpèi cuòwù" +msgid "UART de-init" +msgstr "UART qù chūshǐhuà" + +#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c +msgid "UART init" +msgstr "UART chūshǐhuà" #: ports/stm/common-hal/busio/UART.c -msgid "UART De-init error" -msgstr "UART qǔxiāo chūshǐhuà cuòwù" +msgid "UART re-init" +msgstr "UART chóngxīn qǐdòng" #: ports/stm/common-hal/busio/UART.c -msgid "UART Init Error" -msgstr "UART chūshǐhuà cuòwù" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART Re-init error" -msgstr "UART chóngxīn chūshǐhuà cuòwù" - -#: ports/stm/common-hal/busio/UART.c -msgid "UART write error" -msgstr "UART xiě cuòwù" +msgid "UART write" +msgstr "UART xiě rù" #: shared-module/usb_hid/Device.c msgid "USB busy" @@ -2462,7 +2187,7 @@ msgstr "Wúfǎ dúqǔ tiáosèbǎn shùjù" #: ports/espressif/common-hal/mdns/Server.c msgid "Unable to start mDNS query" -msgstr "" +msgstr "wú fǎ qǐ dòng mDNS chá xún" #: shared-bindings/nvm/ByteArray.c msgid "Unable to write to nvm." @@ -2484,12 +2209,12 @@ msgstr "Wèi chǔlǐ de ESP TLS cuòwù %d %d %x %d" #: ports/espressif/common-hal/_bleio/__init__.c #, c-format msgid "Unknown BLE error at %s:%d: %d" -msgstr "" +msgstr "%s:%d: %d chù chū xiàn wèi zhī BLE cuò wù" #: ports/espressif/common-hal/_bleio/__init__.c #, c-format msgid "Unknown BLE error: %d" -msgstr "" +msgstr "wèi zhī de BLE cuò wù: %d" #: shared-bindings/wifi/Radio.c #, c-format @@ -2539,12 +2264,6 @@ msgstr "" "Wèi zhǐdìng de wèntí. Kěnéng shì qítā shèbèi shàng de pèiduì tíshì bèi jùjué " "huò hūlüè." -#: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/espressif/common-hal/busio/UART.c -#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c -msgid "Unsupported baudrate" -msgstr "Bù zhīchí de baudrate" - #: shared-bindings/bitmaptools/__init__.c msgid "Unsupported colorspace" msgstr "bú zhī chí de sè cǎi kōng jiān" @@ -2557,9 +2276,9 @@ msgstr "Bù zhīchí de gōnggòng qìchē lèixíng" msgid "Unsupported format" msgstr "Bù zhīchí de géshì" -#: py/moduerrno.c -msgid "Unsupported operation" -msgstr "Bù zhīchí de cāozuò" +#: shared-bindings/hashlib/__init__.c +msgid "Unsupported hash algorithm" +msgstr "bù zhīchí de hā xī suànfǎ" #: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" @@ -2579,7 +2298,7 @@ msgstr "Zhí chángdù != Suǒ xū de gùdìng chángdù" msgid "Value length > max_length" msgstr "Zhí chángdù > zuìdà chángdù" -#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c +#: ports/espressif/common-hal/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "bǎn běn wú xiào" @@ -2610,10 +2329,6 @@ msgstr "" msgid "WatchDogTimer.timeout must be greater than 0" msgstr "WatchDogTimer.Timeout bìxū dàyú 0" -#: supervisor/shared/safe_mode.c -msgid "Watchdog timer expired." -msgstr "Kān mén gǒu dìngshí qì yǐ guòqí." - #: py/builtinhelp.c #, c-format msgid "" @@ -2629,9 +2344,9 @@ msgstr "" "\n" "liè chū nèi zhì mó kuài jiàn rù `help(\"modules\")`.\n" -#: shared-bindings/wifi/Radio.c -msgid "WiFi password must be between 8 and 63 characters" -msgstr "WiFi mìmǎ bìxū jiè yú 8 dào 63 gè zìfú zhī jiān" +#: supervisor/shared/web_workflow/web_workflow.c +msgid "Wi-Fi: " +msgstr "Wi-Fi: " #: main.c msgid "Woken up by alarm.\n" @@ -2673,11 +2388,11 @@ msgstr "__new__ cānshù bìxū shì yònghù lèixíng" msgid "a bytes-like object is required" msgstr "xūyào yīgè zì jié lèi duìxiàng" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "address out of bounds" msgstr "dìzhǐ chāochū biānjiè" -#: shared-bindings/i2cperipheral/I2CPeripheral.c +#: shared-bindings/i2ctarget/I2CTarget.c msgid "addresses is empty" msgstr "dìzhǐ wèi kōng" @@ -2726,6 +2441,10 @@ msgstr "cānshù bìxū shì ndarrays" msgid "array and index length must be equal" msgstr "shù zǔ hé suǒ yǐn cháng dù bì xū xiāng děng" +#: extmod/ulab/code/numpy/io/io.c +msgid "array has too many dimensions" +msgstr "shùzǔ yǒu tài duō wéidù" + #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/nvm/ByteArray.c msgid "array/bytes required on right side" @@ -2787,10 +2506,6 @@ msgstr "wèi tú dà xiǎo bì xū pǐ pèi" msgid "bits must be 32 or less" msgstr "wèi bì xū shì 32 huò gèng shǎo" -#: shared-bindings/busio/UART.c -msgid "bits must be in range 5 to 9" -msgstr "wèi bì xū zài fàn wéi nèi 5 zhì 9" - #: shared-bindings/audiomixer/Mixer.c msgid "bits_per_sample must be 8 or 16" msgstr "měi jiàn yàngběn bìxū wèi 8 huò 16" @@ -2828,11 +2543,6 @@ msgstr "huǎn chōng qū tài xiǎo, duì yú qǐng qiú de zì jié" msgid "byteorder is not a string" msgstr "byteorder bùshì zìfú chuàn" -#: ports/atmel-samd/common-hal/busio/UART.c -#: ports/espressif/common-hal/busio/UART.c -msgid "bytes > 8 bits not supported" -msgstr "zì jié > 8 wèi" - #: py/objarray.c msgid "bytes length not a multiple of item size" msgstr "zì jié chángdù, bùshì xiàngmù dàxiǎo de bèishù" @@ -2841,7 +2551,7 @@ msgstr "zì jié chángdù, bùshì xiàngmù dàxiǎo de bèishù" msgid "bytes value out of range" msgstr "zì jié zhí chāochū fànwéi" -#: ports/atmel-samd/bindings/samd/Clock.c ports/atmel-samd/common-hal/rtc/RTC.c +#: ports/atmel-samd/bindings/samd/Clock.c msgid "calibration is out of range" msgstr "jiàozhǔn fànwéi chāochū fànwéi" @@ -2849,13 +2559,10 @@ msgstr "jiàozhǔn fànwéi chāochū fànwéi" msgid "calibration is read only" msgstr "jiàozhǔn zhǐ dú dào" -#: ports/atmel-samd/common-hal/rtc/RTC.c -msgid "calibration value out of range +/-127" -msgstr "jiàozhǔn zhí chāochū fànwéi +/-127" - +#: shared-module/vectorio/Circle.c shared-module/vectorio/Polygon.c #: shared-module/vectorio/Rectangle.c -msgid "can only be registered in one parent" -msgstr "zhǐ néng zài yí gè jiā zhǎng zhōng zhù cè" +msgid "can only have one parent" +msgstr "zhǐ néng yǒu yīgè fù xiàng" #: py/emitinlinethumb.c msgid "can only have up to 4 parameters to Thumb assembly" @@ -2877,7 +2584,7 @@ msgstr "bùnéng fēnpèi dào biǎodá shì" msgid "can't cancel self" msgstr "bù néng qǔ xiāo zì wǒ" -#: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c +#: py/obj.c py/objint.c shared-bindings/i2ctarget/I2CTarget.c #: shared-module/adafruit_pixelbuf/PixelBuf.c msgid "can't convert %q to %q" msgstr "Wúfǎ jiāng %q zhuǎnhuàn wèi %q" @@ -2953,7 +2660,7 @@ msgstr "wúfǎ yòng '%q' ' suǒyǐn jiāzài" #: py/builtinimport.c msgid "can't perform relative import" -msgstr "" +msgstr "wú fǎ zhí xíng xiāng duì dǎo rù" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" @@ -3026,6 +2733,10 @@ msgstr "bù néng háo bù hán hu de dé dào dà xiǎo de lín" msgid "casting" msgstr "tóuyǐng" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "channel re-init" +msgstr "tōngdào chóngxīn chūshǐhuà" + #: shared-bindings/_stage/Text.c msgid "chars buffer too small" msgstr "zìfú huǎnchōng qū tài xiǎo" @@ -3038,10 +2749,6 @@ msgstr "chr() cān shǔ bùzài fànwéi (0x110000)" msgid "chr() arg not in range(256)" msgstr "chr() cān shǔ bùzài fànwéi (256)" -#: shared-module/vectorio/Circle.c -msgid "circle can only be registered in one parent" -msgstr "quānzi zhǐ néng zài yī wèi jiāzhǎng zhōng zhùcè" - #: shared-bindings/bitmaptools/__init__.c msgid "clip point must be (x,y) tuple" msgstr "jiá dian bì xū shì (x,y) kuài" @@ -3109,6 +2816,10 @@ msgstr "juàn jī cānshù bìxū shì ndarrays" msgid "convolve arguments must not be empty" msgstr "juàn jī cān shǔ bùnéng wéi kōng" +#: extmod/ulab/code/numpy/io/io.c +msgid "corrupted file" +msgstr "wénjiàn sǔnhuài" + #: extmod/ulab/code/numpy/poly.c msgid "could not invert Vandermonde matrix" msgstr "wúfǎ fǎn zhuǎn fàndéméng dé jǔzhèn" @@ -3194,10 +2905,6 @@ msgstr "chú yǐ líng" msgid "division by zero" msgstr "bèi líng chú" -#: ports/espressif/common-hal/rotaryio/IncrementalEncoder.c -msgid "divisor must be 4" -msgstr "èr chóng zòu bì xū shì 4" - #: extmod/ulab/code/numpy/vector.c msgid "dtype must be float, or complex" msgstr "dtype bì xū shì fú diǎn xíng huò fù shù" @@ -3206,6 +2913,10 @@ msgstr "dtype bì xū shì fú diǎn xíng huò fù shù" msgid "empty" msgstr "kòngxián" +#: extmod/ulab/code/numpy/io/io.c +msgid "empty file" +msgstr "kōng de wénjiàn" + #: extmod/moduasyncio.c extmod/moduheapq.c extmod/modutimeq.c msgid "empty heap" msgstr "kōng yīn yīnxiào" @@ -3235,6 +2946,12 @@ msgstr "epoch_time bǎn bù zhī chí cǐ bǎn běn" msgid "error = 0x%08lX" msgstr "cuòwù = 0x%08lX" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "" +"esp32_camera.Camera requires reserved PSRAM to be configured. See the " +"documentation for instructions." +msgstr "" + #: py/runtime.c msgid "exceptions must derive from BaseException" msgstr "lìwài bìxū láizì BaseException" @@ -3309,7 +3026,7 @@ msgstr "dì yīgè cānshù bìxū shì yī gè hánshù" msgid "first argument must be a tuple of ndarrays" msgstr "dì yī gè cān shù bì xū shì yí gè yuán zǔ ndarrays" -#: extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/transform.c extmod/ulab/code/numpy/vector.c msgid "first argument must be an ndarray" msgstr "dì yī gè cānshù bìxū shì ndarray" @@ -3345,6 +3062,10 @@ msgstr "zìtǐ bìxū wèi 2048 zì jié" msgid "format requires a dict" msgstr "géshì yāoqiú yīgè yǔjù" +#: shared-bindings/microcontroller/Processor.c +msgid "frequency is read-only for this board" +msgstr "cǐ zhǔ bǎn de pín lǜ wéi zhǐ dú" + #: py/objdeque.c msgid "full" msgstr "chōngfèn" @@ -3453,7 +3174,7 @@ msgstr "géshì bù wánzhěng de mì yào" msgid "incorrect padding" msgstr "bù zhèngquè de tiánchōng" -#: extmod/ulab/code/ndarray.c +#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/transform.c msgid "index is out of bounds" msgstr "suǒyǐn chāochū fànwéi" @@ -3471,6 +3192,10 @@ msgstr "suǒyǐn bìxū shì zhěngshù" msgid "indices must be integers, slices, or Boolean lists" msgstr "suǒyǐn bìxū shì zhěngshù, qiēpiàn huò bù'ěr zhí lièbiǎo" +#: ports/espressif/common-hal/busio/I2C.c +msgid "init I2C" +msgstr "chūshǐhuà I2C" + #: extmod/ulab/code/scipy/optimize/optimize.c msgid "initial values must be iterable" msgstr "chūshǐ zhí bìxū shì kě diédài de" @@ -3516,6 +3241,10 @@ msgstr "shūrù jǔzhèn bù duìchèn" msgid "input matrix is singular" msgstr "shūrù jǔzhèn shì qíyì de" +#: extmod/ulab/code/numpy/create.c +msgid "input must be 1- or 2-d" +msgstr "shūrù bìxū shì 1- huò 2-d" + #: extmod/ulab/code/numpy/carray/carray.c msgid "input must be a 1D ndarray" msgstr "shū rù bì xū shì 1D ndarray" @@ -3524,11 +3253,7 @@ msgstr "shū rù bì xū shì 1D ndarray" msgid "input must be a dense ndarray" msgstr "shū rù bì xū shì mì jí de ndarray" -#: extmod/ulab/code/numpy/create.c -msgid "input must be a tensor of rank 2" -msgstr "shū rù bì xū shì děng jí 2 de zhāng liàng" - -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/user/user.c +#: extmod/ulab/code/user/user.c msgid "input must be an ndarray" msgstr "shū rù bì xū shì ndarray" @@ -3608,6 +3333,10 @@ msgstr "wú xiào zhǔ jī míng" msgid "invalid micropython decorator" msgstr "wúxiào de MicroPython zhuāngshì qì" +#: ports/espressif/common-hal/esp32_camera/Camera.c +msgid "invalid setting" +msgstr "shèzhì wúxiào" + #: shared-bindings/random/__init__.c msgid "invalid step" msgstr "wúxiào bùzhòu" @@ -3700,11 +3429,11 @@ msgstr "Wài shè bù zhī chí huán huí + jìng yīn mó shì" #: ports/espressif/common-hal/mdns/Server.c msgid "mDNS already initialized" -msgstr "" +msgstr "mDNS yǐ chū shǐ huà" #: ports/espressif/common-hal/mdns/Server.c msgid "mDNS only works with built-in WiFi" -msgstr "" +msgstr "mDNS jǐn shì yòng yú nèi zhì wú xiàn wǎng luò" #: py/parse.c msgid "malformed f-string" @@ -3722,24 +3451,16 @@ msgstr "shùxué yù cuòwù" msgid "matrix is not positive definite" msgstr "jǔzhèn bùshì zhèngdìng de" -#: ports/espressif/common-hal/wifi/Radio.c -msgid "max_connections must be between 0 and 10" -msgstr "" - #: ports/espressif/common-hal/_bleio/Descriptor.c #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c #, c-format msgid "max_length must be 0-%d when fixed_length is %s" -msgstr "dāng fixed_length de zhí wéi %s shí, max_length bì xū wéi 0-%d" - -#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c -msgid "max_length must be >= 0" -msgstr "zuì dà cháng dù bì xū >= 0" +msgstr "max_length bìxū shì 0-%d, dāng fixed_length shì %s" #: extmod/ulab/code/ndarray.c -msgid "maximum number of dimensions is 4" -msgstr "zuì dà chǐ cùn shù wéi 4" +msgid "maximum number of dimensions is " +msgstr "zuìdà wéi shù shì " #: py/runtime.c msgid "maximum recursion depth exceeded" @@ -3872,7 +3593,7 @@ msgstr "Méiyǒu kěyòng de fùwèi yǐn jiǎo" msgid "no response from SD card" msgstr "SD kǎ wú huíyīng" -#: py/objobject.c py/runtime.c +#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c msgid "no such attribute" msgstr "méiyǒu cǐ shǔxìng" @@ -3983,7 +3704,11 @@ msgstr "xūyào huǎnchōng qū xiéyì de duìxiàng" msgid "odd-length string" msgstr "jīshù zìfú chuàn" -#: extmod/ulab/code/numpy/create.c extmod/ulab/code/utils/utils.c +#: supervisor/shared/web_workflow/web_workflow.c +msgid "off" +msgstr "guānbì" + +#: extmod/ulab/code/utils/utils.c msgid "offset is too large" msgstr "piān yí tài dà" @@ -4105,11 +3830,7 @@ msgstr "pixel_shader bìxū shì displayio.Palette huò displayio.ColorConverter #: extmod/vfs_posix_file.c msgid "poll on file not available on win32" -msgstr "" - -#: shared-module/vectorio/Polygon.c -msgid "polygon can only be registered in one parent" -msgstr "duōbiānxíng zhī néng zài yīgè fù jí zhōng zhùcè" +msgstr "zài win32 shàng bù tí gōng wén jiàn tóu piào" #: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" @@ -4136,63 +3857,23 @@ msgstr "pow() 3 cān shǔ bùnéng wéi 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() yǒu 3 cānshù xūyào zhěngshù" -#: ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h -#: ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h -#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.h -#: ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h -#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h -#: ports/espressif/boards/artisense_rd00/mpconfigboard.h -#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h -#: ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.h -#: ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.h -#: ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h -#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h -#: ports/espressif/boards/hexky_s2/mpconfigboard.h -#: ports/espressif/boards/hiibot_iots2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.h -#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h -#: ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +#: ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h +msgid "pressing BOOT button at start up.\n" +msgstr "zài qǐdòng shí àn BOOT ànniǔ.\n" + +#: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h +msgid "pressing SW38 button at start up.\n" +msgstr "zài qǐdòng shí àn SW38 ànniǔ.\n" + +#: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h +msgid "pressing VOLUME button at start up.\n" +msgstr "zài qǐdòng shí àn SW38 ànniǔ.\n" + +#: ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.h +#: ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h +#: ports/espressif/boards/lolin_c3_mini/mpconfigboard.h #: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h -#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h -#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h -#: ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.h +#: supervisor/shared/safe_mode.c msgid "pressing boot button at start up.\n" msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n" @@ -4212,14 +3893,6 @@ msgstr "qǐ dòng shí àn xià zuǒ àn niǔ\n" msgid "pull masks conflict with direction masks" msgstr "lā kǒu zhào yǔ fāng xiàng miàn mó chōng tū" -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "pull_threshold must be between 1 and 32" -msgstr "lā lì yù zhí bì xū jiè yú 1 hé 32 zhī jiān" - -#: ports/raspberrypi/bindings/rp2pio/StateMachine.c -msgid "push_threshold must be between 1 and 32" -msgstr "tuī sòng yù zhí bì xū jiè yú 1 hé 32 zhī jiān" - #: extmod/modutimeq.c msgid "queue overflow" msgstr "duìliè yìchū" @@ -4271,14 +3944,6 @@ msgstr "gǔn dòng cān shù bì xū shì ndarray" msgid "rsplit(None,n)" msgstr "Rchāifēn(wú,N)" -#: shared-bindings/audiocore/RawSample.c -msgid "" -"sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or " -"'B'" -msgstr "" -"yàngběn yuán_yuán huǎnchōng qū bìxū shì zì yǎnlèi huò lèixíng 'h', 'H', 'b' " -"huò 'B' de shùzǔ" - #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c #: ports/raspberrypi/common-hal/audiobusio/PDMIn.c msgid "sampling rate out of range" @@ -4379,10 +4044,6 @@ msgstr "" msgid "source_bitmap must have value_count of 8" msgstr "yuán wèi tú (source_bitmap) de zhí de shù mù (value_count) bì xū shì 8" -#: shared-bindings/wifi/Radio.c -msgid "ssid can't be more than 32 bytes" -msgstr "ssid bù néng chāo guò 32 gè zì jié" - #: py/objstr.c msgid "start/end indices" msgstr "kāishǐ/jiéshù zhǐshù" @@ -4395,10 +4056,6 @@ msgstr "kāishǐ_x yīnggāi shì yīgè zhěngshù" msgid "step must be non-zero" msgstr "bùzhòu bìxū shìfēi líng" -#: shared-bindings/busio/UART.c -msgid "stop must be 1 or 2" -msgstr "tíngzhǐ bìxū wèi 1 huò 2" - #: shared-bindings/random/__init__.c msgid "stop not reachable from start" msgstr "tíngzhǐ wúfǎ cóng kāishǐ zhōng zhǎodào" @@ -4447,10 +4104,6 @@ msgstr "uctypes miáoshù fú zhōng de yǔfǎ cuòwù" msgid "threshold must be in the range 0-65536" msgstr "yùzhí bìxū zài fànwéi 0-65536" -#: shared-bindings/rgbmatrix/RGBMatrix.c -msgid "tile must be greater than zero" -msgstr "cí tiē bì xū dà yú líng" - #: shared-bindings/time/__init__.c msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xūyào 9 xùliè" @@ -4470,10 +4123,6 @@ msgstr "Chāo shí shíjiān bìxū wèi 0.0 Dào 100.0 Miǎo" msgid "timeout must be < 655.35 secs" msgstr "chāo shí bì xū < 655.35 miǎo" -#: shared-bindings/_bleio/CharacteristicBuffer.c -msgid "timeout must be >= 0.0" -msgstr "chāoshí bìxū shì >= 0.0" - #: shared-module/sdcardio/SDCard.c msgid "timeout waiting for v1 card" msgstr "děngdài v1 kǎ chāoshí" @@ -4482,6 +4131,10 @@ msgstr "děngdài v1 kǎ chāoshí" msgid "timeout waiting for v2 card" msgstr "děngdài v2 kǎ chāoshí" +#: ports/stm/common-hal/pwmio/PWMOut.c +msgid "timer re-init" +msgstr "dìngshí qì chóngxīn chūshǐhuà" + #: shared-bindings/time/__init__.c msgid "timestamp out of range for platform time_t" msgstr "time_t shíjiān chuō chāochū píngtái fànwéi" @@ -4652,6 +4305,14 @@ msgstr "bù zhīchí de cāozuò zhě lèixíng" msgid "unsupported types for %q: '%q', '%q'" msgstr "%q bù zhīchí de lèixíng: '%q', '%q'" +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols is too high" +msgstr "Usecols tài gāo" + +#: extmod/ulab/code/numpy/io/io.c +msgid "usecols keyword must be specified" +msgstr "bìxū zhǐdìng usecols guānjiàn zì" + #: py/objint.c #, c-format msgid "value must fit in %d byte(s)" @@ -4673,13 +4334,7 @@ msgstr "wèi chū shǐ huà jiān shì qì" msgid "watchdog timeout must be greater than 0" msgstr "kān mén gǒu chāoshí bìxū dàyú 0" -#: shared-bindings/bitops/__init__.c -#, c-format -msgid "width must be from 2 to 8 (inclusive), not %d" -msgstr "kuān dù bì xū cóng 2 dào 8 ( hán ), ér bù shì %d" - #: shared-bindings/is31fl3741/FrameBuffer.c -#: shared-bindings/rgbmatrix/RGBMatrix.c msgid "width must be greater than zero" msgstr "kuāndù bìxū dàyú líng" @@ -4699,7 +4354,17 @@ msgstr "cuò wù de zhóu suǒ yǐn" msgid "wrong axis specified" msgstr "zhǐ dìng de zhóu cuò wù" -#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/vector.c +#: extmod/ulab/code/numpy/io/io.c +msgid "wrong dtype" +msgstr "cuòwù de shùjù lèixíng" + +#: extmod/ulab/code/numpy/transform.c +msgid "wrong index type" +msgstr "cuòwù de suǒyǐn lèixíng" + +#: extmod/ulab/code/numpy/compare.c extmod/ulab/code/numpy/create.c +#: extmod/ulab/code/numpy/io/io.c extmod/ulab/code/numpy/transform.c +#: extmod/ulab/code/numpy/vector.c msgid "wrong input type" msgstr "shūrù lèixíng cuòwù" @@ -4707,6 +4372,10 @@ msgstr "shūrù lèixíng cuòwù" msgid "wrong length of condition array" msgstr "tiáo jiàn shù zǔ de cháng dù cuò wù" +#: extmod/ulab/code/numpy/transform.c +msgid "wrong length of index array" +msgstr "suǒyǐn shùzǔ de chángdù cuòwù" + #: extmod/ulab/code/numpy/create.c py/objarray.c py/objstr.c msgid "wrong number of arguments" msgstr "cānshù shù cuòwù" @@ -4751,6 +4420,386 @@ 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 "" +#~ "sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' " +#~ "or 'B'" +#~ msgstr "" +#~ "yàngběn yuán_yuán huǎnchōng qū bìxū shì zì yǎnlèi huò lèixíng 'h', 'H', " +#~ "'b' huò 'B' de shùzǔ" + +#~ msgid "Expected an alarm" +#~ msgstr "yù qī yǒu jǐng bào" + +#~ msgid "All I2C targets are in use" +#~ msgstr "suǒyǒu I2C mùbiāo dōu zài shǐyòng zhōng" + +#~ msgid "Failed to init wifi" +#~ msgstr "Wúfǎ chūshǐhuà wifi" + +#~ msgid "input must be a tensor of rank 2" +#~ msgstr "shū rù bì xū shì děng jí 2 de zhāng liàng" + +#~ msgid "maximum number of dimensions is 4" +#~ msgstr "zuì dà chǐ cùn shù wéi 4" + +#~ msgid "Watchdog timer expired." +#~ msgstr "Kān mén gǒu dìngshí qì yǐ guòqí." + +#~ msgid "ssid can't be more than 32 bytes" +#~ msgstr "ssid bù néng chāo guò 32 gè zì jié" + +#~ msgid "%q must be a tuple of length 2" +#~ msgstr "%q bìxū shì chángdù wèi 2 de yuánzǔ" + +#~ msgid "%q must be between %d and %d" +#~ msgstr "%q bì xū zài %d hé %d zhī jiān" + +#~ msgid "%q should be an int" +#~ msgstr "%q yīnggāi shì yīgè zhěngshù (int)" + +#~ msgid "(x,y) integers required" +#~ msgstr "xūyào zhěngshù (x,y)" + +#~ msgid "Address type out of range" +#~ msgstr "Dìzhǐ lèixíng chāochū fànwéi" + +#~ msgid "AnalogIn not supported on given pin" +#~ msgstr "gěidìng de yǐnjiǎo bù zhīchí AnalogIn" + +#~ msgid "AnalogOut functionality not supported" +#~ msgstr "Bù zhīchí AnalogOut gōngnéng" + +#~ msgid "AnalogOut is only 16 bits. Value must be less than 65536." +#~ msgstr "AnalogOut jǐn wèi 16 wèi. Zhí bìxū xiǎoyú 65536." + +#~ msgid "AnalogOut not supported on given pin" +#~ msgstr "zhǐdìng de yǐn jiǎo bù zhīchí AnalogOut" + +#, c-format +#~ msgid "Bit depth must be from 1 to 6 inclusive, not %d" +#~ msgstr "wèi shēndù bìxū shì 1 dào 6, ér búshì %d" + +#, c-format +#~ msgid "Buffer incorrect size. Should be %d bytes." +#~ msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè. Yīnggāi shì %d zì jié." + +#~ msgid "Buffer must be at least length 1" +#~ msgstr "Huǎnchōng qū bìxū zhìshǎo chángdù wéi 1" + +#~ msgid "Bytes must be between 0 and 255." +#~ msgstr "Zìjié bìxū jiè yú 0 dào 255 zhījiān." + +#~ msgid "Cannot output both channels on the same pin" +#~ msgstr "Wúfǎ shūchū tóng yīgè yǐn jiǎo shàng de liǎng gè píndào" + +#~ msgid "Cannot read without MISO pin." +#~ msgstr "Wúfǎ dòu qǔ méiyǒu MISO de yǐn jiǎo." + +#~ msgid "Cannot reset into bootloader because no bootloader is present." +#~ msgstr "Wúfǎ chóng zhì wèi bootloader, yīnwèi méiyǒu bootloader cúnzài." + +#~ msgid "Cannot transfer without MOSI and MISO pins." +#~ msgstr "Méiyǒu MOSI/MISO jiù wúfǎ zhuǎnyí." + +#~ msgid "Cannot write without MOSI pin." +#~ msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo." + +#~ msgid "Clock pin init failed." +#~ msgstr "Shízhōng de yǐn jiǎo chūshǐhuà shībài." + +#~ msgid "Command must be an int between 0 and 255" +#~ msgstr "Mìnglìng bìxū shì 0 dào 255 zhī jiān de int" + +#~ msgid "Could not initialize Camera" +#~ msgstr "Wúfǎ chūshǐhuà xiàngjī" + +#~ msgid "Could not initialize GNSS" +#~ msgstr "wú fǎ chū shǐ huà GNSS" + +#~ msgid "Could not initialize SDCard" +#~ msgstr "wú fǎ chū shǐ huà SDCard" + +#~ msgid "Could not initialize UART" +#~ msgstr "Wúfǎ chūshǐhuà UART" + +#~ msgid "Could not re-init channel" +#~ msgstr "Wúfǎ chóngxīn chūshǐhuà píndào" + +#~ msgid "Could not re-init timer" +#~ msgstr "Wúfǎ chóngxīn qǐdòng jìshí qì" + +#~ msgid "Could not restart PWM" +#~ msgstr "Wúfǎ chóngqǐ PWM" + +#~ msgid "Couldn't allocate first buffer" +#~ msgstr "Wúfǎ fēnpèi dì yī gè huǎnchōng qū" + +#~ msgid "Couldn't allocate input buffer" +#~ msgstr "Wúfǎ fēnpèi shūrù huǎnchōng qū" + +#~ msgid "Couldn't allocate second buffer" +#~ msgstr "Wúfǎ fēnpèi dì èr gè huǎnchōng qū" + +#~ msgid "DigitalInOut not supported on given pin" +#~ msgstr "Gěi dìng de yǐn jiǎo bù zhīchí DigitalInOut" + +#, c-format +#~ msgid "Expected tuple of length %d, got %d" +#~ msgstr "Qīwàng de chángdù wèi %d de yuán zǔ, dédào %d" + +#~ msgid "Failed to allocate RX buffer" +#~ msgstr "Fēnpèi RX huǎnchōng shībài" + +#, c-format +#~ msgid "Failed to allocate RX buffer of %d bytes" +#~ msgstr "Fēnpèi RX huǎnchōng qū%d zì jié shībài" + +#, c-format +#~ msgid "Framebuffer requires %d bytes" +#~ msgstr "zhēn huǎn chōng qū xū yào %d zì jié" + +#~ msgid "Hostname must be between 1 and 253 characters" +#~ msgstr "zhǔ jī míng bì xū jiè yú 1 hé 253 gè zì fú zhī jiān" + +#~ msgid "I2C Init Error" +#~ msgstr "I2C chūshǐhuà cuòwù" + +#~ msgid "Invalid %q pin selection" +#~ msgstr "wú xiào %q yǐn jiǎo xuǎn zé" + +#~ msgid "Invalid AuthMode" +#~ msgstr "wú xiào AuthMode" + +#~ msgid "Invalid BMP file" +#~ msgstr "Wúxiào de BMP wénjiàn" + +#~ msgid "Invalid DAC pin supplied" +#~ msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo" + +#~ msgid "Invalid MIDI file" +#~ msgstr "wú xiào de MIDI wén jiàn" + +#~ msgid "Invalid PWM frequency" +#~ msgstr "Wúxiào de PWM pínlǜ" + +#~ msgid "Invalid Pin" +#~ msgstr "wú xiào yǐn jiǎo" + +#~ msgid "Invalid buffer size" +#~ msgstr "Wúxiào de huǎnchōng qū dàxiǎo" + +#~ msgid "Invalid byteorder string" +#~ msgstr "Wúxiào de zì jié shùnxù zìfú chuàn" + +#~ msgid "Invalid capture period. Valid range: 1 - 500" +#~ msgstr "Wúxiào de bǔhuò zhōuqí. Yǒuxiào fànwéi: 1-500" + +#~ msgid "Invalid channel count" +#~ msgstr "Wúxiào de tōngdào jìshù" + +#, c-format +#~ msgid "Invalid data_count %d" +#~ msgstr "wú xiào data_count %d" + +#~ msgid "Invalid direction." +#~ msgstr "Wúxiào de fāngxiàng." + +#~ msgid "Invalid file" +#~ msgstr "Wúxiào de wénjiàn" + +#~ msgid "Invalid mode" +#~ msgstr "wú xiào mó shì" + +#~ msgid "Invalid number of bits" +#~ msgstr "Wèi shù wúxiào" + +#~ msgid "Invalid phase" +#~ msgstr "Jiēduàn wúxiào" + +#~ msgid "Invalid pin" +#~ msgstr "Wúxiào de yǐn jiǎo" + +#~ msgid "Invalid pin for left channel" +#~ msgstr "Zuǒ tōngdào de yǐn jiǎo wúxiào" + +#~ msgid "Invalid pin for right channel" +#~ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào" + +#~ msgid "Invalid polarity" +#~ msgstr "Wúxiào liǎng jí zhí" + +#~ msgid "Invalid properties" +#~ msgstr "Wúxiào de shǔxìng" + +#~ msgid "Invalid run mode." +#~ msgstr "Wúxiào de yùnxíng móshì." + +#~ msgid "Invalid security_mode" +#~ msgstr "Ānquán móshì wúxiào" + +#~ msgid "Invalid voice" +#~ msgstr "Yǔyīn wúxiào" + +#~ msgid "Invalid voice count" +#~ msgstr "Wúxiào de yǔyīn jìshù" + +#~ msgid "Invalid wave file" +#~ msgstr "Wúxiào de làng làngcháo wénjiàn" + +#~ msgid "Invalid word/bit length" +#~ msgstr "Wúxiào de zì/wèi chángdù" + +#~ msgid "Layer already in a group." +#~ msgstr "Tú céng yǐjīng zài yīgè zǔ zhōng." + +#~ msgid "Layer must be a Group or TileGrid subclass." +#~ msgstr "Layer bìxū shì Group huò TileGrid zi lèi." + +#~ msgid "MISO pin init failed." +#~ msgstr "MISO yǐn jiǎo chūshǐhuà shībài." + +#~ msgid "MOSI pin init failed." +#~ msgstr "MOSI yǐn jiǎo shūrù shībài." + +#~ msgid "Messages limited to 8 bytes" +#~ msgstr "Yóujiàn xiànzhì wèi 8 gè zì jié" + +#, c-format +#~ msgid "More than %d report ids not supported" +#~ msgstr "chāo guò %d bào gào bù zhī chí de ID" + +#~ msgid "No hardware support on clk pin" +#~ msgstr "Shízhōng yǐn jiǎo wú yìngjiàn zhīchí" + +#~ msgid "No hardware support on pin" +#~ msgstr "Méiyǒu zài yǐn jiǎo shàng de yìngjiàn zhīchí" + +#, c-format +#~ msgid "Output buffer must be at least %d bytes" +#~ msgstr "shū chū huǎn chōng qū bì xū zhì shǎo wéi %d zì jié" + +#~ msgid "" +#~ "PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)" +#~ msgstr "" +#~ "PWM yìwù zhōuqí bìxū jiè yú 0 zhì 65535 de bāoróng xìng (16 wèi fēnbiàn " +#~ "lǜ)" + +#~ msgid "Pin count must be at least 1" +#~ msgstr "yǐn jiǎo jì shù bì xū zhì shǎo wéi 1" + +#~ msgid "Pin does not have ADC capabilities" +#~ msgstr "Pin méiyǒu ADC nénglì" + +#~ msgid "Program must contain at least one 16-bit instruction." +#~ msgstr "chéng xù bì xū zhì shǎo bāo hán yí gè 16 wèi zhǐ lìng ." + +#~ msgid "Program too large" +#~ msgstr "chéng xù tài dà" + +#~ msgid "RS485 Not yet supported on this device" +#~ msgstr "RS485 cǐ shè bèi shàng bù zhī chí" + +#~ msgid "RTC calibration is not supported on this board" +#~ msgstr "Cǐ bǎn bù zhīchí RTC jiàozhǔn" + +#~ msgid "RTS/CTS/RS485 Not yet supported on this device" +#~ msgstr "RTS/CTS/RS485 gāi shèbèi shàng bù zhīchí" + +#~ msgid "SPI Init Error" +#~ msgstr "SPI chūshǐhuà cuòwù" + +#~ msgid "SPI Re-initialization error" +#~ msgstr "SPI chóngxīn chūshǐhuà cuòwù" + +#~ msgid "Sample rate must be positive" +#~ msgstr "Cǎiyàng lǜ bìxū wèi zhèng shù" + +#, c-format +#~ msgid "Sample rate too high. It must be less than %d" +#~ msgstr "Cǎiyàng lǜ tài gāo. Tā bìxū xiǎoyú %d" + +#~ msgid "Set pin count must be between 1 and 5" +#~ msgstr "shè zhì yǐn jiǎo shù bì xū jiè yú 1 hé 5 zhī jiān" + +#~ msgid "Side set pin count must be between 1 and 5" +#~ msgstr "cè miàn shè zhì yǐn jiǎo shù bì xū jiè yú 1 hé 5 zhī jiān" + +#~ msgid "Stack size must be at least 256" +#~ msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256" + +#~ msgid "Tile value out of bounds" +#~ msgstr "Píng pū zhí chāochū fànwéi" + +#~ msgid "UART Buffer allocation error" +#~ msgstr "UART huǎnchōng qū fēnpèi cuòwù" + +#~ msgid "UART De-init error" +#~ msgstr "UART qǔxiāo chūshǐhuà cuòwù" + +#~ msgid "UART Init Error" +#~ msgstr "UART chūshǐhuà cuòwù" + +#~ msgid "UART Re-init error" +#~ msgstr "UART chóngxīn chūshǐhuà cuòwù" + +#~ msgid "UART write error" +#~ msgstr "UART xiě cuòwù" + +#~ msgid "Unsupported baudrate" +#~ msgstr "Bù zhīchí de baudrate" + +#~ msgid "WiFi password must be between 8 and 63 characters" +#~ msgstr "WiFi mìmǎ bìxū jiè yú 8 dào 63 gè zìfú zhī jiān" + +#~ msgid "bits must be in range 5 to 9" +#~ msgstr "wèi bì xū zài fàn wéi nèi 5 zhì 9" + +#~ msgid "bytes > 8 bits not supported" +#~ msgstr "zì jié > 8 wèi" + +#~ msgid "calibration value out of range +/-127" +#~ msgstr "jiàozhǔn zhí chāochū fànwéi +/-127" + +#~ msgid "can only be registered in one parent" +#~ msgstr "zhǐ néng zài yí gè jiā zhǎng zhōng zhù cè" + +#~ msgid "circle can only be registered in one parent" +#~ msgstr "quānzi zhǐ néng zài yī wèi jiāzhǎng zhōng zhùcè" + +#~ msgid "max_connections must be between 0 and 10" +#~ msgstr "max_connections bì xū jiè yú 0 hé 10 zhī jiān" + +#~ msgid "max_length must be >= 0" +#~ msgstr "zuì dà cháng dù bì xū >= 0" + +#~ msgid "polygon can only be registered in one parent" +#~ msgstr "duōbiānxíng zhī néng zài yīgè fù jí zhōng zhùcè" + +#~ msgid "pull_threshold must be between 1 and 32" +#~ msgstr "lā lì yù zhí bì xū jiè yú 1 hé 32 zhī jiān" + +#~ msgid "push_threshold must be between 1 and 32" +#~ msgstr "tuī sòng yù zhí bì xū jiè yú 1 hé 32 zhī jiān" + +#~ msgid "stop must be 1 or 2" +#~ msgstr "tíngzhǐ bìxū wèi 1 huò 2" + +#~ msgid "tile must be greater than zero" +#~ msgstr "cí tiē bì xū dà yú líng" + +#~ msgid "timeout must be >= 0.0" +#~ msgstr "chāoshí bìxū shì >= 0.0" + +#, c-format +#~ msgid "width must be from 2 to 8 (inclusive), not %d" +#~ msgstr "kuān dù bì xū cóng 2 dào 8 ( hán ), ér bù shì %d" + +#~ msgid "Unsupported operation" +#~ msgstr "Bù zhīchí de cāozuò" + +#~ msgid "divisor must be 4" +#~ msgstr "èr chóng zòu bì xū shì 4" + #~ msgid "" #~ "\n" #~ "Code stopped by auto-reload.\n" @@ -5263,9 +5312,6 @@ msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" #~ msgid "wrong argument type" #~ msgstr "cuòwù de cānshù lèixíng" -#~ msgid "wrong index type" -#~ msgstr "cuòwù de suǒyǐn lèixíng" - #~ msgid "Must provide SCK pin" #~ msgstr "bì xū tí gòng SCK yǐn jiǎo" diff --git a/main.c b/main.c index ba6950e34c..04e8777b9a 100644 --- a/main.c +++ b/main.c @@ -58,10 +58,11 @@ #include "supervisor/shared/status_leds.h" #include "supervisor/shared/tick.h" #include "supervisor/shared/traceback.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/workflow.h" #include "supervisor/usb.h" #include "supervisor/workflow.h" +#include "supervisor/shared/external_flash/external_flash.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Processor.h" @@ -100,6 +101,14 @@ #include "shared-module/memorymonitor/__init__.h" #endif +#if CIRCUITPY_SOCKETPOOL +#include "shared-bindings/socketpool/__init__.h" +#endif + +#if CIRCUITPY_STATUS_BAR +#include "supervisor/shared/status_bar.h" +#endif + #if CIRCUITPY_USB_HID #include "shared-module/usb_hid/__init__.h" #endif @@ -198,6 +207,25 @@ STATIC void stop_mp(void) { gc_deinit(); } +STATIC const char *_current_executing_filename = NULL; + +STATIC pyexec_result_t _exec_result = {0, MP_OBJ_NULL, 0}; + +#if CIRCUITPY_STATUS_BAR +void supervisor_execution_status(void) { + mp_obj_exception_t *exception = MP_OBJ_TO_PTR(_exec_result.exception); + if (_current_executing_filename != NULL) { + serial_write(_current_executing_filename); + } else if ((_exec_result.return_code & PYEXEC_EXCEPTION) != 0 && + _exec_result.exception_line > 0 && + exception != NULL) { + mp_printf(&mp_plat_print, "%d@%s %q", _exec_result.exception_line, _exec_result.exception_filename, exception->base.type->name); + } else { + serial_write_compressed(translate("Done")); + } +} +#endif + #define STRING_LIST(...) {__VA_ARGS__, ""} // Look for the first file that exists in the list of filenames, using mp_import_stat(). @@ -212,17 +240,33 @@ STATIC const char *first_existing_file_in_list(const char *const *filenames) { return NULL; } -STATIC bool maybe_run_list(const char *const *filenames, pyexec_result_t *exec_result) { - const char *filename = first_existing_file_in_list(filenames); - if (filename == NULL) { +STATIC bool maybe_run_list(const char *const *filenames) { + _exec_result.return_code = 0; + _exec_result.exception = MP_OBJ_NULL; + _exec_result.exception_line = 0; + _current_executing_filename = first_existing_file_in_list(filenames); + if (_current_executing_filename == NULL) { return false; } - mp_hal_stdout_tx_str(filename); + mp_hal_stdout_tx_str(_current_executing_filename); serial_write_compressed(translate(" output:\n")); - pyexec_file(filename, exec_result); - #if CIRCUITPY_ATEXIT - shared_module_atexit_execute(exec_result); + + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_update(); #endif + + pyexec_file(_current_executing_filename, &_exec_result); + + #if CIRCUITPY_ATEXIT + shared_module_atexit_execute(&_exec_result); + #endif + + _current_executing_filename = NULL; + + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_update(); + #endif + return true; } @@ -276,10 +320,10 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { memorymonitor_reset(); #endif - filesystem_flush(); - stop_mp(); - free_memory(heap); - supervisor_move_memory(); + // Disable user related BLE state that uses the micropython heap. + #if CIRCUITPY_BLEIO + bleio_user_reset(); + #endif #if CIRCUITPY_CANIO common_hal_canio_reset(); @@ -289,6 +333,16 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { keypad_reset(); #endif + // Close user-initiated sockets. + #if CIRCUITPY_SOCKETPOOL + socketpool_user_reset(); + #endif + + // Turn off user initiated WiFi connections. + #if CIRCUITPY_WIFI + wifi_user_reset(); + #endif + // reset_board_buses() first because it may release pins from the never_reset state, so that // reset_port() can reset them. #if CIRCUITPY_BOARD @@ -296,6 +350,15 @@ STATIC void cleanup_after_vm(supervisor_allocation *heap, mp_obj_t exception) { #endif reset_port(); reset_board(); + + // Free the heap last because other modules may reference heap memory and need to shut down. + filesystem_flush(); + stop_mp(); + free_memory(heap); + supervisor_move_memory(); + + // Let the workflows know we've reset in case they want to restart. + supervisor_workflow_reset(); } STATIC void print_code_py_status_message(safe_mode_t safe_mode) { @@ -322,12 +385,6 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re } #endif - pyexec_result_t result; - - result.return_code = 0; - result.exception = MP_OBJ_NULL; - result.exception_line = 0; - bool skip_repl = false; bool skip_wait = false; bool found_main = false; @@ -366,7 +423,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re if (((next_code_info_t *)next_code_allocation->ptr)->filename[0] != '\0') { const char *next_list[] = {((next_code_info_t *)next_code_allocation->ptr)->filename, ""}; // This is where the user's python code is actually executed: - found_main = maybe_run_list(next_list, &result); + found_main = maybe_run_list(next_list); if (!found_main) { serial_write(((next_code_info_t *)next_code_allocation->ptr)->filename); serial_write_compressed(translate(" not found.\n")); @@ -376,11 +433,11 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re // Otherwise, default to the standard list of filenames if (!found_main) { // This is where the user's python code is actually executed: - found_main = maybe_run_list(supported_filenames, &result); + found_main = maybe_run_list(supported_filenames); // If that didn't work, double check the extensions #if CIRCUITPY_FULL_BUILD if (!found_main) { - found_main = maybe_run_list(double_extension_filenames, &result); + found_main = maybe_run_list(double_extension_filenames); if (found_main) { serial_write_compressed(translate("WARNING: Your code filename has two extensions\n")); } @@ -392,7 +449,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re // Print done before resetting everything so that we get the message over // BLE before it is reset and we have a delay before reconnect. - if ((result.return_code & PYEXEC_RELOAD) && supervisor_get_run_reason() == RUN_REASON_AUTO_RELOAD) { + if ((_exec_result.return_code & PYEXEC_RELOAD) && supervisor_get_run_reason() == RUN_REASON_AUTO_RELOAD) { serial_write_compressed(translate("\nCode stopped by auto-reload. Reloading soon.\n")); } else { serial_write_compressed(translate("\nCode done running.\n")); @@ -400,7 +457,8 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re // Finished executing python code. Cleanup includes filesystem flush and a board reset. - cleanup_after_vm(heap, result.exception); + cleanup_after_vm(heap, _exec_result.exception); + _exec_result.exception = NULL; // If a new next code file was set, that is a reason to keep it (obviously). Stuff this into // the options because it can be treated like any other reason-for-stickiness bit. The @@ -411,7 +469,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re next_code_options |= SUPERVISOR_NEXT_CODE_OPT_NEWLY_SET; } - if (result.return_code & PYEXEC_RELOAD) { + if (_exec_result.return_code & PYEXEC_RELOAD) { next_code_stickiness_situation |= SUPERVISOR_NEXT_CODE_OPT_STICKY_ON_RELOAD; // Reload immediately unless the reload is due to autoreload. In that // case, we wait below to see if any other writes occur. @@ -419,7 +477,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re skip_repl = true; skip_wait = true; } - } else if (result.return_code == 0) { + } else if (_exec_result.return_code == 0) { next_code_stickiness_situation |= SUPERVISOR_NEXT_CODE_OPT_STICKY_ON_SUCCESS; if (next_code_options & SUPERVISOR_NEXT_CODE_OPT_RELOAD_ON_SUCCESS) { skip_repl = true; @@ -430,12 +488,12 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re // Deep sleep cannot be skipped // TODO: settings in deep sleep should persist, using a new sleep memory API if (next_code_options & SUPERVISOR_NEXT_CODE_OPT_RELOAD_ON_ERROR - && !(result.return_code & PYEXEC_DEEP_SLEEP)) { + && !(_exec_result.return_code & PYEXEC_DEEP_SLEEP)) { skip_repl = true; skip_wait = true; } } - if (result.return_code & PYEXEC_FORCED_EXIT) { + if (_exec_result.return_code & PYEXEC_FORCED_EXIT) { skip_repl = false; skip_wait = true; } @@ -453,12 +511,12 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re uint8_t blink_count; bool led_active = false; #if CIRCUITPY_ALARM - if (result.return_code & PYEXEC_DEEP_SLEEP) { + if (_exec_result.return_code & PYEXEC_DEEP_SLEEP) { color = BLACK; blink_count = 0; } else #endif - if (result.return_code != PYEXEC_EXCEPTION) { + if (_exec_result.return_code != PYEXEC_EXCEPTION) { if (safe_mode == NO_SAFE_MODE) { color = ALL_DONE; blink_count = ALL_DONE_BLINKS; @@ -501,7 +559,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re } // If interrupted by keyboard, return - if (serial_connected() && serial_bytes_available()) { + if (serial_connected() && serial_bytes_available() && !autoreload_pending()) { // Skip REPL if reload was requested. skip_repl = serial_read() == CHAR_CTRL_D; if (skip_repl) { @@ -543,7 +601,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re // Sleep until our next interrupt. #if CIRCUITPY_ALARM - if (result.return_code & PYEXEC_DEEP_SLEEP) { + if (_exec_result.return_code & PYEXEC_DEEP_SLEEP) { const bool awoke_from_true_deep_sleep = common_hal_mcu_processor_get_reset_reason() == RESET_REASON_DEEP_SLEEP_ALARM; @@ -563,6 +621,9 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re else if (awoke_from_true_deep_sleep || port_get_raw_ticks(NULL) > CIRCUITPY_WORKFLOW_CONNECTION_SLEEP_DELAY * 1024) { // OK to start sleeping, real or fake. + #if CIRCUITPY_DISPLAYIO + common_hal_displayio_release_displays(); + #endif status_led_deinit(); deinit_rxtx_leds(); board_deinit(); @@ -644,6 +705,12 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re // Done waiting, start the board back up. + // We delay resetting BLE until after the wait in case we're transferring + // more files over. + #if CIRCUITPY_BLEIO + bleio_reset(); + #endif + // free code allocation if unused if ((next_code_options & next_code_stickiness_situation) == 0) { free_memory(next_code_allocation); @@ -671,6 +738,10 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool first_run, bool *simulate_re vstr_t *boot_output; STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { + if (safe_mode == NO_HEAP) { + return; + } + // If not in safe mode, run boot before initing USB and capture output in a file. // There is USB setup to do even if boot.py is not actually run. @@ -692,10 +763,12 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { usb_set_defaults(); #endif - pyexec_result_t result = {0, MP_OBJ_NULL, 0}; - if (ok_to_run) { #ifdef CIRCUITPY_BOOT_OUTPUT_FILE + #if CIRCUITPY_STATUS_BAR + // Turn off status bar updates when writing out to boot_out.txt. + supervisor_status_bar_suspend(); + #endif vstr_t boot_text; vstr_init(&boot_text, 512); boot_output = &boot_text; @@ -703,8 +776,17 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Write version info mp_printf(&mp_plat_print, "%s\nBoard ID:%s\n", MICROPY_FULL_VERSION_INFO, CIRCUITPY_BOARD_ID); + #if CIRCUITPY_MICROCONTROLLER && COMMON_HAL_MCU_PROCESSOR_UID_LENGTH > 0 + uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH]; + common_hal_mcu_processor_get_uid(raw_id); + mp_printf(&mp_plat_print, "UID:"); + for (uint8_t i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) { + mp_printf(&mp_plat_print, "%02X", raw_id[i]); + } + mp_printf(&mp_plat_print, "\n"); + #endif - bool found_boot = maybe_run_list(boot_py_filenames, &result); + bool found_boot = maybe_run_list(boot_py_filenames); (void)found_boot; @@ -714,6 +796,9 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { FATFS *fs = &vfs->fatfs; boot_output = NULL; + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_resume(); + #endif bool write_boot_output = true; FIL boot_output_file; if (f_open(fs, &boot_output_file, CIRCUITPY_BOOT_OUTPUT_FILE, FA_READ) == FR_OK) { @@ -754,7 +839,12 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { usb_get_boot_py_data(usb_boot_py_data, size); #endif - cleanup_after_vm(heap, result.exception); + port_post_boot_py(true); + + cleanup_after_vm(heap, _exec_result.exception); + _exec_result.exception = NULL; + + port_post_boot_py(false); #if CIRCUITPY_USB // Now give back the data we saved from the heap going away. @@ -785,9 +875,23 @@ STATIC int run_repl(bool first_run) { status_led_deinit(); #endif if (pyexec_mode_kind == PYEXEC_MODE_RAW_REPL) { + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_suspend(); + #endif exit_code = pyexec_raw_repl(); + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_resume(); + #endif } else { + _current_executing_filename = "REPL"; + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_update(); + #endif exit_code = pyexec_friendly_repl(); + _current_executing_filename = NULL; + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_update(); + #endif } #if CIRCUITPY_ATEXIT pyexec_result_t result; @@ -797,6 +901,13 @@ STATIC int run_repl(bool first_run) { } #endif cleanup_after_vm(heap, MP_OBJ_SENTINEL); + + // Also reset bleio. The above call omits it in case workflows should continue. In this case, + // we're switching straight to another VM so we want to reset. + #if CIRCUITPY_BLEIO + bleio_reset(); + #endif + #if CIRCUITPY_STATUS_LED status_led_init(); new_status_color(BLACK); @@ -828,6 +939,10 @@ int __attribute__((used)) main(void) { stack_init(); + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_init(); + #endif + #if CIRCUITPY_BLEIO // Early init so that a reset press can cause BLE public advertising. supervisor_bluetooth_init(); @@ -836,6 +951,12 @@ int __attribute__((used)) main(void) { // Start the debug serial serial_early_init(); + #if !INTERNAL_FLASH_FILESYSTEM + // Set up anything that might need to get done before we try to use SPI flash + // This is needed for some boards where flash relies on GPIO setup to work + external_flash_setup(); + #endif + // Create a new filesystem only if we're not in a safe mode. // A power brownout here could make it appear as if there's // no SPI flash filesystem, and we might erase the existing one. @@ -846,15 +967,15 @@ int __attribute__((used)) main(void) { safe_mode = NO_CIRCUITPY; } - // displays init after filesystem, since they could share the flash SPI - board_init(); - // Reset everything and prep MicroPython to run boot.py. reset_port(); // Port-independent devices, like CIRCUITPY_BLEIO_HCI. reset_devices(); reset_board(); + // displays init after filesystem, since they could share the flash SPI + board_init(); + // This is first time we are running CircuitPython after a reset or power-up. supervisor_set_run_reason(RUN_REASON_STARTUP); @@ -870,19 +991,10 @@ int __attribute__((used)) main(void) { run_boot_py(safe_mode); - // Start USB after giving boot.py a chance to tweak behavior. - #if CIRCUITPY_USB - // Setup USB connection after heap is available. - // It needs the heap to build descriptors. - usb_init(); - #endif + supervisor_workflow_start(); - // Set up any other serial connection. - serial_init(); - - #if CIRCUITPY_BLEIO - supervisor_bluetooth_enable_workflow(); - supervisor_start_bluetooth(); + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_request_update(true); #endif // Boot script is finished, so now go into REPL or run code.py. diff --git a/mpy-cross/Makefile.m1 b/mpy-cross/Makefile.m1 index 34e9841540..13431f708b 100644 --- a/mpy-cross/Makefile.m1 +++ b/mpy-cross/Makefile.m1 @@ -7,4 +7,4 @@ BUILD=build-arm64 include mpy-cross.mk # Because mpy-cross.mk unconditionally overwrites CC for Darwin, we must set it BELOW the inclusion -CC := $(shell xcrun --sdk macosx11.1 --find clang) -isysroot $(shell xcrun --sdk macosx11.1 --show-sdk-path) -target arm64-apple-macos11 +CC := $(shell xcrun --find clang) -isysroot $(shell xcrun --show-sdk-path) -target arm64-apple-macos11 diff --git a/mpy-cross/mpy-cross.mk b/mpy-cross/mpy-cross.mk index 642fe9b5aa..452e2f3c1f 100644 --- a/mpy-cross/mpy-cross.mk +++ b/mpy-cross/mpy-cross.mk @@ -6,12 +6,7 @@ include ../py/mkenv.mk # define main target -ifeq ($(OS),Windows_NT) -# Detect a MINGW32 build, and change the name of the final executable. -PROG ?= mpy-cross.exe -else PROG ?= mpy-cross -endif # qstr definitions (must come before including py.mk) QSTR_DEFS = qstrdefsport.h @@ -72,7 +67,7 @@ SRC_C += \ shared/runtime/gchelper_generic.c \ supervisor/stub/safe_mode.c \ supervisor/stub/stack.c \ - supervisor/shared/translate.c + supervisor/shared/translate/translate.c # Add fmode when compiling with mingw gcc COMPILER_TARGET := $(shell $(CC) -dumpmachine) @@ -83,6 +78,6 @@ endif OBJ = $(PY_CORE_O) OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) -$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h +$(BUILD)/supervisor/shared/translate/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h include $(TOP)/py/mkrules.mk diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index b529751f7f..4405766d00 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -123,8 +123,6 @@ $(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY)) #Debugging/Optimization ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og -Os - # You may want to disable -flto if it interferes with debugging. - CFLAGS += -flto -flto-partition=none # You may want to enable these flags to make setting breakpoints easier. # CFLAGS += -fno-inline -fno-ipa-sra ifeq ($(CHIP_FAMILY), samd21) @@ -147,8 +145,6 @@ else CFLAGS += -finline-limit=$(CFLAGS_INLINE_LIMIT) endif - CFLAGS += -flto -flto-partition=none - ifeq ($(CIRCUITPY_FULL_BUILD),0) CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20 endif @@ -168,6 +164,9 @@ CFLAGS += \ -msoft-float \ -mfloat-abi=soft \ -DSAMD21 +LIBS := libs/libgcc-12.1.0-Os-v6-m-nofp.a -lc +else +LIBS := -lgcc -lc endif ifeq ($(CHIP_FAMILY), samd51) CFLAGS += \ @@ -204,8 +203,6 @@ endif CFLAGS += -Wno-stringop-overread -Wno-stringop-overflow LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs -LDFLAGS += -flto=$(shell $(NPROC)) -LIBS := -lgcc -lc # Use toolchain libm if we're not using our own. ifndef INTERNAL_LIBM @@ -275,6 +272,9 @@ SRC_ASF += \ hpl/oscctrl/hpl_oscctrl.c \ hpl/trng/hpl_trng.c \ +# Ignore these errors +$(BUILD)/asf4/same54/hpl/sercom/hpl_sercom.o: CFLAGS += -Wno-maybe-uninitialized + else ifeq ($(CHIP_FAMILY), same51) SRC_ASF += \ hal/src/hal_rand_sync.c \ @@ -319,13 +319,10 @@ $(patsubst %.c,$(BUILD)/%.o,$(SRC_PERIPHERALS)): CFLAGS += -Wno-missing-prototyp SRC_C += \ audio_dma.c \ background.c \ - bindings/samd/Clock.c \ - bindings/samd/__init__.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ eic_handler.c \ fatfs_port.c \ - freetouch/adafruit_ptc.c \ lib/tinyusb/src/portable/microchip/samd/dcd_samd.c \ mphalport.c \ reset.c \ @@ -340,10 +337,18 @@ ifneq (,$(filter 1,$(CIRCUITPY_PWMIO) $(CIRCUITPY_AUDIOIO) $(CIRCUITPY_RGBMATRIX SRC_C += shared_timers.c endif +ifeq ($(CIRCUITPY_SAMD),1) +SRC_C += bindings/samd/Clock.c bindings/samd/__init__.c +endif + ifeq ($(CIRCUITPY_SDIOIO),1) SRC_C += ports/atmel-samd/sd_mmc/sd_mmc.c endif +ifeq ($(CIRCUITPY_TOUCHIO),1) +SRC_C += freetouch/adafruit_ptc.c +endif + # The smallest SAMD51 packages don't have I2S. Everything else does. ifeq ($(CIRCUITPY_AUDIOBUSIO),1) SRC_C += peripherals/samd/i2s.c peripherals/samd/$(PERIPHERALS_CHIP_FAMILY)/i2s.c diff --git a/ports/atmel-samd/bindings/samd/Clock.c b/ports/atmel-samd/bindings/samd/Clock.c index 01fb29f47a..7c405d464d 100644 --- a/ports/atmel-samd/bindings/samd/Clock.c +++ b/ports/atmel-samd/bindings/samd/Clock.c @@ -53,12 +53,8 @@ STATIC mp_obj_t samd_clock_get_enabled(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(samd_clock_get_enabled_obj, samd_clock_get_enabled); -const mp_obj_property_t samd_clock_enabled_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&samd_clock_get_enabled_obj, - MP_ROM_NONE, - MP_ROM_NONE,}, -}; +MP_PROPERTY_GETTER(samd_clock_enabled_obj, + (mp_obj_t)&samd_clock_get_enabled_obj); //| parent: Union[Clock, None] //| """Clock parent. (read-only)""" @@ -82,12 +78,8 @@ STATIC mp_obj_t samd_clock_get_parent(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(samd_clock_get_parent_obj, samd_clock_get_parent); -const mp_obj_property_t samd_clock_parent_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&samd_clock_get_parent_obj, - MP_ROM_NONE, - MP_ROM_NONE,}, -}; +MP_PROPERTY_GETTER(samd_clock_parent_obj, + (mp_obj_t)&samd_clock_get_parent_obj); //| frequency: int //| """Clock frequency in Herz. (read-only)""" @@ -99,12 +91,8 @@ STATIC mp_obj_t samd_clock_get_frequency(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(samd_clock_get_frequency_obj, samd_clock_get_frequency); -const mp_obj_property_t samd_clock_frequency_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&samd_clock_get_frequency_obj, - MP_ROM_NONE, - MP_ROM_NONE,}, -}; +MP_PROPERTY_GETTER(samd_clock_frequency_obj, + (mp_obj_t)&samd_clock_get_frequency_obj); //| calibration: int //| """Clock calibration. Not all clocks can be calibrated.""" @@ -130,12 +118,9 @@ STATIC mp_obj_t samd_clock_set_calibration(mp_obj_t self_in, mp_obj_t calibratio MP_DEFINE_CONST_FUN_OBJ_2(samd_clock_set_calibration_obj, samd_clock_set_calibration); -const mp_obj_property_t samd_clock_calibration_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&samd_clock_get_calibration_obj, - (mp_obj_t)&samd_clock_set_calibration_obj, - MP_ROM_NONE,}, -}; +MP_PROPERTY_GETSET(samd_clock_calibration_obj, + (mp_obj_t)&samd_clock_get_calibration_obj, + (mp_obj_t)&samd_clock_set_calibration_obj); STATIC const mp_rom_map_elem_t samd_clock_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_enabled), MP_ROM_PTR(&samd_clock_enabled_obj) }, diff --git a/ports/atmel-samd/boards/8086_commander/board.c b/ports/atmel-samd/boards/8086_commander/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/8086_commander/board.c +++ b/ports/atmel-samd/boards/8086_commander/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/adafruit_neokey_trinkey_m0/board.c b/ports/atmel-samd/boards/adafruit_neokey_trinkey_m0/board.c index ba0cf06ebc..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/adafruit_neokey_trinkey_m0/board.c +++ b/ports/atmel-samd/boards/adafruit_neokey_trinkey_m0/board.c @@ -25,19 +25,5 @@ */ #include "supervisor/board.h" -#include "common-hal/microcontroller/Pin.h" -#include "supervisor/shared/board.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/board.c b/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/board.c index 8804c3c324..e0f8bda171 100644 --- a/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/board.c +++ b/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/board.c @@ -27,18 +27,9 @@ #include "supervisor/board.h" #include "common-hal/microcontroller/Pin.h" #include "supervisor/shared/board.h" -#include "hal/include/hal_gpio.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} void reset_board(void) { board_reset_user_neopixels(&pin_PA15, 2); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/board.c b/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/board.c index ba0cf06ebc..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/board.c +++ b/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/board.c @@ -25,19 +25,5 @@ */ #include "supervisor/board.h" -#include "common-hal/microcontroller/Pin.h" -#include "supervisor/shared/board.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/adafruit_slide_trinkey_m0/board.c b/ports/atmel-samd/boards/adafruit_slide_trinkey_m0/board.c index 0c829a4a55..0d885160e9 100644 --- a/ports/atmel-samd/boards/adafruit_slide_trinkey_m0/board.c +++ b/ports/atmel-samd/boards/adafruit_slide_trinkey_m0/board.c @@ -29,16 +29,8 @@ #include "supervisor/shared/board.h" #include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { board_reset_user_neopixels(&pin_PA04, 2); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c b/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c index 1c79675305..80e8b909a7 100644 --- a/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c +++ b/ports/atmel-samd/boards/aloriumtech_evo_m51/board.c @@ -50,12 +50,4 @@ void board_init(void) { } } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/arduino_mkr1300/board.c b/ports/atmel-samd/boards/arduino_mkr1300/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/board.c +++ b/ports/atmel-samd/boards/arduino_mkr1300/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index c3d75202bf..261e30d7e5 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/arduino_mkrzero/board.c b/ports/atmel-samd/boards/arduino_mkrzero/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/board.c +++ b/ports/atmel-samd/boards/arduino_mkrzero/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index eea3a27f13..4f058e4f2a 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/board.c b/ports/atmel-samd/boards/arduino_nano_33_iot/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/board.c +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk index 38b1e96d6b..f289aad065 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -6,9 +6,8 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 - -# This board has many pins, and we have to remove something else to make room. -CIRCUITPY_RAINBOWIO = 0 diff --git a/ports/atmel-samd/boards/arduino_zero/board.c b/ports/atmel-samd/boards/arduino_zero/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/arduino_zero/board.c +++ b/ports/atmel-samd/boards/arduino_zero/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index 5d0734f69d..cf64b05bcf 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -6,9 +6,8 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 - -CIRCUITPY_ONEWIREIO = 0 -CIRCUITPY_RAINBOWIO = 0 diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/board.c b/ports/atmel-samd/boards/bast_pro_mini_m0/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/board.c +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/bdmicro_vina_d21/board.c b/ports/atmel-samd/boards/bdmicro_vina_d21/board.c index 5725a67dcc..f56275c016 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d21/board.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d21/board.c @@ -39,12 +39,4 @@ void board_init(void) { // port_pin_set_output_level(MICROPY_HW_LED_RX, true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/board.c b/ports/atmel-samd/boards/bdmicro_vina_d51/board.c index e0a7487bd2..1bba99ac06 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51/board.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/board.c @@ -28,15 +28,4 @@ #include "mpconfigboard.h" #include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51_pcb7/board.c b/ports/atmel-samd/boards/bdmicro_vina_d51_pcb7/board.c index 5725a67dcc..f56275c016 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51_pcb7/board.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d51_pcb7/board.c @@ -39,12 +39,4 @@ void board_init(void) { // port_pin_set_output_level(MICROPY_HW_LED_RX, true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/blm_badge/board.c b/ports/atmel-samd/boards/blm_badge/board.c index 40e66b947e..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/blm_badge/board.c +++ b/ports/atmel-samd/boards/blm_badge/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "supervisor/shared/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - board_reset_user_neopixels(&pin_PA05, 10); -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/board.c b/ports/atmel-samd/boards/capablerobot_usbhub/board.c index d421db8b25..711b2cf766 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/board.c +++ b/ports/atmel-samd/boards/capablerobot_usbhub/board.c @@ -29,15 +29,4 @@ #include "hal/include/hal_gpio.h" #include "common-hal/microcontroller/Pin.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/catwan_usbstick/board.c b/ports/atmel-samd/boards/catwan_usbstick/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/board.c +++ b/ports/atmel-samd/boards/catwan_usbstick/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/board.c b/ports/atmel-samd/boards/circuitbrains_basic_m0/board.c index 1e5a53751a..a28d51be4f 100755 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/board.c +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/board.c @@ -26,18 +26,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/circuitbrains_deluxe_m4/board.c b/ports/atmel-samd/boards/circuitbrains_deluxe_m4/board.c index 1e5a53751a..a28d51be4f 100755 --- a/ports/atmel-samd/boards/circuitbrains_deluxe_m4/board.c +++ b/ports/atmel-samd/boards/circuitbrains_deluxe_m4/board.c @@ -26,18 +26,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/circuitplayground_express/board.c b/ports/atmel-samd/boards/circuitplayground_express/board.c index 113db13085..bda4f7520b 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/board.c +++ b/ports/atmel-samd/boards/circuitplayground_express/board.c @@ -31,9 +31,6 @@ #include "supervisor/shared/board.h" #include "hal/include/hal_gpio.h" -void board_init(void) { -} - // Check the status of the two buttons on CircuitPlayground Express. If both are // pressed, then boot into user safe mode. bool board_requests_safe_mode(void) { @@ -55,5 +52,4 @@ void reset_board(void) { board_reset_user_neopixels(&pin_PB23, 10); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 5311cdc1d4..b64fd2033d 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -19,7 +19,7 @@ CIRCUITPY_COUNTIO = 1 CIRCUITPY_BUSDEVICE = 1 # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground/frozen_cpx FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/board.c b/ports/atmel-samd/boards/circuitplayground_express_crickit/board.c index d419813df3..bd9eba93cc 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/board.c +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/board.c @@ -31,9 +31,6 @@ #include "hal/include/hal_gpio.h" #include "supervisor/shared/board.h" -void board_init(void) { -} - // Check the status of the two buttons on CircuitPlayground Express. If both are // pressed, then boot into user safe mode. bool board_requests_safe_mode(void) { @@ -55,5 +52,4 @@ void reset_board(void) { board_reset_user_neopixels(&pin_PB23, 10); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index fb65d7cd0a..c108a90250 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -17,7 +17,7 @@ CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_KEYPAD = 0 # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground/frozen_cpx FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Crickit FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Motor diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/board.c b/ports/atmel-samd/boards/circuitplayground_express_displayio/board.c index d419813df3..bd9eba93cc 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/board.c +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/board.c @@ -31,9 +31,6 @@ #include "hal/include/hal_gpio.h" #include "supervisor/shared/board.h" -void board_init(void) { -} - // Check the status of the two buttons on CircuitPlayground Express. If both are // pressed, then boot into user safe mode. bool board_requests_safe_mode(void) { @@ -55,5 +52,4 @@ void reset_board(void) { board_reset_user_neopixels(&pin_PB23, 10); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index fd9e6cc2e6..cc125e1ffb 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -23,7 +23,7 @@ CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_PARALLELDISPLAY = 0 # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground/frozen_cpx FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index 05c0de4210..97504d44e5 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -28,6 +28,13 @@ SECTIONS _sfixed = .; KEEP(*(.vectors)) /* isr vector table */ + __property_getter_start = .; + *(.property_getter) + __property_getter_end = .; + __property_getset_start = .; + *(.property_getset) + __property_getset_end = .; + /* Sort text sections so that they have fewer *fill* bytes needed. */ *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.text))) /* .text sections (code) */ *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.text*))) /* .text* sections (code) */ diff --git a/ports/atmel-samd/boards/cp32-m4/board.c b/ports/atmel-samd/boards/cp32-m4/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/cp32-m4/board.c +++ b/ports/atmel-samd/boards/cp32-m4/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/cp_sapling_m0/board.c b/ports/atmel-samd/boards/cp_sapling_m0/board.c index ba0cf06ebc..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0/board.c +++ b/ports/atmel-samd/boards/cp_sapling_m0/board.c @@ -25,19 +25,5 @@ */ #include "supervisor/board.h" -#include "common-hal/microcontroller/Pin.h" -#include "supervisor/shared/board.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/cp_sapling_m0_revb/board.c b/ports/atmel-samd/boards/cp_sapling_m0_revb/board.c index ba0cf06ebc..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0_revb/board.c +++ b/ports/atmel-samd/boards/cp_sapling_m0_revb/board.c @@ -25,19 +25,5 @@ */ #include "supervisor/board.h" -#include "common-hal/microcontroller/Pin.h" -#include "supervisor/shared/board.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/board.c b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/board.c index ba0cf06ebc..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/board.c +++ b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/board.c @@ -25,19 +25,5 @@ */ #include "supervisor/board.h" -#include "common-hal/microcontroller/Pin.h" -#include "supervisor/shared/board.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk index 7a060a168b..a3f9306c7d 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/mpconfigboard.mk @@ -13,3 +13,4 @@ EXTERNAL_FLASH_DEVICES = AT25DF081A CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_ZLIB = 0 diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c b/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c new file mode 100644 index 0000000000..fb1ce4fb83 --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h new file mode 100644 index 0000000000..7e0d96f0fe --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.h @@ -0,0 +1,27 @@ +#define MICROPY_HW_BOARD_NAME "Cytron Maker Zero SAMD21" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define MICROPY_HW_LED_TX &pin_PA27 +#define MICROPY_HW_LED_RX &pin_PB03 + +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA12) + +#define DEFAULT_UART_BUS_RX (&pin_PA11) +#define DEFAULT_UART_BUS_TX (&pin_PA10) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 + +// Connected to a crystal +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 + +// SWD-only +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk new file mode 100644 index 0000000000..9466ce571a --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x04D8 +USB_PID = 0xE799 +USB_PRODUCT = "Maker Zero SAMD21" +USB_MANUFACTURER = "Cytron" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE +CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c b/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c new file mode 100644 index 0000000000..4bb0f48467 --- /dev/null +++ b/ports/atmel-samd/boards/cytron_maker_zero_samd21/pins.c @@ -0,0 +1,49 @@ +#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_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_PA13) }, + { MP_ROM_QSTR(MP_QSTR_ATN), MP_ROM_PTR(&pin_PA13) }, + + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, + + { MP_ROM_QSTR(MP_QSTR_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/atmel-samd/boards/datalore_ip_m4/board.c b/ports/atmel-samd/boards/datalore_ip_m4/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/board.c +++ b/ports/atmel-samd/boards/datalore_ip_m4/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/datum_distance/board.c b/ports/atmel-samd/boards/datum_distance/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/datum_distance/board.c +++ b/ports/atmel-samd/boards/datum_distance/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/datum_imu/board.c b/ports/atmel-samd/boards/datum_imu/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/datum_imu/board.c +++ b/ports/atmel-samd/boards/datum_imu/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/datum_light/board.c b/ports/atmel-samd/boards/datum_light/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/datum_light/board.c +++ b/ports/atmel-samd/boards/datum_light/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/datum_weather/board.c b/ports/atmel-samd/boards/datum_weather/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/datum_weather/board.c +++ b/ports/atmel-samd/boards/datum_weather/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/dynalora_usb/board.c b/ports/atmel-samd/boards/dynalora_usb/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/dynalora_usb/board.c +++ b/ports/atmel-samd/boards/dynalora_usb/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/board.c b/ports/atmel-samd/boards/dynossat_edu_eps/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/dynossat_edu_eps/board.c +++ b/ports/atmel-samd/boards/dynossat_edu_eps/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/dynossat_edu_obc/board.c b/ports/atmel-samd/boards/dynossat_edu_obc/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/dynossat_edu_obc/board.c +++ b/ports/atmel-samd/boards/dynossat_edu_obc/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/escornabot_makech/board.c b/ports/atmel-samd/boards/escornabot_makech/board.c index bfc3bade9d..a3c19899e8 100644 --- a/ports/atmel-samd/boards/escornabot_makech/board.c +++ b/ports/atmel-samd/boards/escornabot_makech/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/board.c b/ports/atmel-samd/boards/feather_m0_adalogger/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/board.c +++ b/ports/atmel-samd/boards/feather_m0_adalogger/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index 62336ecf50..b0e01e43a5 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/feather_m0_basic/board.c b/ports/atmel-samd/boards/feather_m0_basic/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/board.c +++ b/ports/atmel-samd/boards/feather_m0_basic/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index cfd1f63cb3..f54da83f11 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/feather_m0_express/board.c b/ports/atmel-samd/boards/feather_m0_express/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/feather_m0_express/board.c +++ b/ports/atmel-samd/boards/feather_m0_express/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/board.c b/ports/atmel-samd/boards/feather_m0_express_crickit/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/board.c +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/board.c b/ports/atmel-samd/boards/feather_m0_rfm69/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/board.c +++ b/ports/atmel-samd/boards/feather_m0_rfm69/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 48c0f47064..a1891f972e 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/board.c b/ports/atmel-samd/boards/feather_m0_rfm9x/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/board.c +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index 4003dd67f0..3bc3fa3ed0 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Adafruit Industries LLC" CHIP_VARIANT = SAMD21G18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/feather_m0_supersized/board.c b/ports/atmel-samd/boards/feather_m0_supersized/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/board.c +++ b/ports/atmel-samd/boards/feather_m0_supersized/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/feather_m4_can/board.c b/ports/atmel-samd/boards/feather_m4_can/board.c index 289d68af29..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/feather_m4_can/board.c +++ b/ports/atmel-samd/boards/feather_m4_can/board.c @@ -25,17 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk index 088748a0cc..1c337d6256 100644 --- a/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_can/mpconfigboard.mk @@ -12,3 +12,5 @@ LONGINT_IMPL = MPZ CIRCUITPY__EVE = 1 CIRCUITPY_CANIO = 1 + +CIRCUITPY_LTO_PARTITION = one diff --git a/ports/atmel-samd/boards/feather_m4_express/board.c b/ports/atmel-samd/boards/feather_m4_express/board.c index 289d68af29..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/feather_m4_express/board.c +++ b/ports/atmel-samd/boards/feather_m4_express/board.c @@ -25,17 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/fluff_m0/board.c b/ports/atmel-samd/boards/fluff_m0/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/fluff_m0/board.c +++ b/ports/atmel-samd/boards/fluff_m0/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/gemma_m0/board.c b/ports/atmel-samd/boards/gemma_m0/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/gemma_m0/board.c +++ b/ports/atmel-samd/boards/gemma_m0/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/board.c b/ports/atmel-samd/boards/grandcentral_m4_express/board.c index f72884ffe8..7180deb278 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/board.c +++ b/ports/atmel-samd/boards/grandcentral_m4_express/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index aace060b01..701dc4a8ec 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -104,22 +104,14 @@ void board_init(void) { sizeof(display_init_sequence), &pin_PA00, NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 + false, // not SH1107 + 50000); // backlight pwm frequency } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index 358c326b62..5003c904bc 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -84,22 +84,14 @@ void board_init(void) { sizeof(display_init_sequence), &pin_PB14, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 + false, // not SH1107 + 50000); // backlight pwm frequency } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk index 1154d0bb1f..51fccc56e5 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk @@ -7,5 +7,5 @@ CHIP_VARIANT = SAMD51J19A CHIP_FAMILY = samd51 QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = GD25Q64C +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/huntercat_nfc/board.c b/ports/atmel-samd/boards/huntercat_nfc/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/huntercat_nfc/board.c +++ b/ports/atmel-samd/boards/huntercat_nfc/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/board.c b/ports/atmel-samd/boards/itsybitsy_m0_express/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/board.c +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/board.c b/ports/atmel-samd/boards/itsybitsy_m4_express/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/board.c +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/kicksat-sprite/board.c b/ports/atmel-samd/boards/kicksat-sprite/board.c index df7bd70dad..b22d8ae366 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/board.c +++ b/ports/atmel-samd/boards/kicksat-sprite/board.c @@ -25,20 +25,6 @@ */ -#include - #include "supervisor/board.h" -#include "py/mpconfig.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index dd6b811f5b..9bc50ab429 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -18,6 +18,7 @@ CIRCUITPY_AUDIOMIXER = 0 CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_FLOPPYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_GETPASS = 0 CIRCUITPY_KEYPAD = 0 @@ -26,6 +27,8 @@ CIRCUITPY_PS2IO = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO = 0 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 CIRCUITPY_ULAB = 0 diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/board.c b/ports/atmel-samd/boards/loc_ber_m4_base_board/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/loc_ber_m4_base_board/board.c +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/matrixportal_m4/board.c b/ports/atmel-samd/boards/matrixportal_m4/board.c index 1d9b33a40c..65d7297ed9 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/board.c +++ b/ports/atmel-samd/boards/matrixportal_m4/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk index 1770fabc69..1f77c11931 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/matrixportal_m4/mpconfigboard.mk @@ -10,14 +10,16 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "S25FL116K, S25FL216K, GD25Q16C" LONGINT_IMPL = MPZ +CIRCUITPY_LTO_PARTITION = one + CIRCUITPY_AESIO = 0 -CIRCUITPY_ONEWIREIO = 0 +CIRCUITPY_FLOPPYIO = 0 CIRCUITPY_PARALLELDISPLAY = 0 -CIRCUITPY_SDCARDIO = 0 CIRCUITPY_SHARPDISPLAY = 0 -CIRCUITPY_TRACEBACK = 0 +CIRCUITPY_ULAB = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ESP32SPI FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/atmel-samd/boards/meowmeow/board.c b/ports/atmel-samd/boards/meowmeow/board.c index bfc3bade9d..a3c19899e8 100644 --- a/ports/atmel-samd/boards/meowmeow/board.c +++ b/ports/atmel-samd/boards/meowmeow/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/metro_m0_express/board.c b/ports/atmel-samd/boards/metro_m0_express/board.c index 5725a67dcc..f56275c016 100644 --- a/ports/atmel-samd/boards/metro_m0_express/board.c +++ b/ports/atmel-samd/boards/metro_m0_express/board.c @@ -39,12 +39,4 @@ void board_init(void) { // port_pin_set_output_level(MICROPY_HW_LED_RX, true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/board.c b/ports/atmel-samd/boards/metro_m4_airlift_lite/board.c index e0a7487bd2..1bba99ac06 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/board.c +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/board.c @@ -28,15 +28,4 @@ #include "mpconfigboard.h" #include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/pins.c b/ports/atmel-samd/boards/metro_m4_airlift_lite/pins.c index 4af8871ff0..dcb6774da8 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/pins.c +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/pins.c @@ -28,6 +28,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA19) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA17) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_PA16) }, // ESP control diff --git a/ports/atmel-samd/boards/metro_m4_express/board.c b/ports/atmel-samd/boards/metro_m4_express/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/metro_m4_express/board.c +++ b/ports/atmel-samd/boards/metro_m4_express/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/mini_sam_m4/board.c b/ports/atmel-samd/boards/mini_sam_m4/board.c index e0a7487bd2..1bba99ac06 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/board.c +++ b/ports/atmel-samd/boards/mini_sam_m4/board.c @@ -28,15 +28,4 @@ #include "mpconfigboard.h" #include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index e4e5da3ea5..76c96bba82 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -85,22 +85,14 @@ void board_init(void) { sizeof(display_init_sequence), &pin_PA23, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk index 86a04be87f..56dab1d788 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk @@ -7,5 +7,5 @@ CHIP_VARIANT = SAMD51J19A CHIP_FAMILY = samd51 QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = GD25Q64C +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/board.c b/ports/atmel-samd/boards/ndgarage_ndbit6/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/board.c +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/board.c b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/board.c +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/neopixel_trinkey_m0/board.c b/ports/atmel-samd/boards/neopixel_trinkey_m0/board.c index f97d38a1a7..ed54817129 100644 --- a/ports/atmel-samd/boards/neopixel_trinkey_m0/board.c +++ b/ports/atmel-samd/boards/neopixel_trinkey_m0/board.c @@ -29,16 +29,8 @@ #include "supervisor/shared/board.h" #include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { board_reset_user_neopixels(&pin_PA05, 4); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/nfc_copy_cat/board.c b/ports/atmel-samd/boards/nfc_copy_cat/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/nfc_copy_cat/board.c +++ b/ports/atmel-samd/boards/nfc_copy_cat/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/openbook_m4/board.c b/ports/atmel-samd/boards/openbook_m4/board.c index 40512b9416..30537dd3f4 100644 --- a/ports/atmel-samd/boards/openbook_m4/board.c +++ b/ports/atmel-samd/boards/openbook_m4/board.c @@ -102,12 +102,4 @@ void board_init(void) { false); // two_byte_sequence_length } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk b/ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk index 85b2dd4205..c46ed6a9fd 100644 --- a/ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/openbook_m4/mpconfigboard.mk @@ -10,4 +10,4 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ -CIRCUITPY_GAMEPADSHIFT = 1 +CIRCUITPY_KEYPAD = 1 diff --git a/ports/atmel-samd/boards/pewpew10/board.c b/ports/atmel-samd/boards/pewpew10/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/pewpew10/board.c +++ b/ports/atmel-samd/boards/pewpew10/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pewpew_lcd/board.c b/ports/atmel-samd/boards/pewpew_lcd/board.c new file mode 100644 index 0000000000..f4060571bf --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/board.c @@ -0,0 +1,96 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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 "shared-bindings/board/__init__.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/busio/SPI.h" + +displayio_fourwire_obj_t board_display_obj; + +#define DELAY 0x80 + +uint8_t display_init_sequence[] = { + 0xe2, 0, // reset + 0x2f, 0, // power on + 0x80, 0, // contrast 0 + 0xa4, 0, // display normal + 0xaf, 0, // display on + 0x40, 0, // start line 0 +}; + +void board_init(void) { + busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_PA23, &pin_PA22, NULL, false); + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + NULL, // Command or data + &pin_PA19, // Chip select + &pin_PA18, // Reset + 40000000LL, // Baudrate + 0, // Polarity + 0); // Phase + + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 96, // Width + 68, // Height + 0, // column start + 0, // row start + 180, // 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 + false, // reverse_pixels_in_word + 0, // Set column command + 0, // Set row command + 0, // Write memory command + display_init_sequence, + sizeof(display_init_sequence), + NULL, // &pin_PA17, // brightness pin + NO_BRIGHTNESS_COMMAND, + 0.0f, // brightness + false, // single_byte_bounds + true, // data as commands + true, // auto_refresh + 2, // native_frames_per_second + true, // backlight_on_high + true, // SH1107_addressing + 50000); // backlight pwm frequency +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.h b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.h new file mode 100644 index 0000000000..4123e7a135 --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.h @@ -0,0 +1,16 @@ +#define MICROPY_HW_BOARD_NAME "PewPew LCD" +#define MICROPY_HW_MCU_NAME "samd21e18" + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (48 * 1024) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 + +#define SAMD21_BOD33_LEVEL (6) +#define CIRCUITPY_REPL_LOGO (0) diff --git a/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk new file mode 100644 index 0000000000..94d0530ce2 --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/mpconfigboard.mk @@ -0,0 +1,57 @@ +USB_VID = 0x1209 +USB_PID = 0xD1B5 +USB_PRODUCT = "PewPew LCD" +USB_MANUFACTURER = "Radomir Dopieralski" + +CHIP_VARIANT = SAMD21E18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = NONE + +CIRCUITPY_FULL_BUILD = 0 + +CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_TOUCHIO = 1 +CIRCUITPY_PWMIO = 1 +CIRCUITPY_MATH = 0 + +CIRCUITPY_ANALOGIO = 0 +CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_AUDIOBUSIO_I2SOUT = 0 +CIRCUITPY_AUDIOCORE = 0 +CIRCUITPY_AUDIOIO = 0 +CIRCUITPY_AUDIOMIXER = 0 +CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_AUDIOPWMIO = 0 +CIRCUITPY_BITBANG_APA102 = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITBANGIO = 0 +CIRCUITPY_BITMAPTOOLS = 0 +CIRCUITPY_BITMAPTOOLS = 0 +CIRCUITPY_BLEIO = 0 +CIRCUITPY_BUSDEVICE = 0 +CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_I2CTARGET = 0 +CIRCUITPY_MSGPACK = 0 +CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_NVM = 0 +CIRCUITPY_PIXELBUF = 0 +CIRCUITPY_PS2IO = 0 +CIRCUITPY_PULSEIO = 0 +CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_ROTARYIO = 0 +CIRCUITPY_RTC = 0 +CIRCUITPY_SAMD = 0 +CIRCUITPY_ULAB = 0 +CIRCUITPY_USB_HID = 0 +CIRCUITPY_USB_MIDI = 0 +CIRCUITPY_USB_VENDOR = 0 +CIRCUITPY_VECTORIO = 0 +CIRCUITPY_RAINBOWIO = 0 + +CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf +OPTIMIZATION_FLAGS = -Os +FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-lcd diff --git a/ports/atmel-samd/boards/pewpew_lcd/pins.c b/ports/atmel-samd/boards/pewpew_lcd/pins.c new file mode 100644 index 0000000000..13bcf06f4e --- /dev/null +++ b/ports/atmel-samd/boards/pewpew_lcd/pins.c @@ -0,0 +1,28 @@ +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR__SCK), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR__MOSI), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR__CS), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR__RST), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR__BL), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR__UP), MP_ROM_PTR(&pin_PA03) }, + { MP_ROM_QSTR(MP_QSTR__DOWN), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR__LEFT), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR__RIGHT), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR__O), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR__X), MP_ROM_PTR(&pin_PA07) }, + + { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_PA30) }, + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_PA14) }, + + { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 50f829fa88..c36388f933 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -137,22 +137,14 @@ void board_init(void) { sizeof(display_init_sequence), NULL, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands false, // auto_refresh 20, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index cffbaf619a..bcf3e132d3 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -18,7 +18,7 @@ CIRCUITPY_AUDIOPWMIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_BITBANG_APA102 = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_PIXELBUF = 0 @@ -33,6 +33,8 @@ CIRCUITPY_USB_CDC = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_VECTORIO = 0 +CIRCUITPY_BUSDEVICE = 0 +CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_ANALOGIO = 1 CIRCUITPY_AUDIOIO = 1 @@ -42,6 +44,7 @@ CIRCUITPY_KEYPAD = 1 CIRCUITPY_MATH = 1 CIRCUITPY_STAGE = 1 CIRCUITPY_SYNTHIO = 1 +CIRCUITPY_ZLIB = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4 CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf diff --git a/ports/atmel-samd/boards/picoplanet/board.c b/ports/atmel-samd/boards/picoplanet/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/picoplanet/board.c +++ b/ports/atmel-samd/boards/picoplanet/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index ce5beb6bc3..a1cb3a0714 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -33,8 +33,6 @@ #include "shared-module/displayio/mipi_constants.h" #include "supervisor/shared/board.h" -displayio_fourwire_obj_t board_display_obj; - #define DELAY 0x80 uint8_t display_init_sequence[] = { @@ -107,23 +105,18 @@ void board_init(void) { sizeof(display_init_sequence), &pin_PA01, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing -} - -bool board_requests_safe_mode(void) { - return false; + false, // SH1107_addressing + 50000); // backlight pwm frequency } void reset_board(void) { board_reset_user_neopixels(&pin_PA15, 5); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index bbee2ee9a1..fd002609b1 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -12,8 +12,8 @@ LONGINT_IMPL = MPZ CIRCUITPY_AESIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_GIFIO = 0 +CIRCUITPY_KEYPAD = 1 CIRCUITPY_STAGE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pybadge diff --git a/ports/atmel-samd/boards/pycubed/board.c b/ports/atmel-samd/boards/pycubed/board.c index 41e4655102..f0e84103e2 100644 --- a/ports/atmel-samd/boards/pycubed/board.c +++ b/ports/atmel-samd/boards/pycubed/board.c @@ -36,12 +36,4 @@ void board_init(void) { common_hal_pwmio_pwmout_never_reset(&pwm); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pycubed_mram/board.c b/ports/atmel-samd/boards/pycubed_mram/board.c index 41e4655102..f0e84103e2 100644 --- a/ports/atmel-samd/boards/pycubed_mram/board.c +++ b/ports/atmel-samd/boards/pycubed_mram/board.c @@ -36,12 +36,4 @@ void board_init(void) { common_hal_pwmio_pwmout_never_reset(&pwm); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pycubed_mram_v05/board.c b/ports/atmel-samd/boards/pycubed_mram_v05/board.c index 41e4655102..f0e84103e2 100644 --- a/ports/atmel-samd/boards/pycubed_mram_v05/board.c +++ b/ports/atmel-samd/boards/pycubed_mram_v05/board.c @@ -36,12 +36,4 @@ void board_init(void) { common_hal_pwmio_pwmout_never_reset(&pwm); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pycubed_v05/board.c b/ports/atmel-samd/boards/pycubed_v05/board.c index 41e4655102..f0e84103e2 100644 --- a/ports/atmel-samd/boards/pycubed_v05/board.c +++ b/ports/atmel-samd/boards/pycubed_v05/board.c @@ -36,12 +36,4 @@ void board_init(void) { common_hal_pwmio_pwmout_never_reset(&pwm); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 9a85e166c4..8ff34f24c5 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -107,23 +107,18 @@ void board_init(void) { sizeof(display_init_sequence), &pin_PA01, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing -} - -bool board_requests_safe_mode(void) { - return false; + false, // SH1107_addressing + 50000); // backlight pwm frequency } void reset_board(void) { board_reset_user_neopixels(&pin_PA15, 5); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk index 26c3fe9d9b..f6112b4110 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk @@ -7,13 +7,13 @@ CHIP_VARIANT = SAMD51J19A CHIP_FAMILY = samd51 QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = GD25Q64C +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" LONGINT_IMPL = MPZ CIRCUITPY_AESIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_GIFIO = 0 +CIRCUITPY_KEYPAD = 1 CIRCUITPY_STAGE = 1 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pygamer diff --git a/ports/atmel-samd/boards/pyportal/board.c b/ports/atmel-samd/boards/pyportal/board.c index 262850cbf2..e304f6f24b 100644 --- a/ports/atmel-samd/boards/pyportal/board.c +++ b/ports/atmel-samd/boards/pyportal/board.c @@ -94,22 +94,14 @@ void board_init(void) { sizeof(display_init_sequence), &pin_PB31, // Backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pyportal_titano/board.c b/ports/atmel-samd/boards/pyportal_titano/board.c index 9fa7887a11..939a2dcc70 100644 --- a/ports/atmel-samd/boards/pyportal_titano/board.c +++ b/ports/atmel-samd/boards/pyportal_titano/board.c @@ -111,22 +111,14 @@ void board_init(void) { sizeof(display_init_sequence), &pin_PB31, // Backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 500); // backlight_pwm_frequency } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pyruler/board.c b/ports/atmel-samd/boards/pyruler/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/pyruler/board.c +++ b/ports/atmel-samd/boards/pyruler/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/pyruler/pins.c b/ports/atmel-samd/boards/pyruler/pins.c index e8f8d64b3d..27583539f3 100644 --- a/ports/atmel-samd/boards/pyruler/pins.c +++ b/ports/atmel-samd/boards/pyruler/pins.c @@ -41,6 +41,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA00) }, diff --git a/ports/atmel-samd/boards/qtpy_m0/board.c b/ports/atmel-samd/boards/qtpy_m0/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/qtpy_m0/board.c +++ b/ports/atmel-samd/boards/qtpy_m0/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/board.c b/ports/atmel-samd/boards/qtpy_m0_haxpress/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/qtpy_m0_haxpress/board.c +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/robohatmm1_m4/board.c b/ports/atmel-samd/boards/robohatmm1_m4/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/board.c +++ b/ports/atmel-samd/boards/robohatmm1_m4/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/sam32/board.c b/ports/atmel-samd/boards/sam32/board.c index c6d8c45b1f..106159ae4d 100644 --- a/ports/atmel-samd/boards/sam32/board.c +++ b/ports/atmel-samd/boards/sam32/board.c @@ -34,13 +34,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/neopixel_write/__init__.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { uint8_t zeroes[96]; memset(zeroes, 0, 96); @@ -51,5 +44,4 @@ void reset_board(void) { common_hal_digitalio_digitalinout_deinit(&neopixel); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/same54_xplained/board.c b/ports/atmel-samd/boards/same54_xplained/board.c index f72884ffe8..7180deb278 100644 --- a/ports/atmel-samd/boards/same54_xplained/board.c +++ b/ports/atmel-samd/boards/same54_xplained/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c index 62b2299f56..2eddb41fd6 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c @@ -102,14 +102,14 @@ void board_init(void) { sizeof(display_init_sequence), &pin_PC05, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency // Enabling the Power of the 40-pin at the back CTR_5V.base.type = &digitalio_digitalinout_type; @@ -133,13 +133,6 @@ void board_init(void) { reset_pin_number(pin_PA18.number); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - void board_deinit(void) { common_hal_displayio_release_displays(); common_hal_digitalio_digitalinout_deinit(&CTR_5V); @@ -150,3 +143,5 @@ void board_deinit(void) { // Pin state is kept during BACKUP sleep. gpio_set_pin_direction(pin_PA18.number, GPIO_DIRECTION_OUT); } + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/seeeduino_xiao/board.c b/ports/atmel-samd/boards/seeeduino_xiao/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/seeeduino_xiao/board.c +++ b/ports/atmel-samd/boards/seeeduino_xiao/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/seeeduino_xiao_kb/board.c b/ports/atmel-samd/boards/seeeduino_xiao_kb/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/seeeduino_xiao_kb/board.c +++ b/ports/atmel-samd/boards/seeeduino_xiao_kb/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/seeeduino_xiao_kb/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_xiao_kb/mpconfigboard.mk index 7a67048e0b..d0ff1fa05c 100644 --- a/ports/atmel-samd/boards/seeeduino_xiao_kb/mpconfigboard.mk +++ b/ports/atmel-samd/boards/seeeduino_xiao_kb/mpconfigboard.mk @@ -22,8 +22,8 @@ CIRCUITPY_RTC = 0 CIRCUITPY_MATH = 0 #CIRCUITPY_RANDOM = 0 CIRCUITPY_ONEWIREIO = 0 -#CIRCUITPY_NEOPIXEL_WRITE = 1 # Needed fo RGB LEDs -#CIRCUITPY_RAINBOWIO = 1 # Needed fo RGB LEDs +CIRCUITPY_NEOPIXEL_WRITE = 1 # Needed for RGB LEDs +CIRCUITPY_RAINBOWIO = 1 # Needed for RGB LEDs # These are used in a keyboard or computer input device. CIRCUITPY_ROTARYIO = 1 CIRCUITPY_KEYPAD = 1 diff --git a/ports/atmel-samd/boards/sensebox_mcu/board.c b/ports/atmel-samd/boards/sensebox_mcu/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/sensebox_mcu/board.c +++ b/ports/atmel-samd/boards/sensebox_mcu/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk b/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk index ea14f63ad9..37c869e972 100644 --- a/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk @@ -11,6 +11,4 @@ LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 # There are many pin definitions on this board; it doesn't quite fit on very large translations. -CIRCUITPY_ONEWIREIO = 0 -CIRCUITPY_RAINBOWIO = 0 CIRCUITPY_USB_MIDI = 0 diff --git a/ports/atmel-samd/boards/serpente/board.c b/ports/atmel-samd/boards/serpente/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/serpente/board.c +++ b/ports/atmel-samd/boards/serpente/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/shirtty/board.c b/ports/atmel-samd/boards/shirtty/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/shirtty/board.c +++ b/ports/atmel-samd/boards/shirtty/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/silicognition-m4-shim/board.c b/ports/atmel-samd/boards/silicognition-m4-shim/board.c index 289d68af29..f888faa2af 100644 --- a/ports/atmel-samd/boards/silicognition-m4-shim/board.c +++ b/ports/atmel-samd/boards/silicognition-m4-shim/board.c @@ -25,17 +25,7 @@ */ #include "supervisor/board.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. + #include "mpconfigboard.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} diff --git a/ports/atmel-samd/boards/snekboard/board.c b/ports/atmel-samd/boards/snekboard/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/snekboard/board.c +++ b/ports/atmel-samd/boards/snekboard/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/board.c b/ports/atmel-samd/boards/sparkfun_lumidrive/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/board.c +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/board.c b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/board.c +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/board.c b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/board.c +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/board.c b/ports/atmel-samd/boards/sparkfun_redboard_turbo/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/board.c +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/board.c b/ports/atmel-samd/boards/sparkfun_samd21_dev/board.c index e0a7487bd2..1bba99ac06 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/board.c +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/board.c @@ -28,15 +28,4 @@ #include "mpconfigboard.h" #include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/board.c b/ports/atmel-samd/boards/sparkfun_samd21_mini/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/board.c +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c b/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c index 289d68af29..b079679d33 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c +++ b/ports/atmel-samd/boards/sparkfun_samd51_micromod/board.c @@ -26,16 +26,25 @@ #include "supervisor/board.h" #include "mpconfigboard.h" +#include "common-hal/microcontroller/Pin.h" +#include "hal/include/hal_gpio.h" +#include "supervisor/shared/external_flash/external_flash.h" -void board_init(void) { +void external_flash_setup(void) { + // Do not reset the external flash write-protect and hold pins high + never_reset_pin_number(PIN_PB22); + never_reset_pin_number(PIN_PB23); + + // note: using output instead of input+pullups because the pullups are a little weak + // Set the WP pin high + gpio_set_pin_function(PIN_PB22, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PB22, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PB22, true); + + // Set the HOLD pin high + gpio_set_pin_function(PIN_PB23, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(PIN_PB23, GPIO_DIRECTION_OUT); + gpio_set_pin_level(PIN_PB23, true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h index 3c4ef44b88..15fbcc45de 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h @@ -27,3 +27,7 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 + +// The external flash chip has WP (write-protect) and hold pins we should ignore +#define IGNORE_PIN_PB22 +#define IGNORE_PIN_PB23 diff --git a/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/board.c b/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/board.c index 289d68af29..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/board.c +++ b/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/board.c @@ -25,17 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/stackrduino_m0_pro/board.c b/ports/atmel-samd/boards/stackrduino_m0_pro/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/stackrduino_m0_pro/board.c +++ b/ports/atmel-samd/boards/stackrduino_m0_pro/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/stringcar_m0_express/board.c b/ports/atmel-samd/boards/stringcar_m0_express/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/board.c +++ b/ports/atmel-samd/boards/stringcar_m0_express/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/trellis_m4_express/board.c b/ports/atmel-samd/boards/trellis_m4_express/board.c index 3f735e4550..e0455e9344 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/board.c +++ b/ports/atmel-samd/boards/trellis_m4_express/board.c @@ -33,13 +33,6 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/neopixel_write/__init__.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { uint8_t zeroes[96]; memset(zeroes, 0, 96); @@ -50,5 +43,4 @@ void reset_board(void) { common_hal_digitalio_digitalinout_deinit(&neopixel); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/trinket_m0/board.c b/ports/atmel-samd/boards/trinket_m0/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/trinket_m0/board.c +++ b/ports/atmel-samd/boards/trinket_m0/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/board.c b/ports/atmel-samd/boards/trinket_m0_haxpress/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/board.c +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/uartlogger2/board.c b/ports/atmel-samd/boards/uartlogger2/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/uartlogger2/board.c +++ b/ports/atmel-samd/boards/uartlogger2/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/uchip/board.c b/ports/atmel-samd/boards/uchip/board.c index e739776ed1..66469e12ce 100644 --- a/ports/atmel-samd/boards/uchip/board.c +++ b/ports/atmel-samd/boards/uchip/board.c @@ -42,12 +42,4 @@ void board_init(void) { never_reset_pin_number(PIN_PA27); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 90b5600dcb..543007ce11 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -6,6 +6,8 @@ USB_MANUFACTURER = "Itaca Innovation" CHIP_VARIANT = SAMD21E18A CHIP_FAMILY = samd21 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index d75841be54..90cf9dff20 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -105,21 +105,13 @@ void board_init(void) { NULL, NO_BRIGHTNESS_COMMAND, 1.0f, // brightness - false, // auto_brightness false, // single_byte_bounds false, // data as commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index f942490f29..d129429ad6 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -15,14 +15,14 @@ CIRCUITPY_MATH = 1 CIRCUITPY_AUDIOIO = 1 CIRCUITPY_ANALOGIO = 1 CIRCUITPY_DISPLAYIO = 1 -CIRCUITPY_KEYPPAD = 1 +CIRCUITPY_KEYPAD = 1 CIRCUITPY_PULSEIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_PIXELBUF = 0 diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/board.c b/ports/atmel-samd/boards/winterbloom_big_honking_button/board.c index 9f91617a17..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/board.c +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk index 5bf70a9668..00b9b64a33 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -23,7 +23,7 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BLEIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_KEYPAD = 0 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 diff --git a/ports/atmel-samd/boards/winterbloom_sol/board.c b/ports/atmel-samd/boards/winterbloom_sol/board.c index 289d68af29..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/board.c +++ b/ports/atmel-samd/boards/winterbloom_sol/board.c @@ -25,17 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index 653d2e6ed5..17638a0ebd 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -22,7 +22,7 @@ CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 CIRCUITPY_KEYPAD = 0 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 diff --git a/ports/atmel-samd/boards/xinabox_cc03/board.c b/ports/atmel-samd/boards/xinabox_cc03/board.c index e0a7487bd2..fb1ce4fb83 100644 --- a/ports/atmel-samd/boards/xinabox_cc03/board.c +++ b/ports/atmel-samd/boards/xinabox_cc03/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/boards/xinabox_cs11/board.c b/ports/atmel-samd/boards/xinabox_cs11/board.c index e0a7487bd2..1bba99ac06 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/board.c +++ b/ports/atmel-samd/boards/xinabox_cs11/board.c @@ -28,15 +28,4 @@ #include "mpconfigboard.h" #include "hal/include/hal_gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/atmel-samd/common-hal/_pew/PewPew.c b/ports/atmel-samd/common-hal/_pew/PewPew.c index 40cd52134a..c4d94e3dbd 100644 --- a/ports/atmel-samd/common-hal/_pew/PewPew.c +++ b/ports/atmel-samd/common-hal/_pew/PewPew.c @@ -35,7 +35,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/util.h" #include "samd/timers.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "timer_handler.h" diff --git a/ports/atmel-samd/common-hal/alarm/__init__.c b/ports/atmel-samd/common-hal/alarm/__init__.c index 405bf9d573..8f66b3a90c 100644 --- a/ports/atmel-samd/common-hal/alarm/__init__.c +++ b/ports/atmel-samd/common-hal/alarm/__init__.c @@ -142,7 +142,10 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj return wake_alarm; } -void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms) { +void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms, size_t n_dios, digitalio_digitalinout_obj_t **preserve_dios) { + if (n_dios > 0) { + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_preserve_dios); + } _setup_sleep_alarms(true, n_alarms, alarms); } diff --git a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c index eda111639b..9289a66a87 100644 --- a/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c @@ -234,7 +234,7 @@ static void pinalarm_set_alarms_light(size_t n_alarms, const mp_obj_t *alarms) { // raise ValueError here MP_FALLTHROUGH case PINALARM_ERR_NOEXTINT: - mp_raise_RuntimeError(translate("No hardware support on pin")); + raise_ValueError_invalid_pin(); case PINALARM_ERR_NOCHANNEL: mp_raise_RuntimeError(translate("A hardware interrupt channel is already in use")); default: @@ -261,7 +261,7 @@ static void pinalarm_set_alarms_deep(size_t n_alarms, const mp_obj_t *alarms) { } } if (t->n < 0) { - mp_raise_ValueError(translate("Pin cannot wake from Deep Sleep")); + raise_ValueError_invalid_pin(); } // It is strange, but to my experiment, interrupt during sleep diff --git a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c index 14a7346c17..3f116f07e3 100644 --- a/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c +++ b/ports/atmel-samd/common-hal/alarm/time/TimeAlarm.c @@ -100,7 +100,7 @@ void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_ continue; } if (timealarm_set) { - mp_raise_ValueError(translate("Only one alarm.time alarm can be set.")); + mp_raise_ValueError(translate("Only one alarm.time alarm can be set")); } timealarm = MP_OBJ_TO_PTR(alarms[i]); timealarm_set = true; diff --git a/ports/atmel-samd/common-hal/analogio/AnalogIn.c b/ports/atmel-samd/common-hal/analogio/AnalogIn.c index 262e44350c..d15be8308a 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogIn.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogIn.c @@ -36,7 +36,8 @@ #include "samd/adc.h" #include "shared-bindings/analogio/AnalogIn.h" -#include "supervisor/shared/translate.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_adc_sync.h" @@ -60,7 +61,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, } if (adc_channel == 0xff) { // No ADC function on that pin - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } claim_pin(pin); @@ -122,8 +123,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { adc_sync_read_channel(&adc, self->channel, ((uint8_t *)&value), 2); adc_sync_deinit(&adc); - // Shift the value to be 16 bit. - return value << 4; + // Stretch 12-bit ADC reading to 16-bit range + return (value << 4) | (value >> 8); } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { diff --git a/ports/atmel-samd/common-hal/analogio/AnalogOut.c b/ports/atmel-samd/common-hal/analogio/AnalogOut.c index 91782387b8..b4d556429c 100644 --- a/ports/atmel-samd/common-hal/analogio/AnalogOut.c +++ b/ports/atmel-samd/common-hal/analogio/AnalogOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/analogio/AnalogOut.h" #include "shared-bindings/audioio/AudioOut.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_dac_sync.h" @@ -70,7 +70,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, #endif default: - mp_raise_ValueError(translate("AnalogOut not supported on given pin")); + raise_ValueError_invalid_pin(); return; } diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index a434e2541b..447252aace 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -40,7 +40,7 @@ #include "shared-bindings/audiobusio/I2SOut.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_gpio.h" @@ -151,16 +151,16 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self, } #endif if (bc_clock_unit == 0xff) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_bit_clock); + raise_ValueError_invalid_pin_name(MP_QSTR_clock); } if (ws_clock_unit == 0xff) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_word_select); + raise_ValueError_invalid_pin_name(MP_QSTR_word_select); } if (bc_clock_unit != ws_clock_unit) { mp_raise_ValueError(translate("Bit clock and word select must share a clock unit")); } if (serializer == 0xff) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_data); + raise_ValueError_invalid_pin_name(MP_QSTR_data); } self->clock_unit = ws_clock_unit; self->serializer = serializer; @@ -255,7 +255,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self, } uint8_t channel_count = audiosample_channel_count(sample); if (channel_count > 2) { - mp_raise_ValueError(translate("Too many channels in sample.")); + mp_raise_ValueError(translate("Too many channels in sample")); } #ifdef SAMD21 uint32_t serctrl = (self->clock_unit << I2S_SERCTRL_CLKSEL_Pos) | SERCTRL(SERMODE_TX) | I2S_SERCTRL_TXSAME_SAME | I2S_SERCTRL_EXTEND_MSBIT | I2S_SERCTRL_TXDEFAULT_ONE | I2S_SERCTRL_SLOTADJ_LEFT; diff --git a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c index e7c00901bf..6796fe03f8 100644 --- a/ports/atmel-samd/common-hal/audiobusio/PDMIn.c +++ b/ports/atmel-samd/common-hal/audiobusio/PDMIn.c @@ -37,7 +37,7 @@ #include "shared-bindings/audiobusio/PDMIn.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_gpio.h" @@ -58,11 +58,11 @@ #define MIN_MIC_CLOCK 1000000 #ifdef SAMD21 -#define SERCTRL(name) I2S_SERCTRL_ ## name +#define SERCTRL(name) I2S_SERCTRL_##name #endif #ifdef SAM_D5X_E5X -#define SERCTRL(name) I2S_RXCTRL_ ## name +#define SERCTRL(name) I2S_RXCTRL_##name #endif // Set by interrupt handler when DMA block has finished transferring. @@ -80,48 +80,50 @@ void pdmin_reset(void) { pdmin_dma_block_done = false; pdmin_event_channel = EVSYS_SYNCH_NUM; - while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) {} + while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) { + } I2S->INTENCLR.reg = I2S_INTENCLR_MASK; I2S->INTFLAG.reg = I2S_INTFLAG_MASK; I2S->CTRLA.reg &= ~I2S_SYNCBUSY_ENABLE; - while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) {} + while (I2S->SYNCBUSY.reg & I2S_SYNCBUSY_ENABLE) { + } I2S->CTRLA.reg = I2S_CTRLA_SWRST; } // Caller validates that pins are free. -void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, - const mcu_pin_obj_t* clock_pin, - const mcu_pin_obj_t* data_pin, - uint32_t sample_rate, - uint8_t bit_depth, - bool mono, - uint8_t oversample) { +void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self, + const mcu_pin_obj_t *clock_pin, + const mcu_pin_obj_t *data_pin, + uint32_t sample_rate, + uint8_t bit_depth, + bool mono, + uint8_t oversample) { self->clock_pin = clock_pin; // PA10, PA20 -> SCK0, PB11 -> SCK1 #ifdef SAMD21 - if (clock_pin == &pin_PA10 + if (clock_pin == &pin_PA10 #if defined(PIN_PA20) && !defined(IGNORE_PIN_PA20) - || clock_pin == &pin_PA20 + || clock_pin == &pin_PA20 #endif - ) { - self->clock_unit = 0; - #if defined(PIN_PB11) && !defined(IGNORE_PIN_PB11) - } else if (clock_pin == &pin_PB11) { - self->clock_unit = 1; - #endif - #endif - #ifdef SAM_D5X_E5X - if (clock_pin == &pin_PA10 || clock_pin == &pin_PB16) { - self->clock_unit = 0; - } else if (clock_pin == &pin_PB12 - #if defined(PIN_PB28) && !defined(IGNORE_PIN_PB28) - || data_pin == &pin_PB28) { - #else ) { - #endif - self->clock_unit = 1; + self->clock_unit = 0; + #if defined(PIN_PB11) && !defined(IGNORE_PIN_PB11) + } else if (clock_pin == &pin_PB11) { + self->clock_unit = 1; #endif + #else + #ifdef SAM_D5X_E5X + if (clock_pin == &pin_PA10 || clock_pin == &pin_PB16) { + self->clock_unit = 0; + } else if (clock_pin == &pin_PB12 + #if defined(PIN_PB28) && !defined(IGNORE_PIN_PB28) + || data_pin == &pin_PB28 + #endif + ) { + self->clock_unit = 1; + #endif + #endif } else { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_clock); + raise_ValueError_invalid_pin_name(MP_QSTR_clock); } self->data_pin = data_pin; // PA07, PA19 -> SD0, PA08, PB16 -> SD1 @@ -136,23 +138,23 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, #endif ) { self->serializer = 0; - } - else if (false - #if defined(PIN_PA08) && !defined(IGNORE_PIN_PA08) - || data_pin == &pin_PA08 - #endif - #if defined (PIN_PB16) && !defined(IGNORE_PIN_PB16) - || data_pin == &pin_PB16 - #endif - ) { + } else if (false + #if defined(PIN_PA08) && !defined(IGNORE_PIN_PA08) + || data_pin == &pin_PA08 + #endif + #if defined(PIN_PB16) && !defined(IGNORE_PIN_PB16) + || data_pin == &pin_PB16 + #endif + ) { self->serializer = 1; - #endif + #else #ifdef SAM_D5X_E5X if (data_pin == &pin_PB10 || data_pin == &pin_PA22) { self->serializer = 1; #endif + #endif } else { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_data); + raise_ValueError_invalid_pin_name(MP_QSTR_data); } if (!(bit_depth == 16 || bit_depth == 8) || !mono || oversample != OVERSAMPLING) { @@ -163,7 +165,8 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, if (I2S->CTRLA.bit.ENABLE == 0) { I2S->CTRLA.bit.SWRST = 1; - while (I2S->CTRLA.bit.SWRST == 1) {} + while (I2S->CTRLA.bit.SWRST == 1) { + } } else { #ifdef SAMD21 if ((I2S->CTRLA.vec.SEREN & (1 << self->serializer)) != 0) { @@ -183,10 +186,10 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, #define GPIO_I2S_FUNCTION GPIO_PIN_FUNCTION_G #endif - uint32_t clock_divisor = (uint32_t) roundf( 48000000.0f / sample_rate / oversample); + uint32_t clock_divisor = (uint32_t)roundf(48000000.0f / sample_rate / oversample); float mic_clock_freq = 48000000.0f / clock_divisor; - self->sample_rate = mic_clock_freq / oversample; - if (mic_clock_freq < MIN_MIC_CLOCK || clock_divisor == 0) { + self->sample_rate = mic_clock_freq / oversample; + if (mic_clock_freq < MIN_MIC_CLOCK || clock_divisor == 0) { mp_raise_ValueError(translate("sampling rate out of range")); } // Find a free GCLK to generate the MCLK signal. @@ -202,9 +205,9 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, // Clock unit configuration uint32_t clkctrl = I2S_CLKCTRL_MCKSEL_GCLK | - I2S_CLKCTRL_NBSLOTS(2) | - I2S_CLKCTRL_FSWIDTH_SLOT | - I2S_CLKCTRL_SLOTSIZE_16; + I2S_CLKCTRL_NBSLOTS(2) | + I2S_CLKCTRL_FSWIDTH_SLOT | + I2S_CLKCTRL_SLOTSIZE_16; // Serializer configuration #ifdef SAMD21 @@ -241,11 +244,11 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t* self, self->bit_depth = bit_depth; } -bool common_hal_audiobusio_pdmin_deinited(audiobusio_pdmin_obj_t* self) { +bool common_hal_audiobusio_pdmin_deinited(audiobusio_pdmin_obj_t *self) { return self->clock_pin == NULL; } -void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t* self) { +void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t *self) { if (common_hal_audiobusio_pdmin_deinited(self)) { return; } @@ -264,24 +267,24 @@ void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t* self) { self->data_pin = NULL; } -uint8_t common_hal_audiobusio_pdmin_get_bit_depth(audiobusio_pdmin_obj_t* self) { +uint8_t common_hal_audiobusio_pdmin_get_bit_depth(audiobusio_pdmin_obj_t *self) { return self->bit_depth; } -uint32_t common_hal_audiobusio_pdmin_get_sample_rate(audiobusio_pdmin_obj_t* self) { +uint32_t common_hal_audiobusio_pdmin_get_sample_rate(audiobusio_pdmin_obj_t *self) { return self->sample_rate; } -static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, - DmacDescriptor* descriptor, - DmacDescriptor* second_descriptor, - uint32_t words_per_buffer, uint8_t words_per_sample, - uint32_t* first_buffer, uint32_t* second_buffer) { +static void setup_dma(audiobusio_pdmin_obj_t *self, uint32_t length, + DmacDescriptor *descriptor, + DmacDescriptor *second_descriptor, + uint32_t words_per_buffer, uint8_t words_per_sample, + uint32_t *first_buffer, uint32_t *second_buffer) { descriptor->BTCTRL.reg = DMAC_BTCTRL_VALID | - DMAC_BTCTRL_BLOCKACT_NOACT | - DMAC_BTCTRL_EVOSEL_BLOCK | - DMAC_BTCTRL_DSTINC | - DMAC_BTCTRL_BEATSIZE_WORD; + DMAC_BTCTRL_BLOCKACT_NOACT | + DMAC_BTCTRL_EVOSEL_BLOCK | + DMAC_BTCTRL_DSTINC | + DMAC_BTCTRL_BEATSIZE_WORD; // Block transfer count is the number of beats per block (aka descriptor). // In this case there are two bytes per beat so divide the length by two. @@ -291,7 +294,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, } descriptor->BTCNT.reg = block_transfer_count; - descriptor->DSTADDR.reg = ((uint32_t) first_buffer + sizeof(uint32_t) * block_transfer_count); + descriptor->DSTADDR.reg = ((uint32_t)first_buffer + sizeof(uint32_t) * block_transfer_count); descriptor->DESCADDR.reg = 0; if (length * words_per_sample > words_per_buffer) { descriptor->DESCADDR.reg = ((uint32_t)second_descriptor); @@ -314,7 +317,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, block_transfer_count = length * words_per_sample - words_per_buffer; second_descriptor->DESCADDR.reg = 0; } - second_descriptor->DSTADDR.reg = ((uint32_t) second_buffer + sizeof(uint32_t) * block_transfer_count); + second_descriptor->DSTADDR.reg = ((uint32_t)second_buffer + sizeof(uint32_t) * block_transfer_count); second_descriptor->BTCNT.reg = block_transfer_count; #ifdef SAMD21 @@ -324,10 +327,10 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, second_descriptor->SRCADDR.reg = (uint32_t)&I2S->RXDATA; #endif second_descriptor->BTCTRL.reg = DMAC_BTCTRL_VALID | - DMAC_BTCTRL_BLOCKACT_NOACT | - DMAC_BTCTRL_EVOSEL_BLOCK | - DMAC_BTCTRL_DSTINC | - DMAC_BTCTRL_BEATSIZE_WORD; + DMAC_BTCTRL_BLOCKACT_NOACT | + DMAC_BTCTRL_EVOSEL_BLOCK | + DMAC_BTCTRL_DSTINC | + DMAC_BTCTRL_BEATSIZE_WORD; } } @@ -341,7 +344,7 @@ static void setup_dma(audiobusio_pdmin_obj_t* self, uint32_t length, // higher sample rate than specified. Then after the audio is // recorded, a more expensive filter non-real-time filter could be // used to down-sample and low-pass. -const uint16_t sinc_filter [OVERSAMPLING] = { +const uint16_t sinc_filter[OVERSAMPLING] = { 0, 2, 9, 21, 39, 63, 94, 132, 179, 236, 302, 379, 467, 565, 674, 792, 920, 1055, 1196, 1341, 1487, 1633, 1776, 1913, @@ -353,26 +356,26 @@ const uint16_t sinc_filter [OVERSAMPLING] = { }; #ifdef SAMD21 -#define REPEAT_16_TIMES(X) do { for(uint8_t j=0; j<4; j++) { X X X X } } while (0) +#define REPEAT_16_TIMES(X) do { for (uint8_t j = 0; j < 4; j++) { X X X X } } while (0) #else -#define REPEAT_16_TIMES(X) do { X X X X X X X X X X X X X X X X } while(0) +#define REPEAT_16_TIMES(X) do { X X X X X X X X X X X X X X X X } while (0) #endif static uint16_t filter_sample(uint32_t pdm_samples[4]) { uint16_t running_sum = 0; const uint16_t *filter_ptr = sinc_filter; - for (uint8_t i = 0; i < OVERSAMPLING/16; i++) { + for (uint8_t i = 0; i < OVERSAMPLING / 16; i++) { // The sample is 16-bits right channel in the upper two bytes and 16-bits left channel // in the lower two bytes. // We just ignore the upper bits uint32_t pdm_sample = pdm_samples[i]; - REPEAT_16_TIMES( { - if (pdm_sample & 0x8000) { - running_sum += *filter_ptr; - } - filter_ptr++; - pdm_sample <<= 1; + REPEAT_16_TIMES({ + if (pdm_sample & 0x8000) { + running_sum += *filter_ptr; } + filter_ptr++; + pdm_sample <<= 1; + } ); } return running_sum; @@ -380,8 +383,8 @@ static uint16_t filter_sample(uint32_t pdm_samples[4]) { // output_buffer may be a byte buffer or a halfword buffer. // output_buffer_length is the number of slots, not the number of bytes. -uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* self, - uint16_t* output_buffer, uint32_t output_buffer_length) { +uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t *self, + uint16_t *output_buffer, uint32_t output_buffer_length) { uint8_t dma_channel = dma_allocate_channel(); pdmin_event_channel = find_sync_event_channel_raise(); pdmin_dma_block_done = false; @@ -399,7 +402,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se COMPILER_ALIGNED(16) DmacDescriptor second_descriptor; setup_dma(self, output_buffer_length, dma_descriptor(dma_channel), &second_descriptor, - words_per_buffer, words_per_sample, first_buffer, second_buffer); + words_per_buffer, words_per_sample, first_buffer, second_buffer); uint8_t trigger_source = I2S_DMAC_ID_RX_0; #ifdef SAMD21 @@ -444,7 +447,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se // Flip back and forth between processing the first and second buffers. uint32_t *buffer = first_buffer; - DmacDescriptor* descriptor = dma_descriptor(dma_channel); + DmacDescriptor *descriptor = dma_descriptor(dma_channel); if (buffers_processed % 2 == 1) { buffer = second_buffer; descriptor = &second_descriptor; @@ -459,7 +462,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se uint16_t value = filter_sample(buffer + i * words_per_sample); if (self->bit_depth == 8) { // Truncate to 8 bits. - ((uint8_t*) output_buffer)[values_output] = value >> 8; + ((uint8_t *)output_buffer)[values_output] = value >> 8; } else { output_buffer[values_output] = value; } @@ -471,7 +474,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se // Compute how many more samples we need, and if the last buffer is the last // set of samples needed, adjust the DMA count to only fetch as necessary. remaining_samples_needed = output_buffer_length - values_output; - if (remaining_samples_needed <= samples_per_buffer*2 && + if (remaining_samples_needed <= samples_per_buffer * 2 && remaining_samples_needed > samples_per_buffer) { // Adjust the DMA settings for the current buffer, which will be processed // after the other buffer, which is now receiving samples via DMA. @@ -484,7 +487,7 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t* se // Set up to receive the last set of samples (don't include the alternate buffer, now in use). uint32_t samples_needed_for_last_buffer = remaining_samples_needed - samples_per_buffer; descriptor->BTCNT.reg = samples_needed_for_last_buffer * words_per_sample; - descriptor->DSTADDR.reg = ((uint32_t) buffer) + descriptor->DSTADDR.reg = ((uint32_t)buffer) + samples_needed_for_last_buffer * words_per_sample * sizeof(buffer[0]); // Break chain to alternate buffer. diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index 7be7cf7c4c..a565a77042 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -35,7 +35,7 @@ #include "shared-bindings/audioio/AudioOut.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_gpio.h" @@ -136,20 +136,21 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t *self, mp_raise_ValueError(translate("Right channel unsupported")); } if (left_channel != &pin_PA02) { - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); } claim_pin(left_channel); #endif #ifdef SAM_D5X_E5X self->right_channel = NULL; if (left_channel != &pin_PA02 && left_channel != &pin_PA05) { - mp_raise_ValueError(translate("Invalid pin for left channel")); + raise_ValueError_invalid_pin_name(MP_QSTR_left_channel); } if (right_channel != NULL && right_channel != &pin_PA02 && right_channel != &pin_PA05) { - mp_raise_ValueError(translate("Invalid pin for right channel")); + raise_ValueError_invalid_pin_name(MP_QSTR_right_channel); } if (right_channel == left_channel) { - mp_raise_ValueError(translate("Cannot output both channels on the same pin")); + mp_raise_ValueError_varg(translate("%q and %q must be different"), + MP_QSTR_left_channel, MP_QSTR_right_channel); } claim_pin(left_channel); if (right_channel != NULL) { @@ -376,14 +377,13 @@ void common_hal_audioio_audioout_play(audioio_audioout_obj_t *self, audio_dma_result result = AUDIO_DMA_OK; uint32_t sample_rate = audiosample_sample_rate(sample); #ifdef SAMD21 - uint32_t max_sample_rate = 350000; + const uint32_t max_sample_rate = 350000; #endif #ifdef SAM_D5X_E5X - uint32_t max_sample_rate = 1000000; + const uint32_t max_sample_rate = 1000000; #endif - if (sample_rate > max_sample_rate) { - mp_raise_ValueError_varg(translate("Sample rate too high. It must be less than %d"), max_sample_rate); - } + mp_arg_validate_int_max(sample_rate, max_sample_rate, MP_QSTR_sample_rate); + #ifdef SAMD21 result = audio_dma_setup_playback(&self->left_dma, sample, loop, true, 0, false /* output unsigned */, diff --git a/ports/atmel-samd/common-hal/busio/I2C.c b/ports/atmel-samd/common-hal/busio/I2C.c index 48ee26a9b6..d97fa227b2 100644 --- a/ports/atmel-samd/common-hal/busio/I2C.c +++ b/ports/atmel-samd/common-hal/busio/I2C.c @@ -34,7 +34,8 @@ #include "samd/sercom.h" #include "shared-bindings/microcontroller/__init__.h" -#include "supervisor/shared/translate.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate/translate.h" #include "common-hal/busio/__init__.h" @@ -76,7 +77,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, self->sda_pin = NO_PIN; Sercom *sercom = samd_i2c_get_sercom(scl, sda, &sercom_index, &sda_pinmux, &scl_pinmux); if (sercom == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } #if CIRCUITPY_REQUIRE_I2C_PULLUPS @@ -122,15 +123,12 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, // The maximum frequency divisor gives a clock rate of around 48MHz/2/255 // but set_baudrate does not diagnose this problem. (This is not the // exact cutoff, but no frequency well under 100kHz is available) - if (frequency < 95000) { - mp_raise_ValueError(translate("Unsupported baudrate")); - } - - if (i2c_m_sync_set_baudrate(&self->i2c_desc, 0, frequency / 1000) != ERR_NONE) { + if ((frequency < 95000) || + (i2c_m_sync_set_baudrate(&self->i2c_desc, 0, frequency / 1000) != ERR_NONE)) { reset_pin_number(sda->number); reset_pin_number(scl->number); common_hal_busio_i2c_deinit(self); - mp_raise_ValueError(translate("Unsupported baudrate")); + mp_arg_error_invalid(MP_QSTR_frequency); } self->sda_pin = sda->number; diff --git a/ports/atmel-samd/common-hal/busio/SPI.c b/ports/atmel-samd/common-hal/busio/SPI.c index 0f6f38461c..3bb0cabf9e 100644 --- a/ports/atmel-samd/common-hal/busio/SPI.c +++ b/ports/atmel-samd/common-hal/busio/SPI.c @@ -25,6 +25,7 @@ */ #include "shared-bindings/busio/SPI.h" +#include "shared-bindings/microcontroller/Pin.h" #include "py/mperrno.h" #include "py/runtime.h" @@ -32,8 +33,8 @@ #include "peripheral_clk_config.h" #include "supervisor/board.h" +#include "supervisor/shared/translate/translate.h" #include "common-hal/busio/__init__.h" -#include "common-hal/microcontroller/Pin.h" #include "hal/include/hal_gpio.h" #include "hal/include/hal_spi_m_sync.h" @@ -133,7 +134,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, } } if (sercom == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } // Set up SPI clocks on SERCOM. diff --git a/ports/atmel-samd/common-hal/busio/UART.c b/ports/atmel-samd/common-hal/busio/UART.c index 194f1c0217..3a9b628e0b 100644 --- a/ports/atmel-samd/common-hal/busio/UART.c +++ b/ports/atmel-samd/common-hal/busio/UART.c @@ -25,6 +25,7 @@ */ #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/busio/UART.h" #include "mpconfigport.h" @@ -33,7 +34,7 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/tick.h" #include "hpl_sercom_config.h" @@ -70,21 +71,26 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint8_t rx_pad = 255; // Unset pad uint32_t tx_pinmux = 0; uint8_t tx_pad = 255; // Unset pad + uint32_t rts_pinmux = 0; + uint32_t cts_pinmux = 0; // Set state so the object is deinited to start. self->rx_pin = NO_PIN; self->tx_pin = NO_PIN; + self->rts_pin = NO_PIN; + self->cts_pin = NO_PIN; - if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { - mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); + if ((rs485_dir != NULL) || (rs485_invert)) { + mp_raise_NotImplementedError(translate("RS485")); } - if (bits > 8) { - mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); - } + mp_arg_validate_int_max(bits, 8, MP_QSTR_bits); bool have_tx = tx != NULL; bool have_rx = rx != NULL; + bool have_rts = rts != NULL; + bool have_cts = cts != NULL; + if (!have_tx && !have_rx) { mp_raise_ValueError(translate("tx and rx cannot both be None")); } @@ -123,6 +129,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, #endif tx_pinmux = PINMUX(tx->number, (i == 0) ? MUX_C : MUX_D); tx_pad = tx->sercom[i].pad; + if (have_rts) { + rts_pinmux = PINMUX(rts->number, (i == 0) ? MUX_C : MUX_D); + } if (rx == NULL) { sercom = potential_sercom; break; @@ -135,6 +144,9 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, rx->sercom[j].pad != tx_pad) { rx_pinmux = PINMUX(rx->number, (j == 0) ? MUX_C : MUX_D); rx_pad = rx->sercom[j].pad; + if (have_cts) { + cts_pinmux = PINMUX(cts->number, (j == 0) ? MUX_C : MUX_D); + } sercom = sercom_insts[rx->sercom[j].index]; sercom_index = rx->sercom[j].index; break; @@ -145,7 +157,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } } if (sercom == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if (!have_tx) { tx_pad = 0; @@ -175,7 +187,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->buffer = (uint8_t *)gc_alloc(self->buffer_length * sizeof(uint8_t), false, true); if (self->buffer == NULL) { common_hal_busio_uart_deinit(self); - mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), self->buffer_length * sizeof(uint8_t)); + m_malloc_fail(self->buffer_length * sizeof(uint8_t)); } } } else { @@ -184,31 +196,42 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } if (usart_async_init(usart_desc_p, sercom, self->buffer, self->buffer_length, NULL) != ERR_NONE) { - mp_raise_ValueError(translate("Could not initialize UART")); + mp_raise_RuntimeError(translate("UART init")); } // usart_async_init() sets a number of defaults based on a prototypical SERCOM // which don't necessarily match what we need. After calling it, set the values // specific to this instantiation of UART. - // Set pads computed for this SERCOM. + // Set pads computed for this SERCOM. Refer to the datasheet for details on pads. // TXPO: // 0x0: TX pad 0; no RTS/CTS - // 0x1: TX pad 2; no RTS/CTS - // 0x2: TX pad 0; RTS: pad 2, CTS: pad 3 (not used by us right now) - // So divide by 2 to map pad to value. + // 0x1: reserved + // 0x2: TX pad 0; RTS: pad 2, CTS: pad 3 + // 0x3: TX pad 0; RTS: pad 2; no CTS // RXPO: // 0x0: RX pad 0 // 0x1: RX pad 1 // 0x2: RX pad 2 // 0x3: RX pad 3 + // Default to TXPO with no RTS/CTS + uint8_t computed_txpo = 0; + // If we have both CTS (with or without RTS), use second pinout + if (have_cts) { + computed_txpo = 2; + } + // If we have RTS only, use the third pinout + if (have_rts && !have_cts) { + computed_txpo = 3; + } + // Doing a group mask and set of the registers saves 60 bytes over setting the bitfields individually. sercom->USART.CTRLA.reg &= ~(SERCOM_USART_CTRLA_TXPO_Msk | SERCOM_USART_CTRLA_RXPO_Msk | SERCOM_USART_CTRLA_FORM_Msk); - sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(tx_pad / 2) | + sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(computed_txpo) | SERCOM_USART_CTRLA_RXPO(rx_pad) | (parity == BUSIO_UART_PARITY_NONE ? 0 : SERCOM_USART_CTRLA_FORM(1)); @@ -258,6 +281,26 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->rx_pin = NO_PIN; } + if (have_rts) { + gpio_set_pin_direction(rts->number, GPIO_DIRECTION_OUT); + gpio_set_pin_pull_mode(rts->number, GPIO_PULL_OFF); + gpio_set_pin_function(rts->number, rts_pinmux); + self->rts_pin = rts->number; + claim_pin(rts); + } else { + self->rts_pin = NO_PIN; + } + + if (have_cts) { + gpio_set_pin_direction(cts->number, GPIO_DIRECTION_IN); + gpio_set_pin_pull_mode(cts->number, GPIO_PULL_OFF); + gpio_set_pin_function(cts->number, cts_pinmux); + self->cts_pin = cts->number; + claim_pin(cts); + } else { + self->cts_pin = NO_PIN; + } + usart_async_enable(usart_desc_p); } @@ -271,6 +314,8 @@ void common_hal_busio_uart_never_reset(busio_uart_obj_t *self) { never_reset_sercom(hw); never_reset_pin_number(self->rx_pin); never_reset_pin_number(self->tx_pin); + never_reset_pin_number(self->rts_pin); + never_reset_pin_number(self->cts_pin); } } return; @@ -290,8 +335,12 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { usart_async_deinit(usart_desc_p); reset_pin_number(self->rx_pin); reset_pin_number(self->tx_pin); + reset_pin_number(self->rts_pin); + reset_pin_number(self->cts_pin); self->rx_pin = NO_PIN; self->tx_pin = NO_PIN; + self->rts_pin = NO_PIN; + self->cts_pin = NO_PIN; } // Read characters. diff --git a/ports/atmel-samd/common-hal/busio/UART.h b/ports/atmel-samd/common-hal/busio/UART.h index c95fbf1556..b99a16d7db 100644 --- a/ports/atmel-samd/common-hal/busio/UART.h +++ b/ports/atmel-samd/common-hal/busio/UART.h @@ -38,6 +38,8 @@ typedef struct { struct usart_async_descriptor usart_desc; uint8_t rx_pin; uint8_t tx_pin; + int8_t rts_pin; + int8_t cts_pin; uint8_t character_bits; bool rx_error; uint32_t baudrate; diff --git a/ports/atmel-samd/common-hal/countio/Counter.c b/ports/atmel-samd/common-hal/countio/Counter.c index c68b9e18ef..e3694615ab 100644 --- a/ports/atmel-samd/common-hal/countio/Counter.c +++ b/ports/atmel-samd/common-hal/countio/Counter.c @@ -7,7 +7,7 @@ #include "eic_handler.h" #include "samd/external_interrupts.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_countio_counter_construct(countio_counter_obj_t *self, const mcu_pin_obj_t *pin, countio_edge_t edge, digitalio_pull_t pull) { diff --git a/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c b/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c index 40637bef4b..8358ac4d87 100644 --- a/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c +++ b/ports/atmel-samd/common-hal/digitalio/DigitalInOut.c @@ -34,7 +34,7 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" digitalinout_result_t common_hal_digitalio_digitalinout_construct( digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { @@ -187,3 +187,30 @@ digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( } } } + +bool common_hal_digitalio_has_reg_op(digitalinout_reg_op_t op) { + return true; +} + +volatile uint32_t *common_hal_digitalio_digitalinout_get_reg(digitalio_digitalinout_obj_t *self, digitalinout_reg_op_t op, uint32_t *mask) { + const uint8_t pin = self->pin->number; + int port = GPIO_PORT(pin); + + *mask = 1u << GPIO_PIN(pin); + + + switch (op) { + case DIGITALINOUT_REG_READ: + return (volatile uint32_t *)&PORT->Group[port].IN.reg; + case DIGITALINOUT_REG_WRITE: + return &PORT->Group[port].OUT.reg; + case DIGITALINOUT_REG_SET: + return &PORT->Group[port].OUTSET.reg; + case DIGITALINOUT_REG_RESET: + return &PORT->Group[port].OUTCLR.reg; + case DIGITALINOUT_REG_TOGGLE: + return &PORT->Group[port].OUTTGL.reg; + default: + return NULL; + } +} diff --git a/ports/espressif/modules/none.c b/ports/atmel-samd/common-hal/floppyio/__init__.h similarity index 88% rename from ports/espressif/modules/none.c rename to ports/atmel-samd/common-hal/floppyio/__init__.h index aa751bf3f4..693babb2ef 100644 --- a/ports/espressif/modules/none.c +++ b/ports/atmel-samd/common-hal/floppyio/__init__.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2022 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 @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "modules/module.h" +#pragma once -void never_reset_module_internal_pins(void) { -} +// empirical-ish from Arduino @ 120MHz +#define FLOPPYIO_SAMPLERATE (14666667) diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index 4e06b77b56..22200c5d1c 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -45,9 +45,10 @@ #include "peripheral_clk_config.h" #include "hpl_gclk_config.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/time/__init__.h" #include "supervisor/shared/tick.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #ifdef SAMD21 #include "hpl/gclk/hpl_gclk_base.h" @@ -282,11 +283,11 @@ static void frequencyin_samd51_stop_dpll(void) { void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t* self, const mcu_pin_obj_t* pin, const uint16_t capture_period) { if (!pin->has_extint) { - mp_raise_RuntimeError(translate("No hardware support on pin")); - } - if ((capture_period == 0) || (capture_period > 500)) { - mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); + raise_ValueError_invalid_pin(); } + + mp_arg_validate_int_range(capture_period, 0, 500, MP_QSTR_capture_period); + uint32_t mask = 1 << pin->extint_channel; if (eic_get_enable() == 1 && #ifdef SAMD21 @@ -569,9 +570,7 @@ uint16_t common_hal_frequencyio_frequencyin_get_capture_period(frequencyio_frequ } void common_hal_frequencyio_frequencyin_set_capture_period(frequencyio_frequencyin_obj_t *self, uint16_t capture_period) { - if ((capture_period == 0) || (capture_period > 500)) { - mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); - } + mp_arg_validate_int_range(capture_period, 1, 500, MP_QSTR_capture_period); self->capture_period = capture_period; diff --git a/ports/atmel-samd/common-hal/i2cperipheral/__init__.c b/ports/atmel-samd/common-hal/i2cperipheral/__init__.c deleted file mode 100644 index c67511c536..0000000000 --- a/ports/atmel-samd/common-hal/i2cperipheral/__init__.c +++ /dev/null @@ -1 +0,0 @@ -// No i2cperipheral module functions. diff --git a/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c b/ports/atmel-samd/common-hal/i2ctarget/I2CTarget.c similarity index 82% rename from ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c rename to ports/atmel-samd/common-hal/i2ctarget/I2CTarget.c index e1849a6b15..a687143281 100644 --- a/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.c +++ b/ports/atmel-samd/common-hal/i2ctarget/I2CTarget.c @@ -24,7 +24,8 @@ * THE SOFTWARE. */ -#include "shared-bindings/i2cperipheral/I2CPeripheral.h" +#include "shared-bindings/i2ctarget/I2CTarget.h" +#include "shared-bindings/microcontroller/Pin.h" #include "common-hal/busio/I2C.h" #include "shared/runtime/interrupt_char.h" @@ -35,14 +36,14 @@ #include "hal/include/hal_gpio.h" #include "peripherals/samd/sercom.h" -void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, +void common_hal_i2ctarget_i2c_target_construct(i2ctarget_i2c_target_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint8_t *addresses, unsigned int num_addresses, bool smbus) { uint8_t sercom_index; uint32_t sda_pinmux, scl_pinmux; Sercom *sercom = samd_i2c_get_sercom(scl, sda, &sercom_index, &sda_pinmux, &scl_pinmux); if (sercom == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } self->sercom = sercom; @@ -99,12 +100,12 @@ void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_periphe sercom->I2CS.CTRLA.bit.ENABLE = 1; } -bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self) { +bool common_hal_i2ctarget_i2c_target_deinited(i2ctarget_i2c_target_obj_t *self) { return self->sda_pin == NO_PIN; } -void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self) { - if (common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { +void common_hal_i2ctarget_i2c_target_deinit(i2ctarget_i2c_target_obj_t *self) { + if (common_hal_i2ctarget_i2c_target_deinited(self)) { return; } @@ -116,7 +117,7 @@ void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral self->scl_pin = NO_PIN; } -static int i2c_peripheral_check_error(i2cperipheral_i2c_peripheral_obj_t *self, bool raise) { +static int i2c_target_check_error(i2ctarget_i2c_target_obj_t *self, bool raise) { if (!self->sercom->I2CS.INTFLAG.bit.ERROR) { return 0; } @@ -135,8 +136,8 @@ static int i2c_peripheral_check_error(i2cperipheral_i2c_peripheral_obj_t *self, return -err; } -int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart) { - int err = i2c_peripheral_check_error(self, false); +int common_hal_i2ctarget_i2c_target_is_addressed(i2ctarget_i2c_target_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart) { + int err = i2c_target_check_error(self, false); if (err) { return err; } @@ -153,22 +154,22 @@ int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_perip for (unsigned int i = 0; i < self->num_addresses; i++) { if (*address == self->addresses[i]) { - common_hal_i2cperipheral_i2c_peripheral_ack(self, true); + common_hal_i2ctarget_i2c_target_ack(self, true); return 1; } } // This should clear AMATCH, but it doesn't... - common_hal_i2cperipheral_i2c_peripheral_ack(self, false); + common_hal_i2ctarget_i2c_target_ack(self, false); return 0; } -int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data) { +int common_hal_i2ctarget_i2c_target_read_byte(i2ctarget_i2c_target_obj_t *self, uint8_t *data) { for (int t = 0; t < 100 && !self->sercom->I2CS.INTFLAG.reg; t++) { mp_hal_delay_us(10); } - i2c_peripheral_check_error(self, true); + i2c_target_check_error(self, true); if (!self->sercom->I2CS.INTFLAG.bit.DRDY || self->sercom->I2CS.INTFLAG.bit.PREC || @@ -180,12 +181,12 @@ int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripher return 1; } -int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data) { +int common_hal_i2ctarget_i2c_target_write_byte(i2ctarget_i2c_target_obj_t *self, uint8_t data) { for (int t = 0; !self->sercom->I2CS.INTFLAG.reg && t < 100; t++) { mp_hal_delay_us(10); } - i2c_peripheral_check_error(self, true); + i2c_target_check_error(self, true); if (self->sercom->I2CS.INTFLAG.bit.PREC) { return 0; @@ -207,12 +208,12 @@ int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_periphe return 1; } -void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack) { +void common_hal_i2ctarget_i2c_target_ack(i2ctarget_i2c_target_obj_t *self, bool ack) { self->sercom->I2CS.CTRLB.bit.ACKACT = !ack; self->sercom->I2CS.CTRLB.bit.CMD = 0x03; } -void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self) { +void common_hal_i2ctarget_i2c_target_close(i2ctarget_i2c_target_obj_t *self) { for (int t = 0; !self->sercom->I2CS.INTFLAG.reg && t < 100; t++) { mp_hal_delay_us(10); } @@ -222,7 +223,7 @@ void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_ } if (!self->sercom->I2CS.STATUS.bit.DIR) { - common_hal_i2cperipheral_i2c_peripheral_ack(self, false); + common_hal_i2ctarget_i2c_target_ack(self, false); } else { int i = 0; while (self->sercom->I2CS.INTFLAG.reg == SERCOM_I2CS_INTFLAG_DRDY) { diff --git a/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h b/ports/atmel-samd/common-hal/i2ctarget/I2CTarget.h similarity index 85% rename from ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h rename to ports/atmel-samd/common-hal/i2ctarget/I2CTarget.h index 03ae3a2885..894961ab7b 100644 --- a/ports/atmel-samd/common-hal/i2cperipheral/I2CPeripheral.h +++ b/ports/atmel-samd/common-hal/i2ctarget/I2CTarget.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_TARGET_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_TARGET_H #include "common-hal/microcontroller/Pin.h" #include "py/obj.h" @@ -40,6 +40,6 @@ typedef struct { uint8_t scl_pin; uint8_t sda_pin; bool writing; -} i2cperipheral_i2c_peripheral_obj_t; +} i2ctarget_i2c_target_obj_t; -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H +#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_I2C_TARGET_H diff --git a/ports/atmel-samd/common-hal/i2ctarget/__init__.c b/ports/atmel-samd/common-hal/i2ctarget/__init__.c new file mode 100644 index 0000000000..4ec26465ad --- /dev/null +++ b/ports/atmel-samd/common-hal/i2ctarget/__init__.c @@ -0,0 +1 @@ +// No i2ctarget module functions. diff --git a/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c b/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c index 8e41f50d8d..c86ffb8d65 100644 --- a/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c +++ b/ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c @@ -63,16 +63,16 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle } // The peripheral supports 8, 10, 12, or 14 data bits, but the code only supports 8 at present if (data_count != 8) { - mp_raise_ValueError_varg(translate("Invalid data_count %d"), data_count); + mp_arg_error_invalid(MP_QSTR_datacount); } if (vertical_sync && vertical_sync->number != PIN_PCC_DEN1) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_vsync); + raise_ValueError_invalid_pin_name(MP_QSTR_vsync); } if (horizontal_reference && horizontal_reference->number != PIN_PCC_DEN2) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_href); + raise_ValueError_invalid_pin_name(MP_QSTR_href); } if (data_clock->number != PIN_PCC_CLK) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_data_clock); + raise_ValueError_invalid_pin_name(MP_QSTR_data_clock); } // technically, 0 was validated as free already but check again for (int i = 0; i < data_count; i++) { diff --git a/ports/atmel-samd/common-hal/microcontroller/Pin.c b/ports/atmel-samd/common-hal/microcontroller/Pin.c index 1460ece59e..b36286e5f2 100644 --- a/ports/atmel-samd/common-hal/microcontroller/Pin.c +++ b/ports/atmel-samd/common-hal/microcontroller/Pin.c @@ -27,6 +27,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate/translate.h" #include "atmel_start_pins.h" #include "hal/include/hal_gpio.h" diff --git a/ports/atmel-samd/common-hal/microcontroller/__init__.c b/ports/atmel-samd/common-hal/microcontroller/__init__.c index 983af7a647..60b35a2c5c 100644 --- a/ports/atmel-samd/common-hal/microcontroller/__init__.c +++ b/ports/atmel-samd/common-hal/microcontroller/__init__.c @@ -36,7 +36,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" #include "supervisor/shared/safe_mode.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_mcu_delay_us(uint32_t delay) { mp_hal_delay_us(delay); @@ -66,7 +66,7 @@ void common_hal_mcu_enable_interrupts(void) { void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { if (runmode == RUNMODE_BOOTLOADER) { if (!bootloader_available()) { - mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present.")); + mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present")); } // Pretend to be the first of the two reset presses needed to enter the // bootloader. That way one reset will end in the bootloader. diff --git a/ports/atmel-samd/common-hal/neopixel_write/__init__.c b/ports/atmel-samd/common-hal/neopixel_write/__init__.c index 182b8eee14..ac9a804333 100644 --- a/ports/atmel-samd/common-hal/neopixel_write/__init__.c +++ b/ports/atmel-samd/common-hal/neopixel_write/__init__.c @@ -46,6 +46,9 @@ __attribute__((naked,noinline,aligned(16))) static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMask, const uint8_t *ptr, int numBytes); +// The SAMD21 timing loop durations below are approximate, +// because the other instructions take significant time. + static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMask, const uint8_t *ptr, int numBytes) { asm volatile (" push {r4, r5, r6, lr};" @@ -54,25 +57,28 @@ static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMa " ldrb r5, [r2, #0];" // r5 := *ptr " add r2, #1;" // ptr++ " movs r4, #128;" // r4-mask, 0x80 + "loopBit:" " str r1, [r0, #4];" // set #ifdef SAMD21 - " movs r6, #3; d2: sub r6, #1; bne d2;" // delay 3 + " movs r6, #2; d2: sub r6, #1; bne d2;" // 248 ns high (entire T0H or start T1H) #endif #ifdef SAM_D5X_E5X - " movs r6, #16; d2: subs r6, #1; bne d2;" // delay 3 + " movs r6, #11; d2: subs r6, #1; bne d2;" // 300 ns high (entire T0H or start T1H) #endif " tst r4, r5;" // mask&r5 " bne skipclr;" " str r1, [r0, #0];" // clr + "skipclr:" #ifdef SAMD21 - " movs r6, #6; d0: sub r6, #1; bne d0;" // delay 6 + " movs r6, #7; d0: sub r6, #1; bne d0;" // 772 ns low or high (start T0L or end T1H) #endif #ifdef SAM_D5X_E5X - " movs r6, #16; d0: subs r6, #1; bne d0;" // delay 6 + " movs r6, #15; d0: subs r6, #1; bne d0;" // 388 ns low or high (start T0L or end T1H) #endif " str r1, [r0, #0];" // clr (possibly again, doesn't matter) + #ifdef SAMD21 " asr r4, r4, #1;" // mask >>= 1 #endif @@ -82,15 +88,20 @@ static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMa " beq nextbyte;" " uxtb r4, r4;" #ifdef SAMD21 - " movs r6, #2; d1: sub r6, #1; bne d1;" // delay 2 + " movs r6, #5; d1: sub r6, #1; bne d1;" // 496 ns (end TOL or entire T1L) #endif #ifdef SAM_D5X_E5X - " movs r6, #15; d1: subs r6, #1; bne d1;" // delay 2 + " movs r6, #20; d1: subs r6, #1; bne d1;" // 548 ns (end TOL or entire T1L) #endif " b loopBit;" + "nextbyte:" + #ifdef SAMD21 + " movs r6, #1; d3: sub r6, #1; bne d3;" // 60 ns (end TOL or entire T1L) + // other instructions add more delay + #endif #ifdef SAM_D5X_E5X - " movs r6, #12; d3: subs r6, #1; bne d3;" // delay 2 + " movs r6, #18; d3: subs r6, #1; bne d3;" // extra for 936 ns total (byte end T0L or entire T1L) #endif " cmp r2, r3;" " bcs neopixel_stop;" diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.c b/ports/atmel-samd/common-hal/ps2io/Ps2.c index 6e2fb58e51..43f40aa48e 100644 --- a/ports/atmel-samd/common-hal/ps2io/Ps2.c +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.c @@ -43,7 +43,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/ps2io/Ps2.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define STATE_IDLE 0 #define STATE_RECV 1 @@ -79,7 +79,7 @@ static void resume_interrupt(ps2io_ps2_obj_t *self) { disable_interrupt(self); self->state = STATE_IDLE; - gpio_set_pin_function(self->clk_pin, GPIO_PIN_FUNCTION_A); + gpio_set_pin_function(self->clock_pin, GPIO_PIN_FUNCTION_A); uint32_t mask = 1 << self->channel; EIC->INTFLAG.reg = mask << EIC_INTFLAG_EXTINT_Pos; EIC->INTENSET.reg = mask << EIC_INTENSET_EXTINT_Pos; @@ -90,14 +90,14 @@ static void resume_interrupt(ps2io_ps2_obj_t *self) { static void clk_hi(ps2io_ps2_obj_t *self) { // External pull-up // Must set pull after setting direction. - gpio_set_pin_direction(self->clk_pin, GPIO_DIRECTION_IN); - gpio_set_pin_pull_mode(self->clk_pin, GPIO_PULL_OFF); + gpio_set_pin_direction(self->clock_pin, GPIO_DIRECTION_IN); + gpio_set_pin_pull_mode(self->clock_pin, GPIO_PULL_OFF); } static bool wait_clk_lo(ps2io_ps2_obj_t *self, uint32_t us) { clk_hi(self); common_hal_mcu_delay_us(1); - while (gpio_get_pin_level(self->clk_pin) && us) { + while (gpio_get_pin_level(self->clock_pin) && us) { --us; common_hal_mcu_delay_us(1); } @@ -107,7 +107,7 @@ static bool wait_clk_lo(ps2io_ps2_obj_t *self, uint32_t us) { static bool wait_clk_hi(ps2io_ps2_obj_t *self, uint32_t us) { clk_hi(self); common_hal_mcu_delay_us(1); - while (!gpio_get_pin_level(self->clk_pin) && us) { + while (!gpio_get_pin_level(self->clock_pin) && us) { --us; common_hal_mcu_delay_us(1); } @@ -115,9 +115,9 @@ static bool wait_clk_hi(ps2io_ps2_obj_t *self, uint32_t us) { } static void clk_lo(ps2io_ps2_obj_t *self) { - gpio_set_pin_pull_mode(self->clk_pin, GPIO_PULL_OFF); - gpio_set_pin_direction(self->clk_pin, GPIO_DIRECTION_OUT); - gpio_set_pin_level(self->clk_pin, 0); + gpio_set_pin_pull_mode(self->clock_pin, GPIO_PULL_OFF); + gpio_set_pin_direction(self->clock_pin, GPIO_DIRECTION_OUT); + gpio_set_pin_level(self->clock_pin, 0); } static void data_hi(ps2io_ps2_obj_t *self) { @@ -244,19 +244,19 @@ void ps2_interrupt_handler(uint8_t channel) { } void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t *self, - const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *clk_pin) { - if (!clk_pin->has_extint) { - mp_raise_RuntimeError(translate("No hardware support on clk pin")); + const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *clock_pin) { + if (!clock_pin->has_extint) { + mp_arg_error_invalid(MP_QSTR_clock_pin); } - if (eic_get_enable() && !eic_channel_free(clk_pin->extint_channel)) { + if (eic_get_enable() && !eic_channel_free(clock_pin->extint_channel)) { mp_raise_RuntimeError(translate("EXTINT channel already in use")); } clk_hi(self); data_hi(self); - self->channel = clk_pin->extint_channel; - self->clk_pin = clk_pin->number; + self->channel = clock_pin->extint_channel; + self->clock_pin = clock_pin->number; self->data_pin = data_pin->number; self->state = STATE_IDLE; self->bufcount = 0; @@ -264,19 +264,19 @@ void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t *self, self->bufposw = 0; self->waiting_cmd_response = false; - set_eic_channel_data(clk_pin->extint_channel, (void *)self); + set_eic_channel_data(clock_pin->extint_channel, (void *)self); // Check to see if the EIC is enabled and start it up if its not.' if (eic_get_enable() == 0) { turn_on_external_interrupt_controller(); } - gpio_set_pin_function(clk_pin->number, GPIO_PIN_FUNCTION_A); + gpio_set_pin_function(clock_pin->number, GPIO_PIN_FUNCTION_A); gpio_set_pin_function(data_pin->number, GPIO_PIN_FUNCTION_A); turn_on_cpu_interrupt(self->channel); - claim_pin(clk_pin); + claim_pin(clock_pin); claim_pin(data_pin); // Set config will enable the EIC. @@ -284,7 +284,7 @@ void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t *self, } bool common_hal_ps2io_ps2_deinited(ps2io_ps2_obj_t *self) { - return self->clk_pin == NO_PIN; + return self->clock_pin == NO_PIN; } void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t *self) { @@ -293,9 +293,9 @@ void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t *self) { } set_eic_handler(self->channel, EIC_HANDLER_NO_INTERRUPT); turn_off_eic_channel(self->channel); - reset_pin_number(self->clk_pin); + reset_pin_number(self->clock_pin); reset_pin_number(self->data_pin); - self->clk_pin = NO_PIN; + self->clock_pin = NO_PIN; self->data_pin = NO_PIN; } diff --git a/ports/atmel-samd/common-hal/ps2io/Ps2.h b/ports/atmel-samd/common-hal/ps2io/Ps2.h index 588dfdd8be..fa8defdbeb 100644 --- a/ports/atmel-samd/common-hal/ps2io/Ps2.h +++ b/ports/atmel-samd/common-hal/ps2io/Ps2.h @@ -35,7 +35,7 @@ typedef struct { mp_obj_base_t base; uint8_t channel; - uint8_t clk_pin; + uint8_t clock_pin; uint8_t data_pin; uint8_t state; diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 507db7e437..8bf889bed3 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -41,9 +41,10 @@ #include "samd/pins.h" #include "samd/timers.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/pulseio/PulseIn.h" #include "supervisor/shared/tick.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/port.h" // This timer is shared amongst all PulseIn objects as a higher resolution clock. @@ -132,7 +133,7 @@ void pulsein_interrupt_handler(uint8_t channel) { if (self->len < self->maxlen) { self->len++; } else { - self->start++; + self->start = (self->start + 1) % self->maxlen; } } self->last_overflow = current_overflow; @@ -152,7 +153,7 @@ void pulsein_reset() { void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu_pin_obj_t *pin, uint16_t maxlen, bool idle_state) { if (!pin->has_extint) { - mp_raise_RuntimeError(translate("No hardware support on pin")); + raise_ValueError_invalid_pin(); } if (eic_get_enable() && !eic_channel_free(pin->extint_channel)) { mp_raise_RuntimeError(translate("EXTINT channel already in use")); @@ -160,7 +161,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t), false); if (self->buffer == NULL) { - mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), maxlen * sizeof(uint16_t)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } self->channel = pin->extint_channel; self->pin = pin->number; @@ -344,15 +345,15 @@ bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t *self) { return (EIC->INTENSET.reg & (mask << EIC_INTENSET_EXTINT_Pos)) == 0; } -uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, - int16_t index) { +uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_t index) { common_hal_mcu_disable_interrupts(); if (index < 0) { index += self->len; } if (index < 0 || index >= self->len) { common_hal_mcu_enable_interrupts(); - mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); + // Can't use mp_arg_validate_index_range() here due to the critical section. + mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; common_hal_mcu_enable_interrupts(); diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index b0407a1136..dc98e4bd18 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -36,7 +36,7 @@ #include "py/gc.h" #include "py/runtime.h" #include "shared-bindings/pulseio/PulseOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "timer_handler.h" // This timer is shared amongst all PulseOut objects under the assumption that diff --git a/ports/atmel-samd/common-hal/pwmio/PWMOut.c b/ports/atmel-samd/common-hal/pwmio/PWMOut.c index eaec10463d..c6e9e07304 100644 --- a/ports/atmel-samd/common-hal/pwmio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pwmio/PWMOut.c @@ -38,7 +38,7 @@ #include "hal/utils/include/utils_repeat_macro.h" #include "samd/pins.h" #include "samd/timers.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #undef ENABLE @@ -377,7 +377,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t frequency) { uint32_t system_clock = common_hal_mcu_processor_get_frequency(); if (frequency == 0 || frequency > system_clock / 2) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } const pin_timer_t *t = self->timer; uint8_t resolution; diff --git a/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c b/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c index 856fe04dbc..d253e0967e 100644 --- a/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -33,7 +33,7 @@ #include "eic_handler.h" #include "samd/external_interrupts.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" 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) { diff --git a/ports/atmel-samd/common-hal/rtc/RTC.c b/ports/atmel-samd/common-hal/rtc/RTC.c index e2a67bd174..0ebb61e11b 100644 --- a/ports/atmel-samd/common-hal/rtc/RTC.c +++ b/ports/atmel-samd/common-hal/rtc/RTC.c @@ -37,7 +37,7 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/rtc/RTC.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // This is the time in seconds since 2000 that the RTC was started. // TODO: Change the offset to ticks so that it can be a subsecond adjustment. @@ -68,13 +68,7 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { - if (calibration > 127 || calibration < -127) { - #if CIRCUITPY_FULL_BUILD - mp_raise_ValueError(translate("calibration value out of range +/-127")); - #else - mp_raise_ValueError(translate("calibration is out of range")); - #endif - } + mp_arg_validate_int_range(calibration, -127, 127, MP_QSTR_calibration); hri_rtcmode0_write_FREQCORR_SIGN_bit(RTC, calibration < 0 ? 0 : 1); hri_rtcmode0_write_FREQCORR_VALUE_bf(RTC, abs(calibration)); diff --git a/ports/atmel-samd/common-hal/sdioio/SDCard.c b/ports/atmel-samd/common-hal/sdioio/SDCard.c index 10ccb63a55..7ce8a1e1b1 100644 --- a/ports/atmel-samd/common-hal/sdioio/SDCard.c +++ b/ports/atmel-samd/common-hal/sdioio/SDCard.c @@ -32,7 +32,7 @@ #include "shared-bindings/sdioio/SDCard.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "genhdr/sdiodata.h" diff --git a/ports/atmel-samd/common-hal/touchio/TouchIn.c b/ports/atmel-samd/common-hal/touchio/TouchIn.c index 89979b620f..c3fae041fb 100644 --- a/ports/atmel-samd/common-hal/touchio/TouchIn.c +++ b/ports/atmel-samd/common-hal/touchio/TouchIn.c @@ -31,8 +31,9 @@ #include "py/runtime.h" #include "py/binary.h" #include "py/mphal.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/touchio/TouchIn.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Native touchio only exists for SAMD21 #ifdef SAMD21 @@ -60,7 +61,7 @@ static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { void common_hal_touchio_touchin_construct(touchio_touchin_obj_t *self, const mcu_pin_obj_t *pin) { if (!pin->has_touch) { - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); } claim_pin(pin); diff --git a/ports/atmel-samd/libs/libgcc-12.1.0-Os-v6-m-nofp.a b/ports/atmel-samd/libs/libgcc-12.1.0-Os-v6-m-nofp.a new file mode 100644 index 0000000000..56692d5d05 Binary files /dev/null and b/ports/atmel-samd/libs/libgcc-12.1.0-Os-v6-m-nofp.a differ diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index e200ce67db..9d4ddd7134 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -46,6 +46,7 @@ #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) #define MICROPY_PY_FUNCTION_ATTRS (0) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (0) +#define MICROPY_PY_COLLECTIONS_DEQUE (0) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_UERRNO_LIST \ X(EPERM) \ diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 82cc69728a..a03fc1d320 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -8,6 +8,8 @@ INTERNAL_LIBM = 1 USB_NUM_ENDPOINT_PAIRS = 8 CIRCUITPY_ROTARYIO_SOFTENCODER = 1 +CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1 +CIRCUITPY_LTO = 1 ###################################################################### # Put samd21-only choices here. @@ -36,7 +38,7 @@ CIRCUITPY_FRAMEBUFFERIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 CIRCUITPY_GETPASS ?= 0 CIRCUITPY_GIFIO ?= 0 -CIRCUITPY_I2CPERIPHERAL ?= 0 +CIRCUITPY_I2CTARGET ?= 0 CIRCUITPY_JSON ?= 0 CIRCUITPY_KEYPAD ?= 0 CIRCUITPY_MSGPACK ?= 0 @@ -44,8 +46,10 @@ CIRCUITPY_RE ?= 0 CIRCUITPY_SDCARDIO ?= 0 CIRCUITPY_SYNTHIO ?= 0 CIRCUITPY_TOUCHIO_USE_NATIVE ?= 1 +CIRCUITPY_TRACEBACK = 0 CIRCUITPY_ULAB = 0 CIRCUITPY_VECTORIO = 0 +CIRCUITPY_ZLIB = 0 # TODO: In CircuitPython 8.0, turn this back on, after `busio.OneWire` is removed. # We'd like a smoother transition, but we can't afford the space to have both @@ -57,17 +61,12 @@ endif MICROPY_PY_ASYNC_AWAIT = 0 -# We don't have room for the fonts for terminalio for ja and ko +# We don't have room for the fonts for terminalio for certain languages, # so turn off terminalio, and if it's off and displayio is on, # force a clean build. # Note that we cannot test $(CIRCUITPY_DISPLAYIO) directly with an # ifeq, because it's not set yet. -ifeq ($(TRANSLATION), ja) -CIRCUITPY_TERMINALIO = 0 -RELEASE_NEEDS_CLEAN_BUILD = $(CIRCUITPY_DISPLAYIO) -endif - -ifeq ($(TRANSLATION), ko) +ifneq (,$(filter $(TRANSLATION),ja ko ru)) CIRCUITPY_TERMINALIO = 0 RELEASE_NEEDS_CLEAN_BUILD = $(CIRCUITPY_DISPLAYIO) endif @@ -75,6 +74,8 @@ endif SUPEROPT_GC = 0 SUPEROPT_VM = 0 +CIRCUITPY_LTO_PARTITION = one + ifeq ($(CIRCUITPY_FULL_BUILD),0) # On the smallest boards, this saves about 180 bytes. On other boards, it may -increase- space used. CFLAGS_BOARD = -fweb -frename-registers @@ -91,12 +92,17 @@ ifeq ($(CHIP_FAMILY),samd51) # No native touchio on SAMD51. CIRCUITPY_TOUCHIO_USE_NATIVE = 0 +ifeq ($(CIRCUITPY_FULL_BUILD),0) +CIRCUITPY_LTO_PARTITION ?= one +endif + # The ?='s allow overriding in mpconfigboard.mk. CIRCUITPY_ALARM ?= 1 CIRCUITPY_PS2IO ?= 1 CIRCUITPY_SAMD ?= 1 +CIRCUITPY_FLOPPYIO ?= $(CIRCUITPY_FULL_BUILD) CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD) CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FRAMEBUFFERIO) CIRCUITPY_WATCHDOG ?= 1 @@ -109,16 +115,23 @@ endif # samd51 ifeq ($(CHIP_FAMILY),same51) -# No native touchio on SAMD51. +# No native touchio on SAME51. CIRCUITPY_TOUCHIO_USE_NATIVE = 0 +ifeq ($(CIRCUITPY_FULL_BUILD),0) +CIRCUITPY_LTO_PARTITION ?= one +endif + # The ?='s allow overriding in mpconfigboard.mk. CIRCUITPY_ALARM ?= 1 CIRCUITPY_PS2IO ?= 1 CIRCUITPY_SAMD ?= 1 +CIRCUITPY_FLOPPYIO ?= $(CIRCUITPY_FULL_BUILD) CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD) CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FRAMEBUFFERIO) endif # same51 ###################################################################### + +CIRCUITPY_BUILD_EXTENSIONS ?= uf2 diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index d3b20192cf..57133eefeb 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit d3b20192cf94fdea68a412596e082108ba5ebbf0 +Subproject commit 57133eefeb077f73b5ac17ee044d9feaf566da8e diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 704d17c68d..424acece78 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -122,16 +122,17 @@ #include "tusb.h" -#if CIRCUITPY_GAMEPADSHIFT -#include "shared-module/gamepadshift/__init__.h" -#endif #if CIRCUITPY_PEW #include "common-hal/_pew/PewPew.h" #endif static volatile bool sleep_ok = true; #ifdef SAMD21 -uint8_t _tick_event_channel; +static uint8_t _tick_event_channel = EVSYS_SYNCH_NUM; + +static bool tick_enabled(void) { + return _tick_event_channel != EVSYS_SYNCH_NUM; +} // Sleeping requires a register write that can stall interrupt handling. Turning // off sleeps allows for more accurate interrupt timing. (Python still thinks @@ -424,15 +425,19 @@ void reset_port(void) { reset_gclks(); - #if CIRCUITPY_GAMEPADSHIFT - gamepadshift_reset(); - #endif #if CIRCUITPY_PEW pew_reset(); #endif - reset_event_system(); - reset_ticks(); + #ifdef SAMD21 + if (!tick_enabled()) + // SAMD21 ticks depend on the event system, so don't disturb the event system if we need ticks, + // such as for a display that lives across VM instantiations. + #endif + { + reset_event_system(); + reset_ticks(); + } reset_all_pins(); @@ -613,8 +618,8 @@ void port_enable_tick(void) { RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_PER2; #endif #ifdef SAMD21 - // SAMD21 ticks won't survive reset_port(). This *should* be ok since it'll - // be triggered by ticks and no Python will be running. + // reset_port() preserves the event system if ticks were still enabled after a VM finished, + // such as for an on-board display. Normally the event system would be reset between VM instantiations. if (_tick_event_channel >= EVSYS_SYNCH_NUM) { turn_on_event_system(); _tick_event_channel = find_sync_event_channel(); diff --git a/ports/atmel-samd/tools/gen_pin_name_table.py b/ports/atmel-samd/tools/gen_pin_name_table.py index a78144d400..3eb0fbdbb3 100644 --- a/ports/atmel-samd/tools/gen_pin_name_table.py +++ b/ports/atmel-samd/tools/gen_pin_name_table.py @@ -164,11 +164,10 @@ capabilities = { "AnalogOut": ["PA02"], }, "audioio": {"AudioOut": ["PA02"]}, - "bitbangio": {"I2C": ALL_BUT_USB, "OneWire": ALL_BUT_USB, "SPI": ALL_BUT_USB}, + "bitbangio": {"I2C": ALL_BUT_USB, "SPI": ALL_BUT_USB}, "busio": { "I2C - SDA": ["PA00", "PB08", "PA08", "PA12", "PA16", "PA22", "PB02"], # SERCOM pad 0 "I2C - SCL": ["PA01", "PB09", "PA09", "PA13", "PA17", "PA23", "PB03"], # SERCOM pad 1 - "OneWire": ALL_BUT_USB, "SPI - MISO": [ "PA00", "PA01", @@ -299,6 +298,7 @@ capabilities = { ], # pad 0 or 2 }, "digitalio": {"DigitalInOut": ALL_BUT_USB}, + "onewireio": {"OneWire": ALL_BUT_USB}, "pulseio": { "PulseIn": ALL_BUT_USB, "PWMOut": [ diff --git a/ports/broadcom/Makefile b/ports/broadcom/Makefile index 921d26958a..757e7f3450 100644 --- a/ports/broadcom/Makefile +++ b/ports/broadcom/Makefile @@ -1,12 +1,12 @@ # Select the board to build for. -BOARD=raspberrypi_pi4 +BOARD?=raspberrypi_pi4b ifeq ($(BOARD),) - $(error You must provide a BOARD parameter) + $(error You must provide a BOARD parameter) else - ifeq ($(wildcard boards/$(BOARD)/.),) - $(error Invalid BOARD specified) - endif + ifeq ($(wildcard boards/$(BOARD)/.),) + $(error Invalid BOARD "$(BOARD)" specified) + endif endif # If the build directory is not given, make it reflect the board name. @@ -107,7 +107,7 @@ OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_MOD:.c=.o)) # BCM CLFAGS -CFLAGS += -ffreestanding -nostartfiles -DMICROPY_HW_MCU_NAME="\"$(CHIP_VARIANT)\"" +CFLAGS += -nostartfiles -DMICROPY_HW_MCU_NAME="\"$(CHIP_VARIANT)\"" OPTIMIZATION_FLAGS ?= -O3 diff --git a/ports/broadcom/bindings/videocore/Framebuffer.c b/ports/broadcom/bindings/videocore/Framebuffer.c index 46a2ac13b0..4be55ee291 100644 --- a/ports/broadcom/bindings/videocore/Framebuffer.c +++ b/ports/broadcom/bindings/videocore/Framebuffer.c @@ -96,12 +96,8 @@ STATIC mp_obj_t videocore_framebuffer_get_width(mp_obj_t self_in) { return MP_OBJ_NEW_SMALL_INT(common_hal_videocore_framebuffer_get_width(self)); } MP_DEFINE_CONST_FUN_OBJ_1(videocore_framebuffer_get_width_obj, videocore_framebuffer_get_width); -const mp_obj_property_t videocore_framebuffer_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&videocore_framebuffer_get_width_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(videocore_framebuffer_width_obj, + (mp_obj_t)&videocore_framebuffer_get_width_obj); //| height: int //| """The height of the display, in pixels""" @@ -113,12 +109,8 @@ STATIC mp_obj_t videocore_framebuffer_get_height(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(videocore_framebuffer_get_height_obj, videocore_framebuffer_get_height); -const mp_obj_property_t videocore_framebuffer_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&videocore_framebuffer_get_height_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(videocore_framebuffer_height_obj, + (mp_obj_t)&videocore_framebuffer_get_height_obj); STATIC const mp_rom_map_elem_t videocore_framebuffer_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&videocore_framebuffer_deinit_obj) }, diff --git a/ports/broadcom/boards/diodes_delight_piunora/board.c b/ports/broadcom/boards/diodes_delight_piunora/board.c index 80bea7f8b6..e272a8cc3d 100644 --- a/ports/broadcom/boards/diodes_delight_piunora/board.c +++ b/ports/broadcom/boards/diodes_delight_piunora/board.c @@ -45,12 +45,4 @@ void board_init(void) { true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/broadcom/boards/diodes_delight_piunora/mpconfigboard.h b/ports/broadcom/boards/diodes_delight_piunora/mpconfigboard.h index a3e318bb13..12a68201fa 100644 --- a/ports/broadcom/boards/diodes_delight_piunora/mpconfigboard.h +++ b/ports/broadcom/boards/diodes_delight_piunora/mpconfigboard.h @@ -4,3 +4,6 @@ #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) #define MICROPY_HW_NEOPIXEL (&pin_GPIO12) + +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO4) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO5) diff --git a/ports/broadcom/boards/raspberrypi_cm4/board.c b/ports/broadcom/boards/raspberrypi_cm4/board.c index 80bea7f8b6..e272a8cc3d 100644 --- a/ports/broadcom/boards/raspberrypi_cm4/board.c +++ b/ports/broadcom/boards/raspberrypi_cm4/board.c @@ -45,12 +45,4 @@ void board_init(void) { true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/broadcom/boards/raspberrypi_cm4io/board.c b/ports/broadcom/boards/raspberrypi_cm4io/board.c index 80bea7f8b6..e272a8cc3d 100644 --- a/ports/broadcom/boards/raspberrypi_cm4io/board.c +++ b/ports/broadcom/boards/raspberrypi_cm4io/board.c @@ -45,12 +45,4 @@ void board_init(void) { true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/broadcom/boards/raspberrypi_cm4io/mpconfigboard.h b/ports/broadcom/boards/raspberrypi_cm4io/mpconfigboard.h index 9acfb32626..832a0b887b 100644 --- a/ports/broadcom/boards/raspberrypi_cm4io/mpconfigboard.h +++ b/ports/broadcom/boards/raspberrypi_cm4io/mpconfigboard.h @@ -4,3 +4,6 @@ #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) #define MICROPY_HW_LED_STATUS (&pin_GPIO42) + +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO14) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO15) diff --git a/ports/broadcom/boards/raspberrypi_pi4b/board.c b/ports/broadcom/boards/raspberrypi_pi4b/board.c index 80bea7f8b6..e272a8cc3d 100644 --- a/ports/broadcom/boards/raspberrypi_pi4b/board.c +++ b/ports/broadcom/boards/raspberrypi_pi4b/board.c @@ -45,12 +45,4 @@ void board_init(void) { true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/broadcom/boards/raspberrypi_pi4b/mpconfigboard.h b/ports/broadcom/boards/raspberrypi_pi4b/mpconfigboard.h index 2980b0f9a5..521c8fda25 100644 --- a/ports/broadcom/boards/raspberrypi_pi4b/mpconfigboard.h +++ b/ports/broadcom/boards/raspberrypi_pi4b/mpconfigboard.h @@ -4,3 +4,6 @@ #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) #define MICROPY_HW_LED_STATUS (&pin_GPIO42) + +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO14) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO15) diff --git a/ports/broadcom/boards/raspberrypi_zero/board.c b/ports/broadcom/boards/raspberrypi_zero/board.c index 80bea7f8b6..e272a8cc3d 100644 --- a/ports/broadcom/boards/raspberrypi_zero/board.c +++ b/ports/broadcom/boards/raspberrypi_zero/board.c @@ -45,12 +45,4 @@ void board_init(void) { true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.h b/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.h index 1141520e06..c1566e8fc0 100644 --- a/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.h +++ b/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.h @@ -4,3 +4,6 @@ #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) #define MICROPY_HW_LED_STATUS (&pin_GPIO47) + +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO14) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO15) diff --git a/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk b/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk index 74f8511c2d..b6adb5d6bb 100644 --- a/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk +++ b/ports/broadcom/boards/raspberrypi_zero/mpconfigboard.mk @@ -4,3 +4,5 @@ USB_PRODUCT = "Zero" USB_MANUFACTURER = "Raspberry Pi" CHIP_VARIANT = "bcm2835" + +CIRCUITPY_BUILD_EXTENSIONS = disk.img.zip,kernel.img diff --git a/ports/broadcom/boards/raspberrypi_zero2w/board.c b/ports/broadcom/boards/raspberrypi_zero2w/board.c index 80bea7f8b6..e272a8cc3d 100644 --- a/ports/broadcom/boards/raspberrypi_zero2w/board.c +++ b/ports/broadcom/boards/raspberrypi_zero2w/board.c @@ -45,12 +45,4 @@ void board_init(void) { true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/broadcom/boards/raspberrypi_zero2w/mpconfigboard.h b/ports/broadcom/boards/raspberrypi_zero2w/mpconfigboard.h index 11011268ae..e65bf5c163 100644 --- a/ports/broadcom/boards/raspberrypi_zero2w/mpconfigboard.h +++ b/ports/broadcom/boards/raspberrypi_zero2w/mpconfigboard.h @@ -2,3 +2,8 @@ #define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) + +#define MICROPY_HW_LED_STATUS (&pin_GPIO29) + +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO14) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO15) diff --git a/ports/broadcom/boards/raspberrypi_zero2w/pins.c b/ports/broadcom/boards/raspberrypi_zero2w/pins.c index bb6632b923..5e12613b3f 100644 --- a/ports/broadcom/boards/raspberrypi_zero2w/pins.c +++ b/ports/broadcom/boards/raspberrypi_zero2w/pins.c @@ -55,6 +55,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}, diff --git a/ports/broadcom/boards/raspberrypi_zero_w/board.c b/ports/broadcom/boards/raspberrypi_zero_w/board.c index 80bea7f8b6..e272a8cc3d 100644 --- a/ports/broadcom/boards/raspberrypi_zero_w/board.c +++ b/ports/broadcom/boards/raspberrypi_zero_w/board.c @@ -45,12 +45,4 @@ void board_init(void) { true); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.h b/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.h index 389868f882..4dc1372ae5 100644 --- a/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.h +++ b/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.h @@ -4,3 +4,6 @@ #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) #define MICROPY_HW_LED_STATUS (&pin_GPIO47) + +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO14) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO15) diff --git a/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk b/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk index 24d09e0530..cd55f73ee8 100644 --- a/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk +++ b/ports/broadcom/boards/raspberrypi_zero_w/mpconfigboard.mk @@ -4,3 +4,5 @@ USB_PRODUCT = "Zero W" USB_MANUFACTURER = "Raspberry Pi" CHIP_VARIANT = "bcm2835" + +CIRCUITPY_BUILD_EXTENSIONS = disk.img.zip,kernel.img diff --git a/ports/broadcom/common-hal/busio/I2C.c b/ports/broadcom/common-hal/busio/I2C.c index e84810cffd..3142fda145 100644 --- a/ports/broadcom/common-hal/busio/I2C.c +++ b/ports/broadcom/common-hal/busio/I2C.c @@ -90,7 +90,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } } if (instance_index == NUM_I2C) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } i2c_in_use[instance_index] = true; self->index = instance_index; diff --git a/ports/broadcom/common-hal/busio/SPI.c b/ports/broadcom/common-hal/busio/SPI.c index feba34521d..017674dfc0 100644 --- a/ports/broadcom/common-hal/busio/SPI.c +++ b/ports/broadcom/common-hal/busio/SPI.c @@ -104,7 +104,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, break; } if (instance_index == NUM_SPI) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } self->clock = clock; diff --git a/ports/broadcom/common-hal/busio/UART.c b/ports/broadcom/common-hal/busio/UART.c index ff17d5ff1d..52d1b7a418 100644 --- a/ports/broadcom/common-hal/busio/UART.c +++ b/ports/broadcom/common-hal/busio/UART.c @@ -162,13 +162,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte *receiver_buffer, bool sigint_enabled) { - if (bits > 8) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } - - if (receiver_buffer_size == 0) { - mp_raise_ValueError(translate("Invalid buffer size")); - } + mp_arg_validate_int_max(bits, 8, MP_QSTR_bits); + mp_arg_validate_int_min(receiver_buffer_size, 1, MP_QSTR_receiver_buffer_size); if ((rs485_dir != NULL) || (rs485_invert)) { mp_raise_NotImplementedError(translate("RS485 Not yet supported on this device")); @@ -203,7 +198,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, break; } if (instance_index == NUM_UART) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } self->rx_pin = rx; @@ -224,7 +219,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // in the long-lived pool is not strictly necessary) // (This is a macro.) if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { - mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); + m_malloc_fail(receiver_buffer_size); } } } diff --git a/ports/broadcom/common-hal/digitalio/DigitalInOut.c b/ports/broadcom/common-hal/digitalio/DigitalInOut.c index 38a7cbb2b8..d8ac3472de 100644 --- a/ports/broadcom/common-hal/digitalio/DigitalInOut.c +++ b/ports/broadcom/common-hal/digitalio/DigitalInOut.c @@ -32,7 +32,7 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "peripherals/broadcom/gpio.h" diff --git a/ports/broadcom/common-hal/sdioio/SDCard.c b/ports/broadcom/common-hal/sdioio/SDCard.c index 85a84ac213..27b36041de 100644 --- a/ports/broadcom/common-hal/sdioio/SDCard.c +++ b/ports/broadcom/common-hal/sdioio/SDCard.c @@ -35,7 +35,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "peripherals/broadcom/cpu.h" #include "peripherals/broadcom/defines.h" diff --git a/ports/broadcom/mpconfigport.h b/ports/broadcom/mpconfigport.h index 4fce84c973..e77725cca3 100644 --- a/ports/broadcom/mpconfigport.h +++ b/ports/broadcom/mpconfigport.h @@ -60,7 +60,4 @@ #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS -#define CIRCUITPY_DEBUG_UART_TX (&pin_GPIO14) -#define CIRCUITPY_DEBUG_UART_RX (&pin_GPIO15) - #endif // __INCLUDED_MPCONFIGPORT_H diff --git a/ports/broadcom/mpconfigport.mk b/ports/broadcom/mpconfigport.mk index 7296461d1f..839ef00514 100644 --- a/ports/broadcom/mpconfigport.mk +++ b/ports/broadcom/mpconfigport.mk @@ -9,7 +9,7 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_PULSEIO = 0 @@ -24,3 +24,5 @@ INTERNAL_FLASH_FILESYSTEM = 1 USB_NUM_ENDPOINT_PAIRS = 8 USB_HIGHSPEED = 1 + +CIRCUITPY_BUILD_EXTENSIONS ?= disk.img.zip,kernel8.img diff --git a/ports/cxd56/boards/spresense/board.c b/ports/cxd56/boards/spresense/board.c index fba263c569..b397789c3e 100644 --- a/ports/cxd56/boards/spresense/board.c +++ b/ports/cxd56/boards/spresense/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/cxd56/common-hal/analogio/AnalogIn.c b/ports/cxd56/common-hal/analogio/AnalogIn.c index d1bd68cfbe..bb19d02c25 100644 --- a/ports/cxd56/common-hal/analogio/AnalogIn.c +++ b/ports/cxd56/common-hal/analogio/AnalogIn.c @@ -34,6 +34,7 @@ #include "py/runtime.h" #include "shared-bindings/analogio/AnalogIn.h" +#include "shared-bindings/microcontroller/Pin.h" typedef struct { const char *devpath; @@ -52,7 +53,7 @@ STATIC analogin_dev_t analogin_dev[] = { void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin) { if (!pin->analog) { - mp_raise_ValueError(translate("AnalogIn not supported on given pin")); + raise_ValueError_invalid_pin(); } self->number = -1; @@ -65,13 +66,13 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const } if (self->number < 0) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } if (analogin_dev[self->number].fd < 0) { analogin_dev[self->number].fd = open(analogin_dev[self->number].devpath, O_RDONLY); if (analogin_dev[self->number].fd < 0) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } } diff --git a/ports/cxd56/common-hal/analogio/AnalogOut.c b/ports/cxd56/common-hal/analogio/AnalogOut.c index 3f1abe80d1..b57dc8e323 100644 --- a/ports/cxd56/common-hal/analogio/AnalogOut.c +++ b/ports/cxd56/common-hal/analogio/AnalogOut.c @@ -29,7 +29,7 @@ #include "shared-bindings/analogio/AnalogOut.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { - mp_raise_RuntimeError(translate("AnalogOut functionality not supported")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); } void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { diff --git a/ports/cxd56/common-hal/busio/I2C.c b/ports/cxd56/common-hal/busio/I2C.c index 82b52ca179..07d9024a51 100644 --- a/ports/cxd56/common-hal/busio/I2C.c +++ b/ports/cxd56/common-hal/busio/I2C.c @@ -32,15 +32,16 @@ #include "py/runtime.h" #include "shared-bindings/busio/I2C.h" +#include "shared-bindings/microcontroller/Pin.h" void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint32_t frequency, uint32_t timeout) { if (frequency != I2C_SPEED_STANDARD && frequency != I2C_SPEED_FAST) { - mp_raise_ValueError(translate("Unsupported baudrate")); + mp_arg_error_invalid(MP_QSTR_frequency); } if (scl->number != PIN_I2C0_BCK || sda->number != PIN_I2C0_BDT) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } claim_pin(scl); diff --git a/ports/cxd56/common-hal/busio/SPI.c b/ports/cxd56/common-hal/busio/SPI.c index c248b5cc9a..75f530eda1 100644 --- a/ports/cxd56/common-hal/busio/SPI.c +++ b/ports/cxd56/common-hal/busio/SPI.c @@ -33,6 +33,7 @@ #include "py/runtime.h" #include "shared-bindings/busio/SPI.h" +#include "shared-bindings/microcontroller/Pin.h" void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t *clock, const mcu_pin_obj_t *mosi, const mcu_pin_obj_t *miso, bool half_duplex) { @@ -55,7 +56,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * } if (port < 0) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } claim_pin(clock); diff --git a/ports/cxd56/common-hal/busio/UART.c b/ports/cxd56/common-hal/busio/UART.c index 91fbe52441..aafc0b790e 100644 --- a/ports/cxd56/common-hal/busio/UART.c +++ b/ports/cxd56/common-hal/busio/UART.c @@ -40,6 +40,7 @@ #include "py/runtime.h" #include "shared-bindings/busio/UART.h" +#include "shared-bindings/microcontroller/Pin.h" typedef struct { const char *devpath; @@ -65,20 +66,12 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, struct termios tio; if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) { - mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); + mp_raise_NotImplementedError(translate("RS485")); } - if (bits != 8) { - mp_raise_ValueError(translate("Could not initialize UART")); - } - - if (parity != BUSIO_UART_PARITY_NONE) { - mp_raise_ValueError(translate("Could not initialize UART")); - } - - if (stop != 1) { - mp_raise_ValueError(translate("Could not initialize UART")); - } + mp_arg_validate_int(bits, 8, MP_QSTR_bits); + mp_arg_validate_int(parity, BUSIO_UART_PARITY_NONE, MP_QSTR_parity); + mp_arg_validate_int(stop, 1, MP_QSTR_stop); self->number = -1; @@ -91,13 +84,13 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } if (self->number < 0) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if (busio_uart_dev[self->number].fd < 0) { busio_uart_dev[self->number].fd = open(busio_uart_dev[self->number].devpath, O_RDWR); if (busio_uart_dev[self->number].fd < 0) { - mp_raise_ValueError(translate("Could not initialize UART")); + mp_raise_RuntimeError(translate("UART init")); } // Wait to make sure the UART is ready diff --git a/ports/cxd56/common-hal/camera/Camera.c b/ports/cxd56/common-hal/camera/Camera.c index 5e159d61dc..f304ed8f74 100644 --- a/ports/cxd56/common-hal/camera/Camera.c +++ b/ports/cxd56/common-hal/camera/Camera.c @@ -121,11 +121,11 @@ static void camera_start_preview() { void common_hal_camera_construct(camera_obj_t *self) { if (camera_dev.fd < 0) { if (video_initialize(camera_dev.devpath) < 0) { - mp_raise_ValueError(translate("Could not initialize Camera")); + mp_raise_RuntimeError(translate("Camera init")); } camera_dev.fd = open(camera_dev.devpath, 0); if (camera_dev.fd < 0) { - mp_raise_ValueError(translate("Could not initialize Camera")); + mp_raise_RuntimeError(translate("Camera init")); } } diff --git a/ports/cxd56/common-hal/digitalio/DigitalInOut.c b/ports/cxd56/common-hal/digitalio/DigitalInOut.c index 37b695567d..cfb39301df 100644 --- a/ports/cxd56/common-hal/digitalio/DigitalInOut.c +++ b/ports/cxd56/common-hal/digitalio/DigitalInOut.c @@ -29,10 +29,11 @@ #include "py/runtime.h" #include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/microcontroller/Pin.h" digitalinout_result_t common_hal_digitalio_digitalinout_construct(digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) { if (pin->analog) { - mp_raise_ValueError(translate("DigitalInOut not supported on given pin")); + raise_ValueError_invalid_pin(); } claim_pin(pin); diff --git a/ports/cxd56/common-hal/gnss/GNSS.c b/ports/cxd56/common-hal/gnss/GNSS.c index f345f5261d..977d2e9b4b 100644 --- a/ports/cxd56/common-hal/gnss/GNSS.c +++ b/ports/cxd56/common-hal/gnss/GNSS.c @@ -56,7 +56,7 @@ void common_hal_gnss_construct(gnss_obj_t *self, unsigned long selection) { if (gnss_dev.fd < 0) { gnss_dev.fd = open(gnss_dev.devpath, O_RDONLY); if (gnss_dev.fd < 0) { - mp_raise_ValueError(translate("Could not initialize GNSS")); + mp_raise_RuntimeError(translate("GNSS init")); } } diff --git a/ports/cxd56/common-hal/microcontroller/__init__.c b/ports/cxd56/common-hal/microcontroller/__init__.c index 499e0e5f04..dd9a54063f 100644 --- a/ports/cxd56/common-hal/microcontroller/__init__.c +++ b/ports/cxd56/common-hal/microcontroller/__init__.c @@ -72,7 +72,7 @@ void common_hal_mcu_enable_interrupts(void) { void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { if (runmode == RUNMODE_BOOTLOADER) { - mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present.")); + mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present")); } else if (runmode == RUNMODE_SAFE_MODE) { safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE); } diff --git a/ports/cxd56/common-hal/pulseio/PulseIn.c b/ports/cxd56/common-hal/pulseio/PulseIn.c index 0d2fbbfd96..165e2a6ece 100644 --- a/ports/cxd56/common-hal/pulseio/PulseIn.c +++ b/ports/cxd56/common-hal/pulseio/PulseIn.c @@ -75,7 +75,7 @@ static int pulsein_interrupt_handler(int irq, FAR void *context, FAR void *arg) if (self->len < self->maxlen) { self->len++; } else { - self->start++; + self->start = (self->start + 1) % self->maxlen; } } self->last_us = current_us; @@ -87,7 +87,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu_pin_obj_t *pin, uint16_t maxlen, bool idle_state) { self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t), false); if (self->buffer == NULL) { - mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), maxlen * sizeof(uint16_t)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } self->pin = pin; @@ -190,7 +190,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_ } if (index < 0 || index >= self->len) { common_hal_mcu_enable_interrupts(); - mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); + mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; common_hal_mcu_enable_interrupts(); diff --git a/ports/cxd56/common-hal/pwmio/PWMOut.c b/ports/cxd56/common-hal/pwmio/PWMOut.c index e9bffd21e9..7e27817aab 100644 --- a/ports/cxd56/common-hal/pwmio/PWMOut.c +++ b/ports/cxd56/common-hal/pwmio/PWMOut.c @@ -74,7 +74,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, self->variable_frequency = variable_frequency; if (ioctl(pwmout_dev[self->number].fd, PWMIOC_SETCHARACTERISTICS, (unsigned long)((uintptr_t)&self->info)) < 0) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } ioctl(pwmout_dev[self->number].fd, PWMIOC_START, 0); @@ -116,7 +116,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t fr self->info.frequency = frequency; if (ioctl(pwmout_dev[self->number].fd, PWMIOC_SETCHARACTERISTICS, (unsigned long)((uintptr_t)&self->info)) < 0) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } } diff --git a/ports/cxd56/common-hal/rtc/RTC.c b/ports/cxd56/common-hal/rtc/RTC.c index ce65e6acde..0024e56cb2 100644 --- a/ports/cxd56/common-hal/rtc/RTC.c +++ b/ports/cxd56/common-hal/rtc/RTC.c @@ -50,5 +50,5 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); } diff --git a/ports/cxd56/common-hal/sdioio/SDCard.c b/ports/cxd56/common-hal/sdioio/SDCard.c index 56fe5f7057..e8e5df4687 100644 --- a/ports/cxd56/common-hal/sdioio/SDCard.c +++ b/ports/cxd56/common-hal/sdioio/SDCard.c @@ -31,6 +31,7 @@ #include "py/mperrno.h" #include "py/runtime.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/sdioio/SDCard.h" #include "shared-bindings/util.h" @@ -42,7 +43,7 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, struct geometry geo; if (clock->number != PIN_SDIO_CLK || command->number != PIN_SDIO_CMD) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } uint8_t data_pins_num = 0; @@ -54,11 +55,11 @@ void common_hal_sdioio_sdcard_construct(sdioio_sdcard_obj_t *self, } if (data_pins_num != DATA_PINS_NUM) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if (open_blockdriver("/dev/mmcsd0", 0, &self->inode) < 0) { - mp_raise_ValueError(translate("Could not initialize SDCard")); + mp_raise_RuntimeError(translate("SDCard init")); } self->inode->u.i_bops->geometry(self->inode, &geo); diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index 8787c55bcc..cb54233a07 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -3,6 +3,8 @@ USB_HIGHSPEED = 1 # Number of USB endpoint pairs. USB_NUM_ENDPOINT_PAIRS = 6 +CIRCUITPY_TRANSLATE_OBJECT = 1 + # Longints can be implemented as mpz, as longlong, or not LONGINT_IMPL = MPZ @@ -13,7 +15,7 @@ CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_GNSS = 1 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 0 CIRCUITPY_KEYPAD = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 @@ -23,3 +25,5 @@ CIRCUITPY_TOUCHIO = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 INTERNAL_LIBM = 1 + +CIRCUITPY_BUILD_EXTENSIONS ?= spk diff --git a/ports/espressif/CMakeLists.txt b/ports/espressif/CMakeLists.txt index 4c834397b9..d05af27539 100644 --- a/ports/espressif/CMakeLists.txt +++ b/ports/espressif/CMakeLists.txt @@ -6,7 +6,14 @@ set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf) # The component list here determines what options we get in menuconfig and what the ninja file # can build. -set(COMPONENTS esptool_py soc driver log main esp-tls mbedtls mdns esp_event esp_adc_cal esp_netif esp_wifi lwip wpa_supplicant freertos bt) +set(COMPONENTS esptool_py soc driver log main esp-tls mbedtls mdns esp_event esp_adc_cal esp_netif esp_wifi lwip wpa_supplicant freertos bt usb) + +if("${CIRCUITPY_ESP32_CAMERA}") +message("Including esp32-camera") +set(EXTRA_COMPONENT_DIRS "esp32-camera") +list(APPEND COMPONENTS "esp32-camera") +message("COMPONENTS = ${COMPONENTS}") +endif() include($ENV{IDF_PATH}/tools/cmake/project.cmake) project(circuitpython) diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 96360d06bd..af1788d01e 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -98,6 +98,8 @@ INC += \ -isystem esp-idf/components/bt/host/nimble/port/include \ -isystem esp-idf/components/driver/include \ -isystem esp-idf/components/driver/$(IDF_TARGET)/include \ + -isystem esp-idf/components/efuse/include \ + -isystem esp-idf/components/efuse/$(IDF_TARGET)/include \ -isystem esp-idf/components/$(IDF_TARGET)/include \ -isystem esp-idf/components/esp_adc_cal/include \ -isystem esp-idf/components/esp_common/include \ @@ -165,8 +167,6 @@ else # RISC-V is larger than xtensa so do -Os for it OPTIMIZATION_FLAGS ?= -Os endif - # TODO: Test with -flto - ### CFLAGS += -flto endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk @@ -196,7 +196,12 @@ LDFLAGS += \ -Wl,--build-id=none \ -fno-rtti -ifeq ($(IDF_TARGET),esp32c3) +ifeq ($(IDF_TARGET),esp32) +LDFLAGS += \ + -T$(IDF_TARGET).rom.newlib-data.ld \ + -T$(IDF_TARGET).rom.newlib-funcs.ld \ + -T$(IDF_TARGET).rom.spiflash.ld +else ifeq ($(IDF_TARGET),esp32c3) LDFLAGS += \ -Tesp32c3.rom.newlib.ld \ -Tesp32c3.rom.version.ld \ @@ -244,7 +249,6 @@ SRC_C += \ bindings/espidf/__init__.c \ boards/$(BOARD)/board.c \ boards/$(BOARD)/pins.c \ - modules/$(CIRCUITPY_MODULE).c \ shared/netutils/netutils.c \ peripherals/i2c.c \ peripherals/rmt.c \ @@ -257,7 +261,6 @@ SRC_C += \ peripherals/touch.c ifeq ($(IDF_TARGET),esp32s2) SRC_C += \ - cam.c \ i2s_lcd_esp32s2_driver.c endif endif @@ -277,6 +280,17 @@ ifneq ($(CIRCUITPY_BLEIO),0) SRC_C += common-hal/_bleio/ble_events.c endif +SRC_C += $(wildcard common-hal/espidf/*.c) + +ifneq ($(CIRCUITPY_ESP32_CAMERA),0) +SRC_CAMERA := \ + $(wildcard common-hal/esp32_camera/*.c) \ + $(wildcard bindings/esp32_camera/*.c) +SRC_C += $(SRC_CAMERA) +CFLAGS += -isystem esp32-camera/driver/include +CFLAGS += -isystem esp32-camera/conversions/include +endif + SRC_COMMON_HAL_EXPANDED = \ $(addprefix shared-bindings/, $(SRC_COMMON_HAL)) \ $(addprefix shared-bindings/, $(SRC_BINDINGS_ENUMS)) \ @@ -335,8 +349,10 @@ ifneq ($(CIRCUITPY_BLEIO),0) SDKCONFIGS := esp-idf-config/sdkconfig-ble.defaults;$(SDKCONFIGS) endif # create the config headers -$(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig | $(BUILD)/esp-idf - IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -GNinja +.PHONY: do-sdkconfig +do-sdkconfig: $(BUILD)/esp-idf/config/sdkconfig.h +$(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig CMakeLists.txt | $(BUILD)/esp-idf + IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -GNinja -DCIRCUITPY_ESP32_CAMERA=$(CIRCUITPY_ESP32_CAMERA) # build a lib # Adding -d explain -j 1 -v to the ninja line will output debug info @@ -364,6 +380,9 @@ $(HEADER_BUILD)/qstr.split: | $(BUILD)/esp-idf/config/sdkconfig.h BINARY_WIFI_BLOBS = libcoexist.a libcore.a libespnow.a libmesh.a libnet80211.a libpp.a libsmartconfig.a libwapi.a BINARY_BLOBS = esp-idf/components/esp_phy/lib/$(IDF_TARGET)/libphy.a $(addprefix esp-idf/components/esp_wifi/lib/$(IDF_TARGET)/, $(BINARY_WIFI_BLOBS)) +ifeq ($(IDF_TARGET),esp32) +BINARY_BLOBS += esp-idf/components/esp_phy/lib/$(IDF_TARGET)/librtc.a +endif ESP_IDF_COMPONENTS_LINK = $(IDF_TARGET_ARCH) app_update bootloader_support driver efuse esp_adc_cal esp_common esp_event esp_hw_support esp_ipc esp_netif esp_pm esp_phy esp_ringbuf esp_rom esp_system esp_timer esp-tls esp_wifi freertos hal heap log lwip mbedtls mdns newlib nvs_flash pthread soc spi_flash vfs wpa_supplicant ifneq ($(CIRCUITPY_BLEIO),0) @@ -382,12 +401,22 @@ BINARY_BLOBS += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a ESP_IDF_COMPONENTS_EXPANDED += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a endif -ifeq ($(IDF_TARGET),esp32c3) +ifneq ($(CIRCUITPY_ESP32_CAMERA),0) +ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/esp32-camera/libesp32-camera.a +#$(error $(ESP_IDF_COMPONENTS_EXPANDED)) +endif + +# BOOTLOADER_OFFSET is determined by chip type, based on the ROM bootloader, and is not changeable. +ifeq ($(IDF_TARGET),esp32) +BOOTLOADER_OFFSET = 0x1000 +else ifeq ($(IDF_TARGET),esp32c3) BOOTLOADER_OFFSET = 0x0 else ifeq ($(IDF_TARGET),esp32s3) BOOTLOADER_OFFSET = 0x0 -else +else ifeq ($(IDF_TARGET),esp32s2) BOOTLOADER_OFFSET = 0x1000 +else +$(error unknown IDF_TARGET $(IDF_TARGET)) endif IDF_CMAKE_TARGETS = \ @@ -402,7 +431,7 @@ ESP_AUTOGEN_LD = $(BUILD)/esp-idf/esp-idf/$(IDF_TARGET)/$(IDF_TARGET)_out.ld $(B FLASH_FLAGS = --flash_mode $(CIRCUITPY_ESP_FLASH_MODE) --flash_freq $(CIRCUITPY_ESP_FLASH_FREQ) --flash_size $(CIRCUITPY_ESP_FLASH_SIZE) -ESPTOOL_FLAGS ?= --before=default_reset --after=no_reset +ESPTOOL_FLAGS ?= --before=default_reset --after=no_reset --baud 921600 ifeq ($(UF2_BOOTLOADER),1) all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 diff --git a/ports/espressif/README.rst b/ports/espressif/README.rst index cea95dea04..949f3533ae 100644 --- a/ports/espressif/README.rst +++ b/ports/espressif/README.rst @@ -9,6 +9,7 @@ Support Status: .. csv-table:: :header: SoC, Status + ESP, "beta" ESP32-C3, "beta" ESP32-S2, "stable" ESP32-S3, "beta" @@ -20,13 +21,17 @@ How this port is organized: - **boards/** contains the configuration files for each development board and breakout available on the port. - **common-hal/** contains the port-specific module implementations, used by shared-module and shared-bindings. - **esp-idf/** contains the Espressif IoT Development Framework installation, including all the drivers for the port. -- **modules/** contains information specific to certain Espressif SoC based hardware modules, such as the pins used for flash and RAM on the WROVER and WROOM. - **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**. - **supervisor/** contains port-specific implementations of internal flash, serial and USB, as well as the **port.c** file, which initializes the port at startup. - **tools/** includes useful Python scripts for debugging and other purposes. At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled CircuitPython modules. +Connecting to the ESP32 +--------------------------------------- +The ESP32 chip itself has no USB support. On many boards there is a USB-serial adapter chip, such as a CP2102N, CP2104 or CH9102F, usually connected to the ESP32 TXD0 (GPIO1)and RXD0 (GPIO3) pins, for access to the bootloader. CircuitPython also uses this serial channel for the REPL. + + Connecting to the ESP32-C3 --------------------------------------- diff --git a/ports/espressif/background.c b/ports/espressif/background.c index 37fe3d5be0..0b5bb96a3b 100644 --- a/ports/espressif/background.c +++ b/ports/espressif/background.c @@ -40,7 +40,6 @@ #include "common-hal/pulseio/PulseIn.h" #endif - void port_background_task(void) { // Zero delay in case FreeRTOS wants to switch to something else. vTaskDelay(0); diff --git a/ports/espressif/bindings/esp32_camera/Camera.c b/ports/espressif/bindings/esp32_camera/Camera.c new file mode 100644 index 0000000000..4474f3024f --- /dev/null +++ b/ports/espressif/bindings/esp32_camera/Camera.c @@ -0,0 +1,1030 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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/mphal.h" +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/runtime.h" + +#include "bindings/esp32_camera/__init__.h" +#include "bindings/esp32_camera/Camera.h" +#include "common-hal/esp32_camera/Camera.h" + +#include "shared-bindings/displayio/Bitmap.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/util.h" +#include "esp_camera.h" +#include "sensor.h" + +//| class Camera: +//| def __init__( +//| self, +//| *, +//| data_pins: List[microcontroller.Pin], +//| pixel_clock: microcontroller.Pin, +//| vsync: microcontroller.Pin, +//| href: microcontroller.Pin, +//| i2c: busio.I2C, +//| external_clock_pin: microcontroller.Pin, +//| external_clock_frequency: int, +//| powerdown_pin: Optional[microcontroller.Pin] = None, +//| reset_pin: Optional[microcontroller.Pin] = None, +//| pixel_format: PixelFormat=PixelFormat.RGB565, +//| frame_size: FrameSize=FrameSize.QQVGA, +//| jpeg_quality: int=15, +//| framebuffer_count: int = 1, +//| grab_mode: GrabMode = GrabMode.WHEN_EMPTY, +//| ) -> None: +//| """ +//| Configure and initialize a camera with the given properties +//| +//| This driver requires that the ``CIRCUITPY_RESERVED_PSRAM`` in ``/.env`` 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. +//| +//| +//| .. important:: +//| +//| Not all supported sensors have all +//| of the properties listed below. For instance, the +//| OV5640 supports `denoise`, but the +//| OV2640 does not. The underlying esp32-camera +//| library does not provide a reliable API to check +//| which settings are supported. CircuitPython makes +//| a best effort to determine when an unsupported +//| property is set and will raise an exception in +//| that case. +//| +//| :param data_pins: The 8 data data_pins used for image data transfer from the camera module, least significant bit first +//| :param pixel_clock: The pixel clock output from the camera module +//| :param vsync: The vertical sync pulse output from the camera module +//| :param href: The horizontal reference output from the camera module +//| :param i2c: The I2C bus connected to the camera module +//| :param external_clock_frequency: The frequency generated on the external clock pin +//| :param external_clock_pin: The pin on which to generate the external clock +//| :param powerdown_pin: The powerdown input to the camera module +//| :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 framebuffer_count: The number of framebuffers (1 for single-buffered and 2 for double-buffered) +//| :param grab_mode: When to grab a new frame +//| """ +//| +STATIC mp_obj_t esp32_camera_camera_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { + enum { ARG_data_pins, ARG_pixel_clock_pin, ARG_vsync_pin, ARG_href_pin, ARG_i2c, ARG_external_clock_pin, ARG_external_clock_frequency, ARG_powerdown_pin, ARG_reset_pin, ARG_pixel_format, ARG_frame_size, ARG_jpeg_quality, ARG_framebuffer_count, ARG_grab_mode, NUM_ARGS }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_data_pins, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, + { MP_QSTR_pixel_clock_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, + { MP_QSTR_vsync_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, + { MP_QSTR_href_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, + { MP_QSTR_i2c, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, + { MP_QSTR_external_clock_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY }, + { MP_QSTR_external_clock_frequency, MP_ARG_INT | MP_ARG_REQUIRED }, + { MP_QSTR_powerdown_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = MP_ROM_NONE } }, + { MP_QSTR_reset_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = MP_ROM_NONE } }, + { MP_QSTR_pixel_format, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = MP_ROM_PTR((void *)&pixel_format_RGB565_obj) } }, + { MP_QSTR_frame_size, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = MP_ROM_PTR((void *)&frame_size_QQVGA_obj) } }, + { MP_QSTR_jpeg_quality, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 15 } }, + { MP_QSTR_framebuffer_count, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 1 } }, + { MP_QSTR_grab_mode, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = MP_ROM_PTR((void *)&grab_mode_WHEN_EMPTY_obj) } }, + }; + + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + MP_STATIC_ASSERT(MP_ARRAY_SIZE(allowed_args) == NUM_ARGS); + mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + uint8_t data_pins[8]; + uint8_t data_pin_count; + validate_pins(MP_QSTR_data_pins, data_pins, MP_ARRAY_SIZE(data_pins), args[ARG_data_pins].u_obj, &data_pin_count); + mp_arg_validate_length(data_pin_count, 8, MP_QSTR_data_pins); + + const mcu_pin_obj_t *pixel_clock_pin = validate_obj_is_free_pin(args[ARG_pixel_clock_pin].u_obj); + const mcu_pin_obj_t *vsync_pin = validate_obj_is_free_pin(args[ARG_vsync_pin].u_obj); + const mcu_pin_obj_t *href_pin = validate_obj_is_free_pin(args[ARG_href_pin].u_obj); + const busio_i2c_obj_t *i2c = MP_OBJ_TO_PTR(mp_arg_validate_type(args[ARG_i2c].u_obj, &busio_i2c_type, MP_QSTR_i2c)); + const mcu_pin_obj_t *external_clock_pin = validate_obj_is_free_pin(args[ARG_external_clock_pin].u_obj); + const mcu_pin_obj_t *powerdown_pin = validate_obj_is_free_pin_or_none(args[ARG_powerdown_pin].u_obj); + const mcu_pin_obj_t *reset_pin = validate_obj_is_free_pin_or_none(args[ARG_reset_pin].u_obj); + const mp_int_t external_clock_frequency = mp_arg_validate_int_range(args[ARG_external_clock_frequency].u_int, 0, 40000000, MP_QSTR_clock_frequency); + + camera_grab_mode_t grab_mode = validate_grab_mode(args[ARG_grab_mode].u_obj, MP_QSTR_grab_mode); + framesize_t frame_size = validate_frame_size(args[ARG_frame_size].u_obj, MP_QSTR_frame_size); + pixformat_t pixel_format = validate_pixel_format(args[ARG_pixel_format].u_obj, MP_QSTR_pixel_format); + mp_int_t jpeg_quality = mp_arg_validate_int_range(args[ARG_jpeg_quality].u_int, 2, 55, MP_QSTR_jpeg_quality); + mp_int_t framebuffer_count = mp_arg_validate_int_range(args[ARG_framebuffer_count].u_int, 1, 2, MP_QSTR_framebuffer_count); + + esp32_camera_camera_obj_t *self = m_new_obj(esp32_camera_camera_obj_t); + self->base.type = &esp32_camera_camera_type; + common_hal_esp32_camera_camera_construct( + self, + data_pins, + external_clock_pin, + pixel_clock_pin, + vsync_pin, + href_pin, + powerdown_pin, + reset_pin, + i2c, + external_clock_frequency, + pixel_format, + frame_size, + jpeg_quality, + framebuffer_count, + grab_mode); + return MP_OBJ_FROM_PTR(self); +} + +//| def deinit(self) -> None: +//| """Deinitialises the camera and releases all memory resources for reuse.""" +//| ... +//| +STATIC mp_obj_t esp32_camera_camera_deinit(mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_esp32_camera_camera_deinit(self); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_deinit_obj, esp32_camera_camera_deinit); + +STATIC void check_for_deinit(esp32_camera_camera_obj_t *self) { + if (common_hal_esp32_camera_camera_deinited(self)) { + raise_deinited_error(); + } +} + +//| def __enter__(self) -> Camera: +//| """No-op used by Context Managers.""" +//| ... +//| +// Provided by context manager helper. + +//| def __exit__(self) -> None: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +STATIC mp_obj_t esp32_camera_camera_obj___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + return esp32_camera_camera_deinit(args[0]); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp32_camera_camera___exit___obj, 4, 4, esp32_camera_camera_obj___exit__); + +//| frame_available: bool +//| """True if a frame is available, False otherwise""" + +STATIC mp_obj_t esp32_camera_camera_frame_available_get(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(esp_camera_fb_available()); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_frame_available_get_obj, esp32_camera_camera_frame_available_get); + +MP_PROPERTY_GETTER(esp32_camera_camera_frame_available_obj, + (mp_obj_t)&esp32_camera_camera_frame_available_get_obj); + +//| def take(self, timeout: Optional[float]=0.25) -> Optional[displayio.Bitmap | ReadableBuffer]: +//| """Record a frame. Wait up to 'timeout' seconds for a frame to be captured. +//| +//| In the case of timeout, `None` is returned. +//| If `pixel_format` is `PixelFormat.JPEG`, the returned value is a read-only `memoryview`. +//| Otherwise, the returned value is a read-only `displayio.Bitmap`. +//| """ +//| +STATIC mp_obj_t esp32_camera_camera_take(size_t n_args, const mp_obj_t *args) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(args[0]); + mp_float_t timeout = n_args < 2 ? MICROPY_FLOAT_CONST(0.25) : mp_obj_get_float(args[1]); + check_for_deinit(self); + camera_fb_t *result = common_hal_esp32_camera_camera_take(self, (int)MICROPY_FLOAT_C_FUN(round)(timeout * 1000)); + if (!result) { + return mp_const_none; + } + pixformat_t format = common_hal_esp32_camera_camera_get_pixel_format(self); + if (format == PIXFORMAT_JPEG) { + return mp_obj_new_memoryview('b', result->len, result->buf); + } else { + int width = common_hal_esp32_camera_camera_get_width(self); + int height = common_hal_esp32_camera_camera_get_height(self); + displayio_bitmap_t *bitmap = m_new_obj(displayio_bitmap_t); + bitmap->base.type = &displayio_bitmap_type; + common_hal_displayio_bitmap_construct_from_buffer(bitmap, width, height, (format == PIXFORMAT_RGB565) ? 16 : 8, (uint32_t *)(void *)result->buf, true); + return bitmap; + } +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(esp32_camera_camera_take_obj, 1, 2, esp32_camera_camera_take); + + +//| def reconfigure( +//| self, +//| frame_size: Optional[FrameSize] = None, +//| pixel_format: Optional[PixelFormat] = None, +//| grab_mode: Optional[GrabMode] = None, +//| framebuffer_count: Optional[int] = None, +//| ) -> None: +//| """Change multiple related camera settings simultaneously +//| +//| Because these settings interact in complex ways, and take longer than +//| the other properties to set, they are set together in a single function call. +//| +//| If an argument is unspecified or None, then the setting is unchanged.""" +//| + +STATIC mp_obj_t esp32_camera_camera_reconfigure(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + + enum { ARG_frame_size, ARG_pixel_format, ARG_grab_mode, ARG_framebuffer_count }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_frame_size, MP_ARG_OBJ, {.u_obj = MP_ROM_NONE} }, + { MP_QSTR_pixel_format, MP_ARG_OBJ, {.u_obj = MP_ROM_NONE} }, + { MP_QSTR_grab_mode, MP_ARG_OBJ, {.u_obj = MP_ROM_NONE} }, + { MP_QSTR_framebuffer_count, MP_ARG_OBJ, {.u_obj = MP_ROM_NONE} }, + }; + + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + framesize_t frame_size = + args[ARG_frame_size].u_obj != MP_ROM_NONE + ? validate_frame_size(args[ARG_frame_size].u_obj, MP_QSTR_frame_size) + : common_hal_esp32_camera_camera_get_frame_size(self); + pixformat_t pixel_format = + args[ARG_pixel_format].u_obj != MP_ROM_NONE + ? validate_pixel_format(args[ARG_pixel_format].u_obj, MP_QSTR_pixel_format) + : common_hal_esp32_camera_camera_get_pixel_format(self); + camera_grab_mode_t grab_mode = + args[ARG_grab_mode].u_obj != MP_ROM_NONE + ? validate_grab_mode(args[ARG_grab_mode].u_obj, MP_QSTR_grab_mode) + : common_hal_esp32_camera_camera_get_grab_mode(self); + bool framebuffer_count = + args[ARG_framebuffer_count].u_obj != MP_ROM_NONE + ? mp_obj_get_int(args[ARG_framebuffer_count].u_obj) + : common_hal_esp32_camera_camera_get_framebuffer_count(self); + + common_hal_esp32_camera_camera_reconfigure(self, frame_size, pixel_format, grab_mode, framebuffer_count); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_KW(esp32_camera_camera_reconfigure_obj, 1, esp32_camera_camera_reconfigure); + +//| pixel_format: PixelFormat +//| """The pixel format of captured frames""" + +STATIC mp_obj_t esp32_camera_camera_get_pixel_format(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return cp_enum_find(&esp32_camera_pixel_format_type, common_hal_esp32_camera_camera_get_pixel_format(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_pixel_format_obj, esp32_camera_camera_get_pixel_format); + +MP_PROPERTY_GETTER(esp32_camera_camera_pixel_format_obj, + (mp_obj_t)&esp32_camera_camera_get_pixel_format_obj); + + +//| frame_size: FrameSize +//| """The size of captured frames""" + +STATIC mp_obj_t esp32_camera_camera_get_frame_size(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return cp_enum_find(&esp32_camera_frame_size_type, common_hal_esp32_camera_camera_get_frame_size(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_frame_size_obj, esp32_camera_camera_get_frame_size); + +MP_PROPERTY_GETTER(esp32_camera_camera_frame_size_obj, + (mp_obj_t)&esp32_camera_camera_get_frame_size_obj); + +//| contrast: int +//| """The sensor contrast. Positive values increase contrast, negative values lower it. The total range is device-specific but is often from -2 to +2 inclusive.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_contrast(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_contrast(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_contrast_obj, esp32_camera_camera_get_contrast); + +STATIC mp_obj_t esp32_camera_camera_set_contrast(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_contrast(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_contrast_obj, esp32_camera_camera_set_contrast); +MP_PROPERTY_GETSET(esp32_camera_camera_contrast_obj, + (mp_obj_t)&esp32_camera_camera_get_contrast_obj, + (mp_obj_t)&esp32_camera_camera_set_contrast_obj); + +//| brightness: int +//| """The sensor brightness. Positive values increase brightness, negative values lower it. The total range is device-specific but is often from -2 to +2 inclusive.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_brightness(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_brightness(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_brightness_obj, esp32_camera_camera_get_brightness); + +STATIC mp_obj_t esp32_camera_camera_set_brightness(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_brightness(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_brightness_obj, esp32_camera_camera_set_brightness); +MP_PROPERTY_GETSET(esp32_camera_camera_brightness_obj, + (mp_obj_t)&esp32_camera_camera_get_brightness_obj, + (mp_obj_t)&esp32_camera_camera_set_brightness_obj); + +//| saturation: int +//| """The sensor saturation. Positive values increase saturation (more vibrant colors), negative values lower it (more muted colors). The total range is device-specific but the value is often from -2 to +2 inclusive.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_saturation(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_saturation(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_saturation_obj, esp32_camera_camera_get_saturation); + +STATIC mp_obj_t esp32_camera_camera_set_saturation(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_saturation(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_saturation_obj, esp32_camera_camera_set_saturation); +MP_PROPERTY_GETSET(esp32_camera_camera_saturation_obj, + (mp_obj_t)&esp32_camera_camera_get_saturation_obj, + (mp_obj_t)&esp32_camera_camera_set_saturation_obj); + +//| sharpness: int +//| """The sensor sharpness. Positive values increase sharpness (more defined edges), negative values lower it (softer edges). The total range is device-specific but the value is often from -2 to +2 inclusive.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_sharpness(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_sharpness(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_sharpness_obj, esp32_camera_camera_get_sharpness); + +STATIC mp_obj_t esp32_camera_camera_set_sharpness(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_sharpness(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_sharpness_obj, esp32_camera_camera_set_sharpness); +MP_PROPERTY_GETSET(esp32_camera_camera_sharpness_obj, + (mp_obj_t)&esp32_camera_camera_get_sharpness_obj, + (mp_obj_t)&esp32_camera_camera_set_sharpness_obj); + +//| denoise: int +//| """The sensor 'denoise' setting. Any camera sensor has inherent 'noise', especially in low brightness environments. Software algorithms can decrease noise at the expense of fine detail. A larger value increases the amount of software noise removal. The total range is device-specific but the value is often from 0 to 10.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_denoise(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_denoise(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_denoise_obj, esp32_camera_camera_get_denoise); + +STATIC mp_obj_t esp32_camera_camera_set_denoise(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_denoise(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_denoise_obj, esp32_camera_camera_set_denoise); +MP_PROPERTY_GETSET(esp32_camera_camera_denoise_obj, + (mp_obj_t)&esp32_camera_camera_get_denoise_obj, + (mp_obj_t)&esp32_camera_camera_set_denoise_obj); + +//| gain_ceiling: GainCeiling +//| """The sensor 'gain ceiling' setting. "Gain" is an analog multiplier applied to the raw sensor data. The 'ceiling' is the maximum gain value that the sensor will use. A higher gain means that the sensor has a greater response to light, but also makes sensor noise more visible.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_gain_ceiling(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return cp_enum_find(&esp32_camera_gain_ceiling_type, common_hal_esp32_camera_camera_get_gainceiling(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_gain_ceiling_obj, esp32_camera_camera_get_gain_ceiling); + +STATIC mp_obj_t esp32_camera_camera_set_gain_ceiling(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_gainceiling(self, validate_gain_ceiling(arg, MP_QSTR_gain_ceiling)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_gain_ceiling_obj, esp32_camera_camera_set_gain_ceiling); +MP_PROPERTY_GETSET(esp32_camera_camera_gain_ceiling_obj, + (mp_obj_t)&esp32_camera_camera_get_gain_ceiling_obj, + (mp_obj_t)&esp32_camera_camera_set_gain_ceiling_obj); + +//| quality: int +//| """The 'quality' setting when capturing JPEG images. This is similar to the quality setting when exporting a jpeg image from photo editing software. Typical values range from 5 to 40, with higher numbers leading to larger image sizes and better overall image quality. However, when the quality is set to a high number, the total size of the JPEG data can exceed the size of an internal buffer, causing image capture to fail.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_quality(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_quality(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_quality_obj, esp32_camera_camera_get_quality); + +STATIC mp_obj_t esp32_camera_camera_set_quality(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_quality(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_quality_obj, esp32_camera_camera_set_quality); +MP_PROPERTY_GETSET(esp32_camera_camera_quality_obj, + (mp_obj_t)&esp32_camera_camera_get_quality_obj, + (mp_obj_t)&esp32_camera_camera_set_quality_obj); + +//| colorbar: bool +//| """When `True`, a test pattern image is captured and the real sensor data is not used.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_colorbar(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_colorbar(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_colorbar_obj, esp32_camera_camera_get_colorbar); + +STATIC mp_obj_t esp32_camera_camera_set_colorbar(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_colorbar(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_colorbar_obj, esp32_camera_camera_set_colorbar); +MP_PROPERTY_GETSET(esp32_camera_camera_colorbar_obj, + (mp_obj_t)&esp32_camera_camera_get_colorbar_obj, + (mp_obj_t)&esp32_camera_camera_set_colorbar_obj); + +//| whitebal: bool +//| """When `True`, the camera attempts to automatically control white balance. When `False`, the `wb_mode` setting is used instead.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_whitebal(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_whitebal(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_whitebal_obj, esp32_camera_camera_get_whitebal); + +STATIC mp_obj_t esp32_camera_camera_set_whitebal(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_whitebal(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_whitebal_obj, esp32_camera_camera_set_whitebal); +MP_PROPERTY_GETSET(esp32_camera_camera_whitebal_obj, + (mp_obj_t)&esp32_camera_camera_get_whitebal_obj, + (mp_obj_t)&esp32_camera_camera_set_whitebal_obj); + +//| gain_ctrl: bool +//| """When `True`, the camera attempts to automatically control the sensor gain, up to the value in the `gain_ceiling` property. When `False`, the `agc_gain` setting is used instead.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_gain_ctrl(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_gain_ctrl(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_gain_ctrl_obj, esp32_camera_camera_get_gain_ctrl); + +STATIC mp_obj_t esp32_camera_camera_set_gain_ctrl(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_gain_ctrl(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_gain_ctrl_obj, esp32_camera_camera_set_gain_ctrl); +MP_PROPERTY_GETSET(esp32_camera_camera_gain_ctrl_obj, + (mp_obj_t)&esp32_camera_camera_get_gain_ctrl_obj, + (mp_obj_t)&esp32_camera_camera_set_gain_ctrl_obj); + +//| exposure_ctrl: bool +//| """When `True` the camera attempts to automatically control the exposure. When `False`, the `aec_value` setting is used instead.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_exposure_ctrl(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_exposure_ctrl(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_exposure_ctrl_obj, esp32_camera_camera_get_exposure_ctrl); + +STATIC mp_obj_t esp32_camera_camera_set_exposure_ctrl(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_exposure_ctrl(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_exposure_ctrl_obj, esp32_camera_camera_set_exposure_ctrl); +MP_PROPERTY_GETSET(esp32_camera_camera_exposure_ctrl_obj, + (mp_obj_t)&esp32_camera_camera_get_exposure_ctrl_obj, + (mp_obj_t)&esp32_camera_camera_set_exposure_ctrl_obj); + +//| hmirror: bool +//| """When `True` the camera image is mirrored left-to-right""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_hmirror(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_hmirror(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_hmirror_obj, esp32_camera_camera_get_hmirror); + +STATIC mp_obj_t esp32_camera_camera_set_hmirror(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_hmirror(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_hmirror_obj, esp32_camera_camera_set_hmirror); +MP_PROPERTY_GETSET(esp32_camera_camera_hmirror_obj, + (mp_obj_t)&esp32_camera_camera_get_hmirror_obj, + (mp_obj_t)&esp32_camera_camera_set_hmirror_obj); + +//| vflip: bool +//| """When `True` the camera image is flipped top-to-bottom""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_vflip(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_vflip(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_vflip_obj, esp32_camera_camera_get_vflip); + +STATIC mp_obj_t esp32_camera_camera_set_vflip(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_vflip(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_vflip_obj, esp32_camera_camera_set_vflip); +MP_PROPERTY_GETSET(esp32_camera_camera_vflip_obj, + (mp_obj_t)&esp32_camera_camera_get_vflip_obj, + (mp_obj_t)&esp32_camera_camera_set_vflip_obj); + +//| aec2: bool +//| """When `True` the sensor's "night mode" is enabled, extending the range of automatic gain control.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_aec2(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_aec2(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_aec2_obj, esp32_camera_camera_get_aec2); + +STATIC mp_obj_t esp32_camera_camera_set_aec2(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_aec2(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_aec2_obj, esp32_camera_camera_set_aec2); +MP_PROPERTY_GETSET(esp32_camera_camera_aec2_obj, + (mp_obj_t)&esp32_camera_camera_get_aec2_obj, + (mp_obj_t)&esp32_camera_camera_set_aec2_obj); + +//| awb_gain: bool +//| """Access the awb_gain property of the camera sensor""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_awb_gain(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_awb_gain(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_awb_gain_obj, esp32_camera_camera_get_awb_gain); + +STATIC mp_obj_t esp32_camera_camera_set_awb_gain(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_awb_gain(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_awb_gain_obj, esp32_camera_camera_set_awb_gain); +MP_PROPERTY_GETSET(esp32_camera_camera_awb_gain_obj, + (mp_obj_t)&esp32_camera_camera_get_awb_gain_obj, + (mp_obj_t)&esp32_camera_camera_set_awb_gain_obj); + +//| agc_gain: int +//| """Access the gain level of the sensor. Higher values produce brighter images. Typical settings range from 0 to 30. """ +//| + +STATIC mp_obj_t esp32_camera_camera_get_agc_gain(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_agc_gain(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_agc_gain_obj, esp32_camera_camera_get_agc_gain); + +STATIC mp_obj_t esp32_camera_camera_set_agc_gain(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_agc_gain(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_agc_gain_obj, esp32_camera_camera_set_agc_gain); +MP_PROPERTY_GETSET(esp32_camera_camera_agc_gain_obj, + (mp_obj_t)&esp32_camera_camera_get_agc_gain_obj, + (mp_obj_t)&esp32_camera_camera_set_agc_gain_obj); + +//| aec_value: int +//| """Access the exposure value of the camera. Higher values produce brighter images. Typical settings range from 0 to 1200.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_aec_value(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_aec_value(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_aec_value_obj, esp32_camera_camera_get_aec_value); + +STATIC mp_obj_t esp32_camera_camera_set_aec_value(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_aec_value(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_aec_value_obj, esp32_camera_camera_set_aec_value); +MP_PROPERTY_GETSET(esp32_camera_camera_aec_value_obj, + (mp_obj_t)&esp32_camera_camera_get_aec_value_obj, + (mp_obj_t)&esp32_camera_camera_set_aec_value_obj); + +//| special_effect: int +//| """Enable a "special effect". Zero is no special effect. On OV5640, special effects range from 0 to 6 inclusive and select various color modes.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_special_effect(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_special_effect(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_special_effect_obj, esp32_camera_camera_get_special_effect); + +STATIC mp_obj_t esp32_camera_camera_set_special_effect(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_special_effect(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_special_effect_obj, esp32_camera_camera_set_special_effect); +MP_PROPERTY_GETSET(esp32_camera_camera_special_effect_obj, + (mp_obj_t)&esp32_camera_camera_get_special_effect_obj, + (mp_obj_t)&esp32_camera_camera_set_special_effect_obj); + +//| wb_mode: int +//| """The white balance mode. 0 is automatic white balance. Typical values range from 0 to 4 inclusive.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_wb_mode(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_wb_mode(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_wb_mode_obj, esp32_camera_camera_get_wb_mode); + +STATIC mp_obj_t esp32_camera_camera_set_wb_mode(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_wb_mode(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_wb_mode_obj, esp32_camera_camera_set_wb_mode); +MP_PROPERTY_GETSET(esp32_camera_camera_wb_mode_obj, + (mp_obj_t)&esp32_camera_camera_get_wb_mode_obj, + (mp_obj_t)&esp32_camera_camera_set_wb_mode_obj); + +//| ae_level: int +//| """The exposure offset for automatic exposure. Typical values range from -2 to +2.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_ae_level(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_ae_level(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_ae_level_obj, esp32_camera_camera_get_ae_level); + +STATIC mp_obj_t esp32_camera_camera_set_ae_level(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_ae_level(self, mp_obj_get_int(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_ae_level_obj, esp32_camera_camera_set_ae_level); +MP_PROPERTY_GETSET(esp32_camera_camera_ae_level_obj, + (mp_obj_t)&esp32_camera_camera_get_ae_level_obj, + (mp_obj_t)&esp32_camera_camera_set_ae_level_obj); + +//| dcw: bool +//| """When `True` an advanced white balance mode is selected.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_dcw(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_dcw(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_dcw_obj, esp32_camera_camera_get_dcw); + +STATIC mp_obj_t esp32_camera_camera_set_dcw(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_dcw(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_dcw_obj, esp32_camera_camera_set_dcw); +MP_PROPERTY_GETSET(esp32_camera_camera_dcw_obj, + (mp_obj_t)&esp32_camera_camera_get_dcw_obj, + (mp_obj_t)&esp32_camera_camera_set_dcw_obj); + +//| bpc: bool +//| """When `True`, "black point compensation" is enabled. This can make black parts of the image darker.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_bpc(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_bpc(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_bpc_obj, esp32_camera_camera_get_bpc); + +STATIC mp_obj_t esp32_camera_camera_set_bpc(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_bpc(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_bpc_obj, esp32_camera_camera_set_bpc); +MP_PROPERTY_GETSET(esp32_camera_camera_bpc_obj, + (mp_obj_t)&esp32_camera_camera_get_bpc_obj, + (mp_obj_t)&esp32_camera_camera_set_bpc_obj); + +//| wpc: bool +//| """When `True`, "white point compensation" is enabled. This can make white parts of the image whiter.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_wpc(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_wpc(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_wpc_obj, esp32_camera_camera_get_wpc); + +STATIC mp_obj_t esp32_camera_camera_set_wpc(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_wpc(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_wpc_obj, esp32_camera_camera_set_wpc); +MP_PROPERTY_GETSET(esp32_camera_camera_wpc_obj, + (mp_obj_t)&esp32_camera_camera_get_wpc_obj, + (mp_obj_t)&esp32_camera_camera_set_wpc_obj); + +//| raw_gma: bool +//| """When `True`, raw gamma mode is enabled.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_raw_gma(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_raw_gma(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_raw_gma_obj, esp32_camera_camera_get_raw_gma); + +STATIC mp_obj_t esp32_camera_camera_set_raw_gma(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_raw_gma(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_raw_gma_obj, esp32_camera_camera_set_raw_gma); +MP_PROPERTY_GETSET(esp32_camera_camera_raw_gma_obj, + (mp_obj_t)&esp32_camera_camera_get_raw_gma_obj, + (mp_obj_t)&esp32_camera_camera_set_raw_gma_obj); + +//| lenc: bool +//| """Enable "lens correction". This can help compensate for light fall-off at the edge of the sensor area.""" +//| + +STATIC mp_obj_t esp32_camera_camera_get_lenc(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_lenc(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_lenc_obj, esp32_camera_camera_get_lenc); + +STATIC mp_obj_t esp32_camera_camera_set_lenc(const mp_obj_t self_in, const mp_obj_t arg) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_esp32_camera_camera_set_lenc(self, mp_obj_is_true(arg)); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp32_camera_camera_set_lenc_obj, esp32_camera_camera_set_lenc); +MP_PROPERTY_GETSET(esp32_camera_camera_lenc_obj, + (mp_obj_t)&esp32_camera_camera_get_lenc_obj, + (mp_obj_t)&esp32_camera_camera_set_lenc_obj); + +//| max_frame_size: FrameSize +//| """The maximum frame size that can be captured""" +//| +STATIC mp_obj_t esp32_camera_camera_get_max_frame_size(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return cp_enum_find(&esp32_camera_frame_size_type, common_hal_esp32_camera_camera_get_max_frame_size(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_max_frame_size_obj, esp32_camera_camera_get_max_frame_size); + +MP_PROPERTY_GETTER(esp32_camera_camera_max_frame_size_obj, + (mp_obj_t)&esp32_camera_camera_get_max_frame_size_obj); + + +//| address: int +//| """The I2C (SCCB) address of the sensor""" +//| +STATIC mp_obj_t esp32_camera_camera_get_address(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_address(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_address_obj, esp32_camera_camera_get_address); + +MP_PROPERTY_GETTER(esp32_camera_camera_address_obj, + (mp_obj_t)&esp32_camera_camera_get_address_obj); + + +//| sensor_name: str +//| """The name of the sensor""" +//| +STATIC mp_obj_t esp32_camera_camera_get_sensor_name(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + const char *sensor_name = common_hal_esp32_camera_camera_get_sensor_name(self); + return mp_obj_new_str(sensor_name, strlen(sensor_name)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_sensor_name_obj, esp32_camera_camera_get_sensor_name); + +MP_PROPERTY_GETTER(esp32_camera_camera_sensor_name_obj, + (mp_obj_t)&esp32_camera_camera_get_sensor_name_obj); + + +//| supports_jpeg: bool +//| """True if the sensor can capture images in JPEG format""" +//| +STATIC mp_obj_t esp32_camera_camera_get_supports_jpeg(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return mp_obj_new_bool(common_hal_esp32_camera_camera_get_supports_jpeg(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_supports_jpeg_obj, esp32_camera_camera_get_supports_jpeg); + +MP_PROPERTY_GETTER(esp32_camera_camera_supports_jpeg_obj, + (mp_obj_t)&esp32_camera_camera_get_supports_jpeg_obj); + +//| height: int +//| """The height of the image being captured""" +//| +STATIC mp_obj_t esp32_camera_camera_get_height(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_height(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_height_obj, esp32_camera_camera_get_height); + +MP_PROPERTY_GETTER(esp32_camera_camera_height_obj, + (mp_obj_t)&esp32_camera_camera_get_height_obj); + +//| width: int +//| """The width of the image being captured""" +//| +STATIC mp_obj_t esp32_camera_camera_get_width(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_width(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_width_obj, esp32_camera_camera_get_width); + +MP_PROPERTY_GETTER(esp32_camera_camera_width_obj, + (mp_obj_t)&esp32_camera_camera_get_width_obj); + +//| grab_mode: GrabMode +//| """The grab mode of the camera""" +//| +STATIC mp_obj_t esp32_camera_camera_get_grab_mode(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return cp_enum_find(&esp32_camera_grab_mode_type, common_hal_esp32_camera_camera_get_grab_mode(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_grab_mode_obj, esp32_camera_camera_get_grab_mode); + +MP_PROPERTY_GETTER(esp32_camera_camera_grab_mode_obj, + (mp_obj_t)&esp32_camera_camera_get_grab_mode_obj); + + +//| framebuffer_count: int +//| """True if double buffering is used""" +//| +STATIC mp_obj_t esp32_camera_camera_get_framebuffer_count(const mp_obj_t self_in) { + esp32_camera_camera_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_esp32_camera_camera_get_framebuffer_count(self)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp32_camera_camera_get_framebuffer_count_obj, esp32_camera_camera_get_framebuffer_count); + +MP_PROPERTY_GETTER(esp32_camera_camera_framebuffer_count_obj, + (mp_obj_t)&esp32_camera_camera_get_framebuffer_count_obj); + + +STATIC const mp_rom_map_elem_t esp32_camera_camera_locals_table[] = { + { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&esp32_camera_camera_address_obj) }, + { MP_ROM_QSTR(MP_QSTR_aec2), MP_ROM_PTR(&esp32_camera_camera_aec2_obj) }, + { MP_ROM_QSTR(MP_QSTR_aec_value), MP_ROM_PTR(&esp32_camera_camera_aec_value_obj) }, + { MP_ROM_QSTR(MP_QSTR_ae_level), MP_ROM_PTR(&esp32_camera_camera_ae_level_obj) }, + { MP_ROM_QSTR(MP_QSTR_agc_gain), MP_ROM_PTR(&esp32_camera_camera_agc_gain_obj) }, + { MP_ROM_QSTR(MP_QSTR_awb_gain), MP_ROM_PTR(&esp32_camera_camera_awb_gain_obj) }, + { MP_ROM_QSTR(MP_QSTR_bpc), MP_ROM_PTR(&esp32_camera_camera_bpc_obj) }, + { MP_ROM_QSTR(MP_QSTR_brightness), MP_ROM_PTR(&esp32_camera_camera_brightness_obj) }, + { MP_ROM_QSTR(MP_QSTR_colorbar), MP_ROM_PTR(&esp32_camera_camera_colorbar_obj) }, + { MP_ROM_QSTR(MP_QSTR_contrast), MP_ROM_PTR(&esp32_camera_camera_contrast_obj) }, + { MP_ROM_QSTR(MP_QSTR_dcw), MP_ROM_PTR(&esp32_camera_camera_dcw_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&esp32_camera_camera_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_denoise), MP_ROM_PTR(&esp32_camera_camera_denoise_obj) }, + { MP_ROM_QSTR(MP_QSTR_framebuffer_count), MP_ROM_PTR(&esp32_camera_camera_framebuffer_count_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&mp_identity_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&esp32_camera_camera___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_exposure_ctrl), MP_ROM_PTR(&esp32_camera_camera_exposure_ctrl_obj) }, + { MP_ROM_QSTR(MP_QSTR_frame_available), MP_ROM_PTR(&esp32_camera_camera_frame_available_obj) }, + { MP_ROM_QSTR(MP_QSTR_frame_size), MP_ROM_PTR(&esp32_camera_camera_frame_size_obj) }, + { MP_ROM_QSTR(MP_QSTR_gain_ceiling), MP_ROM_PTR(&esp32_camera_camera_gain_ceiling_obj) }, + { MP_ROM_QSTR(MP_QSTR_gain_ctrl), MP_ROM_PTR(&esp32_camera_camera_gain_ctrl_obj) }, + { MP_ROM_QSTR(MP_QSTR_grab_mode), MP_ROM_PTR(&esp32_camera_camera_grab_mode_obj) }, + { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&esp32_camera_camera_height_obj) }, + { MP_ROM_QSTR(MP_QSTR_hmirror), MP_ROM_PTR(&esp32_camera_camera_hmirror_obj) }, + { MP_ROM_QSTR(MP_QSTR_lenc), MP_ROM_PTR(&esp32_camera_camera_lenc_obj) }, + { MP_ROM_QSTR(MP_QSTR_max_frame_size), MP_ROM_PTR(&esp32_camera_camera_max_frame_size_obj) }, + { MP_ROM_QSTR(MP_QSTR_pixel_format), MP_ROM_PTR(&esp32_camera_camera_pixel_format_obj) }, + { MP_ROM_QSTR(MP_QSTR_quality), MP_ROM_PTR(&esp32_camera_camera_quality_obj) }, + { MP_ROM_QSTR(MP_QSTR_raw_gma), MP_ROM_PTR(&esp32_camera_camera_raw_gma_obj) }, + { MP_ROM_QSTR(MP_QSTR_reconfigure), MP_ROM_PTR(&esp32_camera_camera_reconfigure_obj) }, + { MP_ROM_QSTR(MP_QSTR_saturation), MP_ROM_PTR(&esp32_camera_camera_saturation_obj) }, + { MP_ROM_QSTR(MP_QSTR_sensor_name), MP_ROM_PTR(&esp32_camera_camera_sensor_name_obj) }, + { MP_ROM_QSTR(MP_QSTR_sharpness), MP_ROM_PTR(&esp32_camera_camera_sharpness_obj) }, + { MP_ROM_QSTR(MP_QSTR_special_effect), MP_ROM_PTR(&esp32_camera_camera_special_effect_obj) }, + { MP_ROM_QSTR(MP_QSTR_supports_jpeg), MP_ROM_PTR(&esp32_camera_camera_supports_jpeg_obj) }, + { MP_ROM_QSTR(MP_QSTR_take), MP_ROM_PTR(&esp32_camera_camera_take_obj) }, + { MP_ROM_QSTR(MP_QSTR_vflip), MP_ROM_PTR(&esp32_camera_camera_vflip_obj) }, + { MP_ROM_QSTR(MP_QSTR_wb_mode), MP_ROM_PTR(&esp32_camera_camera_wb_mode_obj) }, + { MP_ROM_QSTR(MP_QSTR_whitebal), MP_ROM_PTR(&esp32_camera_camera_whitebal_obj) }, + { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&esp32_camera_camera_width_obj) }, + { MP_ROM_QSTR(MP_QSTR_wpc), MP_ROM_PTR(&esp32_camera_camera_wpc_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(esp32_camera_camera_locals_dict, esp32_camera_camera_locals_table); + +const mp_obj_type_t esp32_camera_camera_type = { + .base = { &mp_type_type }, + .name = MP_QSTR_Camera, + .make_new = esp32_camera_camera_make_new, + .locals_dict = (mp_obj_t)&esp32_camera_camera_locals_dict, +}; diff --git a/ports/espressif/bindings/esp32_camera/Camera.h b/ports/espressif/bindings/esp32_camera/Camera.h new file mode 100644 index 0000000000..146cd0da05 --- /dev/null +++ b/ports/espressif/bindings/esp32_camera/Camera.h @@ -0,0 +1,116 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "py/enum.h" +#include "py/obj.h" + +#include "esp_camera.h" + +#include "shared-bindings/busio/I2C.h" + +extern const mp_obj_type_t esp32_camera_camera_type; +typedef struct esp32_camera_camera_obj esp32_camera_camera_obj_t; + +extern void common_hal_esp32_camera_camera_construct( + esp32_camera_camera_obj_t *self, + uint8_t data_pins[8], + const mcu_pin_obj_t *external_clock_pin, + const mcu_pin_obj_t *pixel_clock_pin, + const mcu_pin_obj_t *vsync_pin, + const mcu_pin_obj_t *href_pin, + const mcu_pin_obj_t *powerdown_pin, + const mcu_pin_obj_t *reset_pin, + const busio_i2c_obj_t *i2c, + mp_int_t external_clock_frequency, + pixformat_t pixel_format, + framesize_t frame_size, + mp_int_t jpeg_quality, + mp_int_t framebuffer_count, + camera_grab_mode_t grab_mode); + +extern void common_hal_esp32_camera_camera_deinit(esp32_camera_camera_obj_t *self); +extern bool common_hal_esp32_camera_camera_deinited(esp32_camera_camera_obj_t *self); +extern bool common_hal_esp32_camera_camera_available(esp32_camera_camera_obj_t *self); +extern camera_fb_t *common_hal_esp32_camera_camera_take(esp32_camera_camera_obj_t *self, int timeout_ms); +extern void common_hal_esp32_camera_camera_reconfigure(esp32_camera_camera_obj_t *self, framesize_t frame_size, pixformat_t pixel_format, camera_grab_mode_t grab_mode, mp_int_t framebuffer_count); + +#define DECLARE_SENSOR_GETSET(type, name, field_name, setter_function_name) \ + DECLARE_SENSOR_GET(type, name, field_name, setter_function_name) \ + DECLARE_SENSOR_SET(type, name, setter_function_name) + +#define DECLARE_SENSOR_STATUS_GETSET(type, name, status_field_name, setter_function_name) \ + DECLARE_SENSOR_GETSET(type, name, status.status_field_name, setter_function_name) + +#define DECLARE_SENSOR_STATUS_GET(type, name, status_field_name, setter_function_name) \ + DECLARE_SENSOR_GET(type, name, status.status_field_name, setter_function_name) + +#define DECLARE_SENSOR_GET(type, name, status_field_name, setter_function_name) \ + extern type common_hal_esp32_camera_camera_get_##name(esp32_camera_camera_obj_t * self); + +#define DECLARE_SENSOR_SET(type, name, setter_function_name) \ + extern void common_hal_esp32_camera_camera_set_##name(esp32_camera_camera_obj_t * self, type value); + +DECLARE_SENSOR_GET(pixformat_t, pixel_format, pixformat, set_pixformat) +DECLARE_SENSOR_STATUS_GET(framesize_t, frame_size, framesize, set_framesize) +DECLARE_SENSOR_STATUS_GETSET(int, contrast, contrast, set_contrast); +DECLARE_SENSOR_STATUS_GETSET(int, brightness, brightness, set_brightness); +DECLARE_SENSOR_STATUS_GETSET(int, saturation, saturation, set_saturation); +DECLARE_SENSOR_STATUS_GETSET(int, sharpness, sharpness, set_sharpness); +DECLARE_SENSOR_STATUS_GETSET(int, denoise, denoise, set_denoise); +DECLARE_SENSOR_STATUS_GETSET(gainceiling_t, gainceiling, gainceiling, set_gainceiling); +DECLARE_SENSOR_STATUS_GETSET(int, quality, quality, set_quality); +DECLARE_SENSOR_STATUS_GETSET(bool, colorbar, colorbar, set_colorbar); +DECLARE_SENSOR_STATUS_GETSET(bool, whitebal, whitebal, set_whitebal); +DECLARE_SENSOR_STATUS_GETSET(bool, gain_ctrl, gain_ctrl, set_gain_ctrl); +DECLARE_SENSOR_STATUS_GETSET(bool, exposure_ctrl, exposure_ctrl, set_exposure_ctrl); +DECLARE_SENSOR_STATUS_GETSET(bool, hmirror, hmirror, set_hmirror); +DECLARE_SENSOR_STATUS_GETSET(bool, vflip, vflip, set_vflip); +DECLARE_SENSOR_STATUS_GETSET(bool, aec2, aec2, set_aec2); +DECLARE_SENSOR_STATUS_GETSET(bool, awb_gain, awb_gain, set_awb_gain); +DECLARE_SENSOR_STATUS_GETSET(int, agc_gain, agc_gain, set_agc_gain); +DECLARE_SENSOR_STATUS_GETSET(int, aec_value, aec_value, set_aec_value); +DECLARE_SENSOR_STATUS_GETSET(int, special_effect, special_effect, set_special_effect); +DECLARE_SENSOR_STATUS_GETSET(int, wb_mode, wb_mode, set_wb_mode); +DECLARE_SENSOR_STATUS_GETSET(int, ae_level, ae_level, set_ae_level); +DECLARE_SENSOR_STATUS_GETSET(bool, dcw, dcw, set_dcw); +DECLARE_SENSOR_STATUS_GETSET(bool, bpc, bpc, set_bpc); +DECLARE_SENSOR_STATUS_GETSET(bool, wpc, wpc, set_wpc); +DECLARE_SENSOR_STATUS_GETSET(bool, raw_gma, raw_gma, set_raw_gma); +DECLARE_SENSOR_STATUS_GETSET(bool, lenc, lenc, set_lenc); + +// From settings +extern camera_grab_mode_t common_hal_esp32_camera_camera_get_grab_mode(esp32_camera_camera_obj_t *self); +extern int common_hal_esp32_camera_camera_get_framebuffer_count(esp32_camera_camera_obj_t *self); + +// From camera_sensor_info_t +extern int common_hal_esp32_camera_camera_get_address(esp32_camera_camera_obj_t *self); +extern const char *common_hal_esp32_camera_camera_get_sensor_name(esp32_camera_camera_obj_t *self); +extern const bool common_hal_esp32_camera_camera_get_supports_jpeg(esp32_camera_camera_obj_t *self); +extern framesize_t common_hal_esp32_camera_camera_get_max_frame_size(esp32_camera_camera_obj_t *self); +extern int common_hal_esp32_camera_camera_get_width(esp32_camera_camera_obj_t *self); +extern int common_hal_esp32_camera_camera_get_height(esp32_camera_camera_obj_t *self); diff --git a/ports/espressif/bindings/esp32_camera/__init__.c b/ports/espressif/bindings/esp32_camera/__init__.c new file mode 100644 index 0000000000..f1ee4b6891 --- /dev/null +++ b/ports/espressif/bindings/esp32_camera/__init__.c @@ -0,0 +1,287 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "py/obj.h" +#include "py/runtime.h" +#include "py/mphal.h" + +#include "bindings/espidf/__init__.h" +#include "bindings/esp32_camera/__init__.h" +#include "bindings/esp32_camera/Camera.h" + +#include "esp_camera.h" +#include "sensor.h" + +//| """Wrapper for the esp32_camera library +//| +//| This library enables access to any camera sensor supported by the library, +//| including OV5640 and OV2640. +//| +//| .. seealso:: +//| +//| Non-Espressif microcontrollers use the `imagecapture` module together with wrapper libraries such as `adafruit_ov5640 `_. +//| +//| """ + +//| class GrabMode: +//| """Controls when a new frame is grabbed.""" +//| +//| WHEN_EMPTY: GrabMode +//| """Fills buffers when they are empty. Less resources but first ``fb_count`` frames might be old""" +//| +//| LATEST: GrabMode +//| """Except when 1 frame buffer is used, queue will always contain the last ``fb_count`` frames""" +//| + +MAKE_ENUM_VALUE(esp32_camera_grab_mode_type, grab_mode, WHEN_EMPTY, CAMERA_GRAB_WHEN_EMPTY); +MAKE_ENUM_VALUE(esp32_camera_grab_mode_type, grab_mode, LATEST, CAMERA_GRAB_LATEST); + +MAKE_ENUM_MAP(esp32_camera_grab_mode) { + MAKE_ENUM_MAP_ENTRY(grab_mode, WHEN_EMPTY), + MAKE_ENUM_MAP_ENTRY(grab_mode, LATEST), +}; + +STATIC MP_DEFINE_CONST_DICT(esp32_camera_grab_mode_locals_dict, esp32_camera_grab_mode_locals_table); +MAKE_PRINTER(esp32_camera, esp32_camera_grab_mode); +MAKE_ENUM_TYPE(esp32_camera, GrabMode, esp32_camera_grab_mode); + +camera_grab_mode_t validate_grab_mode(mp_obj_t obj, qstr arg_name) { + return cp_enum_value(&esp32_camera_grab_mode_type, mp_arg_validate_type(obj, &esp32_camera_grab_mode_type, arg_name)); +} + +//| class PixelFormat: +//| """Format of data in the captured frames""" +//| +//| RGB565: PixelFormat +//| """A 16-bit format with 5 bits of Red and Blue and 6 bits of Green""" +//| +//| GRAYSCALE: PixelFormat +//| """An 8-bit format with 8-bits of luminance""" +//| +//| JPEG: PixelFormat +//| """A compressed format""" +//| + +MAKE_ENUM_VALUE(esp32_camera_pixel_format_type, pixel_format, RGB565, PIXFORMAT_RGB565); +MAKE_ENUM_VALUE(esp32_camera_pixel_format_type, pixel_format, GRAYSCALE, PIXFORMAT_GRAYSCALE); +MAKE_ENUM_VALUE(esp32_camera_pixel_format_type, pixel_format, JPEG, PIXFORMAT_JPEG); + +MAKE_ENUM_MAP(esp32_camera_pixel_format) { + MAKE_ENUM_MAP_ENTRY(pixel_format, RGB565), + MAKE_ENUM_MAP_ENTRY(pixel_format, GRAYSCALE), + MAKE_ENUM_MAP_ENTRY(pixel_format, JPEG), +}; + +STATIC MP_DEFINE_CONST_DICT(esp32_camera_pixel_format_locals_dict, esp32_camera_pixel_format_locals_table); +MAKE_PRINTER(esp32_camera, esp32_camera_pixel_format); +MAKE_ENUM_TYPE(esp32_camera, PixelFormat, esp32_camera_pixel_format); + +pixformat_t validate_pixel_format(mp_obj_t obj, qstr arg_name) { + return cp_enum_value(&esp32_camera_pixel_format_type, mp_arg_validate_type(obj, &esp32_camera_pixel_format_type, arg_name)); +} + +//| class FrameSize: +//| """The pixel size of the captured frames""" +//| +//| R96X96: FrameSize +//| """96x96""" +//| +//| QQVGA: FrameSize +//| """160x120""" +//| +//| QCIF: FrameSize +//| """176x144""" +//| +//| HQVGA: FrameSize +//| """240x176""" +//| +//| R240X240: FrameSize +//| """240x240""" +//| +//| QVGA: FrameSize +//| """320x240 """ +//| +//| CIF: FrameSize +//| """400x296""" +//| +//| HVGA: FrameSize +//| """480x320""" +//| +//| VGA: FrameSize +//| """640x480""" +//| +//| SVGA: FrameSize +//| """800x600""" +//| +//| XGA: FrameSize +//| """1024x768""" +//| +//| HD: FrameSize +//| """1280x720""" +//| +//| SXGA: FrameSize +//| """1280x1024""" +//| +//| UXGA: FrameSize +//| """1600x1200""" +//| +//| FHD: FrameSize +//| """1920x1080""" +//| +//| P_HD: FrameSize +//| """ 720x1280""" +//| +//| P_3MP: FrameSize +//| """ 864x1536""" +//| +//| QXGA: FrameSize +//| """2048x1536""" +//| +//| QHD: FrameSize +//| """2560x1440""" +//| +//| WQXGA: FrameSize +//| """2560x1600""" +//| +//| P_FHD: FrameSize +//| """1080x1920""" +//| +//| QSXGA: FrameSize +//| """2560x1920""" +//| + +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, R96X96, FRAMESIZE_96X96); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, R240X240, FRAMESIZE_240X240); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QQVGA, FRAMESIZE_QQVGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QCIF, FRAMESIZE_QCIF); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, HQVGA, FRAMESIZE_HQVGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QVGA, FRAMESIZE_QVGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, CIF, FRAMESIZE_CIF); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, HVGA, FRAMESIZE_HVGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, VGA, FRAMESIZE_VGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, SVGA, FRAMESIZE_SVGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, XGA, FRAMESIZE_XGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, HD, FRAMESIZE_HD); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, SXGA, FRAMESIZE_SXGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, UXGA, FRAMESIZE_UXGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, FHD, FRAMESIZE_FHD); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, P_HD, FRAMESIZE_P_HD); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, P_3MP, FRAMESIZE_P_3MP); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QXGA, FRAMESIZE_QXGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QHD, FRAMESIZE_QHD); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, WQXGA, FRAMESIZE_WQXGA); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, P_FHD, FRAMESIZE_P_FHD); +MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QSXGA, FRAMESIZE_QSXGA); +MAKE_ENUM_MAP(esp32_camera_frame_size) { + MAKE_ENUM_MAP_ENTRY(frame_size, R96X96), + MAKE_ENUM_MAP_ENTRY(frame_size, R240X240), + MAKE_ENUM_MAP_ENTRY(frame_size, QQVGA), + MAKE_ENUM_MAP_ENTRY(frame_size, QCIF), + MAKE_ENUM_MAP_ENTRY(frame_size, HQVGA), + MAKE_ENUM_MAP_ENTRY(frame_size, QVGA), + MAKE_ENUM_MAP_ENTRY(frame_size, CIF), + MAKE_ENUM_MAP_ENTRY(frame_size, HVGA), + MAKE_ENUM_MAP_ENTRY(frame_size, VGA), + MAKE_ENUM_MAP_ENTRY(frame_size, SVGA), + MAKE_ENUM_MAP_ENTRY(frame_size, XGA), + MAKE_ENUM_MAP_ENTRY(frame_size, HD), + MAKE_ENUM_MAP_ENTRY(frame_size, SXGA), + MAKE_ENUM_MAP_ENTRY(frame_size, UXGA), + MAKE_ENUM_MAP_ENTRY(frame_size, FHD), + MAKE_ENUM_MAP_ENTRY(frame_size, P_HD), + MAKE_ENUM_MAP_ENTRY(frame_size, P_3MP), + MAKE_ENUM_MAP_ENTRY(frame_size, QXGA), + MAKE_ENUM_MAP_ENTRY(frame_size, QHD), + MAKE_ENUM_MAP_ENTRY(frame_size, WQXGA), + MAKE_ENUM_MAP_ENTRY(frame_size, P_FHD), + MAKE_ENUM_MAP_ENTRY(frame_size, QSXGA), +}; + +STATIC MP_DEFINE_CONST_DICT(esp32_camera_frame_size_locals_dict, esp32_camera_frame_size_locals_table); +MAKE_PRINTER(esp32_camera, esp32_camera_frame_size); +MAKE_ENUM_TYPE(esp32_camera, FrameSize, esp32_camera_frame_size); + +framesize_t validate_frame_size(mp_obj_t obj, qstr arg_name) { + return cp_enum_value(&esp32_camera_frame_size_type, mp_arg_validate_type(obj, &esp32_camera_frame_size_type, arg_name)); +} + +//| class GainCeiling: +//| """The maximum amount of gain applied to raw sensor data. +//| +//| Higher values are useful in darker conditions, but increase image noise.""" +//| +//| GAIN_2X: GainCeiling +//| GAIN_4X: GainCeiling +//| GAIN_8X: GainCeiling +//| GAIN_16X: GainCeiling +//| GAIN_32X: GainCeiling +//| GAIN_64X: GainCeiling +//| GAIN_128X: GainCeiling +//| + +MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_2X, GAINCEILING_2X); +MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_4X, GAINCEILING_4X); +MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_8X, GAINCEILING_8X); +MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_16X, GAINCEILING_16X); +MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_32X, GAINCEILING_32X); +MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_64X, GAINCEILING_64X); +MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_128X, GAINCEILING_128X); + +MAKE_ENUM_MAP(esp32_camera_gain_ceiling) { + MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_2X), + MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_4X), + MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_8X), + MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_16X), + MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_32X), + MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_64X), + MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_128X) +}; + +STATIC MP_DEFINE_CONST_DICT(esp32_camera_gain_ceiling_locals_dict, esp32_camera_gain_ceiling_locals_table); +MAKE_PRINTER(esp32_camera, esp32_camera_gain_ceiling); +MAKE_ENUM_TYPE(esp32_camera, GainCeiling, esp32_camera_gain_ceiling); + +gainceiling_t validate_gain_ceiling(mp_obj_t obj, qstr arg_name) { + return cp_enum_value(&esp32_camera_gain_ceiling_type, mp_arg_validate_type(obj, &esp32_camera_gain_ceiling_type, arg_name)); +} + +STATIC const mp_rom_map_elem_t esp32_camera_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_esp32_camera) }, + { MP_ROM_QSTR(MP_QSTR_Camera), MP_ROM_PTR(&esp32_camera_camera_type), }, + { MP_ROM_QSTR(MP_QSTR_FrameSize), &esp32_camera_frame_size_type }, + { MP_ROM_QSTR(MP_QSTR_GainCeiling), &esp32_camera_gain_ceiling_type }, + { MP_ROM_QSTR(MP_QSTR_GrabMode), &esp32_camera_grab_mode_type }, + { MP_ROM_QSTR(MP_QSTR_PixelFormat), &esp32_camera_pixel_format_type }, +}; + +STATIC MP_DEFINE_CONST_DICT(esp32_camera_module_globals, esp32_camera_module_globals_table); + +const mp_obj_module_t esp32_camera_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&esp32_camera_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_esp32_camera, esp32_camera_module, CIRCUITPY_ESP32_CAMERA); diff --git a/ports/espressif/bindings/esp32_camera/__init__.h b/ports/espressif/bindings/esp32_camera/__init__.h new file mode 100644 index 0000000000..a0e7290ff9 --- /dev/null +++ b/ports/espressif/bindings/esp32_camera/__init__.h @@ -0,0 +1,45 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "py/enum.h" +#include "py/obj.h" + +#include "esp_camera.h" + +extern const mp_obj_type_t esp32_camera_grab_mode_type; +extern const cp_enum_obj_t grab_mode_WHEN_EMPTY_obj; +extern const mp_obj_type_t esp32_camera_pixel_format_type; +extern const cp_enum_obj_t pixel_format_RGB565_obj; +extern const mp_obj_type_t esp32_camera_frame_size_type; +extern const cp_enum_obj_t frame_size_QQVGA_obj; +extern const mp_obj_type_t esp32_camera_gain_ceiling_type; + +extern camera_grab_mode_t validate_grab_mode(mp_obj_t obj, qstr arg_name); +extern pixformat_t validate_pixel_format(mp_obj_t obj, qstr arg_name); +extern framesize_t validate_frame_size(mp_obj_t obj, qstr arg_name); +extern gainceiling_t validate_gain_ceiling(mp_obj_t obj, qstr arg_name); diff --git a/ports/espressif/bindings/espidf/__init__.c b/ports/espressif/bindings/espidf/__init__.c index 4f7da39540..c73e494f6c 100644 --- a/ports/espressif/bindings/espidf/__init__.c +++ b/ports/espressif/bindings/espidf/__init__.c @@ -120,6 +120,20 @@ const mp_obj_type_t mp_type_espidf_MemoryError = { .parent = &mp_type_MemoryError, }; +//| def get_total_psram() -> int: +//| """Returns the number of bytes of psram detected, or 0 if psram is not present or not configured""" +STATIC mp_obj_t espidf_get_total_psram(void) { + return MP_OBJ_NEW_SMALL_INT(common_hal_espidf_get_total_psram()); +} +MP_DEFINE_CONST_FUN_OBJ_0(espidf_get_total_psram_obj, espidf_get_total_psram); + +//| def get_reserved_psram() -> int: +//| """Returns number of bytes of psram reserved for use by esp-idf, either a board-specific default value or the value defined in ``/.env``.""" +STATIC mp_obj_t espidf_get_reserved_psram(void) { + return MP_OBJ_NEW_SMALL_INT(common_hal_espidf_get_reserved_psram()); +} +MP_DEFINE_CONST_FUN_OBJ_0(espidf_get_reserved_psram_obj, espidf_get_reserved_psram); + STATIC const mp_rom_map_elem_t espidf_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_espidf) }, @@ -129,6 +143,8 @@ STATIC const mp_rom_map_elem_t espidf_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_erase_nvs), MP_ROM_PTR(&espidf_erase_nvs_obj)}, + { MP_ROM_QSTR(MP_QSTR_get_total_psram), MP_ROM_PTR(&espidf_get_total_psram_obj)}, + { MP_ROM_QSTR(MP_QSTR_get_reserved_psram), MP_ROM_PTR(&espidf_get_reserved_psram_obj)}, { MP_ROM_QSTR(MP_QSTR_IDFError), MP_ROM_PTR(&mp_type_espidf_IDFError) }, { MP_ROM_QSTR(MP_QSTR_MemoryError), MP_ROM_PTR(&mp_type_espidf_MemoryError) }, }; @@ -139,66 +155,3 @@ const mp_obj_module_t espidf_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&espidf_module_globals, }; - -void raise_esp_error(esp_err_t err) { - const compressed_string_t *msg = NULL; - const mp_obj_type_t *exception_type = &mp_type_espidf_IDFError; - switch (err) { - case ESP_FAIL: - msg = translate("Generic Failure"); - break; - case ESP_ERR_NO_MEM: - exception_type = &mp_type_espidf_MemoryError; - msg = translate("Out of memory"); - break; - case ESP_ERR_INVALID_ARG: - msg = translate("Invalid argument"); - break; - case ESP_ERR_INVALID_STATE: - msg = translate("Invalid state"); - break; - case ESP_ERR_INVALID_SIZE: - msg = translate("Invalid size"); - break; - case ESP_ERR_NOT_FOUND: - msg = translate("Requested resource not found"); - break; - case ESP_ERR_NOT_SUPPORTED: - msg = translate("Operation or feature not supported"); - break; - case ESP_ERR_TIMEOUT: - msg = translate("Operation timed out"); - break; - case ESP_ERR_INVALID_RESPONSE: - msg = translate("Received response was invalid"); - break; - case ESP_ERR_INVALID_CRC: - msg = translate("CRC or checksum was invalid"); - break; - case ESP_ERR_INVALID_VERSION: - msg = translate("Version was invalid"); - break; - case ESP_ERR_INVALID_MAC: - msg = translate("MAC address was invalid"); - break; - } - if (msg) { - mp_raise_msg(exception_type, msg); - } - - const char *group = "ESP-IDF"; - - // tests must be in descending order - MP_STATIC_ASSERT(ESP_ERR_FLASH_BASE > ESP_ERR_MESH_BASE); - MP_STATIC_ASSERT(ESP_ERR_MESH_BASE > ESP_ERR_WIFI_BASE); - if (err >= ESP_ERR_FLASH_BASE) { - group = "Flash"; - } else if (err >= ESP_ERR_MESH_BASE) { - group = "Mesh"; - } else if (err >= ESP_ERR_WIFI_BASE) { - group = "WiFi"; - } - mp_raise_msg_varg(exception_type, translate("%s error 0x%x"), group, err); -} - -MP_REGISTER_MODULE(MP_QSTR_espidf, espidf_module, CIRCUITPY_ESPIDF); diff --git a/ports/espressif/bindings/espidf/__init__.h b/ports/espressif/bindings/espidf/__init__.h index 5891d2c5c0..e091a5c477 100644 --- a/ports/espressif/bindings/espidf/__init__.h +++ b/ports/espressif/bindings/espidf/__init__.h @@ -39,4 +39,11 @@ NORETURN void mp_raise_espidf_MemoryError(void); void raise_esp_error(esp_err_t err) NORETURN; #define CHECK_ESP_RESULT(x) do { int res = (x); if (res != ESP_OK) raise_esp_error(res); } while (0) +void common_hal_espidf_reserve_psram(void); +bool common_hal_espidf_set_reserved_psram(size_t amount); +size_t common_hal_espidf_get_reserved_psram(void); +size_t common_hal_espidf_get_total_psram(void); +intptr_t common_hal_espidf_get_psram_start(void); +intptr_t common_hal_espidf_get_psram_end(void); + #endif // MICROPY_INCLUDED_ESPRESSIF_BINDINGS_ESPIDF___INIT___H diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/board.c b/ports/espressif/boards/adafruit_esp32s2_camera/board.c index 109e9b4b9a..280f2b14b8 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/board.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/board.c @@ -56,16 +56,13 @@ void board_init(void) { bus->base.type = &displayio_fourwire_type; common_hal_displayio_fourwire_construct(bus, spi, - &pin_GPIO39, // TFT_DC Command or data - &pin_GPIO40, // TFT_CS Chip select - &pin_GPIO41, // TFT_RESET Reset + &pin_GPIO40, // TFT_DC Command or data + &pin_GPIO39, // TFT_CS Chip select + &pin_GPIO38, // TFT_RESET Reset 40000000, // Baudrate 0, // Polarity 0); // Phase - // workaround as board_init() is called before reset_port() in main.c - pwmout_reset(); - displayio_display_obj_t *display = &displays[0].display; display->base.type = &displayio_display_type; common_hal_displayio_display_construct( @@ -87,25 +84,20 @@ void board_init(void) { MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command display_init_sequence, sizeof(display_init_sequence), - &pin_GPIO38, // backlight pin + &pin_GPIO41, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { + false, // not SH1107 + 50000); // backlight pwm frequency } void board_deinit(void) { common_hal_displayio_release_displays(); } + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h index 793b675784..64ab1b966d 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.h @@ -30,7 +30,9 @@ #define MICROPY_HW_MCU_NAME "ESP32S2" #define MICROPY_HW_NEOPIXEL (&pin_GPIO21) -#define MICROPY_HW_NEOPIXEL_COUNT (6) +#define MICROPY_HW_NEOPIXEL_COUNT (1) + +#define MICROPY_HW_LED_STATUS (&pin_GPIO1) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO34) diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk index d99a431599..6b351c772b 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_esp32s2_camera/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c index 688a555b02..5de2d800aa 100644 --- a/ports/espressif/boards/adafruit_esp32s2_camera/pins.c +++ b/ports/espressif/boards/adafruit_esp32s2_camera/pins.c @@ -24,13 +24,12 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, - { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_GPIO38) }, - { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_GPIO39) }, - { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO40) }, - { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_GPIO38) }, - { MP_ROM_QSTR(MP_QSTR_CARD_CS), MP_ROM_PTR(&pin_GPIO4) }, - { MP_ROM_QSTR(MP_QSTR_CARD_POWER), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_CARD_CS), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_IRQ), MP_ROM_PTR(&pin_GPIO3) }, @@ -39,7 +38,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_GPIO45) }, { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/board.c b/ports/espressif/boards/adafruit_feather_esp32_v2/board.c new file mode 100644 index 0000000000..78341beb3b --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/board.c @@ -0,0 +1,45 @@ +/* + * 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" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +bool espressif_board_reset_pin_number(gpio_num_t pin_number) { + if (pin_number == 2) { + // Turn on NeoPixel and I2C power by default. + gpio_set_direction(pin_number, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(pin_number, true); + return true; + } + + return false; +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h new file mode 100644 index 0000000000..fc478ef005 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h @@ -0,0 +1,54 @@ +/* + * 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 "Adafruit Feather ESP32 V2" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO0) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO2) + +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO20, .sda = &pin_GPIO22}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO5, .mosi = &pin_GPIO19, .miso = &pin_GPIO21}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO8, .rx = &pin_GPIO7}} + +// For entering safe mode, use SW38 button +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO38) + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing SW38 button at start up.\n") + +// 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/adafruit_feather_esp32_v2/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk new file mode 100644 index 0000000000..21a87a9456 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.mk @@ -0,0 +1,15 @@ +CIRCUITPY_CREATOR_ID = 0x0000239A +CIRCUITPY_CREATION_ID = 0x00320001 + +IDF_TARGET = esp32 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/adafruit_feather_esp32_v2/pins.c b/ports/espressif/boards/adafruit_feather_esp32_v2/pins.c new file mode 100644 index 0000000000..43cca6a7af --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/pins.c @@ -0,0 +1,86 @@ +#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, left side, then right side + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SW38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_I2C_POWER), MP_ROM_PTR(&pin_GPIO2) }, + + { 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/adafruit_feather_esp32_v2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig new file mode 100644 index 0000000000..c09d8c409a --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32_v2/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32_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 +CONFIG_SPIRAM_SPEED_40M=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 + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### # CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=8 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=7 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/board.c b/ports/espressif/boards/adafruit_feather_esp32s2/board.c index f9e88c097e..f701d18442 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2/board.c @@ -35,10 +35,6 @@ void board_init(void) { reset_board(); } -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { // Turn on I2C power by default. @@ -53,5 +49,4 @@ void reset_board(void) { gpio_set_level(7, !restlevel); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h index 0be1357939..4e7da01b5a 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.h @@ -32,6 +32,8 @@ #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) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk index 3f2fee9cf4..6af258b3d0 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/adafruit_feather_esp32s2/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32s2/sdkconfig index f19afafa3d..37fd534249 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2/sdkconfig +++ b/ports/espressif/boards/adafruit_feather_esp32s2/sdkconfig @@ -1,3 +1,9 @@ +# +# Component config +# +# +# ESP32S2-specific +# CONFIG_ESP32S2_SPIRAM_SUPPORT=y # # SPI RAM config @@ -7,12 +13,10 @@ 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_CLK_IO=30 CONFIG_DEFAULT_PSRAM_CS_IO=26 # end of PSRAM clock and cs IO for ESP32S2 @@ -30,8 +34,14 @@ CONFIG_SPIRAM_USE_MEMMAP=y # CONFIG_SPIRAM_USE_MALLOC is not set CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config + +# end of ESP32S2-specific + # # LWIP # CONFIG_LWIP_LOCAL_HOSTNAME="espressif" # end of LWIP + +# end of Component config diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c b/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c index 74187899ef..9a57765ef0 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tft/board.c @@ -89,7 +89,7 @@ void board_init(void) { display->base.type = &displayio_display_type; // workaround as board_init() is called before reset_port() in main.c - pwmout_reset(); +/// pwmout_reset(); common_hal_displayio_display_construct( display, @@ -112,21 +112,15 @@ void board_init(void) { sizeof(display_init_sequence), &pin_GPIO45, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - false, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); - - common_hal_never_reset_pin(&pin_GPIO45); // backlight pin -} - -bool board_requests_safe_mode(void) { - return false; } bool espressif_board_reset_pin_number(gpio_num_t pin_number) { @@ -140,9 +134,6 @@ bool espressif_board_reset_pin_number(gpio_num_t pin_number) { return false; } -void reset_board(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. -void board_deinit(void) { - // TODO: Should we turn off the display when asleep? -} +// TODO: Should we turn off the display when asleep, in board_deinit()? diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h index bafb280014..e9eb3326ea 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.h @@ -32,6 +32,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO33) #define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO34) +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO41) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO42) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk index 0f099f8b22..870c2aa3d0 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tft/mpconfigboard.mk @@ -13,8 +13,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c index 71b381616f..e0edec2fa2 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c @@ -94,24 +94,15 @@ void board_init(void) { sizeof(display_init_sequence), &pin_GPIO7, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 + false, // not SH1107 + 50000); // backlight pwm frequency */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h index 6cbe314f42..b4034568c0 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h @@ -32,6 +32,8 @@ #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) diff --git a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk index 01657b7ffd..65f13f5b02 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk @@ -12,13 +12,11 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/board.c b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/board.c new file mode 100644 index 0000000000..983d62a911 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/board.c @@ -0,0 +1,45 @@ +/* + * 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" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +void board_init(void) { + reset_board(); +} + +void reset_board(void) { + // Turn on I2C power by default. + + gpio_set_direction(7, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(7, true); +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/shared-bindings/gamepadshift/GamePadShift.h b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h similarity index 63% rename from shared-bindings/gamepadshift/GamePadShift.h rename to ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h index 8856e133ac..ecaa13a344 100644 --- a/shared-bindings/gamepadshift/GamePadShift.h +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries + * 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 @@ -24,19 +24,24 @@ * THE SOFTWARE. */ +// Micropython setup -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT_GAMEPADSHIFT_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT_GAMEPADSHIFT_H +#define MICROPY_HW_BOARD_NAME "Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM" +#define MICROPY_HW_MCU_NAME "ESP32S3" -#include "shared-module/gamepadshift/GamePadShift.h" +#define MICROPY_HW_NEOPIXEL (&pin_GPIO33) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO21) -extern const mp_obj_type_t gamepadshift_type; +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) -void common_hal_gamepadshift_gamepadshift_init(gamepadshift_obj_t *gamepadshift, - digitalio_digitalinout_obj_t *clock_pin, - digitalio_digitalinout_obj_t *data_pin, - digitalio_digitalinout_obj_t *latch_pin); +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO4) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO3) -void common_hal_gamepadshift_gamepadshift_deinit(gamepadshift_obj_t *gamepadshift); +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT_GAMEPADSHIFT_H +#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/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk new file mode 100644 index 0000000000..b8bea2c02c --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x239A +USB_PID = 0x811C +USB_PRODUCT = "Adafruit Feather ESP32S3 4MB Flash 2MB PSRAM" +USB_MANUFACTURER = "Adafruit" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB + +OPTIMIZATION_FLAGS = -Os +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/pins.c b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/pins.c new file mode 100644 index 0000000000..cf4c915e7f --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/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/adafruit_feather_esp32s3_4mbflash_2mbpsram/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/sdkconfig new file mode 100644 index 0000000000..9a05ab0205 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/sdkconfig @@ -0,0 +1,47 @@ +# +# Component config +# +# +# ESP32S3-Specific +# +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_QUAD=y +# CONFIG_SPIRAM_MODE_OCT is not set +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=2097152 +# +# 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/adafruit_feather_esp32s3_nopsram/board.c b/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/board.c index d4d55c2e23..983d62a911 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/board.c @@ -35,10 +35,6 @@ void board_init(void) { reset_board(); } -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { // Turn on I2C power by default. @@ -46,5 +42,4 @@ void reset_board(void) { gpio_set_level(7, true); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.h index b6477c766b..e089c5c251 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.h @@ -32,6 +32,8 @@ #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) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.mk index 7c768eb51c..a11683b0fe 100644 --- a/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.mk @@ -12,6 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c b/ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c new file mode 100644 index 0000000000..7e28aafb8e --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/board.c @@ -0,0 +1,136 @@ +/* + * 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/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/board/__init__.h" + +displayio_fourwire_obj_t board_display_obj; + +#define DELAY 0x80 + +// display init sequence according to LilyGO example app +uint8_t display_init_sequence[] = { + // sw reset + 0x01, 0 | DELAY, 150, + // sleep out + 0x11, 0 | DELAY, 255, + // normal display mode on + 0x13, 0, + // display and color format settings + 0x36, 1, 0x68, + 0xB6, 2, 0x0A, 0x82, + 0x3A, 1 | DELAY, 0x55, 10, + // ST7789V frame rate setting + 0xB2, 5, 0x0C, 0x0C, 0x00, 0x33, 0x33, + // voltages: VGH / VGL + 0xB7, 1, 0x35, + // ST7789V power setting + 0xBB, 1, 0x28, + 0xC0, 1, 0x0C, + 0xC2, 2, 0x01, 0xFF, + 0xC3, 1, 0x10, + 0xC4, 1, 0x20, + 0xC6, 1, 0x0F, + 0xD0, 2, 0xA4, 0xA1, + // ST7789V gamma setting + 0xE0, 14, 0xD0, 0x00, 0x02, 0x07, 0x0A, 0x28, 0x32, 0x44, 0x42, 0x06, 0x0E, 0x12, 0x14, 0x17, + 0xE1, 14, 0xD0, 0x00, 0x02, 0x07, 0x0A, 0x28, 0x31, 0x54, 0x47, 0x0E, 0x1C, 0x17, 0x1B, 0x1E, + 0x21, 0, + // display on + 0x29, 0 | DELAY, 255, +}; + + +void board_init(void) { + busio_spi_obj_t *spi = common_hal_board_create_spi(0); + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + + common_hal_displayio_fourwire_construct( + bus, + spi, + &pin_GPIO39, // DC + &pin_GPIO7, // CS + &pin_GPIO40, // RST + 40000000, // baudrate + 0, // polarity + 0 // phase + ); + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + + common_hal_displayio_display_construct( + display, + bus, + 240, // width (after rotation) + 135, // height (after rotation) + 40, // column start + 53, // row start + 0, // rotation + 16, // color depth + false, // grayscale + false, // pixels in a byte share a row. Only valid for depths < 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 + MIPI_COMMAND_SET_COLUMN_ADDRESS, // set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // set row command + MIPI_COMMAND_WRITE_MEMORY_START, // write memory command + display_init_sequence, + sizeof(display_init_sequence), + &pin_GPIO45, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + true, // backlight_on_high + false, // SH1107_addressing + 50000 // backlight pwm frequency + ); +} + +bool espressif_board_reset_pin_number(gpio_num_t pin_number) { + // Override the I2C/TFT power pin reset to prevent resetting the display. + if (pin_number == 21) { + // Turn on TFT and I2C + gpio_set_direction(21, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(21, true); + return true; + } + return false; +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. + +// TODO: Should we turn off the display when asleep, in board_deinit() ? diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.h new file mode 100644 index 0000000000..0bc80a884e --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/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 "Adafruit Feather ESP32-S3 TFT" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO33) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO34) + +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO41) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO42) + +#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_GPIO2) +#define DEFAULT_UART_BUS_TX (&pin_GPIO1) + +#define DOUBLE_TAP_PIN (&pin_GPIO38) diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk new file mode 100644 index 0000000000..380423ba10 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.mk @@ -0,0 +1,21 @@ +USB_VID = 0x239A +USB_PID = 0x811E + +USB_PRODUCT = "Feather ESP32-S3 TFT" +USB_MANUFACTURER = "Adafruit" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB + +OPTIMIZATION_FLAGS = -Os +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/adafruit_feather_esp32s3_tft/pins.c b/ports/espressif/boards/adafruit_feather_esp32s3_tft/pins.c new file mode 100644 index 0000000000..fb2f898a18 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/pins.c @@ -0,0 +1,78 @@ +#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_TX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + + { 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_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_A5), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { 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), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_TFT_I2C_POWER), MP_ROM_PTR(&pin_GPIO21) }, + + { 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_SCL), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_TFT_DC), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_GPIO45) }, + + { 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_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_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/adafruit_feather_esp32s3_tft/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32s3_tft/sdkconfig new file mode 100644 index 0000000000..9a05ab0205 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_esp32s3_tft/sdkconfig @@ -0,0 +1,47 @@ +# +# Component config +# +# +# ESP32S3-Specific +# +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_QUAD=y +# CONFIG_SPIRAM_MODE_OCT is not set +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=2097152 +# +# 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/adafruit_feather_huzzah32/board.c b/ports/espressif/boards/adafruit_feather_huzzah32/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_huzzah32/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/adafruit_feather_huzzah32/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_huzzah32/mpconfigboard.h new file mode 100644 index 0000000000..0c481d6a4b --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_huzzah32/mpconfigboard.h @@ -0,0 +1,45 @@ +/* + * 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 "Adafruit Feather HUZZAH32" +#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_GPIO22, .sda = &pin_GPIO23}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO5, .mosi = &pin_GPIO18, .miso = &pin_GPIO19}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO17, .rx = &pin_GPIO16}} + +// 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/adafruit_feather_huzzah32/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_huzzah32/mpconfigboard.mk new file mode 100644 index 0000000000..c0052158b3 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_huzzah32/mpconfigboard.mk @@ -0,0 +1,16 @@ +CIRCUITPY_CREATOR_ID = 0x0000239A +CIRCUITPY_CREATION_ID = 0x00320002 + +IDF_TARGET = esp32 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/adafruit_feather_huzzah32/pins.c b/ports/espressif/boards/adafruit_feather_huzzah32/pins.c new file mode 100644 index 0000000000..2d96457aad --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_huzzah32/pins.c @@ -0,0 +1,79 @@ +#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, left side, then right side + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { 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_A12), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_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/adafruit_feather_huzzah32/sdkconfig b/ports/espressif/boards/adafruit_feather_huzzah32/sdkconfig new file mode 100644 index 0000000000..6c0168c829 --- /dev/null +++ b/ports/espressif/boards/adafruit_feather_huzzah32/sdkconfig @@ -0,0 +1,20 @@ +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +CONFIG_ESP32_SPIRAM_SUPPORT=n + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=17 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=16 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings diff --git a/ports/espressif/boards/adafruit_funhouse/board.c b/ports/espressif/boards/adafruit_funhouse/board.c index 03e967148c..d89a4db268 100644 --- a/ports/espressif/boards/adafruit_funhouse/board.c +++ b/ports/espressif/boards/adafruit_funhouse/board.c @@ -71,9 +71,6 @@ void board_init(void) { 0, // Polarity 0); // Phase - // workaround as board_init() is called before reset_port() in main.c - pwmout_reset(); - displayio_display_obj_t *display = &displays[0].display; display->base.type = &displayio_display_type; common_hal_displayio_display_construct( @@ -97,23 +94,18 @@ void board_init(void) { sizeof(display_init_sequence), &pin_GPIO21, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { + false, // not SH1107 + 50000); // backlight pwm frequency } void board_deinit(void) { common_hal_displayio_release_displays(); } + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.h b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.h index a6f46af978..2b2438432e 100644 --- a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.h @@ -33,6 +33,8 @@ #define MICROPY_HW_APA102_SCK (&pin_GPIO15) #define MICROPY_HW_APA102_COUNT (5) +#define MICROPY_HW_LED_STATUS (&pin_GPIO37) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO33) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO34) diff --git a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk index fb7b969b80..4962806178 100644 --- a/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk @@ -12,11 +12,11 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP32_CAMERA = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase diff --git a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c index 18dd280cea..0c85922524 100644 --- a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c @@ -164,14 +164,6 @@ void board_init(void) { false); // two_byte_sequence_length } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - bool espressif_board_reset_pin_number(gpio_num_t pin_number) { // Pin 16 is speaker enable and it's pulled down on the board. We don't want // to pull it high because then we'll compete with the external pull down. @@ -188,6 +180,10 @@ bool espressif_board_reset_pin_number(gpio_num_t pin_number) { gpio_config(&cfg); return true; } + // Pin 4 is used for voltage monitoring, so don't reset + if (pin_number == 4) { + return true; + } return false; } @@ -205,3 +201,5 @@ void board_deinit(void) { } common_hal_displayio_release_displays(); } + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h index 9f08ca330c..2892110f6e 100644 --- a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h @@ -34,6 +34,8 @@ #define CIRCUITPY_STATUS_LED_POWER_INVERTED (1) #define MICROPY_HW_NEOPIXEL_COUNT (4) +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO34) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) diff --git a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk index 3091d298e9..2df1532535 100644 --- a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk @@ -12,11 +12,11 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP32_CAMERA = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_PortalBase diff --git a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/pins.c b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/pins.c index 2aa2b11b06..1df28f8e05 100644 --- a/ports/espressif/boards/adafruit_magtag_2.9_grayscale/pins.c +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/pins.c @@ -37,6 +37,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_BUTTON_D), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, diff --git a/ports/espressif/boards/adafruit_metro_esp32s2/board.c b/ports/espressif/boards/adafruit_metro_esp32s2/board.c index 6772768da5..164430c88c 100644 --- a/ports/espressif/boards/adafruit_metro_esp32s2/board.c +++ b/ports/espressif/boards/adafruit_metro_esp32s2/board.c @@ -25,19 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h index 3d9250bec1..698dc20764 100644 --- a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h @@ -31,6 +31,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO45) +#define MICROPY_HW_LED_STATUS (&pin_GPIO42) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO34) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) diff --git a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk index a7204b957d..a0e7bfe6fc 100644 --- a/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/adafruit_qtpy_esp32_pico/board.c b/ports/espressif/boards/adafruit_qtpy_esp32_pico/board.c new file mode 100644 index 0000000000..b714fd41f0 --- /dev/null +++ b/ports/espressif/boards/adafruit_qtpy_esp32_pico/board.c @@ -0,0 +1,50 @@ +/* + * 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" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +void board_init(void) { + reset_board(); +} + +void reset_board(void) { + // Turn on NeoPixel power by default. + gpio_set_direction(8, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(8, true); +} + +void board_deinit(void) { + // Turn off NeoPixel + gpio_set_direction(8, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(8, false); +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h b/ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h new file mode 100644 index 0000000000..42a575aa68 --- /dev/null +++ b/ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h @@ -0,0 +1,49 @@ +/* + * 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. + */ + +#define MICROPY_HW_BOARD_NAME "Adafruit QT Py ESP32 PICO" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO5) + +#define CIRCUITPY_BOARD_I2C (2) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO33, .sda = &pin_GPIO4}, \ + {.scl = &pin_GPIO19, .sda = &pin_GPIO22}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO14, .mosi = &pin_GPIO13, .miso = &pin_GPIO12}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO32, .rx = &pin_GPIO7}} + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing BOOT button at start up.\n") + +// 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/adafruit_qtpy_esp32_pico/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.mk new file mode 100644 index 0000000000..5b14bad0dc --- /dev/null +++ b/ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.mk @@ -0,0 +1,15 @@ +CIRCUITPY_CREATOR_ID = 0x0000239A +CIRCUITPY_CREATION_ID = 0x00320003 + +IDF_TARGET = esp32 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/adafruit_qtpy_esp32_pico/pins.c b/ports/espressif/boards/adafruit_qtpy_esp32_pico/pins.c new file mode 100644 index 0000000000..5d760603c1 --- /dev/null +++ b/ports/espressif/boards/adafruit_qtpy_esp32_pico/pins.c @@ -0,0 +1,63 @@ +#include "shared-bindings/board/__init__.h" + +CIRCUITPY_BOARD_BUS_SINGLETON(stemma_i2c, i2c, 1) + +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_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_stemma_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/adafruit_qtpy_esp32_pico/sdkconfig b/ports/espressif/boards/adafruit_qtpy_esp32_pico/sdkconfig new file mode 100644 index 0000000000..bec9e436b7 --- /dev/null +++ b/ports/espressif/boards/adafruit_qtpy_esp32_pico/sdkconfig @@ -0,0 +1,45 @@ +# +# 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 +CONFIG_SPIRAM_SPEED_40M=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 + +# +# SPI RAM config +# +CONFIG_ESP32_SPIRAM_SUPPORT=y +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set + +### # Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### # CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=32 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=7 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings diff --git a/ports/espressif/boards/adafruit_qtpy_esp32c3/board.c b/ports/espressif/boards/adafruit_qtpy_esp32c3/board.c index 7a9ff98fcb..e29b6b93e7 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32c3/board.c +++ b/ports/espressif/boards/adafruit_qtpy_esp32c3/board.c @@ -25,25 +25,6 @@ * THE SOFTWARE. */ -#include "shared-bindings/microcontroller/Pin.h" #include "supervisor/board.h" -#include "components/driver/include/driver/gpio.h" -#include "soc/usb_serial_jtag_struct.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -bool espressif_board_reset_pin_number(gpio_num_t pin_number) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.mk index 36d9c3b5d6..6ca93a9fd4 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32c3/mpconfigboard.mk @@ -1,10 +1,10 @@ CIRCUITPY_CREATOR_ID = 0x0000239A -CIRCUITPY_CREATION_ID = 0x00010001 +CIRCUITPY_CREATION_ID = 0x00c30001 IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/adafruit_qtpy_esp32c3/pins.c b/ports/espressif/boards/adafruit_qtpy_esp32c3/pins.c index 0eb3ddecd2..e13275e1d2 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32c3/pins.c +++ b/ports/espressif/boards/adafruit_qtpy_esp32c3/pins.c @@ -27,8 +27,6 @@ #include "shared-bindings/board/__init__.h" -#include "shared-bindings/board/__init__.h" - CIRCUITPY_BOARD_BUS_SINGLETON(stemma_i2c, i2c, 1) STATIC const mp_rom_map_elem_t board_module_globals_table[] = { diff --git a/ports/espressif/boards/adafruit_qtpy_esp32c3/sdkconfig b/ports/espressif/boards/adafruit_qtpy_esp32c3/sdkconfig index f9b0292400..5111900c7e 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32c3/sdkconfig +++ b/ports/espressif/boards/adafruit_qtpy_esp32c3/sdkconfig @@ -30,6 +30,14 @@ CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-4MB-no-uf2.csv" # # Component config # +# + +# +# PHY +# +CONFIG_ESP_PHY_ENABLE_USB=y +# end of PHY + # # ESP System Settings # diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s2/board.c b/ports/espressif/boards/adafruit_qtpy_esp32s2/board.c index 6772768da5..164430c88c 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s2/board.c +++ b/ports/espressif/boards/adafruit_qtpy_esp32s2/board.c @@ -25,19 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk index d415e140cb..44c33310cc 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32s2/mpconfigboard.mk @@ -13,8 +13,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/board.c b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/board.c index ff9418ec86..3b1f5efd87 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/board.c +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h index 24aa81fb79..f6e51ea583 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.h @@ -29,15 +29,15 @@ #define MICROPY_HW_BOARD_NAME "Adafruit QT Py ESP32-S3 no psram" #define MICROPY_HW_MCU_NAME "ESP32S3" -#define MICROPY_HW_NEOPIXEL (&pin_GPIO38) -#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO37) +#define MICROPY_HW_NEOPIXEL (&pin_GPIO39) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO38) #define CIRCUITPY_BOARD_I2C (2) #define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO6, .sda = &pin_GPIO7}, \ {.scl = &pin_GPIO40, .sda = &pin_GPIO41}} #define CIRCUITPY_BOARD_SPI (1) -#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO35, .mosi = &pin_GPIO34, .miso = &pin_GPIO36}} +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO36, .mosi = &pin_GPIO35, .miso = &pin_GPIO37}} #define CIRCUITPY_BOARD_UART (1) #define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO5, .rx = &pin_GPIO16}} diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk index 1156b1b915..e31f7bd226 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/mpconfigboard.mk @@ -13,11 +13,11 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c index c0386232a8..5d0a3c0baa 100644 --- a/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c +++ b/ports/espressif/boards/adafruit_qtpy_esp32s3_nopsram/pins.c @@ -36,17 +36,17 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO34) }, - { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) }, - - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO35) }, + { 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_MISO), MP_ROM_PTR(&pin_GPIO36) }, + { 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_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO37) }, - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO38) }, + { 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_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO39) }, { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO40) }, { MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO40) }, diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/board.c b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/board.c index 7dd29fd6f6..2e09e7d9a4 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/board.c +++ b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/board.c @@ -43,10 +43,6 @@ void board_init(void) { USB_SERIAL_JTAG.conf0.dp_pullup = 0; } -bool board_requests_safe_mode(void) { - return false; -} - bool espressif_board_reset_pin_number(gpio_num_t pin_number) { // Pull LEDs down on reset rather than the default up if (pin_number == 3 || pin_number == 4 || pin_number == 5 || pin_number == 18 || pin_number == 19) { @@ -63,8 +59,4 @@ bool espressif_board_reset_pin_number(gpio_num_t pin_number) { return false; } -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h index d7a81502fa..a42f8b0436 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h +++ b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.h @@ -37,5 +37,5 @@ #define DEFAULT_UART_BUS_TX (&pin_GPIO21) // Serial over UART -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.mk b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.mk index 6d7a58ea5c..125666b599 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.mk +++ b/ports/espressif/boards/ai_thinker_esp32-c3s-2m/mpconfigboard.mk @@ -5,6 +5,6 @@ IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=2MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 2MB diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s/board.c b/ports/espressif/boards/ai_thinker_esp32-c3s/board.c index 7dd29fd6f6..2e09e7d9a4 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s/board.c +++ b/ports/espressif/boards/ai_thinker_esp32-c3s/board.c @@ -43,10 +43,6 @@ void board_init(void) { USB_SERIAL_JTAG.conf0.dp_pullup = 0; } -bool board_requests_safe_mode(void) { - return false; -} - bool espressif_board_reset_pin_number(gpio_num_t pin_number) { // Pull LEDs down on reset rather than the default up if (pin_number == 3 || pin_number == 4 || pin_number == 5 || pin_number == 18 || pin_number == 19) { @@ -63,8 +59,4 @@ bool espressif_board_reset_pin_number(gpio_num_t pin_number) { return false; } -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h b/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h index 0b8a3b0ae8..20fb1ff022 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h +++ b/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h @@ -37,5 +37,5 @@ #define DEFAULT_UART_BUS_TX (&pin_GPIO21) // Serial over UART -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.mk b/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.mk index 3a83ab500b..eb88c5caab 100644 --- a/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.mk +++ b/ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.mk @@ -5,6 +5,6 @@ IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/board.c b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/board.c +++ b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk index 1883b1fbfa..de0fc66b9d 100644 --- a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk +++ b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/artisense_rd00/board.c b/ports/espressif/boards/artisense_rd00/board.c index ea363f6b54..fb3f6befc9 100644 --- a/ports/espressif/boards/artisense_rd00/board.c +++ b/ports/espressif/boards/artisense_rd00/board.c @@ -39,14 +39,3 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO15); common_hal_never_reset_pin(&pin_GPIO16); } - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} diff --git a/ports/espressif/boards/artisense_rd00/mpconfigboard.mk b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk index 1f9d037ef2..b617b33fac 100644 --- a/ports/espressif/boards/artisense_rd00/mpconfigboard.mk +++ b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/atmegazero_esp32s2/board.c b/ports/espressif/boards/atmegazero_esp32s2/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/atmegazero_esp32s2/board.c +++ b/ports/espressif/boards/atmegazero_esp32s2/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk b/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk index 79246b1393..453591d3f8 100644 --- a/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk +++ b/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 16MB diff --git a/ports/espressif/boards/beetle-esp32-c3/README.md b/ports/espressif/boards/beetle-esp32-c3/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/espressif/boards/beetle-esp32-c3/board.c b/ports/espressif/boards/beetle-esp32-c3/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/beetle-esp32-c3/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/beetle-esp32-c3/mpconfigboard.h b/ports/espressif/boards/beetle-esp32-c3/mpconfigboard.h new file mode 100644 index 0000000000..3b1caff2e9 --- /dev/null +++ b/ports/espressif/boards/beetle-esp32-c3/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. + */ + +// Board setup + +#define MICROPY_HW_BOARD_NAME "DFRobot Beetle ESP32-C3" +#define MICROPY_HW_MCU_NAME "ESP32-C3FN4" + +// Status LED +#define MICROPY_HW_LED_STATUS (&pin_GPIO10) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO9, .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}} + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/beetle-esp32-c3/mpconfigboard.mk b/ports/espressif/boards/beetle-esp32-c3/mpconfigboard.mk new file mode 100644 index 0000000000..c76ee76120 --- /dev/null +++ b/ports/espressif/boards/beetle-esp32-c3/mpconfigboard.mk @@ -0,0 +1,11 @@ +# TODO +CIRCUITPY_CREATOR_ID = 0x10101010 +CIRCUITPY_CREATION_ID = 0x00C30001 + +IDF_TARGET = esp32c3 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_ESP_FLASH_MODE=qio +CIRCUITPY_ESP_FLASH_FREQ=80m +CIRCUITPY_ESP_FLASH_SIZE=4MB diff --git a/ports/espressif/boards/beetle-esp32-c3/pins.c b/ports/espressif/boards/beetle-esp32-c3/pins.c new file mode 100644 index 0000000000..f9060cc306 --- /dev/null +++ b/ports/espressif/boards/beetle-esp32-c3/pins.c @@ -0,0 +1,66 @@ +#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_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, // ADC1_0 + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, // ADC1_1 + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, // ADC1_2 + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + + // Pad on Board + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, // ADC1_3 + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, // ADC1_4, JTAG MTMS + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, // JTAG MTDI + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, // JTAG MTCK + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, // JTAG MTDO + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + + + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_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/beetle-esp32-c3/sdkconfig b/ports/espressif/boards/beetle-esp32-c3/sdkconfig new file mode 100644 index 0000000000..331a5d14dc --- /dev/null +++ b/ports/espressif/boards/beetle-esp32-c3/sdkconfig @@ -0,0 +1,13 @@ +# +# PHY +# +CONFIG_ESP_PHY_ENABLE_USB=y +# end of PHY + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="beetle-esp32-c3 +# end of LWIP + + diff --git a/ports/espressif/boards/bpi_bit_s2/board.c b/ports/espressif/boards/bpi_bit_s2/board.c new file mode 100644 index 0000000000..22cdb31898 --- /dev/null +++ b/ports/espressif/boards/bpi_bit_s2/board.c @@ -0,0 +1,38 @@ +/* + * 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" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ +} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/bpi_bit_s2/mpconfigboard.h b/ports/espressif/boards/bpi_bit_s2/mpconfigboard.h new file mode 100644 index 0000000000..5225325454 --- /dev/null +++ b/ports/espressif/boards/bpi_bit_s2/mpconfigboard.h @@ -0,0 +1,42 @@ +/* + * 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 "BPI-Bit-S2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +// #define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO16) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO15) + +#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_GPIO44) +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) diff --git a/ports/espressif/boards/bpi_bit_s2/mpconfigboard.mk b/ports/espressif/boards/bpi_bit_s2/mpconfigboard.mk new file mode 100644 index 0000000000..c80a18acd0 --- /dev/null +++ b/ports/espressif/boards/bpi_bit_s2/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x303A +USB_PID = 0x80E6 +USB_PRODUCT = "BPI-Bit-S2" +USB_MANUFACTURER = "BananaPi" + +IDF_TARGET = esp32s2 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=4MB + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/bpi_bit_s2/pins.c b/ports/espressif/boards/bpi_bit_s2/pins.c new file mode 100644 index 0000000000..4b14bbd79e --- /dev/null +++ b/ports/espressif/boards/bpi_bit_s2/pins.c @@ -0,0 +1,105 @@ +#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_IO0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_IO1), 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_IO2), 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_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_LUM1), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_LUM2), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_TEMPERATURE), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_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/bpi_bit_s2/sdkconfig b/ports/espressif/boards/bpi_bit_s2/sdkconfig new file mode 100644 index 0000000000..91758051d3 --- /dev/null +++ b/ports/espressif/boards/bpi_bit_s2/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_QUAD=y +# CONFIG_SPIRAM_MODE_OCT is not set +# 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 ESP32S3 +# +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 is not set +CONFIG_SPIRAM_SPEED_40M=y +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 +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="BPI-BIT-S2" +# end of LWIP diff --git a/ports/espressif/modules/module.h b/ports/espressif/boards/bpi_leaf_s3/board.c similarity index 76% rename from ports/espressif/modules/module.h rename to ports/espressif/boards/bpi_leaf_s3/board.c index 643cdc854e..3b1f5efd87 100644 --- a/ports/espressif/modules/module.h +++ b/ports/espressif/boards/bpi_leaf_s3/board.c @@ -1,5 +1,5 @@ /* - * This file is part of the Micro Python project, http://micropython.org/ + * This file is part of the MicroPython project, http://micropython.org/ * * The MIT License (MIT) * @@ -24,12 +24,16 @@ * THE SOFTWARE. */ - -#ifndef MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H -#define MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H - +#include "supervisor/board.h" +#include "mpconfigboard.h" #include "shared-bindings/microcontroller/Pin.h" -void never_reset_module_internal_pins(void); +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif +} -#endif // MICROPY_INCLUDED_ESPRESSIF_MODULES_MODULE_H +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/bpi_leaf_s3/mpconfigboard.h b/ports/espressif/boards/bpi_leaf_s3/mpconfigboard.h new file mode 100644 index 0000000000..fd6aae04ea --- /dev/null +++ b/ports/espressif/boards/bpi_leaf_s3/mpconfigboard.h @@ -0,0 +1,42 @@ +/* + * 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 "BPI-Leaf-S3" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO48) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO16) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO15) + +#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_GPIO44) +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) diff --git a/ports/espressif/boards/bpi_leaf_s3/mpconfigboard.mk b/ports/espressif/boards/bpi_leaf_s3/mpconfigboard.mk new file mode 100644 index 0000000000..f817930832 --- /dev/null +++ b/ports/espressif/boards/bpi_leaf_s3/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x303A +USB_PID = 0x80E0 +USB_PRODUCT = "BPI-Leaf-S3" +USB_MANUFACTURER = "BananaPi" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=80m +CIRCUITPY_ESP_FLASH_SIZE=8MB + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/bpi_leaf_s3/pins.c b/ports/espressif/boards/bpi_leaf_s3/pins.c new file mode 100644 index 0000000000..bf193e88aa --- /dev/null +++ b/ports/espressif/boards/bpi_leaf_s3/pins.c @@ -0,0 +1,68 @@ +#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_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { 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_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { 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_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + // { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { 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_IO35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_IO47), MP_ROM_PTR(&pin_GPIO47) }, + { MP_ROM_QSTR(MP_QSTR_IO48), MP_ROM_PTR(&pin_GPIO48) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO48) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + { 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_SDA), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_VBAT), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_VBAT_SENSE), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO14) }, + + { 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/bpi_leaf_s3/sdkconfig b/ports/espressif/boards/bpi_leaf_s3/sdkconfig new file mode 100644 index 0000000000..e9c767ea85 --- /dev/null +++ b/ports/espressif/boards/bpi_leaf_s3/sdkconfig @@ -0,0 +1,47 @@ +# +# Component config +# +# +# ESP32S3-Specific +# +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_QUAD=y +# CONFIG_SPIRAM_MODE_OCT is not set +# 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 +# +# 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="BPI-Leaf-S3" +# end of LWIP + +# end of Component config diff --git a/ports/espressif/boards/crumpspace_crumps2/board.c b/ports/espressif/boards/crumpspace_crumps2/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/crumpspace_crumps2/board.c +++ b/ports/espressif/boards/crumpspace_crumps2/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h index ca5d782036..ad0b899c1e 100644 --- a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h +++ b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h @@ -28,3 +28,7 @@ #define MICROPY_HW_BOARD_NAME "CrumpS2" #define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_APA102_MOSI (&pin_GPIO40) +#define MICROPY_HW_APA102_SCK (&pin_GPIO45) +#define MICROPY_HW_APA102_COUNT (1) diff --git a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk index e55ca0e4e8..5cd7682090 100644 --- a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk +++ b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk @@ -12,13 +12,11 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB CIRCUITPY_BITBANG_APA102 = 1 -CIRCUITPY_MODULE=wrover - # Include these Python libraries in firmware. # FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c b/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c new file mode 100644 index 0000000000..1f9ef3c4e7 --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/board.c @@ -0,0 +1,85 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Wai Weng for Cytron Technologies + * + * 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" + +void board_init(void) { + reset_board(); +} + +bool espressif_board_reset_pin_number(gpio_num_t pin_number) { + // For GPIOs used in Maker Feather AIoT S3, set the default state to pull down + // as most of them are connected to active high LED. + switch ((int8_t)pin_number) { + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 12: + case 14: + case 15: + case 16: + case 17: + case 18: + case 21: + case 38: + case 39: + case 40: + case 41: + case 42: + case 47: + case 48: + gpio_reset_pin(pin_number); + gpio_pullup_dis(pin_number); + gpio_pulldown_en(pin_number); + return true; + + // Do not pull up/down as this is the battery voltage monitoring pin. + case 13: + gpio_reset_pin(pin_number); + gpio_pullup_dis(pin_number); + gpio_pulldown_dis(pin_number); + return true; + } + + return false; +} + +void reset_board(void) { + // Turn on VP by default. + gpio_set_direction(11, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(11, true); +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h new file mode 100644 index 0000000000..39c1edc5bd --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Wai Weng for Cytron Technologies + * + * 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 "Cytron Maker Feather AIoT S3" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO46) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO11) + +#define MICROPY_HW_LED_STATUS (&pin_GPIO2) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO41) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO42) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO17) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO8) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO18) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO16) +#define DEFAULT_UART_BUS_TX (&pin_GPIO15) + +#define DOUBLE_TAP_PIN (&pin_GPIO1) diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk new file mode 100644 index 0000000000..84ab3422e8 --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x303A +USB_PID = 0x80F9 +USB_PRODUCT = "Cytron Maker Feather AIoT S3" +USB_MANUFACTURER = "Cytron" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/cytron_maker_feather_aiot_s3/pins.c b/ports/espressif/boards/cytron_maker_feather_aiot_s3/pins.c new file mode 100644 index 0000000000..b8ed298596 --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/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_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_VP_EN), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_VIN), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_VBATT), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_RGB), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_GPIO46) }, + + { MP_ROM_QSTR(MP_QSTR_D47), MP_ROM_PTR(&pin_GPIO47) }, + { MP_ROM_QSTR(MP_QSTR_D48), MP_ROM_PTR(&pin_GPIO48) }, + + { 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/cytron_maker_feather_aiot_s3/sdkconfig b/ports/espressif/boards/cytron_maker_feather_aiot_s3/sdkconfig new file mode 100644 index 0000000000..f508f4a67c --- /dev/null +++ b/ports/espressif/boards/cytron_maker_feather_aiot_s3/sdkconfig @@ -0,0 +1,34 @@ +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_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 +# end of SPI RAM config + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +# +# PSRAM Clock and CS IO for ESP32S3 +# +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_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 +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP diff --git a/ports/espressif/boards/electroniccats_bastwifi/board.c b/ports/espressif/boards/electroniccats_bastwifi/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/electroniccats_bastwifi/board.c +++ b/ports/espressif/boards/electroniccats_bastwifi/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h index 229af1c865..bf8c1efa60 100644 --- a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h +++ b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h @@ -28,3 +28,5 @@ #define MICROPY_HW_BOARD_NAME "BastWiFi" #define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO14) diff --git a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk index 8e2517ba23..d36385d6c8 100644 --- a/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk +++ b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk @@ -14,8 +14,7 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/espressif_esp32_eye/board.c b/ports/espressif/boards/espressif_esp32_eye/board.c new file mode 100644 index 0000000000..1c09fb1316 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32_eye/board.c @@ -0,0 +1,54 @@ +/* + * 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" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +void board_init(void) { + reset_board(); +} + +bool espressif_board_reset_pin_number(gpio_num_t pin_number) { + // Pull LEDs down on reset rather than the default up + if (pin_number == 21 || pin_number == 22) { + gpio_config_t cfg = { + .pin_bit_mask = BIT64(pin_number), + .mode = GPIO_MODE_DISABLE, + .pull_up_en = false, + .pull_down_en = true, + .intr_type = GPIO_INTR_DISABLE, + }; + gpio_config(&cfg); + return true; + } + return false; +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32_eye/mpconfigboard.h b/ports/espressif/boards/espressif_esp32_eye/mpconfigboard.h new file mode 100644 index 0000000000..accf539428 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32_eye/mpconfigboard.h @@ -0,0 +1,41 @@ +/* + * 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 "Espressif ESP32-EYE" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO21) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO23, .sda = &pin_GPIO18}} + +// UART pins attached to the USB-serial converter chip +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3) + +#define DEFAULT_RESERVED_PSRAM (1048576) diff --git a/ports/espressif/boards/espressif_esp32_eye/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32_eye/mpconfigboard.mk new file mode 100644 index 0000000000..4bd091d723 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32_eye/mpconfigboard.mk @@ -0,0 +1,11 @@ +CIRCUITPY_CREATOR_ID = 0x000C303A +CIRCUITPY_CREATION_ID = 0x00320001 + +IDF_TARGET = esp32 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/espressif_esp32_eye/pins.c b/ports/espressif/boards/espressif_esp32_eye/pins.c new file mode 100644 index 0000000000..1824ba1cc0 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32_eye/pins.c @@ -0,0 +1,40 @@ +#include "py/objtuple.h" +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_obj_tuple_t camera_data_tuple = { + {&mp_type_tuple}, + 8, + { + MP_ROM_PTR(&pin_GPIO34), + MP_ROM_PTR(&pin_GPIO13), + MP_ROM_PTR(&pin_GPIO14), + MP_ROM_PTR(&pin_GPIO35), + MP_ROM_PTR(&pin_GPIO39), // "S_VN" + MP_ROM_PTR(&pin_GPIO38), + MP_ROM_PTR(&pin_GPIO37), + MP_ROM_PTR(&pin_GPIO36), // "S_VP" + } +}; + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_I2S_WS), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SDO), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_LED_WHITE), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA), MP_ROM_PTR(&camera_data_tuple) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_VSYNC), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_HREF), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_PCLK), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_XCLK), MP_ROM_PTR(&pin_GPIO4) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/espressif_esp32_eye/sdkconfig b/ports/espressif/boards/espressif_esp32_eye/sdkconfig new file mode 100644 index 0000000000..a73d92e0a2 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32_eye/sdkconfig @@ -0,0 +1,72 @@ +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) Project Configuration +# +# +# Component config +# +# +# ESP32-specific +# +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=-1 +CONFIG_SPIRAM_SPEED_40M=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 +# CONFIG_SPIRAM_BANKSWITCH_ENABLE is not set +# end of SPI RAM config + +# end of ESP32-specific + +# +# NVS +# +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set +# end of NVS + +# +# Camera configuration +# +CONFIG_OV7670_SUPPORT=y +CONFIG_OV7725_SUPPORT=y +CONFIG_NT99141_SUPPORT=y +CONFIG_OV2640_SUPPORT=y +CONFIG_OV3660_SUPPORT=y +CONFIG_OV5640_SUPPORT=y +CONFIG_GC2145_SUPPORT=y +CONFIG_GC032A_SUPPORT=y +CONFIG_GC0308_SUPPORT=y +CONFIG_BF3005_SUPPORT=y +CONFIG_BF20A6_SUPPORT=y +# CONFIG_SC101IOT_SUPPORT is not set +CONFIG_SC030IOT_SUPPORT=y +# CONFIG_SCCB_HARDWARE_I2C_PORT0 is not set +CONFIG_SCCB_HARDWARE_I2C_PORT1=y +CONFIG_SCCB_CLK_FREQ=100000 +# CONFIG_GC_SENSOR_WINDOWING_MODE is not set +CONFIG_GC_SENSOR_SUBSAMPLE_MODE=y +CONFIG_CAMERA_CORE0=y +# CONFIG_CAMERA_CORE1 is not set +# CONFIG_CAMERA_NO_AFFINITY is not set +CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX=32768 +# end of Camera configuration + +# end of Component config +# +CONFIG_ESP_CONSOLE_UART_TX_GPIO=1 +CONFIG_ESP_CONSOLE_UART_RX_GPIO=3 + diff --git a/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/board.c b/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/board.c index e3b71f4832..b155ed7a7b 100644 --- a/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/board.c +++ b/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/board.c @@ -35,14 +35,4 @@ void board_init(void) { #endif } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -#if CIRCUITPY_ALARM -void board_deinit(void) { -} -#endif +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h b/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h index 69c4580aba..2b8ab21ad6 100644 --- a/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h +++ b/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.h @@ -37,5 +37,5 @@ #define DEFAULT_UART_BUS_TX (&pin_GPIO21) // Serial over UART -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.mk index b952dacef7..a652d71e8f 100644 --- a/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32c3_devkitm_1_n4/mpconfigboard.mk @@ -5,6 +5,6 @@ IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/board.c b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/board.c +++ b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.mk index e902c3975a..cac986b43c 100644 --- a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4/mpconfigboard.mk @@ -12,6 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/board.c b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/board.c +++ b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.mk index d007558640..06947b1275 100644 --- a/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s2_devkitc_1_n4r2/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/espressif_esp32s3_box/board.c b/ports/espressif/boards/espressif_esp32s3_box/board.c index 8e93c31e07..75c0ede92d 100644 --- a/ports/espressif/boards/espressif_esp32s3_box/board.c +++ b/ports/espressif/boards/espressif_esp32s3_box/board.c @@ -80,14 +80,14 @@ void board_init(void) { sizeof(display_init_sequence), &pin_GPIO45, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency // Debug UART #ifdef DEBUG @@ -96,13 +96,4 @@ void board_init(void) { #endif } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.mk index 6664ba8c98..a641450c93 100644 --- a/ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_box/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 16MB diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/board.c b/ports/espressif/boards/espressif_esp32s3_box_lite/board.c new file mode 100644 index 0000000000..23c67d06b6 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/board.c @@ -0,0 +1,100 @@ +/* + * 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" + +#include "shared-bindings/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" + +uint8_t display_init_sequence[] = { + 0x01, 0x80, 0x96, // _SWRESET and Delay 150ms + 0x11, 0x80, 0xFF, // _SLPOUT and Delay 500ms + 0x3A, 0x81, 0x55, 0x0A, // _COLMOD and Delay 10ms + 0x21, 0x80, 0x0A, // _INVON + 0x13, 0x80, 0x0A, // _NORON and Delay 10ms + 0x36, 0x01, 0xA0, // _MADCTL + 0x29, 0x80, 0xFF, // _DISPON and Delay 500ms +}; + +void board_init(void) { + busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_GPIO7, &pin_GPIO6, NULL, false); + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + &pin_GPIO4, // TFT_DC Command or data + &pin_GPIO5, // TFT_CS Chip select + &pin_GPIO48, // TFT_RST Reset + 60000000, // Baudrate + 0, // Polarity + 0); // Phase + + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 320, // Width + 240, // Height + 0, // column start + 0, // row start + 0, // rotation + 16, // Color depth + false, // Grayscale + false, // pixels in a byte share a row. Only valid for depths < 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 + MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command + MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command + display_init_sequence, + sizeof(display_init_sequence), + &pin_GPIO45, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + false, // backlight_on_high + false, // SH1107_addressing + 50000); // backlight pwm frequency + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.h b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.h new file mode 100644 index 0000000000..fddcddc7c3 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.h @@ -0,0 +1,30 @@ +/* + * 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 "ESP32-S3-Box-Lite" +#define MICROPY_HW_MCU_NAME "ESP32S3" diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk new file mode 100644 index 0000000000..de3d4cd0ed --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x303A +USB_PID = 0x700D +USB_PRODUCT = "ESP32-S3-Box-Lite" +USB_MANUFACTURER = "Espressif" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=40m +CIRCUITPY_ESP_FLASH_SIZE=16MB diff --git a/ports/espressif/boards/espressif_esp32s3_box_lite/pins.c b/ports/espressif/boards/espressif_esp32s3_box_lite/pins.c new file mode 100644 index 0000000000..73ef15697c --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/pins.c @@ -0,0 +1,67 @@ +#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 + + // First PMOD connector + { MP_ROM_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_U0TXD), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_G43), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_U0RXD), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_G44), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_G11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_G13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_G12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_G14), MP_ROM_PTR(&pin_GPIO14) }, + + // Second PMOD connector + { MP_ROM_QSTR(MP_QSTR_G38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_G39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_G40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_G41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_G42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_G21), MP_ROM_PTR(&pin_GPIO21) }, + + // LCD & touchscreen + { MP_ROM_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_LCD_MOSI), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_LCD_SCK), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_LCD_RST), MP_ROM_PTR(&pin_GPIO48) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CTRL), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_CTP_INT), MP_ROM_PTR(&pin_GPIO3) }, + + // Audio + { MP_ROM_QSTR(MP_QSTR_I2S_ADC_SDOUT), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_I2S_MCLK), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SCLK), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_I2S_LRCK), MP_ROM_PTR(&pin_GPIO47) }, + { MP_ROM_QSTR(MP_QSTR_I2S_CODEC_DSDIN), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_PA_CTRL), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_MUTE_STATUS), MP_ROM_PTR(&pin_GPIO1) }, + + // Internal I2C bus + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, + + // boot button, also usable as a software button + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) }, + + { 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/espressif_esp32s3_box_lite/sdkconfig b/ports/espressif/boards/espressif_esp32s3_box_lite/sdkconfig new file mode 100644 index 0000000000..7fcf8ef297 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_box_lite/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_MODE_QUAD is not set +CONFIG_SPIRAM_MODE_OCT=y +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=-1 +# end of SPI RAM config + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +# +# PSRAM Clock and CS IO for ESP32S3 +# +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_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 is not set +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +CONFIG_SPIRAM_USE_MALLOC=y +CONFIG_SPIRAM_MEMTEST=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 +# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP diff --git a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/board.c b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/board.c index ff9418ec86..3b1f5efd87 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/board.c +++ b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.mk index b6ead37eee..ee3aadf421 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8/mpconfigboard.mk @@ -12,6 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/board.c b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/board.c index ff9418ec86..3b1f5efd87 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/board.c +++ b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.mk index 7fff66f5d8..698c1fff88 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r2/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/board.c b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/board.c index ff9418ec86..3b1f5efd87 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/board.c +++ b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.mk index 4e65fc940d..f9c6cd9c44 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_devkitc_1_n8r8/mpconfigboard.mk @@ -12,6 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/board.c b/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/board.c index ff9418ec86..3b1f5efd87 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/board.c +++ b/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.mk index 9558b05576..4df2a97e48 100644 --- a/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_devkitm_1_n8/mpconfigboard.mk @@ -12,6 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/espressif_esp32s3_eye/board.c b/ports/espressif/boards/espressif_esp32s3_eye/board.c new file mode 100644 index 0000000000..be129c6a30 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_eye/board.c @@ -0,0 +1,122 @@ +/* + * 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/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" +#include "shared-bindings/board/__init__.h" + +displayio_fourwire_obj_t board_display_obj; + +#define DELAY 0x80 + +// display init sequence according to LilyGO example app +uint8_t display_init_sequence[] = { + // sw reset + 0x01, 0 | DELAY, 150, + // sleep out + 0x11, 0 | DELAY, 255, + // normal display mode on + 0x13, 0, + // display and color format settings + 0x36, 1, 0x08, + 0xB6, 2, 0x0A, 0x82, + 0x3A, 1 | DELAY, 0x55, 10, + // ST7789V frame rate setting + 0xB2, 5, 0x0C, 0x0C, 0x00, 0x33, 0x33, + // voltages: VGH / VGL + 0xB7, 1, 0x35, + // ST7789V power setting + 0xBB, 1, 0x28, + 0xC0, 1, 0x0C, + 0xC2, 2, 0x01, 0xFF, + 0xC3, 1, 0x10, + 0xC4, 1, 0x20, + 0xC6, 1, 0x0F, + 0xD0, 2, 0xA4, 0xA1, + // ST7789V gamma setting + 0xE0, 14, 0xD0, 0x00, 0x02, 0x07, 0x0A, 0x28, 0x32, 0x44, 0x42, 0x06, 0x0E, 0x12, 0x14, 0x17, + 0xE1, 14, 0xD0, 0x00, 0x02, 0x07, 0x0A, 0x28, 0x31, 0x54, 0x47, 0x0E, 0x1C, 0x17, 0x1B, 0x1E, + 0x21, 0, + // display on + 0x29, 0 | DELAY, 255, +}; + +void board_init(void) { + busio_spi_obj_t *spi = common_hal_board_create_spi(0); + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + + common_hal_displayio_fourwire_construct( + bus, + spi, + &pin_GPIO43, // DC + &pin_GPIO44, // CS + NULL, // no reset pin + 40000000, // baudrate + 0, // polarity + 0 // phase + ); + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + + common_hal_displayio_display_construct( + display, + bus, + 240, // width (after rotation) + 240, // height (after rotation) + 0, // column start + 0, // row start + 0, // rotation + 16, // color depth + false, // grayscale + false, // pixels in a byte share a row. Only valid for depths < 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 + MIPI_COMMAND_SET_COLUMN_ADDRESS, // set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // set row command + MIPI_COMMAND_WRITE_MEMORY_START, // write memory command + display_init_sequence, + sizeof(display_init_sequence), + &pin_GPIO48, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + false, // backlight_on_high + false, // SH1107_addressing + 50000 // backlight pwm frequency + ); +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32s3_eye/mpconfigboard.h b/ports/espressif/boards/espressif_esp32s3_eye/mpconfigboard.h new file mode 100644 index 0000000000..43ade4f6c8 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_eye/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 "ESP32-S3-EYE" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +// Shared by the camera and accelerometer +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO4) +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO5) + +// This is the SD card connection, not the LCD +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO39) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO40) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO38) + +#define CIRCUITPY_BOARD_SPI (2) +#define CIRCUITPY_BOARD_SPI_PIN { \ + {.clock = &pin_GPIO21, .mosi = &pin_GPIO47, .miso = NULL}, \ + {.clock = &pin_GPIO39, .mosi = &pin_GPIO40, .miso = &pin_GPIO38}, \ +} + +#define DEFAULT_RESERVED_PSRAM (1048576) diff --git a/ports/espressif/boards/espressif_esp32s3_eye/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_eye/mpconfigboard.mk new file mode 100644 index 0000000000..bf9464353f --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_eye/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x303A +USB_PID = 0x700F +USB_PRODUCT = "ESP32-S3-EYE" +USB_MANUFACTURER = "Espressif" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB diff --git a/ports/espressif/boards/espressif_esp32s3_eye/pins.c b/ports/espressif/boards/espressif_esp32s3_eye/pins.c new file mode 100644 index 0000000000..4b4da0b199 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_eye/pins.c @@ -0,0 +1,55 @@ +#include "py/objtuple.h" +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_obj_tuple_t camera_data_tuple = { + {&mp_type_tuple}, + 8, + { + MP_ROM_PTR(&pin_GPIO11), + MP_ROM_PTR(&pin_GPIO9), + MP_ROM_PTR(&pin_GPIO8), + MP_ROM_PTR(&pin_GPIO10), + MP_ROM_PTR(&pin_GPIO12), + MP_ROM_PTR(&pin_GPIO18), + MP_ROM_PTR(&pin_GPIO17), + MP_ROM_PTR(&pin_GPIO16), + } +}; + + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BUTTONS), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_MIC_SDO), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, // LCD + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_DATA), MP_ROM_PTR(&camera_data_tuple) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_VSYNC), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_HREF), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_PCLK), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_CAMERA_XCLK), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO47) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_MISO1), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_MOSI1), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCK1), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_MIC_SCK), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_MIC_WS), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_BACKLIGHT), MP_ROM_PTR(&pin_GPIO48) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_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/espressif_esp32s3_eye/sdkconfig b/ports/espressif/boards/espressif_esp32s3_eye/sdkconfig new file mode 100644 index 0000000000..1a24832767 --- /dev/null +++ b/ports/espressif/boards/espressif_esp32s3_eye/sdkconfig @@ -0,0 +1,34 @@ +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_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 +# end of SPI RAM config + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +# +# PSRAM Clock and CS IO for ESP32S3 +# +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_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 +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3-eye" +# end of LWIP diff --git a/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c b/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c index edb8e6a994..685e7cf156 100644 --- a/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c +++ b/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/board.c @@ -108,14 +108,18 @@ void board_init(void) { sizeof(display_init_sequence), &pin_GPIO9, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency + + #if CIRCUITPY_DEBUG + common_hal_never_reset_pin(DEFAULT_UART_BUS_TX); + #endif } bool espressif_board_reset_pin_number(gpio_num_t pin_number) { @@ -129,13 +133,4 @@ bool espressif_board_reset_pin_number(gpio_num_t pin_number) { return false; } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/mpconfigboard.mk b/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/mpconfigboard.mk index e9eab16f91..c6d7ea1a7a 100644 --- a/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_esp32s3_usb_otg_n8/mpconfigboard.mk @@ -12,6 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/espressif_hmi_devkit_1/board.c b/ports/espressif/boards/espressif_hmi_devkit_1/board.c index 93aa1c0436..b44ba7fad2 100644 --- a/ports/espressif/boards/espressif_hmi_devkit_1/board.c +++ b/ports/espressif/boards/espressif_hmi_devkit_1/board.c @@ -34,13 +34,4 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO44); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk index 1b11f4fbee..bd8e6c6e31 100644 --- a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/espressif_kaluga_1.3/board.c b/ports/espressif/boards/espressif_kaluga_1.3/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/espressif_kaluga_1.3/board.c +++ b/ports/espressif/boards/espressif_kaluga_1.3/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h index 8f89bfcbc4..459a5b3289 100644 --- a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h +++ b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h @@ -30,3 +30,6 @@ #define MICROPY_HW_MCU_NAME "ESP32S2" #define MICROPY_HW_NEOPIXEL (&pin_GPIO45) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO7) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) diff --git a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk index 7823674329..0ff4eab64f 100644 --- a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/espressif_kaluga_1.3/pins.c b/ports/espressif/boards/espressif_kaluga_1.3/pins.c index dff98ceeb9..caa7ecd064 100644 --- a/ports/espressif/boards/espressif_kaluga_1.3/pins.c +++ b/ports/espressif/boards/espressif_kaluga_1.3/pins.c @@ -140,5 +140,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_LRCK_DAC1), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_BCLK_DAC2), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/espressif_kaluga_1/board.c b/ports/espressif/boards/espressif_kaluga_1/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/espressif_kaluga_1/board.c +++ b/ports/espressif/boards/espressif_kaluga_1/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk index 7823674329..0ff4eab64f 100644 --- a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/espressif_saola_1_wroom/board.c b/ports/espressif/boards/espressif_saola_1_wroom/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/espressif_saola_1_wroom/board.c +++ b/ports/espressif/boards/espressif_saola_1_wroom/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk index f25cdc4a63..d59926f2a6 100644 --- a/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk @@ -12,8 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/espressif_saola_1_wrover/board.c b/ports/espressif/boards/espressif_saola_1_wrover/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/espressif_saola_1_wrover/board.c +++ b/ports/espressif/boards/espressif_saola_1_wrover/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk index b4154bf3a4..6185e40809 100644 --- a/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/franzininho_wifi_wroom/board.c b/ports/espressif/boards/franzininho_wifi_wroom/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/franzininho_wifi_wroom/board.c +++ b/ports/espressif/boards/franzininho_wifi_wroom/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk index f1ed49a32a..01e85bc35b 100644 --- a/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk @@ -12,8 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/franzininho_wifi_wrover/board.c b/ports/espressif/boards/franzininho_wifi_wrover/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/franzininho_wifi_wrover/board.c +++ b/ports/espressif/boards/franzininho_wifi_wrover/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk index 1478332fac..4d5081dd7f 100644 --- a/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/gravitech_cucumber_m/board.c b/ports/espressif/boards/gravitech_cucumber_m/board.c index 16a6af0742..b3c8cb4191 100644 --- a/ports/espressif/boards/gravitech_cucumber_m/board.c +++ b/ports/espressif/boards/gravitech_cucumber_m/board.c @@ -36,12 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h index a20ea362f2..fba644553f 100644 --- a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h +++ b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h @@ -31,5 +31,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +#define MICROPY_HW_LED_STATUS (&pin_GPIO2) +#define MICROPY_HW_LED_STATUS_INVERTED (1) + #define DEFAULT_UART_BUS_TX (&pin_GPIO43) #define DEFAULT_UART_BUS_RX (&pin_GPIO44) diff --git a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk index ad9bce8cc0..03c81eefbe 100644 --- a/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk @@ -12,8 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/gravitech_cucumber_ms/board.c b/ports/espressif/boards/gravitech_cucumber_ms/board.c index 16a6af0742..b3c8cb4191 100644 --- a/ports/espressif/boards/gravitech_cucumber_ms/board.c +++ b/ports/espressif/boards/gravitech_cucumber_ms/board.c @@ -36,12 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h index 17719c6f40..1fa96a84a6 100644 --- a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h +++ b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h @@ -31,6 +31,9 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +#define MICROPY_HW_LED_STATUS (&pin_GPIO2) +#define MICROPY_HW_LED_STATUS_INVERTED (1) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO40) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO41) diff --git a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk index c96ac0dc09..169596b1dd 100644 --- a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk @@ -12,8 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/gravitech_cucumber_r/board.c b/ports/espressif/boards/gravitech_cucumber_r/board.c index 16a6af0742..b3c8cb4191 100644 --- a/ports/espressif/boards/gravitech_cucumber_r/board.c +++ b/ports/espressif/boards/gravitech_cucumber_r/board.c @@ -36,12 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h index 53409cf263..07d65735a6 100644 --- a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h +++ b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h @@ -31,5 +31,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +#define MICROPY_HW_LED_STATUS (&pin_GPIO2) +#define MICROPY_HW_LED_STATUS_INVERTED (1) + #define DEFAULT_UART_BUS_TX (&pin_GPIO43) #define DEFAULT_UART_BUS_RX (&pin_GPIO44) diff --git a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk index 51f5fe468f..5e4f6c4b98 100644 --- a/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/gravitech_cucumber_rs/board.c b/ports/espressif/boards/gravitech_cucumber_rs/board.c index 16a6af0742..b3c8cb4191 100644 --- a/ports/espressif/boards/gravitech_cucumber_rs/board.c +++ b/ports/espressif/boards/gravitech_cucumber_rs/board.c @@ -36,12 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h index ee19f54ca5..1e91421574 100644 --- a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h +++ b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h @@ -31,6 +31,9 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +#define MICROPY_HW_LED_STATUS (&pin_GPIO2) +#define MICROPY_HW_LED_STATUS_INVERTED (1) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO40) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO41) diff --git a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk index 6cb8d13d8e..96b9dddf8b 100644 --- a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk +++ b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/hardkernel_odroid_go/board.c b/ports/espressif/boards/hardkernel_odroid_go/board.c new file mode 100644 index 0000000000..609572977e --- /dev/null +++ b/ports/espressif/boards/hardkernel_odroid_go/board.c @@ -0,0 +1,129 @@ +/* + * 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/busio/SPI.h" +#include "shared-bindings/displayio/FourWire.h" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" + +#include "common-hal/microcontroller/Pin.h" + +#define DELAY 0x80 + +// ILI9341 init sequence from: +// https://github.com/hardkernel/ODROID-GO-MicroPython/blob/loboris/odroid_go/utils/lcd/lcd.py#L55 +uint8_t display_init_sequence[] = { + 0x0f, 3, 0x03, 0x80, 0x02, // RDDSDR + 0xcf, 3, 0x00, 0xcf, 0x30, // PWCRTLB + 0xed, 4, 0x64, 0x03, 0x12, 0x81, // PWRONCTRL + 0xe8, 3, 0x85, 0x00, 0x78, // DTCTRLA + 0xcb, 5, 0x39, 0x2c, 0x00, 0x34, 0x02, // PWCTRLA + 0xf7, 1, 0x20, // PRCTRL + 0xea, 2, 0x00, 0x00, // DTCTRLB + 0xc0, 1, 0x1b, // PWCTRL1 + 0xc1, 1, 0x12, // PWCTRL2 + 0xc5, 2, 0x3e, 0x3c, // VMCTRL1 + 0xc7, 1, 0x91, // VMCTRL2 + 0x36, 1, 0xa8, // MADCTL + 0x3a, 1, 0x55, // PIXSET + 0xb1, 2, 0x00, 0x1b, // FRMCTR1 + 0xb6, 3, 0x0a, 0xa2, 0x27, // DISCTRL + 0xf6, 2, 0x01, 0x30, // INTFACE + 0xf2, 1, 0x00, // ENA3G + 0x26, 1, 0x01, // GAMSET + 0xe0, 15, 0x0f, 0x31, 0x2b, 0x0c, 0x0e, 0x08, 0x4e, 0xf1, 0x37, 0x07, 0x10, 0x03, 0x0e, 0x09, 0x00, // PGAMCTRL + 0xe1, 15, 0x00, 0x0e, 0x14, 0x03, 0x11, 0x07, 0x31, 0xc1, 0x48, 0x08, 0x0f, 0x0c, 0x31, 0x36, 0x0f, // NGAMCTRL + 0x11, 0 | DELAY, 10, // SLPOUT + 0x29, 0 | DELAY, 100, // DISPON +}; + +void board_init(void) { + busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; + common_hal_busio_spi_construct(spi, &pin_GPIO18, &pin_GPIO23, NULL, false); + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + common_hal_displayio_fourwire_construct(bus, + spi, + &pin_GPIO21, // TFT_DC Command or data + &pin_GPIO5, // TFT_CS Chip select + NULL, // TFT_RST Reset + 40000000, // Baudrate + 0, // Polarity + 0); // Phase + + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + common_hal_displayio_display_construct(display, + bus, + 320, // Width (after rotation) + 240, // Height (after rotation) + 0, // column start + 0, // row start + 0, // rotation + 16, // Color depth + false, // grayscale + false, // pixels in byte share row. only used for 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 + MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command + MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command + display_init_sequence, + sizeof(display_init_sequence), + &pin_GPIO14, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + true, // backlight_on_high + false, // SH1107_addressing + 50000); // backlight pwm frequency +} + +bool espressif_board_reset_pin_number(gpio_num_t pin_number) { + // Pull LED down on reset rather than the default up + if (pin_number == 2) { + gpio_config_t cfg = { + .pin_bit_mask = BIT64(pin_number), + .mode = GPIO_MODE_DISABLE, + .pull_up_en = false, + .pull_down_en = true, + .intr_type = GPIO_INTR_DISABLE, + }; + gpio_config(&cfg); + return true; + } + return false; +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h b/ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h new file mode 100644 index 0000000000..423890f2e1 --- /dev/null +++ b/ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h @@ -0,0 +1,42 @@ +/* + * 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. + */ + +#define MICROPY_HW_BOARD_NAME "Hardkernel Odroid Go" +#define MICROPY_HW_MCU_NAME "ESP32" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO2) + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing VOLUME button at start up.\n") + +// 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/hardkernel_odroid_go/mpconfigboard.mk b/ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.mk new file mode 100644 index 0000000000..80cd6cd11c --- /dev/null +++ b/ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.mk @@ -0,0 +1,15 @@ +CIRCUITPY_CREATOR_ID = 0x0D10D000 +CIRCUITPY_CREATION_ID = 0x00320060 + +IDF_TARGET = esp32 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 16MB diff --git a/ports/espressif/boards/hardkernel_odroid_go/pins.c b/ports/espressif/boards/hardkernel_odroid_go/pins.c new file mode 100644 index 0000000000..40f4fcdc34 --- /dev/null +++ b/ports/espressif/boards/hardkernel_odroid_go/pins.c @@ -0,0 +1,60 @@ +#include "py/objtuple.h" +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +// Pin names from: https://wiki.odroid.com/odroid_go/odroid_go + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // Left side + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_BTN_START), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_BTN_AXIS_X), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_BTN_AXIS_Y), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_BTN_A), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_BTN_B), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_SPEAKER_IN_M), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_SPEAKER_IN_P), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_BTN_SELECT), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_BACKLIGHT_PWM), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_EXT3), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_BTN_MENU), MP_ROM_PTR(&pin_GPIO13) }, + + // Right side. + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_EXT8), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_EXT7), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_EXT2), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_EXT5), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_BTN_VOLUME), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_EXT4), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_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/hardkernel_odroid_go/sdkconfig b/ports/espressif/boards/hardkernel_odroid_go/sdkconfig new file mode 100644 index 0000000000..f4fea0c732 --- /dev/null +++ b/ports/espressif/boards/hardkernel_odroid_go/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32_SPIRAM_SUPPORT=y +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM32=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=4194304 +CONFIG_SPIRAM_SPEED_40M=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 + +# Uncomment (remove ###) to send ESP_LOG output to TX/RX pins +### # +### # ESP System Settings +### # +### CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +### # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +### CONFIG_ESP_CONSOLE_UART_CUSTOM=y +### # CONFIG_ESP_CONSOLE_NONE is not set +### CONFIG_ESP_CONSOLE_UART=y +### nCONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_0=y +### # CONFIG_ESP_CONSOLE_UART_CUSTOM_NUM_1 is not set +### CONFIG_ESP_CONSOLE_UART_NUM=0 +### CONFIG_ESP_CONSOLE_UART_TX_GPIO=12 +### CONFIG_ESP_CONSOLE_UART_RX_GPIO=15 +### CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +### # CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +### # end of ESP System Settings diff --git a/ports/espressif/boards/hexky_s2/board.c b/ports/espressif/boards/hexky_s2/board.c index 88ac4fc661..e4f8f48855 100644 --- a/ports/espressif/boards/hexky_s2/board.c +++ b/ports/espressif/boards/hexky_s2/board.c @@ -88,9 +88,6 @@ void board_init(void) { displayio_display_obj_t *display = &displays[0].display; display->base.type = &displayio_display_type; - // workaround as board_init() is called before reset_port() in main.c - pwmout_reset(); - common_hal_displayio_display_construct( display, bus, @@ -112,21 +109,15 @@ void board_init(void) { sizeof(display_init_sequence), &pin_GPIO45, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - false, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); - - common_hal_never_reset_pin(&pin_GPIO45); // backlight pin -} - -bool board_requests_safe_mode(void) { - return false; } bool espressif_board_reset_pin_number(gpio_num_t pin_number) { @@ -140,9 +131,6 @@ bool espressif_board_reset_pin_number(gpio_num_t pin_number) { return false; } -void reset_board(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. -void board_deinit(void) { - // TODO: Should we turn off the display when asleep? -} +// TODO: Should we turn off the display when asleep, in board_deinit()? diff --git a/ports/espressif/boards/hexky_s2/mpconfigboard.h b/ports/espressif/boards/hexky_s2/mpconfigboard.h index 31dd096beb..f49901332f 100644 --- a/ports/espressif/boards/hexky_s2/mpconfigboard.h +++ b/ports/espressif/boards/hexky_s2/mpconfigboard.h @@ -30,7 +30,7 @@ #define MICROPY_HW_MCU_NAME "ESP32S2" #define MICROPY_HW_NEOPIXEL (&pin_GPIO40) -#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO39) +#define MICROPY_HW_LED_STATUS (&pin_GPIO39) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) diff --git a/ports/espressif/boards/hexky_s2/mpconfigboard.mk b/ports/espressif/boards/hexky_s2/mpconfigboard.mk index 726bd3bb51..dbde2f77e4 100644 --- a/ports/espressif/boards/hexky_s2/mpconfigboard.mk +++ b/ports/espressif/boards/hexky_s2/mpconfigboard.mk @@ -13,8 +13,8 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/hiibot_iots2/board.c b/ports/espressif/boards/hiibot_iots2/board.c index 23ba71ed7e..c9cf7afb92 100644 --- a/ports/espressif/boards/hiibot_iots2/board.c +++ b/ports/espressif/boards/hiibot_iots2/board.c @@ -93,9 +93,6 @@ static void display_init(void) { displayio_display_obj_t *display = &displays[0].display; display->base.type = &displayio_display_type; - // workaround as board_init() is called before reset_port() in main.c - pwmout_reset(); - common_hal_displayio_display_construct( display, bus, @@ -117,17 +114,15 @@ static void display_init(void) { sizeof(display_init_sequence), &pin_GPIO38, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - false, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); - - common_hal_never_reset_pin(&pin_GPIO38); // backlight pin } void board_init(void) { @@ -154,12 +149,4 @@ void board_init(void) { display_init(); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/hiibot_iots2/mpconfigboard.h b/ports/espressif/boards/hiibot_iots2/mpconfigboard.h index 61696716ee..269bea8566 100644 --- a/ports/espressif/boards/hiibot_iots2/mpconfigboard.h +++ b/ports/espressif/boards/hiibot_iots2/mpconfigboard.h @@ -34,3 +34,12 @@ #define MICROPY_HW_BUTTON (&pin_GPIO21) #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO21) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO1, .sda = &pin_GPIO2}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO40, .mosi = &pin_GPIO42, .miso = &pin_GPIO41}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO43, .rx = &pin_GPIO44}} diff --git a/ports/espressif/boards/hiibot_iots2/mpconfigboard.mk b/ports/espressif/boards/hiibot_iots2/mpconfigboard.mk index 58a7176119..b52c88cdc6 100644 --- a/ports/espressif/boards/hiibot_iots2/mpconfigboard.mk +++ b/ports/espressif/boards/hiibot_iots2/mpconfigboard.mk @@ -12,7 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=8MB -#CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 8MB +#CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/hiibot_iots2/pins.c b/ports/espressif/boards/hiibot_iots2/pins.c index 55e81ef3c5..a2277364f2 100644 --- a/ports/espressif/boards/hiibot_iots2/pins.c +++ b/ports/espressif/boards/hiibot_iots2/pins.c @@ -71,6 +71,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, { 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) }, }; diff --git a/ports/espressif/boards/lilygo_ttgo_t-01c3/board.c b/ports/espressif/boards/lilygo_ttgo_t-01c3/board.c index deeb8041ea..67b05e5cd2 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-01c3/board.c +++ b/ports/espressif/boards/lilygo_ttgo_t-01c3/board.c @@ -11,28 +11,4 @@ void board_init(void) { #endif } -bool board_requests_safe_mode(void) { - return false; -} - -bool espressif_board_reset_pin_number(gpio_num_t pin_number) { - // Pull LED down on reset rather than the default up - if (pin_number == MICROPY_HW_LED_STATUS->number) { - gpio_config_t cfg = { - .pin_bit_mask = BIT64(pin_number), - .mode = GPIO_MODE_DISABLE, - .pull_up_en = false, - .pull_down_en = true, - .intr_type = GPIO_INTR_DISABLE, - }; - gpio_config(&cfg); - return true; - } - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/lilygo_ttgo_t-01c3/mpconfigboard.h b/ports/espressif/boards/lilygo_ttgo_t-01c3/mpconfigboard.h index e0eebc9754..bbb8cff195 100644 --- a/ports/espressif/boards/lilygo_ttgo_t-01c3/mpconfigboard.h +++ b/ports/espressif/boards/lilygo_ttgo_t-01c3/mpconfigboard.h @@ -6,5 +6,5 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO20) #define DEFAULT_UART_BUS_TX (&pin_GPIO21) -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c new file mode 100644 index 0000000000..7bcdcdba25 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/board.c @@ -0,0 +1,40 @@ +/* + * 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 "shared-bindings/microcontroller/Pin.h" +#include "supervisor/board.h" + +#include "components/driver/include/driver/gpio.h" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO21); + #endif +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h new file mode 100644 index 0000000000..26a30e07dd --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.h @@ -0,0 +1,10 @@ +#define MICROPY_HW_BOARD_NAME "LILYGO TTGO T-OI PLUS" +#define MICROPY_HW_MCU_NAME "ESP32-C3" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO3) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO20) +#define DEFAULT_UART_BUS_TX (&pin_GPIO21) + +#define CIRCUITPY_CONSOLE_UART_RX DEFAULT_UART_BUS_RX +#define CIRCUITPY_CONSOLE_UART_TX DEFAULT_UART_BUS_TX diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk new file mode 100644 index 0000000000..2f66e69415 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/mpconfigboard.mk @@ -0,0 +1,10 @@ +CIRCUITPY_CREATOR_ID = 0xC3C30000 +CIRCUITPY_CREATION_ID = 0x00C30002 + +IDF_TARGET = esp32c3 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c new file mode 100644 index 0000000000..c906b7a555 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/pins.c @@ -0,0 +1,27 @@ +#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_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { 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_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { 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/lilygo_ttgo_t-oi-plus/sdkconfig b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig new file mode 100644 index 0000000000..7c85db8776 --- /dev/null +++ b/ports/espressif/boards/lilygo_ttgo_t-oi-plus/sdkconfig @@ -0,0 +1,5 @@ +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="LILYGO TTGO T-OI PLUS" +# end of LWIP diff --git a/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/board.c b/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/board.c index d522720629..6597b51c5f 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/board.c +++ b/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/board.c @@ -36,12 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk index 528938f7ac..38af491bec 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_esp32_s2_wroom/mpconfigboard.mk @@ -12,8 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2/board.c b/ports/espressif/boards/lilygo_ttgo_t8_s2/board.c index d522720629..6597b51c5f 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2/board.c +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2/board.c @@ -36,12 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk index f0c9eb5c0b..781818f53e 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_MODULE = wroom diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c index 492c3f8f4d..6c0a54c99c 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c @@ -93,9 +93,6 @@ static void display_init(void) { displayio_display_obj_t *display = &displays[0].display; display->base.type = &displayio_display_type; - // workaround as board_init() is called before reset_port() in main.c - pwmout_reset(); - common_hal_displayio_display_construct( display, bus, @@ -117,17 +114,15 @@ static void display_init(void) { sizeof(display_init_sequence), &pin_GPIO33, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - false, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); - - common_hal_never_reset_pin(&pin_GPIO33); // backlight pin } void board_init(void) { @@ -141,13 +136,4 @@ void board_init(void) { display_init(); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk index c7795bbdeb..4d6a586ff8 100644 --- a/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk @@ -15,5 +15,3 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_MODULE = wroom diff --git a/ports/espressif/boards/lolin_c3_mini/board.c b/ports/espressif/boards/lolin_c3_mini/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/lolin_c3_mini/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/lolin_c3_mini/mpconfigboard.h b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h new file mode 100644 index 0000000000..03e4d5d436 --- /dev/null +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.h @@ -0,0 +1,51 @@ +/* + * 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. + */ + +// Board setup + +#define MICROPY_HW_BOARD_NAME "Wemos Lolin C3 Mini" // from Wemos MP +#define MICROPY_HW_MCU_NAME "ESP32-C3FH4" // from Wemos MP + +// From Wemos C3 Mini Schematic +// https://www.wemos.cc/en/latest/_static/files/sch_c3_mini_v1.0.0.pdf +// And MP Config +// https://github.com/micropython/micropython/blob/master/ports/esp32/boards/LOLIN_C3_MINI +// Status LED +#define MICROPY_HW_NEOPIXEL (&pin_GPIO7) + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO6, .sda = &pin_GPIO5}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO10, .mosi = &pin_GPIO7, .miso = &pin_GPIO8}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO21, .rx = &pin_GPIO20}} + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk new file mode 100644 index 0000000000..28e4190adf --- /dev/null +++ b/ports/espressif/boards/lolin_c3_mini/mpconfigboard.mk @@ -0,0 +1,10 @@ +CIRCUITPY_CREATOR_ID = 0x19881988 +CIRCUITPY_CREATION_ID = 0x00C30001 + +IDF_TARGET = esp32c3 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_ESP_FLASH_MODE=qio +CIRCUITPY_ESP_FLASH_FREQ=80m +CIRCUITPY_ESP_FLASH_SIZE=4MB diff --git a/ports/espressif/boards/lolin_c3_mini/pins.c b/ports/espressif/boards/lolin_c3_mini/pins.c new file mode 100644 index 0000000000..ccc70f6043 --- /dev/null +++ b/ports/espressif/boards/lolin_c3_mini/pins.c @@ -0,0 +1,74 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // C3 Mini Board + // Wemos Lolin C3 Mini Schematic + // https://www.wemos.cc/en/latest/_static/files/sch_c3_mini_v1.0.0.pdf + // Starting on Left side going counterclockwise + // MP Config + // https://github.com/micropython/micropython/blob/master/ports/esp32/boards/LOLIN_C3_MINI + // C3 Data Sheet + // https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf + + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_IO1), 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_IO2), 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_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), 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_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) }, + + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_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/lolin_c3_mini/sdkconfig b/ports/espressif/boards/lolin_c3_mini/sdkconfig new file mode 100644 index 0000000000..c548ee3c69 --- /dev/null +++ b/ports/espressif/boards/lolin_c3_mini/sdkconfig @@ -0,0 +1,13 @@ +# +# PHY +# +CONFIG_ESP_PHY_ENABLE_USB=y +# end of PHY + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="lolin-c3-mini" +# end of LWIP + + diff --git a/ports/espressif/boards/lolin_s2_mini/board.c b/ports/espressif/boards/lolin_s2_mini/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/lolin_s2_mini/board.c +++ b/ports/espressif/boards/lolin_s2_mini/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/lolin_s2_mini/mpconfigboard.h b/ports/espressif/boards/lolin_s2_mini/mpconfigboard.h index c490cd8ceb..e943e70184 100644 --- a/ports/espressif/boards/lolin_s2_mini/mpconfigboard.h +++ b/ports/espressif/boards/lolin_s2_mini/mpconfigboard.h @@ -29,6 +29,8 @@ #define MICROPY_HW_BOARD_NAME "S2Mini" #define MICROPY_HW_MCU_NAME "ESP32S2-S2FN4R2" // from Wemos MP +#define MICROPY_HW_LED_STATUS (&pin_GPIO15) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO35) // no I2C labels on S2 Mini, def from Wemos MP #define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) // no I2C labels on S2 Mini, def from Wemos MP diff --git a/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk b/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk index 5e40a1e13c..acedc2ad51 100644 --- a/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB # Include these Python libraries in firmware. diff --git a/ports/espressif/boards/lolin_s2_pico/board.c b/ports/espressif/boards/lolin_s2_pico/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/lolin_s2_pico/board.c +++ b/ports/espressif/boards/lolin_s2_pico/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/lolin_s2_pico/mpconfigboard.h b/ports/espressif/boards/lolin_s2_pico/mpconfigboard.h index 19c41f84e4..a33e6ea4d0 100644 --- a/ports/espressif/boards/lolin_s2_pico/mpconfigboard.h +++ b/ports/espressif/boards/lolin_s2_pico/mpconfigboard.h @@ -29,6 +29,8 @@ #define MICROPY_HW_BOARD_NAME "S2Pico" #define MICROPY_HW_MCU_NAME "ESP32S2-S2FN4R2" // from Wemos MP +#define MICROPY_HW_LED_STATUS (&pin_GPIO10) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) // JST SH Connector Pin 3 NOT STEMMA QT / Feather pinout #define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) // JST SH Connector Pin 2 NOT STEMMA QT / Feather pinout diff --git a/ports/espressif/boards/lolin_s2_pico/mpconfigboard.mk b/ports/espressif/boards/lolin_s2_pico/mpconfigboard.mk index b060be0261..bd4aca0337 100644 --- a/ports/espressif/boards/lolin_s2_pico/mpconfigboard.mk +++ b/ports/espressif/boards/lolin_s2_pico/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB # Include these Python libraries in firmware. diff --git a/ports/espressif/boards/lolin_s3/board.c b/ports/espressif/boards/lolin_s3/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/lolin_s3/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/lolin_s3/mpconfigboard.h b/ports/espressif/boards/lolin_s3/mpconfigboard.h new file mode 100644 index 0000000000..9dc1b8f6a9 --- /dev/null +++ b/ports/espressif/boards/lolin_s3/mpconfigboard.h @@ -0,0 +1,41 @@ +/* + * 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 "LOLIN S3 16MB Flash 8MB PSRAM" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO38) + +// #define MICROPY_HW_LED_STATUS (&pin_GPIO13) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO41) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO42) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO12) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO11) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO13) diff --git a/ports/espressif/boards/lolin_s3/mpconfigboard.mk b/ports/espressif/boards/lolin_s3/mpconfigboard.mk new file mode 100644 index 0000000000..2daa5b3ed5 --- /dev/null +++ b/ports/espressif/boards/lolin_s3/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x303a +USB_PID = 0x8117 +USB_PRODUCT = "LOLIN S3 16MB Flash 8MB PSRAM" +USB_MANUFACTURER = "WEMOS" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 16MB + +OPTIMIZATION_FLAGS = -Os +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/lolin_s3/pins.c b/ports/espressif/boards/lolin_s3/pins.c new file mode 100644 index 0000000000..cc88572b6e --- /dev/null +++ b/ports/espressif/boards/lolin_s3/pins.c @@ -0,0 +1,123 @@ +#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_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { 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_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { 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_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { 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_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { 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_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + + + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_A14), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_A16), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_A17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + + { 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/lolin_s3/sdkconfig b/ports/espressif/boards/lolin_s3/sdkconfig new file mode 100644 index 0000000000..23d005edd9 --- /dev/null +++ b/ports/espressif/boards/lolin_s3/sdkconfig @@ -0,0 +1,48 @@ +# +# Component config +# +# +# ESP32S3-Specific +# +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +CONFIG_SPIRAM_MODE_QUAD=y +# CONFIG_SPIRAM_MODE_OCT is not set +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 +# +# 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 +CONFIG_SPIRAM_MODE_OCT=y +# end of SPI RAM config + +# end of ESP32S3-Specific + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="LOLIN-S3" +# end of LWIP + +# end of Component config diff --git a/ports/espressif/boards/microdev_micro_c3/board.c b/ports/espressif/boards/microdev_micro_c3/board.c index e3b71f4832..b155ed7a7b 100644 --- a/ports/espressif/boards/microdev_micro_c3/board.c +++ b/ports/espressif/boards/microdev_micro_c3/board.c @@ -35,14 +35,4 @@ void board_init(void) { #endif } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -#if CIRCUITPY_ALARM -void board_deinit(void) { -} -#endif +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h b/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h index e94f14c80b..97a18f3235 100644 --- a/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h +++ b/ports/espressif/boards/microdev_micro_c3/mpconfigboard.h @@ -25,24 +25,31 @@ */ // Board setup -#define MICROPY_HW_BOARD_NAME "MicroDev microC3" -#define MICROPY_HW_MCU_NAME "ESP32-C3FN4" +#define MICROPY_HW_BOARD_NAME "MicroDev microC3" +#define MICROPY_HW_MCU_NAME "ESP32-C3FN4" -// Status LED -#define MICROPY_HW_NEOPIXEL (&pin_GPIO7) -#define MICROPY_HW_NEOPIXEL_COUNT (2) +// Status LEDs +#define MICROPY_HW_NEOPIXEL (&pin_GPIO7) +#define MICROPY_HW_NEOPIXEL_COUNT (2) + +#define MICROPY_HW_LED_STATUS (&pin_GPIO8) // Default bus pins -#define DEFAULT_I2C_BUS_SCL (&pin_GPIO4) -#define DEFAULT_I2C_BUS_SDA (&pin_GPIO5) +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO4) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO5) -#define DEFAULT_SPI_BUS_SCK (&pin_GPIO1) -#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO2) -#define DEFAULT_SPI_BUS_MISO (&pin_GPIO3) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO1) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO2) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO3) -#define DEFAULT_UART_BUS_RX (&pin_GPIO20) -#define DEFAULT_UART_BUS_TX (&pin_GPIO21) +#define DEFAULT_UART_BUS_RX (&pin_GPIO20) +#define DEFAULT_UART_BUS_TX (&pin_GPIO21) -// Serial over UART -#define CIRCUITPY_DEBUG_UART_RX DEFAULT_UART_BUS_RX -#define CIRCUITPY_DEBUG_UART_TX DEFAULT_UART_BUS_TX +// For REPL over built-in USB Serial +#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) + +// For entering safe mode +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) + +// Explanation of how a user got into safe mode +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") diff --git a/ports/espressif/boards/microdev_micro_c3/mpconfigboard.mk b/ports/espressif/boards/microdev_micro_c3/mpconfigboard.mk index 12bd7358b8..646522db8d 100644 --- a/ports/espressif/boards/microdev_micro_c3/mpconfigboard.mk +++ b/ports/espressif/boards/microdev_micro_c3/mpconfigboard.mk @@ -5,6 +5,6 @@ IDF_TARGET = esp32c3 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/microdev_micro_c3/sdkconfig b/ports/espressif/boards/microdev_micro_c3/sdkconfig index f6f038a77c..6674dbfb90 100644 --- a/ports/espressif/boards/microdev_micro_c3/sdkconfig +++ b/ports/espressif/boards/microdev_micro_c3/sdkconfig @@ -1,5 +1,70 @@ +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) Project Configuration +# +# Bootloader config +# +CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set +CONFIG_BOOTLOADER_LOG_LEVEL=0 +# end of Bootloader config + +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +# end of Serial flasher config + +# +# Partition Table +# +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-4MB-no-uf2.csv" +CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-4MB-no-uf2.csv" +# end of Partition Table + +# +# Compiler options +# +# CONFIG_COMPILER_SAVE_RESTORE_LIBCALLS is not set +# end of Compiler options + +# +# Component config +# +# + +# +# PHY +# +CONFIG_ESP_PHY_ENABLE_USB=y +# end of PHY + +# +# ESP System Settings +# +# CONFIG_ESP_SYSTEM_USE_EH_FRAME is not set +CONFIG_ESP_CONSOLE_SECONDARY_NONE=y +# CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +# end of ESP System Settings + # # LWIP # CONFIG_LWIP_LOCAL_HOSTNAME="MicroDev-microC3" # end of LWIP + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set +# end of SPI Flash driver + +# end of Component config + +# +# Deprecated options for backward compatibility +# +# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set +CONFIG_LOG_BOOTLOADER_LEVEL=0 +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set +# end of Deprecated options for backward compatibility diff --git a/ports/espressif/boards/microdev_micro_s2/board.c b/ports/espressif/boards/microdev_micro_s2/board.c index 0a2b17e001..65bb19aced 100644 --- a/ports/espressif/boards/microdev_micro_s2/board.c +++ b/ports/espressif/boards/microdev_micro_s2/board.c @@ -38,23 +38,4 @@ void board_init(void) { #endif } -bool board_requests_safe_mode(void) { - return false; -} - -bool espressif_board_reset_pin_number(gpio_num_t pin_number) { - // Pin 21 is a high side LED so pull it down to prevent lighting the LED. - if (pin_number == 21) { - gpio_reset_pin(21); - gpio_pullup_dis(21); - gpio_pulldown_en(21); - return true; - } - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/microdev_micro_s2/mpconfigboard.h b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.h index c9354cabcc..c692c5e664 100644 --- a/ports/espressif/boards/microdev_micro_s2/mpconfigboard.h +++ b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.h @@ -28,9 +28,11 @@ #define MICROPY_HW_BOARD_NAME "MicroDev microS2" #define MICROPY_HW_MCU_NAME "ESP32-S2" -// Status LED +// Status LEDs #define MICROPY_HW_NEOPIXEL (&pin_GPIO33) +#define MICROPY_HW_LED_STATUS (&pin_GPIO21) + // Default bus pins #define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) diff --git a/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk index 887e6d8b9b..d551a5601c 100644 --- a/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk +++ b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk @@ -11,6 +11,6 @@ INTERNAL_FLASH_FILESYSTEM = 1 # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 16MB diff --git a/ports/espressif/boards/mixgo_ce_serial/board.c b/ports/espressif/boards/mixgo_ce_serial/board.c new file mode 100644 index 0000000000..e6ffb553b1 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_serial/board.c @@ -0,0 +1,62 @@ +/* + * 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" + +#include "lib/oofatfs/ff.h" +#include "extmod/vfs_fat.h" +#include "py/mpstate.h" +#include "supervisor/filesystem.h" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ + + mp_import_stat_t stat_b = mp_import_stat("boot.py"); + if (stat_b != MP_IMPORT_STAT_FILE) { + FATFS *fatfs = filesystem_circuitpy(); + FIL fs; + UINT char_written = 0; + const byte buffer[] = "#Serial port upload mode\nimport storage\nstorage.remount(\"/\", False)\nstorage.disable_usb_drive()\n"; + // Create or modify existing boot.py file + f_open(fatfs, &fs, "/boot.py", FA_WRITE | FA_CREATE_ALWAYS); + f_write(&fs, buffer, sizeof(buffer) - 1, &char_written); + f_close(&fs); + // Delete code.Py, use main.py + mp_import_stat_t stat_c = mp_import_stat("code.py"); + if (stat_c == MP_IMPORT_STAT_FILE) { + f_unlink(fatfs,"/code.py"); + } + } + +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.h b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.h new file mode 100644 index 0000000000..187687c8f5 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.h @@ -0,0 +1,32 @@ +/* + * 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 "MixGo CE" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO45) diff --git a/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk new file mode 100644 index 0000000000..6da83550be --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_serial/mpconfigboard.mk @@ -0,0 +1,24 @@ +USB_VID = 0x303A +USB_PID = 0x80FD +USB_PRODUCT = "MixGo CE" +USB_MANUFACTURER = "Espressif" + +IDF_TARGET = esp32s2 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB + +CIRCUITPY_ESP32_CAMERA = 0 + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/mixgo_cp_lib/mixgoce_lib +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/mixgo_ce_serial/pins.c b/ports/espressif/boards/mixgo_ce_serial/pins.c new file mode 100644 index 0000000000..ca4eb12bf7 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_serial/pins.c @@ -0,0 +1,50 @@ +#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_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { 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_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { 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_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, + + + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { 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_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/mixgo_ce_serial/sdkconfig b/ports/espressif/boards/mixgo_ce_serial/sdkconfig new file mode 100644 index 0000000000..5b9c86dcc3 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_serial/sdkconfig @@ -0,0 +1,6 @@ +# CONFIG_ESP32S2_SPIRAM_SUPPORT is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +# end of LWIP diff --git a/ports/espressif/boards/mixgo_ce_udisk/board.c b/ports/espressif/boards/mixgo_ce_udisk/board.c new file mode 100644 index 0000000000..b3c8cb4191 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/board.c @@ -0,0 +1,39 @@ +/* + * 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" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.h b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.h new file mode 100644 index 0000000000..187687c8f5 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.h @@ -0,0 +1,32 @@ +/* + * 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 "MixGo CE" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO45) diff --git a/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk new file mode 100644 index 0000000000..da38010805 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/mpconfigboard.mk @@ -0,0 +1,24 @@ +USB_VID = 0x303A +USB_PID = 0x80FC +USB_PRODUCT = "MixGo CE" +USB_MANUFACTURER = "Espressif" + +IDF_TARGET = esp32s2 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB + +CIRCUITPY_ESP32_CAMERA = 0 + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/mixgo_cp_lib/mixgoce_lib +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/mixgo_ce_udisk/pins.c b/ports/espressif/boards/mixgo_ce_udisk/pins.c new file mode 100644 index 0000000000..ca4eb12bf7 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/pins.c @@ -0,0 +1,50 @@ +#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_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { 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_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { 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_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, + + + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { 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_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/mixgo_ce_udisk/sdkconfig b/ports/espressif/boards/mixgo_ce_udisk/sdkconfig new file mode 100644 index 0000000000..5b9c86dcc3 --- /dev/null +++ b/ports/espressif/boards/mixgo_ce_udisk/sdkconfig @@ -0,0 +1,6 @@ +# CONFIG_ESP32S2_SPIRAM_SUPPORT is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +# end of LWIP diff --git a/ports/espressif/boards/morpheans_morphesp-240/board.c b/ports/espressif/boards/morpheans_morphesp-240/board.c index b15562de38..30e0a04aad 100644 --- a/ports/espressif/boards/morpheans_morphesp-240/board.c +++ b/ports/espressif/boards/morpheans_morphesp-240/board.c @@ -172,9 +172,6 @@ void board_init(void) { 0 // phase ); - // workaround as board_init() is called before reset_port() in main.c - pwmout_reset(); - displayio_display_obj_t *display = &displays[0].display; display->base.type = &displayio_display_type; common_hal_displayio_display_construct( @@ -198,25 +195,19 @@ void board_init(void) { sizeof(display_init_sequence), NULL, // There is no backlight pin, defined for now. NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second false, // backlight_on_high - false // SH1107_addressing + false, // SH1107_addressing + 50000 // backlight pwm frequency ); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - void board_deinit(void) { common_hal_displayio_release_displays(); } + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk index 567f2ddea1..2cb2ad0118 100644 --- a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk +++ b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk @@ -15,5 +15,4 @@ CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 CIRCUITPY_ESP_FLASH_MODE = dio CIRCUITPY_ESP_FLASH_FREQ = 40m CIRCUITPY_ESP_FLASH_SIZE = 4MB - -CIRCUITPY_MODULE = wroom +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/board.c b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/board.c +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk index 7385906921..d9c808adbc 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk @@ -12,8 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/board.c b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/board.c +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk index 6060a5c581..80557e1575 100644 --- a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/odt_pixelwing_esp32_s2/board.c b/ports/espressif/boards/odt_pixelwing_esp32_s2/board.c index 6772768da5..164430c88c 100644 --- a/ports/espressif/boards/odt_pixelwing_esp32_s2/board.c +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/board.c @@ -25,19 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -#include "shared-bindings/microcontroller/Pin.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h index 9d7a480228..5d6ad95e1b 100644 --- a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h @@ -31,5 +31,7 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO45) +#define MICROPY_HW_LED_STATUS (&pin_GPIO21) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO34) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) diff --git a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk index f4c0be83dc..d02872f445 100644 --- a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/seeed_xiao_esp32c3/board.c b/ports/espressif/boards/seeed_xiao_esp32c3/board.c new file mode 100644 index 0000000000..7bcdcdba25 --- /dev/null +++ b/ports/espressif/boards/seeed_xiao_esp32c3/board.c @@ -0,0 +1,40 @@ +/* + * 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 "shared-bindings/microcontroller/Pin.h" +#include "supervisor/board.h" + +#include "components/driver/include/driver/gpio.h" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO20); + common_hal_never_reset_pin(&pin_GPIO21); + #endif +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/seeed_xiao_esp32c3/mpconfigboard.h b/ports/espressif/boards/seeed_xiao_esp32c3/mpconfigboard.h new file mode 100644 index 0000000000..638be9d197 --- /dev/null +++ b/ports/espressif/boards/seeed_xiao_esp32c3/mpconfigboard.h @@ -0,0 +1,14 @@ +#define MICROPY_HW_BOARD_NAME "Seeed Studio XIAO ESP32C3" +#define MICROPY_HW_MCU_NAME "ESP32-C3FN4" + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO7) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO6) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO8) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO10) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO9) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO20) +#define DEFAULT_UART_BUS_TX (&pin_GPIO21) + +#define CIRCUITPY_ESP_USB_SERIAL_JTAG (1) diff --git a/ports/espressif/boards/seeed_xiao_esp32c3/mpconfigboard.mk b/ports/espressif/boards/seeed_xiao_esp32c3/mpconfigboard.mk new file mode 100644 index 0000000000..9e14c9ac7f --- /dev/null +++ b/ports/espressif/boards/seeed_xiao_esp32c3/mpconfigboard.mk @@ -0,0 +1,10 @@ +CIRCUITPY_CREATOR_ID = 0x000C2886 +CIRCUITPY_CREATION_ID = 0x00C30001 + +IDF_TARGET = esp32c3 + +INTERNAL_FLASH_FILESYSTEM = 1 + +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/seeed_xiao_esp32c3/pins.c b/ports/espressif/boards/seeed_xiao_esp32c3/pins.c new file mode 100644 index 0000000000..5fc475d564 --- /dev/null +++ b/ports/espressif/boards/seeed_xiao_esp32c3/pins.c @@ -0,0 +1,43 @@ +#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_D0), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_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/seeed_xiao_esp32c3/sdkconfig b/ports/espressif/boards/seeed_xiao_esp32c3/sdkconfig new file mode 100644 index 0000000000..b2c9bc0fe6 --- /dev/null +++ b/ports/espressif/boards/seeed_xiao_esp32c3/sdkconfig @@ -0,0 +1,5 @@ +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="seeed-xiao-esp32c3" +# end of LWIP diff --git a/ports/espressif/boards/smartbeedesigns_bee_motion_s3/board.c b/ports/espressif/boards/smartbeedesigns_bee_motion_s3/board.c new file mode 100644 index 0000000000..b3c8cb4191 --- /dev/null +++ b/ports/espressif/boards/smartbeedesigns_bee_motion_s3/board.c @@ -0,0 +1,39 @@ +/* + * 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" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/smartbeedesigns_bee_motion_s3/mpconfigboard.h b/ports/espressif/boards/smartbeedesigns_bee_motion_s3/mpconfigboard.h new file mode 100644 index 0000000000..11e2449e9b --- /dev/null +++ b/ports/espressif/boards/smartbeedesigns_bee_motion_s3/mpconfigboard.h @@ -0,0 +1,41 @@ +/* + * 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 "Bee-Motion-S3" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO48) +#define DEFAULT_UART_BUS_RX (&pin_GPIO44) +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO36) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO37) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO17) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO15) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO16) diff --git a/ports/espressif/boards/smartbeedesigns_bee_motion_s3/mpconfigboard.mk b/ports/espressif/boards/smartbeedesigns_bee_motion_s3/mpconfigboard.mk new file mode 100644 index 0000000000..9a23741804 --- /dev/null +++ b/ports/espressif/boards/smartbeedesigns_bee_motion_s3/mpconfigboard.mk @@ -0,0 +1,21 @@ +USB_VID = 0x303A +USB_PID = 0x8114 +USB_PRODUCT = "Bee-Motion-S3" +USB_MANUFACTURER = "Smart Bee Designs" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB + + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/smartbeedesigns_bee_motion_s3/pins.c b/ports/espressif/boards/smartbeedesigns_bee_motion_s3/pins.c new file mode 100644 index 0000000000..7696986472 --- /dev/null +++ b/ports/espressif/boards/smartbeedesigns_bee_motion_s3/pins.c @@ -0,0 +1,102 @@ +#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_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) }, + { 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_IO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_IO48), MP_ROM_PTR(&pin_GPIO48) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44)}, + { MP_ROM_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_BOOT_BTN), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_VBAT), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_VBAT_SENSE), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_LIGHT_SENSOR), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_PIR), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_PIR_SENSOR), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO34) }, + + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_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/smartbeedesigns_bee_motion_s3/sdkconfig b/ports/espressif/boards/smartbeedesigns_bee_motion_s3/sdkconfig new file mode 100644 index 0000000000..84cf45aa83 --- /dev/null +++ b/ports/espressif/boards/smartbeedesigns_bee_motion_s3/sdkconfig @@ -0,0 +1,6 @@ +# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="smartbeedesigns_bee_motion_s3" +# end of LWIP diff --git a/ports/espressif/boards/smartbeedesigns_bee_s3/board.c b/ports/espressif/boards/smartbeedesigns_bee_s3/board.c new file mode 100644 index 0000000000..b3c8cb4191 --- /dev/null +++ b/ports/espressif/boards/smartbeedesigns_bee_s3/board.c @@ -0,0 +1,39 @@ +/* + * 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" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/smartbeedesigns_bee_s3/mpconfigboard.h b/ports/espressif/boards/smartbeedesigns_bee_s3/mpconfigboard.h new file mode 100644 index 0000000000..1a17770fb7 --- /dev/null +++ b/ports/espressif/boards/smartbeedesigns_bee_s3/mpconfigboard.h @@ -0,0 +1,41 @@ +/* + * 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 "Bee-S3" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO48) +#define DEFAULT_UART_BUS_RX (&pin_GPIO44) +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO36) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO37) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO39) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO38) diff --git a/ports/espressif/boards/smartbeedesigns_bee_s3/mpconfigboard.mk b/ports/espressif/boards/smartbeedesigns_bee_s3/mpconfigboard.mk new file mode 100644 index 0000000000..99435c69c8 --- /dev/null +++ b/ports/espressif/boards/smartbeedesigns_bee_s3/mpconfigboard.mk @@ -0,0 +1,21 @@ +USB_VID = 0x303A +USB_PID = 0x8111 +USB_PRODUCT = "Bee-S3" +USB_MANUFACTURER = "Smart Bee Designs" + +IDF_TARGET = esp32s3 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB + + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/smartbeedesigns_bee_s3/pins.c b/ports/espressif/boards/smartbeedesigns_bee_s3/pins.c new file mode 100644 index 0000000000..189899fa49 --- /dev/null +++ b/ports/espressif/boards/smartbeedesigns_bee_s3/pins.c @@ -0,0 +1,79 @@ +#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_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) }, + { 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_IO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_IO48), MP_ROM_PTR(&pin_GPIO48) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO48) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44)}, + { MP_ROM_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_VBAT), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_VBAT_SENSE), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_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/smartbeedesigns_bee_s3/sdkconfig b/ports/espressif/boards/smartbeedesigns_bee_s3/sdkconfig new file mode 100644 index 0000000000..b7bb11fdd5 --- /dev/null +++ b/ports/espressif/boards/smartbeedesigns_bee_s3/sdkconfig @@ -0,0 +1,6 @@ +# CONFIG_ESP32S3_SPIRAM_SUPPORT is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="smartbeedesigns_bee_s3" +# end of LWIP diff --git a/ports/espressif/boards/targett_module_clip_wroom/board.c b/ports/espressif/boards/targett_module_clip_wroom/board.c index 66aea4bdd5..ce5a770920 100644 --- a/ports/espressif/boards/targett_module_clip_wroom/board.c +++ b/ports/espressif/boards/targett_module_clip_wroom/board.c @@ -40,13 +40,4 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO16); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk index a64f49c144..a06829b7c6 100644 --- a/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk +++ b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk @@ -12,8 +12,7 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wroom +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESP32_CAMERA = 0 diff --git a/ports/espressif/boards/targett_module_clip_wrover/board.c b/ports/espressif/boards/targett_module_clip_wrover/board.c index 66aea4bdd5..ce5a770920 100644 --- a/ports/espressif/boards/targett_module_clip_wrover/board.c +++ b/ports/espressif/boards/targett_module_clip_wrover/board.c @@ -40,13 +40,4 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO16); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk index 6683acac15..80014bdf98 100644 --- a/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk +++ b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk @@ -12,8 +12,6 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=4MB - -CIRCUITPY_MODULE=wrover +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/unexpectedmaker_feathers2/board.c b/ports/espressif/boards/unexpectedmaker_feathers2/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2/board.c +++ b/ports/espressif/boards/unexpectedmaker_feathers2/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h index d10ab94223..ebea0f447b 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h +++ b/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h @@ -32,6 +32,8 @@ // #define MICROPY_HW_APA102_MOSI (&pin_GPIO40) // #define MICROPY_HW_APA102_SCK (&pin_GPIO45) +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) diff --git a/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk index 84c9787733..10ddea75f1 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 16MB CIRCUITPY_BITBANG_APA102 = 1 diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_neo/board.c b/ports/espressif/boards/unexpectedmaker_feathers2_neo/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2_neo/board.c +++ b/ports/espressif/boards/unexpectedmaker_feathers2_neo/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h index af61a67fbb..aeaf23d248 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h +++ b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h @@ -32,6 +32,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO40) #define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO39) +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk index cef7355051..f42f8ca7cc 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB CIRCUITPY_BITBANG_NEOPIXEL = 1 diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/board.c b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/board.c +++ b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h index a2fadd85ea..1b11b37d66 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h +++ b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h @@ -32,6 +32,8 @@ // #define MICROPY_HW_APA102_MOSI (&pin_GPIO40) // #define MICROPY_HW_APA102_SCK (&pin_GPIO45) +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO38) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO33) diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk index 84c9787733..10ddea75f1 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=40m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 40m +CIRCUITPY_ESP_FLASH_SIZE = 16MB CIRCUITPY_BITBANG_APA102 = 1 diff --git a/ports/espressif/boards/unexpectedmaker_feathers3/board.c b/ports/espressif/boards/unexpectedmaker_feathers3/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers3/board.c +++ b/ports/espressif/boards/unexpectedmaker_feathers3/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h index a341cf0464..67054b8664 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h +++ b/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.h @@ -32,6 +32,8 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO40) #define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO39) +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) diff --git a/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.mk index 866bd15ffa..eb6673b563 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_feathers3/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 16MB #CIRCUITPY_BITBANG_NEOPIXEL = 1 diff --git a/ports/espressif/boards/unexpectedmaker_feathers3/pins.c b/ports/espressif/boards/unexpectedmaker_feathers3/pins.c index 43fdc3c579..9a2fde5a0c 100644 --- a/ports/espressif/boards/unexpectedmaker_feathers3/pins.c +++ b/ports/espressif/boards/unexpectedmaker_feathers3/pins.c @@ -110,7 +110,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4) }, // Ambient Light Sensor { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO39) }, // Second LDO Enable control - { MP_ROM_QSTR(MP_QSTR_I39), MP_ROM_PTR(&pin_GPIO39) }, // Second LDO Enable control + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, // Second LDO Enable control { 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) }, diff --git a/ports/espressif/boards/unexpectedmaker_pros3/board.c b/ports/espressif/boards/unexpectedmaker_pros3/board.c index 0432485111..8fd94f6c8b 100644 --- a/ports/espressif/boards/unexpectedmaker_pros3/board.c +++ b/ports/espressif/boards/unexpectedmaker_pros3/board.c @@ -35,14 +35,3 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO44); #endif /* DEBUG */ } - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} diff --git a/ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.mk index 3b50324d3c..4413a8b641 100644 --- a/ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_pros3/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=16MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 16MB # CIRCUITPY_BITBANG_NEOPIXEL = 1 diff --git a/ports/espressif/boards/unexpectedmaker_pros3/pins.c b/ports/espressif/boards/unexpectedmaker_pros3/pins.c index bc0ca026f3..8c7e050ded 100644 --- a/ports/espressif/boards/unexpectedmaker_pros3/pins.c +++ b/ports/espressif/boards/unexpectedmaker_pros3/pins.c @@ -130,7 +130,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO17) }, // Second LDO Enable control - { MP_ROM_QSTR(MP_QSTR_I17), MP_ROM_PTR(&pin_GPIO17) }, // Second LDO Enable control + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, // Second LDO Enable control { 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) }, diff --git a/ports/espressif/boards/unexpectedmaker_tinypico/board.c b/ports/espressif/boards/unexpectedmaker_tinypico/board.c new file mode 100644 index 0000000000..e59af9528d --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinypico/board.c @@ -0,0 +1,52 @@ +/* + * 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" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +void board_init(void) { + reset_board(); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + // Turn on APA102 power by default + gpio_set_direction(13, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(13, true); +} + +void board_deinit(void) { + // Turn off APA102 power + gpio_set_direction(13, GPIO_MODE_DEF_OUTPUT); + gpio_set_level(13, false); +} diff --git a/ports/espressif/boards/unexpectedmaker_tinypico/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_tinypico/mpconfigboard.h new file mode 100644 index 0000000000..a12ccb0c18 --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinypico/mpconfigboard.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#define MICROPY_HW_BOARD_NAME "TinyPICO" +#define MICROPY_HW_MCU_NAME "ESP32-PICO-D4" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO22, .sda = &pin_GPIO21}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} + +// #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +// Explanation of how a user got into safe mode +// #define BOARD_USER_SAFE_MODE_ACTION translate("pressing BOOT button at start up.\n") + +// 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/unexpectedmaker_tinypico/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_tinypico/mpconfigboard.mk new file mode 100644 index 0000000000..c3569378ce --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinypico/mpconfigboard.mk @@ -0,0 +1,15 @@ +CIRCUITPY_CREATOR_ID = 0xB0B00000 +CIRCUITPY_CREATION_ID = 0x00000001 + +IDF_TARGET = esp32 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/unexpectedmaker_tinypico/pins.c b/ports/espressif/boards/unexpectedmaker_tinypico/pins.c new file mode 100644 index 0000000000..b4843960ae --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinypico/pins.c @@ -0,0 +1,84 @@ +#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_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_IO27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A27), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_IO25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_A25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_IO23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_SDO), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_SDI), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_IO5), 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_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_IO22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_IO32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_A32), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_A33), MP_ROM_PTR(&pin_GPIO33) }, + + // Battery voltage sense pin + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_VBAT), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_VBAT_SENSE), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO35) }, + + // 5V present sense pin + { MP_ROM_QSTR(MP_QSTR_VBUS), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_GPIO2) }, // APA102 + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO12) }, // APA102 + { MP_ROM_QSTR(MP_QSTR_APA102_PWR), MP_ROM_PTR(&pin_GPIO13) }, // APA102 + + { MP_ROM_QSTR(MP_QSTR_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/unexpectedmaker_tinypico/sdkconfig b/ports/espressif/boards/unexpectedmaker_tinypico/sdkconfig new file mode 100644 index 0000000000..2d4d0d4ecc --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinypico/sdkconfig @@ -0,0 +1,20 @@ +# +# 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=y +# CONFIG_SPIRAM_SIZE is not set +CONFIG_ESP32_SPIRAM_SUPPORT=y +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/unexpectedmaker_tinypico_nano/board.c b/ports/espressif/boards/unexpectedmaker_tinypico_nano/board.c new file mode 100644 index 0000000000..d66ab9e5f1 --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinypico_nano/board.c @@ -0,0 +1,46 @@ +/* + * 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" +#include "components/driver/include/driver/gpio.h" +#include "components/hal/include/hal/gpio_hal.h" +#include "common-hal/microcontroller/Pin.h" + +void board_init(void) { + reset_board(); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/unexpectedmaker_tinypico_nano/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_tinypico_nano/mpconfigboard.h new file mode 100644 index 0000000000..3cc64859ce --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinypico_nano/mpconfigboard.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#define MICROPY_HW_BOARD_NAME "TinyPICO Nano" +#define MICROPY_HW_MCU_NAME "ESP32-PICO-D4" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO22, .sda = &pin_GPIO21}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO18, .mosi = &pin_GPIO23, .miso = &pin_GPIO19}} + +// #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +// Explanation of how a user got into safe mode +// #define BOARD_USER_SAFE_MODE_ACTION translate("pressing BOOT button at start up.\n") + +// 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/unexpectedmaker_tinypico_nano/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_tinypico_nano/mpconfigboard.mk new file mode 100644 index 0000000000..2b36b66245 --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinypico_nano/mpconfigboard.mk @@ -0,0 +1,15 @@ +CIRCUITPY_CREATOR_ID = 0xB0B00000 +CIRCUITPY_CREATION_ID = 0x00000002 + +IDF_TARGET = esp32 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/unexpectedmaker_tinypico_nano/pins.c b/ports/espressif/boards/unexpectedmaker_tinypico_nano/pins.c new file mode 100644 index 0000000000..61f65a089b --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinypico_nano/pins.c @@ -0,0 +1,117 @@ +#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_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_IO5), 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_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_A15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_SDI), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_IO22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_IO23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_SDO), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_IO25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_A25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_IO27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A27), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_IO32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO32) }, + { MP_ROM_QSTR(MP_QSTR_A32), MP_ROM_PTR(&pin_GPIO32) }, + + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_A33), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_A34), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_A35), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_A36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_A37), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_A38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_A39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_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/unexpectedmaker_tinypico_nano/sdkconfig b/ports/espressif/boards/unexpectedmaker_tinypico_nano/sdkconfig new file mode 100644 index 0000000000..2d4d0d4ecc --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinypico_nano/sdkconfig @@ -0,0 +1,20 @@ +# +# 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=y +# CONFIG_SPIRAM_SIZE is not set +CONFIG_ESP32_SPIRAM_SUPPORT=y +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/unexpectedmaker_tinys2/board.c b/ports/espressif/boards/unexpectedmaker_tinys2/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/unexpectedmaker_tinys2/board.c +++ b/ports/espressif/boards/unexpectedmaker_tinys2/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk index ead608e6b2..8b1cd8bb51 100644 --- a/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=qio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=4MB +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB CIRCUITPY_BITBANG_NEOPIXEL = 1 diff --git a/ports/espressif/boards/unexpectedmaker_tinys3/board.c b/ports/espressif/boards/unexpectedmaker_tinys3/board.c index 0432485111..b3c8cb4191 100644 --- a/ports/espressif/boards/unexpectedmaker_tinys3/board.c +++ b/ports/espressif/boards/unexpectedmaker_tinys3/board.c @@ -36,13 +36,4 @@ void board_init(void) { #endif /* DEBUG */ } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.mk index 32a711c257..9de950e632 100644 --- a/ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_tinys3/mpconfigboard.mk @@ -12,9 +12,9 @@ LONGINT_IMPL = MPZ # so increase it to 32. CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 -CIRCUITPY_ESP_FLASH_MODE=dio -CIRCUITPY_ESP_FLASH_FREQ=80m -CIRCUITPY_ESP_FLASH_SIZE=8MB +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB # CIRCUITPY_BITBANG_NEOPIXEL = 1 diff --git a/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c new file mode 100644 index 0000000000..070e3418da --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/board.c @@ -0,0 +1,139 @@ +/* + * 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" +#include "shared-module/displayio/__init__.h" +#include "shared-module/displayio/mipi_constants.h" + +#define DELAY 0x80 + + +// display init sequence according to Adafruit_CircuitPython_ST7735R +// https://github.com/adafruit/Adafruit_CircuitPython_ST7735R +uint8_t display_init_sequence[] = { + // sw reset + 0x01, 0 | DELAY, 0x96, + // SLPOUT and Delay + 0x11, 0 | DELAY, 0xFF, + 0xB1, 0x03, 0x01, 0x2C, 0x2D, // _FRMCTR1 + 0xB3, 0x06, 0x01, 0x2C, 0x2D, 0x01, 0x2C, 0x2D, // _FRMCTR3 + 0xB4, 0x01, 0x07, // _INVCTR line inversion + 0xC0, 0x03, 0xA2, 0x02, 0x84, // _PWCTR1 GVDD = 4.7V, 1.0uA + 0xC1, 0x01, 0xC5, // _PWCTR2 VGH=14.7V, VGL=-7.35V + 0xC2, 0x02, 0x0A, 0x00, // _PWCTR3 Opamp current small, Boost frequency + 0xC3, 0x02, 0x8A, 0x2A, + 0xC4, 0x02, 0x8A, 0xEE, + 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, + // 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 + 0xE1, 0x10, 0x03, 0x1D, 0x07, 0x06, 0x2E, 0x2C, 0x29, 0x2D, 0x2E, 0x2E, 0x37, 0x3F, 0x00, 0x00, 0x02, 0x10, // _GMCTRN1 + 0x13, 0 | DELAY, 0x0A, // _NORON + 0x29, 0 | DELAY, 0x64, // _DISPON + // 0x36, 0x01, 0xC0, // _MADCTL Default rotation plus BGR encoding + 0x36, 0x01, 0xC8, // _MADCTL Default rotation plus RGB encoding + 0x21, 0x00, // _INVON +}; + +static void display_init(void) { + busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; + + common_hal_busio_spi_construct( + spi, + &pin_GPIO10, // CLK + &pin_GPIO11, // MOSI + NULL, // MISO not connected + false); // Not half-duplex + + common_hal_busio_spi_never_reset(spi); + + displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus; + bus->base.type = &displayio_fourwire_type; + + common_hal_displayio_fourwire_construct( + bus, + spi, + &pin_GPIO18, // DC + &pin_GPIO9, // CS + &pin_GPIO21, // RST + 40000000, // baudrate + 0, // polarity + 0 // phase + ); + + displayio_display_obj_t *display = &displays[0].display; + display->base.type = &displayio_display_type; + + common_hal_displayio_display_construct( + display, + bus, + 160, // width (after rotation) + 80, // height (after rotation) + 26, // column start + 1, // row start + 90, // rotation + 16, // color depth + false, // grayscale + false, // pixels in a byte share a row. Only valid for depths < 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 + MIPI_COMMAND_SET_COLUMN_ADDRESS, // set column command + MIPI_COMMAND_SET_PAGE_ADDRESS, // set row command + MIPI_COMMAND_WRITE_MEMORY_START, // write memory command + display_init_sequence, + sizeof(display_init_sequence), + &pin_GPIO45, // backlight pin + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness + false, // single_byte_bounds + false, // data_as_commands + true, // auto_refresh + 60, // native_frames_per_second + true, // backlight_on_high + false, // SH1107_addressing + 50000 // backlight pwm frequency + ); +} + + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ + + // Display + display_init(); +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/mpconfigboard.h b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/mpconfigboard.h new file mode 100644 index 0000000000..f9cf2aa384 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/mpconfigboard.h @@ -0,0 +1,40 @@ +/* + * 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 "Waveshare ESP32-S2-Pico-LCD" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO41) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO40) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO10) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO11) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO12) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO44) +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) diff --git a/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/mpconfigboard.mk b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/mpconfigboard.mk new file mode 100644 index 0000000000..6e005bfdd7 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/mpconfigboard.mk @@ -0,0 +1,18 @@ +USB_VID = 0x303a +USB_PID = 0x810c + +USB_PRODUCT = "ESP32-S2-Pico-LCD" +USB_MANUFACTURER = "Waveshare Electronics" + +IDF_TARGET = esp32s2 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE=dio +CIRCUITPY_ESP_FLASH_FREQ=80m +CIRCUITPY_ESP_FLASH_SIZE=4MB diff --git a/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/pins.c b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/pins.c new file mode 100644 index 0000000000..ac1e983202 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/pins.c @@ -0,0 +1,79 @@ +#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_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_USB_IN), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_GP34), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_GP35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_GP36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_GP37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_GP38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_GP39), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_GP40), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_GP41), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_GP42), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_GP43), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_GP44), MP_ROM_PTR(&pin_GPIO44) }, + + // 0.96 inch LCD ST7735s + { MP_ROM_QSTR(MP_QSTR_LCD_MOSI), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CLK), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_LCD_RST), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_LCD_BACKLIGHT), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_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_DISPLAY), MP_ROM_PTR(&displays[0].display) }, + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/sdkconfig b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/sdkconfig new file mode 100644 index 0000000000..836fd46764 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32_s2_pico_lcd/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# 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 +# 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=y +# CONFIG_SPIRAM_SPEED_40M is not set +# 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="waveshare" +# end of LWIP diff --git a/ports/espressif/boards/waveshare_esp32s2_pico/board.c b/ports/espressif/boards/waveshare_esp32s2_pico/board.c new file mode 100644 index 0000000000..b3c8cb4191 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32s2_pico/board.c @@ -0,0 +1,39 @@ +/* + * 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" + +void board_init(void) { + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/waveshare_esp32s2_pico/mpconfigboard.h b/ports/espressif/boards/waveshare_esp32s2_pico/mpconfigboard.h new file mode 100644 index 0000000000..6a10db6061 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32s2_pico/mpconfigboard.h @@ -0,0 +1,32 @@ +/* + * 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 "Waveshare ESP32-S2-Pico" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO9) diff --git a/ports/espressif/boards/waveshare_esp32s2_pico/mpconfigboard.mk b/ports/espressif/boards/waveshare_esp32s2_pico/mpconfigboard.mk new file mode 100644 index 0000000000..3d4937bd93 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32s2_pico/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x303a +USB_PID = 0x810a +USB_PRODUCT = "ESP32-S2-Pico" +USB_MANUFACTURER = "Waveshare Electronics" + +IDF_TARGET = esp32s2 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ + +# The default queue depth of 16 overflows on release builds, +# so increase it to 32. +CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/waveshare_esp32s2_pico/pins.c b/ports/espressif/boards/waveshare_esp32s2_pico/pins.c new file mode 100644 index 0000000000..04054344ae --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32s2_pico/pins.c @@ -0,0 +1,44 @@ +#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_LED), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_GP34), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_GP35), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_GP36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_GP37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_GP38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_GP39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_GP40), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_GP41), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_GP42), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_GP43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_GP44), MP_ROM_PTR(&pin_GPIO44) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/waveshare_esp32s2_pico/sdkconfig b/ports/espressif/boards/waveshare_esp32s2_pico/sdkconfig new file mode 100644 index 0000000000..e1635f6d17 --- /dev/null +++ b/ports/espressif/boards/waveshare_esp32s2_pico/sdkconfig @@ -0,0 +1,17 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 + +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +CONFIG_SPIRAM_USE_MEMMAP=y +CONFIG_SPIRAM_MEMTEST=y + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="waveshare" +# end of LWIP diff --git a/ports/espressif/common-hal/_bleio/Adapter.c b/ports/espressif/common-hal/_bleio/Adapter.c index d72f9dbf02..5eaf6e9cf4 100644 --- a/ports/espressif/common-hal/_bleio/Adapter.c +++ b/ports/espressif/common-hal/_bleio/Adapter.c @@ -59,6 +59,10 @@ #include "esp_bt.h" #include "esp_nimble_hci.h" +#if CIRCUITPY_DOTENV +#include "shared-module/dotenv/__init__.h" +#endif + bleio_connection_internal_t bleio_connections[BLEIO_TOTAL_CONNECTION_COUNT]; // static void bluetooth_adapter_background(void *data) { @@ -96,7 +100,23 @@ void common_hal_bleio_adapter_set_enabled(bleio_adapter_obj_t *self, bool enable // ble_hs_cfg.reset_cb = blecent_on_reset; ble_hs_cfg.sync_cb = _on_sync; // ble_hs_cfg.store_status_cb = ble_store_util_status_rr; + + #if CIRCUITPY_DOTENV + mp_int_t name_len = 0; + char ble_name[32]; + name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1); + if (name_len > 0) { + if (name_len > MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH) { + name_len = MYNEWT_VAL_BLE_SVC_GAP_DEVICE_NAME_MAX_LENGTH; + } + ble_name[name_len] = '\0'; + ble_svc_gap_device_name_set(ble_name); + } else { + ble_svc_gap_device_name_set("CIRCUITPY"); + } + #else ble_svc_gap_device_name_set("CIRCUITPY"); + #endif // Clear all of the internal connection objects. for (size_t i = 0; i < BLEIO_TOTAL_CONNECTION_COUNT; i++) { @@ -574,6 +594,9 @@ void common_hal_bleio_adapter_start_advertising(bleio_adapter_obj_t *self, bool } void common_hal_bleio_adapter_stop_advertising(bleio_adapter_obj_t *self) { + if (!common_hal_bleio_adapter_get_advertising(self)) { + return; + } int err_code = ble_gap_ext_adv_stop(0); self->user_advertising = false; diff --git a/ports/espressif/common-hal/_bleio/Connection.c b/ports/espressif/common-hal/_bleio/Connection.c index 7dbcbd6e5f..63c85099e6 100644 --- a/ports/espressif/common-hal/_bleio/Connection.c +++ b/ports/espressif/common-hal/_bleio/Connection.c @@ -394,6 +394,11 @@ STATIC void discover_remote_services(bleio_connection_internal_t *self, mp_obj_t ? service->end_handle : next_characteristic->def_handle - 1; + // Pre-check if characteristic is empty so descriptor discovery doesn't fail + if (end_handle <= characteristic->handle) { + continue; + } + _last_discovery_status = BLE_ERR_SUCCESS; CHECK_NIMBLE_ERROR(ble_gattc_disc_all_dscs(self->conn_handle, characteristic->handle, end_handle, diff --git a/ports/espressif/common-hal/_bleio/__init__.c b/ports/espressif/common-hal/_bleio/__init__.c index 7eba47d6a1..e25f9b0ef1 100644 --- a/ports/espressif/common-hal/_bleio/__init__.c +++ b/ports/espressif/common-hal/_bleio/__init__.c @@ -42,6 +42,17 @@ // #include "common-hal/_bleio/bonding.h" #include "common-hal/_bleio/ble_events.h" +void bleio_user_reset() { + // Stop any user scanning or advertising. + common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj); + common_hal_bleio_adapter_stop_advertising(&common_hal_bleio_adapter_obj); + + ble_event_remove_heap_handlers(); + + // Maybe start advertising the BLE workflow. + supervisor_bluetooth_background(); +} + // Turn off BLE on a reset or reload. void bleio_reset() { // Set this explicitly to save data. diff --git a/ports/espressif/common-hal/_bleio/ble_events.c b/ports/espressif/common-hal/_bleio/ble_events.c index 1ccd72cb61..a072a80623 100644 --- a/ports/espressif/common-hal/_bleio/ble_events.c +++ b/ports/espressif/common-hal/_bleio/ble_events.c @@ -31,6 +31,7 @@ #include #include +#include "py/gc.h" #include "py/misc.h" #include "py/mpstate.h" #include "py/runtime.h" @@ -44,6 +45,17 @@ void ble_event_reset(void) { MP_STATE_VM(ble_event_handler_entries) = NULL; } +void ble_event_remove_heap_handlers(void) { + ble_event_handler_entry_t *it = MP_STATE_VM(ble_event_handler_entries); + while (it != NULL) { + // If the param is on the heap, then delete the handler. + if (HEAP_PTR(it->param)) { + ble_event_remove_handler(it->func, it->param); + } + it = it->next; + } +} + void ble_event_add_handler_entry(ble_event_handler_entry_t *entry, ble_gap_event_fn *func, void *param) { ble_event_handler_entry_t *it = MP_STATE_VM(ble_event_handler_entries); diff --git a/ports/espressif/common-hal/_bleio/ble_events.h b/ports/espressif/common-hal/_bleio/ble_events.h index 03ff351118..cc6c9e92f7 100644 --- a/ports/espressif/common-hal/_bleio/ble_events.h +++ b/ports/espressif/common-hal/_bleio/ble_events.h @@ -40,6 +40,7 @@ typedef struct ble_event_handler_entry { } ble_event_handler_entry_t; void ble_event_reset(void); +void ble_event_remove_heap_handlers(void); void ble_event_add_handler(ble_gap_event_fn *func, void *param); void ble_event_remove_handler(ble_gap_event_fn *func, void *param); diff --git a/ports/espressif/common-hal/alarm/SleepMemory.c b/ports/espressif/common-hal/alarm/SleepMemory.c index 764125ddb2..d375fdc778 100644 --- a/ports/espressif/common-hal/alarm/SleepMemory.c +++ b/ports/espressif/common-hal/alarm/SleepMemory.c @@ -31,7 +31,6 @@ #include "common-hal/alarm/SleepMemory.h" #include "shared-bindings/alarm/SleepMemory.h" -#include "esp_log.h" #include "esp_sleep.h" // Data storage for singleton instance of SleepMemory. @@ -39,7 +38,7 @@ static RTC_DATA_ATTR uint8_t _sleep_mem[SLEEP_MEMORY_LENGTH]; void alarm_sleep_memory_reset(void) { - // ESP-IDF build system takes care of doing esp_sleep_pd_config() or the equivalentwith + // ESP-IDF build system takes care of doing esp_sleep_pd_config() or the equivalent with // the correct settings, depending on which RTC mem we are using. // https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-reference/system/sleep_modes.html#power-down-of-rtc-peripherals-and-memories } diff --git a/ports/espressif/common-hal/alarm/__init__.c b/ports/espressif/common-hal/alarm/__init__.c index d65ab0bbb2..a47930850d 100644 --- a/ports/espressif/common-hal/alarm/__init__.c +++ b/ports/espressif/common-hal/alarm/__init__.c @@ -39,12 +39,15 @@ #include "shared-bindings/wifi/__init__.h" #include "shared-bindings/microcontroller/__init__.h" +#include "common-hal/digitalio/DigitalInOut.h" + #include "supervisor/port.h" #include "supervisor/shared/workflow.h" #include "esp_sleep.h" #include "soc/rtc_cntl_reg.h" +#include "components/driver/include/driver/gpio.h" #include "components/driver/include/driver/uart.h" // Singleton instance of SleepMemory. @@ -158,7 +161,8 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj return wake_alarm; } -void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms) { +void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms, size_t n_dios, digitalio_digitalinout_obj_t *preserve_dios[]) { + digitalio_digitalinout_preserve_for_deep_sleep(n_dios, preserve_dios); _setup_sleep_alarms(true, n_alarms, alarms); } @@ -166,6 +170,12 @@ void NORETURN common_hal_alarm_enter_deep_sleep(void) { alarm_pin_pinalarm_prepare_for_deep_sleep(); alarm_touch_touchalarm_prepare_for_deep_sleep(); + // We no longer need to remember the pin preservations, since any pin resets are all done. + clear_pin_preservations(); + + // Allow pin holds to work during deep sleep. + gpio_deep_sleep_hold_en(); + // The ESP-IDF caches the deep sleep settings and applies them before sleep. // We don't need to worry about resetting them in the interim. esp_deep_sleep_start(); diff --git a/ports/espressif/common-hal/alarm/pin/PinAlarm.c b/ports/espressif/common-hal/alarm/pin/PinAlarm.c index 6318cc2cca..62496ec4c6 100644 --- a/ports/espressif/common-hal/alarm/pin/PinAlarm.c +++ b/ports/espressif/common-hal/alarm/pin/PinAlarm.c @@ -27,7 +27,7 @@ #include "py/runtime.h" -#include "supervisor/esp_port.h" +#include "supervisor/port.h" #include "shared-bindings/alarm/pin/PinAlarm.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" @@ -90,11 +90,7 @@ STATIC void gpio_interrupt(void *arg) { gpio_ll_intr_disable(&GPIO, 32 + i); } } - BaseType_t high_task_wakeup; - vTaskNotifyGiveFromISR(circuitpython_task, &high_task_wakeup); - if (high_task_wakeup) { - portYIELD_FROM_ISR(); - } + port_wake_main_task_from_isr(); } bool alarm_pin_pinalarm_woke_this_cycle(void) { diff --git a/ports/espressif/common-hal/alarm/time/TimeAlarm.c b/ports/espressif/common-hal/alarm/time/TimeAlarm.c index 256d96a75f..973da33c67 100644 --- a/ports/espressif/common-hal/alarm/time/TimeAlarm.c +++ b/ports/espressif/common-hal/alarm/time/TimeAlarm.c @@ -27,7 +27,7 @@ #include "esp_sleep.h" #include "py/runtime.h" -#include "supervisor/esp_port.h" +#include "supervisor/port.h" #include "components/esp_timer/include/esp_timer.h" @@ -66,7 +66,7 @@ STATIC bool woke_up = false; STATIC void timer_callback(void *arg) { (void)arg; woke_up = true; - xTaskNotifyGive(circuitpython_task); + port_wake_main_task(); } bool alarm_time_timealarm_woke_this_cycle(void) { diff --git a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c index 6ae2421e4c..fc44c1dcc0 100644 --- a/ports/espressif/common-hal/alarm/touch/TouchAlarm.c +++ b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c @@ -26,17 +26,18 @@ #include "shared-bindings/alarm/touch/TouchAlarm.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "esp_sleep.h" #include "peripherals/touch.h" -#include "supervisor/esp_port.h" +#include "supervisor/port.h" static uint16_t touch_channel_mask; static volatile bool woke_up = false; void common_hal_alarm_touch_touchalarm_construct(alarm_touch_touchalarm_obj_t *self, const mcu_pin_obj_t *pin) { if (pin->touch_channel == TOUCH_PAD_MAX) { - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); } claim_pin(pin); self->pin = pin; @@ -57,10 +58,17 @@ mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void) { alarm->base.type = &alarm_touch_touchalarm_type; alarm->pin = NULL; + #if defined(CONFIG_IDF_TARGET_ESP32) + touch_pad_t wake_channel; + if (touch_pad_get_wakeup_status(&wake_channel) != ESP_OK) { + return alarm; + } + #else touch_pad_t wake_channel = touch_pad_get_current_meas_channel(); if (wake_channel == TOUCH_PAD_MAX) { return alarm; } + #endif // Map the pin number back to a pin object. for (size_t i = 0; i < mcu_pin_globals.map.used; i++) { @@ -78,11 +86,7 @@ mp_obj_t alarm_touch_touchalarm_create_wakeup_alarm(void) { STATIC void touch_interrupt(void *arg) { (void)arg; woke_up = true; - BaseType_t task_wakeup; - vTaskNotifyGiveFromISR(circuitpython_task, &task_wakeup); - if (task_wakeup) { - portYIELD_FROM_ISR(); - } + port_wake_main_task_from_isr(); } void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alarms, const mp_obj_t *alarms) { @@ -121,16 +125,27 @@ void alarm_touch_touchalarm_set_alarm(const bool deep_sleep, const size_t n_alar mp_hal_delay_ms(10); // configure trigger threshold + #if defined(CONFIG_IDF_TARGET_ESP32) + uint16_t touch_value; + touch_pad_read(touch_channel, &touch_value); + touch_pad_set_thresh(touch_channel, touch_value / 10); // 10% + #else uint32_t touch_value; touch_pad_read_benchmark(touch_channel, &touch_value); - touch_pad_set_thresh(touch_channel, touch_value * 0.1); // 10% + touch_pad_set_thresh(touch_channel, touch_value / 10); // 10% + #endif } } // configure touch interrupt + #if defined(CONFIG_IDF_TARGET_ESP32) + touch_pad_isr_register(touch_interrupt, NULL); + touch_pad_intr_enable(); + #else touch_pad_timeout_set(true, SOC_TOUCH_PAD_THRESHOLD_MAX); touch_pad_isr_register(touch_interrupt, NULL, TOUCH_PAD_INTR_MASK_ALL); touch_pad_intr_enable(TOUCH_PAD_INTR_MASK_ACTIVE | TOUCH_PAD_INTR_MASK_INACTIVE); + #endif } void alarm_touch_touchalarm_prepare_for_deep_sleep(void) { @@ -153,17 +168,25 @@ void alarm_touch_touchalarm_prepare_for_deep_sleep(void) { // intialize touchpad peripherals_touch_init(touch_channel); + #if !defined(CONFIG_IDF_TARGET_ESP32) // configure touchpad for sleep touch_pad_sleep_channel_enable(touch_channel, true); touch_pad_sleep_channel_enable_proximity(touch_channel, false); + #endif // wait for touch data to reset mp_hal_delay_ms(10); // configure trigger threshold + #if defined(CONFIG_IDF_TARGET_ESP32) + uint16_t touch_value; + touch_pad_read_filtered(touch_channel, &touch_value); + touch_pad_set_thresh(touch_channel, touch_value); + #else uint32_t touch_value; touch_pad_sleep_channel_read_smooth(touch_channel, &touch_value); - touch_pad_sleep_set_threshold(touch_channel, touch_value * 0.1); // 10% + touch_pad_sleep_set_threshold(touch_channel, touch_value / 10); // 10% + #endif // enable touchpad wakeup esp_sleep_enable_touchpad_wakeup(); diff --git a/ports/espressif/common-hal/analogio/AnalogIn.c b/ports/espressif/common-hal/analogio/AnalogIn.c index ba85d42735..fb2e098cb4 100644 --- a/ports/espressif/common-hal/analogio/AnalogIn.c +++ b/ports/espressif/common-hal/analogio/AnalogIn.c @@ -28,7 +28,7 @@ #include "shared-bindings/analogio/AnalogIn.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "components/driver/include/driver/adc_common.h" #include "components/esp_adc_cal/include/esp_adc_cal.h" @@ -40,21 +40,29 @@ #define DEFAULT_VREF 1100 #define NO_OF_SAMPLES 2 #define ATTENUATION ADC_ATTEN_DB_11 -#ifdef CONFIG_IDF_TARGET_ESP32C3 +#if defined(CONFIG_IDF_TARGET_ESP32) +#define DATA_WIDTH ADC_WIDTH_BIT_12 +#elif defined(CONFIG_IDF_TARGET_ESP32C3) #define DATA_WIDTH ADC_WIDTH_BIT_12 #elif defined(CONFIG_IDF_TARGET_ESP32S2) #define DATA_WIDTH ADC_WIDTH_BIT_13 #elif defined(CONFIG_IDF_TARGET_ESP32S3) #define DATA_WIDTH ADC_WIDTH_BIT_12 +#else +#error No known CONFIG_IDF_TARGET_xxx found #endif void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin) { if (pin->adc_index == 0 || pin->adc_channel == ADC_CHANNEL_MAX) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } common_hal_mcu_pin_claim(pin); self->pin = pin; + // Pull-ups are enabled by default for power-saving reasons on quiescent pins. + // Turn off the pull-up as soon as we know the pin will be used for analog reads, + // since it may take a while for the voltage to stabilize if the input is high-impedance. + gpio_pullup_dis(pin->number); } bool common_hal_analogio_analogin_deinited(analogio_analogin_obj_t *self) { @@ -76,7 +84,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { } else if (self->pin->adc_index == ADC_UNIT_2) { adc2_config_channel_atten((adc2_channel_t)self->pin->adc_channel, ATTENUATION); } else { - mp_raise_ValueError(translate("Invalid Pin")); + raise_ValueError_invalid_pin(); } // Automatically select calibration process depending on status of efuse diff --git a/ports/espressif/common-hal/analogio/AnalogOut.c b/ports/espressif/common-hal/analogio/AnalogOut.c index 2b5f9d0b35..1a1e74391b 100644 --- a/ports/espressif/common-hal/analogio/AnalogOut.c +++ b/ports/espressif/common-hal/analogio/AnalogOut.c @@ -33,23 +33,31 @@ #include "shared-bindings/analogio/AnalogOut.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" -#ifdef CONFIG_IDF_TARGET_ESP32S2 +#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2) #include "components/driver/include/driver/dac_common.h" +#define HAS_DAC 1 +#if defined(CONFIG_IDF_TARGET_ESP32) +#define pin_CHANNEL_1 pin_GPIO25 +#define pin_CHANNEL_2 pin_GPIO26 +#elif defined(CONFIG_IDF_TARGET_ESP32S2) +#define pin_CHANNEL_1 pin_GPIO17 +#define pin_CHANNEL_2 pin_GPIO18 +#endif +#else +#define HAS_DAC 0 #endif - -#include "common-hal/microcontroller/Pin.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { - #ifdef CONFIG_IDF_TARGET_ESP32S2 - if (pin == &pin_GPIO17) { + #if HAS_DAC + if (pin == &pin_CHANNEL_1) { self->channel = DAC_CHANNEL_1; - } else if (pin == &pin_GPIO18) { + } else if (pin == &pin_CHANNEL_2) { self->channel = DAC_CHANNEL_2; } else { - mp_raise_ValueError(translate("Invalid DAC pin supplied")); + raise_ValueError_invalid_pin(); } dac_output_enable(self->channel); #else @@ -58,7 +66,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #if HAS_DAC return self->channel == DAC_CHANNEL_MAX; #else return false; @@ -66,7 +74,7 @@ bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { } void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #if HAS_DAC dac_output_disable(self->channel); self->channel = DAC_CHANNEL_MAX; #endif @@ -74,7 +82,7 @@ void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, uint16_t value) { - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #if HAS_DAC uint8_t dac_value = (value * 255) / 65535; dac_output_enable(self->channel); dac_output_voltage(self->channel, dac_value); @@ -82,7 +90,7 @@ void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, } void analogout_reset(void) { - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #if HAS_DAC dac_output_disable(DAC_CHANNEL_1); dac_output_disable(DAC_CHANNEL_2); #endif diff --git a/ports/espressif/common-hal/audiobusio/I2SOut.c b/ports/espressif/common-hal/audiobusio/I2SOut.c index 6548f46071..440151e881 100644 --- a/ports/espressif/common-hal/audiobusio/I2SOut.c +++ b/ports/espressif/common-hal/audiobusio/I2SOut.c @@ -42,7 +42,7 @@ #include "shared-bindings/audiobusio/I2SOut.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "driver/i2s.h" diff --git a/ports/espressif/common-hal/busio/I2C.c b/ports/espressif/common-hal/busio/I2C.c index 0706de1df5..92bd4fb157 100644 --- a/ports/espressif/common-hal/busio/I2C.c +++ b/ports/espressif/common-hal/busio/I2C.c @@ -32,7 +32,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint32_t frequency, uint32_t timeout) { @@ -42,7 +42,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, // // 46 is also input-only so it'll never work. if (scl->number == 45 || scl->number == 46 || sda->number == 45 || sda->number == 46) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } #if CIRCUITPY_REQUIRE_I2C_PULLUPS @@ -113,7 +113,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, if (err == ESP_FAIL) { mp_raise_OSError(MP_EIO); } else { - mp_raise_ValueError(translate("Invalid argument")); + mp_raise_RuntimeError(translate("init I2C")); } } diff --git a/ports/espressif/common-hal/busio/SPI.c b/ports/espressif/common-hal/busio/SPI.c index 4eff1be54c..0b894fa215 100644 --- a/ports/espressif/common-hal/busio/SPI.c +++ b/ports/espressif/common-hal/busio/SPI.c @@ -28,6 +28,7 @@ #include "py/runtime.h" #include "shared-bindings/busio/SPI.h" +#include "shared-bindings/microcontroller/Pin.h" #include "driver/spi_common_internal.h" @@ -101,7 +102,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } else if (result == ESP_ERR_INVALID_ARG) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } set_spi_config(self, 250000, 0, 0, 8); diff --git a/ports/espressif/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c index 0c44107e60..cdaf25250f 100644 --- a/ports/espressif/common-hal/busio/UART.c +++ b/ports/espressif/common-hal/busio/UART.c @@ -25,6 +25,7 @@ */ #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/busio/UART.h" #include "components/driver/include/driver/uart.h" @@ -37,10 +38,10 @@ #include "py/runtime.h" #include "py/stream.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/tick.h" -uint8_t never_reset_uart_mask = 0; +static uint8_t never_reset_uart_mask = 0; static void uart_event_task(void *param) { busio_uart_obj_t *self = param; @@ -49,8 +50,8 @@ static void uart_event_task(void *param) { if (xQueueReceive(self->event_queue, &event, portMAX_DELAY)) { switch (event.type) { case UART_PATTERN_DET: - // When the debug uart receives CTRL+C, wake the main task and schedule a keyboard interrupt - if (self->is_debug) { + // When the console uart receives CTRL+C, wake the main task and schedule a keyboard interrupt + if (self->is_console) { port_wake_main_task(); if (mp_interrupt_char == CHAR_CTRL_C) { uart_flush(self->uart_num); @@ -59,8 +60,8 @@ static void uart_event_task(void *param) { } break; case UART_DATA: - // When the debug uart receives any key, wake the main task - if (self->is_debug) { + // When the console uart receives any key, wake the main task + if (self->is_console) { port_wake_main_task(); } break; @@ -73,13 +74,13 @@ static void uart_event_task(void *param) { void uart_reset(void) { for (uart_port_t num = 0; num < UART_NUM_MAX; num++) { - // Ignore the UART used by the IDF. - #ifdef CONFIG_CONSOLE_UART_NUM - if (num == CONFIG_CONSOLE_UART_NUM) { + #ifdef CONFIG_ESP_CONSOLE_UART_NUM + // Do not reset the UART used by the IDF for logging. + if (num == CONFIG_ESP_CONSOLE_UART_NUM) { continue; } #endif - if (uart_is_driver_installed(num) && !(never_reset_uart_mask & 1 << num)) { + if (uart_is_driver_installed(num) && !(never_reset_uart_mask & (1 << num))) { uart_driver_delete(num); } } @@ -101,14 +102,14 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte *receiver_buffer, bool sigint_enabled) { - if (bits > 8) { - mp_raise_NotImplementedError(translate("bytes > 8 bits not supported")); - } + mp_arg_validate_int_max(bits, 8, MP_QSTR_bytes); bool have_tx = tx != NULL; bool have_rx = rx != NULL; bool have_rts = rts != NULL; bool have_cts = cts != NULL; + + uart_config_t uart_config = {0}; bool have_rs485_dir = rs485_dir != NULL; if (!have_tx && !have_rx) { mp_raise_ValueError(translate("tx and rx cannot both be None")); @@ -136,37 +137,40 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } uart_mode_t mode = UART_MODE_UART; - uart_hw_flowcontrol_t flow_control = UART_HW_FLOWCTRL_DISABLE; + uart_config.flow_ctrl = UART_HW_FLOWCTRL_DISABLE; if (have_rs485_dir) { mode = UART_MODE_RS485_HALF_DUPLEX; if (!rs485_invert) { + // This one is not in the set uart_set_line_inverse(self->uart_num, UART_SIGNAL_DTR_INV); } } else if (have_rts && have_cts) { - flow_control = UART_HW_FLOWCTRL_CTS_RTS; + uart_config.flow_ctrl = UART_HW_FLOWCTRL_CTS_RTS; } else if (have_rts) { - flow_control = UART_HW_FLOWCTRL_RTS; + uart_config.flow_ctrl = UART_HW_FLOWCTRL_RTS; } else if (have_rts) { - flow_control = UART_HW_FLOWCTRL_CTS; + uart_config.flow_ctrl = UART_HW_FLOWCTRL_CTS; } if (receiver_buffer_size <= UART_FIFO_LEN) { receiver_buffer_size = UART_FIFO_LEN + 8; } - uint8_t rx_threshold = UART_FIFO_LEN - 8; + uart_config.rx_flow_ctrl_thresh = UART_FIFO_LEN - 8; // Install the driver before we change the settings. if (uart_driver_install(self->uart_num, receiver_buffer_size, 0, 20, &self->event_queue, 0) != ESP_OK || uart_set_mode(self->uart_num, mode) != ESP_OK) { - mp_raise_ValueError(translate("Could not initialize UART")); + mp_raise_RuntimeError(translate("UART init")); } - // On the debug uart, enable pattern detection to look for CTRL+C - #ifdef CIRCUITPY_DEBUG_UART_RX - if (rx == CIRCUITPY_DEBUG_UART_RX) { - self->is_debug = true; + + // On the console uart, enable pattern detection to look for CTRL+C + #if CIRCUITPY_CONSOLE_UART + if (rx == CIRCUITPY_CONSOLE_UART_RX) { + self->is_console = true; uart_enable_pattern_det_baud_intr(self->uart_num, CHAR_CTRL_C, 1, 1, 0, 0); } #endif + // Start a task to listen for uart events xTaskCreatePinnedToCore( uart_event_task, @@ -176,55 +180,62 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, CONFIG_PTHREAD_TASK_PRIO_DEFAULT, &self->event_task, xPortGetCoreID()); - uart_set_hw_flow_ctrl(self->uart_num, flow_control, rx_threshold); + // uart_set_hw_flow_ctrl(self->uart_num, uart_config.flow_control, uart_config.rx_flow_ctrl_thresh); // Set baud rate - common_hal_busio_uart_set_baudrate(self, baudrate); + // common_hal_busio_uart_set_baudrate(self, baudrate); + uart_config.baud_rate = baudrate; - uart_word_length_t word_length = UART_DATA_8_BITS; + uart_config.data_bits = UART_DATA_8_BITS; switch (bits) { // Shared bindings prevents data < 7 bits. // case 5: - // word_length = UART_DATA_5_BITS; + // uart_config.data_bits = UART_DATA_5_BITS; // break; // case 6: - // word_length = UART_DATA_6_BITS; + // uart_config.data_bits = UART_DATA_6_BITS; // break; case 7: - word_length = UART_DATA_7_BITS; + uart_config.data_bits = UART_DATA_7_BITS; break; case 8: - word_length = UART_DATA_8_BITS; + uart_config.data_bits = UART_DATA_8_BITS; break; default: // Won't hit this because shared-bindings limits to 7-9 bits. We error on 9 above. break; } - uart_set_word_length(self->uart_num, word_length); + // uart_set_word_length(self->uart_num, uart_config.data_bits); - uart_parity_t parity_mode = UART_PARITY_DISABLE; + uart_config.parity = UART_PARITY_DISABLE; switch (parity) { case BUSIO_UART_PARITY_NONE: - parity_mode = UART_PARITY_DISABLE; + uart_config.parity = UART_PARITY_DISABLE; break; case BUSIO_UART_PARITY_EVEN: - parity_mode = UART_PARITY_EVEN; + uart_config.parity = UART_PARITY_EVEN; break; case BUSIO_UART_PARITY_ODD: - parity_mode = UART_PARITY_ODD; + uart_config.parity = UART_PARITY_ODD; break; default: // Won't reach here because the input is an enum that is completely handled. break; } - uart_set_parity(self->uart_num, parity_mode); + // uart_set_parity(self->uart_num, uart_config.parity); // Stop is 1 or 2 always. - uart_stop_bits_t stop_bits = UART_STOP_BITS_1; + uart_config.stop_bits = UART_STOP_BITS_1; if (stop == 2) { - stop_bits = UART_STOP_BITS_2; + uart_config.stop_bits = UART_STOP_BITS_2; + } + // uart_set_stop_bits(self->uart_num, stop_bits); + uart_config.source_clk = UART_SCLK_APB; // guessing here... + + // config all in one? + if (uart_param_config(self->uart_num, &uart_config) != ESP_OK) { + mp_raise_RuntimeError(translate("UART init")); } - uart_set_stop_bits(self->uart_num, stop_bits); self->tx_pin = NULL; self->rx_pin = NULL; @@ -265,7 +276,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, rts_num = rs485_dir->number; } if (uart_set_pin(self->uart_num, tx_num, rx_num, rts_num, cts_num) != ESP_OK) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } } @@ -376,7 +387,7 @@ uint32_t common_hal_busio_uart_get_baudrate(busio_uart_obj_t *self) { void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrate) { if (baudrate > UART_BITRATE_MAX || uart_set_baudrate(self->uart_num, baudrate) != ESP_OK) { - mp_raise_ValueError(translate("Unsupported baudrate")); + mp_arg_error_invalid(MP_QSTR_baudrate); } } diff --git a/ports/espressif/common-hal/busio/UART.h b/ports/espressif/common-hal/busio/UART.h index cd2dcc4d57..4880346015 100644 --- a/ports/espressif/common-hal/busio/UART.h +++ b/ports/espressif/common-hal/busio/UART.h @@ -46,7 +46,7 @@ typedef struct { uint8_t character_bits; bool rx_error; uint32_t timeout_ms; - bool is_debug; + bool is_console; QueueHandle_t event_queue; TaskHandle_t event_task; } busio_uart_obj_t; diff --git a/ports/espressif/common-hal/canio/CAN.c b/ports/espressif/common-hal/canio/CAN.c index fb2e35f1b1..67cf7b9591 100644 --- a/ports/espressif/common-hal/canio/CAN.c +++ b/ports/espressif/common-hal/canio/CAN.c @@ -76,30 +76,42 @@ STATIC twai_timing_config_t get_t_config(int baudrate) { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_25KBITS(); return t_config; } + #if defined(TWAI_TIMING_CONFIG_20KBITS) case 20000: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_20KBITS(); return t_config; } + #endif + #if defined(TWAI_TIMING_CONFIG_16KBITS) case 16000: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_16KBITS(); return t_config; } + #endif + #if defined(TWAI_TIMING_CONFIG_12_5KBITS) case 12500: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_12_5KBITS(); return t_config; } + #endif + #if defined(TWAI_TIMING_CONFIG_10KBITS) case 10000: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_10KBITS(); return t_config; } + #endif + #if defined(TWAI_TIMING_CONFIG_5KBITS) case 5000: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_5KBITS(); return t_config; } + #endif + #if defined(TWAI_TIMING_CONFIG_1KBITS) case 1000: { twai_timing_config_t t_config = TWAI_TIMING_CONFIG_1KBITS(); return t_config; } + #endif default: mp_raise_ValueError(translate("Baudrate not supported by peripheral")); } @@ -133,7 +145,7 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, const mcu_pin_obj_t * if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("ESP-IDF memory allocation failed")); } else if (result == ESP_ERR_INVALID_ARG) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } else if (result != ESP_OK) { mp_raise_OSError_msg_varg(translate("twai_driver_install returned esp-idf error #%d"), (int)result); } diff --git a/ports/espressif/common-hal/countio/Counter.c b/ports/espressif/common-hal/countio/Counter.c index d18196051f..cc4c067266 100644 --- a/ports/espressif/common-hal/countio/Counter.c +++ b/ports/espressif/common-hal/countio/Counter.c @@ -29,14 +29,14 @@ #include "common-hal/microcontroller/Pin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_countio_counter_construct(countio_counter_obj_t *self, const mcu_pin_obj_t *pin, countio_edge_t edge, digitalio_pull_t pull) { claim_pin(pin); // Prepare configuration for the PCNT unit - const pcnt_config_t pcnt_config = { + pcnt_config_t pcnt_config = { // Set PCNT input signal and control GPIOs .pulse_gpio_num = pin->number, .ctrl_gpio_num = PCNT_PIN_NOT_USED, @@ -48,7 +48,7 @@ void common_hal_countio_counter_construct(countio_counter_obj_t *self, }; // Initialize PCNT unit - const int8_t unit = peripherals_pcnt_init(pcnt_config); + const int8_t unit = peripherals_pcnt_init(&pcnt_config); if (unit == -1) { mp_raise_RuntimeError(translate("All PCNT units in use")); } diff --git a/ports/espressif/common-hal/digitalio/DigitalInOut.c b/ports/espressif/common-hal/digitalio/DigitalInOut.c index bf52965d28..63c8ec1a41 100644 --- a/ports/espressif/common-hal/digitalio/DigitalInOut.c +++ b/ports/espressif/common-hal/digitalio/DigitalInOut.c @@ -26,12 +26,26 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "components/driver/include/driver/gpio.h" #include "components/hal/include/hal/gpio_hal.h" +STATIC bool _pin_is_input(uint8_t pin_number) { + const uint32_t iomux = READ_PERI_REG(GPIO_PIN_MUX_REG[pin_number]); + return (iomux & FUN_IE) != 0; +} + +void digitalio_digitalinout_preserve_for_deep_sleep(size_t n_dios, digitalio_digitalinout_obj_t *preserve_dios[]) { + // Mark the pin states of the given DigitalInOuts for preservation during deep sleep + for (size_t i = 0; i < n_dios; i++) { + if (!common_hal_digitalio_digitalinout_deinited(preserve_dios[i])) { + preserve_pin_number(preserve_dios[i]->pin->number); + } + } +} + void common_hal_digitalio_digitalinout_never_reset( digitalio_digitalinout_obj_t *self) { never_reset_pin_number(self->pin->number); @@ -83,8 +97,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output( digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( digitalio_digitalinout_obj_t *self) { - uint32_t iomux = READ_PERI_REG(GPIO_PIN_MUX_REG[self->pin->number]); - if ((iomux & FUN_IE) != 0) { + if (_pin_is_input(self->pin->number)) { return DIRECTION_INPUT; } return DIRECTION_OUTPUT; @@ -142,9 +155,9 @@ void common_hal_digitalio_digitalinout_set_pull( digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( digitalio_digitalinout_obj_t *self) { gpio_num_t gpio_num = self->pin->number; - if (REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], FUN_PU) == 1) { + if (REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], FUN_PU)) { return PULL_UP; - } else if (REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], FUN_PD) == 1) { + } else if (REG_GET_BIT(GPIO_PIN_MUX_REG[gpio_num], FUN_PD)) { return PULL_DOWN; } return PULL_NONE; diff --git a/ports/espressif/common-hal/digitalio/DigitalInOut.h b/ports/espressif/common-hal/digitalio/DigitalInOut.h index 2d42e79809..793d2a0986 100644 --- a/ports/espressif/common-hal/digitalio/DigitalInOut.h +++ b/ports/espressif/common-hal/digitalio/DigitalInOut.h @@ -36,4 +36,6 @@ typedef struct { bool output_value; } digitalio_digitalinout_obj_t; +extern void digitalio_digitalinout_preserve_for_deep_sleep(size_t n_dios, digitalio_digitalinout_obj_t *preserve_dios[]); + #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_DIGITALIO_DIGITALINOUT_H diff --git a/ports/espressif/common-hal/esp32_camera/Camera.c b/ports/espressif/common-hal/esp32_camera/Camera.c new file mode 100644 index 0000000000..5ee112a911 --- /dev/null +++ b/ports/espressif/common-hal/esp32_camera/Camera.c @@ -0,0 +1,286 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "py/runtime.h" + +#include "bindings/esp32_camera/Camera.h" +#include "bindings/espidf/__init__.h" +#include "common-hal/esp32_camera/Camera.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "common-hal/microcontroller/Pin.h" + +#include "esp32-camera/driver/private_include/cam_hal.h" + +#if !CONFIG_SPIRAM +#error esp32_camera only works on boards configured with spiram, disable it in mpconfigboard.mk +#endif + +static void maybe_claim_pin(const mcu_pin_obj_t *pin) { + if (pin) { + claim_pin(pin); + } +} + +void common_hal_esp32_camera_camera_construct( + esp32_camera_camera_obj_t *self, + uint8_t data_pins[8], + const mcu_pin_obj_t *external_clock_pin, + const mcu_pin_obj_t *pixel_clock_pin, + const mcu_pin_obj_t *vsync_pin, + const mcu_pin_obj_t *href_pin, + const mcu_pin_obj_t *powerdown_pin, + const mcu_pin_obj_t *reset_pin, + const busio_i2c_obj_t *i2c, + mp_int_t external_clock_frequency, + pixformat_t pixel_format, + framesize_t frame_size, + mp_int_t jpeg_quality, + mp_int_t framebuffer_count, + camera_grab_mode_t grab_mode) { + + if (common_hal_espidf_get_reserved_psram() == 0) { + mp_raise_msg(&mp_type_MemoryError, translate( + "esp32_camera.Camera requires reserved PSRAM to be configured. " + "See the documentation for instructions.")); + } + for (int i = 0; i < 8; i++) { + claim_pin_number(data_pins[i]); + } + claim_pin(external_clock_pin); + claim_pin(pixel_clock_pin); + claim_pin(vsync_pin); + claim_pin(href_pin); + maybe_claim_pin(powerdown_pin); + maybe_claim_pin(reset_pin); + + common_hal_pwmio_pwmout_construct(&self->pwm, external_clock_pin, 1, external_clock_frequency, true); + + self->camera_config.pin_pwdn = common_hal_mcu_pin_number(powerdown_pin); + self->camera_config.pin_reset = common_hal_mcu_pin_number(reset_pin); + self->camera_config.pin_xclk = common_hal_mcu_pin_number(external_clock_pin); + + self->camera_config.pin_sccb_sda = NO_PIN; + self->camera_config.pin_sccb_scl = NO_PIN; + /* sccb i2c port set below */ + + self->camera_config.pin_d7 = data_pins[7]; + self->camera_config.pin_d6 = data_pins[6]; + self->camera_config.pin_d5 = data_pins[5]; + self->camera_config.pin_d4 = data_pins[4]; + self->camera_config.pin_d3 = data_pins[3]; + self->camera_config.pin_d2 = data_pins[2]; + self->camera_config.pin_d1 = data_pins[1]; + self->camera_config.pin_d0 = data_pins[0]; + + self->camera_config.pin_vsync = common_hal_mcu_pin_number(vsync_pin); + self->camera_config.pin_href = common_hal_mcu_pin_number(href_pin); + self->camera_config.pin_pclk = common_hal_mcu_pin_number(pixel_clock_pin); + + self->camera_config.xclk_freq_hz = external_clock_frequency; + + self->camera_config.ledc_timer = self->pwm.tim_handle.timer_num; + self->camera_config.ledc_channel = self->pwm.chan_handle.channel; + + self->camera_config.pixel_format = pixel_format; + self->camera_config.frame_size = frame_size; + self->camera_config.jpeg_quality = jpeg_quality; + self->camera_config.fb_count = framebuffer_count; + self->camera_config.grab_mode = grab_mode; + + self->camera_config.sccb_i2c_port = i2c->i2c_num; + + CHECK_ESP_RESULT(esp_camera_init(&self->camera_config)); +} + +extern void common_hal_esp32_camera_camera_deinit(esp32_camera_camera_obj_t *self) { + if (common_hal_esp32_camera_camera_deinited(self)) { + return; + } + + common_hal_pwmio_pwmout_deinit(&self->pwm); + + reset_pin_number(self->camera_config.pin_pwdn); + reset_pin_number(self->camera_config.pin_reset); + reset_pin_number(self->camera_config.pin_xclk); + + reset_pin_number(self->camera_config.pin_d7); + reset_pin_number(self->camera_config.pin_d6); + reset_pin_number(self->camera_config.pin_d5); + reset_pin_number(self->camera_config.pin_d4); + reset_pin_number(self->camera_config.pin_d3); + reset_pin_number(self->camera_config.pin_d2); + reset_pin_number(self->camera_config.pin_d1); + reset_pin_number(self->camera_config.pin_d0); + + esp_camera_deinit(); + + self->camera_config.xclk_freq_hz = 0; +} + +bool common_hal_esp32_camera_camera_deinited(esp32_camera_camera_obj_t *self) { + return !self->camera_config.xclk_freq_hz; +} + +bool common_hal_esp32_camera_camera_available(esp32_camera_camera_obj_t *self) { + return esp_camera_fb_available(); +} + +camera_fb_t *common_hal_esp32_camera_camera_take(esp32_camera_camera_obj_t *self, int timeout_ms) { + if (self->buffer_to_return) { + esp_camera_fb_return(self->buffer_to_return); + self->buffer_to_return = NULL; + } + return self->buffer_to_return = esp_camera_fb_get_timeout(timeout_ms); +} + +#define SENSOR_GETSET(type, name, field_name, setter_function_name) \ + SENSOR_GET(type, name, field_name, setter_function_name) \ + SENSOR_SET(type, name, setter_function_name) + +#define SENSOR_STATUS_GETSET(type, name, status_field_name, setter_function_name) \ + SENSOR_GETSET(type, name, status.status_field_name, setter_function_name) + +#define SENSOR_GET(type, name, status_field_name, setter_function_name) \ + type common_hal_esp32_camera_camera_get_##name(esp32_camera_camera_obj_t * self) { \ + sensor_t *sensor = esp_camera_sensor_get(); \ + if (!sensor->setter_function_name) { \ + mp_raise_AttributeError(translate("no such attribute")); \ + } \ + return sensor->status_field_name; \ + } + +#define SENSOR_SET(type, name, setter_function_name) \ + void common_hal_esp32_camera_camera_set_##name(esp32_camera_camera_obj_t * self, type value) { \ + sensor_t *sensor = esp_camera_sensor_get(); \ + if (!sensor->setter_function_name) { \ + mp_raise_AttributeError(translate("no such attribute")); \ + } \ + if (sensor->setter_function_name(sensor, value) < 0) { \ + mp_raise_ValueError(translate("invalid setting")); \ + } \ + } + +pixformat_t common_hal_esp32_camera_camera_get_pixel_format(esp32_camera_camera_obj_t *self) { + return self->camera_config.pixel_format; +} + +framesize_t common_hal_esp32_camera_camera_get_frame_size(esp32_camera_camera_obj_t *self) { + return self->camera_config.frame_size; +} + +void common_hal_esp32_camera_camera_reconfigure(esp32_camera_camera_obj_t *self, framesize_t frame_size, pixformat_t pixel_format, camera_grab_mode_t grab_mode, mp_int_t framebuffer_count) { + sensor_t *sensor = esp_camera_sensor_get(); + camera_sensor_info_t *sensor_info = esp_camera_sensor_get_info(&sensor->id); + + if (PIXFORMAT_JPEG == pixel_format && (!sensor_info->support_jpeg)) { + raise_esp_error(ESP_ERR_NOT_SUPPORTED); + } + + if (frame_size > sensor_info->max_size) { + frame_size = sensor_info->max_size; + } + + cam_deinit(); + self->camera_config.pixel_format = pixel_format; + self->camera_config.frame_size = frame_size; + self->camera_config.grab_mode = grab_mode; + self->camera_config.fb_count = framebuffer_count; + sensor->set_pixformat(sensor, self->camera_config.pixel_format); + sensor->set_framesize(sensor, self->camera_config.frame_size); + cam_init(&self->camera_config); + cam_config(&self->camera_config, frame_size, sensor_info->pid); + cam_start(); +} + +SENSOR_STATUS_GETSET(int, contrast, contrast, set_contrast); +SENSOR_STATUS_GETSET(int, brightness, brightness, set_brightness); +SENSOR_STATUS_GETSET(int, saturation, saturation, set_saturation); +SENSOR_STATUS_GETSET(int, sharpness, sharpness, set_sharpness); +SENSOR_STATUS_GETSET(int, denoise, denoise, set_denoise); +SENSOR_STATUS_GETSET(gainceiling_t, gainceiling, gainceiling, set_gainceiling); +SENSOR_STATUS_GETSET(int, quality, quality, set_quality); +SENSOR_STATUS_GETSET(bool, colorbar, colorbar, set_colorbar); +SENSOR_STATUS_GETSET(bool, whitebal, awb, set_whitebal); +SENSOR_STATUS_GETSET(bool, gain_ctrl, agc, set_gain_ctrl); +SENSOR_STATUS_GETSET(bool, exposure_ctrl, aec, set_exposure_ctrl); +SENSOR_STATUS_GETSET(bool, hmirror, hmirror, set_hmirror); +SENSOR_STATUS_GETSET(bool, vflip, vflip, set_vflip); +SENSOR_STATUS_GETSET(bool, aec2, aec2, set_aec2); +SENSOR_STATUS_GETSET(bool, awb_gain, awb_gain, set_awb_gain); +SENSOR_STATUS_GETSET(int, agc_gain, agc_gain, set_agc_gain); +SENSOR_STATUS_GETSET(int, aec_value, aec_value, set_aec_value); +SENSOR_STATUS_GETSET(int, special_effect, special_effect, set_special_effect); +SENSOR_STATUS_GETSET(int, wb_mode, wb_mode, set_wb_mode); +SENSOR_STATUS_GETSET(int, ae_level, ae_level, set_ae_level); +SENSOR_STATUS_GETSET(bool, dcw, dcw, set_dcw); +SENSOR_STATUS_GETSET(bool, bpc, bpc, set_bpc); +SENSOR_STATUS_GETSET(bool, wpc, wpc, set_wpc); +SENSOR_STATUS_GETSET(bool, raw_gma, raw_gma, set_raw_gma); +SENSOR_STATUS_GETSET(bool, lenc, lenc, set_lenc); + +const char *common_hal_esp32_camera_camera_get_sensor_name(esp32_camera_camera_obj_t *self) { + sensor_t *sensor = esp_camera_sensor_get(); + camera_sensor_info_t *sensor_info = esp_camera_sensor_get_info(&sensor->id); + return sensor_info->name; +} + +const bool common_hal_esp32_camera_camera_get_supports_jpeg(esp32_camera_camera_obj_t *self) { + sensor_t *sensor = esp_camera_sensor_get(); + camera_sensor_info_t *sensor_info = esp_camera_sensor_get_info(&sensor->id); + return sensor_info->support_jpeg; +} + +const framesize_t common_hal_esp32_camera_camera_get_max_frame_size(esp32_camera_camera_obj_t *self) { + sensor_t *sensor = esp_camera_sensor_get(); + camera_sensor_info_t *sensor_info = esp_camera_sensor_get_info(&sensor->id); + return sensor_info->max_size; +} + +const int common_hal_esp32_camera_camera_get_address(esp32_camera_camera_obj_t *self) { + sensor_t *sensor = esp_camera_sensor_get(); + camera_sensor_info_t *sensor_info = esp_camera_sensor_get_info(&sensor->id); + return sensor_info->sccb_addr; +} + +const int common_hal_esp32_camera_camera_get_width(esp32_camera_camera_obj_t *self) { + sensor_t *sensor = esp_camera_sensor_get(); + framesize_t framesize = sensor->status.framesize; + return resolution[framesize].width; +} + +const int common_hal_esp32_camera_camera_get_height(esp32_camera_camera_obj_t *self) { + sensor_t *sensor = esp_camera_sensor_get(); + framesize_t framesize = sensor->status.framesize; + return resolution[framesize].height; +} + +const camera_grab_mode_t common_hal_esp32_camera_camera_get_grab_mode(esp32_camera_camera_obj_t *self) { + return self->camera_config.grab_mode; +} + +const int common_hal_esp32_camera_camera_get_framebuffer_count(esp32_camera_camera_obj_t *self) { + return self->camera_config.fb_count; +} diff --git a/ports/espressif/common-hal/esp32_camera/Camera.h b/ports/espressif/common-hal/esp32_camera/Camera.h new file mode 100644 index 0000000000..9c21f81b16 --- /dev/null +++ b/ports/espressif/common-hal/esp32_camera/Camera.h @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "py/obj.h" +#include "esp_camera.h" +#include "shared-bindings/pwmio/PWMOut.h" + +typedef struct esp32_camera_camera_obj { + mp_obj_base_t base; + camera_config_t camera_config; + camera_fb_t *buffer_to_return; + pwmio_pwmout_obj_t pwm; +} esp32_camera_obj_t; diff --git a/ports/espressif/common-hal/espidf/__init__.c b/ports/espressif/common-hal/espidf/__init__.c new file mode 100644 index 0000000000..183ebb3817 --- /dev/null +++ b/ports/espressif/common-hal/espidf/__init__.c @@ -0,0 +1,194 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "bindings/espidf/__init__.h" +#include "supervisor/shared/translate/translate.h" +#include "supervisor/memory.h" +#include "py/runtime.h" + +#include "esp_log.h" +#define TAG "espidf" + +#ifdef CONFIG_SPIRAM +#include "esp32/spiram.h" +#include "esp_heap_caps.h" +#include "esp_heap_caps_init.h" +#include "soc/soc.h" +#ifdef CONFIG_IDF_TARGET_ESP32 +#include "esp32/himem.h" +#else +#define esp_himem_reserved_area_size() (0) +#endif +bool ok_to_reserve_psram = true; +size_t reserved_psram = DEFAULT_RESERVED_PSRAM; +#endif + +static size_t psram_size_usable(void) { + #ifdef CONFIG_SPIRAM + /* PSRAM chip may be larger than the size we can map into address space */ + size_t s = MIN(esp_spiram_get_size(), SOC_EXTRAM_DATA_SIZE); + return s - esp_himem_reserved_area_size(); + #else + return 0; + #endif +} + +bool common_hal_espidf_set_reserved_psram(size_t amount) { + #ifdef CONFIG_SPIRAM + if (!esp_spiram_is_initialized()) { + return false; + } + if (!ok_to_reserve_psram) { + return false; + } + if (amount > psram_size_usable()) { + return false; + } + reserved_psram = amount; + return true; + #else + return false; + #endif +} + +supervisor_allocation *psram_for_idf; + +void common_hal_espidf_reserve_psram(void) { + #ifdef CONFIG_SPIRAM + if (!psram_for_idf) { + ESP_LOGI(TAG, "Reserving %d bytes of psram", reserved_psram); + if (reserved_psram == 0) { + return; + } + psram_for_idf = allocate_memory(reserved_psram, true, false); + if (psram_for_idf) { + intptr_t psram_for_idf_start = (intptr_t)psram_for_idf->ptr; + intptr_t psram_for_idf_end = psram_for_idf_start + reserved_psram; + ESP_LOGI(TAG, "Reserved %x..%x", psram_for_idf_start, psram_for_idf_end); + heap_caps_add_region(psram_for_idf_start, psram_for_idf_end); + } else { + ESP_LOGE(TAG, "supervisor allocation failed"); + } + } + #endif +} + +size_t common_hal_espidf_get_reserved_psram(void) { + #ifdef CONFIG_SPIRAM + return reserved_psram; + #else + return 0; + #endif +} + +size_t common_hal_espidf_get_total_psram(void) { + return psram_size_usable(); +} + +intptr_t common_hal_espidf_get_psram_start(void) { + #ifdef CONFIG_SPIRAM + if (esp_spiram_is_initialized()) { + #ifdef CONFIG_IDF_TARGET_ESP32 + return SOC_EXTRAM_DATA_LOW; + #else + return SOC_EXTRAM_DATA_HIGH - psram_size_usable(); + #endif + } + #endif + return 0; +} + +intptr_t common_hal_espidf_get_psram_end(void) { + #ifdef CONFIG_SPIRAM + if (esp_spiram_is_initialized()) { + return common_hal_espidf_get_psram_start() + psram_size_usable(); + } + #endif + return 0; +} + +void raise_esp_error(esp_err_t err) { + const compressed_string_t *msg = NULL; + const mp_obj_type_t *exception_type = &mp_type_espidf_IDFError; + switch (err) { + case ESP_FAIL: + msg = translate("Generic Failure"); + break; + case ESP_ERR_NO_MEM: + exception_type = &mp_type_espidf_MemoryError; + msg = translate("Out of memory"); + break; + case ESP_ERR_INVALID_ARG: + msg = translate("Invalid argument"); + break; + case ESP_ERR_INVALID_STATE: + msg = translate("Invalid state"); + break; + case ESP_ERR_INVALID_SIZE: + msg = translate("Invalid size"); + break; + case ESP_ERR_NOT_FOUND: + msg = translate("Requested resource not found"); + break; + case ESP_ERR_NOT_SUPPORTED: + msg = translate("Operation or feature not supported"); + break; + case ESP_ERR_TIMEOUT: + msg = translate("Operation timed out"); + break; + case ESP_ERR_INVALID_RESPONSE: + msg = translate("Received response was invalid"); + break; + case ESP_ERR_INVALID_CRC: + msg = translate("CRC or checksum was invalid"); + break; + case ESP_ERR_INVALID_VERSION: + msg = translate("Version was invalid"); + break; + case ESP_ERR_INVALID_MAC: + msg = translate("MAC address was invalid"); + break; + } + if (msg) { + mp_raise_msg(exception_type, msg); + } + + const char *group = "ESP-IDF"; + + // tests must be in descending order + MP_STATIC_ASSERT(ESP_ERR_FLASH_BASE > ESP_ERR_MESH_BASE); + MP_STATIC_ASSERT(ESP_ERR_MESH_BASE > ESP_ERR_WIFI_BASE); + if (err >= ESP_ERR_FLASH_BASE) { + group = "Flash"; + } else if (err >= ESP_ERR_MESH_BASE) { + group = "Mesh"; + } else if (err >= ESP_ERR_WIFI_BASE) { + group = "WiFi"; + } + mp_raise_msg_varg(exception_type, translate("%s error 0x%x"), group, err); +} + +MP_REGISTER_MODULE(MP_QSTR_espidf, espidf_module, CIRCUITPY_ESPIDF); diff --git a/ports/espressif/common-hal/espidf/__init__.h b/ports/espressif/common-hal/espidf/__init__.h new file mode 100644 index 0000000000..0d168b105c --- /dev/null +++ b/ports/espressif/common-hal/espidf/__init__.h @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "bindings/espidf/__init__.h" diff --git a/ports/espressif/common-hal/frequencyio/FrequencyIn.c b/ports/espressif/common-hal/frequencyio/FrequencyIn.c index e4d65c95bd..d35614ea19 100644 --- a/ports/espressif/common-hal/frequencyio/FrequencyIn.c +++ b/ports/espressif/common-hal/frequencyio/FrequencyIn.c @@ -55,21 +55,35 @@ static void IRAM_ATTR timer_interrupt_handler(void *self_in) { // reset interrupt timg_dev_t *device = self->timer.group ? &(TIMERG1) : &(TIMERG0); + + #if defined(CONFIG_IDF_TARGET_ESP32) + if (self->timer.idx) { + device->int_clr_timers.t1 = 1; + } else { + device->int_clr_timers.t0 = 1; + } + #else if (self->timer.idx) { device->int_clr_timers.t1_int_clr = 1; } else { device->int_clr_timers.t0_int_clr = 1; } - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #endif + + #if defined(CONFIG_IDF_TARGET_ESP32) + device->hw_timer[self->timer.idx].config.alarm_en = 1; + #elif defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C2) device->hw_timer[self->timer.idx].config.tx_alarm_en = 1; #elif defined(CONFIG_IDF_TARGET_ESP32S3) device->hw_timer[self->timer.idx].config.tn_alarm_en = 1; + #else + #error No known CONFIG_IDF_TARGET_xxx found #endif } static void init_pcnt(frequencyio_frequencyin_obj_t *self) { // Prepare configuration for the PCNT unit - const pcnt_config_t pcnt_config = { + pcnt_config_t pcnt_config = { // Set PCNT input signal and control GPIOs .pulse_gpio_num = self->pin, .ctrl_gpio_num = PCNT_PIN_NOT_USED, @@ -83,7 +97,7 @@ static void init_pcnt(frequencyio_frequencyin_obj_t *self) { }; // initialize PCNT - const int8_t unit = peripherals_pcnt_init(pcnt_config); + const int8_t unit = peripherals_pcnt_init(&pcnt_config); if (unit == -1) { mp_raise_RuntimeError(translate("All PCNT units in use")); } @@ -130,9 +144,7 @@ static void init_timer(frequencyio_frequencyin_obj_t *self) { void common_hal_frequencyio_frequencyin_construct(frequencyio_frequencyin_obj_t *self, const mcu_pin_obj_t *pin, const uint16_t capture_period) { - if ((capture_period == 0) || (capture_period > 500)) { - mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); - } + mp_arg_validate_int_range(capture_period, 1, 500, MP_QSTR_capture_period); self->pin = pin->number; self->handle = NULL; @@ -188,9 +200,8 @@ uint16_t common_hal_frequencyio_frequencyin_get_capture_period(frequencyio_frequ } void common_hal_frequencyio_frequencyin_set_capture_period(frequencyio_frequencyin_obj_t *self, uint16_t capture_period) { - if ((capture_period == 0) || (capture_period > 500)) { - mp_raise_ValueError(translate("Invalid capture period. Valid range: 1 - 500")); - } + mp_arg_validate_int_range(capture_period, 1, 500, MP_QSTR_capture_period); + self->capture_period = capture_period; common_hal_frequencyio_frequencyin_clear(self); timer_set_alarm_value(self->timer.group, self->timer.idx, capture_period * 1000000); diff --git a/shared-module/gamepadshift/__init__.c b/ports/espressif/common-hal/hashlib/Hash.c similarity index 53% rename from shared-module/gamepadshift/__init__.c rename to ports/espressif/common-hal/hashlib/Hash.c index eadd3034f6..8090128acb 100644 --- a/shared-module/gamepadshift/__init__.c +++ b/ports/espressif/common-hal/hashlib/Hash.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2019 Scott Shawcroft + * Copyright (c) 2022 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 @@ -24,34 +24,34 @@ * THE SOFTWARE. */ -#include "shared-module/gamepadshift/__init__.h" +#include "shared-bindings/hashlib/Hash.h" -#include "py/mpstate.h" -#include "shared-bindings/gamepadshift/GamePadShift.h" +#include "components/mbedtls/mbedtls/include/mbedtls/ssl.h" -void gamepadshift_tick(void) { - void *singleton = MP_STATE_VM(gamepad_singleton); - if (singleton == NULL || !mp_obj_is_type(MP_OBJ_FROM_PTR(singleton), &gamepadshift_type)) { +void common_hal_hashlib_hash_update(hashlib_hash_obj_t *self, const uint8_t *data, size_t datalen) { + if (self->hash_type == MBEDTLS_SSL_HASH_SHA1) { + mbedtls_sha1_update_ret(&self->sha1, data, datalen); return; } +} - gamepadshift_obj_t *self = MP_OBJ_TO_PTR(singleton); - uint8_t current = 0; - uint8_t bit = 1; - common_hal_digitalio_digitalinout_set_value(self->latch_pin, 1); - for (int i = 0; i < 8; ++i) { - common_hal_digitalio_digitalinout_set_value(self->clock_pin, 0); - if (common_hal_digitalio_digitalinout_get_value(self->data_pin)) { - current |= bit; - } - common_hal_digitalio_digitalinout_set_value(self->clock_pin, 1); - bit <<= 1; +void common_hal_hashlib_hash_digest(hashlib_hash_obj_t *self, uint8_t *data, size_t datalen) { + if (datalen < common_hal_hashlib_hash_get_digest_size(self)) { + return; + } + if (self->hash_type == MBEDTLS_SSL_HASH_SHA1) { + // We copy the sha1 state so we can continue to update if needed or get + // the digest a second time. + mbedtls_sha1_context copy; + mbedtls_sha1_clone(©, &self->sha1); + mbedtls_sha1_finish_ret(&self->sha1, data); + mbedtls_sha1_clone(&self->sha1, ©); } - common_hal_digitalio_digitalinout_set_value(self->latch_pin, 0); - self->pressed |= self->last & current; - self->last = current; } -void gamepadshift_reset(void) { - MP_STATE_VM(gamepad_singleton) = NULL; +size_t common_hal_hashlib_hash_get_digest_size(hashlib_hash_obj_t *self) { + if (self->hash_type == MBEDTLS_SSL_HASH_SHA1) { + return 20; + } + return 0; } diff --git a/ports/espressif/common-hal/hashlib/Hash.h b/ports/espressif/common-hal/hashlib/Hash.h new file mode 100644 index 0000000000..ece282833e --- /dev/null +++ b/ports/espressif/common-hal/hashlib/Hash.h @@ -0,0 +1,41 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_HASHLIB_HASH_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_HASHLIB_HASH_H + +#include "components/mbedtls/mbedtls/include/mbedtls/sha1.h" + +typedef struct { + mp_obj_base_t base; + union { + mbedtls_sha1_context sha1; + }; + // Of MBEDTLS_SSL_HASH_* + uint8_t hash_type; +} hashlib_hash_obj_t; + +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_HASHLIB_HASH_H diff --git a/ports/espressif/common-hal/hashlib/__init__.c b/ports/espressif/common-hal/hashlib/__init__.c new file mode 100644 index 0000000000..1e6b2a4802 --- /dev/null +++ b/ports/espressif/common-hal/hashlib/__init__.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "shared-bindings/hashlib/__init__.h" + +#include "components/mbedtls/mbedtls/include/mbedtls/ssl.h" + + +bool common_hal_hashlib_new(hashlib_hash_obj_t *self, const char *algorithm) { + if (strcmp(algorithm, "sha1") == 0) { + self->hash_type = MBEDTLS_SSL_HASH_SHA1; + mbedtls_sha1_init(&self->sha1); + mbedtls_sha1_starts_ret(&self->sha1); + return true; + } + return false; +} diff --git a/ports/espressif/common-hal/i2cperipheral/__init__.c b/ports/espressif/common-hal/i2cperipheral/__init__.c deleted file mode 100644 index c67511c536..0000000000 --- a/ports/espressif/common-hal/i2cperipheral/__init__.c +++ /dev/null @@ -1 +0,0 @@ -// No i2cperipheral module functions. diff --git a/ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c b/ports/espressif/common-hal/i2ctarget/I2CTarget.c similarity index 75% rename from ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c rename to ports/espressif/common-hal/i2ctarget/I2CTarget.c index d073a8a362..ad0d09967a 100644 --- a/ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c +++ b/ports/espressif/common-hal/i2ctarget/I2CTarget.c @@ -24,14 +24,15 @@ * THE SOFTWARE. */ -#include "shared-bindings/i2cperipheral/I2CPeripheral.h" +#include "shared-bindings/i2ctarget/I2CTarget.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "common-hal/i2cperipheral/I2CPeripheral.h" +#include "common-hal/i2ctarget/I2CTarget.h" +#include "shared-bindings/microcontroller/Pin.h" -void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, +void common_hal_i2ctarget_i2c_target_construct(i2ctarget_i2c_target_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint8_t *addresses, unsigned int num_addresses, bool smbus) { // Pins 45 and 46 are "strapping" pins that impact start up behavior. They usually need to @@ -39,7 +40,7 @@ void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_periphe // support I2C on these pins. // Also 46 is input-only so it'll never work. if (scl->number == 45 || scl->number == 46 || sda->number == 45 || sda->number == 46) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if (num_addresses > 1) { @@ -72,7 +73,7 @@ void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_periphe if (err == ESP_FAIL) { mp_raise_OSError(MP_EIO); } else { - mp_raise_ValueError(translate("Invalid argument")); + mp_arg_error_invalid(MP_QSTR_I2CTarget); } } @@ -80,12 +81,12 @@ void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_periphe claim_pin(scl); } -bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self) { +bool common_hal_i2ctarget_i2c_target_deinited(i2ctarget_i2c_target_obj_t *self) { return self->sda_pin == NULL; } -void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self) { - if (common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { +void common_hal_i2ctarget_i2c_target_deinit(i2ctarget_i2c_target_obj_t *self) { + if (common_hal_i2ctarget_i2c_target_deinited(self)) { return; } @@ -97,7 +98,7 @@ void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral self->scl_pin = NULL; } -int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, +int common_hal_i2ctarget_i2c_target_is_addressed(i2ctarget_i2c_target_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart) { *address = self->addresses[0]; *is_read = true; @@ -105,21 +106,21 @@ int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_perip return 1; } -int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data) { +int common_hal_i2ctarget_i2c_target_read_byte(i2ctarget_i2c_target_obj_t *self, uint8_t *data) { i2c_slave_read_buffer(self->i2c_num, data, 128, 0); return 1; } -int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data) { +int common_hal_i2ctarget_i2c_target_write_byte(i2ctarget_i2c_target_obj_t *self, uint8_t data) { i2c_reset_tx_fifo(self->i2c_num); i2c_slave_write_buffer(self->i2c_num, &data, 128, 0); return 1; } -void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack) { +void common_hal_i2ctarget_i2c_target_ack(i2ctarget_i2c_target_obj_t *self, bool ack) { } -void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self) { +void common_hal_i2ctarget_i2c_target_close(i2ctarget_i2c_target_obj_t *self) { } diff --git a/ports/espressif/common-hal/i2cperipheral/I2CPeripheral.h b/ports/espressif/common-hal/i2ctarget/I2CTarget.h similarity index 85% rename from ports/espressif/common-hal/i2cperipheral/I2CPeripheral.h rename to ports/espressif/common-hal/i2ctarget/I2CTarget.h index d3b324b39a..422bd720eb 100644 --- a/ports/espressif/common-hal/i2cperipheral/I2CPeripheral.h +++ b/ports/espressif/common-hal/i2ctarget/I2CTarget.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H -#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H +#ifndef MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_TARGET_H +#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_TARGET_H #include "py/obj.h" #include "peripherals/i2c.h" @@ -38,6 +38,6 @@ typedef struct { uint8_t num_addresses; const mcu_pin_obj_t *scl_pin; const mcu_pin_obj_t *sda_pin; -} i2cperipheral_i2c_peripheral_obj_t; +} i2ctarget_i2c_target_obj_t; -#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H +#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_TARGET_H diff --git a/ports/espressif/common-hal/i2ctarget/__init__.c b/ports/espressif/common-hal/i2ctarget/__init__.c new file mode 100644 index 0000000000..4ec26465ad --- /dev/null +++ b/ports/espressif/common-hal/i2ctarget/__init__.c @@ -0,0 +1 @@ +// No i2ctarget module functions. diff --git a/ports/espressif/common-hal/imagecapture/ParallelImageCapture.c b/ports/espressif/common-hal/imagecapture/ParallelImageCapture.c index b167b5c734..7456e474a9 100644 --- a/ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +++ b/ports/espressif/common-hal/imagecapture/ParallelImageCapture.c @@ -41,9 +41,7 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle const mcu_pin_obj_t *horizontal_reference) { // only 8 bits is supported at present - if (data_count < 8 || data_count > 16) { - mp_raise_ValueError_varg(translate("%q must be between %d and %d"), MP_QSTR_data_count, 8, 16); - } + mp_arg_validate_int_range(data_count, 8, 16, MP_QSTR_data_count); // This will throw if unsuccessful. Everything following is guaranteed to succeed. port_i2s_allocate_i2s0(); diff --git a/ports/espressif/common-hal/mdns/RemoteService.c b/ports/espressif/common-hal/mdns/RemoteService.c index 1d80c738bd..5a84c4a79b 100644 --- a/ports/espressif/common-hal/mdns/RemoteService.c +++ b/ports/espressif/common-hal/mdns/RemoteService.c @@ -26,6 +26,8 @@ #include "shared-bindings/mdns/RemoteService.h" +#include "shared-bindings/ipaddress/IPv4Address.h" + const char *common_hal_mdns_remoteservice_get_service_type(mdns_remoteservice_obj_t *self) { if (self->result == NULL) { return ""; @@ -61,6 +63,32 @@ mp_int_t common_hal_mdns_remoteservice_get_port(mdns_remoteservice_obj_t *self) return self->result->port; } +uint32_t mdns_remoteservice_get_ipv4_address(mdns_remoteservice_obj_t *self) { + if (self->result == NULL || + self->result->ip_protocol != MDNS_IP_PROTOCOL_V4 || + self->result->addr == NULL) { + return 0; + } + mdns_ip_addr_t *cur = self->result->addr; + while (cur != NULL) { + if (cur->addr.type == ESP_IPADDR_TYPE_V4) { + return cur->addr.u_addr.ip4.addr; + } + + cur = cur->next; + } + + return 0; +} + +mp_obj_t common_hal_mdns_remoteservice_get_ipv4_address(mdns_remoteservice_obj_t *self) { + uint32_t addr = mdns_remoteservice_get_ipv4_address(self); + if (addr == 0) { + return mp_const_none; + } + return common_hal_ipaddress_new_ipv4address(addr); +} + void common_hal_mdns_remoteservice_deinit(mdns_remoteservice_obj_t *self) { mdns_query_results_free(self->result); self->result = NULL; diff --git a/ports/espressif/common-hal/mdns/Server.c b/ports/espressif/common-hal/mdns/Server.c index 9da67a9145..d657a84eb7 100644 --- a/ports/espressif/common-hal/mdns/Server.c +++ b/ports/espressif/common-hal/mdns/Server.c @@ -35,13 +35,9 @@ STATIC bool inited = false; -void common_hal_mdns_server_construct(mdns_server_obj_t *self, mp_obj_t network_interface) { - if (network_interface != MP_OBJ_FROM_PTR(&common_hal_wifi_radio_obj)) { - mp_raise_ValueError(translate("mDNS only works with built-in WiFi")); - return; - } +void mdns_server_construct(mdns_server_obj_t *self, bool workflow) { if (inited) { - mp_raise_RuntimeError(translate("mDNS already initialized")); + return; } mdns_init(); @@ -50,19 +46,31 @@ void common_hal_mdns_server_construct(mdns_server_obj_t *self, mp_obj_t network_ snprintf(self->default_hostname, sizeof(self->default_hostname), "cpy-%02x%02x%02x", mac[3], mac[4], mac[5]); common_hal_mdns_server_set_hostname(self, self->default_hostname); - // Set a delegated entry to ourselves. This allows us to respond to "circuitpython.local" - // queries as well. - // TODO: Allow for disabling this with `supervisor.disable_web_workflow()`. - mdns_ip_addr_t our_ip; - esp_netif_get_ip_info(common_hal_wifi_radio_obj.netif, &common_hal_wifi_radio_obj.ip_info); - our_ip.next = NULL; - our_ip.addr.type = ESP_IPADDR_TYPE_V4; - our_ip.addr.u_addr.ip4 = common_hal_wifi_radio_obj.ip_info.ip; - our_ip.addr.u_addr.ip6.addr[1] = 0; - our_ip.addr.u_addr.ip6.addr[2] = 0; - our_ip.addr.u_addr.ip6.addr[3] = 0; - our_ip.addr.u_addr.ip6.zone = 0; - mdns_delegate_hostname_add("circuitpython", &our_ip); + if (workflow) { + // Set a delegated entry to ourselves. This allows us to respond to "circuitpython.local" + // queries as well. + mdns_ip_addr_t our_ip; + esp_netif_get_ip_info(common_hal_wifi_radio_obj.netif, &common_hal_wifi_radio_obj.ip_info); + our_ip.next = NULL; + our_ip.addr.type = ESP_IPADDR_TYPE_V4; + our_ip.addr.u_addr.ip4 = common_hal_wifi_radio_obj.ip_info.ip; + our_ip.addr.u_addr.ip6.addr[1] = 0; + our_ip.addr.u_addr.ip6.addr[2] = 0; + our_ip.addr.u_addr.ip6.addr[3] = 0; + our_ip.addr.u_addr.ip6.zone = 0; + mdns_delegate_hostname_add("circuitpython", &our_ip); + } +} + +void common_hal_mdns_server_construct(mdns_server_obj_t *self, mp_obj_t network_interface) { + if (network_interface != MP_OBJ_FROM_PTR(&common_hal_wifi_radio_obj)) { + mp_raise_ValueError(translate("mDNS only works with built-in WiFi")); + return; + } + if (inited) { + mp_raise_RuntimeError(translate("mDNS already initialized")); + } + mdns_server_construct(self, false); } void common_hal_mdns_server_deinit(mdns_server_obj_t *self) { @@ -82,6 +90,10 @@ const char *common_hal_mdns_server_get_hostname(mdns_server_obj_t *self) { void common_hal_mdns_server_set_hostname(mdns_server_obj_t *self, const char *hostname) { mdns_hostname_set(hostname); + // Wait for the mdns task to set the new hostname. + while (!mdns_hostname_exists(hostname)) { + RUN_BACKGROUND_TASKS; + } self->hostname = hostname; } @@ -97,6 +109,48 @@ void common_hal_mdns_server_set_instance_name(mdns_server_obj_t *self, const cha self->instance_name = instance_name; } +size_t mdns_server_find(mdns_server_obj_t *self, const char *service_type, const char *protocol, + mp_float_t timeout, mdns_remoteservice_obj_t *out, size_t out_len) { + mdns_search_once_t *search = mdns_query_async_new(NULL, service_type, protocol, MDNS_TYPE_PTR, timeout * 1000, 255, NULL); + if (search == NULL) { + return 0; + } + mdns_result_t *results; + while (!mdns_query_async_get_results(search, 1, &results)) { + RUN_BACKGROUND_TASKS; + } + mdns_query_async_delete(search); + // Count how many results we got. + // TODO: Remove this loop when moving off 4.4. Newer APIs will give us num_results + // back directly. + mdns_result_t *next = results; + uint8_t num_results = 0; + while (next != NULL) { + num_results++; + next = next->next; + } + + next = results; + // Don't error if we're out of memory. Instead, truncate the tuple. + uint8_t added = 0; + while (next != NULL && added < out_len) { + mdns_remoteservice_obj_t *service = &out[added]; + + service->result = next; + service->base.type = &mdns_remoteservice_type; + next = next->next; + // Break the linked list so we free each result separately. + service->result->next = NULL; + added++; + } + if (added < out_len) { + // Free the remaining results from the IDF because we don't have + // enough space in Python. + mdns_query_results_free(next); + } + return num_results; +} + mp_obj_t common_hal_mdns_server_find(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_float_t timeout) { mdns_search_once_t *search = mdns_query_async_new(NULL, service_type, protocol, MDNS_TYPE_PTR, timeout * 1000, 255, NULL); if (search == NULL) { @@ -150,5 +204,9 @@ mp_obj_t common_hal_mdns_server_find(mdns_server_obj_t *self, const char *servic } void common_hal_mdns_server_advertise_service(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_int_t port) { - mdns_service_add(NULL, service_type, protocol, port, NULL, 0); + if (mdns_service_exists(service_type, protocol, NULL)) { + mdns_service_port_set(service_type, protocol, port); + } else { + mdns_service_add(NULL, service_type, protocol, port, NULL, 0); + } } diff --git a/ports/espressif/common-hal/microcontroller/Pin.c b/ports/espressif/common-hal/microcontroller/Pin.c index 1323c9ae5d..adc1e8b918 100644 --- a/ports/espressif/common-hal/microcontroller/Pin.c +++ b/ports/espressif/common-hal/microcontroller/Pin.c @@ -33,14 +33,78 @@ #include "components/driver/include/driver/gpio.h" #include "components/hal/include/hal/gpio_hal.h" -STATIC uint32_t never_reset_pins[2]; -STATIC uint32_t in_use[2]; +STATIC uint64_t _never_reset_pin_mask; +STATIC uint64_t _preserved_pin_mask; +STATIC uint64_t _in_use_pin_mask; + +// Bit mask of all pins that should never EVER be reset. +// Typically these are SPI flash and PSRAM control pins, and communication pins. +// "Reset forbidden" is stronger than "never reset" below, which may only be temporary. +static const uint64_t pin_mask_reset_forbidden = + #if defined(CONFIG_IDF_TARGET_ESP32) + // Never ever reset serial pins for bootloader and possibly USB-serial converter. + GPIO_SEL_1 | // TXD0 + GPIO_SEL_3 | // RXD0 + // SPI flash and PSRAM pins are protected at runtime in supervisor/port.c. + #endif // ESP32 + + #if defined(CONFIG_IDF_TARGET_ESP32C3) + // Never ever reset pins used to communicate with SPI flash. + GPIO_SEL_11 | // VDD_SPI + GPIO_SEL_12 | // SPIHD + GPIO_SEL_13 | // SPIWP + GPIO_SEL_14 | // SPICS0 + GPIO_SEL_15 | // SPICLK + GPIO_SEL_16 | // SPID + GPIO_SEL_17 | // SPIQ + #if CIRCUITPY_ESP_USB_SERIAL_JTAG + // Never ever reset serial/JTAG communication pins. + GPIO_SEL_18 | // USB D- + GPIO_SEL_19 | // USB D+ + #endif + #endif // ESP32C3 + + #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) + // Never ever reset pins used to communicate with SPI flash and PSRAM. + GPIO_SEL_19 | // USB D- + GPIO_SEL_20 | // USB D+ + #if defined(CONFIG_ESP32_SPIRAM_SUPPORT) || defined(CONFIG_ESP32S2_SPIRAM_SUPPORT) || defined(CONFIG_ESP32S3_SPIRAM_SUPPORT) + // Note ESP32-C3 does not have SPIRAM support. + // Board uses PSRAM, and needs another chip select. + GPIO_SEL_26 | // SPICS1 + #endif + GPIO_SEL_27 | // SPIHD + GPIO_SEL_28 | // SPIWP + GPIO_SEL_29 | // SPICS0 + GPIO_SEL_30 | // SPICLK + GPIO_SEL_31 | // SPIHD + GPIO_SEL_32 | // SPIQ + #if defined(CONFIG_SPIRAM_MODE_OCT) + // Never reset octal SPI flash pins DQ4-DQ7 and DQS/DM. + GPIO_SEL_33 | // SPIIO4 + GPIO_SEL_34 | // SPIIO5 + GPIO_SEL_35 | // SPIIO6 + GPIO_SEL_36 | // SPIIO7 + GPIO_SEL_37 | // SPIDQS + #endif + #if CIRCUITPY_USB + // Never ever reset USB pins. + GPIO_SEL_19 | // USB D- + GPIO_SEL_20 | // USB D+ + #endif + #endif // ESP32S2, ESP32S3 + + 0; // Terminate last "|". + + void never_reset_pin_number(gpio_num_t pin_number) { - if (pin_number == NO_PIN) { + // Some CircuitPython APIs deal in uint8_t pin numbers, but NO_PIN is -1. + // Also allow pin 255 to be treated as NO_PIN to avoid crashes + if (pin_number == NO_PIN || pin_number == (uint8_t)NO_PIN) { return; } - never_reset_pins[pin_number / 32] |= 1 << pin_number % 32; + _never_reset_pin_mask |= PIN_BIT(pin_number); } void common_hal_never_reset_pin(const mcu_pin_obj_t *pin) { @@ -54,60 +118,77 @@ MP_WEAK bool espressif_board_reset_pin_number(gpio_num_t pin_number) { return false; } -STATIC void _reset_pin(gpio_num_t pin_number) { - #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) - // Never ever reset pins used for flash and RAM. - if (26 <= pin_number && pin_number <= 32) { - return; - } - #ifdef CONFIG_SPIRAM_MODE_OCT - // Octal DQ4-DQ7 and DQS/DM - if (33 <= pin_number && pin_number <= 37) { - return; - } - #endif +STATIC bool _reset_forbidden(gpio_num_t pin_number) { + return pin_mask_reset_forbidden & PIN_BIT(pin_number); +} - #if CIRCUITPY_USB - // Never reset USB pins. - if (pin_number == 19 || pin_number == 20) { +STATIC bool _never_reset(gpio_num_t pin_number) { + return _never_reset_pin_mask & PIN_BIT(pin_number); +} + +STATIC bool _preserved_pin(gpio_num_t pin_number) { + return _preserved_pin_mask & PIN_BIT(pin_number); +} + +STATIC void _reset_pin(gpio_num_t pin_number) { + // Never ever reset pins used for flash, RAM, and basic communication. + if (_reset_forbidden(pin_number)) { return; } - #endif - #elif defined(CONFIG_IDF_TARGET_ESP32C3) - // Never ever reset pins used for flash and RAM. - if (11 <= pin_number && pin_number <= 17) { - return; + + // Disable any existing hold on this pin, + if (GPIO_IS_VALID_OUTPUT_GPIO(pin_number)) { + gpio_hold_dis(pin_number); } - #if CIRCUITPY_ESP_USB_SERIAL_JTAG - if (pin_number == 18 || pin_number == 19) { - return; - } - #endif - #endif // Give the board a chance to reset the pin in a particular way. if (espressif_board_reset_pin_number(pin_number)) { return; } - gpio_reset_pin(pin_number); + bool pull_down = false; + + // Special case the status LED pin. + #if defined(MICROPY_HW_LED_STATUS) && (!defined(MICROPY_HW_LED_STATUS_INVERTED) || !MICROPY_HW_LED_STATUS_INVERTED) + pull_down = pull_down || pin_number == MICROPY_HW_LED_STATUS->number; + #endif #ifdef DOUBLE_TAP_PIN // Pull the double tap pin down so that resets come back to CircuitPython. - if (pin_number == DOUBLE_TAP_PIN->number) { + pull_down = pull_down || pin_number == DOUBLE_TAP_PIN->number; + #endif + + // This will pull the pin up. For pins needing pull down it shouldn't be a + // problem for a moment. + gpio_reset_pin(pin_number); + + if (pull_down) { gpio_pullup_dis(pin_number); gpio_pulldown_en(pin_number); } - #endif } +void preserve_pin_number(gpio_num_t pin_number) { + if (GPIO_IS_VALID_OUTPUT_GPIO(pin_number)) { + gpio_hold_en(pin_number); + _preserved_pin_mask |= PIN_BIT(pin_number); + } +} + +void clear_pin_preservations(void) { + _preserved_pin_mask = 0; +} + + // Mark pin as free and return it to a quiescent state. void reset_pin_number(gpio_num_t pin_number) { - if (pin_number == NO_PIN) { + // Some CircuitPython APIs deal in uint8_t pin numbers, but NO_PIN is -1. + // Also allow pin 255 to be treated as NO_PIN to avoid crashes + if (pin_number == NO_PIN || pin_number == (uint8_t)NO_PIN) { return; } - never_reset_pins[pin_number / 32] &= ~(1 << pin_number % 32); - in_use[pin_number / 32] &= ~(1 << pin_number % 32); + _never_reset_pin_mask &= ~PIN_BIT(pin_number); + _in_use_pin_mask &= ~PIN_BIT(pin_number); _reset_pin(pin_number); } @@ -124,27 +205,33 @@ void common_hal_reset_pin(const mcu_pin_obj_t *pin) { } void reset_all_pins(void) { + // Undo deep sleep holds in case we woke up from deep sleep. + // We still need to unhold individual pins, which is done by _reset_pin. + gpio_deep_sleep_hold_dis(); + for (uint8_t i = 0; i < GPIO_PIN_COUNT; i++) { uint32_t iomux_address = GPIO_PIN_MUX_REG[i]; if (iomux_address == 0 || - (never_reset_pins[i / 32] & (1 << i % 32)) != 0) { + _never_reset(i) || + _preserved_pin(i)) { continue; } _reset_pin(i); } - in_use[0] = never_reset_pins[0]; - in_use[1] = never_reset_pins[1]; + _in_use_pin_mask = _never_reset_pin_mask; } void claim_pin_number(gpio_num_t pin_number) { - if (pin_number == NO_PIN) { + // Some CircuitPython APIs deal in uint8_t pin numbers, but NO_PIN is -1. + // Also allow pin 255 to be treated as NO_PIN to avoid crashes + if (pin_number == NO_PIN || pin_number == (uint8_t)NO_PIN) { return; } - in_use[pin_number / 32] |= (1 << (pin_number % 32)); + _in_use_pin_mask |= PIN_BIT(pin_number); } void claim_pin(const mcu_pin_obj_t *pin) { - in_use[pin->number / 32] |= (1 << (pin->number % 32)); + claim_pin_number(pin->number); } void common_hal_mcu_pin_claim(const mcu_pin_obj_t *pin) { @@ -152,9 +239,7 @@ void common_hal_mcu_pin_claim(const mcu_pin_obj_t *pin) { } bool pin_number_is_free(gpio_num_t pin_number) { - uint8_t offset = pin_number / 32; - uint32_t mask = 1 << (pin_number % 32); - return (in_use[offset] & mask) == 0; + return !(_in_use_pin_mask & PIN_BIT(pin_number)); } bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) { diff --git a/ports/espressif/common-hal/microcontroller/Pin.h b/ports/espressif/common-hal/microcontroller/Pin.h index e74346ef65..55927fe068 100644 --- a/ports/espressif/common-hal/microcontroller/Pin.h +++ b/ports/espressif/common-hal/microcontroller/Pin.h @@ -31,21 +31,28 @@ #include "peripherals/pins.h" -void reset_all_pins(void); +// 64-bit pin mask for a single bit +#define PIN_BIT(pin_number) (((uint64_t)1) << pin_number) + +extern void common_hal_reset_pin(const mcu_pin_obj_t *pin); +extern void common_hal_never_reset_pin(const mcu_pin_obj_t *pin); + +extern void reset_all_pins(void); // reset_pin_number takes the pin number instead of the pointer so that objects don't // need to store a full pointer. -void reset_pin_number(gpio_num_t pin_number); -void common_hal_reset_pin(const mcu_pin_obj_t *pin); -void common_hal_never_reset_pin(const mcu_pin_obj_t *pin); -void claim_pin(const mcu_pin_obj_t *pin); -void claim_pin_number(gpio_num_t pin_number); -bool pin_number_is_free(gpio_num_t pin_number); -void never_reset_pin_number(gpio_num_t pin_number); +extern void reset_pin_number(gpio_num_t pin_number); +extern void claim_pin(const mcu_pin_obj_t *pin); +extern void claim_pin_number(gpio_num_t pin_number); +extern bool pin_number_is_free(gpio_num_t pin_number); +extern void never_reset_pin_number(gpio_num_t pin_number); + +extern void preserve_pin_number(gpio_num_t pin_number); +extern void clear_pin_preservations(void); // Allow the board to reset a pin in a board-specific way. This can be used // for LEDs or enable pins to put them in a state beside the default pull-up. // Return true to indicate that the pin was reset. Returning false will lead to // the port-default reset behavior. -bool espressif_board_reset_pin_number(gpio_num_t pin_number); +extern bool espressif_board_reset_pin_number(gpio_num_t pin_number); #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_MICROCONTROLLER_PIN_H diff --git a/ports/espressif/common-hal/microcontroller/Processor.c b/ports/espressif/common-hal/microcontroller/Processor.c index e4782c30ab..9b97b98cbd 100644 --- a/ports/espressif/common-hal/microcontroller/Processor.c +++ b/ports/espressif/common-hal/microcontroller/Processor.c @@ -33,17 +33,20 @@ #include "common-hal/microcontroller/Processor.h" #include "shared-bindings/microcontroller/Processor.h" #include "shared-bindings/microcontroller/ResetReason.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "esp_sleep.h" #include "esp_system.h" #include "soc/efuse_reg.h" + +#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S3) #include "driver/temp_sensor.h" +#endif float common_hal_mcu_processor_get_temperature(void) { float tsens_out; - #ifdef CONFIG_IDF_TARGET_ESP32S3 + #if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32) mp_raise_NotImplementedError(NULL); #else temp_sensor_config_t temp_sensor = TSENS_CONFIG_DEFAULT(); // DEFAULT: range:-10℃ ~ 80℃, error < 1℃. @@ -60,12 +63,16 @@ float common_hal_mcu_processor_get_voltage(void) { } uint32_t common_hal_mcu_processor_get_frequency(void) { - #ifdef CONFIG_IDF_TARGET_ESP32C3 + #if defined(CONFIG_IDF_TARGET_ESP32) + return CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 100000; + #elif defined(CONFIG_IDF_TARGET_ESP32C3) return CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ * 1000000; #elif defined(CONFIG_IDF_TARGET_ESP32S2) return CONFIG_ESP32S2_DEFAULT_CPU_FREQ_MHZ * 1000000; #elif defined(CONFIG_IDF_TARGET_ESP32S3) return CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ * 1000000; + #else + #error No known CONFIG_IDF_TARGET_xxx found #endif } @@ -78,7 +85,13 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { uint8_t *ptr = &raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH - 1]; // MAC address contains 48 bits (6 bytes), 32 in the low order word + + #if defined(CONFIG_IDF_TARGET_ESP32) + uint32_t mac_address_part = REG_READ(EFUSE_BLK0_RDATA1_REG); + #else uint32_t mac_address_part = REG_READ(EFUSE_RD_MAC_SPI_SYS_0_REG); + #endif + *ptr-- = swap_nibbles(mac_address_part & 0xff); mac_address_part >>= 8; *ptr-- = swap_nibbles(mac_address_part & 0xff); @@ -88,7 +101,12 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { *ptr-- = swap_nibbles(mac_address_part & 0xff); // and 16 in the high order word + #if defined(CONFIG_IDF_TARGET_ESP32) + mac_address_part = REG_READ(EFUSE_BLK0_RDATA2_REG); + #else mac_address_part = REG_READ(EFUSE_RD_MAC_SPI_SYS_1_REG); + #endif + *ptr-- = swap_nibbles(mac_address_part & 0xff); mac_address_part >>= 8; *ptr-- = swap_nibbles(mac_address_part & 0xff); diff --git a/ports/espressif/common-hal/microcontroller/__init__.c b/ports/espressif/common-hal/microcontroller/__init__.c index 3cf41ba7f0..68479dc46f 100644 --- a/ports/espressif/common-hal/microcontroller/__init__.c +++ b/ports/espressif/common-hal/microcontroller/__init__.c @@ -45,7 +45,9 @@ #include "soc/rtc_cntl_reg.h" #include "esp_private/system_internal.h" -#ifdef CONFIG_IDF_TARGET_ESP32C3 +#if defined(CONFIG_IDF_TARGET_ESP32) +#include "esp32/rom/rtc.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C3) #include "esp32c3/rom/rtc.h" #elif defined(CONFIG_IDF_TARGET_ESP32S2) #include "esp32s2/rom/rtc.h" @@ -55,6 +57,8 @@ #include "esp32s3/rom/rtc.h" #include "esp32s3/rom/usb/usb_persist.h" #include "esp32s3/rom/usb/chip_usb_dw_wrapper.h" +#else +#error No known CONFIG_IDF_TARGET_xxx found #endif void common_hal_mcu_delay_us(uint32_t delay) { @@ -65,6 +69,7 @@ volatile uint32_t nesting_count = 0; static portMUX_TYPE cp_mutex = portMUX_INITIALIZER_UNLOCKED; void common_hal_mcu_disable_interrupts(void) { + assert(xPortGetCoreID() == CONFIG_ESP_MAIN_TASK_AFFINITY); if (nesting_count == 0) { portENTER_CRITICAL(&cp_mutex); } @@ -72,9 +77,8 @@ void common_hal_mcu_disable_interrupts(void) { } void common_hal_mcu_enable_interrupts(void) { - if (nesting_count == 0) { - // Maybe log here because it's very bad. - } + assert(xPortGetCoreID() == CONFIG_ESP_MAIN_TASK_AFFINITY); + assert(nesting_count > 0); nesting_count--; if (nesting_count > 0) { return; @@ -85,16 +89,22 @@ void common_hal_mcu_enable_interrupts(void) { void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { switch (runmode) { case RUNMODE_UF2: - #ifndef CONFIG_IDF_TARGET_ESP32C3 + #if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32C3) + mp_arg_error_invalid(MP_QSTR_run_mode); + #else // 0x11F2 is APP_REQUEST_UF2_RESET_HINT & is defined by TinyUF2 esp_reset_reason_set_hint(0x11F2); #endif break; case RUNMODE_NORMAL: // revert back to normal boot + #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) REG_WRITE(RTC_RESET_CAUSE_REG, 0); // reset uf2 + #endif REG_WRITE(RTC_CNTL_STORE0_REG, 0); // reset safe mode + #if !defined(CONFIG_IDF_TARGET_ESP32) REG_WRITE(RTC_CNTL_OPTION1_REG, 0); // reset bootloader + #endif break; case RUNMODE_SAFE_MODE: // enter safe mode on next boot @@ -102,10 +112,14 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { break; case RUNMODE_BOOTLOADER: // DFU download - #ifndef CONFIG_IDF_TARGET_ESP32C3 + #if defined(CONFIG_IDF_TARGET_ESP32) + mp_arg_error_invalid(MP_QSTR_run_mode); + #else + #if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) chip_usb_set_persist_flags(USBDC_BOOT_DFU); #endif REG_WRITE(RTC_CNTL_OPTION1_REG, RTC_CNTL_FORCE_DOWNLOAD_BOOT); + #endif break; default: break; @@ -149,49 +163,145 @@ watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = { // This maps MCU pin names to pin objects. STATIC const mp_rom_map_elem_t mcu_pin_global_dict_table[] = { + #ifdef GPIO0_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO0), MP_ROM_PTR(&pin_GPIO0) }, + #endif + #ifdef GPIO1_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO1), MP_ROM_PTR(&pin_GPIO1) }, + #endif + #ifdef GPIO2_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO2), MP_ROM_PTR(&pin_GPIO2) }, + #endif + #ifdef GPIO3_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO3), MP_ROM_PTR(&pin_GPIO3) }, + #endif + #ifdef GPIO4_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO4), MP_ROM_PTR(&pin_GPIO4) }, + #endif + #ifdef GPIO5_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO5), MP_ROM_PTR(&pin_GPIO5) }, + #endif + #ifdef GPIO6_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO6), MP_ROM_PTR(&pin_GPIO6) }, + #endif + #ifdef GPIO7_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO7), MP_ROM_PTR(&pin_GPIO7) }, + #endif + #ifdef GPIO8_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO8), MP_ROM_PTR(&pin_GPIO8) }, + #endif + #ifdef GPIO9_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO9), MP_ROM_PTR(&pin_GPIO9) }, + #endif + #ifdef GPIO10_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO10), MP_ROM_PTR(&pin_GPIO10) }, + #endif + #ifdef GPIO11_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO11), MP_ROM_PTR(&pin_GPIO11) }, + #endif + #ifdef GPIO12_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO12), MP_ROM_PTR(&pin_GPIO12) }, + #endif + #ifdef GPIO13_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO13), MP_ROM_PTR(&pin_GPIO13) }, + #endif + #ifdef GPIO14_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO14), MP_ROM_PTR(&pin_GPIO14) }, + #endif + #ifdef GPIO15_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO15), MP_ROM_PTR(&pin_GPIO15) }, + #endif + #ifdef GPIO16_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO16), MP_ROM_PTR(&pin_GPIO16) }, + #endif + #ifdef GPIO17_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO17), MP_ROM_PTR(&pin_GPIO17) }, + #endif + #ifdef GPIO18_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO18), MP_ROM_PTR(&pin_GPIO18) }, + #endif + #ifdef GPIO19_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO19), MP_ROM_PTR(&pin_GPIO19) }, + #endif + #ifdef GPIO20_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO20), MP_ROM_PTR(&pin_GPIO20) }, + #endif + #ifdef GPIO21_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO21), MP_ROM_PTR(&pin_GPIO21) }, - #ifndef CONFIG_IDF_TARGET_ESP32C3 + #endif + #ifdef GPIO22_EXISTS + { MP_ROM_QSTR(MP_QSTR_GPIO22), MP_ROM_PTR(&pin_GPIO22) }, + #endif + #ifdef GPIO23_EXISTS + { MP_ROM_QSTR(MP_QSTR_GPIO23), MP_ROM_PTR(&pin_GPIO23) }, + #endif + #ifdef GPIO24_EXISTS + { MP_ROM_QSTR(MP_QSTR_GPIO24), MP_ROM_PTR(&pin_GPIO24) }, + #endif + #ifdef GPIO25_EXISTS + { MP_ROM_QSTR(MP_QSTR_GPIO25), MP_ROM_PTR(&pin_GPIO25) }, + #endif + #ifdef GPIO26_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO26), MP_ROM_PTR(&pin_GPIO26) }, + #endif + #ifdef GPIO27_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO27), MP_ROM_PTR(&pin_GPIO27) }, + #endif + #ifdef GPIO28_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO28), MP_ROM_PTR(&pin_GPIO28) }, + #endif + #ifdef GPIO29_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO29), MP_ROM_PTR(&pin_GPIO29) }, + #endif + #ifdef GPIO30_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO30), MP_ROM_PTR(&pin_GPIO30) }, + #endif + #ifdef GPIO31_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO31), MP_ROM_PTR(&pin_GPIO31) }, + #endif + #ifdef GPIO32_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO32), MP_ROM_PTR(&pin_GPIO32) }, + #endif + #ifdef GPIO33_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO33), MP_ROM_PTR(&pin_GPIO33) }, + #endif + #ifdef GPIO34_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO34), MP_ROM_PTR(&pin_GPIO34) }, + #endif + #ifdef GPIO35_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO35), MP_ROM_PTR(&pin_GPIO35) }, + #endif + #ifdef GPIO36_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO36), MP_ROM_PTR(&pin_GPIO36) }, + #endif + #ifdef GPIO37_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO37), MP_ROM_PTR(&pin_GPIO37) }, + #endif + #ifdef GPIO38_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO38), MP_ROM_PTR(&pin_GPIO38) }, + #endif + #ifdef GPIO39_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO39), MP_ROM_PTR(&pin_GPIO39) }, + #endif + #ifdef GPIO40_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO40), MP_ROM_PTR(&pin_GPIO40) }, + #endif + #ifdef GPIO41_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO41), MP_ROM_PTR(&pin_GPIO41) }, + #endif + #ifdef GPIO42_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO42), MP_ROM_PTR(&pin_GPIO42) }, + #endif + #ifdef GPIO43_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO43), MP_ROM_PTR(&pin_GPIO43) }, + #endif + #ifdef GPIO44_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO44), MP_ROM_PTR(&pin_GPIO44) }, + #endif + #ifdef GPIO45_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO45), MP_ROM_PTR(&pin_GPIO45) }, + #endif + #ifdef GPIO46_EXISTS { MP_ROM_QSTR(MP_QSTR_GPIO46), MP_ROM_PTR(&pin_GPIO46) }, #endif }; diff --git a/ports/espressif/common-hal/neopixel_write/__init__.c b/ports/espressif/common-hal/neopixel_write/__init__.c index b140eff4f9..148b47aeb0 100644 --- a/ports/espressif/common-hal/neopixel_write/__init__.c +++ b/ports/espressif/common-hal/neopixel_write/__init__.c @@ -47,11 +47,11 @@ #include "components/driver/include/driver/rmt.h" #include "peripherals/rmt.h" -// 416 ns is 1/3 of the 1250ns period of a 800khz signal. -#define WS2812_T0H_NS (416) -#define WS2812_T0L_NS (416 * 2) -#define WS2812_T1H_NS (416 * 2) -#define WS2812_T1L_NS (416) +// Use closer to WS2812-style timings instead of WS2812B, to accommodate more varieties. +#define WS2812_T0H_NS (316) +#define WS2812_T0L_NS (316 * 3) +#define WS2812_T1H_NS (700) +#define WS2812_T1L_NS (564) static uint32_t ws2812_t0h_ticks = 0; static uint32_t ws2812_t1h_ticks = 0; diff --git a/ports/espressif/common-hal/pulseio/PulseIn.c b/ports/espressif/common-hal/pulseio/PulseIn.c index 1b29032354..41c1dcb189 100644 --- a/ports/espressif/common-hal/pulseio/PulseIn.c +++ b/ports/espressif/common-hal/pulseio/PulseIn.c @@ -42,19 +42,19 @@ STATIC void update_internal_buffer(pulseio_pulsein_obj_t *self) { for (size_t i = 0; i < length; i++) { uint16_t pos = (self->start + self->len) % self->maxlen; self->buffer[pos] = items[i].duration0 * 3; - // Check if second item exists before incrementing - if (items[i].duration1) { - self->buffer[pos + 1] = items[i].duration1 * 3; - if (self->len < (self->maxlen - 1)) { - self->len += 2; - } else { - self->start += 2; - } + if (self->len < self->maxlen) { + self->len++; } else { + self->start = (self->start + 1) % self->maxlen; + } + // Check if second item exists + if (items[i].duration1) { + pos = (self->start + self->len) % self->maxlen; + self->buffer[pos] = items[i].duration1 * 3; if (self->len < self->maxlen) { self->len++; } else { - self->start++; + self->start = (self->start + 1) % self->maxlen; } } } @@ -88,7 +88,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu uint16_t maxlen, bool idle_state) { self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t), false); if (self->buffer == NULL) { - mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), maxlen * sizeof(uint16_t)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } self->pin = pin; self->maxlen = maxlen; diff --git a/ports/espressif/common-hal/pwmio/PWMOut.c b/ports/espressif/common-hal/pwmio/PWMOut.c index 9ca39c223b..d83ce6590a 100644 --- a/ports/espressif/common-hal/pwmio/PWMOut.c +++ b/ports/espressif/common-hal/pwmio/PWMOut.c @@ -55,18 +55,14 @@ STATIC uint32_t calculate_duty_cycle(uint32_t frequency) { void pwmout_reset(void) { for (size_t i = 0; i < LEDC_CHANNEL_MAX; i++) { - if (reserved_channels[i] != INDEX_EMPTY) { + if (reserved_channels[i] != INDEX_EMPTY && !never_reset_chan[i]) { ledc_stop(LEDC_LOW_SPEED_MODE, i, 0); - } - if (!never_reset_chan[i]) { reserved_channels[i] = INDEX_EMPTY; } } for (size_t i = 0; i < LEDC_TIMER_MAX; i++) { - if (reserved_timer_freq[i]) { + if (reserved_timer_freq[i] && !never_reset_tim[i]) { ledc_timer_rst(LEDC_LOW_SPEED_MODE, i); - } - if (!never_reset_tim[i]) { reserved_timer_freq[i] = 0; varfreq_timers[i] = false; } @@ -217,7 +213,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t fr // Calculate duty cycle uint32_t duty_bits = calculate_duty_cycle(frequency); if (duty_bits == 0) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } self->duty_resolution = duty_bits; ledc_set_freq(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num, frequency); diff --git a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c index 676e99289d..07b97cf9a3 100644 --- a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c @@ -29,7 +29,6 @@ #include "common-hal/microcontroller/Pin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" 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) { @@ -37,25 +36,42 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode claim_pin(pin_b); // Prepare configuration for the PCNT unit - const pcnt_config_t pcnt_config = { + pcnt_config_t pcnt_config_channel_0 = { // Set PCNT input signal and control GPIOs .pulse_gpio_num = pin_a->number, .ctrl_gpio_num = pin_b->number, .channel = PCNT_CHANNEL_0, // What to do on the positive / negative edge of pulse input? - .pos_mode = PCNT_COUNT_DEC, // Count up on the positive edge - .neg_mode = PCNT_COUNT_INC, // Keep the counter value on the negative edge + .pos_mode = PCNT_COUNT_DEC, // Count up on the positive edge + .neg_mode = PCNT_COUNT_INC, // Keep the counter value on the negative edge // What to do when control input is low or high? .lctrl_mode = PCNT_MODE_REVERSE, // Reverse counting direction if low .hctrl_mode = PCNT_MODE_KEEP, // Keep the primary counter mode if high }; - // Initialize PCNT unit - const int8_t unit = peripherals_pcnt_init(pcnt_config); + // Allocate and initialize PCNT unit, CHANNEL_0. + const int8_t unit = peripherals_pcnt_init(&pcnt_config_channel_0); if (unit == -1) { mp_raise_RuntimeError(translate("All PCNT units in use")); } + pcnt_config_t pcnt_config_channel_1 = { + // Set PCNT input signal and control GPIOs + .pulse_gpio_num = pin_b->number, // Pins are reversed from above + .ctrl_gpio_num = pin_a->number, + .channel = PCNT_CHANNEL_1, + // What to do on the positive / negative edge of pulse input? + .pos_mode = PCNT_COUNT_DEC, // Count up on the positive edge + .neg_mode = PCNT_COUNT_INC, // Keep the counter value on the negative edge + // What to do when control input is low or high? + .lctrl_mode = PCNT_MODE_KEEP, // Keep the primary counter mode if low + .hctrl_mode = PCNT_MODE_REVERSE, // Reverse counting direction if high + .unit = unit, + }; + + // Reinitalize same unit, CHANNEL_1 with different parameters. + peripherals_pcnt_reinit(&pcnt_config_channel_1); + self->pin_a = pin_a->number; self->pin_b = pin_b->number; self->unit = (pcnt_unit_t)unit; @@ -77,21 +93,20 @@ void common_hal_rotaryio_incrementalencoder_deinit(rotaryio_incrementalencoder_o mp_int_t common_hal_rotaryio_incrementalencoder_get_position(rotaryio_incrementalencoder_obj_t *self) { int16_t count; pcnt_get_counter_value(self->unit, &count); - return (count / 2) + self->position; + + return (count + self->position) / self->divisor; } void common_hal_rotaryio_incrementalencoder_set_position(rotaryio_incrementalencoder_obj_t *self, mp_int_t new_position) { - self->position = new_position; + self->position = new_position * self->divisor; pcnt_counter_clear(self->unit); } mp_int_t common_hal_rotaryio_incrementalencoder_get_divisor(rotaryio_incrementalencoder_obj_t *self) { - return 4; + return self->divisor; } void common_hal_rotaryio_incrementalencoder_set_divisor(rotaryio_incrementalencoder_obj_t *self, mp_int_t divisor) { - if (divisor != 4) { - mp_raise_ValueError(translate("divisor must be 4")); - } + self->divisor = divisor; } diff --git a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h index 4982c39103..c43cd62bf6 100644 --- a/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h +++ b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h @@ -35,6 +35,7 @@ typedef struct { uint8_t pin_a, pin_b; mp_int_t position; pcnt_unit_t unit; + int8_t divisor; // Number of quadrature edges required per count } rotaryio_incrementalencoder_obj_t; #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_ROTARYIO_INCREMENTALENCODER_H diff --git a/ports/espressif/common-hal/rtc/RTC.c b/ports/espressif/common-hal/rtc/RTC.c index a78c2fb613..866f9b65a0 100644 --- a/ports/espressif/common-hal/rtc/RTC.c +++ b/ports/espressif/common-hal/rtc/RTC.c @@ -48,5 +48,5 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); } diff --git a/ports/espressif/common-hal/socketpool/Socket.c b/ports/espressif/common-hal/socketpool/Socket.c index c16be01998..f6025d329c 100644 --- a/ports/espressif/common-hal/socketpool/Socket.c +++ b/ports/espressif/common-hal/socketpool/Socket.c @@ -30,40 +30,217 @@ #include "shared/runtime/interrupt_char.h" #include "py/mperrno.h" #include "py/runtime.h" +#include "shared-bindings/socketpool/SocketPool.h" +#include "supervisor/port.h" #include "supervisor/shared/tick.h" +#include "supervisor/workflow.h" #include "components/lwip/lwip/src/include/lwip/err.h" #include "components/lwip/lwip/src/include/lwip/sockets.h" #include "components/lwip/lwip/src/include/lwip/sys.h" #include "components/lwip/lwip/src/include/lwip/netdb.h" +#include "components/vfs/include/esp_vfs_eventfd.h" -STATIC socketpool_socket_obj_t *open_socket_handles[CONFIG_LWIP_MAX_SOCKETS]; +StackType_t socket_select_stack[2 * configMINIMAL_STACK_SIZE]; -void socket_reset(void) { - for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_handles); i++) { - if (open_socket_handles[i]) { - if (open_socket_handles[i]->num > 0) { - // Close automatically clears socket handle - common_hal_socketpool_socket_close(open_socket_handles[i]); - } else { - open_socket_handles[i] = NULL; +STATIC int open_socket_fds[CONFIG_LWIP_MAX_SOCKETS]; +STATIC bool user_socket[CONFIG_LWIP_MAX_SOCKETS]; +StaticTask_t socket_select_task_handle; +STATIC int socket_change_fd = -1; + +STATIC void socket_select_task(void *arg) { + uint64_t signal; + + while (true) { + fd_set readfds; + fd_set errfds; + FD_ZERO(&readfds); + FD_ZERO(&errfds); + FD_SET(socket_change_fd, &readfds); + FD_SET(socket_change_fd, &errfds); + int max_fd = socket_change_fd; + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + int sockfd = open_socket_fds[i]; + if (sockfd < 0) { + continue; } + max_fd = MAX(max_fd, sockfd); + FD_SET(sockfd, &readfds); + FD_SET(sockfd, &errfds); + } + + int num_triggered = select(max_fd + 1, &readfds, NULL, &errfds, NULL); + // Check for bad file descriptor and queue up the background task before + // circling around. + if (num_triggered == -1 && errno == EBADF) { + // One for the change fd and one for the closed socket. + num_triggered = 2; + } + // Try and find the bad file and remove it from monitoring. + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + int sockfd = open_socket_fds[i]; + if (sockfd < 0) { + continue; + } + int err; + int optlen = sizeof(int); + int ret = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &err, (socklen_t *)&optlen); + if (ret < 0) { + open_socket_fds[i] = -1; + // Raise num_triggered so that we skip the assert and queue the background task. + num_triggered = 2; + } + } + assert(num_triggered >= 0); + + if (FD_ISSET(socket_change_fd, &readfds)) { + read(socket_change_fd, &signal, sizeof(signal)); + num_triggered -= 1; + } + if (num_triggered > 0) { + supervisor_workflow_request_background(); + + // Wake up CircuitPython. We know it is asleep because we are lower + // priority. + port_wake_main_task(); + } + + } + close(socket_change_fd); + vTaskDelete(NULL); +} + +void socket_user_reset(void) { + if (socket_change_fd < 0) { + esp_vfs_eventfd_config_t config = ESP_VFS_EVENTD_CONFIG_DEFAULT(); + ESP_ERROR_CHECK(esp_vfs_eventfd_register(&config)); + + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + open_socket_fds[i] = -1; + user_socket[i] = false; + } + socket_change_fd = eventfd(0, 0); + // Run this at the same priority as CP so that the web workflow background task can be + // queued while CP is running. Both tasks can still sleep and, therefore, sleep overall. + (void)xTaskCreateStaticPinnedToCore(socket_select_task, + "socket_select", + 2 * configMINIMAL_STACK_SIZE, + NULL, + uxTaskPriorityGet(NULL), + socket_select_stack, + &socket_select_task_handle, + xPortGetCoreID()); + } + + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + if (open_socket_fds[i] >= 0 && user_socket[i]) { + int num = open_socket_fds[i]; + // Close automatically clears socket handle + lwip_shutdown(num, SHUT_RDWR); + lwip_close(num); + open_socket_fds[i] = -1; + user_socket[i] = false; } } } -bool register_open_socket(socketpool_socket_obj_t *self) { - for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_handles); i++) { - if (open_socket_handles[i] == NULL) { - open_socket_handles[i] = self; +// The writes below send an event to the socket select task so that it redoes the +// select with the new open socket set. + +STATIC bool register_open_socket(int fd) { + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + if (open_socket_fds[i] == -1) { + open_socket_fds[i] = fd; + user_socket[i] = false; + uint64_t signal = 1; + write(socket_change_fd, &signal, sizeof(signal)); return true; } } return false; } -socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_obj_t *self, - uint8_t *ip, uint32_t *port) { +STATIC void unregister_open_socket(int fd) { + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + if (open_socket_fds[i] == fd) { + open_socket_fds[i] = -1; + user_socket[i] = false; + write(socket_change_fd, &fd, sizeof(fd)); + return; + } + } +} + +STATIC void mark_user_socket(int fd) { + for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_fds); i++) { + if (open_socket_fds[i] == fd) { + user_socket[i] = true; + return; + } + } +} + +bool socketpool_socket(socketpool_socketpool_obj_t *self, + socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type, + socketpool_socket_obj_t *sock) { + int addr_family; + int ipproto; + if (family == SOCKETPOOL_AF_INET) { + addr_family = AF_INET; + ipproto = IPPROTO_IP; + } else { // INET6 + addr_family = AF_INET6; + ipproto = IPPROTO_IPV6; + } + + int socket_type; + if (type == SOCKETPOOL_SOCK_STREAM) { + socket_type = SOCK_STREAM; + } else if (type == SOCKETPOOL_SOCK_DGRAM) { + socket_type = SOCK_DGRAM; + } else { // SOCKETPOOL_SOCK_RAW + socket_type = SOCK_RAW; + } + sock->type = socket_type; + sock->family = addr_family; + sock->ipproto = ipproto; + sock->pool = self; + sock->timeout_ms = (uint)-1; + + // Create LWIP socket + int socknum = -1; + socknum = lwip_socket(sock->family, sock->type, sock->ipproto); + if (socknum < 0) { + return false; + } + // This shouldn't happen since we have room for the same number of sockets as LWIP. + if (!register_open_socket(socknum)) { + lwip_close(socknum); + return false; + } + sock->num = socknum; + // Sockets should be nonblocking in most cases + lwip_fcntl(socknum, F_SETFL, O_NONBLOCK); + return true; +} + +socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_t *self, + socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type) { + if (family != SOCKETPOOL_AF_INET) { + mp_raise_NotImplementedError(translate("Only IPv4 sockets supported")); + } + + socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t); + sock->base.type = &socketpool_socket_type; + + if (!socketpool_socket(self, family, type, sock)) { + mp_raise_RuntimeError(translate("Out of sockets")); + } + mark_user_socket(sock->num); + return sock; +} + +int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port) { struct sockaddr_in accept_addr; socklen_t socklen = sizeof(accept_addr); int newsoc = -1; @@ -71,17 +248,15 @@ socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_o uint64_t start_ticks = supervisor_ticks_ms64(); // Allow timeouts and interrupts - while (newsoc == -1 && - !timed_out && - !mp_hal_is_interrupted()) { + while (newsoc == -1 && !timed_out) { if (self->timeout_ms != (uint)-1 && self->timeout_ms != 0) { timed_out = supervisor_ticks_ms64() - start_ticks >= self->timeout_ms; } RUN_BACKGROUND_TASKS; newsoc = lwip_accept(self->num, (struct sockaddr *)&accept_addr, &socklen); // In non-blocking mode, fail instead of timing out - if (newsoc == -1 && self->timeout_ms == 0) { - mp_raise_OSError(MP_EAGAIN); + if (newsoc == -1 && (self->timeout_ms == 0 || mp_hal_is_interrupted())) { + return -MP_EAGAIN; } } @@ -90,10 +265,24 @@ socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_o memcpy((void *)ip, (void *)&accept_addr.sin_addr.s_addr, sizeof(accept_addr.sin_addr.s_addr)); *port = accept_addr.sin_port; } else { - mp_raise_OSError(ETIMEDOUT); + return -ETIMEDOUT; } + if (newsoc < 0) { + return -MP_EBADF; + } + if (!register_open_socket(newsoc)) { + lwip_close(newsoc); + return -MP_EBADF; + } + return newsoc; +} + +socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_obj_t *self, + uint8_t *ip, uint32_t *port) { + int newsoc = socketpool_socket_accept(self, ip, port); if (newsoc > 0) { + mark_user_socket(newsoc); // Create the socket socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t); sock->base.type = &socketpool_socket_type; @@ -101,14 +290,10 @@ socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_o sock->pool = self->pool; sock->connected = true; - if (!register_open_socket(sock)) { - mp_raise_OSError(MP_EBADF); - } - lwip_fcntl(newsoc, F_SETFL, O_NONBLOCK); return sock; } else { - mp_raise_OSError(MP_EBADF); + mp_raise_OSError(-newsoc); return NULL; } } @@ -116,7 +301,17 @@ socketpool_socket_obj_t *common_hal_socketpool_socket_accept(socketpool_socket_o bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t *self, const char *host, size_t hostlen, uint32_t port) { struct sockaddr_in bind_addr; - bind_addr.sin_addr.s_addr = inet_addr(host); + const char *broadcast = ""; + uint32_t ip; + if (hostlen == 0) { + ip = IPADDR_ANY; + } else if (hostlen == strlen(broadcast) && + memcmp(host, broadcast, strlen(broadcast)) == 0) { + ip = IPADDR_BROADCAST; + } else { + ip = inet_addr(host); + } + bind_addr.sin_addr.s_addr = ip; bind_addr.sin_family = AF_INET; bind_addr.sin_port = htons(port); @@ -125,23 +320,22 @@ bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t *self, if (err != 0) { mp_raise_RuntimeError(translate("Cannot set socket options")); } - int result = lwip_bind(self->num, (struct sockaddr *)&bind_addr, sizeof(bind_addr)) == 0; - return result; + int result = lwip_bind(self->num, (struct sockaddr *)&bind_addr, sizeof(bind_addr)); + return result == 0; +} + +void socketpool_socket_close(socketpool_socket_obj_t *self) { + self->connected = false; + if (self->num >= 0) { + lwip_shutdown(self->num, SHUT_RDWR); + lwip_close(self->num); + unregister_open_socket(self->num); + self->num = -1; + } } void common_hal_socketpool_socket_close(socketpool_socket_obj_t *self) { - self->connected = false; - if (self->num >= 0) { - lwip_shutdown(self->num, 0); - lwip_close(self->num); - self->num = -1; - } - // Remove socket record - for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_handles); i++) { - if (open_socket_handles[i] == self) { - open_socket_handles[i] = NULL; - } - } + socketpool_socket_close(self); } void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *self, @@ -199,7 +393,7 @@ bool common_hal_socketpool_socket_get_connected(socketpool_socket_obj_t *self) { } bool common_hal_socketpool_socket_listen(socketpool_socket_obj_t *self, int backlog) { - return lwip_listen(self->num, backlog) == 0; + return lwip_listen(self->num, backlog); } mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t *self, @@ -242,7 +436,8 @@ mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t *se return received; } -mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t *self, const uint8_t *buf, uint32_t len) { +int socketpool_socket_recv_into(socketpool_socket_obj_t *self, + const uint8_t *buf, uint32_t len) { int received = 0; bool timed_out = false; @@ -251,8 +446,7 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t *self, uint64_t start_ticks = supervisor_ticks_ms64(); received = -1; while (received == -1 && - !timed_out && - !mp_hal_is_interrupted()) { + !timed_out) { if (self->timeout_ms != (uint)-1 && self->timeout_ms != 0) { timed_out = supervisor_ticks_ms64() - start_ticks >= self->timeout_ms; } @@ -261,31 +455,64 @@ mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t *self, // In non-blocking mode, fail instead of looping if (received == -1 && self->timeout_ms == 0) { - mp_raise_OSError(MP_EAGAIN); + if (errno == ENOTCONN) { + self->connected = false; + return -MP_ENOTCONN; + } + return -MP_EAGAIN; + } + // Check this after going through the loop once so it can make + // progress while interrupted. + if (mp_hal_is_interrupted()) { + if (received == -1) { + return -MP_EAGAIN; + } + break; } } } else { - mp_raise_OSError(MP_EBADF); + return -MP_EBADF; } if (timed_out) { - mp_raise_OSError(ETIMEDOUT); + return -ETIMEDOUT; } return received; } -mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t *self, const uint8_t *buf, uint32_t len) { +mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t *self, const uint8_t *buf, uint32_t len) { + int received = socketpool_socket_recv_into(self, buf, len); + if (received < 0) { + mp_raise_OSError(received); + } + return received; +} + +int socketpool_socket_send(socketpool_socket_obj_t *self, const uint8_t *buf, uint32_t len) { int sent = -1; if (self->num != -1) { // LWIP Socket // TODO: deal with potential failure/add timeout? sent = lwip_send(self->num, buf, len, 0); } else { - mp_raise_OSError(MP_EBADF); + sent = -MP_EBADF; } if (sent < 0) { - mp_raise_OSError(errno); + if (errno == ECONNRESET || errno == ENOTCONN) { + self->connected = false; + } + return -errno; + } + + return sent; +} + +mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t *self, const uint8_t *buf, uint32_t len) { + int sent = socketpool_socket_send(self, buf, len); + + if (sent < 0) { + mp_raise_OSError(-sent); } return sent; } diff --git a/ports/espressif/common-hal/socketpool/Socket.h b/ports/espressif/common-hal/socketpool/Socket.h index 943b5d9fdd..b91419807c 100644 --- a/ports/espressif/common-hal/socketpool/Socket.h +++ b/ports/espressif/common-hal/socketpool/Socket.h @@ -45,7 +45,6 @@ typedef struct { mp_uint_t timeout_ms; } socketpool_socket_obj_t; -void socket_reset(void); -bool register_open_socket(socketpool_socket_obj_t *self); +void socket_user_reset(void); #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_SOCKETPOOL_SOCKET_H diff --git a/ports/espressif/common-hal/socketpool/SocketPool.c b/ports/espressif/common-hal/socketpool/SocketPool.c index 4cea95ec41..1d1aafa638 100644 --- a/ports/espressif/common-hal/socketpool/SocketPool.c +++ b/ports/espressif/common-hal/socketpool/SocketPool.c @@ -40,52 +40,7 @@ void common_hal_socketpool_socketpool_construct(socketpool_socketpool_obj_t *sel } } -socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_t *self, - socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type) { - - int addr_family; - int ipproto; - if (family == SOCKETPOOL_AF_INET) { - addr_family = AF_INET; - ipproto = IPPROTO_IP; - } else { // INET6 - addr_family = AF_INET6; - ipproto = IPPROTO_IPV6; - } - - int socket_type; - if (type == SOCKETPOOL_SOCK_STREAM) { - socket_type = SOCK_STREAM; - } else if (type == SOCKETPOOL_SOCK_DGRAM) { - socket_type = SOCK_DGRAM; - } else { // SOCKETPOOL_SOCK_RAW - socket_type = SOCK_RAW; - } - - if (addr_family == AF_INET6 || ipproto == IPPROTO_IPV6) { - mp_raise_NotImplementedError(translate("Only IPv4 sockets supported")); - } - - socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t); - sock->base.type = &socketpool_socket_type; - sock->type = socket_type; - sock->family = addr_family; - sock->ipproto = ipproto; - sock->pool = self; - sock->timeout_ms = (uint)-1; - - // Create LWIP socket - int socknum = -1; - socknum = lwip_socket(sock->family, sock->type, sock->ipproto); - if (socknum < 0 || !register_open_socket(sock)) { - mp_raise_RuntimeError(translate("Out of sockets")); - } - sock->num = socknum; - // Sockets should be nonblocking in most cases - lwip_fcntl(socknum, F_SETFL, O_NONBLOCK); - return sock; -} - +// common_hal_socketpool_socket is in socketpool/Socket.c to centralize open socket tracking. mp_obj_t common_hal_socketpool_socketpool_gethostbyname(socketpool_socketpool_obj_t *self, const char *host) { diff --git a/ports/espressif/common-hal/socketpool/__init__.c b/ports/espressif/common-hal/socketpool/__init__.c index fa0e7d5f3f..595977d24f 100644 --- a/ports/espressif/common-hal/socketpool/__init__.c +++ b/ports/espressif/common-hal/socketpool/__init__.c @@ -23,3 +23,11 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + +#include "shared-bindings/socketpool/__init__.h" + +#include "common-hal/socketpool/Socket.h" + +void socketpool_user_reset(void) { + socket_user_reset(); +} diff --git a/ports/espressif/common-hal/touchio/TouchIn.c b/ports/espressif/common-hal/touchio/TouchIn.c index 53bc335d30..c2ef0d6e18 100644 --- a/ports/espressif/common-hal/touchio/TouchIn.c +++ b/ports/espressif/common-hal/touchio/TouchIn.c @@ -28,35 +28,24 @@ #include "py/runtime.h" #include "peripherals/touch.h" - -static uint16_t get_raw_reading(touchio_touchin_obj_t *self) { - uint32_t touch_value; - touch_pad_read_raw_data(self->pin->touch_channel, &touch_value); - if (touch_value > UINT16_MAX) { - return UINT16_MAX; - } - return touch_value; -} +#include "shared-bindings/microcontroller/Pin.h" void common_hal_touchio_touchin_construct(touchio_touchin_obj_t *self, const mcu_pin_obj_t *pin) { - if (pin->touch_channel == TOUCH_PAD_MAX) { - mp_raise_ValueError(translate("Invalid pin")); + if (pin->touch_channel == NO_TOUCH_CHANNEL) { + raise_ValueError_invalid_pin(); } claim_pin(pin); // initialize touchpad peripherals_touch_init(pin->touch_channel); - // wait for touch data to reset - mp_hal_delay_ms(10); - // Set a "touched" threshold not too far above the initial value. // For simple finger touch, the values may vary as much as a factor of two, // but for touches using fruit or other objects, the difference is much less. self->pin = pin; - self->threshold = get_raw_reading(self) + 100; + self->threshold = common_hal_touchio_touchin_get_raw_value(self) + 100; } bool common_hal_touchio_touchin_deinited(touchio_touchin_obj_t *self) { @@ -72,11 +61,11 @@ void common_hal_touchio_touchin_deinit(touchio_touchin_obj_t *self) { } bool common_hal_touchio_touchin_get_value(touchio_touchin_obj_t *self) { - return get_raw_reading(self) > self->threshold; + return common_hal_touchio_touchin_get_raw_value(self) > self->threshold; } uint16_t common_hal_touchio_touchin_get_raw_value(touchio_touchin_obj_t *self) { - return get_raw_reading(self); + return peripherals_touch_read(self->pin->touch_channel); } uint16_t common_hal_touchio_touchin_get_threshold(touchio_touchin_obj_t *self) { diff --git a/ports/espressif/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c index 4f92425c87..8616501ba2 100644 --- a/ports/espressif/common-hal/wifi/Radio.c +++ b/ports/espressif/common-hal/wifi/Radio.c @@ -139,6 +139,16 @@ void common_hal_wifi_radio_set_mac_address(wifi_radio_obj_t *self, const uint8_t esp_wifi_set_mac(ESP_IF_WIFI_STA, mac); } +mp_float_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self) { + int8_t tx_power; + esp_wifi_get_max_tx_power(&tx_power); + return tx_power / 4.0f; +} + +void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const mp_float_t tx_power) { + esp_wifi_set_max_tx_power(tx_power * 4.0f); +} + mp_obj_t common_hal_wifi_radio_get_mac_address_ap(wifi_radio_obj_t *self) { uint8_t mac[MAC_ADDRESS_LENGTH]; esp_wifi_get_mac(ESP_IF_WIFI_AP, mac); @@ -209,7 +219,7 @@ void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_ authmode = WIFI_AUTH_WPA_WPA2_PSK; break; default: - mp_raise_ValueError(translate("Invalid AuthMode")); + mp_arg_error_invalid(MP_QSTR_authmode); break; } @@ -221,9 +231,8 @@ void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_ config->ap.channel = channel; config->ap.authmode = authmode; - if (max_connections < 0 || max_connections > 10) { - mp_raise_ValueError(translate("max_connections must be between 0 and 10")); - } + mp_arg_validate_int_range(max_connections, 0, 10, MP_QSTR_max_connections); + config->ap.max_connection = max_connections; esp_wifi_set_config(WIFI_IF_AP, config); @@ -237,6 +246,11 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t if (!common_hal_wifi_radio_get_enabled(self)) { mp_raise_RuntimeError(translate("wifi is not enabled")); } + wifi_config_t *config = &self->sta_config; + + size_t timeout_ms = timeout * 1000; + uint32_t start_time = common_hal_time_monotonic_ms(); + uint32_t end_time = start_time + timeout_ms; EventBits_t bits; // can't block since both bits are false after wifi_init @@ -246,18 +260,37 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t pdTRUE, pdTRUE, 0); - if (((bits & WIFI_CONNECTED_BIT) != 0) && - !((bits & WIFI_DISCONNECTED_BIT) != 0)) { - return WIFI_RADIO_ERROR_NONE; + bool connected = ((bits & WIFI_CONNECTED_BIT) != 0) && + !((bits & WIFI_DISCONNECTED_BIT) != 0); + if (connected) { + // SSIDs are up to 32 bytes. Assume it is null terminated if it is less. + if (memcmp(ssid, config->sta.ssid, ssid_len) == 0 && + (ssid_len == 32 || strlen((const char *)config->sta.ssid) == ssid_len)) { + // Already connected to the desired network. + return WIFI_RADIO_ERROR_NONE; + } else { + xEventGroupClearBits(self->event_group_handle, WIFI_DISCONNECTED_BIT); + // Trying to switch networks so disconnect first. + esp_wifi_disconnect(); + do { + RUN_BACKGROUND_TASKS; + bits = xEventGroupWaitBits(self->event_group_handle, + WIFI_DISCONNECTED_BIT, + pdTRUE, + pdTRUE, + 0); + } while ((bits & WIFI_DISCONNECTED_BIT) == 0 && !mp_hal_is_interrupted()); + } } // explicitly clear bits since xEventGroupWaitBits may have timed out xEventGroupClearBits(self->event_group_handle, WIFI_CONNECTED_BIT); xEventGroupClearBits(self->event_group_handle, WIFI_DISCONNECTED_BIT); set_mode_station(self, true); - wifi_config_t *config = &self->sta_config; memcpy(&config->sta.ssid, ssid, ssid_len); - config->sta.ssid[ssid_len] = 0; + if (ssid_len < 32) { + config->sta.ssid[ssid_len] = 0; + } memcpy(&config->sta.password, password, password_len); config->sta.password[password_len] = 0; config->sta.channel = channel; @@ -290,7 +323,12 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t pdTRUE, pdTRUE, 0); + // Don't retry anymore if we're over our time budget. + if (self->retries_left > 0 && common_hal_time_monotonic_ms() > end_time) { + self->retries_left = 0; + } } while ((bits & (WIFI_CONNECTED_BIT | WIFI_DISCONNECTED_BIT)) == 0 && !mp_hal_is_interrupted()); + if ((bits & WIFI_DISCONNECTED_BIT) != 0) { if (self->last_disconnect_reason == WIFI_REASON_AUTH_FAIL) { return WIFI_RADIO_ERROR_AUTH_FAIL; @@ -298,6 +336,9 @@ wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t return WIFI_RADIO_ERROR_NO_AP_FOUND; } return self->last_disconnect_reason; + } else { + // We're connected, allow us to retry if we get disconnected. + self->retries_left = self->starting_retries; } return WIFI_RADIO_ERROR_NONE; } @@ -369,6 +410,14 @@ mp_obj_t common_hal_wifi_radio_get_ipv4_subnet_ap(wifi_radio_obj_t *self) { return common_hal_ipaddress_new_ipv4address(self->ap_ip_info.netmask.addr); } +uint32_t wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { + if (!esp_netif_is_netif_up(self->netif)) { + return 0; + } + esp_netif_get_ip_info(self->netif, &self->ip_info); + return self->ip_info.ip.addr; +} + mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self) { if (!esp_netif_is_netif_up(self->netif)) { return mp_const_none; @@ -399,6 +448,35 @@ mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self) { return common_hal_ipaddress_new_ipv4address(self->dns_info.ip.u_addr.ip4.addr); } +void common_hal_wifi_radio_set_ipv4_dns(wifi_radio_obj_t *self, mp_obj_t ipv4_dns_addr) { + esp_netif_dns_info_t dns_addr; + ipaddress_ipaddress_to_esp_idf_ip4(ipv4_dns_addr, &dns_addr.ip.u_addr.ip4); + esp_netif_set_dns_info(self->netif, ESP_NETIF_DNS_MAIN, &dns_addr); +} + +void common_hal_wifi_radio_start_dhcp_client(wifi_radio_obj_t *self) { + esp_netif_dhcpc_start(self->netif); +} + +void common_hal_wifi_radio_stop_dhcp_client(wifi_radio_obj_t *self) { + esp_netif_dhcpc_stop(self->netif); +} + +void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv4, mp_obj_t netmask, mp_obj_t gateway, mp_obj_t ipv4_dns) { + common_hal_wifi_radio_stop_dhcp_client(self); // Must stop DHCP to set a manual address + + esp_netif_ip_info_t ip_info; + ipaddress_ipaddress_to_esp_idf_ip4(ipv4, &ip_info.ip); + ipaddress_ipaddress_to_esp_idf_ip4(netmask, &ip_info.netmask); + ipaddress_ipaddress_to_esp_idf_ip4(gateway, &ip_info.gw); + + esp_netif_set_ip_info(self->netif, &ip_info); + + if (ipv4_dns != MP_OBJ_NULL) { + common_hal_wifi_radio_set_ipv4_dns(self, ipv4_dns); + } +} + mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout) { esp_ping_config_t ping_config = ESP_PING_DEFAULT_CONFIG(); ipaddress_ipaddress_to_esp_idf(ip_address, &ping_config.target_addr); diff --git a/ports/espressif/common-hal/wifi/__init__.c b/ports/espressif/common-hal/wifi/__init__.c index cb9b028aba..42ea078810 100644 --- a/ports/espressif/common-hal/wifi/__init__.c +++ b/ports/espressif/common-hal/wifi/__init__.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#include "bindings/espidf/__init__.h" #include "common-hal/wifi/__init__.h" #include "shared-bindings/wifi/__init__.h" @@ -42,10 +43,35 @@ wifi_radio_obj_t common_hal_wifi_radio_obj; #include "components/log/include/esp_log.h" -static const char *TAG = "wifi"; +#include "supervisor/port.h" +#include "supervisor/workflow.h" + +#if CIRCUITPY_STATUS_BAR +#include "supervisor/shared/status_bar.h" +#endif + +#include "esp_ipc.h" + +#ifdef CONFIG_IDF_TARGET_ESP32 +#include "nvs_flash.h" +#endif + +static const char *TAG = "CP wifi"; + +STATIC void schedule_background_on_cp_core(void *arg) { + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_request_update(false); + #endif + + // CircuitPython's VM is run in a separate FreeRTOS task from wifi callbacks. So, we have to + // notify the main task every time in case it's waiting for us. + port_wake_main_task(); +} static void event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) { + // This runs on the PRO CORE! It cannot share CP interrupt enable/disable + // directly. wifi_radio_obj_t *radio = arg; if (event_base == WIFI_EVENT) { switch (event_id) { @@ -106,12 +132,31 @@ static void event_handler(void *arg, esp_event_base_t event_base, radio->retries_left = radio->starting_retries; xEventGroupSetBits(radio->event_group_handle, WIFI_CONNECTED_BIT); } + // Use IPC to ensure we run schedule background on the same core as CircuitPython. + #if defined(CONFIG_FREERTOS_UNICORE) && CONFIG_FREERTOS_UNICORE + schedule_background_on_cp_core(NULL); + #else + // This only blocks until the start of the function. That's ok since the PRO + // core shouldn't care what we do. + esp_ipc_call(CONFIG_ESP_MAIN_TASK_AFFINITY, schedule_background_on_cp_core, NULL); + #endif } -static bool wifi_inited, wifi_ever_inited; +static bool wifi_inited; +static bool wifi_ever_inited; +static bool wifi_user_initiated; -void common_hal_wifi_init(void) { +void common_hal_wifi_init(bool user_initiated) { + wifi_radio_obj_t *self = &common_hal_wifi_radio_obj; + + if (wifi_inited) { + if (user_initiated && !wifi_user_initiated) { + common_hal_wifi_radio_set_enabled(self, true); + } + return; + } wifi_inited = true; + wifi_user_initiated = user_initiated; common_hal_wifi_radio_obj.base.type = &wifi_radio_type; if (!wifi_ever_inited) { @@ -120,7 +165,6 @@ void common_hal_wifi_init(void) { } wifi_ever_inited = true; - wifi_radio_obj_t *self = &common_hal_wifi_radio_obj; self->netif = esp_netif_create_default_wifi_sta(); self->ap_netif = esp_netif_create_default_wifi_ap(); self->started = false; @@ -145,11 +189,21 @@ void common_hal_wifi_init(void) { &self->handler_instance_got_ip)); wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT(); + #ifdef CONFIG_IDF_TARGET_ESP32 + esp_err_t err = nvs_flash_init(); + if (err == ESP_ERR_NVS_NO_FREE_PAGES || err == ESP_ERR_NVS_NEW_VERSION_FOUND) { + // NVS partition was truncated and needs to be erased + // Retry nvs_flash_init + ESP_ERROR_CHECK(nvs_flash_erase()); + err = nvs_flash_init(); + } + ESP_ERROR_CHECK(err); + #endif esp_err_t result = esp_wifi_init(&config); if (result == ESP_ERR_NO_MEM) { mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate Wifi memory")); } else if (result != ESP_OK) { - mp_raise_RuntimeError(translate("Failed to init wifi")); + raise_esp_error(result); } // set station mode to avoid the default SoftAP common_hal_wifi_radio_start_station(self); @@ -157,6 +211,13 @@ void common_hal_wifi_init(void) { common_hal_wifi_radio_set_enabled(self, true); } +void wifi_user_reset(void) { + if (wifi_user_initiated) { + wifi_reset(); + wifi_user_initiated = false; + } +} + void wifi_reset(void) { if (!wifi_inited) { return; @@ -164,6 +225,7 @@ void wifi_reset(void) { common_hal_wifi_monitor_deinit(MP_STATE_VM(wifi_monitor_singleton)); wifi_radio_obj_t *radio = &common_hal_wifi_radio_obj; common_hal_wifi_radio_set_enabled(radio, false); + #ifndef CONFIG_IDF_TARGET_ESP32 ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, radio->handler_instance_all_wifi)); @@ -176,6 +238,8 @@ void wifi_reset(void) { esp_netif_destroy(radio->ap_netif); radio->ap_netif = NULL; wifi_inited = false; + #endif + supervisor_workflow_request_background(); } void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t *esp_ip_address) { @@ -189,6 +253,16 @@ void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t *esp_ip_addre IP_ADDR4(esp_ip_address, bytes[0], bytes[1], bytes[2], bytes[3]); } +void ipaddress_ipaddress_to_esp_idf_ip4(mp_obj_t ip_address, esp_ip4_addr_t *esp_ip_address) { + if (!mp_obj_is_type(ip_address, &ipaddress_ipv4address_type)) { + mp_raise_ValueError(translate("Only IPv4 addresses supported")); + } + mp_obj_t packed = common_hal_ipaddress_ipv4address_get_packed(ip_address); + size_t len; + const char *bytes = mp_obj_str_get_data(packed, &len); + esp_netif_set_ip4_addr(esp_ip_address, bytes[0], bytes[1], bytes[2], bytes[3]); +} + void common_hal_wifi_gc_collect(void) { common_hal_wifi_radio_gc_collect(&common_hal_wifi_radio_obj); } diff --git a/ports/espressif/common-hal/wifi/__init__.h b/ports/espressif/common-hal/wifi/__init__.h index be91dca758..4258f1643f 100644 --- a/ports/espressif/common-hal/wifi/__init__.h +++ b/ports/espressif/common-hal/wifi/__init__.h @@ -30,9 +30,11 @@ #include "py/obj.h" #include "lwip/api.h" +#include "components/esp_wifi/include/esp_wifi.h" void wifi_reset(void); void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t *esp_ip_address); +void ipaddress_ipaddress_to_esp_idf_ip4(mp_obj_t ip_address, esp_ip4_addr_t *esp_ip_address); #endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_WIFI___INIT___H diff --git a/ports/espressif/esp-idf b/ports/espressif/esp-idf index 121ddb87e5..d51f7d8821 160000 --- a/ports/espressif/esp-idf +++ b/ports/espressif/esp-idf @@ -1 +1 @@ -Subproject commit 121ddb87e5130314e4fcc5e9cb260a81b7d30d36 +Subproject commit d51f7d882187afa4b39c2613fd0fe2ac2fea1145 diff --git a/ports/espressif/esp-idf-config/partitions-16MB-no-uf2.csv b/ports/espressif/esp-idf-config/partitions-16MB-no-uf2.csv new file mode 100644 index 0000000000..8e73e8d056 --- /dev/null +++ b/ports/espressif/esp-idf-config/partitions-16MB-no-uf2.csv @@ -0,0 +1,9 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +# bootloader.bin,, 0x1000, 32K +# partition table,, 0x8000, 4K +nvs, data, nvs, 0x9000, 20K, +otadata, data, ota, 0xe000, 8K, +ota_0, 0, ota_0, 0x10000, 2048K, +ota_1, 0, ota_1, 0x210000, 2048K, +user_fs, data, fat, 0x410000, 12224K, diff --git a/ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv b/ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv new file mode 100644 index 0000000000..ba92d9fc73 --- /dev/null +++ b/ports/espressif/esp-idf-config/partitions-8MB-no-uf2.csv @@ -0,0 +1,9 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +# bootloader.bin,, 0x1000, 32K +# partition table,, 0x8000, 4K +nvs, data, nvs, 0x9000, 20K, +otadata, data, ota, 0xe000, 8K, +ota_0, app, ota_0, 0x10000, 2048K, +ota_1, app, ota_1, 0x210000, 2048K, +user_fs, data, fat, 0x410000, 4032K, diff --git a/ports/espressif/esp-idf-config/sdkconfig-16MB-no-uf2.defaults b/ports/espressif/esp-idf-config/sdkconfig-16MB-no-uf2.defaults new file mode 100644 index 0000000000..6065abcd93 --- /dev/null +++ b/ports/espressif/esp-idf-config/sdkconfig-16MB-no-uf2.defaults @@ -0,0 +1,18 @@ +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="16MB" +CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y +# end of Serial flasher config + +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-16MB-no-uf2.csv" +# +# Partition Table +# +CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-16MB-no-uf2.csv" +# end of Partition Table diff --git a/ports/espressif/esp-idf-config/sdkconfig-8MB-no-uf2.defaults b/ports/espressif/esp-idf-config/sdkconfig-8MB-no-uf2.defaults new file mode 100644 index 0000000000..2a2548ba04 --- /dev/null +++ b/ports/espressif/esp-idf-config/sdkconfig-8MB-no-uf2.defaults @@ -0,0 +1,18 @@ +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="8MB" +CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y +# end of Serial flasher config + +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" +# +# Partition Table +# +CONFIG_PARTITION_TABLE_FILENAME="esp-idf-config/partitions-8MB-no-uf2.csv" +# end of Partition Table diff --git a/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults new file mode 100644 index 0000000000..62e35a32e2 --- /dev/null +++ b/ports/espressif/esp-idf-config/sdkconfig-esp32.defaults @@ -0,0 +1,1162 @@ +# +# Espressif IoT Development Framework (ESP-IDF) Project Configuration +# +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 + +# +# SDK tool configuration +# +CONFIG_SDK_TOOLPREFIX="xtensa-esp32-elf-" +# CONFIG_SDK_TOOLCHAIN_SUPPORTS_TIME_WIDE_64_BITS is not set +# end of SDK tool configuration + +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +# end of Build type + +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 +# end of Application manager + +# +# Bootloader config +# +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y +# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_INFO is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=0 +# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_WDT_ENABLE=y +# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set +CONFIG_BOOTLOADER_WDT_TIME_MS=9000 +# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Bootloader config + +# +# Security features +# +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +# end of Security features + +# +# Serial flasher config +# +CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 +# CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +CONFIG_ESPTOOLPY_FLASHMODE_DIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ="40m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +# CONFIG_ESPTOOLPY_MONITOR_BAUD_CONSOLE is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_9600B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_57600B is not set +CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y +# CONFIG_ESPTOOLPY_MONITOR_BAUD_230400B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_921600B is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_2MB is not set +# CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER is not set +CONFIG_ESPTOOLPY_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Compiler options +# +# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set +CONFIG_COMPILER_HIDE_PATHS_MACROS=y +# CONFIG_COMPILER_CXX_EXCEPTIONS is not set +# CONFIG_COMPILER_CXX_RTTI is not set +CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y +# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +# CONFIG_COMPILER_DISABLE_GCC8_WARNINGS is not set +# CONFIG_COMPILER_DUMP_RTL_FILES is not set +# end of Compiler options + +# +# Component config +# + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_JTAG is not set +CONFIG_APPTRACE_DEST_NONE=y +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Bluetooth +# +# CONFIG_BT_ENABLED is not set +# end of Bluetooth + +# +# Driver configurations +# + +# +# ADC configuration +# +# CONFIG_ADC_FORCE_XPD_FSM is not set +CONFIG_ADC_DISABLE_DAC=y +# end of ADC configuration + +# +# MCPWM configuration +# +# CONFIG_MCPWM_ISR_IN_IRAM is not set +# end of MCPWM configuration + +# +# SPI configuration +# +# CONFIG_SPI_MASTER_IN_IRAM is not set +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_IN_IRAM is not set +CONFIG_SPI_SLAVE_ISR_IN_IRAM=y +# end of SPI configuration + +# +# TWAI configuration +# +# CONFIG_TWAI_ISR_IN_IRAM is not set +# CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is not set +# CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID is not set +# CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT is not set +# end of TWAI configuration + +# +# UART configuration +# +CONFIG_UART_ISR_IN_IRAM=y +# end of UART configuration + +# +# RTCIO configuration +# +# CONFIG_RTCIO_SUPPORT_RTC_GPIO_DESC is not set +# end of RTCIO configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# end of GPIO Configuration + +# +# GDMA Configuration +# +# CONFIG_GDMA_CTRL_FUNC_IN_IRAM is not set +# CONFIG_GDMA_ISR_IRAM_SAFE is not set +# end of GDMA Configuration +# end of Driver configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +CONFIG_ESP_TLS_SERVER=y +# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# CONFIG_ESP_TLS_INSECURE is not set +# end of ESP-TLS + +# +# ESP32-specific +# +CONFIG_ESP32_ECO3_CACHE_LOCK_FIX=y +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_DPORT_WORKAROUND=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 +# CONFIG_ESP32_SPIRAM_SUPPORT is not set + +# +# SPIRAM cache workaround debugging +# +CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW=y +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_DUPLDST is not set +# CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_NOPS is not set +# end of SPIRAM cache workaround debugging + +# +# SPIRAM workaround libraries placement +# +CONFIG_SPIRAM_CACHE_LIBJMP_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMATH_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBNUMPARSER_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBIO_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMEM_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBRAND_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBENV_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBFILE_IN_IRAM=y +CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=y +# end of SPIRAM workaround libraries placement + +CONFIG_SPIRAM_BANKSWITCH_ENABLE=n + +# +# PSRAM clock and cs IO for ESP32-DOWD +# +CONFIG_D0WD_PSRAM_CLK_IO=17 +CONFIG_D0WD_PSRAM_CS_IO=16 +# end of PSRAM clock and cs IO for ESP32-DOWD + +# +# PSRAM clock and cs IO for ESP32-D2WD +# +CONFIG_D2WD_PSRAM_CLK_IO=9 +CONFIG_D2WD_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-D2WD + +# +# PSRAM clock and cs IO for ESP32-PICO +# +CONFIG_PICO_PSRAM_CS_IO=10 +# end of PSRAM clock and cs IO for ESP32-PICO + +# CONFIG_SPIRAM_CUSTOM_SPIWP_SD3_PIN is not set +CONFIG_SPIRAM_SPIWP_SD3_PIN=7 +# CONFIG_SPIRAM_2T_MODE is not set +# end of SPI RAM config + +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=0 +CONFIG_ESP32_DEBUG_OCDAWARE=y +CONFIG_ESP32_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP32_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_26 is not set +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_ESP32_NO_BLOBS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set +CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 +# end of ESP32-specific + +# +# ADC-Calibration +# +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y +# end of ADC-Calibration + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# Ethernet +# +# CONFIG_ETH_USE_ESP32_EMAC is not set +# CONFIG_ETH_USE_SPI_ETHERNET is not set +# CONFIG_ETH_USE_OPENETH is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y +# end of Event Loop Library + +# +# GDB Stub +# +# end of GDB Stub + +# +# Hardware Settings +# + +# +# MAC Config +# +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# end of MAC Config + +# +# Sleep Config +# +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y +# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set +# CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND is not set +# CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND is not set +# end of Sleep Config + +# +# RTC Clock Config +# +# end of RTC Clock Config +# end of Hardware Settings + +# +# IPC (Inter-Processor Call) +# +CONFIG_ESP_IPC_TASK_STACK_SIZE=1536 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y +# end of IPC (Inter-Processor Call) + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +CONFIG_ESP_NETIF_TCPIP_LWIP=y +# CONFIG_ESP_NETIF_LOOPBACK is not set +# CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER is not set +# end of ESP NETIF Adapter + +# +# PHY +# +CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP_PHY_MAX_TX_POWER=20 +CONFIG_ESP_PHY_REDUCE_TX_POWER=y +# end of PHY + +# +# Power Management +# +# CONFIG_PM_ENABLE is not set +# end of Power Management + +# +# ESP System Settings +# +CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y +# CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set + +# +# Memory protection +# +# end of Memory protection + +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set +# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 +# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +CONFIG_ESP_CONSOLE_NONE=y +CONFIG_ESP_CONSOLE_MULTIPLE_UART=y +CONFIG_ESP_CONSOLE_UART_NUM=-1 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y +# CONFIG_ESP_TASK_WDT is not set +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +# CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5 is not set +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y +# end of ESP System Settings + +# +# High resolution timer (esp_timer) +# +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y +CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 +# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set +# CONFIG_ESP_TIMER_IMPL_FRC2 is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y +# end of High resolution timer (esp_timer) + +# +# Wi-Fi +# +CONFIG_ESP32_WIFI_ENABLED=y +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32 +# CONFIG_ESP32_WIFI_CSI_ENABLED is not set +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP32_WIFI_TX_BA_WIN=6 +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +# CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED is not set +CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP32_WIFI_IRAM_OPT=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +# CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set +# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# end of Wi-Fi + +# +# Core dump +# +# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set +# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set +CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +# end of Core dump + +# +# FreeRTOS +# +# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y +CONFIG_FREERTOS_HZ=100 +CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set +CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y +# CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE is not set +# CONFIG_FREERTOS_ASSERT_DISABLE is not set +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 +CONFIG_FREERTOS_ISR_STACKSIZE=1536 +# CONFIG_FREERTOS_LEGACY_HOOKS is not set +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set +CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y +# CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set +# end of FreeRTOS + +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y +# CONFIG_HAL_ASSERTION_DISABLE is not set +# CONFIG_HAL_ASSERTION_SILIENT is not set +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# end of Heap memory debugging + +# +# Log output +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=3 +CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set +# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set +CONFIG_LOG_MAXIMUM_LEVEL=3 +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Log output + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="Adafruit-Feather-ESP32-V2" +# CONFIG_LWIP_NETIF_API is not set +# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_MAX_SOCKETS=8 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set +CONFIG_LWIP_SO_REUSE=y +CONFIG_LWIP_SO_REUSE_RXTOALL=y +CONFIG_LWIP_SO_RCVBUF=y +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +# CONFIG_LWIP_ETHARP_TRUST_IP_MAC is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +CONFIG_LWIP_DHCP_OPTIONS_LEN=68 + +# +# DHCP server +# +CONFIG_LWIP_DHCPS=y +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +CONFIG_LWIP_IPV6=y +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 +# CONFIG_LWIP_IPV6_FORWARD is not set +# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=4 +CONFIG_LWIP_MAX_LISTENING_TCP=4 +CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=6 +CONFIG_LWIP_TCP_MSS=1440 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=2880 +CONFIG_LWIP_TCP_WND_DEFAULT=2880 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +# CONFIG_LWIP_TCP_SACK_OUT is not set +# CONFIG_LWIP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=3000 +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +# +# Checksums +# +# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set +# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set +CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y +# end of Checksums + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_LWIP_PPP_SUPPORT is not set +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +# CONFIG_LWIP_SLIP_SUPPORT is not set + +# +# ICMP +# +CONFIG_LWIP_ICMP=y +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_SNTP_MAX_SERVERS=1 +# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +# end of SNTP + +CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Hooks +# +# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set +CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y +# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y +# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set +CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y +# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set +# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set +CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set +# end of Hooks + +# CONFIG_LWIP_DEBUG is not set +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=2048 +# CONFIG_MBEDTLS_DEBUG is not set + +# +# mbedTLS v2.28.x related +# +# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +CONFIG_MBEDTLS_ECDH_LEGACY_CONTEXT=y +# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set +# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y + +# +# DTLS-based configurations +# +# CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID is not set +# CONFIG_MBEDTLS_SSL_DTLS_SRTP is not set +# end of DTLS-based configurations +# end of mbedTLS v2.28.x related + +# +# Certificate Bundle +# +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE=y +CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE=y +CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE_PATH="certificates/nina-fw/data/roots.pem" +# end of Certificate Bundle + +CONFIG_MBEDTLS_ECP_RESTARTABLE=y +CONFIG_MBEDTLS_CMAC_C=y +CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_HARDWARE_MPI=y +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_ROM_MD5=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA512_C=y +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +CONFIG_MBEDTLS_PSK_MODES=y +CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_PSK=y +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +# CONFIG_MBEDTLS_SSL_PROTO_SSL3 is not set +# CONFIG_MBEDTLS_SSL_PROTO_TLS1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_1 is not set +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set +CONFIG_MBEDTLS_SSL_PROTO_DTLS=y +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_X509_CHECK_KEY_USAGE=y +CONFIG_MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +CONFIG_MBEDTLS_RC4_DISABLED=y +# CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT is not set +# CONFIG_MBEDTLS_RC4_ENABLED is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# CONFIG_MBEDTLS_NIST_KW_C is not set +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y +CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +# CONFIG_MBEDTLS_SECURITY_RISKS is not set +# end of mbedTLS + +# +# mDNS +# +CONFIG_MDNS_MAX_SERVICES=10 +CONFIG_MDNS_TASK_PRIORITY=1 +CONFIG_MDNS_TASK_STACK_SIZE=4096 +# CONFIG_MDNS_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_MDNS_TASK_AFFINITY_CPU0=y +# CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set +CONFIG_MDNS_TASK_AFFINITY=0x0 +CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 +# CONFIG_MDNS_STRICT_MODE is not set +CONFIG_MDNS_TIMER_PERIOD_MS=100 +# CONFIG_MDNS_NETWORKING_SOCKET is not set +CONFIG_MDNS_MULTIPLE_INSTANCE=y +# end of mDNS + +# +# Newlib +# +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +# end of Newlib + +# +# NVS +# +# end of NVS + +# +# OpenThread +# +# CONFIG_OPENTHREAD_ENABLED is not set +# end of OpenThread + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_USE_LEGACY_IMPL is not set +# CONFIG_SPI_FLASH_SHARE_SPI1_BUS is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +# CONFIG_SPI_FLASH_YIELD_DURING_ERASE is not set +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set +# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set +# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y +# end of Auto-detect flash chips + +CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y +# end of SPI Flash driver + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_VFS_SUPPORT_TERMIOS=y + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 +# end of Host File System I/O (Semihosting) +# end of Virtual file system + +# +# Supplicant +# +CONFIG_WPA_MBEDTLS_CRYPTO=y +# CONFIG_WPA_WAPI_PSK is not set +# CONFIG_WPA_SUITE_B_192 is not set +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_WPA_WPS_STRICT is not set +# CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# end of Supplicant +# end of Component config + +# +# Compatibility options +# +# CONFIG_LEGACY_INCLUDE_COMMON_HEADERS is not set +# end of Compatibility options + +# Deprecated options for backward compatibility +CONFIG_TOOLPREFIX="xtensa-esp32-elf-" +CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_INFO is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=0 +# CONFIG_APP_ROLLBACK_ENABLE is not set +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +# CONFIG_FLASHMODE_QIO is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +# CONFIG_MONITOR_BAUD_9600B is not set +# CONFIG_MONITOR_BAUD_57600B is not set +CONFIG_MONITOR_BAUD_115200B=y +# CONFIG_MONITOR_BAUD_230400B is not set +# CONFIG_MONITOR_BAUD_921600B is not set +# CONFIG_MONITOR_BAUD_2MB is not set +# CONFIG_MONITOR_BAUD_OTHER is not set +CONFIG_MONITOR_BAUD_OTHER_VAL=115200 +CONFIG_MONITOR_BAUD=115200 +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set +CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_DISABLE_GCC8_WARNINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_ADC2_DISABLE_DAC=y +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ULP_COPROC_ENABLED is not set +CONFIG_ULP_COPROC_RESERVE_MEM=0 +CONFIG_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 +# CONFIG_ESP32C3_LIGHTSLEEP_GPIO_RESET_WORKAROUND is not set +CONFIG_IPC_TASK_STACK_SIZE=1536 +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +CONFIG_ESP32_REDUCE_PHY_TX_POWER=y +CONFIG_ESP32S2_PANIC_PRINT_HALT=y +# CONFIG_ESP32S2_PANIC_PRINT_REBOOT is not set +# CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP32S2_PANIC_GDBSTUB is not set +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +# CONFIG_CONSOLE_UART_DEFAULT is not set +# CONFIG_CONSOLE_UART_CUSTOM is not set +CONFIG_ESP_CONSOLE_UART_NONE=y +CONFIG_CONSOLE_UART_NUM=-1 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +# CONFIG_TASK_WDT is not set +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_TIMER_TASK_STACK_SIZE=3584 +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_L2_TO_L3_COPY is not set +# CONFIG_USE_ONLY_LWIP_SELECT is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=6 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=2880 +CONFIG_TCP_WND_DEFAULT=2880 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +# CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES is not set +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 +# End of deprecated options diff --git a/ports/espressif/esp-idf-config/sdkconfig-esp32s3.defaults b/ports/espressif/esp-idf-config/sdkconfig-esp32s3.defaults index bfb867d923..ce0d9f8d62 100644 --- a/ports/espressif/esp-idf-config/sdkconfig-esp32s3.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig-esp32s3.defaults @@ -191,3 +191,31 @@ CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" # end of Deprecated options for backward compatibility + +# +# Camera configuration +# +CONFIG_OV7670_SUPPORT=y +# CONFIG_OV7725_SUPPORT is not set +# CONFIG_NT99141_SUPPORT is not set +CONFIG_OV2640_SUPPORT=y +CONFIG_OV3660_SUPPORT=y +CONFIG_OV5640_SUPPORT=y +# CONFIG_GC2145_SUPPORT is not set +# CONFIG_GC032A_SUPPORT is not set +# CONFIG_GC0308_SUPPORT is not set +# CONFIG_BF3005_SUPPORT is not set +# CONFIG_BF20A6_SUPPORT is not set +# CONFIG_SC101IOT_SUPPORT is not set +# CONFIG_SC030IOT_SUPPORT is not set +# CONFIG_SCCB_HARDWARE_I2C_PORT0 is not set +CONFIG_SCCB_HARDWARE_I2C_PORT1=y +CONFIG_SCCB_CLK_FREQ=100000 +CONFIG_CAMERA_CORE0=y +# CONFIG_CAMERA_CORE1 is not set +# CONFIG_CAMERA_NO_AFFINITY is not set +CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX=32768 +# CONFIG_CAMERA_CONVERTER_ENABLED is not set +# end of Camera configuration +# end of Component config + diff --git a/ports/espressif/esp-idf-config/sdkconfig.defaults b/ports/espressif/esp-idf-config/sdkconfig.defaults index 5fb49faa82..21ac590698 100644 --- a/ports/espressif/esp-idf-config/sdkconfig.defaults +++ b/ports/espressif/esp-idf-config/sdkconfig.defaults @@ -294,7 +294,7 @@ CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=16384 CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 @@ -805,9 +805,9 @@ CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y CONFIG_LOG_BOOTLOADER_LEVEL=3 # CONFIG_APP_ROLLBACK_ENABLE is not set # CONFIG_FLASH_ENCRYPTION_ENABLED is not set -# CONFIG_FLASHMODE_QIO is not set +CONFIG_FLASHMODE_QIO=y # CONFIG_FLASHMODE_QOUT is not set -CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DIO is not set # CONFIG_FLASHMODE_DOUT is not set # CONFIG_MONITOR_BAUD_9600B is not set # CONFIG_MONITOR_BAUD_57600B is not set diff --git a/ports/espressif/esp32-camera b/ports/espressif/esp32-camera new file mode 160000 index 0000000000..54c3f61c86 --- /dev/null +++ b/ports/espressif/esp32-camera @@ -0,0 +1 @@ +Subproject commit 54c3f61c864c3d3ffd779042454554045b9dd9d2 diff --git a/ports/espressif/fatfs_port.c b/ports/espressif/fatfs_port.c index 631f7f0982..38c2d923b8 100644 --- a/ports/espressif/fatfs_port.c +++ b/ports/espressif/fatfs_port.c @@ -26,8 +26,26 @@ #include "py/runtime.h" #include "lib/oofatfs/ff.h" +#include "shared/timeutils/timeutils.h" +#include "shared-bindings/rtc/RTC.h" +#include "shared-bindings/time/__init__.h" +#include "supervisor/fatfs_port.h" +DWORD _time_override = 0; DWORD get_fattime(void) { - // TODO: Implement this function. For now, fake it. - return ((2016 - 1980) << 25) | ((12) << 21) | ((4) << 16) | ((00) << 11) | ((18) << 5) | (23 / 2); + if (_time_override > 0) { + return _time_override; + } + #if CIRCUITPY_RTC + timeutils_struct_time_t tm; + common_hal_rtc_get_time(&tm); + return ((tm.tm_year - 1980) << 25) | (tm.tm_mon << 21) | (tm.tm_mday << 16) | + (tm.tm_hour << 11) | (tm.tm_min << 5) | (tm.tm_sec >> 1); + #else + return ((2016 - 1980) << 25) | ((9) << 21) | ((1) << 16) | ((16) << 11) | ((43) << 5) | (35 / 2); + #endif +} + +void override_fattime(DWORD time) { + _time_override = time; } diff --git a/ports/espressif/mpconfigport.h b/ports/espressif/mpconfigport.h index f390112387..632a7a13cd 100644 --- a/ports/espressif/mpconfigport.h +++ b/ports/espressif/mpconfigport.h @@ -53,11 +53,13 @@ // Nearly all boards have this because it is used to enter the ROM bootloader. #ifndef CIRCUITPY_BOOT_BUTTON -#ifdef CONFIG_IDF_TARGET_ESP32C3 -#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) -#else -#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) -#endif + #ifdef CONFIG_IDF_TARGET_ESP32C3 + #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9) + #else + #ifndef CONFIG_IDF_TARGET_ESP32 + #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + #endif + #endif #endif #define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x9000) @@ -88,4 +90,13 @@ #define CIRCUITPY_ESP_USB_SERIAL_JTAG (0) #endif +#ifndef DEFAULT_RESERVED_PSRAM +#define DEFAULT_RESERVED_PSRAM (0) +#endif + +#if defined(CONFIG_SPIRAM) +#undef CIRCUITPY_PORT_NUM_SUPERVISOR_ALLOCATIONS +#define CIRCUITPY_PORT_NUM_SUPERVISOR_ALLOCATIONS (1) +#endif + #endif // MICROPY_INCLUDED_ESPRESSIF_MPCONFIGPORT_H diff --git a/ports/espressif/mpconfigport.mk b/ports/espressif/mpconfigport.mk index 2eeb86e49d..c2949ccbab 100644 --- a/ports/espressif/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -19,8 +19,9 @@ CIRCUITPY_COUNTIO ?= 1 CIRCUITPY_DUALBANK ?= 1 CIRCUITPY_FRAMEBUFFERIO ?= 1 CIRCUITPY_FREQUENCYIO ?= 1 -CIRCUITPY_IMAGECAPTURE ?= 1 -CIRCUITPY_I2CPERIPHERAL ?= 1 +CIRCUITPY_HASHLIB ?= 1 +CIRCUITPY_IMAGECAPTURE ?= 0 +CIRCUITPY_I2CTARGET ?= 1 CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_ROTARYIO ?= 1 CIRCUITPY_NVM ?= 1 @@ -31,9 +32,17 @@ CIRCUITPY_WATCHDOG ?= 1 CIRCUITPY_ESPIDF ?= 1 -CIRCUITPY_MODULE ?= none +ifeq ($(IDF_TARGET),esp32) +CIRCUITPY_BLEIO = 0 +CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_PARALLELDISPLAY = 0 +# Protomatter needs to support ESP32. +CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_USB = 0 +CIRCUITPY_BUILD_EXTENSIONS ?= bin +CIRCUITPY_ESP32_CAMERA ?= 1 -ifeq ($(IDF_TARGET),esp32c3) +else ifeq ($(IDF_TARGET),esp32c3) CIRCUITPY_AESIO = 0 CIRCUITPY_ALARM = 0 CIRCUITPY_AUDIOBUSIO = 0 @@ -42,22 +51,27 @@ CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_DUALBANK = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_IMAGECAPTURE = 0 CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_TOUCHIO ?= 1 CIRCUITPY_TOUCHIO_USE_NATIVE = 0 CIRCUITPY_USB = 0 +CIRCUITPY_BUILD_EXTENSIONS ?= bin + else ifeq ($(IDF_TARGET),esp32s3) CIRCUITPY_BLEIO = 1 CIRCUITPY_BLEIO_HCI = 0 -CIRCUITPY_IMAGECAPTURE = 0 CIRCUITPY_PARALLELDISPLAY = 0 +CIRCUITPY_BUILD_EXTENSIONS ?= bin,uf2 +CIRCUITPY_ESP32_CAMERA ?= 1 + else ifeq ($(IDF_TARGET),esp32s2) # No BLE on S2 CIRCUITPY_BLEIO = 0 CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_BUILD_EXTENSIONS ?= bin,uf2 +CIRCUITPY_ESP32_CAMERA ?= 1 endif # From ESP32-S2/S3 Technical Reference Manual: @@ -71,3 +85,7 @@ endif # only if something else is turned off, such as HID. USB_NUM_ENDPOINT_PAIRS = 7 USB_NUM_IN_ENDPOINTS = 5 + +CIRCUITPY_ESP32_CAMERA ?= 0 +CIRCUITPY_GIFIO ?= $(CIRCUITPY_ESP32_CAMERA) +CIRCUITPY_QRIO ?= $(CIRCUITPY_ESP32_CAMERA) diff --git a/ports/espressif/mphalport.c b/ports/espressif/mphalport.c index 39b080fba3..76d2c05cc3 100644 --- a/ports/espressif/mphalport.c +++ b/ports/espressif/mphalport.c @@ -28,7 +28,9 @@ #include "py/mphal.h" #include "supervisor/cpu.h" -#ifdef CONFIG_IDF_TARGET_ESP32C3 +#if defined(CONFIG_IDF_TARGET_ESP32) +#include "components/esp_rom/include/esp32/rom/ets_sys.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C3) #include "components/esp_rom/include/esp32c3/rom/ets_sys.h" #elif defined(CONFIG_IDF_TARGET_ESP32S2) #include "components/esp_rom/include/esp32s2/rom/ets_sys.h" diff --git a/ports/espressif/peripherals/esp32/pins.c b/ports/espressif/peripherals/esp32/pins.c new file mode 100644 index 0000000000..9bf00a0e56 --- /dev/null +++ b/ports/espressif/peripherals/esp32/pins.c @@ -0,0 +1,69 @@ +/* + * This file is part of the Micro Python 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 "peripherals/pins.h" + +const mcu_pin_obj_t pin_GPIO0 = PIN(0, ADC_UNIT_2, ADC_CHANNEL_1, TOUCH_PAD_NUM1); +const mcu_pin_obj_t pin_GPIO1 = PIN(1, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO2 = PIN(2, ADC_UNIT_2, ADC_CHANNEL_2, TOUCH_PAD_NUM2); +const mcu_pin_obj_t pin_GPIO3 = PIN(3, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO4 = PIN(4, ADC_UNIT_2, ADC_CHANNEL_0, TOUCH_PAD_NUM0); +const mcu_pin_obj_t pin_GPIO5 = PIN(5, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO6 = PIN(6, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO7 = PIN(7, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO8 = PIN(8, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO9 = PIN(9, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO10 = PIN(10, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO11 = PIN(11, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO12 = PIN(12, ADC_UNIT_2, ADC_CHANNEL_5, TOUCH_PAD_NUM5); +const mcu_pin_obj_t pin_GPIO13 = PIN(13, ADC_UNIT_2, ADC_CHANNEL_4, TOUCH_PAD_NUM4); +const mcu_pin_obj_t pin_GPIO14 = PIN(14, ADC_UNIT_2, ADC_CHANNEL_6, TOUCH_PAD_NUM6); +const mcu_pin_obj_t pin_GPIO15 = PIN(15, ADC_UNIT_2, ADC_CHANNEL_3, TOUCH_PAD_NUM3); +const mcu_pin_obj_t pin_GPIO16 = PIN(16, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO17 = PIN(17, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO18 = PIN(18, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO19 = PIN(19, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +// GPIO20 not exposed on some packages, but available in some modules +const mcu_pin_obj_t pin_GPIO20 = PIN(20, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO21 = PIN(21, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO22 = PIN(22, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO23 = PIN(23, NO_ADC, NO_ADC_CHANNEL, NO_TOUCH_CHANNEL); +// no GPIO24 +const mcu_pin_obj_t pin_GPIO25 = PIN(25, ADC_UNIT_2, ADC_CHANNEL_8, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO26 = PIN(26, ADC_UNIT_2, ADC_CHANNEL_9, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO27 = PIN(27, ADC_UNIT_2, ADC_CHANNEL_7, TOUCH_PAD_NUM7); +// no GPIO28 +// no GPIO29 +// no GPIO30 +// no GPIO31 +const mcu_pin_obj_t pin_GPIO32 = PIN(32, ADC_UNIT_1, ADC_CHANNEL_1, TOUCH_PAD_NUM9); +const mcu_pin_obj_t pin_GPIO33 = PIN(33, ADC_UNIT_1, ADC_CHANNEL_5, TOUCH_PAD_NUM8); +const mcu_pin_obj_t pin_GPIO34 = PIN(34, ADC_UNIT_1, ADC_CHANNEL_6, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO35 = PIN(35, ADC_UNIT_1, ADC_CHANNEL_7, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO36 = PIN(36, ADC_UNIT_1, ADC_CHANNEL_0, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO37 = PIN(37, ADC_UNIT_1, ADC_CHANNEL_1, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO38 = PIN(38, ADC_UNIT_1, ADC_CHANNEL_2, NO_TOUCH_CHANNEL); +const mcu_pin_obj_t pin_GPIO39 = PIN(39, ADC_UNIT_1, ADC_CHANNEL_3, NO_TOUCH_CHANNEL); diff --git a/ports/espressif/peripherals/esp32/pins.h b/ports/espressif/peripherals/esp32/pins.h new file mode 100644 index 0000000000..6ec7c624a0 --- /dev/null +++ b/ports/espressif/peripherals/esp32/pins.h @@ -0,0 +1,111 @@ +/* + * This file is part of the Micro Python 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. + */ + +// DO NOT include this file directly. +// Use shared-bindings/microcontroller/Pin.h instead. +// This ensures that all necessary includes are already included. + +#ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32_PINS_H +#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32_PINS_H + +#define GPIO0_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO0; +#define GPIO1_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO1; +#define GPIO2_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO2; +#define GPIO3_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO3; +#define GPIO4_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO4; +#define GPIO5_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO5; +#define GPIO6_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO6; +#define GPIO7_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO7; +#define GPIO8_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO8; +#define GPIO9_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO9; +#define GPIO10_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO10; +#define GPIO11_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO11; +#define GPIO12_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO12; +#define GPIO13_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO13; +#define GPIO14_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO14; +#define GPIO15_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO15; +#define GPIO16_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO16; +#define GPIO17_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO17; +#define GPIO18_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO18; +#define GPIO19_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO19; +// GPIO20 not exposed on some packages, but available in some modules +#define GPIO20_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO20; +#define GPIO21_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO21; +#define GPIO22_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO22; +#define GPIO23_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO23; +// no GPIO24 +#define GPIO25_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO25; +#define GPIO26_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO26; +#define GPIO27_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO27; +// no GPIO28 +// no GPIO29 +// no GPIO30 +// no GPIO31 +#define GPIO32_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO32; +#define GPIO33_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO33; +#define GPIO34_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO34; +#define GPIO35_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO35; +#define GPIO36_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO36; +#define GPIO37_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO37; +#define GPIO38_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO38; +#define GPIO39_EXISTS 1 +extern const mcu_pin_obj_t pin_GPIO39; + +#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32_PINS_H diff --git a/ports/espressif/peripherals/esp32c3/pins.h b/ports/espressif/peripherals/esp32c3/pins.h index 3cce2763c6..9f55768825 100644 --- a/ports/espressif/peripherals/esp32c3/pins.h +++ b/ports/espressif/peripherals/esp32c3/pins.h @@ -31,27 +31,49 @@ #ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32C3_PINS_H #define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32C3_PINS_H +#define GPIO0_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO0; +#define GPIO1_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO1; +#define GPIO2_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO2; +#define GPIO3_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO3; +#define GPIO4_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO4; +#define GPIO5_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO5; +#define GPIO6_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO6; +#define GPIO7_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO7; +#define GPIO8_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO8; +#define GPIO9_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO9; +#define GPIO10_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO10; +#define GPIO11_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO11; +#define GPIO12_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO12; +#define GPIO13_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO13; +#define GPIO14_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO14; +#define GPIO15_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO15; +#define GPIO16_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO16; +#define GPIO17_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO17; +#define GPIO18_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO18; +#define GPIO19_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO19; +#define GPIO20_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO20; +#define GPIO21_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO21; #endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32C3_PINS_H diff --git a/ports/espressif/peripherals/esp32s2/pins.h b/ports/espressif/peripherals/esp32s2/pins.h index b66db79861..cff6fea7cb 100644 --- a/ports/espressif/peripherals/esp32s2/pins.h +++ b/ports/espressif/peripherals/esp32s2/pins.h @@ -31,48 +31,91 @@ #ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S2_PINS_H #define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S2_PINS_H +#define GPIO0_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO0; +#define GPIO1_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO1; +#define GPIO2_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO2; +#define GPIO3_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO3; +#define GPIO4_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO4; +#define GPIO5_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO5; +#define GPIO6_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO6; +#define GPIO7_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO7; +#define GPIO8_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO8; +#define GPIO9_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO9; +#define GPIO10_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO10; +#define GPIO11_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO11; +#define GPIO12_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO12; +#define GPIO13_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO13; +#define GPIO14_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO14; +#define GPIO15_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO15; +#define GPIO16_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO16; +#define GPIO17_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO17; +#define GPIO18_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO18; +#define GPIO19_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO19; +#define GPIO20_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO20; +#define GPIO21_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO21; +#define GPIO26_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO26; +#define GPIO27_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO27; +#define GPIO28_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO28; +#define GPIO29_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO29; +#define GPIO30_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO30; +#define GPIO31_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO31; +#define GPIO32_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO32; +#define GPIO33_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO33; +#define GPIO34_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO34; +#define GPIO35_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO35; +#define GPIO36_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO36; +#define GPIO37_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO37; +#define GPIO38_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO38; +#define GPIO39_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO39; +#define GPIO40_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO40; +#define GPIO41_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO41; +#define GPIO42_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO42; +#define GPIO43_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO43; +#define GPIO44_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO44; +#define GPIO45_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO45; +#define GPIO46_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO46; #endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S2_PINS_H diff --git a/ports/espressif/peripherals/esp32s3/pins.h b/ports/espressif/peripherals/esp32s3/pins.h index c2a932f572..7c0b8edd64 100644 --- a/ports/espressif/peripherals/esp32s3/pins.h +++ b/ports/espressif/peripherals/esp32s3/pins.h @@ -31,50 +31,95 @@ #ifndef MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S3_PINS_H #define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S3_PINS_H +#define GPIO0_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO0; +#define GPIO1_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO1; +#define GPIO2_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO2; +#define GPIO3_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO3; +#define GPIO4_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO4; +#define GPIO5_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO5; +#define GPIO6_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO6; +#define GPIO7_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO7; +#define GPIO8_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO8; +#define GPIO9_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO9; +#define GPIO10_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO10; +#define GPIO11_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO11; +#define GPIO12_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO12; +#define GPIO13_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO13; +#define GPIO14_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO14; +#define GPIO15_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO15; +#define GPIO16_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO16; +#define GPIO17_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO17; +#define GPIO18_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO18; +#define GPIO19_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO19; +#define GPIO20_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO20; +#define GPIO21_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO21; +#define GPIO26_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO26; +#define GPIO27_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO27; +#define GPIO28_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO28; +#define GPIO29_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO29; +#define GPIO30_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO30; +#define GPIO31_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO31; +#define GPIO32_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO32; +#define GPIO33_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO33; +#define GPIO34_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO34; +#define GPIO35_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO35; +#define GPIO36_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO36; +#define GPIO37_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO37; +#define GPIO38_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO38; +#define GPIO39_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO39; +#define GPIO40_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO40; +#define GPIO41_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO41; +#define GPIO42_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO42; +#define GPIO43_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO43; +#define GPIO44_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO44; +#define GPIO45_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO45; +#define GPIO46_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO46; +#define GPIO47_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO47; +#define GPIO48_EXISTS 1 extern const mcu_pin_obj_t pin_GPIO48; #endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_ESP32S3_PINS_H diff --git a/ports/espressif/peripherals/pcnt.c b/ports/espressif/peripherals/pcnt.c index e4578a2791..fa8a3e05d1 100644 --- a/ports/espressif/peripherals/pcnt.c +++ b/ports/espressif/peripherals/pcnt.c @@ -29,37 +29,50 @@ #define PCNT_UNIT_ACTIVE 1 #define PCNT_UNIT_INACTIVE 0 -static uint8_t pcnt_unit_state[4]; +static uint8_t pcnt_unit_state[PCNT_UNIT_MAX]; void peripherals_pcnt_reset(void) { - for (uint8_t i = 0; i <= 3; i++) { + for (uint8_t i = 0; i < PCNT_UNIT_MAX; i++) { pcnt_unit_state[i] = PCNT_UNIT_INACTIVE; } } -int peripherals_pcnt_init(pcnt_config_t pcnt_config) { +static int peripherals_pcnt_get_unit(pcnt_config_t *pcnt_config) { // Look for available pcnt unit - for (uint8_t i = 0; i <= 3; i++) { + for (uint8_t i = 0; i < PCNT_UNIT_MAX; i++) { if (pcnt_unit_state[i] == PCNT_UNIT_INACTIVE) { - pcnt_config.unit = (pcnt_unit_t)i; + pcnt_config->unit = (pcnt_unit_t)i; pcnt_unit_state[i] = PCNT_UNIT_ACTIVE; - break; - } else if (i == 3) { - return -1; + return i; } } + return -1; +} + +void peripherals_pcnt_reinit(pcnt_config_t *pcnt_config) { + // Reinitialize a pcnt unit that has already been allocated. + // Initialize PCNT unit - pcnt_unit_config(&pcnt_config); + pcnt_unit_config(pcnt_config); // Initialize PCNT's counter - pcnt_counter_pause(pcnt_config.unit); - pcnt_counter_clear(pcnt_config.unit); + pcnt_counter_pause(pcnt_config->unit); + pcnt_counter_clear(pcnt_config->unit); // Everything is set up, now go to counting - pcnt_counter_resume(pcnt_config.unit); + pcnt_counter_resume(pcnt_config->unit); +} - return pcnt_config.unit; +int peripherals_pcnt_init(pcnt_config_t *pcnt_config) { + const int8_t unit = peripherals_pcnt_get_unit(pcnt_config); + if (unit == -1) { + return -1; + } + + peripherals_pcnt_reinit(pcnt_config); + + return pcnt_config->unit; } void peripherals_pcnt_deinit(pcnt_unit_t *unit) { diff --git a/ports/espressif/peripherals/pcnt.h b/ports/espressif/peripherals/pcnt.h index b2bae7b371..d34d971601 100644 --- a/ports/espressif/peripherals/pcnt.h +++ b/ports/espressif/peripherals/pcnt.h @@ -30,7 +30,8 @@ #include "driver/pcnt.h" #include "soc/pcnt_struct.h" -extern int peripherals_pcnt_init(pcnt_config_t pcnt_config); +extern int peripherals_pcnt_init(pcnt_config_t *pcnt_config); +extern void peripherals_pcnt_reinit(pcnt_config_t *pcnt_config); extern void peripherals_pcnt_deinit(pcnt_unit_t *unit); extern void peripherals_pcnt_reset(void); diff --git a/ports/espressif/peripherals/pins.h b/ports/espressif/peripherals/pins.h index 4958c46410..9edad560c8 100644 --- a/ports/espressif/peripherals/pins.h +++ b/ports/espressif/peripherals/pins.h @@ -65,7 +65,9 @@ extern const mp_obj_type_t mcu_pin_type; } // Choose based on chip -#ifdef CONFIG_IDF_TARGET_ESP32C3 +#if defined(CONFIG_IDF_TARGET_ESP32) +#include "esp32/pins.h" +#elif defined(CONFIG_IDF_TARGET_ESP32C3) #include "esp32c3/pins.h" #elif defined(CONFIG_IDF_TARGET_ESP32S2) #include "esp32s2/pins.h" diff --git a/ports/espressif/peripherals/touch.c b/ports/espressif/peripherals/touch.c index eeba49c683..9cf718b501 100644 --- a/ports/espressif/peripherals/touch.c +++ b/ports/espressif/peripherals/touch.c @@ -43,14 +43,36 @@ void peripherals_touch_never_reset(const bool enable) { void peripherals_touch_init(const touch_pad_t touchpad) { if (!touch_inited) { touch_pad_init(); - touch_pad_set_fsm_mode(TOUCH_FSM_MODE_TIMER); + touch_pad_set_fsm_mode(TOUCH_FSM_MODE_SW); } // touch_pad_config() must be done before touch_pad_fsm_start() the first time. // Otherwise the calibration is wrong and we get maximum raw values if there is // a trace of any significant length on the pin. + #if defined(CONFIG_IDF_TARGET_ESP32) + touch_pad_config(touchpad, 0); + #else touch_pad_config(touchpad); - if (!touch_inited) { - touch_pad_fsm_start(); - touch_inited = true; - } + touch_pad_fsm_start(); + #endif + touch_inited = true; +} + +uint16_t peripherals_touch_read(touch_pad_t touchpad) { + #if defined(CONFIG_IDF_TARGET_ESP32) + uint16_t touch_value; + touch_pad_read(touchpad, &touch_value); + // ESP32 touch_pad_read() returns a lower value when a pin is touched instead of a higher value. + // Flip the values around to be consistent with TouchIn assumptions. + return UINT16_MAX - touch_value; + #else + uint32_t touch_value; + touch_pad_sw_start(); + while (!touch_pad_meas_is_done()) { + } + touch_pad_read_raw_data(touchpad, &touch_value); + if (touch_value > UINT16_MAX) { + return UINT16_MAX; + } + return (uint16_t)touch_value; + #endif } diff --git a/ports/espressif/peripherals/touch.h b/ports/espressif/peripherals/touch.h index c7cd1f6be1..5feba4410a 100644 --- a/ports/espressif/peripherals/touch.h +++ b/ports/espressif/peripherals/touch.h @@ -29,6 +29,7 @@ #include "driver/touch_pad.h" +extern uint16_t peripherals_touch_read(touch_pad_t touchpad); extern void peripherals_touch_reset(void); extern void peripherals_touch_never_reset(const bool enable); extern void peripherals_touch_init(const touch_pad_t touchpad); diff --git a/ports/espressif/supervisor/port.c b/ports/espressif/supervisor/port.c index 11709eda40..3106f4b991 100644 --- a/ports/espressif/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -29,13 +29,13 @@ #include #include "supervisor/board.h" #include "supervisor/port.h" -#include "modules/module.h" +#include "supervisor/filesystem.h" #include "py/runtime.h" -#include "supervisor/esp_port.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" +#include "bindings/espidf/__init__.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/analogio/AnalogOut.h" #include "common-hal/busio/I2C.h" @@ -54,6 +54,8 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/RunMode.h" #include "shared-bindings/rtc/__init__.h" +#include "shared-bindings/socketpool/__init__.h" +#include "shared-module/dotenv/__init__.h" #include "peripherals/rmt.h" #include "peripherals/timer.h" @@ -74,32 +76,30 @@ #include "shared-bindings/_bleio/__init__.h" #endif -#if CIRCUITPY_IMAGECAPTURE -#include "cam.h" +#if CIRCUITPY_ESP32_CAMERA +#include "esp_camera.h" #endif +#ifndef CONFIG_IDF_TARGET_ESP32 #include "soc/cache_memory.h" +#endif + +#include "soc/efuse_reg.h" #include "soc/rtc_cntl_reg.h" #include "esp_debug_helpers.h" +#include "bootloader_flash_config.h" +#include "esp_efuse.h" #include "esp_ipc.h" +#include "esp_rom_efuse.h" -#ifdef CONFIG_SPIRAM -#include "esp32/spiram.h" +#ifdef CONFIG_IDF_TARGET_ESP32 +#include "esp32/rom/efuse.h" #endif -// Heap sizes for when there is no external RAM for CircuitPython to use -// exclusively. -#ifdef CONFIG_IDF_TARGET_ESP32S2 -#define HEAP_SIZE (48 * 1024) -#endif -#ifdef CONFIG_IDF_TARGET_ESP32S3 -#define HEAP_SIZE (176 * 1024) -#endif -#ifdef CONFIG_IDF_TARGET_ESP32C3 -#define HEAP_SIZE (88 * 1024) -#endif +#include "esp_log.h" +#define TAG "port" uint32_t *heap; uint32_t heap_size; @@ -133,6 +133,97 @@ STATIC void tick_timer_cb(void *arg) { void sleep_timer_cb(void *arg); +// The ESP-IDF determines these pins at runtime so we do too. This code is based on: +// https://github.com/espressif/esp-idf/blob/6d85d53ceec30c818a92c2fff8f5437d21c4720f/components/esp_hw_support/port/esp32/spiram_psram.c#L810 +// IO-pins for PSRAM. +// WARNING: PSRAM shares all but the CS and CLK pins with the flash, so these defines +// hardcode the flash pins as well, making this code incompatible with either a setup +// that has the flash on non-standard pins or ESP32s with built-in flash. +#define PSRAM_SPIQ_SD0_IO 7 +#define PSRAM_SPID_SD1_IO 8 +#define PSRAM_SPIWP_SD3_IO 10 +#define PSRAM_SPIHD_SD2_IO 9 + +#define FLASH_HSPI_CLK_IO 14 +#define FLASH_HSPI_CS_IO 15 +#define PSRAM_HSPI_SPIQ_SD0_IO 12 +#define PSRAM_HSPI_SPID_SD1_IO 13 +#define PSRAM_HSPI_SPIWP_SD3_IO 2 +#define PSRAM_HSPI_SPIHD_SD2_IO 4 + +#ifdef CONFIG_SPIRAM +// PSRAM clock and cs IO should be configured based on hardware design. +// For ESP32-WROVER or ESP32-WROVER-B module, the clock IO is IO17, the cs IO is IO16, +// they are the default value for these two configs. +#define D0WD_PSRAM_CLK_IO CONFIG_D0WD_PSRAM_CLK_IO // Default value is 17 +#define D0WD_PSRAM_CS_IO CONFIG_D0WD_PSRAM_CS_IO // Default value is 16 + +#define D2WD_PSRAM_CLK_IO CONFIG_D2WD_PSRAM_CLK_IO // Default value is 9 +#define D2WD_PSRAM_CS_IO CONFIG_D2WD_PSRAM_CS_IO // Default value is 10 + +// There is no reason to change the pin of an embedded psram. +// So define the number of pin directly, instead of configurable. +#define D0WDR2_V3_PSRAM_CLK_IO 6 +#define D0WDR2_V3_PSRAM_CS_IO 16 + +// For ESP32-PICO chip, the psram share clock with flash. The flash clock pin is fixed, which is IO6. +#define PICO_PSRAM_CLK_IO 6 +#define PICO_PSRAM_CS_IO CONFIG_PICO_PSRAM_CS_IO // Default value is 10 + +#define PICO_V3_02_PSRAM_CLK_IO 10 +#define PICO_V3_02_PSRAM_CS_IO 9 +#endif // CONFIG_SPIRAM + +static void _never_reset_spi_ram_flash(void) { + #if defined(CONFIG_IDF_TARGET_ESP32) + #if defined(CONFIG_SPIRAM) + uint32_t pkg_ver = esp_efuse_get_pkg_ver(); + if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5) { + never_reset_pin_number(D2WD_PSRAM_CLK_IO); + never_reset_pin_number(D2WD_PSRAM_CS_IO); + } else if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4 && esp_efuse_get_chip_ver() >= 3) { + // This chip is ESP32-PICO-V3 and doesn't have PSRAM. + } else if ((pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2) || (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4)) { + never_reset_pin_number(PICO_PSRAM_CLK_IO); + never_reset_pin_number(PICO_PSRAM_CS_IO); + } else if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302) { + never_reset_pin_number(PICO_V3_02_PSRAM_CLK_IO); + never_reset_pin_number(PICO_V3_02_PSRAM_CS_IO); + } else if ((pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ6) || (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D0WDQ5)) { + never_reset_pin_number(D0WD_PSRAM_CLK_IO); + never_reset_pin_number(D0WD_PSRAM_CS_IO); + } else if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D0WDR2V3) { + never_reset_pin_number(D0WDR2_V3_PSRAM_CLK_IO); + never_reset_pin_number(D0WDR2_V3_PSRAM_CS_IO); + } + #endif // CONFIG_SPIRAM + + const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info(); + if (spiconfig == ESP_ROM_EFUSE_FLASH_DEFAULT_SPI) { + never_reset_pin_number(SPI_IOMUX_PIN_NUM_CLK); + never_reset_pin_number(SPI_IOMUX_PIN_NUM_CS); + never_reset_pin_number(PSRAM_SPIQ_SD0_IO); + never_reset_pin_number(PSRAM_SPID_SD1_IO); + never_reset_pin_number(PSRAM_SPIWP_SD3_IO); + never_reset_pin_number(PSRAM_SPIHD_SD2_IO); + } else if (spiconfig == ESP_ROM_EFUSE_FLASH_DEFAULT_HSPI) { + never_reset_pin_number(FLASH_HSPI_CLK_IO); + never_reset_pin_number(FLASH_HSPI_CS_IO); + never_reset_pin_number(PSRAM_HSPI_SPIQ_SD0_IO); + never_reset_pin_number(PSRAM_HSPI_SPID_SD1_IO); + never_reset_pin_number(PSRAM_HSPI_SPIWP_SD3_IO); + never_reset_pin_number(PSRAM_HSPI_SPIHD_SD2_IO); + } else { + never_reset_pin_number(EFUSE_SPICONFIG_RET_SPICLK(spiconfig)); + never_reset_pin_number(EFUSE_SPICONFIG_RET_SPICS0(spiconfig)); + never_reset_pin_number(EFUSE_SPICONFIG_RET_SPIQ(spiconfig)); + never_reset_pin_number(EFUSE_SPICONFIG_RET_SPID(spiconfig)); + never_reset_pin_number(EFUSE_SPICONFIG_RET_SPIHD(spiconfig)); + never_reset_pin_number(bootloader_flash_get_wp_pin()); + } + #endif // CONFIG_IDF_TARGET_ESP32 +} + safe_mode_t port_init(void) { esp_timer_create_args_t args; args.callback = &tick_timer_cb; @@ -155,12 +246,22 @@ safe_mode_t port_init(void) { #endif heap = NULL; - never_reset_module_internal_pins(); #ifndef DEBUG #define DEBUG (0) #endif + #define pin_GPIOn(n) pin_GPIO##n + #define pin_GPIOn_EXPAND(x) pin_GPIOn(x) + + #ifdef CONFIG_CONSOLE_UART_TX_GPIO + common_hal_never_reset_pin(&pin_GPIOn_EXPAND(CONFIG_CONSOLE_UART_TX_GPIO)); + #endif + + #ifdef CONFIG_CONSOLE_UART_RX_GPIO + common_hal_never_reset_pin(&pin_GPIOn_EXPAND(CONFIG_CONSOLE_UART_RX_GPIO)); + #endif + #if DEBUG // debug UART #ifdef CONFIG_IDF_TARGET_ESP32C3 @@ -192,18 +293,29 @@ safe_mode_t port_init(void) { #endif #ifdef CONFIG_SPIRAM - if (esp_spiram_is_initialized()) { - size_t spiram_size = esp_spiram_get_size(); - heap = (uint32_t *)(SOC_EXTRAM_DATA_HIGH - spiram_size); - heap_size = spiram_size / sizeof(uint32_t); + { + intptr_t heap_start = common_hal_espidf_get_psram_start(); + intptr_t heap_end = common_hal_espidf_get_psram_end(); + size_t spiram_size = heap_end - heap_start; + if (spiram_size > 0) { + heap = (uint32_t *)heap_start; + heap_size = (heap_end - heap_start) / sizeof(uint32_t); + } else { + ESP_LOGE(TAG, "CONFIG_SPIRAM enabled but no spiram heap available"); + } } #endif + _never_reset_spi_ram_flash(); + if (heap == NULL) { - heap = malloc(HEAP_SIZE); - heap_size = HEAP_SIZE / sizeof(uint32_t); + size_t heap_total = heap_caps_get_total_size(MALLOC_CAP_8BIT); + heap_size = MIN(heap_caps_get_largest_free_block(MALLOC_CAP_8BIT), heap_total / 2); + heap = malloc(heap_size); + heap_size = heap_size / sizeof(uint32_t); } if (heap == NULL) { + heap_size = 0; return NO_HEAP; } @@ -214,6 +326,9 @@ safe_mode_t port_init(void) { case ESP_RST_PANIC: return HARD_CRASH; case ESP_RST_INT_WDT: + // The interrupt watchdog is used internally to make sure that latency sensitive + // interrupt code isn't blocked. User watchdog resets come through ESP_RST_WDT. + return WATCHDOG_RESET; case ESP_RST_WDT: default: break; @@ -223,15 +338,13 @@ safe_mode_t port_init(void) { } void reset_port(void) { - #if CIRCUITPY_IMAGECAPTURE - cam_deinit(); + // TODO deinit for esp32-camera + #if CIRCUITPY_ESP32_CAMERA + esp_camera_deinit(); #endif reset_all_pins(); - // A larger delay so the idle task can run and do any IDF cleanup needed. - vTaskDelay(4); - #if CIRCUITPY_ANALOGIO analogout_reset(); #endif @@ -275,6 +388,10 @@ void reset_port(void) { rtc_reset(); #endif + #if CIRCUITPY_SOCKETPOOL + socketpool_user_reset(); + #endif + #if CIRCUITPY_TOUCHIO_USE_NATIVE peripherals_touch_reset(); #endif @@ -283,17 +400,8 @@ void reset_port(void) { watchdog_reset(); #endif - #if CIRCUITPY_BLEIO - bleio_reset(); - #endif - - #if CIRCUITPY_WIFI - wifi_reset(); - #endif - - #if CIRCUITPY_SOCKETPOOL - socket_reset(); - #endif + // Yield so the idle task can run and do any IDF cleanup needed. + port_yield(); } void reset_to_bootloader(void) { @@ -376,6 +484,18 @@ void port_wake_main_task() { xTaskNotifyGive(circuitpython_task); } +void port_wake_main_task_from_isr() { + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + vTaskNotifyGiveFromISR(circuitpython_task, &xHigherPriorityTaskWoken); + if (xHigherPriorityTaskWoken == pdTRUE) { + portYIELD_FROM_ISR(); + } +} + +void port_yield() { + vTaskDelay(4); +} + void sleep_timer_cb(void *arg) { port_wake_main_task(); } @@ -396,6 +516,16 @@ void port_idle_until_interrupt(void) { } } +void port_post_boot_py(bool heap_valid) { + if (!heap_valid && filesystem_present()) { + mp_int_t reserved; + if (dotenv_get_key_int("/.env", "CIRCUITPY_RESERVED_PSRAM", &reserved)) { + common_hal_espidf_set_reserved_psram(reserved); + } + common_hal_espidf_reserve_psram(); + } +} + // Wrap main in app_main that the IDF expects. extern void main(void); extern void app_main(void); diff --git a/ports/espressif/supervisor/serial.c b/ports/espressif/supervisor/serial.c index 9a0ecee4df..7b0166f5b1 100644 --- a/ports/espressif/supervisor/serial.c +++ b/ports/espressif/supervisor/serial.c @@ -27,6 +27,10 @@ #include "py/mpconfig.h" #include "supervisor/serial.h" +#if CIRCUITPY_ESP_USB_SERIAL_JTAG && CIRCUITPY_CONSOLE_UART +#error CIRCUITPY_ESP_USB_SERIAL_JTAG and CIRCUITPY_CONSOLE_UART cannot both be enabled. +#endif + #if CIRCUITPY_ESP_USB_SERIAL_JTAG #include "supervisor/usb_serial_jtag.h" #endif @@ -37,14 +41,13 @@ void port_serial_init(void) { #endif } + bool port_serial_connected(void) { #if CIRCUITPY_ESP_USB_SERIAL_JTAG - if (usb_serial_jtag_connected()) { - return true; - } - #endif - + return usb_serial_jtag_connected(); + #else return false; + #endif } char port_serial_read(void) { @@ -58,12 +61,10 @@ char port_serial_read(void) { bool port_serial_bytes_available(void) { #if CIRCUITPY_ESP_USB_SERIAL_JTAG - if (usb_serial_jtag_bytes_available()) { - return true; - } - #endif - + return usb_serial_jtag_bytes_available(); + #else return false; + #endif } void port_serial_write_substring(const char *text, uint32_t length) { diff --git a/ports/espressif/supervisor/usb.c b/ports/espressif/supervisor/usb.c index a4f26b366c..61e6b5f09d 100644 --- a/ports/espressif/supervisor/usb.c +++ b/ports/espressif/supervisor/usb.c @@ -27,7 +27,6 @@ #include "py/runtime.h" #include "supervisor/usb.h" -#include "supervisor/esp_port.h" #include "supervisor/port.h" #include "shared/runtime/interrupt_char.h" #include "shared/readline/readline.h" diff --git a/ports/espressif/supervisor/usb_serial_jtag.c b/ports/espressif/supervisor/usb_serial_jtag.c index 064d7d668c..646d2c3a5e 100644 --- a/ports/espressif/supervisor/usb_serial_jtag.c +++ b/ports/espressif/supervisor/usb_serial_jtag.c @@ -28,19 +28,46 @@ #include "py/ringbuf.h" #include "py/runtime.h" #include "py/mphal.h" -#include "usb_serial_jtag.h" +#include "supervisor/port.h" +#include "supervisor/usb_serial_jtag.h" #include "hal/usb_serial_jtag_ll.h" #include "esp_intr_alloc.h" #include "soc/periph_defs.h" -#include "supervisor/esp_port.h" #define USB_SERIAL_JTAG_BUF_SIZE (64) STATIC ringbuf_t ringbuf; STATIC uint8_t buf[128]; -STATIC bool connected; +STATIC volatile bool connected; + +#if CIRCUITPY_ESP_USB_SERIAL_JTAG && !CONFIG_ESP_PHY_ENABLE_USB +#error "CONFIG_ESP_PHY_ENABLE_USB must be enabled in sdkconfig" +#endif + +// Make sure the recv interrupt is disabled during this. Otherwise, it could reorder data if it +// interrupts itself. +static void _copy_out_of_fifo(void) { + size_t req_len = ringbuf_num_empty(&ringbuf); + if (req_len == 0) { + // Disable the interrupt so that CircuitPython can run and process the ringbuf. It will + // re-enable the interrupt once the ringbuf is empty. + usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT); + } + if (req_len > USB_SERIAL_JTAG_BUF_SIZE) { + req_len = USB_SERIAL_JTAG_BUF_SIZE; + } + uint8_t rx_buf[USB_SERIAL_JTAG_BUF_SIZE]; + size_t len = usb_serial_jtag_ll_read_rxfifo(rx_buf, req_len); + for (size_t i = 0; i < len; ++i) { + if (rx_buf[i] == mp_interrupt_char) { + mp_sched_keyboard_interrupt(); + } else { + ringbuf_put(&ringbuf, rx_buf[i]); + } + } +} static void usb_serial_jtag_isr_handler(void *arg) { uint32_t flags = usb_serial_jtag_ll_get_intsts_mask(); @@ -49,40 +76,27 @@ static void usb_serial_jtag_isr_handler(void *arg) { usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SOF); } + if (flags & USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1) { + usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1); + connected = true; + } + if (flags & USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT) { usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT); - size_t req_len = ringbuf_num_empty(&ringbuf); - if (req_len > USB_SERIAL_JTAG_BUF_SIZE) { - req_len = USB_SERIAL_JTAG_BUF_SIZE; - } - uint8_t rx_buf[USB_SERIAL_JTAG_BUF_SIZE]; - size_t len = usb_serial_jtag_ll_read_rxfifo(rx_buf, req_len); - for (size_t i = 0; i < len; ++i) { - if (rx_buf[i] == mp_interrupt_char) { - mp_sched_keyboard_interrupt(); - } else { - ringbuf_put(&ringbuf, rx_buf[i]); - } - } - vTaskNotifyGiveFromISR(circuitpython_task, NULL); + _copy_out_of_fifo(); + port_wake_main_task_from_isr(); } } void usb_serial_jtag_init(void) { - ringbuf_init(&ringbuf, buf, sizeof(buf)); - usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SOF | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT); - usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SOF | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT); + ringbuf_init(&ringbuf, buf, sizeof(buf) - 1); + usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_INTR_SOF | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1); + usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SOF | USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT | USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1); ESP_ERROR_CHECK(esp_intr_alloc(ETS_USB_SERIAL_JTAG_INTR_SOURCE, ESP_INTR_FLAG_LEVEL1, usb_serial_jtag_isr_handler, NULL, NULL)); } bool usb_serial_jtag_connected(void) { - // Make connected sticky. Otherwise we'll be disconnected every time the SOF - // index is 0. (It's only ~15 bits so it wraps around frequently.) - if (connected) { - return true; - } - connected = USB_SERIAL_JTAG.fram_num.sof_frame_index > 0; return connected; } @@ -90,22 +104,38 @@ char usb_serial_jtag_read_char(void) { if (ringbuf_num_filled(&ringbuf) == 0) { return -1; } - return ringbuf_get(&ringbuf); + char c = ringbuf_get(&ringbuf); + // Maybe re-enable the recv interrupt if we've emptied the ringbuf. + if (ringbuf_num_filled(&ringbuf) == 0) { + usb_serial_jtag_ll_disable_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT); + _copy_out_of_fifo(); + usb_serial_jtag_ll_ena_intr_mask(USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT); + } + return c; } bool usb_serial_jtag_bytes_available(void) { - return ringbuf_num_filled(&ringbuf); + return ringbuf_num_filled(&ringbuf) > 0; } void usb_serial_jtag_write(const char *text, uint32_t length) { - if (USB_SERIAL_JTAG.fram_num.sof_frame_index > 0) { - size_t total_written = 0; - uint32_t start_time = supervisor_ticks_ms32(); - // Time out after 5 milliseconds in case usb isn't actually reading CDC. - while (total_written < length && start_time - supervisor_ticks_ms32() < 5) { - total_written += usb_serial_jtag_ll_write_txfifo((const uint8_t *)(text + total_written), length - total_written); - RUN_BACKGROUND_TASKS; - } - usb_serial_jtag_ll_txfifo_flush(); + if (!usb_serial_jtag_connected()) { + return; } + size_t total_written = 0; + while (total_written < length) { + uint32_t start_time = supervisor_ticks_ms32(); + // Wait until we can write to the FIFO again. If it takes too long, then + // assume we're disconnected. + while (!usb_serial_jtag_ll_txfifo_writable()) { + uint32_t now = supervisor_ticks_ms32(); + if (now - start_time > 200) { + connected = false; + return; + } + } + total_written += usb_serial_jtag_ll_write_txfifo((const uint8_t *)(text + total_written), length - total_written); + RUN_BACKGROUND_TASKS; + } + usb_serial_jtag_ll_txfifo_flush(); } diff --git a/ports/espressif/tools/build_memory_info.py b/ports/espressif/tools/build_memory_info.py index b26c007741..df9d6a801e 100644 --- a/ports/espressif/tools/build_memory_info.py +++ b/ports/espressif/tools/build_memory_info.py @@ -15,6 +15,15 @@ from elftools.elf.elffile import ELFFile print() internal_memory = { + "esp32": [ + # Name, Start, Length + ("RTC Fast Memory", (0x3FF8_0000, 0x400C_0000), 8 * 1024), + ("RTC Slow Memory", (0x5000_0000,), 8 * 1024), + # First 64kB of Internal SRAM 0 can be configured as cached, and starts at 0x4007_0000 + ("Internal SRAM 0", (0x4008_0000,), 128 * 1024), + ("Internal SRAM 1", (0x3FFE_0000, 0x400A_0000), 128 * 1024), + ("Internal SRAM 2", (0x3FFA_E000,), 200 * 1024), + ], "esp32s2": [ # Name, Start, Length ("RTC Fast Memory", (0x3FF9_E000, 0x4007_0000), 8 * 1024), @@ -73,9 +82,12 @@ with open(sys.argv[2], "r") as f: elif subtype == "ota_0": ota = partition[4].strip() size = app if ota is None else ota - if size[-1] not in ("k", "K"): - raise RuntimeError("Unhandled partition size suffix") - firmware_region = int(size[:-1]) * 1024 + if size[-1] in ("k", "K"): + firmware_region = int(size[:-1]) * 1024 + elif size[-1] in ("m", "M"): + firmware_region = int(size[:-1]) * 1024 * 1024 + else: + raise RuntimeError("Unhandled partition size suffix:", size[-1]) regions = dict((name, 0) for name, _, _ in internal_memory[target]) diff --git a/ports/espressif/tools/decode_backtrace.py b/ports/espressif/tools/decode_backtrace.py index 523677baea..38b2c12b66 100644 --- a/ports/espressif/tools/decode_backtrace.py +++ b/ports/espressif/tools/decode_backtrace.py @@ -18,7 +18,7 @@ while True: addresses = addresses[len("Backtrace:") :] addresses = addresses.strip().split() addresses = [address.split(":")[0] for address in addresses] - print("got", addresses) subprocess.run( - ["xtensa-esp32s2-elf-addr2line", "-e", "build-{}/firmware.elf".format(board)] + addresses + ["xtensa-esp32s2-elf-addr2line", "-aipfe", "build-{}/firmware.elf".format(board)] + + addresses ) diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 6fe9e46bec..6b1e33c8d1 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -81,8 +81,6 @@ ifeq ($(DEBUG), 1) else CFLAGS += -DNDEBUG -ggdb3 OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions - # TODO: Test with -flto - ### CFLAGS += -flto endif # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk @@ -99,7 +97,7 @@ LDFLAGS = $(CFLAGS) -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -W LIBS := -lgcc -lc -LDFLAGS += -flto -ffreestanding -nostartfiles -Wl,--gc-section -Wl,-Bstatic -Wl,-melf32lriscv -nostartfiles \ +LDFLAGS += -ffreestanding -nostartfiles -Wl,--gc-section -Wl,-Bstatic -Wl,-melf32lriscv -nostartfiles \ -Wl,--no-warn-mismatch \ -Wl,--build-id=none diff --git a/ports/litex/boards/fomu/board.c b/ports/litex/boards/fomu/board.c index e5bff42b1a..43fc74fd42 100644 --- a/ports/litex/boards/fomu/board.c +++ b/ports/litex/boards/fomu/board.c @@ -66,14 +66,3 @@ void board_init(void) { ledda_write(3, LEDDPWRG); // Green ledda_write(98, LEDDPWRB); // Blue } - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} diff --git a/ports/litex/common-hal/digitalio/DigitalInOut.c b/ports/litex/common-hal/digitalio/DigitalInOut.c index 96cc95dfa6..a48d698fcb 100644 --- a/ports/litex/common-hal/digitalio/DigitalInOut.c +++ b/ports/litex/common-hal/digitalio/DigitalInOut.c @@ -27,7 +27,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "csr.h" diff --git a/ports/litex/common-hal/microcontroller/Processor.c b/ports/litex/common-hal/microcontroller/Processor.c index ff2f041876..12c3787c79 100644 --- a/ports/litex/common-hal/microcontroller/Processor.c +++ b/ports/litex/common-hal/microcontroller/Processor.c @@ -31,7 +31,7 @@ #include "common-hal/microcontroller/Processor.h" #include "shared-bindings/microcontroller/Processor.h" #include "shared-bindings/microcontroller/ResetReason.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "csr.h" #include "generated/soc.h" diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk index 57f5113b69..d8dc4eef1e 100644 --- a/ports/litex/mpconfigport.mk +++ b/ports/litex/mpconfigport.mk @@ -18,7 +18,7 @@ CIRCUITPY_BUSIO = 0 CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PWMIO = 0 CIRCUITPY_PULSEIO = 0 @@ -29,3 +29,5 @@ CIRCUITPY_SDCARDIO = 0 # Enable USB support CIRCUITPY_USB_HID = 1 CIRCUITPY_USB_MIDI = 1 + +CIRCUITPY_BUILD_EXTENSIONS ?= dfu diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index 4a74b8fce5..4b05c91714 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -75,7 +75,7 @@ INC += \ # NDEBUG disables assert() statements. This reduces code size pretty dramatically, per tannewt. -CFLAGS += -Os -ftree-vrp -DNDEBUG -ffreestanding +CFLAGS += -ftree-vrp -DNDEBUG # TinyUSB defines CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_TUD_CDC_RX_BUFSIZE=512 -DCFG_TUD_MIDI_TX_BUFSIZE=512 -DCFG_TUD_CDC_TX_BUFSIZE=512 -DCFG_TUD_MSC_BUFSIZE=1024 @@ -84,12 +84,8 @@ CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_MIMXRT10XX -DCFG_TUD_MIDI_RX_BUFSIZE=512 -DCFG_ # Never set -fno-inline because we use inline to move small functions into routines that must be # in RAM. If inlining is disallowed, then we may end up calling a function in flash when we cannot. ifeq ($(DEBUG), 1) - # You may want to disable -flto if it interferes with debugging. - # CFLAGS += -flto -flto-partition=none # You may want to enable these flags to make setting breakpoints easier. CFLAGS += -fno-ipa-sra -else - #CFLAGS += -flto -flto-partition=none endif CFLAGS += $(INC) -ggdb -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) -Werror=missing-prototypes @@ -105,7 +101,6 @@ CFLAGS += \ -mfloat-abi=hard \ -mfpu=fpv5-sp-d16 \ -DCPU_$(CHIP_VARIANT) \ - -DDEBUG \ -DIMXRT10XX \ -g3 -Wno-unused-parameter \ -ffunction-sections -fdata-sections -fstack-usage diff --git a/ports/mimxrt10xx/boards/feather_m7_1011/board.c b/ports/mimxrt10xx/boards/feather_m7_1011/board.c index e6c41681ba..fa37b8ebfd 100644 --- a/ports/mimxrt10xx/boards/feather_m7_1011/board.c +++ b/ports/mimxrt10xx/boards/feather_m7_1011/board.c @@ -44,13 +44,3 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_SD_07); common_hal_never_reset_pin(&pin_GPIO_SD_06); } - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c b/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c index e6c41681ba..1514503834 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1011/board.c @@ -45,12 +45,4 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_SD_06); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c b/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c index 8cefabc937..df3d502d80 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1062/board.c @@ -44,12 +44,4 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c index eefbcc6deb..5a4cbcfc66 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/board.c @@ -47,12 +47,4 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_13); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c index 42ab6bbd8c..a9eea2d14e 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/board.c @@ -48,12 +48,4 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_AD_B1_12); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c index d85b615f0f..12e75738f8 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/board.c +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/board.c @@ -53,13 +53,3 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_AD_B0_01); common_hal_never_reset_pin(&pin_GPIO_AD_B0_03); } - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/mpconfigboard.h b/ports/mimxrt10xx/boards/imxrt1060_evk/mpconfigboard.h index 8e026fa7ce..3b63172328 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/mpconfigboard.h +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/mpconfigboard.h @@ -16,9 +16,8 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B1_07) #define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B1_06) -#define CIRCUITPY_DEBUG_UART_TX (&pin_GPIO_AD_B0_12) -#define CIRCUITPY_DEBUG_UART_RX (&pin_GPIO_AD_B0_13) - +#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO_AD_B0_12) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO_AD_B0_13) // Put host on the first USB so that right angle OTG adapters can fit. This is // the right port when looking at the board. diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/board.c b/ports/mimxrt10xx/boards/metro_m7_1011/board.c index e6c41681ba..1514503834 100644 --- a/ports/mimxrt10xx/boards/metro_m7_1011/board.c +++ b/ports/mimxrt10xx/boards/metro_m7_1011/board.c @@ -45,12 +45,4 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_SD_06); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c new file mode 100644 index 0000000000..55cd826de2 --- /dev/null +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.c @@ -0,0 +1,56 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2019 Artur Pacholec + * + * 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 "boards/flash_config.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +void board_init(void) { + // FLEX flash + common_hal_never_reset_pin(&pin_GPIO_SD_B1_06); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_07); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_08); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_09); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_10); + common_hal_never_reset_pin(&pin_GPIO_SD_B1_11); + + // FLEX flash 2 + common_hal_never_reset_pin(&pin_GPIO_AD_B0_04); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_06); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_07); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_08); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_09); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_10); + common_hal_never_reset_pin(&pin_GPIO_EMC_01); + common_hal_never_reset_pin(&pin_GPIO_B0_13); + common_hal_never_reset_pin(&pin_GPIO_AD_B0_11); + // Data strobe needs protection despite being grounded + common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.ld b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.ld new file mode 100644 index 0000000000..8f19810a35 --- /dev/null +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/board.ld @@ -0,0 +1 @@ +_ld_reserved_flash_size = 4K; diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/flash_config.c b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/flash_config.c new file mode 100644 index 0000000000..e0f5a5bd7d --- /dev/null +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/flash_config.c @@ -0,0 +1,172 @@ +/* + * Copyright 2017 NXP + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "boards/flash_config.h" + +#include "fsl_flexspi_nor_boot.h" + + +__attribute__((section(".boot_hdr.ivt"))) +/************************************* + * IVT Data + *************************************/ +const ivt image_vector_table = { + 0x432000D1, /* Teensy bootloader looks for this value*/ + IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ + IVT_RSVD, /* Reserved = 0 */ + (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ + (uint32_t)BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure is stored */ + (uint32_t)&image_vector_table, /* Pointer to IVT Self (absolute address */ + (uint32_t)CSF_ADDRESS, /* Address where CSF file is stored */ + IVT_RSVD /* Reserved = 0 */ +}; + +extern unsigned long _flashimagelen; + +__attribute__((section(".boot_hdr.boot_data"))) +/************************************* + * Boot Data + *************************************/ +const BOOT_DATA_T boot_data = { + FLASH_BASE, /* boot start location */ + (uint32_t)&_flashimagelen, /* actual size of image */ + PLUGIN_FLAG, /* Plugin flag*/ + 0xFFFFFFFF /* empty - extra data word */ +}; + +// Config for W25Q64JV with QSPI routed. +__attribute__((section(".boot_hdr.conf"))) +const flexspi_nor_config_t qspiflash_config = { + .pageSize = 256u, + .sectorSize = 4u * 1024u, + .ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz, + .blockSize = 0x00010000, + .isUniformBlockSize = false, + .memConfig = + { + .tag = FLEXSPI_CFG_BLK_TAG, + .version = FLEXSPI_CFG_BLK_VERSION, + .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad, + .csHoldTime = 3u, + .csSetupTime = 3u, + + .busyOffset = 0u, // Status bit 0 indicates busy. + .busyBitPolarity = 0u, // Busy when the bit is 1. + + .deviceModeCfgEnable = 1u, + .deviceModeType = kDeviceConfigCmdType_QuadEnable, + .deviceModeSeq = { + .seqId = 4u, + .seqNum = 1u, + }, + .deviceModeArg = 0x02, + .deviceType = kFlexSpiDeviceType_SerialNOR, + .sflashPadType = kSerialFlash_4Pads, + .serialClkFreq = kFlexSpiSerialClk_60MHz, + .sflashA1Size = FLASH_SIZE, + .lookupTable = + { + // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) + // The high 16 bits is command 1 and the low are command 0. + // Within a command, the top 6 bits are the opcode, the next two are the number + // of pads and then last byte is the operand. The operand's meaning changes + // per opcode. + + // Indices with ROM should always have the same function because the ROM + // bootloader uses it. + + // 0: ROM: Read LUTs + // Quad version + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */, + RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */), + FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */, + READ_SDR, FLEXSPI_4PAD, 0x04), + // Single fast read version, good for debugging. + // FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */, + // RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + // FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */, + // READ_SDR, FLEXSPI_1PAD, 0x04), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 1: ROM: Read status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */, + READ_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 2: Empty + EMPTY_SEQUENCE, + + // 3: ROM: Write Enable + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */, + STOP, FLEXSPI_1PAD, 0x00), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 4: Config: Write Status + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */, + WRITE_SDR, FLEXSPI_1PAD, 0x01), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 5: ROM: Erase Sector + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 6: Empty + EMPTY_SEQUENCE, + + // 7: Empty + EMPTY_SEQUENCE, + + // 8: Block Erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 9: ROM: Page program + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */, + RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */), + + FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 10: Empty + EMPTY_SEQUENCE, + + // 11: ROM: Chip erase + SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */, + STOP, FLEXSPI_1PAD, 0), + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS, + TWO_EMPTY_STEPS), + + // 12: Empty + EMPTY_SEQUENCE, + + // 13: ROM: Read SFDP + EMPTY_SEQUENCE, + + // 14: ROM: Restore no cmd + EMPTY_SEQUENCE, + + // 15: ROM: Dummy + EMPTY_SEQUENCE + }, + }, +}; diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h new file mode 100644 index 0000000000..e768578b03 --- /dev/null +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.h @@ -0,0 +1,21 @@ +#define MICROPY_HW_BOARD_NAME "SparkFun Teensy MicroMod Processor" +#define MICROPY_HW_MCU_NAME "IMXRT1062DVL6A" + +// If you change this, then make sure to update the linker scripts as well to +// make sure you don't overwrite code +#define CIRCUITPY_INTERNAL_NVM_SIZE 0 + +#define BOARD_FLASH_SIZE (16 * 1024 * 1024) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO_AD_B1_00) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO_AD_B1_01) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO_B0_03) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO_B0_02) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO_B0_01) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B0_03) +#define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B0_02) + +#define CIRCUITPY_USB_DEVICE_INSTANCE 0 +#define CIRCUITPY_USB_HOST_INSTANCE 1 diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.mk b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.mk new file mode 100644 index 0000000000..3705bc6fb6 --- /dev/null +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x1B4F +USB_PID = 0x002E +USB_PRODUCT = "Teensy MicroMod" +USB_MANUFACTURER = "PJRC/Sparkfun" + +CHIP_VARIANT = MIMXRT1062DVJ6A +CHIP_FAMILY = MIMXRT1062 +FLASH = W25Q128JV +CIRCUITPY__EVE = 1 +CIRCUITPY_USB_HOST = 1 +CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY = 1 diff --git a/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/pins.c b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/pins.c new file mode 100644 index 0000000000..a81414aed2 --- /dev/null +++ b/ports/mimxrt10xx/boards/sparkfun_teensy_micromod/pins.c @@ -0,0 +1,208 @@ +#include "shared-bindings/board/__init__.h" + +#include "supervisor/board.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // Micromod pins mapped to logical Teensy pins + // Plus pins mapping some of the names on micromod breakout boards + {MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_B1_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_B1_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07)}, + + // SD Card slot + {MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + + // new pins (not on T4 or T4.1) + + {MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_GPIO_B0_04)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_GPIO_B0_05)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_B0_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_GPIO_B0_06)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_B0_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_GPIO_B0_07)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_B0_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_GPIO_B0_08)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_B0_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_GPIO_B0_09)}, + + // USB Host + {MP_ROM_QSTR(MP_QSTR_USB_HOST_POWER), MP_ROM_PTR(&pin_GPIO_EMC_40)}, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_DP), MP_ROM_PTR(&pin_USB_OTG2_DP)}, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_DM), MP_ROM_PTR(&pin_USB_OTG2_DN)}, + + {MP_ROM_QSTR(MP_QSTR_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)}, + + // Micromod Names on different carrier boards + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, // D0 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, // D1 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_PWM1), MP_ROM_PTR(&pin_GPIO_EMC_04)}, // D2 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_PWM0), MP_ROM_PTR(&pin_GPIO_EMC_05)}, // D3 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_D0), MP_ROM_PTR(&pin_GPIO_EMC_06)}, // D4 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_D1), MP_ROM_PTR(&pin_GPIO_EMC_08)}, // D5 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G6), MP_ROM_PTR(&pin_GPIO_B0_10)}, // D6 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_SDO), MP_ROM_PTR(&pin_GPIO_B1_01)}, // D7 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_SDI), MP_ROM_PTR(&pin_GPIO_B1_00)}, // D8 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G7), MP_ROM_PTR(&pin_GPIO_B0_11)}, // D9 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CS), MP_ROM_PTR(&pin_GPIO_B0_00)}, // D10 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_COPI), MP_ROM_PTR(&pin_GPIO_B0_02)}, // D11 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CIPO), MP_ROM_PTR(&pin_GPIO_B0_01)}, // D12 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, // D13 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, // D14 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, // D15 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_RX2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, // D16 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_TX2), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, // D17 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, // D18 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, // D19 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_FS), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, // D20 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_CLK), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, // D21 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_BATT_VIN3), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, // D22 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_MCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, // D23 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, // D24 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, // D25 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G8), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, // D26 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G11), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, // D27 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_33V_EN), MP_ROM_PTR(&pin_GPIO_EMC_32)}, // D28 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2C_INT), MP_ROM_PTR(&pin_GPIO_EMC_31)}, // D29 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CAN_RX), MP_ROM_PTR(&pin_GPIO_EMC_37)}, // D30 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CAN_TX), MP_ROM_PTR(&pin_GPIO_EMC_36)}, // D31 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G9), MP_ROM_PTR(&pin_GPIO_B0_12)}, // D32 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G10), MP_ROM_PTR(&pin_GPIO_EMC_07)}, // D33 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, // D34 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, // 35 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CIPO1), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, // 35 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCK1), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, // D36 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_COPI1), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, // D37 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_CS1), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, // D38 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, // D38 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G0), MP_ROM_PTR(&pin_GPIO_B0_04)}, // D40 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G1), MP_ROM_PTR(&pin_GPIO_B0_05)}, // D41 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G2), MP_ROM_PTR(&pin_GPIO_B0_06)}, // D42 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G3), MP_ROM_PTR(&pin_GPIO_B0_07)}, // D43 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G4), MP_ROM_PTR(&pin_GPIO_B0_08)}, // D44 + {MP_OBJ_NEW_QSTR(MP_QSTR_MM_G5), MP_ROM_PTR(&pin_GPIO_B0_09)}, // D45 + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/teensy40/board.c b/ports/mimxrt10xx/boards/teensy40/board.c index 1a1dc7e5ec..55cd826de2 100644 --- a/ports/mimxrt10xx/boards/teensy40/board.c +++ b/ports/mimxrt10xx/boards/teensy40/board.c @@ -53,12 +53,4 @@ void board_init(void) { common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/mimxrt10xx/boards/teensy40/flash_config.c b/ports/mimxrt10xx/boards/teensy40/flash_config.c index 3f4ab0271d..d878124b40 100644 --- a/ports/mimxrt10xx/boards/teensy40/flash_config.c +++ b/ports/mimxrt10xx/boards/teensy40/flash_config.c @@ -15,7 +15,7 @@ __attribute__((section(".boot_hdr.ivt"))) * IVT Data *************************************/ const ivt image_vector_table = { - IVT_HEADER, /* IVT Header */ + 0x432000D1, /* Teensy bootloader looks for this value*/ IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ IVT_RSVD, /* Reserved = 0 */ (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ @@ -25,13 +25,15 @@ const ivt image_vector_table = { IVT_RSVD /* Reserved = 0 */ }; +extern unsigned long _flashimagelen; + __attribute__((section(".boot_hdr.boot_data"))) /************************************* * Boot Data *************************************/ const BOOT_DATA_T boot_data = { FLASH_BASE, /* boot start location */ - FLASH_SIZE, /* size */ + (uint32_t)&_flashimagelen, /* actual size of image */ PLUGIN_FLAG, /* Plugin flag*/ 0xFFFFFFFF /* empty - extra data word */ }; diff --git a/ports/mimxrt10xx/boards/teensy40/mpconfigboard.mk b/ports/mimxrt10xx/boards/teensy40/mpconfigboard.mk index 3a73245403..9cb1e636b6 100644 --- a/ports/mimxrt10xx/boards/teensy40/mpconfigboard.mk +++ b/ports/mimxrt10xx/boards/teensy40/mpconfigboard.mk @@ -7,3 +7,4 @@ CHIP_VARIANT = MIMXRT1062DVJ6A CHIP_FAMILY = MIMXRT1062 FLASH = W25Q16JV CIRCUITPY__EVE = 1 +CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY = 1 diff --git a/ports/mimxrt10xx/boards/teensy40/pins.c b/ports/mimxrt10xx/boards/teensy40/pins.c index 2188c6c0e2..263603dcf3 100644 --- a/ports/mimxrt10xx/boards/teensy40/pins.c +++ b/ports/mimxrt10xx/boards/teensy40/pins.c @@ -6,111 +6,133 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS // With USB on left. Bottom edge. - { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01)}, // Top edge - { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, // Back side - { MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, - { MP_ROM_QSTR(MP_QSTR_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_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)}, + + // other i2c ports defined + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + + // Serial Pins + {MP_OBJ_NEW_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX8), MP_ROM_PTR(&pin_GPIO_B1_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX8), MP_ROM_PTR(&pin_GPIO_B1_12)}, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/teensy41/board.c b/ports/mimxrt10xx/boards/teensy41/board.c index 1a1dc7e5ec..628befd02b 100644 --- a/ports/mimxrt10xx/boards/teensy41/board.c +++ b/ports/mimxrt10xx/boards/teensy41/board.c @@ -52,13 +52,3 @@ void board_init(void) { // Data strobe needs protection despite being grounded common_hal_never_reset_pin(&pin_GPIO_SD_B1_05); } - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} diff --git a/ports/mimxrt10xx/boards/teensy41/flash_config.c b/ports/mimxrt10xx/boards/teensy41/flash_config.c index 09886dece6..e0f5a5bd7d 100644 --- a/ports/mimxrt10xx/boards/teensy41/flash_config.c +++ b/ports/mimxrt10xx/boards/teensy41/flash_config.c @@ -15,7 +15,7 @@ __attribute__((section(".boot_hdr.ivt"))) * IVT Data *************************************/ const ivt image_vector_table = { - IVT_HEADER, /* IVT Header */ + 0x432000D1, /* Teensy bootloader looks for this value*/ IMAGE_ENTRY_ADDRESS, /* Image Entry Function */ IVT_RSVD, /* Reserved = 0 */ (uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */ @@ -25,13 +25,15 @@ const ivt image_vector_table = { IVT_RSVD /* Reserved = 0 */ }; +extern unsigned long _flashimagelen; + __attribute__((section(".boot_hdr.boot_data"))) /************************************* * Boot Data *************************************/ const BOOT_DATA_T boot_data = { FLASH_BASE, /* boot start location */ - FLASH_SIZE, /* size */ + (uint32_t)&_flashimagelen, /* actual size of image */ PLUGIN_FLAG, /* Plugin flag*/ 0xFFFFFFFF /* empty - extra data word */ }; diff --git a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk index 9f214a22a2..7d16b797c5 100644 --- a/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk +++ b/ports/mimxrt10xx/boards/teensy41/mpconfigboard.mk @@ -8,3 +8,4 @@ CHIP_FAMILY = MIMXRT1062 FLASH = W25Q64JV CIRCUITPY__EVE = 1 CIRCUITPY_USB_HOST = 1 +CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY = 1 diff --git a/ports/mimxrt10xx/boards/teensy41/pins.c b/ports/mimxrt10xx/boards/teensy41/pins.c index 46604a933d..716772e27c 100644 --- a/ports/mimxrt10xx/boards/teensy41/pins.c +++ b/ports/mimxrt10xx/boards/teensy41/pins.c @@ -6,149 +6,171 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS // With USB on left. Bottom edge. - { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01)}, // Bottom Edge extended for 4.1 - { MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12)}, // Top edge - { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, // Top edge extended for Teensy 4.1 - { MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_B1_13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_B1_12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_B1_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_B1_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_AD_B1_12) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_AD_B1_13) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_AD_B1_04) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_AD_B1_05) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_B1_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_B1_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_AD_B1_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_AD_B1_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_AD_B1_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_AD_B1_05)}, // SD Card slot - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_SD_B0_02) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_SD_B0_01) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_SD_B0_00) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_GPIO_SD_B0_05) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D46), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_D47), MP_ROM_PTR(&pin_GPIO_SD_B0_04) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_D47), MP_ROM_PTR(&pin_GPIO_SD_B0_04)}, // Flash expansion spot and PSRAM expansion spot on a shared QSPI BUS - { MP_OBJ_NEW_QSTR(MP_QSTR_D48), MP_ROM_PTR(&pin_GPIO_EMC_24) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_PSRAM_CS), MP_ROM_PTR(&pin_GPIO_EMC_24) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D48), MP_ROM_PTR(&pin_GPIO_EMC_24)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_PSRAM_CS), MP_ROM_PTR(&pin_GPIO_EMC_24)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D49), MP_ROM_PTR(&pin_GPIO_EMC_27) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO1), MP_ROM_PTR(&pin_GPIO_EMC_27) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D49), MP_ROM_PTR(&pin_GPIO_EMC_27)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO1), MP_ROM_PTR(&pin_GPIO_EMC_27)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D50), MP_ROM_PTR(&pin_GPIO_EMC_28) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO2), MP_ROM_PTR(&pin_GPIO_EMC_28) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D50), MP_ROM_PTR(&pin_GPIO_EMC_28)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO2), MP_ROM_PTR(&pin_GPIO_EMC_28)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D51), MP_ROM_PTR(&pin_GPIO_EMC_22) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_FLASH_CS), MP_ROM_PTR(&pin_GPIO_EMC_22) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D51), MP_ROM_PTR(&pin_GPIO_EMC_22)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_FLASH_CS), MP_ROM_PTR(&pin_GPIO_EMC_22)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D52), MP_ROM_PTR(&pin_GPIO_EMC_26) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO0), MP_ROM_PTR(&pin_GPIO_EMC_26) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D52), MP_ROM_PTR(&pin_GPIO_EMC_26)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO0), MP_ROM_PTR(&pin_GPIO_EMC_26)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D53), MP_ROM_PTR(&pin_GPIO_EMC_25) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_CLK), MP_ROM_PTR(&pin_GPIO_EMC_25) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D53), MP_ROM_PTR(&pin_GPIO_EMC_25)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_CLK), MP_ROM_PTR(&pin_GPIO_EMC_25)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_D54), MP_ROM_PTR(&pin_GPIO_EMC_29) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO3), MP_ROM_PTR(&pin_GPIO_EMC_29) }, + {MP_OBJ_NEW_QSTR(MP_QSTR_D54), MP_ROM_PTR(&pin_GPIO_EMC_29)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_QSPI_IO3), MP_ROM_PTR(&pin_GPIO_EMC_29)}, // USB Host - { MP_ROM_QSTR(MP_QSTR_USB_HOST_POWER), MP_ROM_PTR(&pin_GPIO_EMC_40) }, - { MP_ROM_QSTR(MP_QSTR_USB_HOST_DP), MP_ROM_PTR(&pin_USB_OTG2_DP) }, - { MP_ROM_QSTR(MP_QSTR_USB_HOST_DM), MP_ROM_PTR(&pin_USB_OTG2_DN) }, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_POWER), MP_ROM_PTR(&pin_GPIO_EMC_40)}, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_DP), MP_ROM_PTR(&pin_USB_OTG2_DP)}, + {MP_ROM_QSTR(MP_QSTR_USB_HOST_DM), MP_ROM_PTR(&pin_USB_OTG2_DN)}, - { MP_ROM_QSTR(MP_QSTR_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_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)}, + + // other i2c ports defined + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + + // Serial Pins + {MP_OBJ_NEW_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO_B1_01)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO_B1_00)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_31)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_RX8), MP_ROM_PTR(&pin_GPIO_B1_13)}, + {MP_OBJ_NEW_QSTR(MP_QSTR_TX8), MP_ROM_PTR(&pin_GPIO_B1_12)}, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c index 2d809c258c..f5d2e7f42e 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogIn.c @@ -42,7 +42,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, adc_config_t config = {0}; if (pin->adc == NULL) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } ADC_GetDefaultConfig(&config); @@ -81,8 +81,10 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { } - // Shift the value to be 16 bit - return ADC_GetChannelConversionValue(self->pin->adc, ADC_CHANNEL_GROUP) << 4; + uint16_t value = ADC_GetChannelConversionValue(self->pin->adc, ADC_CHANNEL_GROUP); + + // Stretch 12-bit ADC reading to 16-bit range + return (value << 4) | (value >> 8); } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { diff --git a/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c b/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c index bf21e30df3..14e1faab09 100644 --- a/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c +++ b/ports/mimxrt10xx/common-hal/analogio/AnalogOut.c @@ -29,10 +29,10 @@ #include "shared-bindings/analogio/AnalogOut.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { - mp_raise_NotImplementedError(translate("AnalogOut functionality not supported")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { diff --git a/ports/mimxrt10xx/common-hal/busio/I2C.c b/ports/mimxrt10xx/common-hal/busio/I2C.c index 77df979e4d..50aae54aba 100644 --- a/ports/mimxrt10xx/common-hal/busio/I2C.c +++ b/ports/mimxrt10xx/common-hal/busio/I2C.c @@ -138,7 +138,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } if (self->sda == NULL || self->scl == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } else { self->i2c = mcu_i2c_banks[self->sda->bank_idx - 1]; } diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c index 608fae7fbe..0048c2aeb2 100644 --- a/ports/mimxrt10xx/common-hal/busio/SPI.c +++ b/ports/mimxrt10xx/common-hal/busio/SPI.c @@ -168,7 +168,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, if (spi_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); } else { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } } diff --git a/ports/mimxrt10xx/common-hal/busio/UART.c b/ports/mimxrt10xx/common-hal/busio/UART.c index 77a2f97974..20430c91c8 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.c +++ b/ports/mimxrt10xx/common-hal/busio/UART.c @@ -39,6 +39,17 @@ #include "periph.h" #include "fsl_lpuart.h" +#include "fsl_gpio.h" +// ========================================================== +// Debug code +// ========================================================== +#define ENABLE_DEBUG_PRINTING 0 +#if ENABLE_DEBUG_PRINTING +#define DBGPrintf mp_printf +#else +#define DBGPrintf(p,...) +#endif + // arrays use 0 based numbering: UART1 is stored at index 0 #define MAX_UART 8 @@ -90,6 +101,7 @@ void common_hal_busio_uart_never_reset(busio_uart_obj_t *self) { common_hal_never_reset_pin(self->rx); common_hal_never_reset_pin(self->rts); common_hal_never_reset_pin(self->cts); + common_hal_never_reset_pin(self->rs485_dir); } void common_hal_busio_uart_construct(busio_uart_obj_t *self, @@ -101,16 +113,16 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, bool sigint_enabled) { self->baudrate = baudrate; - self->character_bits = bits; + self->character_bits = (uint8_t)mp_arg_validate_int_range(self->character_bits, 7, 8, MP_QSTR_bits); self->timeout_ms = timeout * 1000; - if (self->character_bits != 7 && self->character_bits != 8) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } + + DBGPrintf(&mp_plat_print, "uart_construct: tx:%p rx:%p rts:%p cts:%p rs485:%p\n", tx, rx, rts, cts, rs485_dir); // We are transmitting one direction if one pin is NULL and the other isn't. bool is_onedirection = (rx == NULL) != (tx == NULL); bool uart_taken = false; + bool use_rts_for_rs485 = false; const uint32_t rx_count = MP_ARRAY_SIZE(mcu_uart_rx_list); const uint32_t tx_count = MP_ARRAY_SIZE(mcu_uart_tx_list); @@ -171,10 +183,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } if (rx && !rx_config) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_RX); + raise_ValueError_invalid_pin_name(MP_QSTR_rx); } if (tx && !tx_config) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_TX); + raise_ValueError_invalid_pin_name(MP_QSTR_tx); } if (uart_taken) { @@ -187,11 +199,14 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // Filter for sane settings for RS485 if (rs485_dir != NULL) { + DBGPrintf(&mp_plat_print, "\t(485 pin): gpio:%p #:%x Mux: %x %x cfg:%x reset:%x %x\n", + rs485_dir->gpio, rs485_dir->number, rs485_dir->mux_idx, rs485_dir->mux_reg, rs485_dir->cfg_reg, + rs485_dir->mux_reset, rs485_dir->pad_reset); if ((rts != NULL) || (cts != NULL)) { mp_raise_ValueError(translate("Cannot specify RTS or CTS in RS485 mode")); } - // For IMXRT the RTS pin is used for RS485 direction - rts = rs485_dir; + // For IMXRT the RTS pin is used for RS485 direction ???? - Can be will try + // it if this is an rts pin. } else { if (rs485_invert) { mp_raise_ValueError(translate("RS485 inversion specified when not in RS485 mode")); @@ -202,17 +217,23 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, const uint32_t rts_count = MP_ARRAY_SIZE(mcu_uart_rts_list); const uint32_t cts_count = MP_ARRAY_SIZE(mcu_uart_cts_list); - if (rts != NULL) { + if ((rts != NULL) || (rs485_dir != NULL)) { for (uint32_t i = 0; i < rts_count; ++i) { if (mcu_uart_rts_list[i].bank_idx == rx_config->bank_idx) { if (mcu_uart_rts_list[i].pin == rts) { rts_config = &mcu_uart_rts_list[i]; break; + } else if (mcu_uart_rts_list[i].pin == rs485_dir) { + rts_config = &mcu_uart_rts_list[i]; + use_rts_for_rs485 = true; + rts = rs485_dir; + rs485_dir = NULL; + break; } } } - if (rts_config == NULL) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_RTS); + if ((rts != NULL) && (rts_config == NULL)) { + raise_ValueError_invalid_pin_name(MP_QSTR_rts); } } @@ -225,8 +246,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } } } - if (cts == NULL) { - mp_raise_ValueError_varg(translate("Invalid %q pin"), MP_QSTR_CTS); + if (cts_config == NULL) { + raise_ValueError_invalid_pin_name(MP_QSTR_cts); } } @@ -257,7 +278,32 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, config_periph_pin(cts_config); self->cts = cts; } + if (rs485_dir) { + DBGPrintf(&mp_plat_print, "\tInit rs485 pin\n"); + // lets configure this pin as standard GPIO output pin. + claim_pin(rs485_dir); + #define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U + IOMUXC_SetPinMux(rs485_dir->mux_reg, IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5, 0, 0, 0, 0); + DBGPrintf(&mp_plat_print, "\tAfter IOMUXC_SetPinMux\n"); + IOMUXC_SetPinConfig(0, 0, 0, 0, rs485_dir->cfg_reg, + IOMUXC_SW_PAD_CTL_PAD_HYS(1) + | 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(1) + | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); + DBGPrintf(&mp_plat_print, "\tAfter IOMUXC_SetPinConfig\n"); + + const gpio_pin_config_t config = { kGPIO_DigitalOutput, rs485_invert, kGPIO_NoIntmode }; + GPIO_PinInit(rs485_dir->gpio, rs485_dir->number, &config); + DBGPrintf(&mp_plat_print, "\tAfter GPIO_PinInit\n"); + self->rs485_dir = rs485_dir; + self->rs485_invert = rs485_invert; + + } lpuart_config_t config = { 0 }; LPUART_GetDefaultConfig(&config); @@ -279,7 +325,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // Before we init, setup RS485 direction pin // ..unfortunately this isn't done by the driver library uint32_t modir = (self->uart->MODIR) & ~(LPUART_MODIR_TXRTSPOL_MASK | LPUART_MODIR_TXRTSE_MASK); - if (rs485_dir != NULL) { + if (use_rts_for_rs485) { modir |= LPUART_MODIR_TXRTSE_MASK; if (rs485_invert) { modir |= LPUART_MODIR_TXRTSPOL_MASK; @@ -301,7 +347,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, if (!self->ringbuf) { LPUART_Deinit(self->uart); - mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); + m_malloc_fail(receiver_buffer_size); } LPUART_TransferCreateHandle(self->uart, &self->handle, LPUART_UserCallback, self); @@ -311,6 +357,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, claim_pin(self->rx); } + DBGPrintf(&mp_plat_print, "\t<< Init completed >>\n"); } bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { @@ -330,9 +377,16 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { common_hal_reset_pin(self->rx); common_hal_reset_pin(self->tx); + common_hal_reset_pin(self->cts); + common_hal_reset_pin(self->rts); + common_hal_reset_pin(self->rs485_dir); self->rx = NULL; self->tx = NULL; + self->cts = NULL; + self->rts = NULL; + self->rs485_dir = NULL; + } // Read characters. @@ -371,6 +425,10 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t uint32_t recvd = 0; LPUART_TransferGetReceiveCount(self->uart, &self->handle, &recvd); LPUART_TransferAbortReceive(self->uart, &self->handle); + if (recvd == 0) { + *errcode = EAGAIN; + return MP_STREAM_ERROR; + } return recvd; } @@ -393,8 +451,21 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, if (self->tx == NULL) { mp_raise_ValueError(translate("No TX pin")); } - - LPUART_WriteBlocking(self->uart, data, len); + if (self->rs485_dir && len) { + GPIO_PinWrite(self->rs485_dir->gpio, self->rs485_dir->number, !self->rs485_invert); + LPUART_WriteBlocking(self->uart, data, len); + // Probably need to verify we have completed output. + uint32_t dont_hang_count = 0xffff; + while (dont_hang_count--) { + if (LPUART_GetStatusFlags(self->uart) & kLPUART_TransmissionCompleteFlag) { + break; // hardware says it completed. + } + } + GPIO_PinWrite(self->rs485_dir->gpio, self->rs485_dir->number, self->rs485_invert); + } else { + // could combine with above but would go through two ifs + LPUART_WriteBlocking(self->uart, data, len); + } return len; } diff --git a/ports/mimxrt10xx/common-hal/busio/UART.h b/ports/mimxrt10xx/common-hal/busio/UART.h index fb3fd3245a..bc8374aabb 100644 --- a/ports/mimxrt10xx/common-hal/busio/UART.h +++ b/ports/mimxrt10xx/common-hal/busio/UART.h @@ -50,6 +50,9 @@ typedef struct { const mcu_pin_obj_t *tx; const mcu_pin_obj_t *cts; const mcu_pin_obj_t *rts; + const mcu_pin_obj_t *rs485_dir; + bool rs485_invert; + } busio_uart_obj_t; void uart_reset(void); diff --git a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c index 27753f47dc..dde7b3badd 100644 --- a/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c +++ b/ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c @@ -36,7 +36,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define IOMUXC_SW_MUX_CTL_PAD_MUX_MODE_ALT5 5U diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c index 697d97ca43..17ced78910 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.c @@ -27,6 +27,8 @@ #include +#include "py/runtime.h" + #include "common-hal/microcontroller/Processor.h" #include "shared-bindings/microcontroller/Processor.h" #include "shared-bindings/microcontroller/ResetReason.h" @@ -50,6 +52,18 @@ float common_hal_mcu_processor_get_temperature(void) { return temp; } +uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self, + uint32_t frequency) { + uint32_t freq = frequency / 1000000; + if (freq != 24 && freq != 150 && freq != 396 && freq != 450 && freq != 528 && freq != 600 && + freq != 720 && freq != 816 && freq != 912 && freq != 960 && freq != 1008) { + mp_raise_ValueError(translate("Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz")); + } + SystemCoreClock = setarmclock(frequency); + return SystemCoreClock; +} + + float common_hal_mcu_processor_get_voltage(void) { return NAN; } diff --git a/ports/mimxrt10xx/common-hal/microcontroller/Processor.h b/ports/mimxrt10xx/common-hal/microcontroller/Processor.h index 43b0ec878c..2f7ff88697 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/Processor.h +++ b/ports/mimxrt10xx/common-hal/microcontroller/Processor.h @@ -31,10 +31,11 @@ #define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 16 #include "py/obj.h" +#include "clocks.h" typedef struct { mp_obj_base_t base; - // Stores no state currently. + uint32_t frequency; } mcu_processor_obj_t; #endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H diff --git a/ports/mimxrt10xx/common-hal/microcontroller/__init__.c b/ports/mimxrt10xx/common-hal/microcontroller/__init__.c index e6edd6dfc9..8de63061ad 100644 --- a/ports/mimxrt10xx/common-hal/microcontroller/__init__.c +++ b/ports/mimxrt10xx/common-hal/microcontroller/__init__.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" #include "supervisor/shared/safe_mode.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define DBL_TAP_REG SNVS->LPGPR[3] @@ -70,7 +70,7 @@ void common_hal_mcu_enable_interrupts(void) { void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { if (runmode == RUNMODE_BOOTLOADER) { if (!bootloader_available()) { - mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present.")); + mp_raise_ValueError(translate("Cannot reset into bootloader because no bootloader is present")); } // Pretend to be the first of the two reset presses needed to enter the // bootloader. That way one reset will end in the bootloader. diff --git a/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c index 8eb3251bf3..97892b1095 100644 --- a/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c +++ b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c @@ -35,9 +35,13 @@ #include "fsl_pwm.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "periph.h" +// Debug print support set to zero to enable debug printing +#define ENABLE_DEBUG_PRINTING 0 + + static void config_periph_pin(const mcu_pwm_obj_t *periph) { IOMUXC_SetPinMux( periph->pin->mux_reg, periph->mux_mode, @@ -83,6 +87,33 @@ static int calculate_pulse_count(uint32_t frequency, uint8_t *prescaler) { return 0; } +// ========================================================== +// Debug code +// ========================================================== +#if ENABLE_DEBUG_PRINTING +#define DBGPrintf mp_printf +extern void debug_print_flexpwm_registers(PWM_Type *base); + +void debug_print_flexpwm_registers(PWM_Type *base) { + mp_printf(&mp_plat_print, + "\t\tPWM OUTEN:%x MASK:%x SWCOUT:%x DTSRCSEL:%x MCTRL:%x MCTRL2:%x FCTRL:%x FSTS:%x FFILT:%x FTST:%x FCTRL2:%x\n", + base->OUTEN, base->MASK, base->SWCOUT, base->DTSRCSEL, base->MCTRL, base->MCTRL2, base->FCTRL, + base->FSTS, base->FFILT, base->FTST, base->FCTRL2); + for (uint8_t i = 0; i < 4; i++) { + mp_printf(&mp_plat_print, + "\t\t(%u) INIT:%x CTRL2:%x CTRL:%x VAL0:%x VAL1:%x VAL2:%x VAL3:%x VAL4:%x VAL5:%x OCTRL:%x DTCNT0:%x DTCNT1:%x DISMAP: %x %x\n", i, + base->SM[i].INIT, base->SM[i].CTRL2, base->SM[i].CTRL, base->SM[i].VAL0, base->SM[i].VAL1, base->SM[i].VAL2, + base->SM[i].VAL3, base->SM[i].VAL4, base->SM[i].VAL5, base->SM[i].OCTRL, base->SM[i].DTCNT0, base->SM[i].DTCNT1, + base->SM[i].DISMAP[0], base->SM[i].DISMAP[1]); + } + +} +#else +#define DBGPrintf(p,...) +inline void debug_print_flexpwm_registers(PWM_Type *base) { +} +#endif + pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, const mcu_pin_obj_t *pin, uint16_t duty, @@ -93,6 +124,9 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, const uint32_t pwm_count = sizeof(mcu_pwm_list) / sizeof(mcu_pwm_obj_t); + DBGPrintf(&mp_plat_print, ">>> common_hal_pwmio_pwmout_construct called: pin: %p %u freq:%u duty:%u var:%u\n", + self->pin->gpio, self->pin->number, frequency, duty, variable_frequency); + for (uint32_t i = 0; i < pwm_count; ++i) { if (mcu_pwm_list[i].pin != pin) { continue; @@ -107,6 +141,8 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, return PWMOUT_INVALID_PIN; } + DBGPrintf(&mp_plat_print, "\tFound in PWM List\n"); + config_periph_pin(self->pwm); pwm_config_t pwmConfig; @@ -138,33 +174,67 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, pwmConfig.prescale = self->prescaler; + DBGPrintf(&mp_plat_print, "\tCall PWM_Init\n"); if (PWM_Init(self->pwm->pwm, self->pwm->submodule, &pwmConfig) == kStatus_Fail) { return PWMOUT_INVALID_PIN; } - pwm_signal_param_t pwmSignal = { - .pwmChannel = self->pwm->channel, - .level = kPWM_HighTrue, - .dutyCyclePercent = 0, // avoid an initial transient - .deadtimeValue = 0, // allow 100% duty cycle - }; - // Disable all fault inputs self->pwm->pwm->SM[self->pwm->submodule].DISMAP[0] = 0; self->pwm->pwm->SM[self->pwm->submodule].DISMAP[1] = 0; - status_t status = PWM_SetupPwm(self->pwm->pwm, self->pwm->submodule, &pwmSignal, 1, kPWM_EdgeAligned, frequency, PWM_SRC_CLK_FREQ); + DBGPrintf(&mp_plat_print, "\tCall PWM_SetupPwm %p %x %u\n", self->pwm->pwm, self->pwm->submodule); + // ======================================================================================================== + // Not calling the PWM_SetupPwm as it was setup to only work for PWM output on chan A and B but not X + // I have done some experimenting, probably could try others, but again they do not work with X. + // Most of the code checks to see if A if not, then it assume B. + // + // Instead I set it up to work similar to what the Teensy 4.x code does. + // + // That is we set the PWM_CTRL_FULL_MASK, which then uses base->SM[submodule].VAL1 to control + // when the timer is reset, so it sets up your cycle/frequency. But then this implies that X channel + // which uses 0, 1 has to be handled specially. So for the different channels: + // A - Uses VAL2 to turn on (0) and VAL3=duty to turn off + // B - Uses VAL4 to turn on (0) and VAL5 to turn off + // X - As mentioned above VAL1 turns off, but it's set to the timing for frequency. so + // VAL0 turns on, so we set it to VAL1 - duty + // + PWM_Type *base = self->pwm->pwm; + uint8_t submodule = self->pwm->submodule; - if (status != kStatus_Success) { - return PWMOUT_INITIALIZATION_ERROR; + uint32_t mask = 1 << submodule; + uint32_t olddiv = base->SM[submodule].VAL1 + 1; + if (self->pulse_count != olddiv) { + base->MCTRL |= PWM_MCTRL_CLDOK(mask); + base->SM[submodule].CTRL = PWM_CTRL_PRSC_MASK | PWM_CTRL_PRSC(self->prescaler); + base->SM[submodule].VAL1 = self->pulse_count - 1; + base->SM[submodule].CTRL2 = PWM_CTRL2_INDEP_MASK | PWM_CTRL2_WAITEN_MASK | PWM_CTRL2_DBGEN_MASK; + + if (olddiv == 1) { + base->SM[submodule].CTRL = PWM_CTRL_FULL_MASK; + base->SM[submodule].VAL0 = 0; + base->SM[submodule].VAL2 = 0; + base->SM[submodule].VAL3 = 0; + base->SM[submodule].VAL4 = 0; + base->SM[submodule].VAL5 = 0; + } else { + base->SM[submodule].VAL0 = (base->SM[submodule].VAL0 * self->pulse_count) / olddiv; + base->SM[submodule].VAL3 = (base->SM[submodule].VAL3 * self->pulse_count) / olddiv; + base->SM[submodule].VAL5 = (base->SM[submodule].VAL5 * self->pulse_count) / olddiv; + } + base->MCTRL |= PWM_MCTRL_LDOK(mask); } + debug_print_flexpwm_registers(self->pwm->pwm); + PWM_SetPwmLdok(self->pwm->pwm, 1 << self->pwm->submodule, true); PWM_StartTimer(self->pwm->pwm, 1 << self->pwm->submodule); + DBGPrintf(&mp_plat_print, "\tCall common_hal_pwmio_pwmout_set_duty_cycle\n"); common_hal_pwmio_pwmout_set_duty_cycle(self, duty); + DBGPrintf(&mp_plat_print, "\tReturn OK\n"); return PWMOUT_OK; } @@ -185,7 +255,16 @@ void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uint16_t d // we do not use PWM_UpdatePwmDutycycle because ... // * it works in integer percents // * it can't set the "X" duty cycle + // As mentioned in the setting up of the frequency code + // A - Uses VAL2 to turn on (0) and VAL3=duty to turn off + // B - Uses VAL4 to turn on (0) and VAL5 to turn off + // X - As mentioned above VAL1 turns off, but it's set to the timing for frequency. so + // VAL0 turns on, so we set it to VAL1 - duty + + DBGPrintf(&mp_plat_print, "common_hal_pwmio_pwmout_set_duty_cycle %u\n", duty); self->duty_cycle = duty; + PWM_Type *base = self->pwm->pwm; + uint8_t mask = 1 << self->pwm->submodule; if (duty == 65535) { self->duty_scaled = self->pulse_count + 1; } else { @@ -193,18 +272,21 @@ void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uint16_t d } switch (self->pwm->channel) { case kPWM_PwmX: - self->pwm->pwm->SM[self->pwm->submodule].VAL0 = 0; - self->pwm->pwm->SM[self->pwm->submodule].VAL1 = self->duty_scaled; + base->SM[self->pwm->submodule].VAL0 = self->pulse_count - self->duty_scaled; + base->OUTEN |= PWM_OUTEN_PWMX_EN(mask); break; case kPWM_PwmA: - self->pwm->pwm->SM[self->pwm->submodule].VAL2 = 0; - self->pwm->pwm->SM[self->pwm->submodule].VAL3 = self->duty_scaled; + base->SM[self->pwm->submodule].VAL3 = self->duty_scaled; + base->OUTEN |= PWM_OUTEN_PWMA_EN(mask); break; case kPWM_PwmB: - self->pwm->pwm->SM[self->pwm->submodule].VAL4 = 0; - self->pwm->pwm->SM[self->pwm->submodule].VAL5 = self->duty_scaled; + base->SM[self->pwm->submodule].VAL5 = self->duty_scaled; + base->OUTEN |= PWM_OUTEN_PWMB_EN(mask); } PWM_SetPwmLdok(self->pwm->pwm, 1 << self->pwm->submodule, true); + + debug_print_flexpwm_registers(self->pwm->pwm); + } uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t *self) { @@ -219,7 +301,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, int pulse_count = calculate_pulse_count(frequency, &self->prescaler); if (pulse_count == 0) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } self->pulse_count = pulse_count; diff --git a/ports/mimxrt10xx/common-hal/rtc/RTC.c b/ports/mimxrt10xx/common-hal/rtc/RTC.c index 04aa799ce5..7ed65a3499 100644 --- a/ports/mimxrt10xx/common-hal/rtc/RTC.c +++ b/ports/mimxrt10xx/common-hal/rtc/RTC.c @@ -33,7 +33,7 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/rtc/RTC.h" #include "common-hal/rtc/RTC.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "fsl_snvs_hp.h" @@ -75,5 +75,5 @@ int common_hal_rtc_get_calibration(void) { void common_hal_rtc_set_calibration(int calibration) { // SNVS has HPCALB_VAL bits for calibration. - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); } diff --git a/ports/mimxrt10xx/common-hal/usb_host/Port.c b/ports/mimxrt10xx/common-hal/usb_host/Port.c index 52ac12dc86..126160c69c 100644 --- a/ports/mimxrt10xx/common-hal/usb_host/Port.c +++ b/ports/mimxrt10xx/common-hal/usb_host/Port.c @@ -24,9 +24,8 @@ * THE SOFTWARE. */ -#include "shared-bindings/usb_host/Port.h" - #include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/usb_host/Port.h" #include "py/runtime.h" @@ -43,7 +42,7 @@ void common_hal_usb_host_port_construct(usb_host_port_obj_t *self, const mcu_pin supported_dm = &pin_USB_OTG2_DN; } if (dp != supported_dp || dm != supported_dm) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } self->init = true; usb_host_init = true; diff --git a/ports/mimxrt10xx/linking/common.ld b/ports/mimxrt10xx/linking/common.ld index 44e8d537c4..b6f1acc8d0 100644 --- a/ports/mimxrt10xx/linking/common.ld +++ b/ports/mimxrt10xx/linking/common.ld @@ -74,7 +74,6 @@ SECTIONS _etext = .; /* define a global symbol at end of code */ __etext = .; /* define a global symbol at end of code */ } > FLASH_FIRMWARE - _ld_filesystem_start = ORIGIN(FLASH_FATFS); _ld_filesystem_end = _ld_filesystem_start + LENGTH(FLASH_FATFS); @@ -127,6 +126,8 @@ SECTIONS _ld_dtcm_data_flash_copy = LOADADDR(.dtcm_data); _ld_dtcm_data_size = SIZEOF(.dtcm_data); + _flashimagelen = _ld_dtcm_data_flash_copy + _ld_dtcm_data_size - flash_config_location; + .dtcm_bss : { . = ALIGN(4); diff --git a/ports/mimxrt10xx/linking/flash/W25Q128JV.ld b/ports/mimxrt10xx/linking/flash/W25Q128JV.ld new file mode 100644 index 0000000000..205d9dd839 --- /dev/null +++ b/ports/mimxrt10xx/linking/flash/W25Q128JV.ld @@ -0,0 +1 @@ +_ld_flash_size = 16M; diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index e7e7abe141..cee2d9a698 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -14,10 +14,12 @@ CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BUSDEVICE = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 0 CIRCUITPY_NVM = 0 CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_USB_MIDI = 1 LONGINT_IMPL = MPZ + +CIRCUITPY_BUILD_EXTENSIONS ?= hex,uf2 diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c index 46d1eccb20..0eb879053b 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/clocks.c @@ -34,6 +34,7 @@ #include "fsl_clock.h" #include "fsl_iomuxc.h" +#include "fsl_device_registers.h" #include "clocks.h" @@ -335,3 +336,257 @@ void clocks_init(void) { CLOCK_EnableClock(kCLOCK_Iomuxc); } + +/* clockspeed.c + * http://www.pjrc.com/teensy/ + * Copyright (c) 2017 PJRC.COM, LLC + * + * 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. + */ +// Note setarmclock is a port from Teensyduino for the Teensy 4.x written by Paul Stroffgren, +// A brief explanation of F_CPU_ACTUAL vs F_CPU +// https://forum.pjrc.com/threads/57236?p=212642&viewfull=1#post212642 +volatile uint32_t F_CPU_ACTUAL = 396000000; +volatile uint32_t F_BUS_ACTUAL = 132000000; + +// Define these to increase the voltage when attempting overclocking +// The frequency step is how quickly to increase voltage per frequency +// The datasheet says 1600 is the absolute maximum voltage. The hardware +// can actually create up to 1575. But 1300 is the recommended limit. +// (earlier versions of the datasheet said 1300 was the absolute max) +#define OVERCLOCK_STEPSIZE 28000000 +#define OVERCLOCK_MAX_VOLT 1575 + +#define DCDC_REG3 0x40080012 +#define DCDC_REG0 0x40080000 +#define DCDC_REG0_STS_DC_OK_L ((uint32_t)(1 << 31)) +#define CCM_ANALOG_PLL_USB1_ENABLE_L ((uint32_t)(1 << 13)) +#define CCM_ANALOG_PLL_USB1_POWER_L ((uint32_t)(1 << 12)) +#define CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L ((uint32_t)(1 << 6)) +#define CCM_ANALOG_PLL_USB1_LOCK_L ((uint32_t)(1 << 31)) +#define CCM_CCGR6_DCDC(n) ((uint32_t)(((n) & 0x03) << 6)) +#define CCM_ANALOG_PLL_ARM_LOCK_L ((uint32_t)(1 << 31)) +#define CCM_ANALOG_PLL_ARM_BYPASS_L ((uint32_t)(1 << 16)) +#define CCM_ANALOG_PLL_ARM_ENABLE_L ((uint32_t)(1 << 13)) +#define CCM_ANALOG_PLL_ARM_POWERDOWN_L ((uint32_t)(1 << 12)) +#define CCM_CDHIPR_ARM_PODF_BUSY_L ((uint32_t)(1 << 16)) +#define CCM_CDHIPR_AHB_PODF_BUSY_L ((uint32_t)(1 << 1)) +#define CCM_CDHIPR_PERIPH_CLK_SEL_BUSY_L ((uint32_t)(1 << 5)) +#define CCM_CBCDR_PERIPH_CLK_SEL_L ((uint32_t)(1 << 25)) +#define CCM_CCGR_OFF 0 +#define CCM_CCGR_ON_RUNONLY 1 +#define CCM_CCGR_ON 3 + +/* Teensyduino Core Library - clockspeed.c + * http://www.pjrc.com/teensy/ + * Copyright (c) 2017 PJRC.COM, LLC. + * + * 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: + * + * 1. The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 2. If the Software is incorporated into a build system that allows + * selection among a list of target devices, then similar target + * devices manufactured by PJRC.COM must be included in the list of + * target devices and selectable in the same manner. + * + * 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. + */ + +// uint32_t set_arm_clock(uint32_t frequency); + +// stuff needing wait handshake: +// CCM_CACRR ARM_PODF +// CCM_CBCDR PERIPH_CLK_SEL +// CCM_CBCMR PERIPH2_CLK_SEL +// CCM_CBCDR AHB_PODF +// CCM_CBCDR SEMC_PODF + +uint32_t setarmclock(uint32_t frequency) { + uint32_t cbcdr = CCM->CBCDR; // pg 1021 + uint32_t cbcmr = CCM->CBCMR; // pg 1023 + uint32_t dcdc = DCDC->REG3; + + // compute required voltage + uint32_t voltage = 1150; // default = 1.15V + if (frequency > 528000000) { + voltage = 1250; // 1.25V + #if defined(OVERCLOCK_STEPSIZE) && defined(OVERCLOCK_MAX_VOLT) + if (frequency > 600000000) { + voltage += ((frequency - 600000000) / OVERCLOCK_STEPSIZE) * 25; + if (voltage > OVERCLOCK_MAX_VOLT) { + voltage = OVERCLOCK_MAX_VOLT; + } + } + #endif + } else if (frequency <= 24000000) { + voltage = 950; // 0.95 + } + + // if voltage needs to increase, do it before switch clock speed + CCM->CCGR6 |= CCM_CCGR6_DCDC(CCM_CCGR_ON); + if ((dcdc & ((uint32_t)(0x1F << 0))) < ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) { + dcdc &= ~((uint32_t)(0x1F << 0)); + dcdc |= ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0); + DCDC->REG3 = dcdc; + while (!(DCDC->REG0 & DCDC_REG0_STS_DC_OK_L)) { + ; // wait voltage settling + } + } + + if (!(cbcdr & CCM_CBCDR_PERIPH_CLK_SEL_L)) { + const uint32_t need1s = CCM_ANALOG_PLL_USB1_ENABLE_L | CCM_ANALOG_PLL_USB1_POWER_L | + CCM_ANALOG_PLL_USB1_LOCK_L | CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L; + uint32_t sel, div; + if ((CCM_ANALOG->PLL_USB1 & need1s) == need1s) { + sel = 0; + div = 3; // divide down to 120 MHz, so IPG is ok even if IPG_PODF=0 + } else { + sel = 1; + div = 0; + } + if ((cbcdr & ((uint32_t)(0x07 << 27))) != CCM_CBCDR_PERIPH_CLK2_PODF(div)) { + // PERIPH_CLK2 divider needs to be changed + cbcdr &= ~((uint32_t)(0x07 << 27)); + cbcdr |= CCM_CBCDR_PERIPH_CLK2_PODF(div); + CCM->CBCDR = cbcdr; + } + if ((cbcmr & ((uint32_t)(0x03 << 12))) != CCM_CBCMR_PERIPH_CLK2_SEL(sel)) { + // PERIPH_CLK2 source select needs to be changed + cbcmr &= ~((uint32_t)(0x03 << 12)); + cbcmr |= CCM_CBCMR_PERIPH_CLK2_SEL(sel); + CCM->CBCMR = cbcmr; + while (CCM->CDHIPR & ((uint32_t)(1 << 3))) { + ; // wait + } + } + // switch over to PERIPH_CLK2 + cbcdr |= ((uint32_t)(1 << 25)); + CCM->CBCDR = cbcdr; + while (CCM->CDHIPR & ((uint32_t)(1 << 5))) { + ; // wait + } + } + + // TODO: check if PLL2 running, can 352, 396 or 528 can work? (no need for ARM PLL) + + // DIV_SELECT: 54-108 = official range 648 to 1296 in 12 MHz steps + uint32_t div_arm = 1; + uint32_t div_ahb = 1; + while (frequency * div_arm * div_ahb < 648000000) { + if (div_arm < 8) { + div_arm = div_arm + 1; + } else { + if (div_ahb < 5) { + div_ahb = div_ahb + 1; + div_arm = 1; + } else { + break; + } + } + } + uint32_t mult = (frequency * div_arm * div_ahb + 6000000) / 12000000; + if (mult > 108) { + mult = 108; + } + if (mult < 54) { + mult = 54; + } + + frequency = mult * 12000000 / div_arm / div_ahb; + + const uint32_t arm_pll_mask = CCM_ANALOG_PLL_ARM_LOCK_L | CCM_ANALOG_PLL_ARM_BYPASS_L | + CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_POWERDOWN_L | + CCM_ANALOG_PLL_ARM_DIV_SELECT_MASK; + if ((CCM_ANALOG->PLL_ARM & arm_pll_mask) != (CCM_ANALOG_PLL_ARM_LOCK_L + | CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_DIV_SELECT(mult))) { + // printf("ARM PLL needs reconfigure\n"); + CCM_ANALOG->PLL_ARM = CCM_ANALOG_PLL_ARM_POWERDOWN_L; + // TODO: delay needed? + CCM_ANALOG->PLL_ARM = CCM_ANALOG_PLL_ARM_ENABLE_L + | CCM_ANALOG_PLL_ARM_DIV_SELECT(mult); + while (!(CCM_ANALOG->PLL_ARM & CCM_ANALOG_PLL_ARM_LOCK_L)) { + ; // wait for lock + } + } + + if ((CCM->CACRR & ((uint32_t)(0x07 << 0))) != (div_arm - 1)) { + CCM->CACRR = CCM_CACRR_ARM_PODF(div_arm - 1); + while (CCM->CDHIPR & CCM_CDHIPR_ARM_PODF_BUSY_L) { + ; // wait + } + } + + if ((cbcdr & ((uint32_t)(0x07 << 10))) != CCM_CBCDR_AHB_PODF(div_ahb - 1)) { + cbcdr &= ~((uint32_t)(0x07 << 10)); + cbcdr |= CCM_CBCDR_AHB_PODF(div_ahb - 1); + CCM->CBCDR = cbcdr; + while (CCM->CDHIPR & CCM_CDHIPR_AHB_PODF_BUSY_L) { + ; // wait + } + } + + uint32_t div_ipg = (frequency + 149999999) / 150000000; + if (div_ipg > 4) { + div_ipg = 4; + } + if ((cbcdr & ((uint32_t)(0x03 << 8))) != (CCM_CBCDR_IPG_PODF(div_ipg - 1))) { + cbcdr &= ~((uint32_t)(0x03 << 8)); + cbcdr |= CCM_CBCDR_IPG_PODF(div_ipg - 1); + // TODO: how to safely change IPG_PODF ?? + CCM->CBCDR = cbcdr; + } + + // cbcdr &= ~CCM_CBCDR_PERIPH_CLK_SEL; + // CCM_CBCDR = cbcdr; // why does this not work at 24 MHz? + CCM->CBCDR &= ~((uint32_t)(1 << 25)); + while (CCM->CDHIPR & CCM_CDHIPR_PERIPH_CLK_SEL_BUSY_L) { + ; // wait + + } + F_CPU_ACTUAL = frequency; + F_BUS_ACTUAL = frequency / div_ipg; + // scale_cpu_cycles_to_microseconds = 0xFFFFFFFFu / (uint32_t)(frequency / 1000000u); + + // if voltage needs to decrease, do it after switch clock speed + if ((dcdc & ((uint32_t)(0x1F << 0))) > ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) { + dcdc &= ~((uint32_t)(0x1F << 0)); + dcdc |= ((uint32_t)(0x1F << 0)); + DCDC->REG3 = dcdc; + while (!(DCDC->REG0 & DCDC_REG0_STS_DC_OK_L)) { + ; // wait voltage settling + } + } + + return frequency; +} diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h index ccbba2edd4..54f0e37b8f 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/clocks.h @@ -27,3 +27,4 @@ extern uint32_t SystemCoreClock; void clocks_init(void); +uint32_t setarmclock(uint32_t frequency); diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index fe10b73116..fbf0e8a9d8 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -46,9 +46,6 @@ #include "supervisor/background_callback.h" -#if CIRCUITPY_GAMEPADSHIFT -#include "shared-module/gamepadshift/__init__.h" -#endif #if CIRCUITPY_PEW #include "shared-module/_pew/PewPew.h" #endif @@ -294,9 +291,6 @@ void reset_port(void) { rtc_reset(); #endif - #if CIRCUITPY_GAMEPADSHIFT - gamepadshift_reset(); - #endif #if CIRCUITPY_PEW pew_reset(); #endif @@ -398,6 +392,13 @@ void port_interrupt_after_ticks(uint32_t ticks) { void port_idle_until_interrupt(void) { // App note here: https://www.nxp.com/docs/en/application-note/AN12085.pdf + // Currently I have disabled the setting into wait mode as this impacts lots of different + // subsystems and it is unclear if you can or should set it generically without having + // a better understanding of user intent. For example by default it will kill PWM + // when in this mode, unless PWM_CTRL2_WAITEN_MASK is set, and even with this set + // it may not work properly if the same timer/subtimer is trying to PWM on multiple channels. + // Maybe at later date, revisit after we have a better understanding on things like which + // timers it impacts and how each subsystem is configured. // Clear the FPU interrupt because it can prevent us from sleeping. if (__get_FPSCR() & ~(0x9f)) { @@ -408,13 +409,7 @@ void port_idle_until_interrupt(void) { common_hal_mcu_disable_interrupts(); if (!background_callback_pending()) { NVIC_ClearPendingIRQ(SNVS_HP_WRAPPER_IRQn); - // Don't down clock on debug builds because it prevents the DAP from - // reading memory - #if CIRCUITPY_DEBUG == 0 - CLOCK_SetMode(kCLOCK_ModeWait); - #endif __WFI(); - CLOCK_SetMode(kCLOCK_ModeRun); } common_hal_mcu_enable_interrupts(); } diff --git a/ports/mimxrt10xx/supervisor/serial.c b/ports/mimxrt10xx/supervisor/serial.c index b3c37b077d..cb557d36a8 100644 --- a/ports/mimxrt10xx/supervisor/serial.c +++ b/ports/mimxrt10xx/supervisor/serial.c @@ -26,27 +26,26 @@ * THE SOFTWARE. */ +#include "supervisor/serial.h" #include "py/mphal.h" #include -#include "supervisor/serial.h" #include "fsl_clock.h" #include "fsl_lpuart.h" -// TODO: Switch this to using DEBUG_UART. - +#if defined(CIRCUITPY_CONSOLE_UART) // static LPUART_Type *uart_instance = LPUART1; // evk static LPUART_Type *uart_instance = LPUART4; // feather 1011 // static LPUART_Type *uart_instance = LPUART2; // feather 1062 - static uint32_t UartSrcFreq(void) { uint32_t freq; - /* To make it simple, we assume default PLL and divider settings, and the only variable - from application is use PLL3 source or OSC source */ + /* To make it simple, we assume default PLL and divider settings, and the only + variable from application is use PLL3 source or OSC source */ /* PLL3 div6 80M */ if (CLOCK_GetMux(kCLOCK_UartMux) == 0) { - freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); + freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / + (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); } else { freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U); } @@ -88,3 +87,4 @@ void port_serial_write_substring(const char *text, uint32_t len) { LPUART_WriteBlocking(uart_instance, (uint8_t *)text, len); } +#endif // CIRCUITPY_CONSOLE_UART diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 6db2b547c5..bbe102ffc8 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -91,7 +91,6 @@ ifeq ($(DEBUG), 1) else OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions CFLAGS += -DNDEBUG -ggdb3 - CFLAGS += -flto -flto-partition=none endif ifeq ($(NRF_DEBUG_PRINT), 1) diff --git a/ports/nrf/bluetooth/ble_drv.c b/ports/nrf/bluetooth/ble_drv.c index f5d2f96715..cf3f9382d7 100644 --- a/ports/nrf/bluetooth/ble_drv.c +++ b/ports/nrf/bluetooth/ble_drv.c @@ -35,6 +35,7 @@ #include "nrf_sdm.h" #include "nrf_soc.h" #include "nrfx_power.h" +#include "py/gc.h" #include "py/misc.h" #include "py/mpstate.h" @@ -56,6 +57,17 @@ void ble_drv_reset() { sd_flash_operation_status = SD_FLASH_OPERATION_DONE; } +void ble_drv_remove_heap_handlers(void) { + ble_drv_evt_handler_entry_t *it = MP_STATE_VM(ble_drv_evt_handler_entries); + while (it != NULL) { + // If the param is on the heap, then delete the handler. + if (HEAP_PTR(it->param)) { + ble_drv_remove_event_handler(it->func, it->param); + } + it = it->next; + } +} + void ble_drv_add_event_handler_entry(ble_drv_evt_handler_entry_t *entry, ble_drv_evt_handler_t func, void *param) { ble_drv_evt_handler_entry_t *it = MP_STATE_VM(ble_drv_evt_handler_entries); while (it != NULL) { diff --git a/ports/nrf/bluetooth/ble_drv.h b/ports/nrf/bluetooth/ble_drv.h index e7649fceee..798e70e1fb 100644 --- a/ports/nrf/bluetooth/ble_drv.h +++ b/ports/nrf/bluetooth/ble_drv.h @@ -67,6 +67,7 @@ typedef struct ble_drv_evt_handler_entry { } ble_drv_evt_handler_entry_t; void ble_drv_reset(void); +void ble_drv_remove_heap_handlers(void); void ble_drv_add_event_handler(ble_drv_evt_handler_t func, void *param); void ble_drv_remove_event_handler(ble_drv_evt_handler_t func, void *param); diff --git a/ports/nrf/boards/ADM_B_NRF52840_1/board.c b/ports/nrf/boards/ADM_B_NRF52840_1/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/ADM_B_NRF52840_1/board.c +++ b/ports/nrf/boards/ADM_B_NRF52840_1/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/Seeed_XIAO_nRF52840_Sense/board.c b/ports/nrf/boards/Seeed_XIAO_nRF52840_Sense/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/Seeed_XIAO_nRF52840_Sense/board.c +++ b/ports/nrf/boards/Seeed_XIAO_nRF52840_Sense/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/TG-Watch/board.c b/ports/nrf/boards/TG-Watch/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/TG-Watch/board.c +++ b/ports/nrf/boards/TG-Watch/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/TG-Watch/mpconfigboard.mk b/ports/nrf/boards/TG-Watch/mpconfigboard.mk index 8a191c1534..212ab7edc2 100644 --- a/ports/nrf/boards/TG-Watch/mpconfigboard.mk +++ b/ports/nrf/boards/TG-Watch/mpconfigboard.mk @@ -8,7 +8,6 @@ MCU_CHIP = nrf52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q128JVxQ" -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ST7789 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Display_Shapes diff --git a/ports/nrf/boards/adafruit_led_glasses_nrf52840/board.c b/ports/nrf/boards/adafruit_led_glasses_nrf52840/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/adafruit_led_glasses_nrf52840/board.c +++ b/ports/nrf/boards/adafruit_led_glasses_nrf52840/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/aramcon2_badge/board.c b/ports/nrf/boards/aramcon2_badge/board.c index 6eb1789284..f8424734fb 100644 --- a/ports/nrf/boards/aramcon2_badge/board.c +++ b/ports/nrf/boards/aramcon2_badge/board.c @@ -26,18 +26,5 @@ */ #include "supervisor/board.h" -#include "common-hal/microcontroller/Pin.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/aramcon_badge_2019/board.c b/ports/nrf/boards/aramcon_badge_2019/board.c index 2ac061613a..32d1ca9483 100644 --- a/ports/nrf/boards/aramcon_badge_2019/board.c +++ b/ports/nrf/boards/aramcon_badge_2019/board.c @@ -26,18 +26,5 @@ */ #include "supervisor/board.h" -#include "common-hal/microcontroller/Pin.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/arduino_nano_33_ble/board.c b/ports/nrf/boards/arduino_nano_33_ble/board.c index 2f2c5e8388..0b6aa8f0db 100644 --- a/ports/nrf/boards/arduino_nano_33_ble/board.c +++ b/ports/nrf/boards/arduino_nano_33_ble/board.c @@ -53,14 +53,3 @@ void board_init(void) { // digitalWrite(PIN_ENABLE_SENSORS_3V3, HIGH); // digitalWrite(PIN_ENABLE_I2C_PULLUP, HIGH); } - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} diff --git a/ports/nrf/boards/bastble/board.c b/ports/nrf/boards/bastble/board.c index bcf952c89f..fb1ce4fb83 100644 --- a/ports/nrf/boards/bastble/board.c +++ b/ports/nrf/boards/bastble/board.c @@ -25,20 +25,5 @@ */ #include "supervisor/board.h" -#include "nrf.h" -#include "nrf_rtc.h" -void board_init(void) { - -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/bless_dev_board_multi_sensor/board.c b/ports/nrf/boards/bless_dev_board_multi_sensor/board.c index 5b0bdf1e1c..fb1ce4fb83 100644 --- a/ports/nrf/boards/bless_dev_board_multi_sensor/board.c +++ b/ports/nrf/boards/bless_dev_board_multi_sensor/board.c @@ -1,15 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 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" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/bluemicro833/board.c b/ports/nrf/boards/bluemicro833/board.c index 104cea6274..c96bc6a996 100644 --- a/ports/nrf/boards/bluemicro833/board.c +++ b/ports/nrf/boards/bluemicro833/board.c @@ -56,10 +56,4 @@ void board_deinit(void) { nrf_gpio_pin_write(POWER_SWITCH_PIN->number, false); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/bluemicro833/mpconfigboard.mk b/ports/nrf/boards/bluemicro833/mpconfigboard.mk index 23c04ed47c..6108f23102 100644 --- a/ports/nrf/boards/bluemicro833/mpconfigboard.mk +++ b/ports/nrf/boards/bluemicro833/mpconfigboard.mk @@ -7,46 +7,10 @@ MCU_CHIP = nrf52833 INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_AESIO = 0 -CIRCUITPY_ALARM = 0 CIRCUITPY_AUDIOBUSIO = 0 -#CIRCUITPY_AUDIOCORE = 0 -#CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOMIXER = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BINASCII = 0 -CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_BITMAPTOOLS = 0 -CIRCUITPY_BUILTINS_POW3=0 -CIRCUITPY_BUSDEVICE = 0 -CIRCUITPY_COUNTIO = 0 -CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_JSON = 0 CIRCUITPY_KEYPAD = 1 -CIRCUITPY_MSGPACK = 0 -#CIRCUITPY_NEOPIXEL_WRITE = 1 -CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_NVM = 0 +CIRCUITPY_ONEWIREIO = 0 CIRCUITPY_PIXELBUF = 1 -CIRCUITPY_PULSEIO = 1 -CIRCUITPY_RE = 0 -CIRCUITPY_RGBMATRIX = 0 -CIRCUITPY_SDCARDIO = 0 -CIRCUITPY_SYNTHIO = 0 -CIRCUITPY_TRACEBACK = 0 CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_TRACEBACK = 0 -CIRCUITPY_ULAB = 0 -CIRCUITPY_USB_MIDI = 0 -CIRCUITPY_VECTORIO = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - -SUPEROPT_GC = 0 -SUPEROPT_VM = 0 - -# Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os diff --git a/ports/nrf/boards/bluemicro840/board.c b/ports/nrf/boards/bluemicro840/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/bluemicro840/board.c +++ b/ports/nrf/boards/bluemicro840/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/challenger_840/board.c b/ports/nrf/boards/challenger_840/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/challenger_840/board.c +++ b/ports/nrf/boards/challenger_840/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/challenger_840/mpconfigboard.mk b/ports/nrf/boards/challenger_840/mpconfigboard.mk index a72bd34857..ddb55ce705 100644 --- a/ports/nrf/boards/challenger_840/mpconfigboard.mk +++ b/ports/nrf/boards/challenger_840/mpconfigboard.mk @@ -6,4 +6,4 @@ USB_MANUFACTURER = "Invector Labs AB" MCU_CHIP = nrf52840 SPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ,W25Q32FV,W25Q64FV" diff --git a/ports/nrf/boards/circuitplayground_bluefruit/board.c b/ports/nrf/boards/circuitplayground_bluefruit/board.c index 938d92aff1..412b249844 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/board.c +++ b/ports/nrf/boards/circuitplayground_bluefruit/board.c @@ -54,10 +54,8 @@ void board_deinit(void) { nrf_gpio_pin_write(POWER_SWITCH_PIN->number, true); } -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { board_reset_user_neopixels(&pin_P0_13, 10); } + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index f2e648f473..92ea3fefeb 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -84,22 +84,12 @@ void board_init(void) { sizeof(display_init_sequence), &pin_P1_05, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // not SH1107 -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { + false, // not SH1107 + 50000); // backlight pwm frequency } diff --git a/ports/nrf/boards/electronut_labs_blip/board.c b/ports/nrf/boards/electronut_labs_blip/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/electronut_labs_blip/board.c +++ b/ports/nrf/boards/electronut_labs_blip/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk index 2b46f4397a..0e3b1b9048 100644 --- a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk +++ b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk @@ -5,6 +5,8 @@ USB_MANUFACTURER = "Electronut Labs" MCU_CHIP = nrf52840 +CIRCUITPY_BUILD_EXTENSIONS = hex + INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_DISPLAYIO = 1 diff --git a/ports/nrf/boards/electronut_labs_papyr/board.c b/ports/nrf/boards/electronut_labs_papyr/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/electronut_labs_papyr/board.c +++ b/ports/nrf/boards/electronut_labs_papyr/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/feather_bluefruit_sense/board.c b/ports/nrf/boards/feather_bluefruit_sense/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/feather_bluefruit_sense/board.c +++ b/ports/nrf/boards/feather_bluefruit_sense/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/feather_nrf52840_express/board.c b/ports/nrf/boards/feather_nrf52840_express/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/feather_nrf52840_express/board.c +++ b/ports/nrf/boards/feather_nrf52840_express/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/hiibot_bluefi/board.c b/ports/nrf/boards/hiibot_bluefi/board.c index 9616596caa..e5fc4279f8 100644 --- a/ports/nrf/boards/hiibot_bluefi/board.c +++ b/ports/nrf/boards/hiibot_bluefi/board.c @@ -85,22 +85,12 @@ void board_init(void) { sizeof(display_init_sequence), &pin_P1_13, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { + false, // SH1107_addressing + 50000); // backlight pwm frequency } diff --git a/ports/nrf/boards/ikigaisense_vita/board.c b/ports/nrf/boards/ikigaisense_vita/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/ikigaisense_vita/board.c +++ b/ports/nrf/boards/ikigaisense_vita/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/itsybitsy_nrf52840_express/board.c b/ports/nrf/boards/itsybitsy_nrf52840_express/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/itsybitsy_nrf52840_express/board.c +++ b/ports/nrf/boards/itsybitsy_nrf52840_express/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/board.c b/ports/nrf/boards/makerdiary_m60_keyboard/board.c index b4070e72dc..8074c895dc 100644 --- a/ports/nrf/boards/makerdiary_m60_keyboard/board.c +++ b/ports/nrf/boards/makerdiary_m60_keyboard/board.c @@ -26,16 +26,5 @@ #include "supervisor/board.h" -void board_init(void) { -} -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c index 87c9b2f226..ce4241c9da 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c @@ -85,22 +85,12 @@ void board_init(void) { sizeof(display_init_sequence), &pin_P0_20, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { + false, // SH1107_addressing + 50000); // backlight pwm frequency } diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/board.c b/ports/nrf/boards/makerdiary_nrf52840_mdk/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk/board.c +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk index 7da9ed1896..887bf0a7da 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.mk @@ -5,5 +5,7 @@ USB_MANUFACTURER = "makerdiary" MCU_CHIP = nrf52840 +CIRCUITPY_BUILD_EXTENSIONS = hex + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "MX25R6435F" diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/board.c b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/board.c +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk index c4fa121744..1a650d5d4d 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk @@ -5,4 +5,6 @@ USB_MANUFACTURER = "makerdiary" MCU_CHIP = nrf52840 +CIRCUITPY_BUILD_EXTENSIONS = hex,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/metro_nrf52840_express/board.c b/ports/nrf/boards/metro_nrf52840_express/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/metro_nrf52840_express/board.c +++ b/ports/nrf/boards/metro_nrf52840_express/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/microbit_v2/board.c b/ports/nrf/boards/microbit_v2/board.c index b87b342823..331653173e 100644 --- a/ports/nrf/boards/microbit_v2/board.c +++ b/ports/nrf/boards/microbit_v2/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/microbit_v2/mpconfigboard.h b/ports/nrf/boards/microbit_v2/mpconfigboard.h index bae49dfae2..eba5af6c22 100644 --- a/ports/nrf/boards/microbit_v2/mpconfigboard.h +++ b/ports/nrf/boards/microbit_v2/mpconfigboard.h @@ -52,5 +52,6 @@ #define BOOTLOADER_SETTING_SIZE (0) #define BOARD_HAS_32KHZ_XTAL (0) -#define CIRCUITPY_DEBUG_UART_TX (&pin_P0_06) -#define CIRCUITPY_DEBUG_UART_RX (&pin_P1_08) + +#define CIRCUITPY_CONSOLE_UART_TX (&pin_P0_06) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_P1_08) diff --git a/ports/nrf/boards/microbit_v2/mpconfigboard.mk b/ports/nrf/boards/microbit_v2/mpconfigboard.mk index dc47f2be4e..d0430ea403 100644 --- a/ports/nrf/boards/microbit_v2/mpconfigboard.mk +++ b/ports/nrf/boards/microbit_v2/mpconfigboard.mk @@ -3,33 +3,9 @@ CIRCUITPY_CREATION_ID = 0x80D8 MCU_CHIP = nrf52833 +CIRCUITPY_BUILD_EXTENSIONS = combined.hex + INTERNAL_FLASH_FILESYSTEM = 1 -CIRCUITPY_ALARM = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_BUILTINS_POW3=0 -CIRCUITPY_BUSDEVICE = 0 -CIRCUITPY_COUNTIO = 0 -CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_JSON = 0 -CIRCUITPY_KEYPAD = 0 -CIRCUITPY_MSGPACK = 0 -CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NVM = 0 -CIRCUITPY_PIXELBUF = 0 -CIRCUITPY_RE = 0 -CIRCUITPY_RGBMATRIX = 0 -CIRCUITPY_SDCARDIO = 0 -CIRCUITPY_ULAB = 0 +# USB pins aren't used. CIRCUITPY_USB = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - -# Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os -SUPEROPT_VM = 0 -SUPEROPT_GC = 0 diff --git a/ports/nrf/boards/nice_nano/board.c b/ports/nrf/boards/nice_nano/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/nice_nano/board.c +++ b/ports/nrf/boards/nice_nano/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index dd0a9b2547..30c066d91e 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -84,22 +84,12 @@ void board_init(void) { sizeof(display_init_sequence), &pin_P0_02, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second false, // backlight_on_high - false); // SH1107_addressing -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { + false, // SH1107_addressing + 50000); // backlight pwm frequency } diff --git a/ports/nrf/boards/particle_argon/board.c b/ports/nrf/boards/particle_argon/board.c index 0aee79f590..7180deb278 100644 --- a/ports/nrf/boards/particle_argon/board.c +++ b/ports/nrf/boards/particle_argon/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/particle_boron/board.c b/ports/nrf/boards/particle_boron/board.c index 0aee79f590..7180deb278 100644 --- a/ports/nrf/boards/particle_boron/board.c +++ b/ports/nrf/boards/particle_boron/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/particle_xenon/board.c b/ports/nrf/boards/particle_xenon/board.c index 0aee79f590..7180deb278 100644 --- a/ports/nrf/boards/particle_xenon/board.c +++ b/ports/nrf/boards/particle_xenon/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/pca10056/board.c b/ports/nrf/boards/pca10056/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/pca10056/board.c +++ b/ports/nrf/boards/pca10056/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/pca10056/mpconfigboard.mk b/ports/nrf/boards/pca10056/mpconfigboard.mk index 48f68a30ae..b30e6ee7a2 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.mk +++ b/ports/nrf/boards/pca10056/mpconfigboard.mk @@ -5,5 +5,7 @@ USB_MANUFACTURER = "Nordic Semiconductor" MCU_CHIP = nrf52840 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = "MX25R6435F" diff --git a/ports/nrf/boards/pca10059/board.c b/ports/nrf/boards/pca10059/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/pca10059/board.c +++ b/ports/nrf/boards/pca10059/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/pca10059/mpconfigboard.mk b/ports/nrf/boards/pca10059/mpconfigboard.mk index 9dc3cc71ed..fe702a50c9 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.mk +++ b/ports/nrf/boards/pca10059/mpconfigboard.mk @@ -5,4 +5,6 @@ USB_MANUFACTURER = "Nordic Semiconductor" MCU_CHIP = nrf52840 +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 + INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/pca10100/board.c b/ports/nrf/boards/pca10100/board.c index 0aee79f590..7180deb278 100644 --- a/ports/nrf/boards/pca10100/board.c +++ b/ports/nrf/boards/pca10100/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 59f2b217c3..356eb16f11 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -6,37 +6,3 @@ USB_MANUFACTURER = "Nordic Semiconductor" MCU_CHIP = nrf52833 INTERNAL_FLASH_FILESYSTEM = 1 - -CIRCUITPY_AESIO = 0 -CIRCUITPY_ALARM = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BINASCII = 0 -CIRCUITPY_BITBANGIO = 0 -CIRCUITPY_BITMAPTOOLS = 0 -CIRCUITPY_BUSDEVICE = 0 -CIRCUITPY_COUNTIO = 0 -CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_JSON = 0 -CIRCUITPY_KEYPAD = 0 -CIRCUITPY_MSGPACK = 0 -CIRCUITPY_NEOPIXEL_WRITE = 0 -CIRCUITPY_NVM = 0 -CIRCUITPY_PIXELBUF = 0 -CIRCUITPY_RE = 0 -CIRCUITPY_RGBMATRIX = 0 -CIRCUITPY_SDCARDIO = 0 -CIRCUITPY_SYNTHIO = 0 -CIRCUITPY_ULAB = 0 -CIRCUITPY_USB_MIDI = 0 -CIRCUITPY_VECTORIO = 0 - -MICROPY_PY_ASYNC_AWAIT = 0 - -SUPEROPT_GC = 0 -SUPEROPT_VM = 0 - -# Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os diff --git a/ports/nrf/boards/pitaya_go/board.c b/ports/nrf/boards/pitaya_go/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/pitaya_go/board.c +++ b/ports/nrf/boards/pitaya_go/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/raytac_mdbt50q-db-40/board.c b/ports/nrf/boards/raytac_mdbt50q-db-40/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/raytac_mdbt50q-db-40/board.c +++ b/ports/nrf/boards/raytac_mdbt50q-db-40/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/raytac_mdbt50q-rx/board.c b/ports/nrf/boards/raytac_mdbt50q-rx/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/raytac_mdbt50q-rx/board.c +++ b/ports/nrf/boards/raytac_mdbt50q-rx/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/simmel/board.c b/ports/nrf/boards/simmel/board.c index 0aee79f590..7180deb278 100644 --- a/ports/nrf/boards/simmel/board.c +++ b/ports/nrf/boards/simmel/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 67f5dfbd6d..20a50ac700 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -13,40 +13,18 @@ INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_ALARM = 0 CIRCUITPY_AESIO = 1 CIRCUITPY_AUDIOMIXER = 0 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_BITMAPTOOLS = 0 -CIRCUITPY_BUSDEVICE = 0 -CIRCUITPY_BUSIO = 1 -CIRCUITPY_COUNTIO = 0 -CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_ERRNO = 0 -CIRCUITPY_FRAMEBUFFERIO = 0 -CIRCUITPY_GETPASS = 0 -CIRCUITPY_KEYPAD = 0 -CIRCUITPY_MSGPACK = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ONEWIREIO = 0 -CIRCUITPY_PIXELBUF = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_PWMIO = 1 # Deliberately excluded for other reasons than code space, see #5534 CIRCUITPY_RAINBOWIO = 0 -CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_RTC = 1 -CIRCUITPY_SDCARDIO = 0 -CIRCUITPY_SYNTHIO = 0 CIRCUITPY_TOUCHIO = 0 -CIRCUITPY_ULAB = 0 CIRCUITPY_USB_CDC = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_WATCHDOG = 1 # Enable micropython.native #CIRCUITPY_ENABLE_MPY_NATIVE = 1 - -# Override optimization to keep binary small -OPTIMIZATION_FLAGS = -Os -SUPEROPT_VM = 0 -SUPEROPT_GC = 0 diff --git a/ports/nrf/boards/sparkfun_nrf52840_micromod/board.c b/ports/nrf/boards/sparkfun_nrf52840_micromod/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_micromod/board.c +++ b/ports/nrf/boards/sparkfun_nrf52840_micromod/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/board.c b/ports/nrf/boards/sparkfun_nrf52840_mini/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/board.c +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/ssci_isp1807_dev_board/board.c b/ports/nrf/boards/ssci_isp1807_dev_board/board.c index 8d8e531d47..c8bd7e0b35 100644 --- a/ports/nrf/boards/ssci_isp1807_dev_board/board.c +++ b/ports/nrf/boards/ssci_isp1807_dev_board/board.c @@ -28,16 +28,4 @@ #include "nrf.h" #include "nrf_rtc.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/ssci_isp1807_micro_board/board.c b/ports/nrf/boards/ssci_isp1807_micro_board/board.c index 8d8e531d47..c8bd7e0b35 100644 --- a/ports/nrf/boards/ssci_isp1807_micro_board/board.c +++ b/ports/nrf/boards/ssci_isp1807_micro_board/board.c @@ -28,16 +28,4 @@ #include "nrf.h" #include "nrf_rtc.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/teknikio_bluebird/board.c b/ports/nrf/boards/teknikio_bluebird/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/teknikio_bluebird/board.c +++ b/ports/nrf/boards/teknikio_bluebird/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/tinkeringtech_scoutmakes_azul/board.c b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/tinkeringtech_scoutmakes_azul/board.c +++ b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/warmbit_bluepixel/board.c b/ports/nrf/boards/warmbit_bluepixel/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/nrf/boards/warmbit_bluepixel/board.c +++ b/ports/nrf/boards/warmbit_bluepixel/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 288cf2f217..49b5d638f3 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -52,6 +52,10 @@ #include "shared-bindings/_bleio/ScanEntry.h" #include "shared-bindings/time/__init__.h" +#if CIRCUITPY_DOTENV +#include "shared-module/dotenv/__init__.h" +#endif + #define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_MAX_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_SLAVE_LATENCY 0 @@ -329,18 +333,30 @@ STATIC void get_address(bleio_adapter_obj_t *self, ble_gap_addr_t *address) { char default_ble_name[] = { 'C', 'I', 'R', 'C', 'U', 'I', 'T', 'P', 'Y', 0, 0, 0, 0, 0}; STATIC void bleio_adapter_reset_name(bleio_adapter_obj_t *self) { - uint8_t len = sizeof(default_ble_name) - 1; - - ble_gap_addr_t local_address; - get_address(self, &local_address); - - default_ble_name[len - 4] = nibble_to_hex_lower[local_address.addr[1] >> 4 & 0xf]; - default_ble_name[len - 3] = nibble_to_hex_lower[local_address.addr[1] & 0xf]; - default_ble_name[len - 2] = nibble_to_hex_lower[local_address.addr[0] >> 4 & 0xf]; - default_ble_name[len - 1] = nibble_to_hex_lower[local_address.addr[0] & 0xf]; + // setup the default name + ble_gap_addr_t addr; // local_address + get_address(self, &addr); + mp_int_t len = sizeof(default_ble_name) - 1; + default_ble_name[len - 4] = nibble_to_hex_lower[addr.addr[1] >> 4 & 0xf]; + default_ble_name[len - 3] = nibble_to_hex_lower[addr.addr[1] & 0xf]; + default_ble_name[len - 2] = nibble_to_hex_lower[addr.addr[0] >> 4 & 0xf]; + default_ble_name[len - 1] = nibble_to_hex_lower[addr.addr[0] & 0xf]; default_ble_name[len] = '\0'; // for now we add null for compatibility with C ASCIIZ strings - common_hal_bleio_adapter_set_name(self, (char *)default_ble_name); + mp_int_t name_len = 0; + + #if CIRCUITPY_DOTENV + char ble_name[32]; + name_len = dotenv_get_key("/.env", "CIRCUITPY_BLE_NAME", ble_name, sizeof(ble_name) - 1); + if (name_len > 0) { + ble_name[name_len] = '\0'; + common_hal_bleio_adapter_set_name(self, (char *)ble_name); + } + #endif + + if (name_len <= 0) { + common_hal_bleio_adapter_set_name(self, (char *)default_ble_name); + } } static void bluetooth_adapter_background(void *data) { @@ -433,22 +449,34 @@ bool common_hal_bleio_adapter_set_address(bleio_adapter_obj_t *self, bleio_addre return sd_ble_gap_addr_set(&local_address) == NRF_SUCCESS; } +uint16_t bleio_adapter_get_name(char *buf, uint16_t len) { + uint16_t full_len = 0; + sd_ble_gap_device_name_get(NULL, &full_len); + + uint32_t err_code = sd_ble_gap_device_name_get((uint8_t *)buf, &len); + if (err_code != NRF_SUCCESS) { + return 0; + } + return full_len; +} + mp_obj_str_t *common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self) { uint16_t len = 0; sd_ble_gap_device_name_get(NULL, &len); - uint8_t buf[len]; - uint32_t err_code = sd_ble_gap_device_name_get(buf, &len); - if (err_code != NRF_SUCCESS) { - return NULL; - } - return mp_obj_new_str((char *)buf, len); + char buf[len]; + bleio_adapter_get_name(buf, len); + return mp_obj_new_str(buf, len); } void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char *name) { ble_gap_conn_sec_mode_t sec; sec.lv = 0; sec.sm = 0; - sd_ble_gap_device_name_set(&sec, (const uint8_t *)name, strlen(name)); + uint16_t len = strlen(name); + if (len > BLE_GAP_DEVNAME_MAX_LEN) { + len = BLE_GAP_DEVNAME_MAX_LEN; + } + sd_ble_gap_device_name_set(&sec, (const uint8_t *)name, len); } STATIC uint32_t _update_identities(bool is_central) { diff --git a/ports/nrf/common-hal/_bleio/PacketBuffer.c b/ports/nrf/common-hal/_bleio/PacketBuffer.c index f7d35cbdb5..38dcdd9041 100644 --- a/ports/nrf/common-hal/_bleio/PacketBuffer.c +++ b/ports/nrf/common-hal/_bleio/PacketBuffer.c @@ -380,9 +380,11 @@ mp_int_t common_hal_bleio_packet_buffer_write(bleio_packet_buffer_obj_t *self, c !mp_hal_is_interrupted()) { RUN_BACKGROUND_TASKS; } + if (mp_hal_is_interrupted()) { + return -1; + } } - if (self->conn_handle == BLE_CONN_HANDLE_INVALID || - mp_hal_is_interrupted()) { + if (self->conn_handle == BLE_CONN_HANDLE_INVALID) { return -1; } diff --git a/ports/nrf/common-hal/_bleio/__init__.c b/ports/nrf/common-hal/_bleio/__init__.c index e02cf306af..718b28c7fe 100644 --- a/ports/nrf/common-hal/_bleio/__init__.c +++ b/ports/nrf/common-hal/_bleio/__init__.c @@ -94,6 +94,17 @@ void check_sec_status(uint8_t sec_status) { } } +void bleio_user_reset() { + // Stop any user scanning or advertising. + common_hal_bleio_adapter_stop_scan(&common_hal_bleio_adapter_obj); + common_hal_bleio_adapter_stop_advertising(&common_hal_bleio_adapter_obj); + + ble_drv_remove_heap_handlers(); + + // Maybe start advertising the BLE workflow. + supervisor_bluetooth_background(); +} + // Turn off BLE on a reset or reload. void bleio_reset() { // Set this explicitly to save data. @@ -174,7 +185,12 @@ STATIC bool _on_gattc_read_rsp_evt(ble_evt_t *ble_evt, void *param) { } break; } - + case BLE_GAP_EVT_DISCONNECTED: { + read->conn_handle = BLE_CONN_HANDLE_INVALID; + read->done = true; + return false; + break; + } default: // For debugging. // mp_printf(&mp_plat_print, "Unhandled characteristic event: 0x%04x\n", ble_evt->header.evt_id); @@ -208,6 +224,8 @@ size_t common_hal_bleio_gattc_read(uint16_t handle, uint16_t conn_handle, uint8_ while (!read_info.done) { RUN_BACKGROUND_TASKS; } + // Test if we were disconnected while reading + common_hal_bleio_check_connected(read_info.conn_handle); ble_drv_remove_event_handler(_on_gattc_read_rsp_evt, &read_info); check_gatt_status(read_info.status); diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index 92dac1c789..75f616c805 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -96,7 +96,7 @@ static const char *cause_str[] = { "VBUS", "RESETPIN", }; -void print_wakeup_cause(nrf_sleep_source_t cause) { +static void print_wakeup_cause(nrf_sleep_source_t cause) { if (cause >= 0 && cause < NRF_SLEEP_WAKEUP_ZZZ) { mp_printf(&mp_plat_print, "wakeup cause = NRF_SLEEP_WAKEUP_%s\r\n", cause_str[(int)cause]); @@ -108,7 +108,7 @@ bool common_hal_alarm_woken_from_sleep(void) { nrf_sleep_source_t cause = _get_wakeup_cause(); #ifdef NRF_DEBUG_PRINT if (cause != NRF_SLEEP_WAKEUP_UNDEFINED) { - // print_wakeup_cause(cause); + print_wakeup_cause(cause); } #endif return cause == NRF_SLEEP_WAKEUP_GPIO || cause == NRF_SLEEP_WAKEUP_TIMER @@ -247,7 +247,10 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj return wake_alarm; } -void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms) { +void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms, size_t n_dios, digitalio_digitalinout_obj_t **preserve_dios) { + if (n_dios > 0) { + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_preserve_dios); + } _setup_sleep_alarms(true, n_alarms, alarms); } diff --git a/ports/nrf/common-hal/alarm/pin/PinAlarm.c b/ports/nrf/common-hal/alarm/pin/PinAlarm.c index 4bf412d85b..9d0f8f4b88 100644 --- a/ports/nrf/common-hal/alarm/pin/PinAlarm.c +++ b/ports/nrf/common-hal/alarm/pin/PinAlarm.c @@ -49,10 +49,10 @@ extern uint32_t reset_reason_saved; void common_hal_alarm_pin_pinalarm_construct(alarm_pin_pinalarm_obj_t *self, const mcu_pin_obj_t *pin, bool value, bool edge, bool pull) { if (edge) { - mp_raise_ValueError(translate("Cannot wake on pin edge. Only level.")); + mp_raise_ValueError(translate("Cannot wake on pin edge, only level")); } if (pin->number >= NUMBER_OF_PINS) { - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); } self->pin = pin; self->value = value; diff --git a/ports/nrf/common-hal/alarm/time/TimeAlarm.c b/ports/nrf/common-hal/alarm/time/TimeAlarm.c index c5f3bfd705..03b91068f9 100644 --- a/ports/nrf/common-hal/alarm/time/TimeAlarm.c +++ b/ports/nrf/common-hal/alarm/time/TimeAlarm.c @@ -85,7 +85,7 @@ void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_ continue; } if (timealarm_set) { - mp_raise_ValueError(translate("Only one alarm.time alarm can be set.")); + mp_raise_ValueError(translate("Only one alarm.time alarm can be set")); } timealarm = MP_OBJ_TO_PTR(alarms[i]); timealarm_set = true; diff --git a/ports/nrf/common-hal/analogio/AnalogIn.c b/ports/nrf/common-hal/analogio/AnalogIn.c index c64e51ec09..b9d4b6a199 100644 --- a/ports/nrf/common-hal/analogio/AnalogIn.c +++ b/ports/nrf/common-hal/analogio/AnalogIn.c @@ -27,8 +27,9 @@ #include "common-hal/analogio/AnalogIn.h" #include "shared-bindings/analogio/AnalogIn.h" +#include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "nrf_saadc.h" #include "nrf_gpio.h" @@ -48,7 +49,7 @@ void analogin_init(void) { void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin) { if (pin->adc_channel == 0) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } nrf_gpio_cfg_default(pin->number); @@ -76,7 +77,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { // Something else might have used the ADC in a different way, // so we completely re-initialize it. - nrf_saadc_value_t value; + nrf_saadc_value_t value = -1; const nrf_saadc_channel_config_t config = { .resistor_p = NRF_SAADC_RESISTOR_DISABLED, @@ -124,8 +125,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { value = 0; } - // Map value to from 14 to 16 bits - return value << 2; + // Stretch 14-bit ADC reading to 16-bit range + return (value << 2) | (value >> 12); } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { diff --git a/ports/nrf/common-hal/analogio/AnalogOut.c b/ports/nrf/common-hal/analogio/AnalogOut.c index 7afa773d30..38ff935674 100644 --- a/ports/nrf/common-hal/analogio/AnalogOut.c +++ b/ports/nrf/common-hal/analogio/AnalogOut.c @@ -31,10 +31,10 @@ #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { - mp_raise_RuntimeError(translate("AnalogOut functionality not supported")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index c3da519454..bc6302cb42 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/tick.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // TODO: This should be the same size as PWMOut.c:pwms[], but there's no trivial way to accomplish that STATIC audiopwmio_pwmaudioout_obj_t *active_audio[4]; @@ -263,9 +263,8 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t *self, &spacing); self->sample_channel_count = audiosample_channel_count(sample); - if (max_buffer_length > UINT16_MAX) { - mp_raise_ValueError_varg(translate("Buffer length %d too big. It must be less than %d"), max_buffer_length, UINT16_MAX); - } + mp_arg_validate_length_max(max_buffer_length, UINT16_MAX, MP_QSTR_buffer); + uint16_t buffer_length = (uint16_t)max_buffer_length; self->buffers[0] = m_malloc(buffer_length * 2 * sizeof(uint16_t), false); if (!self->single_buffer) { diff --git a/ports/nrf/common-hal/busio/I2C.c b/ports/nrf/common-hal/busio/I2C.c index 322b5f2faa..2bd1416f5a 100644 --- a/ports/nrf/common-hal/busio/I2C.c +++ b/ports/nrf/common-hal/busio/I2C.c @@ -29,9 +29,10 @@ #include "shared-bindings/busio/I2C.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "nrfx_twim.h" #include "nrfx_spim.h" @@ -96,7 +97,7 @@ static uint8_t twi_error_to_mp(const nrfx_err_t err) { void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint32_t frequency, uint32_t timeout) { if (scl->number == sda->number) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } // Find a free instance. diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 132f5d9272..ae8389fd9e 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -33,7 +33,7 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "nrfx_uarte.h" #include "nrf_gpio.h" @@ -164,12 +164,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte *receiver_buffer, bool sigint_enabled) { - if (bits != 8) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } + mp_arg_validate_int(bits, 8, MP_QSTR_bits); if ((rs485_dir != NULL) || (rs485_invert)) { - mp_raise_ValueError(translate("RS485 Not yet supported on this device")); + mp_raise_NotImplementedError(translate("RS485")); } // Find a free UART peripheral. @@ -189,9 +187,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_raise_ValueError(translate("tx and rx cannot both be None")); } - if (receiver_buffer_size == 0) { - mp_raise_ValueError(translate("Invalid buffer size")); - } + mp_arg_validate_int_min(receiver_buffer_size, 1, MP_QSTR_receiver_buffer_size); if (parity == BUSIO_UART_PARITY_ODD) { mp_raise_ValueError(translate("Odd parity is not supported")); @@ -234,7 +230,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // (This is a macro.) } else if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { nrfx_uarte_uninit(self->uarte); - mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); + m_malloc_fail(receiver_buffer_size); } self->rx_pin_number = rx->number; @@ -341,6 +337,11 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t NVIC_EnableIRQ(nrfx_get_irq_number(self->uarte->p_reg)); + if (rx_bytes == 0) { + *errcode = EAGAIN; + return MP_STREAM_ERROR; + } + return rx_bytes; } diff --git a/ports/nrf/common-hal/digitalio/DigitalInOut.c b/ports/nrf/common-hal/digitalio/DigitalInOut.c index b42d7dc704..95e488f3b7 100644 --- a/ports/nrf/common-hal/digitalio/DigitalInOut.c +++ b/ports/nrf/common-hal/digitalio/DigitalInOut.c @@ -26,7 +26,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "nrf_gpio.h" diff --git a/ports/nrf/common-hal/microcontroller/Processor.c b/ports/nrf/common-hal/microcontroller/Processor.c index fa2dfad6a4..2fca3a3c0a 100644 --- a/ports/nrf/common-hal/microcontroller/Processor.c +++ b/ports/nrf/common-hal/microcontroller/Processor.c @@ -31,7 +31,6 @@ #include "common-hal/alarm/__init__.h" #include "shared-bindings/microcontroller/ResetReason.h" -#include "supervisor/shared/translate.h" #include "nrfx_saadc.h" #ifdef BLUETOOTH_SD @@ -72,7 +71,7 @@ uint32_t common_hal_mcu_processor_get_frequency(void) { } float common_hal_mcu_processor_get_voltage(void) { - nrf_saadc_value_t value; + nrf_saadc_value_t value = -1; const nrf_saadc_channel_config_t config = { .resistor_p = NRF_SAADC_RESISTOR_DISABLED, diff --git a/ports/nrf/common-hal/neopixel_write/__init__.c b/ports/nrf/common-hal/neopixel_write/__init__.c index 6f012fa35b..ce8ee8c7cf 100644 --- a/ports/nrf/common-hal/neopixel_write/__init__.c +++ b/ports/nrf/common-hal/neopixel_write/__init__.c @@ -53,13 +53,16 @@ // The PWM starts the duty cycle in LOW. To start with HIGH we // need to set the 15th bit on each register. +// *** CircuitPython: Use WS2812 for all, works with https://adafru.it/5225 and everything else +// *** + // WS2812 (rev A) timing is 0.35 and 0.7us -// #define MAGIC_T0H 5UL | (0x8000) // 0.3125us -// #define MAGIC_T1H 12UL | (0x8000) // 0.75us +#define MAGIC_T0H 5UL | (0x8000) // 0.3125us +#define MAGIC_T1H 12UL | (0x8000) // 0.75us // WS2812B (rev B) timing is 0.4 and 0.8 us -#define MAGIC_T0H 6UL | (0x8000) // 0.375us -#define MAGIC_T1H 13UL | (0x8000) // 0.8125us +// #define MAGIC_T0H 6UL | (0x8000) // 0.375us +// #define MAGIC_T1H 13UL | (0x8000) // 0.8125us #define CTOPVAL 20UL // 1.25us // ---------- END Constants for the EasyDMA implementation ------------- diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index 84545f5293..757c56a4ac 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -103,7 +103,7 @@ static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action if (self->len < self->maxlen) { self->len++; } else { - self->start++; + self->start = (self->start + 1) % self->maxlen; } } @@ -129,7 +129,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t), false); if (self->buffer == NULL) { - mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), maxlen * sizeof(uint16_t)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } if (refcount == 0) { @@ -271,7 +271,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_ if (!self->paused) { nrfx_gpiote_in_event_enable(self->pin, true); } - mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); + mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; diff --git a/ports/nrf/common-hal/pulseio/PulseOut.c b/ports/nrf/common-hal/pulseio/PulseOut.c index 1c3c317a05..c2d59ffdba 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.c +++ b/ports/nrf/common-hal/pulseio/PulseOut.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "shared-bindings/pulseio/PulseOut.h" #include "shared-bindings/pwmio/PWMOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // A single timer is shared amongst all PulseOut objects under the assumption that // the code is single threaded. @@ -74,6 +74,11 @@ static void pulseout_event_handler(nrf_timer_event_t event_type, void *p_context nrfx_timer_pause(timer); pulse_array_index++; + // Ignore a zero-length pulse + while (pulse_array_index < pulse_array_length && + pulse_array[pulse_array_index] == 0) { + pulse_array_index++; + } // No more pulses. Turn off output and don't restart. if (pulse_array_index >= pulse_array_length) { diff --git a/ports/nrf/common-hal/pwmio/PWMOut.c b/ports/nrf/common-hal/pwmio/PWMOut.c index 76c8c4e6d4..1bd38e7a6e 100644 --- a/ports/nrf/common-hal/pwmio/PWMOut.c +++ b/ports/nrf/common-hal/pwmio/PWMOut.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "common-hal/pwmio/PWMOut.h" #include "shared-bindings/pwmio/PWMOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "nrf_gpio.h" @@ -108,6 +108,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 } } @@ -296,7 +297,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t fr uint16_t countertop; nrf_pwm_clk_t base_clock; if (frequency == 0 || !convert_frequency(frequency, &countertop, &base_clock)) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } self->frequency = frequency; diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index 0b7115a14f..29d308eccc 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -33,7 +33,7 @@ #include "common-hal/rtc/RTC.h" #include "shared-bindings/rtc/RTC.h" #include "supervisor/port.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // This is the time in seconds since 2000 that the RTC was started. __attribute__((section(".uninitialized"))) static uint32_t rtc_offset[3]; @@ -80,5 +80,5 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); } diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 1a12c20f2d..04c4f3bce6 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -4,6 +4,8 @@ LD_TEMPLATE_FILE = boards/common.template.ld INTERNAL_LIBM = 1 +CIRCUITPY_BUILD_EXTENSIONS ?= uf2 + # Number of USB endpoint pairs. USB_NUM_ENDPOINT_PAIRS = 8 @@ -25,19 +27,14 @@ CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_BLEIO ?= 1 # No I2CPeripheral implementation -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 0 CIRCUITPY_RTC ?= 1 # frequencyio not yet implemented CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_RGBMATRIX ?= 1 CIRCUITPY_ROTARYIO_SOFTENCODER = 1 -CIRCUITPY_FRAMEBUFFERIO ?= 1 - -CIRCUITPY_COUNTIO ?= 1 -CIRCUITPY_WATCHDOG ?= 1 # Sleep and Wakeup CIRCUITPY_ALARM ?= 1 @@ -60,6 +57,12 @@ MCU_SUB_VARIANT = nrf52840 # Fits on nrf52840 but space is tight on nrf52833. CIRCUITPY_AESIO ?= 1 +CIRCUITPY_RGBMATRIX ?= 1 +CIRCUITPY_FRAMEBUFFERIO ?= 1 + +CIRCUITPY_COUNTIO ?= 1 +CIRCUITPY_WATCHDOG ?= 1 + SD ?= s140 SOFTDEV_VERSION ?= 6.1.0 @@ -71,17 +74,37 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 # Defined here because system_nrf52840.c doesn't #include any of our own include files. CFLAGS += -DCONFIG_NFCT_PINS_AS_GPIOS +ifeq ($(INTERNAL_FLASH_FILESYSTEM),1) + OPTIMIZATION_FLAGS ?= -Os + CIRCUITPY_LTO = 1 + CIRCUITPY_LTO_PARTITION = balanced +endif + else ifeq ($(MCU_CHIP),nrf52833) MCU_SERIES = m4 MCU_VARIANT = nrf52 MCU_SUB_VARIANT = nrf52833 +# Need the space +SUPEROPT_GC ?= 0 +SUPEROPT_VM ?= 0 + +CIRCUITPY_SYNTHIO ?= 0 + SD ?= s140 SOFTDEV_VERSION ?= 7.0.1 BOOT_SETTING_ADDR = 0x7F000 NRF_DEFINES += -DNRF52833_XXAA -DNRF52833 +OPTIMIZATION_FLAGS ?= -Os + +CIRCUITPY_LTO = 1 +CIRCUITPY_LTO_PARTITION = one +ifeq ($(INTERNAL_FLASH_FILESYSTEM),1) + CIRCUITPY_FULL_BUILD ?= 0 + CIRCUITPY_PULSEIO ?= 1 +endif endif endif diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 5c1139271d..0ed1ecd547 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -246,10 +246,6 @@ void reset_port(void) { timers_reset(); - #if CIRCUITPY_BLEIO - bleio_reset(); - #endif - #if CIRCUITPY_WATCHDOG watchdog_reset(); #endif @@ -408,9 +404,3 @@ void HardFault_Handler(void) { asm ("nop;"); } } - -#if CIRCUITPY_ALARM -// in case boards/xxx/board.c does not provide board_deinit() -MP_WEAK void board_deinit(void) { -} -#endif diff --git a/ports/raspberrypi/audio_dma.c b/ports/raspberrypi/audio_dma.c index b7e5a0db44..7fef1a52e0 100644 --- a/ports/raspberrypi/audio_dma.c +++ b/ports/raspberrypi/audio_dma.c @@ -29,6 +29,7 @@ #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/audiocore/WaveFile.h" #include "shared-bindings/microcontroller/__init__.h" +#include "bindings/rp2pio/StateMachine.h" #include "supervisor/background_callback.h" #include "py/mpstate.h" @@ -324,7 +325,9 @@ void audio_dma_stop(audio_dma_t *dma) { channel_mask |= 1 << dma->channel[1]; } dma_hw->inte0 &= ~channel_mask; - irq_set_mask_enabled(1 << DMA_IRQ_0, false); + if (!dma_hw->inte0) { + irq_set_mask_enabled(1 << DMA_IRQ_0, false); + } // Run any remaining audio tasks because we remove ourselves from // playing_audio. @@ -442,12 +445,23 @@ STATIC void dma_callback_fun(void *arg) { void isr_dma_0(void) { for (size_t i = 0; i < NUM_DMA_CHANNELS; i++) { uint32_t mask = 1 << i; - if ((dma_hw->intr & mask) != 0 && MP_STATE_PORT(playing_audio)[i] != NULL) { + if ((dma_hw->intr & mask) == 0) { + continue; + } + // acknowledge interrupt early. Doing so late means that you could lose an + // interrupt if the buffer is very small and the DMA operation + // completed by the time callback_add() / dma_complete() returned. This + // affected PIO continuous write more than audio. + dma_hw->ints0 = mask; + if (MP_STATE_PORT(playing_audio)[i] != NULL) { audio_dma_t *dma = MP_STATE_PORT(playing_audio)[i]; // Record all channels whose DMA has completed; they need loading. dma->channels_to_load_mask |= mask; background_callback_add(&dma->callback, dma_callback_fun, (void *)dma); - dma_hw->ints0 = mask; + } + if (MP_STATE_PORT(background_pio)[i] != NULL) { + rp2pio_statemachine_obj_t *pio = MP_STATE_PORT(background_pio)[i]; + rp2pio_statemachine_dma_complete(pio, i); } } } diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index fb13821e35..be87a47ec5 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -40,7 +40,7 @@ #include "py/mperrno.h" #include "py/objproperty.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class StateMachine: @@ -79,6 +79,8 @@ //| initial_sideset_pin_state: int = 0, //| initial_sideset_pin_direction: int = 0x1f, //| sideset_enable: bool = False, +//| jmp_pin: Optional[microcontroller.Pin] = None, +//| jmp_pin_pull: Optional[digitalio.Pull] = None, //| exclusive_pin_use: bool = True, //| auto_pull: bool = False, //| pull_threshold: int = 32, @@ -87,12 +89,15 @@ //| auto_push: bool = False, //| push_threshold: int = 32, //| in_shift_right: bool = True, -//| user_interruptible: bool = True) -> None: +//| user_interruptible: bool = True, +//| wrap_target: int = 0, +//| wrap: int = -1, +//| ) -> None: //| //| """Construct a StateMachine object on the given pins with the given program. //| //| :param ReadableBuffer program: the program to run with the state machine -//| :param int frequency: the target clock frequency of the state machine. Actual may be less. +//| :param int frequency: the target clock frequency of the state machine. Actual may be less. Use 0 for system clock speed. //| :param ReadableBuffer init: a program to run once at start up. This is run after program //| is started so instructions may be intermingled //| :param ~microcontroller.Pin first_out_pin: the first pin to use with the OUT instruction @@ -113,6 +118,7 @@ //| :param int initial_sideset_pin_direction: the initial output direction for sideset pins starting at first_sideset_pin //| :param bool sideset_enable: True when the top sideset bit is to enable. This should be used with the ".side_set # opt" directive //| :param ~microcontroller.Pin jmp_pin: the pin which determines the branch taken by JMP PIN instructions +//| :param ~digitalio.Pull jmp_pin_pull: The pull value for the jmp pin, default is no pull. //| :param bool exclusive_pin_use: When True, do not share any pins with other state machines. Pins are never shared with other peripherals //| :param bool auto_pull: When True, automatically load data from the tx FIFO into the //| output shift register (OSR) when an OUT instruction shifts more than pull_threshold bits @@ -136,6 +142,10 @@ //| that causes an infinite loop, you will be able to interrupt the loop. //| However, if you are writing to a device that can get into a bad state if a read or write //| is interrupted, you may want to set this to False after your program has been vetted. +//| :param int wrap_target: The target instruction number of automatic wrap. Defaults to the first instruction of the program. +//| :param int wrap: The instruction after which to wrap to the ``wrap`` +//| instruction. As a special case, -1 (the default) indicates the +//| last instruction of the program. //| """ //| ... //| @@ -150,12 +160,14 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n ARG_first_set_pin, ARG_set_pin_count, ARG_initial_set_pin_state, ARG_initial_set_pin_direction, ARG_first_sideset_pin, ARG_sideset_pin_count, ARG_initial_sideset_pin_state, ARG_initial_sideset_pin_direction, ARG_sideset_enable, - ARG_jmp_pin, + ARG_jmp_pin, ARG_jmp_pin_pull, ARG_exclusive_pin_use, ARG_auto_pull, ARG_pull_threshold, ARG_out_shift_right, ARG_wait_for_txstall, ARG_auto_push, ARG_push_threshold, ARG_in_shift_right, - ARG_user_interruptible,}; + ARG_user_interruptible, + ARG_wrap_target, + ARG_wrap,}; static const mp_arg_t allowed_args[] = { { MP_QSTR_program, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_frequency, MP_ARG_REQUIRED | MP_ARG_INT }, @@ -184,6 +196,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n { MP_QSTR_sideset_enable, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, { MP_QSTR_jmp_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_jmp_pin_pull, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, { MP_QSTR_exclusive_pin_use, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, { MP_QSTR_auto_pull, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, @@ -194,6 +207,9 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n { MP_QSTR_push_threshold, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 32} }, { MP_QSTR_in_shift_right, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, { MP_QSTR_user_interruptible, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} }, + + { MP_QSTR_wrap_target, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, + { MP_QSTR_wrap, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = -1} }, }; 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); @@ -207,53 +223,38 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n // We don't validate pin in use here because we may be ok sharing them within a PIO. const mcu_pin_obj_t *first_out_pin = validate_obj_is_pin_or_none(args[ARG_first_out_pin].u_obj); - if (args[ARG_out_pin_count].u_int < 1) { - mp_raise_ValueError(translate("Pin count must be at least 1")); - } + mp_int_t out_pin_count = mp_arg_validate_int_min(args[ARG_out_pin_count].u_int, 1, MP_QSTR_out_pin_count); + const mcu_pin_obj_t *first_in_pin = validate_obj_is_pin_or_none(args[ARG_first_in_pin].u_obj); - if (args[ARG_in_pin_count].u_int < 1) { - mp_raise_ValueError(translate("Pin count must be at least 1")); - } + mp_int_t in_pin_count = mp_arg_validate_int_min(args[ARG_in_pin_count].u_int, 1, MP_QSTR_in_pin_count); + const mcu_pin_obj_t *first_set_pin = validate_obj_is_pin_or_none(args[ARG_first_set_pin].u_obj); - if (args[ARG_set_pin_count].u_int < 1) { - mp_raise_ValueError(translate("Pin count must be at least 1")); - } - if (args[ARG_set_pin_count].u_int > 5) { - mp_raise_ValueError(translate("Set pin count must be between 1 and 5")); - } + mp_int_t set_pin_count = mp_arg_validate_int_range(args[ARG_set_pin_count].u_int, 1, 5, MP_QSTR_set_pin_count); + const mcu_pin_obj_t *first_sideset_pin = validate_obj_is_pin_or_none(args[ARG_first_sideset_pin].u_obj); - if (args[ARG_sideset_pin_count].u_int < 1) { - mp_raise_ValueError(translate("Pin count must be at least 1")); - } - if (args[ARG_sideset_pin_count].u_int > 5) { - mp_raise_ValueError(translate("Side set pin count must be between 1 and 5")); - } + mp_int_t sideset_pin_count = mp_arg_validate_int_range(args[ARG_sideset_pin_count].u_int, 1, 5, MP_QSTR_set_pin_count); const mcu_pin_obj_t *jmp_pin = validate_obj_is_pin_or_none(args[ARG_jmp_pin].u_obj); + digitalio_pull_t jmp_pin_pull = validate_pull(args[ARG_jmp_pin_pull].u_rom_obj, MP_QSTR_jmp_pull); - mp_int_t pull_threshold = args[ARG_pull_threshold].u_int; - mp_int_t push_threshold = args[ARG_push_threshold].u_int; - if (pull_threshold < 1 || pull_threshold > 32) { - mp_raise_ValueError(translate("pull_threshold must be between 1 and 32")); - } - if (push_threshold < 1 || push_threshold > 32) { - mp_raise_ValueError(translate("push_threshold must be between 1 and 32")); - } + mp_int_t pull_threshold = + mp_arg_validate_int_range(args[ARG_pull_threshold].u_int, 1, 32, MP_QSTR_pull_threshold); + mp_int_t push_threshold = + mp_arg_validate_int_range(args[ARG_push_threshold].u_int, 1, 32, MP_QSTR_push_threshold); - if (bufinfo.len < 2) { - mp_raise_ValueError(translate("Program must contain at least one 16-bit instruction.")); - } + mp_arg_validate_length_range(bufinfo.len, 2, 64, MP_QSTR_program); if (bufinfo.len % 2 != 0) { mp_raise_ValueError(translate("Program size invalid")); } - if (bufinfo.len > 64) { - mp_raise_ValueError(translate("Program too large")); - } + mp_arg_validate_length_range(init_bufinfo.len, 0, 64, MP_QSTR_init); if (init_bufinfo.len % 2 != 0) { mp_raise_ValueError(translate("Init program size invalid")); } + int wrap = args[ARG_wrap].u_int; + int wrap_target = args[ARG_wrap_target].u_int; + common_hal_rp2pio_statemachine_construct(self, bufinfo.buf, bufinfo.len / 2, args[ARG_frequency].u_int, @@ -263,13 +264,14 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n first_set_pin, args[ARG_set_pin_count].u_int, args[ARG_initial_set_pin_state].u_int, args[ARG_initial_set_pin_direction].u_int, first_sideset_pin, args[ARG_sideset_pin_count].u_int, args[ARG_initial_sideset_pin_state].u_int, args[ARG_initial_sideset_pin_direction].u_int, args[ARG_sideset_enable].u_bool, - jmp_pin, + jmp_pin, jmp_pin_pull, 0, args[ARG_exclusive_pin_use].u_bool, args[ARG_auto_pull].u_bool, pull_threshold, args[ARG_out_shift_right].u_bool, args[ARG_wait_for_txstall].u_bool, args[ARG_auto_push].u_bool, push_threshold, args[ARG_in_shift_right].u_bool, - args[ARG_user_interruptible].u_bool); + args[ARG_user_interruptible].u_bool, + wrap_target, wrap); return MP_OBJ_FROM_PTR(self); } @@ -357,7 +359,7 @@ STATIC mp_obj_t rp2pio_statemachine_stop(mp_obj_t self_obj) { } MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop); -//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: +//| def write(self, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None, swap: bool = False) -> None: //| """Write the data contained in ``buffer`` to the state machine. If the buffer is empty, nothing happens. //| //| Writes to the FIFO will match the input buffer's element size. For example, bytearray elements @@ -369,15 +371,17 @@ MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_obj, rp2pio_statemachine_stop //| //| :param ~circuitpython_typing.ReadableBuffer buffer: Write out the data in this buffer //| :param int start: Start of the slice of ``buffer`` to write out: ``buffer[start:end]`` -//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" +//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` +//| :param bool swap: For 2- and 4-byte elements, swap (reverse) the byte order""" //| ... //| STATIC mp_obj_t rp2pio_statemachine_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_buffer, ARG_start, ARG_end }; + enum { ARG_buffer, ARG_start, ARG_end, ARG_swap }; static const mp_arg_t allowed_args[] = { { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, + { MP_QSTR_swap, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, }; rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -399,7 +403,7 @@ STATIC mp_obj_t rp2pio_statemachine_write(size_t n_args, const mp_obj_t *pos_arg mp_raise_ValueError(translate("Buffer elements must be 4 bytes long or less")); } - bool ok = common_hal_rp2pio_statemachine_write(self, ((uint8_t *)bufinfo.buf) + start, length, stride_in_bytes); + bool ok = common_hal_rp2pio_statemachine_write(self, ((uint8_t *)bufinfo.buf) + start, length, stride_in_bytes, args[ARG_swap].u_bool); if (mp_hal_is_interrupted()) { return mp_const_none; } @@ -410,8 +414,151 @@ STATIC mp_obj_t rp2pio_statemachine_write(size_t n_args, const mp_obj_t *pos_arg } MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine_write); +//| def background_write(self, once: Optional[ReadableBuffer]=None, *, loop: Optional[ReadableBuffer]=None, swap: bool=False) -> None: +//| """Write data to the TX fifo in the background, with optional looping. +//| +//| First, if any previous ``once`` or ``loop`` buffer has not been started, this function blocks until they have. +//| This means that any ``once`` or ``loop`` buffer will be written at least once. +//| Then the ``once`` and/or ``loop`` buffers are queued. and the function returns. +//| The ``once`` buffer (if specified) will be written just once. +//| Finally, the ``loop`` buffer (if specified) will continue being looped indefinitely. +//| +//| Writes to the FIFO will match the input buffer's element size. For example, bytearray elements +//| will perform 8 bit writes to the PIO FIFO. The RP2040's memory bus will duplicate the value into +//| the other byte positions. So, pulling more data in the PIO assembly will read the duplicated values. +//| +//| To perform 16 or 32 bits writes into the FIFO use an `array.array` with a type code of the desired +//| size, or use `memoryview.cast` to change the interpretation of an +//| existing buffer. To send just part of a larger buffer, slice a `memoryview` +//| of it. +//| +//| If a buffer is modified while it is being written out, the updated +//| values will be used. However, because of interactions between CPU +//| writes, DMA and the PIO FIFO are complex, it is difficult to predict +//| the result of modifying multiple values. Instead, alternate between +//| a pair of buffers. +//| +//| Having both a ``once`` and a ``loop`` parameter is to support a special case in PWM generation +//| where a change in duty cycle requires a special transitional buffer to be used exactly once. Most +//| use cases will probably only use one of ``once`` or ``loop``. +//| +//| Having neither ``once`` nor ``loop`` terminates an existing +//| background looping write after exactly a whole loop. This is in contrast to +//| `stop_background_write`, which interrupts an ongoing DMA operation. +//| +//| :param ~Optional[circuitpython_typing.ReadableBuffer] once: Data to be written once +//| :param ~Optional[circuitpython_typing.ReadableBuffer] loop: Data to be written repeatedly +//| :param bool swap: For 2- and 4-byte elements, swap (reverse) the byte order +//| """ +//| ... +//| -//| def readinto(self, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: +STATIC void fill_buf_info(sm_buf_info *info, mp_obj_t obj, size_t *stride_in_bytes) { + if (obj != mp_const_none) { + info->obj = obj; + mp_get_buffer_raise(obj, &info->info, MP_BUFFER_READ); + size_t stride = mp_binary_get_size('@', info->info.typecode, NULL); + if (stride > 4) { + mp_raise_ValueError(translate("Buffer elements must be 4 bytes long or less")); + } + if (*stride_in_bytes && stride != *stride_in_bytes) { + mp_raise_ValueError(translate("Mismatched data size")); + } + *stride_in_bytes = stride; + } else { + memset(info, 0, sizeof(*info)); + } +} + +STATIC mp_obj_t rp2pio_statemachine_background_write(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_once, ARG_loop, ARG_swap }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_once, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_loop, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, + { MP_QSTR_swap, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, + }; + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + check_for_deinit(self); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + sm_buf_info once_info; + sm_buf_info loop_info; + size_t stride_in_bytes = 0; + fill_buf_info(&once_info, args[ARG_once].u_obj, &stride_in_bytes); + fill_buf_info(&loop_info, args[ARG_loop].u_obj, &stride_in_bytes); + if (!stride_in_bytes) { + return mp_const_none; + } + + bool ok = common_hal_rp2pio_statemachine_background_write(self, &once_info, &loop_info, stride_in_bytes, args[ARG_swap].u_bool); + + if (mp_hal_is_interrupted()) { + return mp_const_none; + } + if (!ok) { + mp_raise_OSError(MP_EIO); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_background_write_obj, 1, rp2pio_statemachine_background_write); + +//| def stop_background_write(self) -> None: +//| """Immediately stop a background write, if one is in progress. Any +//| DMA in progress is halted, but items already in the TX FIFO are not +//| affected.""" +//| +STATIC mp_obj_t rp2pio_statemachine_obj_stop_background_write(mp_obj_t self_in) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); + bool ok = common_hal_rp2pio_statemachine_stop_background_write(self); + if (mp_hal_is_interrupted()) { + return mp_const_none; + } + if (!ok) { + mp_raise_OSError(MP_EIO); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_stop_background_write_obj, rp2pio_statemachine_obj_stop_background_write); + +//| @property +//| def writing(self) -> bool: +//| """Returns True if a background write is in progress""" +//| +STATIC mp_obj_t rp2pio_statemachine_obj_get_writing(mp_obj_t self_in) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_bool(common_hal_rp2pio_statemachine_get_writing(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_writing_obj, rp2pio_statemachine_obj_get_writing); + +const mp_obj_property_t rp2pio_statemachine_writing_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&rp2pio_statemachine_get_writing_obj, + MP_ROM_NONE, + MP_ROM_NONE}, +}; + + +//| @property +//| def pending(self) -> int: +//| """Returns the number of pending buffers for background writing. +//| +//| If the number is 0, then a `StateMachine.background_write` call will not block.""" +//| +STATIC mp_obj_t rp2pio_statemachine_obj_get_pending(mp_obj_t self_in) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(common_hal_rp2pio_statemachine_get_pending(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_pending_obj, rp2pio_statemachine_obj_get_pending); + +const mp_obj_property_t rp2pio_statemachine_pending_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&rp2pio_statemachine_get_pending_obj, + MP_ROM_NONE, + MP_ROM_NONE}, +}; + +//| def readinto(self, buffer: WriteableBuffer, *, start: int = 0, end: Optional[int] = None, swap: bool=False) -> None: //| """Read into ``buffer``. If the number of bytes to read is 0, nothing happens. The buffer //| includes any data added to the fifo even if it was added before this was called. //| @@ -425,16 +572,18 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine //| //| :param ~circuitpython_typing.WriteableBuffer buffer: Read data into this buffer //| :param int start: Start of the slice of ``buffer`` to read into: ``buffer[start:end]`` -//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)``""" +//| :param int end: End of the slice; this index is not included. Defaults to ``len(buffer)`` +//| :param bool swap: For 2- and 4-byte elements, swap (reverse) the byte order""" //| ... //| STATIC mp_obj_t rp2pio_statemachine_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_buffer, ARG_start, ARG_end }; + enum { ARG_buffer, ARG_start, ARG_end, ARG_swap }; static const mp_arg_t allowed_args[] = { { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, + { MP_QSTR_swap, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, }; rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -457,7 +606,7 @@ STATIC mp_obj_t rp2pio_statemachine_readinto(size_t n_args, const mp_obj_t *pos_ mp_raise_ValueError(translate("Buffer elements must be 4 bytes long or less")); } - bool ok = common_hal_rp2pio_statemachine_readinto(self, ((uint8_t *)bufinfo.buf) + start, length, stride_in_bytes); + bool ok = common_hal_rp2pio_statemachine_readinto(self, ((uint8_t *)bufinfo.buf) + start, length, stride_in_bytes, args[ARG_swap].u_bool); if (!ok) { mp_raise_OSError(MP_EIO); } @@ -482,12 +631,14 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_readinto_obj, 2, rp2pio_statemach //| :param int out_start: Start of the slice of buffer_out to write out: ``buffer_out[out_start:out_end]`` //| :param int out_end: End of the slice; this index is not included. Defaults to ``len(buffer_out)`` //| :param int in_start: Start of the slice of ``buffer_in`` to read into: ``buffer_in[in_start:in_end]`` -//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)``""" +//| :param int in_end: End of the slice; this index is not included. Defaults to ``len(buffer_in)`` +//| :param bool swap_out: For 2- and 4-byte elements, swap (reverse) the byte order for the buffer being transmitted (written) +//| :param bool swap_in: For 2- and 4-rx elements, swap (reverse) the byte order for the buffer being received (read)""" //| ... //| STATIC mp_obj_t rp2pio_statemachine_write_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end }; + enum { ARG_buffer_out, ARG_buffer_in, ARG_out_start, ARG_out_end, ARG_in_start, ARG_in_end, ARG_swap_out, ARG_swap_in }; static const mp_arg_t allowed_args[] = { { MP_QSTR_buffer_out, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, { MP_QSTR_buffer_in, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, @@ -495,6 +646,8 @@ STATIC mp_obj_t rp2pio_statemachine_write_readinto(size_t n_args, const mp_obj_t { MP_QSTR_out_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, { MP_QSTR_in_start, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, { MP_QSTR_in_end, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = INT_MAX} }, + { MP_QSTR_swap_out, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, + { MP_QSTR_swap_in, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, }; rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -533,7 +686,7 @@ STATIC mp_obj_t rp2pio_statemachine_write_readinto(size_t n_args, const mp_obj_t out_stride_in_bytes, ((uint8_t *)buf_in_info.buf) + in_start, in_length, - in_stride_in_bytes); + in_stride_in_bytes, args[ARG_swap_out].u_bool, args[ARG_swap_in].u_bool); if (!ok) { mp_raise_OSError(MP_EIO); } @@ -552,6 +705,18 @@ STATIC mp_obj_t rp2pio_statemachine_obj_clear_rxfifo(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_clear_rxfifo_obj, rp2pio_statemachine_obj_clear_rxfifo); +//| def clear_txstall(self) -> None: +//| """Clears the txstall flag.""" +//| ... +//| +STATIC mp_obj_t rp2pio_statemachine_obj_clear_txstall(mp_obj_t self_in) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_rp2pio_statemachine_clear_txstall(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_clear_txstall_obj, rp2pio_statemachine_obj_clear_txstall); + + //| frequency: int //| """The actual state machine frequency. This may not match the frequency requested //| due to internal limitations.""" @@ -573,13 +738,30 @@ STATIC mp_obj_t rp2pio_statemachine_obj_set_frequency(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(rp2pio_statemachine_set_frequency_obj, rp2pio_statemachine_obj_set_frequency); -const mp_obj_property_t rp2pio_statemachine_frequency_obj = { +MP_PROPERTY_GETSET(rp2pio_statemachine_frequency_obj, + (mp_obj_t)&rp2pio_statemachine_get_frequency_obj, + (mp_obj_t)&rp2pio_statemachine_set_frequency_obj); + +//| txstall: bool +//| """True when the state machine has stalled due to a full TX FIFO since the last +//| `clear_txstall` call.""" +//| + +STATIC mp_obj_t rp2pio_statemachine_obj_get_txstall(mp_obj_t self_in) { + rp2pio_statemachine_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + return MP_OBJ_NEW_SMALL_INT(common_hal_rp2pio_statemachine_get_txstall(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_txstall_obj, rp2pio_statemachine_obj_get_txstall); + +const mp_obj_property_t rp2pio_statemachine_txstall_obj = { .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&rp2pio_statemachine_get_frequency_obj, - (mp_obj_t)&rp2pio_statemachine_set_frequency_obj, + .proxy = {(mp_obj_t)&rp2pio_statemachine_get_txstall_obj, + MP_ROM_NONE, MP_ROM_NONE}, }; + //| rxstall: bool //| """True when the state machine has stalled due to a full RX FIFO since the last //| `clear_rxfifo` call.""" @@ -592,12 +774,8 @@ STATIC mp_obj_t rp2pio_statemachine_obj_get_rxstall(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_rxstall_obj, rp2pio_statemachine_obj_get_rxstall); -const mp_obj_property_t rp2pio_statemachine_rxstall_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&rp2pio_statemachine_get_rxstall_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(rp2pio_statemachine_rxstall_obj, + (mp_obj_t)&rp2pio_statemachine_get_rxstall_obj); //| in_waiting: int //| """The number of words available to readinto""" @@ -610,12 +788,8 @@ STATIC mp_obj_t rp2pio_statemachine_obj_get_in_waiting(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(rp2pio_statemachine_get_in_waiting_obj, rp2pio_statemachine_obj_get_in_waiting); -const mp_obj_property_t rp2pio_statemachine_in_waiting_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&rp2pio_statemachine_get_in_waiting_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(rp2pio_statemachine_in_waiting_obj, + (mp_obj_t)&rp2pio_statemachine_get_in_waiting_obj); STATIC const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&rp2pio_statemachine_deinit_obj) }, @@ -626,13 +800,19 @@ STATIC const mp_rom_map_elem_t rp2pio_statemachine_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_restart), MP_ROM_PTR(&rp2pio_statemachine_restart_obj) }, { MP_ROM_QSTR(MP_QSTR_run), MP_ROM_PTR(&rp2pio_statemachine_run_obj) }, { MP_ROM_QSTR(MP_QSTR_clear_rxfifo), MP_ROM_PTR(&rp2pio_statemachine_clear_rxfifo_obj) }, + { MP_ROM_QSTR(MP_QSTR_clear_txstall), MP_ROM_PTR(&rp2pio_statemachine_clear_txstall_obj) }, { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&rp2pio_statemachine_readinto_obj) }, { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&rp2pio_statemachine_write_obj) }, { MP_ROM_QSTR(MP_QSTR_write_readinto), MP_ROM_PTR(&rp2pio_statemachine_write_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_background_write), MP_ROM_PTR(&rp2pio_statemachine_background_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_stop_background_write), MP_ROM_PTR(&rp2pio_statemachine_stop_background_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_writing), MP_ROM_PTR(&rp2pio_statemachine_writing_obj) }, + { MP_ROM_QSTR(MP_QSTR_pending), MP_ROM_PTR(&rp2pio_statemachine_pending_obj) }, { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&rp2pio_statemachine_frequency_obj) }, { MP_ROM_QSTR(MP_QSTR_rxstall), MP_ROM_PTR(&rp2pio_statemachine_rxstall_obj) }, + { MP_ROM_QSTR(MP_QSTR_txstall), MP_ROM_PTR(&rp2pio_statemachine_txstall_obj) }, { MP_ROM_QSTR(MP_QSTR_in_waiting), MP_ROM_PTR(&rp2pio_statemachine_in_waiting_obj) }, }; STATIC MP_DEFINE_CONST_DICT(rp2pio_statemachine_locals_dict, rp2pio_statemachine_locals_dict_table); diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.h b/ports/raspberrypi/bindings/rp2pio/StateMachine.h index 3f3b8cf7d8..3ec70a8703 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.h +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.h @@ -29,6 +29,7 @@ #include "py/obj.h" +#include "shared-bindings/digitalio/Pull.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/rp2pio/StateMachine.h" @@ -45,13 +46,14 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, const mcu_pin_obj_t *first_set_pin, uint8_t set_pin_count, uint32_t initial_set_pin_state, uint32_t initial_set_pin_direction, const mcu_pin_obj_t *first_sideset_pin, uint8_t sideset_pin_count, uint32_t initial_sideset_pin_state, uint32_t initial_sideset_pin_direction, bool sideset_enable, - const mcu_pin_obj_t *jmp_pin, + const mcu_pin_obj_t *jmp_pin, digitalio_pull_t jmp_pin_pull, uint32_t wait_gpio_mask, bool exclusive_pin_use, bool auto_pull, uint8_t pull_threshold, bool out_shift_right, bool wait_for_txstall, bool auto_push, uint8_t push_threshold, bool in_shift_right, - bool user_interruptible); + bool user_interruptible, + int wrap_taget, int wrap); void common_hal_rp2pio_statemachine_deinit(rp2pio_statemachine_obj_t *self); bool common_hal_rp2pio_statemachine_deinited(rp2pio_statemachine_obj_t *self); @@ -63,11 +65,15 @@ void common_hal_rp2pio_statemachine_stop(rp2pio_statemachine_obj_t *self); void common_hal_rp2pio_statemachine_run(rp2pio_statemachine_obj_t *self, const uint16_t *instructions, size_t len); // Writes out the given data. -bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len, uint8_t stride_in_bytes); -bool common_hal_rp2pio_statemachine_readinto(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t stride_in_bytes); +bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len, uint8_t stride_in_bytes, bool swap); +bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t *self, const sm_buf_info *once_obj, const sm_buf_info *loop_obj, uint8_t stride_in_bytes, bool swap); +bool common_hal_rp2pio_statemachine_stop_background_write(rp2pio_statemachine_obj_t *self); +mp_int_t common_hal_rp2pio_statemachine_get_pending(rp2pio_statemachine_obj_t *self); +bool common_hal_rp2pio_statemachine_get_writing(rp2pio_statemachine_obj_t *self); +bool common_hal_rp2pio_statemachine_readinto(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t stride_in_bytes, bool swap); bool common_hal_rp2pio_statemachine_write_readinto(rp2pio_statemachine_obj_t *self, const uint8_t *data_out, size_t out_len, uint8_t out_stride_in_bytes, - uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes); + uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes, bool swap_out, bool swap_in); // Return actual state machine frequency. uint32_t common_hal_rp2pio_statemachine_get_frequency(rp2pio_statemachine_obj_t *self); @@ -75,6 +81,8 @@ void common_hal_rp2pio_statemachine_set_frequency(rp2pio_statemachine_obj_t *sel bool common_hal_rp2pio_statemachine_get_rxstall(rp2pio_statemachine_obj_t *self); void common_hal_rp2pio_statemachine_clear_rxfifo(rp2pio_statemachine_obj_t *self); +bool common_hal_rp2pio_statemachine_get_txstall(rp2pio_statemachine_obj_t *self); +void common_hal_rp2pio_statemachine_clear_txstall(rp2pio_statemachine_obj_t *self); size_t common_hal_rp2pio_statemachine_get_in_waiting(rp2pio_statemachine_obj_t *self); void common_hal_rp2pio_statemachine_set_interrupt_handler(rp2pio_statemachine_obj_t *self, void (*handler)(void *), void *arg, int mask); diff --git a/ports/raspberrypi/bindings/rp2pio/__init__.c b/ports/raspberrypi/bindings/rp2pio/__init__.c index b3b45dc923..941ede2e12 100644 --- a/ports/raspberrypi/bindings/rp2pio/__init__.c +++ b/ports/raspberrypi/bindings/rp2pio/__init__.c @@ -30,7 +30,14 @@ #include "bindings/rp2pio/StateMachine.h" #include "bindings/rp2pio/__init__.h" -//| """Hardware interface to RP2 series' programmable IO (PIO) peripheral.""" +//| """Hardware interface to RP2 series' programmable IO (PIO) peripheral. +//| +//| .. note:: This module is intended to be used with the `adafruit_pioasm library +//| `_. For an +//| introduction and guide to working with PIO in CircuitPython, see `this +//| Learn guide `_. +//| +//| """ //| //| def pins_are_sequential(pins: List[microcontroller.Pin]) -> bool: diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040/board.c b/ports/raspberrypi/boards/adafruit_feather_rp2040/board.c index eac54ce460..331653173e 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040/board.c +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040/board.c @@ -26,18 +26,4 @@ #include "supervisor/board.h" -#include "shared-bindings/microcontroller/Pin.h" -#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_itsybitsy_rp2040/board.c b/ports/raspberrypi/boards/adafruit_itsybitsy_rp2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/adafruit_itsybitsy_rp2040/board.c +++ b/ports/raspberrypi/boards/adafruit_itsybitsy_rp2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_kb2040/board.c b/ports/raspberrypi/boards/adafruit_kb2040/board.c index eac54ce460..331653173e 100644 --- a/ports/raspberrypi/boards/adafruit_kb2040/board.c +++ b/ports/raspberrypi/boards/adafruit_kb2040/board.c @@ -26,18 +26,4 @@ #include "supervisor/board.h" -#include "shared-bindings/microcontroller/Pin.h" -#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c b/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c index 7b00ff7ecc..b5cef1639d 100644 --- a/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c +++ b/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c @@ -97,17 +97,13 @@ void board_init(void) { NULL, 0x81, 1.0f, // brightness - false, // auto_brightness true, // single_byte_bounds true, // data as commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - true); // SH1107_addressing -} - -bool board_requests_safe_mode(void) { - return false; + true, // SH1107_addressing + 50000); // backlight pwm frequency } void reset_board(void) { @@ -115,5 +111,4 @@ void reset_board(void) { board_reset_user_neopixels(&pin_GPIO19, 12); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_qt2040_trinkey/board.c b/ports/raspberrypi/boards/adafruit_qt2040_trinkey/board.c index eac54ce460..c94078ae60 100644 --- a/ports/raspberrypi/boards/adafruit_qt2040_trinkey/board.c +++ b/ports/raspberrypi/boards/adafruit_qt2040_trinkey/board.c @@ -29,15 +29,4 @@ #include "shared-bindings/microcontroller/Pin.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_qtpy_rp2040/board.c b/ports/raspberrypi/boards/adafruit_qtpy_rp2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/adafruit_qtpy_rp2040/board.c +++ b/ports/raspberrypi/boards/adafruit_qtpy_rp2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/arduino_nano_rp2040_connect/board.c b/ports/raspberrypi/boards/arduino_nano_rp2040_connect/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/arduino_nano_rp2040_connect/board.c +++ b/ports/raspberrypi/boards/arduino_nano_rp2040_connect/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/bwshockley_figpi/board.c b/ports/raspberrypi/boards/bwshockley_figpi/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/bwshockley_figpi/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/bwshockley_figpi/mpconfigboard.h b/ports/raspberrypi/boards/bwshockley_figpi/mpconfigboard.h new file mode 100644 index 0000000000..fbd03379dd --- /dev/null +++ b/ports/raspberrypi/boards/bwshockley_figpi/mpconfigboard.h @@ -0,0 +1,15 @@ +#define MICROPY_HW_BOARD_NAME "Fig Pi" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO13) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO1) + +#define CIRCUITPY_BOARD_I2C (2) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO17, .sda = &pin_GPIO16}, \ + {.scl = &pin_GPIO19, .sda = &pin_GPIO18}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO6, .mosi = &pin_GPIO7, .miso = &pin_GPIO4}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO24, .rx = &pin_GPIO25}} diff --git a/ports/raspberrypi/boards/bwshockley_figpi/mpconfigboard.mk b/ports/raspberrypi/boards/bwshockley_figpi/mpconfigboard.mk new file mode 100644 index 0000000000..95bd9715d6 --- /dev/null +++ b/ports/raspberrypi/boards/bwshockley_figpi/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x2019 +USB_PID = 0x7103 +USB_PRODUCT = "Fig Pi" +USB_MANUFACTURER = "Benjamin Shockley" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" diff --git a/ports/raspberrypi/boards/bwshockley_figpi/pico-sdk-configboard.h b/ports/raspberrypi/boards/bwshockley_figpi/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/bwshockley_figpi/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/bwshockley_figpi/pins.c b/ports/raspberrypi/boards/bwshockley_figpi/pins.c new file mode 100644 index 0000000000..1bec6fd91b --- /dev/null +++ b/ports/raspberrypi/boards/bwshockley_figpi/pins.c @@ -0,0 +1,62 @@ +#include "shared-bindings/board/__init__.h" + +CIRCUITPY_BOARD_BUS_SINGLETON(stemma_i2c, i2c, 1) + +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_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO29) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_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_STEMMA_I2C), MP_ROM_PTR(&board_stemma_i2c_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/board.c b/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/board.c +++ b/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/mpconfigboard.h b/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/mpconfigboard.h index 013b8e9276..a3f79af481 100644 --- a/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/mpconfigboard.h +++ b/ports/raspberrypi/boards/challenger_nb_rp2040_wifi/mpconfigboard.h @@ -5,6 +5,3 @@ #define DEFAULT_UART_BUS_RX (&pin_GPIO17) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) -#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22) -#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23) -#define DEFAULT_SPI_BUS_MISO (&pin_GPIO24) diff --git a/ports/raspberrypi/boards/challenger_rp2040_lora/board.c b/ports/raspberrypi/boards/challenger_rp2040_lora/board.c new file mode 100644 index 0000000000..b66ea0e27f --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Pontus Oldberg, Invector Labs + * + * 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/challenger_rp2040_lora/mpconfigboard.h b/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.h new file mode 100644 index 0000000000..a5245b98fe --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.h @@ -0,0 +1,10 @@ +#define MICROPY_HW_BOARD_NAME "Challenger RP2040 LoRa" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_UART_BUS_TX (&pin_GPIO16) +#define DEFAULT_UART_BUS_RX (&pin_GPIO17) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO20) diff --git a/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.mk b/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.mk new file mode 100644 index 0000000000..1150bfb331 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/mpconfigboard.mk @@ -0,0 +1,13 @@ +USB_VID = 0x2e8a +USB_PID = 0x1023 +USB_PRODUCT = "Challenger RP2040 LoRa" +USB_MANUFACTURER = "Invector Labs" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ" + +CIRCUITPY__EVE = 1 + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM9x diff --git a/ports/raspberrypi/boards/challenger_rp2040_lora/pico-sdk-configboard.h b/ports/raspberrypi/boards/challenger_rp2040_lora/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/challenger_rp2040_lora/pins.c b/ports/raspberrypi/boards/challenger_rp2040_lora/pins.c new file mode 100644 index 0000000000..0eff192f9f --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_lora/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_SDA), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + + // RFM95W connections + { MP_ROM_QSTR(MP_QSTR_RFM95W_CS), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_SCK), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_SDO), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_SDI), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_RST), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_DIO0), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_DIO1), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_RFM95W_DIO2), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_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/challenger_rp2040_lte/board.c b/ports/raspberrypi/boards/challenger_rp2040_lte/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/challenger_rp2040_lte/board.c +++ b/ports/raspberrypi/boards/challenger_rp2040_lte/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/challenger_rp2040_subghz/board.c b/ports/raspberrypi/boards/challenger_rp2040_subghz/board.c new file mode 100644 index 0000000000..b66ea0e27f --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_subghz/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Pontus Oldberg, Invector Labs + * + * 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/challenger_rp2040_subghz/mpconfigboard.h b/ports/raspberrypi/boards/challenger_rp2040_subghz/mpconfigboard.h new file mode 100644 index 0000000000..0e41e9f3a5 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_subghz/mpconfigboard.h @@ -0,0 +1,10 @@ +#define MICROPY_HW_BOARD_NAME "Challenger RP2040 SubGHz" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_UART_BUS_TX (&pin_GPIO16) +#define DEFAULT_UART_BUS_RX (&pin_GPIO17) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO20) diff --git a/ports/raspberrypi/boards/challenger_rp2040_subghz/mpconfigboard.mk b/ports/raspberrypi/boards/challenger_rp2040_subghz/mpconfigboard.mk new file mode 100644 index 0000000000..8bd9ac2318 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_subghz/mpconfigboard.mk @@ -0,0 +1,13 @@ +USB_VID = 0x2e8a +USB_PID = 0x1032 +USB_PRODUCT = "Challenger RP2040 SubGHz" +USB_MANUFACTURER = "Invector Labs" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ" + +CIRCUITPY__EVE = 1 + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM69 diff --git a/ports/raspberrypi/boards/challenger_rp2040_subghz/pico-sdk-configboard.h b/ports/raspberrypi/boards/challenger_rp2040_subghz/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_subghz/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/challenger_rp2040_subghz/pins.c b/ports/raspberrypi/boards/challenger_rp2040_subghz/pins.c new file mode 100644 index 0000000000..f5275e84dc --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_subghz/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_SDA), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + + // RFM69HCW connections + { MP_ROM_QSTR(MP_QSTR_RFM69HCW_CS), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_RFM69HCW_SCK), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_RFM69HCW_SDO), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_RFM69HCW_SDI), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_RFM69HCW_RST), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_RFM69HCW_DIO0), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_RFM69HCW_DIO1), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_RFM69HCW_DIO2), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_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/challenger_rp2040_wifi/board.c b/ports/raspberrypi/boards/challenger_rp2040_wifi/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/challenger_rp2040_wifi/board.c +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/shared-bindings/gamepadshift/__init__.h b/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/board.c similarity index 82% rename from shared-bindings/gamepadshift/__init__.h rename to ports/raspberrypi/boards/challenger_rp2040_wifi_ble/board.c index 4b4be756a6..de6e424ed9 100644 --- a/shared-bindings/gamepadshift/__init__.h +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/board.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries + * 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 @@ -24,8 +24,17 @@ * THE SOFTWARE. */ +#include "supervisor/board.h" -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT___INIT___H -#define MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT___INIT___H +void board_init(void) { +} -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPADSHIFT___INIT___H +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/mpconfigboard.h b/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/mpconfigboard.h new file mode 100644 index 0000000000..76c0748079 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/mpconfigboard.h @@ -0,0 +1,10 @@ +#define MICROPY_HW_BOARD_NAME "Challenger RP2040 WiFi/BLE" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_UART_BUS_TX (&pin_GPIO16) +#define DEFAULT_UART_BUS_RX (&pin_GPIO17) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO0) +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO1) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO20) diff --git a/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/mpconfigboard.mk b/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/mpconfigboard.mk new file mode 100644 index 0000000000..5b1502fdd0 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x2e8a +USB_PID = 0x102c +USB_PRODUCT = "Challenger RP2040 WiFi/BLE" +USB_MANUFACTURER = "Invector Labs" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/pico-sdk-configboard.h b/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/pins.c b/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/pins.c new file mode 100644 index 0000000000..57d7ecc698 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi_ble/pins.c @@ -0,0 +1,78 @@ +#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_SDA), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_WIFI_MODE), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_WIFI_RESET), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_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/cytron_maker_nano_rp2040/board.c b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c index b583e7bf11..22f2970c9e 100644 --- a/ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c +++ b/ports/raspberrypi/boards/cytron_maker_nano_rp2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c index b583e7bf11..22f2970c9e 100644 --- a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c +++ b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/board.c b/ports/raspberrypi/boards/elecfreaks_picoed/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/elecfreaks_picoed/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/elecfreaks_picoed/mpconfigboard.h b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h new file mode 100644 index 0000000000..03d892091e --- /dev/null +++ b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.h @@ -0,0 +1,4 @@ +#define MICROPY_HW_BOARD_NAME "ELECFREAKS PICO:ED" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_LED_STATUS (&pin_GPIO25) diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk new file mode 100644 index 0000000000..ea72feef00 --- /dev/null +++ b/ports/raspberrypi/boards/elecfreaks_picoed/mpconfigboard.mk @@ -0,0 +1,19 @@ +USB_VID = 0x2E8A +USB_PID = 0x1026 +USB_PRODUCT = "Pico:ed" +USB_MANUFACTURER = "ELECFREAKS" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_asyncio +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_IS31FL3731 +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Motor +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Ticks +FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython_ef_music +FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython_picoed diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/pico-sdk-configboard.h b/ports/raspberrypi/boards/elecfreaks_picoed/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/elecfreaks_picoed/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/elecfreaks_picoed/pins.c b/ports/raspberrypi/boards/elecfreaks_picoed/pins.c new file mode 100644 index 0000000000..4542b58672 --- /dev/null +++ b/ports/raspberrypi/boards/elecfreaks_picoed/pins.c @@ -0,0 +1,56 @@ +#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_BUZZER_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_I2C0_SDA), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_I2C0_SCL), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_BUZZER_GP3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_P10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_P11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_P12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_P13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_P14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_P15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_P16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_P20), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_P19), MP_ROM_PTR(&pin_GPIO19) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_P0_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_P1_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_P2_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_P3_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/electrolama_minik/board.c b/ports/raspberrypi/boards/electrolama_minik/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/electrolama_minik/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/electrolama_minik/mpconfigboard.h b/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.h new file mode 100644 index 0000000000..f2261ac8b7 --- /dev/null +++ b/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.h @@ -0,0 +1,8 @@ +#define MICROPY_HW_BOARD_NAME "Electrolama minik" +#define MICROPY_HW_MCU_NAME "rp2040" + +// GPIO25 is the WS2812 LED on the module +#define MICROPY_HW_NEOPIXEL (&pin_GPIO25) + +// GPIO15 is not routed out +#define IGNORE_PIN_GPIO15 1 diff --git a/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.mk b/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.mk new file mode 100644 index 0000000000..8bd2394127 --- /dev/null +++ b/ports/raspberrypi/boards/electrolama_minik/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x1209 +USB_PID = 0xF123 +USB_PRODUCT = "minik" +USB_MANUFACTURER = "Electrolama" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/electrolama_minik/pico-sdk-configboard.h b/ports/raspberrypi/boards/electrolama_minik/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/electrolama_minik/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/electrolama_minik/pins.c b/ports/raspberrypi/boards/electrolama_minik/pins.c new file mode 100644 index 0000000000..21331ffda5 --- /dev/null +++ b/ports/raspberrypi/boards/electrolama_minik/pins.c @@ -0,0 +1,52 @@ +#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_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + // GPIO15 is not routed out. + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_GP29_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/board.c b/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/board.c index 831bf96cdf..1c16e2fc4f 100644 --- a/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/board.c +++ b/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/board.c @@ -30,17 +30,9 @@ #include "supervisor/shared/board.h" #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { // turn off any left over LED board_reset_user_neopixels(&pin_GPIO15, 9); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/jpconstantineau_pykey18/board.c b/ports/raspberrypi/boards/jpconstantineau_pykey18/board.c index e4e5a8bc57..4785f742ec 100644 --- a/ports/raspberrypi/boards/jpconstantineau_pykey18/board.c +++ b/ports/raspberrypi/boards/jpconstantineau_pykey18/board.c @@ -29,17 +29,9 @@ #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" #include "supervisor/shared/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { // turn off any left over LED board_reset_user_neopixels(&pin_GPIO29, 62); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/jpconstantineau_pykey44/board.c b/ports/raspberrypi/boards/jpconstantineau_pykey44/board.c index e4e5a8bc57..4785f742ec 100644 --- a/ports/raspberrypi/boards/jpconstantineau_pykey44/board.c +++ b/ports/raspberrypi/boards/jpconstantineau_pykey44/board.c @@ -29,17 +29,9 @@ #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" #include "supervisor/shared/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { // turn off any left over LED board_reset_user_neopixels(&pin_GPIO29, 62); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/jpconstantineau_pykey60/board.c b/ports/raspberrypi/boards/jpconstantineau_pykey60/board.c index e4e5a8bc57..4785f742ec 100644 --- a/ports/raspberrypi/boards/jpconstantineau_pykey60/board.c +++ b/ports/raspberrypi/boards/jpconstantineau_pykey60/board.c @@ -29,17 +29,9 @@ #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" #include "supervisor/shared/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { // turn off any left over LED board_reset_user_neopixels(&pin_GPIO29, 62); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/jpconstantineau_pykey87/board.c b/ports/raspberrypi/boards/jpconstantineau_pykey87/board.c index e4e5a8bc57..4785f742ec 100644 --- a/ports/raspberrypi/boards/jpconstantineau_pykey87/board.c +++ b/ports/raspberrypi/boards/jpconstantineau_pykey87/board.c @@ -29,17 +29,9 @@ #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" #include "supervisor/shared/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - void reset_board(void) { // turn off any left over LED board_reset_user_neopixels(&pin_GPIO29, 62); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/melopero_shake_rp2040/board.c b/ports/raspberrypi/boards/melopero_shake_rp2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/melopero_shake_rp2040/board.c +++ b/ports/raspberrypi/boards/melopero_shake_rp2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/odt_bread_2040/board.c b/ports/raspberrypi/boards/odt_bread_2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/odt_bread_2040/board.c +++ b/ports/raspberrypi/boards/odt_bread_2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/odt_cast_away_rp2040/board.c b/ports/raspberrypi/boards/odt_cast_away_rp2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/odt_cast_away_rp2040/board.c +++ b/ports/raspberrypi/boards/odt_cast_away_rp2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_badger2040/board.c b/ports/raspberrypi/boards/pimoroni_badger2040/board.c index 666bb5f62f..48ae66e7cb 100644 --- a/ports/raspberrypi/boards/pimoroni_badger2040/board.c +++ b/ports/raspberrypi/boards/pimoroni_badger2040/board.c @@ -320,13 +320,6 @@ void board_init(void) { false); // two_byte_sequence_length } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - void board_deinit(void) { displayio_epaperdisplay_obj_t *display = &displays[0].epaper_display; if (display->base.type == &displayio_epaperdisplay_type) { @@ -338,3 +331,5 @@ void board_deinit(void) { } common_hal_displayio_release_displays(); } + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_interstate75/board.c b/ports/raspberrypi/boards/pimoroni_interstate75/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/pimoroni_interstate75/board.c +++ b/ports/raspberrypi/boards/pimoroni_interstate75/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_interstate75/pins.c b/ports/raspberrypi/boards/pimoroni_interstate75/pins.c index 2460ebc76a..801a418015 100644 --- a/ports/raspberrypi/boards/pimoroni_interstate75/pins.c +++ b/ports/raspberrypi/boards/pimoroni_interstate75/pins.c @@ -22,6 +22,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SW_A), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_GPIO18) }, diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/board.c b/ports/raspberrypi/boards/pimoroni_keybow2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/pimoroni_keybow2040/board.c +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_motor2040/board.c b/ports/raspberrypi/boards/pimoroni_motor2040/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_motor2040/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/pimoroni_motor2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_motor2040/mpconfigboard.h new file mode 100644 index 0000000000..b53e54ba90 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_motor2040/mpconfigboard.h @@ -0,0 +1,11 @@ +#define MICROPY_HW_BOARD_NAME "Pimoroni Motor 2040" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) +#define MICROPY_HW_NEOPIXEL_COUNT (1) + +#define DEFAULT_UART_BUS_TX (&pin_GPIO16) +#define DEFAULT_UART_BUS_RX (&pin_GPIO17) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO21) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO20) diff --git a/ports/raspberrypi/boards/pimoroni_motor2040/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_motor2040/mpconfigboard.mk new file mode 100644 index 0000000000..0b73fa1123 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_motor2040/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x2E8A +USB_PID = 0x1019 +USB_PRODUCT = "Motor 2040" +USB_MANUFACTURER = "Pimoroni" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/pimoroni_motor2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/pimoroni_motor2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_motor2040/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/pimoroni_motor2040/pins.c b/ports/raspberrypi/boards/pimoroni_motor2040/pins.c new file mode 100644 index 0000000000..caafe16ad1 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_motor2040/pins.c @@ -0,0 +1,77 @@ +#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_MOTOR_A_P), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_MOTOR_A_N), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_MOTOR_B_P), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_MOTOR_B_N), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_MOTOR_C_P), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_MOTOR_C_N), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_MOTOR_D_P), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_MOTOR_D_N), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_NUM_MOTORS), MP_ROM_INT(4) }, + + { MP_ROM_QSTR(MP_QSTR_ENCODER_A_A), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_ENCODER_A_B), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_ENCODER_B_A), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_ENCODER_B_B), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_ENCODER_C_A), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_ENCODER_C_B), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_ENCODER_D_A), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_ENCODER_D_B), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_NUM_ENCODERS), MP_ROM_INT(4) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_TRIG), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_ECHO), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_LED_DATA), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_NUM_LEDS), MP_ROM_INT(1) }, + + { MP_ROM_QSTR(MP_QSTR_INT), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_ADC_ADDR_0), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_ADC_ADDR_1), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_ADC_ADDR_2), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + + { MP_ROM_QSTR(MP_QSTR_SHARED_ADC), MP_ROM_PTR(&pin_GPIO29) }, + + { MP_ROM_QSTR(MP_QSTR_CURRENT_SENSE_A_ADDR), MP_ROM_INT(0b000) }, + { MP_ROM_QSTR(MP_QSTR_CURRENT_SENSE_B_ADDR), MP_ROM_INT(0b001) }, + { MP_ROM_QSTR(MP_QSTR_CURRENT_SENSE_C_ADDR), MP_ROM_INT(0b010) }, + { MP_ROM_QSTR(MP_QSTR_CURRENT_SENSE_D_ADDR), MP_ROM_INT(0b011) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_SENSE_ADDR), MP_ROM_INT(0b100) }, + { MP_ROM_QSTR(MP_QSTR_FAULT_SENSE_ADDR), MP_ROM_INT(0b101) }, + { MP_ROM_QSTR(MP_QSTR_SENSOR_1_ADDR), MP_ROM_INT(0b110) }, + { MP_ROM_QSTR(MP_QSTR_SENSOR_2_ADDR), MP_ROM_INT(0b111) }, + { MP_ROM_QSTR(MP_QSTR_NUM_SENSORS), MP_ROM_INT(2) }, + + { 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_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/pimoroni_pga2040/board.c b/ports/raspberrypi/boards/pimoroni_pga2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/pimoroni_pga2040/board.c +++ b/ports/raspberrypi/boards/pimoroni_pga2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_picolipo_16mb/board.c b/ports/raspberrypi/boards/pimoroni_picolipo_16mb/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/pimoroni_picolipo_16mb/board.c +++ b/ports/raspberrypi/boards/pimoroni_picolipo_16mb/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_picolipo_4mb/board.c b/ports/raspberrypi/boards/pimoroni_picolipo_4mb/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/pimoroni_picolipo_4mb/board.c +++ b/ports/raspberrypi/boards/pimoroni_picolipo_4mb/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/board.c b/ports/raspberrypi/boards/pimoroni_picosystem/board.c index e8458e90d9..600089f129 100644 --- a/ports/raspberrypi/boards/pimoroni_picosystem/board.c +++ b/ports/raspberrypi/boards/pimoroni_picosystem/board.c @@ -101,22 +101,14 @@ void board_init(void) { sizeof(display_init_sequence), &pin_GPIO12, // backlight pin NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - true, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency } -void board_deinit(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_plasma2040/board.c b/ports/raspberrypi/boards/pimoroni_plasma2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/pimoroni_plasma2040/board.c +++ b/ports/raspberrypi/boards/pimoroni_plasma2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_servo2040/board.c b/ports/raspberrypi/boards/pimoroni_servo2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/pimoroni_servo2040/board.c +++ b/ports/raspberrypi/boards/pimoroni_servo2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_servo2040/pins.c b/ports/raspberrypi/boards/pimoroni_servo2040/pins.c index 5471283cf9..5868f06b63 100644 --- a/ports/raspberrypi/boards/pimoroni_servo2040/pins.c +++ b/ports/raspberrypi/boards/pimoroni_servo2040/pins.c @@ -23,6 +23,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SERVO_18), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_NUM_SERVOS), MP_ROM_INT(18) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_LED_DATA), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_NUM_LEDS), MP_ROM_INT(6) }, diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/board.c b/ports/raspberrypi/boards/pimoroni_tiny2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/pimoroni_tiny2040/board.c +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040_2mb/board.c b/ports/raspberrypi/boards/pimoroni_tiny2040_2mb/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/pimoroni_tiny2040_2mb/board.c +++ b/ports/raspberrypi/boards/pimoroni_tiny2040_2mb/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/raspberry_pi_pico/board.c b/ports/raspberrypi/boards/raspberry_pi_pico/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico/board.c +++ b/ports/raspberrypi/boards/raspberry_pi_pico/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/seeeduino_xiao_rp2040/board.c b/ports/raspberrypi/boards/seeeduino_xiao_rp2040/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/seeeduino_xiao_rp2040/board.c +++ b/ports/raspberrypi/boards/seeeduino_xiao_rp2040/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/silicognition_rp2040_shim/board.c b/ports/raspberrypi/boards/silicognition_rp2040_shim/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/silicognition_rp2040_shim/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/silicognition_rp2040_shim/mpconfigboard.h b/ports/raspberrypi/boards/silicognition_rp2040_shim/mpconfigboard.h new file mode 100644 index 0000000000..ebfdf8bd9e --- /dev/null +++ b/ports/raspberrypi/boards/silicognition_rp2040_shim/mpconfigboard.h @@ -0,0 +1,14 @@ +#define MICROPY_HW_BOARD_NAME "Silicognition LLC RP2040-Shim" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO23) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO17) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO16) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO10) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO11) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO12) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/silicognition_rp2040_shim/mpconfigboard.mk b/ports/raspberrypi/boards/silicognition_rp2040_shim/mpconfigboard.mk new file mode 100644 index 0000000000..df18e3ffe8 --- /dev/null +++ b/ports/raspberrypi/boards/silicognition_rp2040_shim/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x1209 +USB_PID = 0xF502 +USB_PRODUCT = "RP2040-Shim" +USB_MANUFACTURER = "Silicognition LLC" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "P25Q32H" diff --git a/ports/raspberrypi/boards/silicognition_rp2040_shim/pico-sdk-configboard.h b/ports/raspberrypi/boards/silicognition_rp2040_shim/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/silicognition_rp2040_shim/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/silicognition_rp2040_shim/pins.c b/ports/raspberrypi/boards/silicognition_rp2040_shim/pins.c new file mode 100644 index 0000000000..fcde354c2d --- /dev/null +++ b/ports/raspberrypi/boards/silicognition_rp2040_shim/pins.c @@ -0,0 +1,38 @@ +#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_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO26) }, + { 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_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO12) }, + { 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_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_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/solderparty_bbq20kbd/board.c b/ports/raspberrypi/boards/solderparty_bbq20kbd/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/solderparty_bbq20kbd/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/solderparty_bbq20kbd/mpconfigboard.h b/ports/raspberrypi/boards/solderparty_bbq20kbd/mpconfigboard.h new file mode 100644 index 0000000000..4f5f2c1106 --- /dev/null +++ b/ports/raspberrypi/boards/solderparty_bbq20kbd/mpconfigboard.h @@ -0,0 +1,7 @@ +#define MICROPY_HW_BOARD_NAME "BBQ20KBD" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO23) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO18) + +#define DEFAULT_UART_BUS_TX (&pin_GPIO20) diff --git a/ports/raspberrypi/boards/solderparty_bbq20kbd/mpconfigboard.mk b/ports/raspberrypi/boards/solderparty_bbq20kbd/mpconfigboard.mk new file mode 100644 index 0000000000..3f3acc46be --- /dev/null +++ b/ports/raspberrypi/boards/solderparty_bbq20kbd/mpconfigboard.mk @@ -0,0 +1,13 @@ +USB_VID = 0x1209 +USB_PID = 0xB182 +USB_PRODUCT = "BBQ20 Keyboard" +USB_MANUFACTURER = "Solder Party" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "GD25Q16C" + +CIRCUITPY__EVE = 1 + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID diff --git a/ports/raspberrypi/boards/solderparty_bbq20kbd/pico-sdk-configboard.h b/ports/raspberrypi/boards/solderparty_bbq20kbd/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/solderparty_bbq20kbd/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/solderparty_bbq20kbd/pins.c b/ports/raspberrypi/boards/solderparty_bbq20kbd/pins.c new file mode 100644 index 0000000000..c5eab180a0 --- /dev/null +++ b/ports/raspberrypi/boards/solderparty_bbq20kbd/pins.c @@ -0,0 +1,41 @@ +#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_INT), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_PERIPHERAL_SDA), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_PERIPHERAL_SCL), MP_ROM_PTR(&pin_GPIO29) }, + + { MP_ROM_QSTR(MP_QSTR_ROW1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_ROW2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_ROW3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_ROW4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_ROW5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_ROW6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_ROW7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_COL1), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_COL2), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_COL3), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_COL4), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_COL5), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_COL6), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_BTN1), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_BACKLIGHT), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_TP_RESET), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_TP_MOTION), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_TP_SHUTDOWN), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO20) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_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/solderparty_rp2040_stamp/board.c b/ports/raspberrypi/boards/solderparty_rp2040_stamp/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/solderparty_rp2040_stamp/board.c +++ b/ports/raspberrypi/boards/solderparty_rp2040_stamp/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/solderparty_rp2040_stamp/mpconfigboard.mk b/ports/raspberrypi/boards/solderparty_rp2040_stamp/mpconfigboard.mk index e2b4118761..1954b12415 100644 --- a/ports/raspberrypi/boards/solderparty_rp2040_stamp/mpconfigboard.mk +++ b/ports/raspberrypi/boards/solderparty_rp2040_stamp/mpconfigboard.mk @@ -11,7 +11,6 @@ EXTERNAL_FLASH_DEVICES = "GD25Q64C" CIRCUITPY__EVE = 1 FROZEN_MPY_DIRS += $(TOP)/ports/raspberrypi/boards/solderparty_rp2040_stamp -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register diff --git a/ports/raspberrypi/boards/solderparty_rp2040_stamp/stamp_round_carrier_board.py b/ports/raspberrypi/boards/solderparty_rp2040_stamp/stamp_round_carrier_board.py new file mode 100644 index 0000000000..43ce598460 --- /dev/null +++ b/ports/raspberrypi/boards/solderparty_rp2040_stamp/stamp_round_carrier_board.py @@ -0,0 +1,68 @@ +from board import * +import busio + + +_SPI = None +_UART = None +_I2C = None + + +D0 = GP0 +SDA = D0 +D1 = GP1 +SCL = D1 +D8 = GP8 +CIPO = D8 +MISO = D8 +D9 = GP9 +CS = D9 +D10 = GP10 +SCK = D10 +D11 = GP11 +COPI = D11 +MOSI = D11 +D14 = GP14 +D15 = GP15 +D16 = GP16 +TX = D16 +D17 = GP17 +RX = D17 +D26 = GP26 +A0 = D26 +D27 = GP27 +A1 = D27 +D28 = GP28 +A2 = D28 +D29 = GP29 +A3 = D29 +D24 = GP24 +NEOPIXEL = D24 +D25 = GP25 +LED = D25 + + +def SPI(): + global _SPI + + if not _SPI: + _SPI = busio.SPI(SCK, COPI, CIPO) + + return _SPI + + +def UART(): + global _UART + + if not _UART: + _UART = busio.UART(TX, RX) + + return _UART + + +def I2C(): + global _I2C + + if not _I2C: + _I2C = busio.I2C(SCL, SDA) + + return _I2C diff --git a/ports/raspberrypi/boards/sparkfun_micromod_rp2040/board.c b/ports/raspberrypi/boards/sparkfun_micromod_rp2040/board.c index eac54ce460..331653173e 100644 --- a/ports/raspberrypi/boards/sparkfun_micromod_rp2040/board.c +++ b/ports/raspberrypi/boards/sparkfun_micromod_rp2040/board.c @@ -26,18 +26,4 @@ #include "supervisor/board.h" -#include "shared-bindings/microcontroller/Pin.h" -#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/board.c b/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/board.c index eac54ce460..331653173e 100644 --- a/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/board.c +++ b/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/board.c @@ -26,18 +26,4 @@ #include "supervisor/board.h" -#include "shared-bindings/microcontroller/Pin.h" -#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/board.c b/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/board.c index eac54ce460..331653173e 100644 --- a/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/board.c +++ b/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/board.c @@ -26,18 +26,4 @@ #include "supervisor/board.h" -#include "shared-bindings/microcontroller/Pin.h" -#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" - -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pins.c b/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pins.c index 22dccc66bb..86adaa926d 100644 --- a/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pins.c +++ b/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pins.c @@ -46,8 +46,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, { MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27) }, - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO28) }, - { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, // SD Card { MP_ROM_QSTR(MP_QSTR_SD_SCK), MP_ROM_PTR(&pin_GPIO14)}, diff --git a/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/board.c b/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/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/takayoshiotake_octave_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/mpconfigboard.h new file mode 100644 index 0000000000..901ae068dd --- /dev/null +++ b/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/mpconfigboard.h @@ -0,0 +1,5 @@ +#define MICROPY_HW_BOARD_NAME "takayoshiotake Octave RP2040" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO12) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO11) diff --git a/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/mpconfigboard.mk b/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/mpconfigboard.mk new file mode 100644 index 0000000000..6a7234809c --- /dev/null +++ b/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x1209 +USB_PID = 0x8CAE +USB_PRODUCT = "Octave RP2040" +USB_MANUFACTURER = "takayoshiotake" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ" diff --git a/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/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/takayoshiotake_octave_rp2040/pins.c b/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/pins.c new file mode 100644 index 0000000000..4218f9cdea --- /dev/null +++ b/ports/raspberrypi/boards/takayoshiotake_octave_rp2040/pins.c @@ -0,0 +1,45 @@ +#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_GPIO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPIO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GPIO2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GPIO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GPIO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GPIO5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GPIO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GPIO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GPIO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GPIO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GPIO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GPIO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GPIO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GPIO13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GPIO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GPIO15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GPIO16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GPIO17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GPIO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GPIO19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GPIO20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GPIO21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GPIO22), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_GPIO23), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GPIO24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_GPIO25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_GPIO26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GPIO27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GPIO28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GPIO29), MP_ROM_PTR(&pin_GPIO29) }, + + { MP_ROM_QSTR(MP_QSTR_ADC0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_ADC1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_ADC2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_ADC3), MP_ROM_PTR(&pin_GPIO29) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIX), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIX_POWER), MP_ROM_PTR(&pin_GPIO11) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/waveshare_rp2040_zero/board.c b/ports/raspberrypi/boards/waveshare_rp2040_zero/board.c index de6e424ed9..331653173e 100644 --- a/ports/raspberrypi/boards/waveshare_rp2040_zero/board.c +++ b/ports/raspberrypi/boards/waveshare_rp2040_zero/board.c @@ -26,15 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/weact_studio_pico/board.c b/ports/raspberrypi/boards/weact_studio_pico/board.c new file mode 100644 index 0000000000..76973aee30 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Fabian Affolter + * + * 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/weact_studio_pico/mpconfigboard.h b/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.h new file mode 100644 index 0000000000..e3276bbd74 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.h @@ -0,0 +1,2 @@ +#define MICROPY_HW_BOARD_NAME "WeAct Studio Pico" +#define MICROPY_HW_MCU_NAME "rp2040" diff --git a/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk b/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk new file mode 100644 index 0000000000..73f3676825 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x239A +USB_PID = 0x102E +USB_PRODUCT = "Pico" +USB_MANUFACTURER = "WeAct Studio" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/weact_studio_pico/pico-sdk-configboard.h b/ports/raspberrypi/boards/weact_studio_pico/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/weact_studio_pico/pins.c b/ports/raspberrypi/boards/weact_studio_pico/pins.c new file mode 100644 index 0000000000..8632d9c322 --- /dev/null +++ b/ports/raspberrypi/boards/weact_studio_pico/pins.c @@ -0,0 +1,53 @@ +#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_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { 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_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/board.c b/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/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/wiznet_w5100s_evb_pico/mpconfigboard.h b/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/mpconfigboard.h new file mode 100644 index 0000000000..1dae266fc8 --- /dev/null +++ b/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/mpconfigboard.h @@ -0,0 +1,9 @@ +#define MICROPY_HW_BOARD_NAME "W5100S-EVB-Pico" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO18) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO19) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO16) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/mpconfigboard.mk b/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/mpconfigboard.mk new file mode 100644 index 0000000000..c7b6f312fc --- /dev/null +++ b/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x2E8A +USB_PID = 0x1027 +USB_PRODUCT = "W5100S-EVB-Pico" +USB_MANUFACTURER = "WIZnet" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/pico-sdk-configboard.h b/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/pins.c b/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/pins.c new file mode 100644 index 0000000000..87ff27fa46 --- /dev/null +++ b/ports/raspberrypi/boards/wiznet_w5100s_evb_pico/pins.c @@ -0,0 +1,54 @@ +#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_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { 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_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/wiznet_w5500_evb_pico/board.c b/ports/raspberrypi/boards/wiznet_w5500_evb_pico/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/wiznet_w5500_evb_pico/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/wiznet_w5500_evb_pico/mpconfigboard.h b/ports/raspberrypi/boards/wiznet_w5500_evb_pico/mpconfigboard.h new file mode 100644 index 0000000000..00faa83742 --- /dev/null +++ b/ports/raspberrypi/boards/wiznet_w5500_evb_pico/mpconfigboard.h @@ -0,0 +1,9 @@ +#define MICROPY_HW_BOARD_NAME "W5500-EVB-Pico" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO18) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO19) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO16) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/wiznet_w5500_evb_pico/mpconfigboard.mk b/ports/raspberrypi/boards/wiznet_w5500_evb_pico/mpconfigboard.mk new file mode 100644 index 0000000000..3789a76e0b --- /dev/null +++ b/ports/raspberrypi/boards/wiznet_w5500_evb_pico/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x2E8A +USB_PID = 0x1029 +USB_PRODUCT = "W5500-EVB-Pico" +USB_MANUFACTURER = "WIZnet" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/wiznet_w5500_evb_pico/pico-sdk-configboard.h b/ports/raspberrypi/boards/wiznet_w5500_evb_pico/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/wiznet_w5500_evb_pico/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/wiznet_w5500_evb_pico/pins.c b/ports/raspberrypi/boards/wiznet_w5500_evb_pico/pins.c new file mode 100644 index 0000000000..87ff27fa46 --- /dev/null +++ b/ports/raspberrypi/boards/wiznet_w5500_evb_pico/pins.c @@ -0,0 +1,54 @@ +#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_GP0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) }, + + { MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_GPIO23) }, + { MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + + { MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { 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_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/board.c b/ports/raspberrypi/boards/zrichard_rp2.65-f/board.c new file mode 100644 index 0000000000..aa189002ba --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/board.c @@ -0,0 +1,37 @@ +/* + * 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" +#include "shared-bindings/microcontroller/Pin.h" +#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" +#include "supervisor/shared/board.h" + +void reset_board(void) { + // turn off any left over LED + board_reset_user_neopixels(&pin_GPIO25, 62); +} + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.h b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.h new file mode 100644 index 0000000000..5acfceba9d --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.h @@ -0,0 +1,4 @@ +#define MICROPY_HW_BOARD_NAME "RP2.65-F" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO25) diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk new file mode 100644 index 0000000000..4cba650ec4 --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/mpconfigboard.mk @@ -0,0 +1,17 @@ +# pid.codes ZR +USB_VID = 0x1209 +USB_PID = 0x5a52 + +USB_PRODUCT = "RP2.65-F" +USB_MANUFACTURER = "ZRichard" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ,W25Q128JVxQ" + +CIRCUITPY__EVE = 1 + + +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_MIDI diff --git a/ports/raspberrypi/boards/zrichard_rp2.65-f/pico-sdk-configboard.h b/ports/raspberrypi/boards/zrichard_rp2.65-f/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/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/zrichard_rp2.65-f/pins.c b/ports/raspberrypi/boards/zrichard_rp2.65-f/pins.c new file mode 100644 index 0000000000..02c69c014f --- /dev/null +++ b/ports/raspberrypi/boards/zrichard_rp2.65-f/pins.c @@ -0,0 +1,32 @@ +#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_ROW0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_COL0), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_ROW1), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_COL1), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_ROW2), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_COL2), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_ROW3), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_COL3), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_ROW4), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_COL4), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_ROW5), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_COL5), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_ROW6), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_COL6), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_ROW7), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_COL7), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_ROW8), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_ROW9), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_RV1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_RV2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_RV3), MP_ROM_PTR(&pin_GPIO29) }, + +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/common-hal/alarm/__init__.c b/ports/raspberrypi/common-hal/alarm/__init__.c index 0d6734568b..31fa58aab3 100644 --- a/ports/raspberrypi/common-hal/alarm/__init__.c +++ b/ports/raspberrypi/common-hal/alarm/__init__.c @@ -194,7 +194,10 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj return wake_alarm; } -void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms) { +void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms, size_t n_dios, digitalio_digitalinout_obj_t **preserve_dios) { + if (n_dios > 0) { + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_preserve_dios); + } _setup_sleep_alarms(true, n_alarms, alarms); } diff --git a/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c b/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c new file mode 100644 index 0000000000..951c07af03 --- /dev/null +++ b/ports/raspberrypi/common-hal/analogbufio/BufferedIn.c @@ -0,0 +1,167 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 Lee Atkinson, MeanStride Technology, Inc. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2021 Raspberry Pi (Trading) Ltd. + * https://github.com/raspberrypi/pico-examples/blob/master/adc/dma_capture/dma_capture.c + * + * 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 "common-hal/analogbufio/BufferedIn.h" +#include "shared-bindings/analogbufio/BufferedIn.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "py/runtime.h" +#include "supervisor/shared/translate/translate.h" +#include "src/rp2_common/hardware_adc/include/hardware/adc.h" +#include "src/rp2_common/hardware_dma/include/hardware/dma.h" +#include "src/common/pico_stdlib/include/pico/stdlib.h" + +#define ADC_FIRST_PIN_NUMBER 26 +#define ADC_PIN_COUNT 4 + +void common_hal_analogbufio_bufferedin_construct(analogbufio_bufferedin_obj_t *self, const mcu_pin_obj_t *pin, uint8_t *buffer, uint32_t len, uint8_t bytes_per_sample, bool samples_signed, uint32_t sample_rate) { + + // Make sure pin number is in range for ADC + if (pin->number < ADC_FIRST_PIN_NUMBER || pin->number >= (ADC_FIRST_PIN_NUMBER + ADC_PIN_COUNT)) { + raise_ValueError_invalid_pins(); + } + + // Set pin and channel + self->pin = pin; + claim_pin(pin); + + // TODO: find a way to accept ADC4 for temperature + self->chan = pin->number - ADC_FIRST_PIN_NUMBER; + + // Set buffer and length + self->buffer = buffer; + self->len = len; + + // Set sample rate - used in read + self->bytes_per_sample = bytes_per_sample; + self->sample_rate = sample_rate; + + // Init GPIO for analogue use: hi-Z, no pulls, disable digital input buffer. + adc_init(); + adc_gpio_init(pin->number); + adc_select_input(self->chan); // chan = pin - 26 ?? + + // RP2040 Implementation Detail + // Fills the supplied buffer with ADC values using DMA transfer. + // If the buffer is 8-bit, then values are 8-bit shifted and error bit is off. + // If buffer is 16-bit, then values are not shifted and error bit is present. + // Number of transfers is always the number of samples which is the array + // byte length divided by the bytes_per_sample. + + // self->bytes_per_sample == 1 + uint dma_size = DMA_SIZE_8; + bool show_error_bit = false; + bool shift_sample_8_bits = true; + if (self->bytes_per_sample == 2) { + dma_size = DMA_SIZE_16; + show_error_bit = true; + shift_sample_8_bits = false; + } + + // adc_select_input(self->pin->number - ADC_FIRST_PIN_NUMBER); + adc_fifo_setup( + true, // Write each completed conversion to the sample FIFO + true, // Enable DMA data request (DREQ) + 1, // DREQ (and IRQ) asserted when at least 1 sample present + show_error_bit, // See the ERR bit + shift_sample_8_bits // Shift each sample to 8 bits when pushing to FIFO + ); + + // Divisor of 0 -> full speed. Free-running capture with the divider is + // equivalent to pressing the ADC_CS_START_ONCE button once per `div + 1` + // cycles (div not necessarily an integer). Each conversion takes 96 + // cycles, so in general you want a divider of 0 (hold down the button + // continuously) or > 95 (take samples less frequently than 96 cycle + // intervals). This is all timed by the 48 MHz ADC clock. + // sample rate determines divisor, not zero. + + // sample_rate is forced to be >= 1 in shared-bindings + adc_set_clkdiv((float)48000000.0 / (float)self->sample_rate); + + // Set up the DMA to start transferring data as soon as it appears in FIFO + uint dma_chan = dma_claim_unused_channel(true); + self->dma_chan = dma_chan; + + // Set Config + self->cfg = dma_channel_get_default_config(dma_chan); + + // Reading from constant address, writing to incrementing byte addresses + channel_config_set_transfer_data_size(&(self->cfg), dma_size); + channel_config_set_read_increment(&(self->cfg), false); + channel_config_set_write_increment(&(self->cfg), true); + + // Pace transfers based on availability of ADC samples + channel_config_set_dreq(&(self->cfg), DREQ_ADC); + + // clear any previous activity + adc_fifo_drain(); + adc_run(false); +} + +bool common_hal_analogbufio_bufferedin_deinited(analogbufio_bufferedin_obj_t *self) { + return self->pin == NULL; +} + +void common_hal_analogbufio_bufferedin_deinit(analogbufio_bufferedin_obj_t *self) { + if (common_hal_analogbufio_bufferedin_deinited(self)) { + return; + } + + // Release ADC Pin + reset_pin_number(self->pin->number); + self->pin = NULL; + + // Release DMA Channel + dma_channel_unclaim(self->dma_chan); +} + +void common_hal_analogbufio_bufferedin_read(analogbufio_bufferedin_obj_t *self) { + + uint32_t cdl = self->len / self->bytes_per_sample; + + dma_channel_configure(self->dma_chan, &(self->cfg), + self->buffer, // dst + &adc_hw->fifo, // src + cdl, // transfer count + true // start immediately + ); + + // Start the ADC + adc_run(true); + + // Once DMA finishes, stop any new conversions from starting, and clean up + // the FIFO in case the ADC was still mid-conversion. + dma_channel_wait_for_finish_blocking(self->dma_chan); + + // Clean up + adc_run(false); + adc_fifo_drain(); +} diff --git a/ports/raspberrypi/common-hal/analogbufio/BufferedIn.h b/ports/raspberrypi/common-hal/analogbufio/BufferedIn.h new file mode 100644 index 0000000000..8b183a1d70 --- /dev/null +++ b/ports/raspberrypi/common-hal/analogbufio/BufferedIn.h @@ -0,0 +1,56 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 Lee Atkinson, MeanStride Technology, Inc. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2021 Raspberry Pi (Trading) Ltd. + * https://github.com/raspberrypi/pico-examples/blob/master/adc/dma_capture/dma_capture.c + * + * 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. + */ + +#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ANALOGBUFIO_BUFFEREDIN_H +#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ANALOGBUFIO_BUFFEREDIN_H + +#include "common-hal/microcontroller/Pin.h" +#include "src/rp2_common/hardware_dma/include/hardware/dma.h" + +#include "py/obj.h" + +// This is the analogbufio object +typedef struct { + mp_obj_base_t base; + const mcu_pin_obj_t *pin; + uint8_t *buffer; + uint32_t len; + uint8_t bytes_per_sample; + bool samples_signed; + uint32_t sample_rate; + uint8_t chan; + uint dma_chan; + dma_channel_config cfg; +} analogbufio_bufferedin_obj_t; + +void bufferedin_init(void); + +#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_ANALOGBUFIO_BUFFEREDIN_H diff --git a/ports/raspberrypi/common-hal/analogbufio/__init__.c b/ports/raspberrypi/common-hal/analogbufio/__init__.c new file mode 100644 index 0000000000..b6c74b985b --- /dev/null +++ b/ports/raspberrypi/common-hal/analogbufio/__init__.c @@ -0,0 +1 @@ +// No analogbufio module functions. diff --git a/ports/raspberrypi/common-hal/analogio/AnalogIn.c b/ports/raspberrypi/common-hal/analogio/AnalogIn.c index 1d77630063..b827068e1a 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogIn.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogIn.c @@ -26,8 +26,9 @@ #include "common-hal/analogio/AnalogIn.h" #include "shared-bindings/analogio/AnalogIn.h" +#include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2_common/hardware_adc/include/hardware/adc.h" @@ -36,7 +37,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin) { if (pin->number < ADC_FIRST_PIN_NUMBER || pin->number > ADC_FIRST_PIN_NUMBER + ADC_PIN_COUNT) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } adc_init(); @@ -64,8 +65,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { adc_select_input(self->pin->number - ADC_FIRST_PIN_NUMBER); uint16_t value = adc_read(); - // Map value to from 12 to 16 bits - return value << 4; + // Stretch 12-bit ADC reading to 16-bit range + return (value << 4) | (value >> 8); } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { diff --git a/ports/raspberrypi/common-hal/analogio/AnalogOut.c b/ports/raspberrypi/common-hal/analogio/AnalogOut.c index 7afa773d30..38ff935674 100644 --- a/ports/raspberrypi/common-hal/analogio/AnalogOut.c +++ b/ports/raspberrypi/common-hal/analogio/AnalogOut.c @@ -31,10 +31,10 @@ #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, const mcu_pin_obj_t *pin) { - mp_raise_RuntimeError(translate("AnalogOut functionality not supported")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_AnalogOut); } bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { diff --git a/ports/raspberrypi/common-hal/audiobusio/I2SOut.c b/ports/raspberrypi/common-hal/audiobusio/I2SOut.c index 8432e47a52..7db053a39d 100644 --- a/ports/raspberrypi/common-hal/audiobusio/I2SOut.c +++ b/ports/raspberrypi/common-hal/audiobusio/I2SOut.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-module/audiocore/__init__.h" #include "bindings/rp2pio/StateMachine.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" const uint16_t i2s_program[] = { // ; Load the next set of samples @@ -128,13 +128,14 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self, NULL, 0, 0, 0x1f, // set pins bit_clock, 2, 0, 0x1f, // sideset pins false, // No sideset enable - NULL, // jump pin + NULL, PULL_NONE, // jump pin 0, // wait gpio pins true, // exclusive pin use false, 32, false, // shift out left to start with MSB false, // Wait for txstall false, 32, false, // in settings - false); // Not user-interruptible. + false, // Not user-interruptible. + 0, -1); // wrap settings self->playing = false; audio_dma_init(&self->dma); diff --git a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c index 4b5694706f..c3aadd2bbe 100644 --- a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c +++ b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c @@ -32,7 +32,7 @@ #include "py/runtime.h" #include "shared-bindings/audiobusio/PDMIn.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "audio_dma.h" @@ -63,7 +63,7 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self, // Use the state machine to manage pins. common_hal_rp2pio_statemachine_construct(&self->state_machine, - pdmin, sizeof(pdmin) / sizeof(pdmin[0]), + pdmin, MP_ARRAY_SIZE(pdmin), sample_rate * 32 * 2, // Frequency based on sample rate NULL, 0, NULL, 1, 0, 0xffffffff, // out pin @@ -72,13 +72,14 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self, NULL, 0, 0, 0x1f, // set pins clock_pin, 1, 0, 0x1f, // sideset pins false, // No sideset enable - NULL, // jump pin + NULL, PULL_NONE, // jump pin 0, // wait gpio pins true, // exclusive pin use false, 32, false, // out settings false, // Wait for txstall false, 32, true, // in settings - false); // Not user-interruptible. + false, // Not user-interruptible. + 0, -1); // wrap settings uint32_t actual_frequency = common_hal_rp2pio_statemachine_get_frequency(&self->state_machine); if (actual_frequency < MIN_MIC_CLOCK) { @@ -156,9 +157,9 @@ uint32_t common_hal_audiobusio_pdmin_record_to_buffer(audiobusio_pdmin_obj_t *se size_t output_count = 0; common_hal_rp2pio_statemachine_clear_rxfifo(&self->state_machine); // Do one read to get the mic going and throw it away. - common_hal_rp2pio_statemachine_readinto(&self->state_machine, (uint8_t *)samples, 2 * sizeof(uint32_t), sizeof(uint32_t)); + common_hal_rp2pio_statemachine_readinto(&self->state_machine, (uint8_t *)samples, 2 * sizeof(uint32_t), sizeof(uint32_t), false); while (output_count < output_buffer_length && !common_hal_rp2pio_statemachine_get_rxstall(&self->state_machine)) { - common_hal_rp2pio_statemachine_readinto(&self->state_machine, (uint8_t *)samples, 2 * sizeof(uint32_t), sizeof(uint32_t)); + common_hal_rp2pio_statemachine_readinto(&self->state_machine, (uint8_t *)samples, 2 * sizeof(uint32_t), sizeof(uint32_t), false); // Call filter_sample just one place so it can be inlined. uint16_t value = filter_sample(samples); if (self->bit_depth == 8) { diff --git a/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c b/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c index 2f09124f4b..8b5c3accec 100644 --- a/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -39,7 +39,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2040/hardware_structs/include/hardware/structs/dma.h" #include "src/rp2_common/hardware_pwm/include/hardware/pwm.h" diff --git a/ports/raspberrypi/common-hal/busio/I2C.c b/ports/raspberrypi/common-hal/busio/I2C.c index 516cee2227..6b15bee512 100644 --- a/ports/raspberrypi/common-hal/busio/I2C.c +++ b/ports/raspberrypi/common-hal/busio/I2C.c @@ -30,6 +30,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/bitbangio/I2C.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" @@ -65,14 +66,14 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, self->peripheral = i2c[sda_instance]; } if (self->peripheral == NULL) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if ((i2c_get_hw(self->peripheral)->enable & I2C_IC_ENABLE_ENABLE_BITS) != 0) { mp_raise_ValueError(translate("I2C peripheral in use")); } - if (frequency > 1000000) { - mp_raise_ValueError(translate("Unsupported baudrate")); - } + + mp_arg_validate_int_max(frequency, 1000000, MP_QSTR_frequency); + #if CIRCUITPY_REQUIRE_I2C_PULLUPS // Test that the pins are in a high state. (Hopefully indicating they are pulled up.) diff --git a/ports/raspberrypi/common-hal/busio/SPI.c b/ports/raspberrypi/common-hal/busio/SPI.c index 4a18d62584..a7b97823f9 100644 --- a/ports/raspberrypi/common-hal/busio/SPI.c +++ b/ports/raspberrypi/common-hal/busio/SPI.c @@ -82,7 +82,7 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // TODO: Check to see if we're sharing the SPI with a native APA102. if (instance_index > 1) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } if (instance_index == 0) { diff --git a/ports/raspberrypi/common-hal/busio/UART.c b/ports/raspberrypi/common-hal/busio/UART.c index 0e25c57297..c06bb21903 100644 --- a/ports/raspberrypi/common-hal/busio/UART.c +++ b/ports/raspberrypi/common-hal/busio/UART.c @@ -32,6 +32,7 @@ #include "supervisor/shared/tick.h" #include "shared/runtime/interrupt_char.h" #include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "src/rp2_common/hardware_irq/include/hardware/irq.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" @@ -66,7 +67,7 @@ static uint8_t pin_init(const uint8_t uart, const mcu_pin_obj_t *pin, const uint return NO_PIN; } if (!(((pin->number % 4) == pin_type) && ((((pin->number + 4) / 8) % NUM_UARTS) == uart))) { - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); } claim_pin(pin); gpio_set_function(pin->number, GPIO_FUNC_UART); @@ -85,7 +86,7 @@ static void shared_callback(busio_uart_obj_t *self) { _copy_into_ringbuf(&self->ringbuf, self->uart); // We always clear the interrupt so it doesn't continue to fire because we // may not have read everything available. - uart_get_hw(self->uart)->icr = UART_UARTICR_RXIC_BITS; + uart_get_hw(self->uart)->icr = UART_UARTICR_RXIC_BITS | UART_UARTICR_RTIC_BITS; } static void uart0_callback(void) { @@ -104,17 +105,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, mp_float_t timeout, uint16_t receiver_buffer_size, byte *receiver_buffer, bool sigint_enabled) { - if (bits > 8) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } - - if (receiver_buffer_size == 0) { - mp_raise_ValueError(translate("Invalid buffer size")); - } - - if ((rs485_dir != NULL) || (rs485_invert)) { - mp_raise_NotImplementedError(translate("RS485 Not yet supported on this device")); - } + mp_arg_validate_int_max(bits, 8, MP_QSTR_bits); + mp_arg_validate_int_min(receiver_buffer_size, 1, MP_QSTR_receiver_buffer_size); uint8_t uart_id = ((((tx != NULL) ? tx->number : rx->number) + 4) / 8) % NUM_UARTS; @@ -126,6 +118,29 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->rx_pin = pin_init(uart_id, rx, 1); self->cts_pin = pin_init(uart_id, cts, 2); self->rts_pin = pin_init(uart_id, rts, 3); + + if (rs485_dir != NULL) { + uint8_t pin = rs485_dir->number; + self->rs485_dir_pin = pin; + self->rs485_invert = rs485_invert; + + gpio_init(pin); + + claim_pin(rs485_dir); + + gpio_disable_pulls(pin); + + // Turn on "strong" pin driving (more current available). + hw_write_masked(&padsbank0_hw->io[pin], + PADS_BANK0_GPIO0_DRIVE_VALUE_12MA << PADS_BANK0_GPIO0_DRIVE_LSB, + PADS_BANK0_GPIO0_DRIVE_BITS); + + gpio_put(self->rs485_dir_pin, rs485_invert); + gpio_set_dir(self->rs485_dir_pin, GPIO_OUT); + } else { + self->rs485_dir_pin = NO_PIN; + } + uart_status[uart_id] = STATUS_BUSY; @@ -148,7 +163,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // in the long-lived pool is not strictly necessary) // (This is a macro.) if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { - mp_raise_msg(&mp_type_MemoryError, translate("Failed to allocate RX buffer")); + m_malloc_fail(receiver_buffer_size); } active_uarts[uart_id] = self; if (uart_id == 1) { @@ -179,10 +194,12 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { reset_pin_number(self->rx_pin); reset_pin_number(self->cts_pin); reset_pin_number(self->rts_pin); + reset_pin_number(self->rs485_dir_pin); self->tx_pin = NO_PIN; self->rx_pin = NO_PIN; self->cts_pin = NO_PIN; self->rts_pin = NO_PIN; + self->rs485_dir_pin = NO_PIN; } // Write characters. @@ -191,6 +208,11 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, mp_raise_ValueError(translate("No TX pin")); } + if (self->rs485_dir_pin != NO_PIN) { + uart_tx_wait_blocking(self->uart); + gpio_put(self->rs485_dir_pin, !self->rs485_invert); + } + size_t left_to_write = len; while (left_to_write > 0) { while (uart_is_writable(self->uart) && left_to_write > 0) { @@ -201,7 +223,10 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, } RUN_BACKGROUND_TASKS; } - + if (self->rs485_dir_pin != NO_PIN) { + uart_tx_wait_blocking(self->uart); + gpio_put(self->rs485_dir_pin, self->rs485_invert); + } return len; } @@ -286,7 +311,7 @@ uint32_t common_hal_busio_uart_rx_characters_available(busio_uart_obj_t *self) { // The UART only interrupts after a threshold so make sure to copy anything // out of its FIFO before measuring how many bytes we've received. _copy_into_ringbuf(&self->ringbuf, self->uart); - irq_set_enabled(self->uart_irq_id, false); + irq_set_enabled(self->uart_irq_id, true); return ringbuf_num_filled(&self->ringbuf); } diff --git a/ports/raspberrypi/common-hal/busio/UART.h b/ports/raspberrypi/common-hal/busio/UART.h index f6978fd1d2..db416b7062 100644 --- a/ports/raspberrypi/common-hal/busio/UART.h +++ b/ports/raspberrypi/common-hal/busio/UART.h @@ -37,6 +37,8 @@ typedef struct { uint8_t tx_pin; uint8_t rx_pin; uint8_t cts_pin; + uint8_t rs485_dir_pin; + bool rs485_invert; uint8_t rts_pin; uint8_t uart_id; uint8_t uart_irq_id; diff --git a/ports/raspberrypi/common-hal/countio/Counter.c b/ports/raspberrypi/common-hal/countio/Counter.c index 0ae773bdf3..44db126656 100644 --- a/ports/raspberrypi/common-hal/countio/Counter.c +++ b/ports/raspberrypi/common-hal/countio/Counter.c @@ -2,7 +2,7 @@ #include "py/runtime.h" #include "py/mpstate.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/countio/Edge.h" #include "shared-bindings/digitalio/Pull.h" diff --git a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c index 22a61afa3f..ef431d8506 100644 --- a/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c +++ b/ports/raspberrypi/common-hal/digitalio/DigitalInOut.c @@ -32,7 +32,7 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" @@ -164,3 +164,28 @@ digitalio_pull_t common_hal_digitalio_digitalinout_get_pull( } return PULL_NONE; } + +bool common_hal_digitalio_has_reg_op(digitalinout_reg_op_t op) { + return true; +} + +volatile uint32_t *common_hal_digitalio_digitalinout_get_reg(digitalio_digitalinout_obj_t *self, digitalinout_reg_op_t op, uint32_t *mask) { + const uint8_t pin = self->pin->number; + + *mask = 1u << pin; + + switch (op) { + case DIGITALINOUT_REG_READ: + return (volatile uint32_t *)&sio_hw->gpio_in; + case DIGITALINOUT_REG_WRITE: + return &sio_hw->gpio_out; + case DIGITALINOUT_REG_SET: + return &sio_hw->gpio_set; + case DIGITALINOUT_REG_RESET: + return &sio_hw->gpio_clr; + case DIGITALINOUT_REG_TOGGLE: + return &sio_hw->gpio_togl; + default: + return NULL; + } +} diff --git a/ports/espressif/modules/wrover.c b/ports/raspberrypi/common-hal/floppyio/__init__.h similarity index 64% rename from ports/espressif/modules/wrover.c rename to ports/raspberrypi/common-hal/floppyio/__init__.h index 23fa7ee5ca..7dbf8a7af7 100644 --- a/ports/espressif/modules/wrover.c +++ b/ports/raspberrypi/common-hal/floppyio/__init__.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2022 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 @@ -24,15 +24,14 @@ * THE SOFTWARE. */ -#include "modules/module.h" +#pragma once -void never_reset_module_internal_pins(void) { - // SPI Flash and RAM - common_hal_never_reset_pin(&pin_GPIO26); - common_hal_never_reset_pin(&pin_GPIO27); - common_hal_never_reset_pin(&pin_GPIO28); - common_hal_never_reset_pin(&pin_GPIO29); - common_hal_never_reset_pin(&pin_GPIO30); - common_hal_never_reset_pin(&pin_GPIO31); - common_hal_never_reset_pin(&pin_GPIO32); -} +// empirical-ish from RP2040 @ 125MHz for floppy_flux_readinto +#define FLOPPYIO_SAMPLERATE (24000000) +// empirical-ish from RP2040 @ 125MHz for floppy_mfm_readinto +// my guess is these are slower because the more complex routine falls out of cache, but it's just +// speculation because the loops are very similar. When looking at raw bins with a modified +// version of adafruit_floppy, it can be seen that there are _two_ peaks for T2 and T3, rather +// than a single one, around 36 (mostly) and 43 (rarer), compared to a single peak around 48. +#define T2_5 (54) +#define T3_5 (75) diff --git a/ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c b/ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c new file mode 100644 index 0000000000..43cb43a9f9 --- /dev/null +++ b/ports/raspberrypi/common-hal/i2ctarget/I2CTarget.c @@ -0,0 +1,156 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus, Ken Stillson, im-redactd + * + * 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/i2ctarget/I2CTarget.h" + +#include "common-hal/busio/I2C.h" + +#include "py/mperrno.h" +#include "py/mphal.h" +#include "shared-bindings/busio/I2C.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "py/runtime.h" + +#include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" + +STATIC i2c_inst_t *i2c[2] = {i2c0, i2c1}; + +#define NO_PIN 0xff + +void common_hal_i2ctarget_i2c_target_construct(i2ctarget_i2c_target_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, + uint8_t *addresses, unsigned int num_addresses, bool smbus) { + self->peripheral = NULL; + + // I2C pins have a regular pattern. SCL is always odd and SDA is even. They match up in pairs + // so we can divide by two to get the instance. This pattern repeats. + size_t scl_instance = (scl->number / 2) % 2; + size_t sda_instance = (sda->number / 2) % 2; + if (scl->number % 2 == 1 && sda->number % 2 == 0 && scl_instance == sda_instance) { + self->peripheral = i2c[sda_instance]; + } + + if (self->peripheral == NULL) { + raise_ValueError_invalid_pins(); + } + + if ((i2c_get_hw(self->peripheral)->enable & I2C_IC_ENABLE_ENABLE_BITS) != 0) { + mp_raise_ValueError(translate("I2C peripheral in use")); + } + + if (num_addresses > 1) { + mp_raise_ValueError(translate("Only one address is allowed")); + } + + self->addresses = addresses; + self->num_addresses = num_addresses; + self->scl_pin = scl->number; + self->sda_pin = sda->number; + + // Have to specify a baudrate even if the i2c target does not use it + const uint32_t frequency = 400000; + i2c_init(self->peripheral, frequency); + + gpio_set_function(sda->number, GPIO_FUNC_I2C); + gpio_set_function(scl->number, GPIO_FUNC_I2C); + + gpio_set_pulls(sda->number, true, false); + gpio_set_pulls(scl->number, true, false); + + self->peripheral->hw->intr_mask |= I2C_IC_INTR_MASK_M_RESTART_DET_BITS; + i2c_set_slave_mode(self->peripheral, true, self->addresses[0]); + + return; +} + +bool common_hal_i2ctarget_i2c_target_deinited(i2ctarget_i2c_target_obj_t *self) { + return self->sda_pin == NO_PIN; +} + +void common_hal_i2ctarget_i2c_target_deinit(i2ctarget_i2c_target_obj_t *self) { + if (common_hal_i2ctarget_i2c_target_deinited(self)) { + return; + } + + i2c_deinit(self->peripheral); + + reset_pin_number(self->sda_pin); + reset_pin_number(self->scl_pin); + self->sda_pin = NO_PIN; + self->scl_pin = NO_PIN; + + return; +} + +static int i2c_peripheral_check_error(i2ctarget_i2c_target_obj_t *self, bool raise) { + return 0; +} + +int common_hal_i2ctarget_i2c_target_is_addressed(i2ctarget_i2c_target_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart) { + if (!((self->peripheral->hw->raw_intr_stat & I2C_IC_INTR_STAT_R_RX_FULL_BITS) || (self->peripheral->hw->raw_intr_stat & I2C_IC_INTR_STAT_R_RD_REQ_BITS))) { + return 0; + } + + *address = self->peripheral->hw->sar; + *is_read = !(self->peripheral->hw->raw_intr_stat & I2C_IC_INTR_STAT_R_RX_FULL_BITS); + *is_restart = ((self->peripheral->hw->raw_intr_stat & I2C_IC_RAW_INTR_STAT_RD_REQ_RESET) != 0); + + common_hal_i2ctarget_i2c_target_ack(self, true); + return 1; +} + +int common_hal_i2ctarget_i2c_target_read_byte(i2ctarget_i2c_target_obj_t *self, uint8_t *data) { + if (self->peripheral->hw->status & I2C_IC_STATUS_RFNE_BITS) { + *data = (uint8_t)self->peripheral->hw->data_cmd; + return 1; + } else { + return 0; + } +} + +int common_hal_i2ctarget_i2c_target_write_byte(i2ctarget_i2c_target_obj_t *self, uint8_t data) { + if (self->peripheral->hw->raw_intr_stat & I2C_IC_INTR_STAT_R_TX_ABRT_BITS) { + self->peripheral->hw->clr_tx_abrt; + } + + const size_t IC_TX_BUFFER_DEPTH = 16; + size_t space = IC_TX_BUFFER_DEPTH - self->peripheral->hw->txflr; + + if (space > 0) { + self->peripheral->hw->data_cmd = data; + self->peripheral->hw->clr_rd_req; + return 1; + } else { + return 0; + } +} + +void common_hal_i2ctarget_i2c_target_ack(i2ctarget_i2c_target_obj_t *self, bool ack) { + return; +} + +void common_hal_i2ctarget_i2c_target_close(i2ctarget_i2c_target_obj_t *self) { + return; +} diff --git a/shared-module/gamepadshift/GamePadShift.h b/ports/raspberrypi/common-hal/i2ctarget/I2CTarget.h similarity index 70% rename from shared-module/gamepadshift/GamePadShift.h rename to ports/raspberrypi/common-hal/i2ctarget/I2CTarget.h index 53aef50986..b47c51fbbb 100644 --- a/shared-module/gamepadshift/GamePadShift.h +++ b/ports/raspberrypi/common-hal/i2ctarget/I2CTarget.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries + * Copyright (c) 2022 Mark Komus, Ken Stillson, im-redactd * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,20 +24,23 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_GAMEPADSHIFT_GAMEPADSHIFT_H -#define MICROPY_INCLUDED_GAMEPADSHIFT_GAMEPADSHIFT_H +#ifndef MICROPY_INCLUDED_RPI_COMMON_HAL_I2C_TARGET_H +#define MICROPY_INCLUDED_RPI_COMMON_HAL_I2C_TARGET_H -#include - -#include "shared-bindings/digitalio/DigitalInOut.h" +#include "py/obj.h" +#include "common-hal/microcontroller/Pin.h" +#include "src/rp2_common/hardware_i2c/include/hardware/i2c.h" typedef struct { mp_obj_base_t base; - digitalio_digitalinout_obj_t *data_pin; - digitalio_digitalinout_obj_t *clock_pin; - digitalio_digitalinout_obj_t *latch_pin; - volatile uint8_t pressed; - volatile uint8_t last; -} gamepadshift_obj_t; -#endif // MICROPY_INCLUDED_GAMEPADSHIFT_GAMEPADSHIFT_H + uint8_t *addresses; + unsigned int num_addresses; + + i2c_inst_t *peripheral; + + uint8_t scl_pin; + uint8_t sda_pin; +} i2ctarget_i2c_target_obj_t; + +#endif MICROPY_INCLUDED_RPI_COMMON_HAL_BUSIO_I2C_TARGET_H diff --git a/ports/raspberrypi/common-hal/i2ctarget/__init__.c b/ports/raspberrypi/common-hal/i2ctarget/__init__.c new file mode 100644 index 0000000000..4ec26465ad --- /dev/null +++ b/ports/raspberrypi/common-hal/i2ctarget/__init__.c @@ -0,0 +1 @@ +// No i2ctarget module functions. diff --git a/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c b/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c index 45a3766897..3c5c57eea5 100644 --- a/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c +++ b/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c @@ -112,19 +112,19 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle NULL, 0, 0, 0, // sideset pins #endif false, // No sideset enable - NULL, // jump pin + NULL, PULL_NONE, // jump pin (1 << vertical_sync->number) | (1 << horizontal_reference->number) | (1 << data_clock->number), // wait gpio pins true, // exclusive pin use false, 32, false, // out settings false, // wait for txstall true, 32, true, // in settings - false); // Not user-interruptible. + false, // Not user-interruptible. + 2, 5); // wrap settings PIO pio = self->state_machine.pio; uint8_t pio_index = pio_get_index(pio); uint sm = self->state_machine.state_machine; - rp2pio_statemachine_set_wrap(&self->state_machine, 2, 5); } void common_hal_imagecapture_parallelimagecapture_deinit(imagecapture_parallelimagecapture_obj_t *self) { @@ -153,7 +153,7 @@ void common_hal_imagecapture_parallelimagecapture_singleshot_capture(imagecaptur pio_sm_exec(pio, sm, pio_encode_jmp(offset)); pio_sm_set_enabled(pio, sm, true); - common_hal_rp2pio_statemachine_readinto(&self->state_machine, bufinfo.buf, bufinfo.len, 4); + common_hal_rp2pio_statemachine_readinto(&self->state_machine, bufinfo.buf, bufinfo.len, 4, false); pio_sm_set_enabled(pio, sm, false); } diff --git a/ports/raspberrypi/common-hal/microcontroller/__init__.c b/ports/raspberrypi/common-hal/microcontroller/__init__.c index ed68835e71..3b656edc07 100644 --- a/ports/raspberrypi/common-hal/microcontroller/__init__.c +++ b/ports/raspberrypi/common-hal/microcontroller/__init__.c @@ -38,7 +38,7 @@ #include "supervisor/filesystem.h" #include "supervisor/port.h" #include "supervisor/shared/safe_mode.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2040/hardware_structs/include/hardware/structs/sio.h" #include "src/rp2_common/hardware_sync/include/hardware/sync.h" diff --git a/ports/raspberrypi/common-hal/neopixel_write/__init__.c b/ports/raspberrypi/common-hal/neopixel_write/__init__.c index 09388af481..d473285b02 100644 --- a/ports/raspberrypi/common-hal/neopixel_write/__init__.c +++ b/ports/raspberrypi/common-hal/neopixel_write/__init__.c @@ -35,23 +35,23 @@ uint64_t next_start_raw_ticks = 0; -// NeoPixels are 800khz bit streams. Zeroes are 1/3 duty cycle (~416ns) and ones -// are 2/3 duty cycle (~833ns). Each of the instructions below take 1/3 duty +// NeoPixels are 800khz bit streams. We are choosing zeros as <312ns hi, 936 lo> and ones +// and ones as <700 ns hi, 556 ns lo>. // cycle. The first two instructions always run while only one of the two final // instructions run per bit. We start with the low period because it can be -// longer than 1/3 period while waiting for more data. +// longer while waiting for more data. const uint16_t neopixel_program[] = { // bitloop: -// out x 1 side 0 [1]; Side-set still takes place before instruction stalls - 0x6121, -// jmp !x do_zero side 1 [1]; Branch on the bit we shifted out after 1/3 duty delay. Positive pulse - 0x1123, +// out x 1 side 0 [6]; Drive low. Side-set still takes place before instruction stalls. + 0x6621, +// jmp !x do_zero side 1 [3]; Branch on the bit we shifted out previous delay. Drive high. + 0x1323, // do_one: -// jmp bitloop side 1 [1]; Continue driving high, for a long pulse - 0x1100, +// jmp bitloop side 1 [4]; Continue driving high, for a one (long pulse) + 0x1400, // do_zero: -// nop side 0 [1]; Or drive low, for a short pulse - 0xa142 +// nop side 0 [4]; Or drive low, for a zero (short pulse) + 0xa442 }; void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, uint8_t *pixels, uint32_t num_bytes) { @@ -63,7 +63,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, uint32_t pins_we_use = 1 << digitalinout->pin->number; bool ok = rp2pio_statemachine_construct(&state_machine, neopixel_program, sizeof(neopixel_program) / sizeof(neopixel_program[0]), - 800000 * 6, // 800 khz * 6 cycles per bit + 12800000, // 12.8MHz, to get appropriate sub-bit times in PIO program. NULL, 0, // init program NULL, 1, // out NULL, 1, // in @@ -78,7 +78,8 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, false, 32, true, // RX setting we don't use false, // claim pins false, // Not user-interruptible. - false); // No sideset enable + false, // No sideset enable + 0, -1); // wrap if (!ok) { // Do nothing. Maybe bitbang? return; @@ -89,7 +90,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, while (port_get_raw_ticks(NULL) < next_start_raw_ticks) { } - common_hal_rp2pio_statemachine_write(&state_machine, pixels, num_bytes, 1 /* stride in bytes */); + common_hal_rp2pio_statemachine_write(&state_machine, pixels, num_bytes, 1 /* stride in bytes */, false); // Use a private deinit of the state machine that doesn't reset the pin. rp2pio_statemachine_deinit(&state_machine, true); diff --git a/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c b/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c index 51187a3429..96c89ade95 100644 --- a/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c +++ b/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c @@ -95,7 +95,7 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu } common_hal_rp2pio_statemachine_construct(&self->state_machine, - parallel_program, sizeof(parallel_program) / sizeof(parallel_program[0]), + parallel_program, MP_ARRAY_SIZE(parallel_program), frequency * 2, // frequency multiplied by 2 as 2 PIO instructions NULL, 0, // init data0, 8, 0, 255, // first out pin, # out pins @@ -103,13 +103,14 @@ void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbu NULL, 0, 0, 0, // first set pin write, 1, 0, 1, // first sideset pin false, // No sideset enable - NULL, // jump pin + NULL, PULL_NONE, // jump pin 0, // wait gpio pins true, // exclusive pin usage true, 8, true, // TX, auto pull every 8 bits. shift left to output msb first false, // wait for TX stall false, 32, true, // RX setting we don't use - false); // Not user-interruptible. + false, // Not user-interruptible. + 0, -1); // wrap settings common_hal_rp2pio_statemachine_never_reset(&self->state_machine); } @@ -160,7 +161,7 @@ void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->command, byte_type == DISPLAY_DATA); - common_hal_rp2pio_statemachine_write(&self->state_machine, data, data_length, 1); + common_hal_rp2pio_statemachine_write(&self->state_machine, data, data_length, 1, false); } void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t obj) { diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index e507cd16e8..346c0951ed 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -32,15 +32,15 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/pulseio/PulseIn.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "bindings/rp2pio/StateMachine.h" #include "common-hal/pulseio/PulseIn.h" #define NO_PIN 0xff #define MAX_PULSE 65535 -#define MIN_PULSE 10 +#define MIN_PULSE 0 -uint16_t pulsein_program[] = { +static const uint16_t pulsein_program[] = { 0x4001, // 1: in pins, 1 }; @@ -49,7 +49,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t), false); if (self->buffer == NULL) { - mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), maxlen * sizeof(uint16_t)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } self->pin = pin->number; self->maxlen = maxlen; @@ -57,47 +57,29 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, self->start = 0; self->len = 0; - bool ok = rp2pio_statemachine_construct(&self->state_machine, - pulsein_program, sizeof(pulsein_program) / sizeof(pulsein_program[0]), - 1000000, - NULL, 0, - NULL, 0, - pin, 1, - 0,0, - NULL, 0, - NULL, 0, - 1, 0, - NULL, // jump pin - 1 << self->pin, false, true, - false, 8, false, // TX, unused - false, - true, 32, true, // RX auto-push every 32 bits - false, // claim pins - false, // Not user-interruptible. - false); // No sideset enable + common_hal_rp2pio_statemachine_construct(&self->state_machine, + pulsein_program, MP_ARRAY_SIZE(pulsein_program), + 1000000, // frequency + NULL, 0, // init, init_len + NULL, 0, 0, 0, // first out pin, # out pins, initial_out_pin_state + pin, 1, 0, 0, // first in pin, # in pins + NULL, 0, 0, 0, // first set pin + NULL, 0, 0, 0, // first sideset pin + false, // No sideset enable + NULL, PULL_NONE, // jump pin, jmp_pull + 0, // wait gpio pins + true, // exclusive pin usage + false, 8, false, // TX, setting we don't use + false, // wait for TX stall + true, 32, true, // RX auto pull every 32 bits. shift left to output msb first + false, // Not user-interruptible. + 0, -1); // wrap settings - if (!ok) { - mp_raise_RuntimeError(translate("All state machines in use")); - } + common_hal_pulseio_pulsein_pause(self); - pio_sm_set_enabled(self->state_machine.pio,self->state_machine.state_machine, false); - pio_sm_clear_fifos(self->state_machine.pio,self->state_machine.state_machine); - self->last_level = self->idle_state; - self->level_count = 0; - self->buf_index = 0; - - pio_sm_set_in_pins(self->state_machine.pio,self->state_machine.state_machine,pin->number); common_hal_rp2pio_statemachine_set_interrupt_handler(&(self->state_machine),&common_hal_pulseio_pulsein_interrupt,self,PIO_IRQ0_INTE_SM0_RXNEMPTY_BITS); - // exec a set pindirs to 0 for input - pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0xe080); - // exec the appropriate wait for pin - if (self->idle_state == true) { - pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0x2020); - } else { - pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0x20a0); - } - pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, true); + common_hal_pulseio_pulsein_resume(self, 0); } bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t *self) { @@ -118,9 +100,10 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) { void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t *self) { pio_sm_restart(self->state_machine.pio, self->state_machine.state_machine); pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, false); + pio_sm_clear_fifos(self->state_machine.pio,self->state_machine.state_machine); self->last_level = self->idle_state; self->level_count = 0; - self->buf_index = 0; + self->paused = true; } void common_hal_pulseio_pulsein_interrupt(void *self_in) { pulseio_pulsein_obj_t *self = self_in; @@ -139,40 +122,29 @@ void common_hal_pulseio_pulsein_interrupt(void *self_in) { } else { uint32_t result = self->level_count; self->last_level = level; - self->level_count = 0; + self->level_count = 1; // Pulses that are longer than MAX_PULSE will return MAX_PULSE if (result > MAX_PULSE) { result = MAX_PULSE; } // return pulses that are not too short if (result > MIN_PULSE) { - self->buffer[self->buf_index] = (uint16_t)result; + size_t buf_index = (self->start + self->len) % self->maxlen; + self->buffer[buf_index] = (uint16_t)result; if (self->len < self->maxlen) { self->len++; - } - if (self->buf_index < self->maxlen) { - self->buf_index++; } else { - self->start = 0; - self->buf_index = 0; + self->start = (self->start + 1) % self->maxlen; } } } } } - -// check for a pulse thats too long (MAX_PULSE us) or maxlen reached, and reset - if ((self->level_count > MAX_PULSE) || (self->buf_index >= self->maxlen)) { - pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, false); - pio_sm_init(self->state_machine.pio, self->state_machine.state_machine, self->state_machine.offset, &self->state_machine.sm_config); - pio_sm_restart(self->state_machine.pio,self->state_machine.state_machine); - pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, true); - self->buf_index = 0; - self->start = 0; - } } void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, uint16_t trigger_duration) { + + common_hal_pulseio_pulsein_pause(self); // Send the trigger pulse. if (trigger_duration > 0) { gpio_set_function(self->pin,GPIO_FUNC_SIO); @@ -180,11 +152,8 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, gpio_put(self->pin, !self->idle_state); common_hal_mcu_delay_us((uint32_t)trigger_duration); gpio_set_function(self->pin,GPIO_FUNC_PIO0); - common_hal_mcu_delay_us(125); } - // Reconfigure the pin for PIO - gpio_set_function(self->pin, GPIO_FUNC_PIO0); // exec a wait for the selected pin to change state if (self->idle_state == true) { pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0x2020); @@ -192,12 +161,11 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0x20a0); } pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, true); + self->paused = false; } void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t *self) { - self->start = 0; self->len = 0; - self->buf_index = 0; } uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { @@ -207,12 +175,6 @@ uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { uint16_t value = self->buffer[self->start]; self->start = (self->start + 1) % self->maxlen; self->len--; - // if we are empty reset buffer pointer and counters - if (self->len == 0) { - self->start = 0; - self->buf_index = 0; - self->level_count = 0; - } return value; } @@ -225,7 +187,7 @@ uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t *self) { } bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t *self) { - return true; + return self->paused; } uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, @@ -234,7 +196,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, index += self->len; } if (index < 0 || index >= self->len) { - mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); + mp_arg_validate_index_range(index, 0, self->len, MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; return value; diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.h b/ports/raspberrypi/common-hal/pulseio/PulseIn.h index f2c4fc0d06..8694f75e62 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.h +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.h @@ -37,13 +37,13 @@ typedef struct { mp_obj_base_t base; uint8_t pin; bool idle_state; + bool paused; uint16_t maxlen; uint16_t *buffer; volatile bool last_level; volatile uint32_t level_count; volatile uint16_t len; volatile uint16_t start; - volatile uint16_t buf_index; rp2pio_statemachine_obj_t state_machine; } pulseio_pulsein_obj_t; diff --git a/ports/raspberrypi/common-hal/pulseio/PulseOut.c b/ports/raspberrypi/common-hal/pulseio/PulseOut.c index 7704fdff6f..881e003579 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseOut.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/microcontroller/__init__.h" #include "common-hal/pwmio/PWMOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2040/hardware_structs/include/hardware/structs/pwm.h" #include "src/rp2_common/hardware_gpio/include/hardware/gpio.h" #include "src/rp2_common/hardware_pwm/include/hardware/pwm.h" diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c index 3ef4fb57f3..e6f88f8894 100644 --- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c +++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c @@ -32,7 +32,7 @@ #include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/microcontroller/Processor.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "src/rp2040/hardware_regs/include/hardware/platform_defs.h" #include "src/rp2_common/hardware_clocks/include/hardware/clocks.h" @@ -259,7 +259,7 @@ void pwmio_pwmout_set_top(pwmio_pwmout_obj_t *self, uint16_t top) { void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t frequency) { if (frequency == 0 || frequency > (common_hal_mcu_processor_get_frequency() / 2)) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } target_slice_frequencies[self->slice] = frequency; diff --git a/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c b/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c index 1f15b010f7..0da12e5923 100644 --- a/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c @@ -86,17 +86,19 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode NULL, 0, 0, 0x1f, // set pins NULL, 0, 0, 0x1f, // sideset pins false, // No sideset enable - NULL, // jump pin + NULL, PULL_NONE, // jump pin 0, // wait gpio pins true, // exclusive pin use false, 32, false, // out settings false, // Wait for txstall false, 32, false, // in settings - false); // Not user-interruptible. + false, // Not user-interruptible. + 0, MP_ARRAY_SIZE(encoder) - 1 // wrap settings + ); // We're guaranteed by the init code that some output will be available promptly uint8_t quiescent_state; - common_hal_rp2pio_statemachine_readinto(&self->state_machine, &quiescent_state, 1, 1); + common_hal_rp2pio_statemachine_readinto(&self->state_machine, &quiescent_state, 1, 1, false); shared_module_softencoder_state_init(self, quiescent_state & 3); common_hal_rp2pio_statemachine_set_interrupt_handler(&self->state_machine, incrementalencoder_interrupt_handler, self, PIO_IRQ0_INTF_SM0_RXNEMPTY_BITS); diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index ac5a41652a..78703351d7 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -24,9 +24,12 @@ * THE SOFTWARE. */ +#include + #include "bindings/rp2pio/StateMachine.h" #include "common-hal/microcontroller/__init__.h" +#include "shared-bindings/digitalio/Pull.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" @@ -42,6 +45,8 @@ #include "py/objproperty.h" #include "py/runtime.h" +#define NO_DMA_CHANNEL (-1) + // Count how many state machines are using each pin. STATIC uint8_t _pin_reference_count[TOTAL_GPIO_COUNT]; STATIC uint32_t _current_program_id[NUM_PIOS][NUM_PIO_STATE_MACHINES]; @@ -51,6 +56,12 @@ STATIC bool _never_reset[NUM_PIOS][NUM_PIO_STATE_MACHINES]; STATIC uint32_t _current_pins[NUM_PIOS]; STATIC uint32_t _current_sm_pins[NUM_PIOS][NUM_PIO_STATE_MACHINES]; +STATIC int8_t _sm_dma_plus_one[NUM_PIOS][NUM_PIO_STATE_MACHINES]; + +#define SM_DMA_ALLOCATED(pio_index, sm) (_sm_dma_plus_one[(pio_index)][(sm)] != 0) +#define SM_DMA_GET_CHANNEL(pio_index, sm) (_sm_dma_plus_one[(pio_index)][(sm)] - 1) +#define SM_DMA_CLEAR_CHANNEL(pio_index, sm) (_sm_dma_plus_one[(pio_index)][(sm)] = 0) +#define SM_DMA_SET_CHANNEL(pio_isntance, sm, channel) (_sm_dma_plus_one[(pio_index)][(sm)] = (channel) + 1) STATIC PIO pio_instances[2] = {pio0, pio1}; typedef void (*interrupt_handler_type)(void *); @@ -70,8 +81,24 @@ static void rp2pio_statemachine_set_pull(uint32_t pull_pin_up, uint32_t pull_pin } } +STATIC void rp2pio_statemachine_clear_dma(int pio_index, int sm) { + if (SM_DMA_ALLOCATED(pio_index, sm)) { + int channel = SM_DMA_GET_CHANNEL(pio_index, sm); + uint32_t channel_mask = 1u << channel; + dma_hw->inte0 &= ~channel_mask; + if (!dma_hw->inte0) { + irq_set_mask_enabled(1 << DMA_IRQ_0, false); + } + MP_STATE_PORT(background_pio)[channel] = NULL; + dma_channel_abort(channel); + dma_channel_unclaim(channel); + } + SM_DMA_CLEAR_CHANNEL(pio_index, sm); +} + STATIC void _reset_statemachine(PIO pio, uint8_t sm, bool leave_pins) { uint8_t pio_index = pio_get_index(pio); + rp2pio_statemachine_clear_dma(pio_index, sm); uint32_t program_id = _current_program_id[pio_index][sm]; if (program_id == 0) { return; @@ -165,7 +192,8 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, bool auto_push, uint8_t push_threshold, bool in_shift_right, bool claim_pins, bool user_interruptible, - bool sideset_enable + bool sideset_enable, + int wrap_target, int wrap ) { // Create a program id that isn't the pointer so we can store it without storing the original object. uint32_t program_id = ~((uint32_t)program); @@ -289,7 +317,18 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, if (jmp_pin != NULL) { sm_config_set_jmp_pin(&c, jmp_pin->number); } - sm_config_set_wrap(&c, program_offset, program_offset + program_len - 1); + + mp_arg_validate_int_range(wrap, -1, program_len - 1, MP_QSTR_wrap); + if (wrap == -1) { + wrap = program_len - 1; + } + + mp_arg_validate_int_range(wrap_target, 0, program_len - 1, MP_QSTR_wrap_target); + + wrap += program_offset; + wrap_target += program_offset; + + sm_config_set_wrap(&c, wrap_target, wrap); sm_config_set_in_shift(&c, in_shift_right, auto_push, push_threshold); sm_config_set_out_shift(&c, out_shift_right, auto_pull, pull_threshold); @@ -318,6 +357,9 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, sm_config_set_fifo_join(&c, join); self->sm_config = c; + // no DMA allocated + SM_DMA_CLEAR_CHANNEL(pio_index, state_machine); + pio_sm_init(self->pio, self->state_machine, program_offset, &c); common_hal_rp2pio_statemachine_run(self, init, init_len); @@ -327,6 +369,9 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, } static uint32_t mask_and_rotate(const mcu_pin_obj_t *first_pin, uint32_t bit_count, uint32_t value) { + if (!first_pin) { + return 0; + } value = value & ((1 << bit_count) - 1); uint32_t shift = first_pin->number; return value << shift | value >> (32 - shift); @@ -342,13 +387,14 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, const mcu_pin_obj_t *first_set_pin, uint8_t set_pin_count, uint32_t initial_set_pin_state, uint32_t initial_set_pin_direction, const mcu_pin_obj_t *first_sideset_pin, uint8_t sideset_pin_count, uint32_t initial_sideset_pin_state, uint32_t initial_sideset_pin_direction, bool sideset_enable, - const mcu_pin_obj_t *jmp_pin, + const mcu_pin_obj_t *jmp_pin, digitalio_pull_t jmp_pull, uint32_t wait_gpio_mask, bool exclusive_pin_use, bool auto_pull, uint8_t pull_threshold, bool out_shift_right, bool wait_for_txstall, bool auto_push, uint8_t push_threshold, bool in_shift_right, - bool user_interruptible) { + bool user_interruptible, + int wrap_target, int wrap) { // First, check that all pins are free OR already in use by any PIO if exclusive_pin_use is false. uint32_t pins_we_use = wait_gpio_mask; @@ -393,7 +439,7 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, if (first_in_pin == NULL) { mp_raise_ValueError_varg(translate("Missing first_in_pin. Instruction %d waits based on pin"), i); } - if (wait_index > in_pin_count) { + if (wait_index >= in_pin_count) { mp_raise_ValueError_varg(translate("Instruction %d waits on input outside of count"), i); } } @@ -489,6 +535,16 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, // Deal with pull up/downs uint32_t pull_up = mask_and_rotate(first_in_pin, in_pin_count, pull_pin_up); uint32_t pull_down = mask_and_rotate(first_in_pin, in_pin_count, pull_pin_down); + + if (jmp_pin) { + uint32_t jmp_mask = mask_and_rotate(jmp_pin, 1, 0x1f); + if (jmp_pull == PULL_UP) { + pull_up |= jmp_mask; + } + if (jmp_pull == PULL_DOWN) { + pull_up |= jmp_mask; + } + } if (initial_pin_direction & (pull_up | pull_down)) { mp_raise_ValueError(translate("pull masks conflict with direction masks")); } @@ -510,7 +566,8 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, auto_push, push_threshold, in_shift_right, true /* claim pins */, user_interruptible, - sideset_enable); + sideset_enable, + wrap_target, wrap); if (!ok) { mp_raise_RuntimeError(translate("All state machines in use")); } @@ -567,6 +624,7 @@ void common_hal_rp2pio_statemachine_set_frequency(rp2pio_statemachine_obj_t *sel void rp2pio_statemachine_deinit(rp2pio_statemachine_obj_t *self, bool leave_pins) { common_hal_rp2pio_statemachine_stop(self); + (void)common_hal_rp2pio_statemachine_stop_background_write(self); uint8_t sm = self->state_machine; uint8_t pio_index = pio_get_index(self->pio); @@ -608,7 +666,7 @@ STATIC enum dma_channel_transfer_size _stride_to_dma_size(uint8_t stride) { static bool _transfer(rp2pio_statemachine_obj_t *self, const uint8_t *data_out, size_t out_len, uint8_t out_stride_in_bytes, - uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes) { + uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes, bool swap_out, bool swap_in) { // This implementation is based on SPI but varies because the tx and rx buffers // may be different lengths and occur at different times or speeds. @@ -619,13 +677,26 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, size_t len = MAX(out_len, in_len); bool tx = data_out != NULL; bool rx = data_in != NULL; - if (len >= dma_min_size_threshold) { + bool use_dma = len >= dma_min_size_threshold || swap_out || swap_in; + if (use_dma) { // Use DMA channels to service the two FIFOs if (tx) { chan_tx = dma_claim_unused_channel(false); + // DMA allocation failed... + if (chan_tx < 0) { + return false; + } } if (rx) { chan_rx = dma_claim_unused_channel(false); + // DMA allocation failed... + if (chan_rx < 0) { + // may need to free tx channel + if (chan_tx >= 0) { + dma_channel_unclaim(chan_tx); + } + return false; + } } } volatile uint8_t *tx_destination = NULL; @@ -643,7 +714,6 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, } } uint32_t stall_mask = 1 << (PIO_FDEBUG_TXSTALL_LSB + self->state_machine); - bool use_dma = (!rx || chan_rx >= 0) && (!tx || chan_tx >= 0); if (use_dma) { dma_channel_config c; uint32_t channel_mask = 0; @@ -653,6 +723,7 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, channel_config_set_dreq(&c, self->tx_dreq); channel_config_set_read_increment(&c, true); channel_config_set_write_increment(&c, false); + channel_config_set_bswap(&c, swap_out); dma_channel_configure(chan_tx, &c, tx_destination, data_out, @@ -666,6 +737,7 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, channel_config_set_dreq(&c, self->rx_dreq); channel_config_set_read_increment(&c, false); channel_config_set_write_increment(&c, true); + channel_config_set_bswap(&c, swap_in); dma_channel_configure(chan_rx, &c, data_in, rx_source, @@ -756,27 +828,27 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, // TODO: Provide a way around these checks in case someone wants to use the FIFO // with manually run code. -bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len, uint8_t stride_in_bytes) { +bool common_hal_rp2pio_statemachine_write(rp2pio_statemachine_obj_t *self, const uint8_t *data, size_t len, uint8_t stride_in_bytes, bool swap) { if (!self->out) { mp_raise_RuntimeError(translate("No out in program")); } - return _transfer(self, data, len, stride_in_bytes, NULL, 0, 0); + return _transfer(self, data, len, stride_in_bytes, NULL, 0, 0, swap, false); } -bool common_hal_rp2pio_statemachine_readinto(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t stride_in_bytes) { +bool common_hal_rp2pio_statemachine_readinto(rp2pio_statemachine_obj_t *self, uint8_t *data, size_t len, uint8_t stride_in_bytes, bool swap) { if (!self->in) { mp_raise_RuntimeError(translate("No in in program")); } - return _transfer(self, NULL, 0, 0, data, len, stride_in_bytes); + return _transfer(self, NULL, 0, 0, data, len, stride_in_bytes, false, swap); } bool common_hal_rp2pio_statemachine_write_readinto(rp2pio_statemachine_obj_t *self, const uint8_t *data_out, size_t out_len, uint8_t out_stride_in_bytes, - uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes) { + uint8_t *data_in, size_t in_len, uint8_t in_stride_in_bytes, bool swap_out, bool swap_in) { if (!self->in || !self->out) { mp_raise_RuntimeError(translate("No in or out in program")); } - return _transfer(self, data_out, out_len, out_stride_in_bytes, data_in, in_len, in_stride_in_bytes); + return _transfer(self, data_out, out_len, out_stride_in_bytes, data_in, in_len, in_stride_in_bytes, swap_out, swap_in); } bool common_hal_rp2pio_statemachine_get_rxstall(rp2pio_statemachine_obj_t *self) { @@ -793,6 +865,18 @@ void common_hal_rp2pio_statemachine_clear_rxfifo(rp2pio_statemachine_obj_t *self self->pio->fdebug = stall_mask; } +bool common_hal_rp2pio_statemachine_get_txstall(rp2pio_statemachine_obj_t *self) { + uint32_t stall_mask = 1 << (PIO_FDEBUG_TXSTALL_LSB + self->state_machine); + return (self->pio->fdebug & stall_mask) != 0; +} + +void common_hal_rp2pio_statemachine_clear_txstall(rp2pio_statemachine_obj_t *self) { + uint8_t level = pio_sm_get_rx_fifo_level(self->pio, self->state_machine); + uint32_t stall_mask = 1 << (PIO_FDEBUG_TXSTALL_LSB + self->state_machine); + self->pio->fdebug = stall_mask; +} + + size_t common_hal_rp2pio_statemachine_get_in_waiting(rp2pio_statemachine_obj_t *self) { uint8_t level = pio_sm_get_rx_fifo_level(self->pio, self->state_machine); return level; @@ -835,9 +919,119 @@ uint8_t rp2pio_statemachine_program_offset(rp2pio_statemachine_obj_t *self) { return _current_program_offset[pio_index][sm]; } -void rp2pio_statemachine_set_wrap(rp2pio_statemachine_obj_t *self, uint wrap_target, uint wrap) { +bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t *self, const sm_buf_info *once, const sm_buf_info *loop, uint8_t stride_in_bytes, bool swap) { + uint8_t pio_index = pio_get_index(self->pio); uint8_t sm = self->state_machine; - uint8_t offset = rp2pio_statemachine_program_offset(self); - pio_sm_set_wrap(self->pio, sm, offset + wrap_target, offset + wrap); + int pending_buffers = (once->info.len != 0) + (loop->info.len != 0); + if (!once->info.len) { + once = loop; + } + + if (SM_DMA_ALLOCATED(pio_index, sm)) { + if (stride_in_bytes != self->background_stride_in_bytes) { + mp_raise_ValueError(translate("Mismatched data size")); + } + if (swap != self->byteswap) { + mp_raise_ValueError(translate("Mismatched swap flag")); + } + + while (self->pending_buffers) { + RUN_BACKGROUND_TASKS; + if (self->user_interruptible && mp_hal_is_interrupted()) { + return false; + } + } + + common_hal_mcu_disable_interrupts(); + self->once = *once; + self->loop = *loop; + self->pending_buffers = pending_buffers; + + if (self->dma_completed && self->once.info.len) { + rp2pio_statemachine_dma_complete(self, SM_DMA_GET_CHANNEL(pio_index, sm)); + self->dma_completed = false; + } + + common_hal_mcu_enable_interrupts(); + + return true; + } + + int channel = dma_claim_unused_channel(false); + if (channel == -1) { + return false; + } + + SM_DMA_SET_CHANNEL(pio_index, sm, channel); + + volatile uint8_t *tx_destination = (volatile uint8_t *)&self->pio->txf[self->state_machine]; + + self->tx_dreq = pio_get_dreq(self->pio, self->state_machine, true); + + dma_channel_config c; + + self->current = *once; + self->once = *loop; + self->loop = *loop; + self->pending_buffers = pending_buffers; + self->dma_completed = false; + self->background_stride_in_bytes = stride_in_bytes; + self->byteswap = swap; + + c = dma_channel_get_default_config(channel); + channel_config_set_transfer_data_size(&c, _stride_to_dma_size(stride_in_bytes)); + channel_config_set_dreq(&c, self->tx_dreq); + channel_config_set_read_increment(&c, true); + channel_config_set_write_increment(&c, false); + channel_config_set_bswap(&c, swap); + dma_channel_configure(channel, &c, + tx_destination, + once->info.buf, + once->info.len / stride_in_bytes, + false); + + common_hal_mcu_disable_interrupts(); + MP_STATE_PORT(background_pio)[channel] = self; + dma_hw->inte0 |= 1u << channel; + irq_set_mask_enabled(1 << DMA_IRQ_0, true); + dma_start_channel_mask(1u << channel); + common_hal_mcu_enable_interrupts(); + + return true; +} + +void rp2pio_statemachine_dma_complete(rp2pio_statemachine_obj_t *self, int channel) { + self->current = self->once; + self->once = self->loop; + + if (self->current.info.buf) { + if (self->pending_buffers > 0) { + self->pending_buffers--; + } + dma_channel_set_read_addr(channel, self->current.info.buf, false); + dma_channel_set_trans_count(channel, self->current.info.len / self->background_stride_in_bytes, true); + } else { + self->dma_completed = true; + self->pending_buffers = 0; // should be a no-op + } +} + +bool common_hal_rp2pio_statemachine_stop_background_write(rp2pio_statemachine_obj_t *self) { + uint8_t pio_index = pio_get_index(self->pio); + uint8_t sm = self->state_machine; + rp2pio_statemachine_clear_dma(pio_index, sm); + memset(&self->current, 0, sizeof(self->current)); + memset(&self->once, 0, sizeof(self->once)); + memset(&self->loop, 0, sizeof(self->loop)); + self->pending_buffers = 0; + return true; +} + +bool common_hal_rp2pio_statemachine_get_writing(rp2pio_statemachine_obj_t *self) { + return !self->dma_completed; +} + +int common_hal_rp2pio_statemachine_get_pending(rp2pio_statemachine_obj_t *self) { + return self->pending_buffers; } diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.h b/ports/raspberrypi/common-hal/rp2pio/StateMachine.h index 125e0fa68b..03dadc53b3 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.h +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.h @@ -32,6 +32,11 @@ #include "common-hal/microcontroller/Pin.h" #include "src/rp2_common/hardware_pio/include/hardware/pio.h" +typedef struct sm_buf_info { + mp_obj_t obj; + mp_buffer_info_t info; +} sm_buf_info; + typedef struct { mp_obj_base_t base; uint32_t pins; // Bitmask of what pins this state machine uses. @@ -54,6 +59,12 @@ typedef struct { bool in_shift_right; bool user_interruptible; uint8_t offset; + + // dma-related items + volatile int pending_buffers; + sm_buf_info current, once, loop; + int background_stride_in_bytes; + bool dma_completed, byteswap; } rp2pio_statemachine_obj_t; void reset_rp2pio_statemachine(void); @@ -76,12 +87,13 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, bool auto_push, uint8_t push_threshold, bool in_shift_right, bool claim_pins, bool interruptible, - bool sideset_enable); + bool sideset_enable, + int wrap_target, int wrap); uint8_t rp2pio_statemachine_program_offset(rp2pio_statemachine_obj_t *self); -void rp2pio_statemachine_set_wrap(rp2pio_statemachine_obj_t *self, uint wrap_target, uint wrap); void rp2pio_statemachine_deinit(rp2pio_statemachine_obj_t *self, bool leave_pins); +void rp2pio_statemachine_dma_complete(rp2pio_statemachine_obj_t *self, int channel); extern const mp_obj_type_t rp2pio_statemachine_type; diff --git a/ports/raspberrypi/common-hal/rtc/RTC.c b/ports/raspberrypi/common-hal/rtc/RTC.c index 9bd10abf70..9bfda0af31 100644 --- a/ports/raspberrypi/common-hal/rtc/RTC.c +++ b/ports/raspberrypi/common-hal/rtc/RTC.c @@ -92,5 +92,5 @@ int common_hal_rtc_get_calibration(void) { } void common_hal_rtc_set_calibration(int calibration) { - mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board")); + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); } diff --git a/ports/raspberrypi/link.ld b/ports/raspberrypi/link.ld index 62b1bd04b6..c9480f84db 100644 --- a/ports/raspberrypi/link.ld +++ b/ports/raspberrypi/link.ld @@ -68,6 +68,14 @@ SECTIONS /* bit of a hack right now to exclude all floating point and time critical (e.g. memset, memcpy) code from * FLASH ... we will include any thing excluded here in .data below by default */ *(.init) + + __property_getter_start = .; + *(.property_getter) + __property_getter_end = .; + __property_getset_start = .; + *(.property_getset) + __property_getset_end = .; + *(EXCLUDE_FILE(*libgcc.a: *libc.a:*lib_a-mem*.o *libm.a:) .text*) *(.fini) /* Pull all c'tors into .text */ diff --git a/ports/raspberrypi/mpconfigport.h b/ports/raspberrypi/mpconfigport.h index 0259ffd023..fd09d8a9ac 100644 --- a/ports/raspberrypi/mpconfigport.h +++ b/ports/raspberrypi/mpconfigport.h @@ -46,6 +46,7 @@ #define MICROPY_PORT_ROOT_POINTERS \ mp_obj_t counting[NUM_PWM_SLICES]; \ mp_obj_t playing_audio[NUM_DMA_CHANNELS]; \ + mp_obj_t background_pio[NUM_DMA_CHANNELS]; \ CIRCUITPY_COMMON_ROOT_POINTERS; #endif // __INCLUDED_MPCONFIGPORT_H diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk index 1dfb345f5d..fa1f0c153d 100644 --- a/ports/raspberrypi/mpconfigport.mk +++ b/ports/raspberrypi/mpconfigport.mk @@ -1,10 +1,12 @@ # All raspberrypi ports have longints. LONGINT_IMPL = MPZ +CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 1 CIRCUITPY_ALARM ?= 1 CIRCUITPY_RP2PIO ?= 1 CIRCUITPY_NEOPIXEL_WRITE ?= $(CIRCUITPY_RP2PIO) +CIRCUITPY_FLOPPYIO ?= 1 CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_DISPLAYIO) CIRCUITPY_FULL_BUILD ?= 1 CIRCUITPY_AUDIOMP3 ?= 1 @@ -18,12 +20,15 @@ CIRCUITPY_ROTARYIO_SOFTENCODER = 1 # Things that need to be implemented. # Use PWM interally CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 1 CIRCUITPY_NVM = 1 # Use PIO interally CIRCUITPY_PULSEIO ?= 1 CIRCUITPY_WATCHDOG ?= 1 +# Use of analogbufio +CIRCUITPY_ANALOGBUFIO = 1 + # Audio via PWM CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO ?= 1 @@ -34,6 +39,8 @@ CIRCUITPY_AUDIOMIXER = 1 INTERNAL_LIBM = 1 +CIRCUITPY_BUILD_EXTENSIONS ?= uf2 + # Number of USB endpoint pairs. USB_NUM_ENDPOINT_PAIRS = 8 diff --git a/ports/raspberrypi/sdk b/ports/raspberrypi/sdk index 2062372d20..2e6142b15b 160000 --- a/ports/raspberrypi/sdk +++ b/ports/raspberrypi/sdk @@ -1 +1 @@ -Subproject commit 2062372d203b372849d573f252cf7c6dc2800c0a +Subproject commit 2e6142b15b8a75c1227dd3edbe839193b2bf9041 diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 48b0000a65..afde51bdc0 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -88,8 +88,6 @@ else CFLAGS += -DNDEBUG OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions CFLAGS += -ggdb3 - # TODO: Test with -flto - # CFLAGS += -flto endif # to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk @@ -302,11 +300,11 @@ $(BUILD)/firmware.hex: $(BUILD)/firmware.elf $(BUILD)/firmware.uf2: $(BUILD)/firmware.hex $(ECHO) "Create $@" - $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f 0x57755a57 -b $(BOOTLOADER_OFFSET) -c -o "$(BUILD)/firmware.uf2" $^ + $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -b $(BOOTLOADER_OFFSET) -c -o "$(BUILD)/firmware.uf2" $^ flash: $(BUILD)/firmware.bin $(ECHO) "Writing $< to the board" - dfu-util -a 0 --dfuse-address 0x08000000 -D $(BUILD)/firmware.bin + dfu-util -a 0 --dfuse-address $(BOOTLOADER_OFFSET) -D $(BUILD)/firmware.bin include $(TOP)/py/mkrules.mk diff --git a/ports/stm/boards/STM32L4R5_boot.ld b/ports/stm/boards/STM32L4R5_boot.ld index 16204205e6..ab34b281a8 100644 --- a/ports/stm/boards/STM32L4R5_boot.ld +++ b/ports/stm/boards/STM32L4R5_boot.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 4K /* ISR vector. Kind of wasteful. */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08011000, LENGTH = 1024K-128K-64K-4K /* For now, limit to 1MB so that bank switching is still possible. */ - FLASH_FS (rw) : ORIGIN = 0x080e0000, LENGTH = 128K + FLASH_FS (rw) : ORIGIN = 0x08100000, LENGTH = 1024K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K } diff --git a/ports/stm/boards/STM32L4R5_default.ld b/ports/stm/boards/STM32L4R5_default.ld index 1f6e04f6be..1bffcee04e 100644 --- a/ports/stm/boards/STM32L4R5_default.ld +++ b/ports/stm/boards/STM32L4R5_default.ld @@ -8,7 +8,7 @@ MEMORY FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */ FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 4K /* ISR vector. Kind of wasteful. */ FLASH_FIRMWARE (rx) : ORIGIN = 0x08001000, LENGTH = 1024K-128K-4K /* For now, limit to 1MB so that bank switching is still possible. */ - FLASH_FS (rw) : ORIGIN = 0x080e0000, LENGTH = 128K + FLASH_FS (rw) : ORIGIN = 0x08100000, LENGTH = 1024K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K } diff --git a/ports/stm/boards/espruino_pico/board.c b/ports/stm/boards/espruino_pico/board.c index 4286717446..fb1ce4fb83 100644 --- a/ports/stm/boards/espruino_pico/board.c +++ b/ports/stm/boards/espruino_pico/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/espruino_wifi/board.c b/ports/stm/boards/espruino_wifi/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/espruino_wifi/board.c +++ b/ports/stm/boards/espruino_wifi/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/feather_stm32f405_express/board.c b/ports/stm/boards/feather_stm32f405_express/board.c index 4286717446..fb1ce4fb83 100644 --- a/ports/stm/boards/feather_stm32f405_express/board.c +++ b/ports/stm/boards/feather_stm32f405_express/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index 59ba948237..e4d362bbfa 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -104,14 +104,14 @@ void board_init(void) { sizeof(display_init_sequence), &pin_PB03, NO_BRIGHTNESS_COMMAND, - 1.0f, // brightness (ignored) - false, // auto_brightness + 1.0f, // brightness false, // single_byte_bounds false, // data_as_commands true, // auto_refresh 60, // native_frames_per_second true, // backlight_on_high - false); // SH1107_addressing + false, // SH1107_addressing + 50000); // backlight pwm frequency board_buzz_obj.base.type = &audiopwmio_pwmaudioout_type; common_hal_audiopwmio_pwmaudioout_construct(&board_buzz_obj, @@ -119,13 +119,4 @@ void board_init(void) { never_reset_pin_number(pin_PB08.port, pin_PB08.number); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index 15ae33c4c8..3bbfb7eec8 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -13,6 +13,8 @@ MCU_SERIES = F4 MCU_VARIANT = STM32F401xE MCU_PACKAGE = LQFP64 +CIRCUITPY_BUILD_EXTENSIONS = uf2 + OPTIMIZATION_FLAGS = -Os LD_COMMON = boards/common_default.ld @@ -26,5 +28,6 @@ CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_GIFIO = 0 CIRCUITPY_ULAB = 0 CIRCUITPY_STAGE = 1 +CIRCUITPY_ZLIB = 0 FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/meowbit diff --git a/ports/stm/boards/nucleo_f746zg/board.c b/ports/stm/boards/nucleo_f746zg/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/nucleo_f746zg/board.c +++ b/ports/stm/boards/nucleo_f746zg/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h index c4399f5a3d..bde2c3ec73 100644 --- a/ports/stm/boards/nucleo_f746zg/mpconfigboard.h +++ b/ports/stm/boards/nucleo_f746zg/mpconfigboard.h @@ -46,5 +46,5 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) // ST boards use the STLink clock signal #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) -#define CIRCUITPY_DEBUG_UART_TX (&pin_PD08) -#define CIRCUITPY_DEBUG_UART_RX (&pin_PD09) +#define CIRCUITPY_CONSOLE_UART_TX (&pin_PD08) +#define CIRCUITPY_CONSOLE_UART_RX (&pin_PD09) diff --git a/ports/stm/boards/nucleo_f767zi/board.c b/ports/stm/boards/nucleo_f767zi/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/nucleo_f767zi/board.c +++ b/ports/stm/boards/nucleo_f767zi/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/nucleo_h743zi_2/board.c b/ports/stm/boards/nucleo_h743zi_2/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/nucleo_h743zi_2/board.c +++ b/ports/stm/boards/nucleo_h743zi_2/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/openmv_h7/board.c b/ports/stm/boards/openmv_h7/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/openmv_h7/board.c +++ b/ports/stm/boards/openmv_h7/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/pyb_nano_v2/board.c b/ports/stm/boards/pyb_nano_v2/board.c index 4286717446..fb1ce4fb83 100644 --- a/ports/stm/boards/pyb_nano_v2/board.c +++ b/ports/stm/boards/pyb_nano_v2/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk index 3ba45e0c5b..c8b548c50f 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk @@ -16,10 +16,4 @@ LD_FILE = boards/STM32F411_fs.ld # Too big for the flash CIRCUITPY_AUDIOCORE = 0 CIRCUITPY_AUDIOPWMIO = 0 -CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BLEIO_HCI = 0 -CIRCUITPY_BUSDEVICE = 0 -CIRCUITPY_GIFIO = 0 -CIRCUITPY_KEYPAD = 0 -CIRCUITPY_MSGPACK = 0 -CIRCUITPY_ONEWIREIO = 0 diff --git a/ports/stm/boards/pyboard_v11/board.c b/ports/stm/boards/pyboard_v11/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/pyboard_v11/board.c +++ b/ports/stm/boards/pyboard_v11/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/sparkfun_stm32_thing_plus/mpconfigboard.mk b/ports/stm/boards/sparkfun_stm32_thing_plus/mpconfigboard.mk index 62d0136be5..24505eb23d 100644 --- a/ports/stm/boards/sparkfun_stm32_thing_plus/mpconfigboard.mk +++ b/ports/stm/boards/sparkfun_stm32_thing_plus/mpconfigboard.mk @@ -19,3 +19,5 @@ LD_BOOT = boards/STM32F405_boot.ld UF2_OFFSET = 0x8010000 CIRCUITPY_RGBMATRIX ?= 1 + +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 diff --git a/ports/stm/boards/sparkfun_stm32f405_micromod/board.c b/ports/stm/boards/sparkfun_stm32f405_micromod/board.c index 4286717446..f081e7fa90 100644 --- a/ports/stm/boards/sparkfun_stm32f405_micromod/board.c +++ b/ports/stm/boards/sparkfun_stm32f405_micromod/board.c @@ -27,16 +27,4 @@ #include "supervisor/board.h" #include "mpconfigboard.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/stm32f411ce_blackpill/board.c b/ports/stm/boards/stm32f411ce_blackpill/board.c index 4286717446..fb1ce4fb83 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/board.c +++ b/ports/stm/boards/stm32f411ce_blackpill/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/stm32f411ce_blackpill_with_flash/board.c b/ports/stm/boards/stm32f411ce_blackpill_with_flash/board.c index 4286717446..fb1ce4fb83 100644 --- a/ports/stm/boards/stm32f411ce_blackpill_with_flash/board.c +++ b/ports/stm/boards/stm32f411ce_blackpill_with_flash/board.c @@ -25,18 +25,5 @@ */ #include "supervisor/board.h" -#include "mpconfigboard.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/stm32f411ve_discovery/board.c b/ports/stm/boards/stm32f411ve_discovery/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/stm32f411ve_discovery/board.c +++ b/ports/stm/boards/stm32f411ve_discovery/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/stm32f412zg_discovery/board.c b/ports/stm/boards/stm32f412zg_discovery/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/stm32f412zg_discovery/board.c +++ b/ports/stm/boards/stm32f412zg_discovery/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/stm32f4_discovery/board.c b/ports/stm/boards/stm32f4_discovery/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/stm32f4_discovery/board.c +++ b/ports/stm/boards/stm32f4_discovery/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/stm32f746g_discovery/board.c b/ports/stm/boards/stm32f746g_discovery/board.c index 8f35532627..56c90bd8c6 100644 --- a/ports/stm/boards/stm32f746g_discovery/board.c +++ b/ports/stm/boards/stm32f746g_discovery/board.c @@ -48,13 +48,4 @@ void board_init(void) { never_reset_pin_number(10, 3); } -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/swan_r5/board.c b/ports/stm/boards/swan_r5/board.c index 5ad6d464bf..602fd87537 100644 --- a/ports/stm/boards/swan_r5/board.c +++ b/ports/stm/boards/swan_r5/board.c @@ -30,20 +30,42 @@ #include "stm32l4xx.h" #include "stm32l4r5xx.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/digitalio/Direction.h" +#include "shared-bindings/digitalio/DriveMode.h" +#include "board.h" + +digitalio_digitalinout_obj_t power_pin = { .base.type = &digitalio_digitalinout_type }; +digitalio_digitalinout_obj_t discharge_pin = { .base.type = &digitalio_digitalinout_type }; + void initialize_discharge_pin(void) { + /* Initialize the 3V3 discharge to be OFF and the output power to be ON */ __HAL_RCC_GPIOE_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + + + common_hal_digitalio_digitalinout_construct(&power_pin, &pin_PE04); + common_hal_digitalio_digitalinout_construct(&discharge_pin, &pin_PE06); + common_hal_digitalio_digitalinout_never_reset(&power_pin); + common_hal_digitalio_digitalinout_never_reset(&discharge_pin); + GPIO_InitTypeDef GPIO_InitStruct; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; + /* Set the DISCHARGE pin and the USB_DETECT pin to FLOAT */ + GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Pin = GPIO_PIN_6; - HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); - HAL_GPIO_WritePin(GPIOE, GPIO_PIN_6, GPIO_PIN_SET); + HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); /* PE6 DISCHRG */ + HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); /* PC6 is USB_DETECT */ + + /* Turn on the 3V3 regulator */ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Speed = GPIO_SPEED_LOW; GPIO_InitStruct.Pin = GPIO_PIN_4; HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); HAL_GPIO_WritePin(GPIOE, GPIO_PIN_4, GPIO_PIN_SET); + } void board_init(void) { @@ -53,15 +75,21 @@ void board_init(void) { // Set tick interrupt priority, default HAL value is intentionally invalid // Without this, USB does not function. HAL_InitTick((1UL << __NVIC_PRIO_BITS) - 1UL); -} -bool board_requests_safe_mode(void) { - return false; + __HAL_RCC_GPIOE_CLK_ENABLE(); + GPIO_InitTypeDef GPIO_InitStruct; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_LOW; + GPIO_InitStruct.Pin = GPIO_PIN_2; + HAL_GPIO_Init(GPIOE, &GPIO_InitStruct); + HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, GPIO_PIN_SET); + HAL_Delay(50); + HAL_GPIO_WritePin(GPIOE, GPIO_PIN_2, GPIO_PIN_RESET); } void reset_board(void) { initialize_discharge_pin(); } -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/swan_r5/board.h b/ports/stm/boards/swan_r5/board.h new file mode 100644 index 0000000000..56c62c34a0 --- /dev/null +++ b/ports/stm/boards/swan_r5/board.h @@ -0,0 +1,10 @@ +#ifndef _BOARDS_SWAN_R5_BOARD_H_ +#define _BOARDS_SWAN_R5_BOARD_H_ + +#include "common-hal/digitalio/DigitalInOut.h" + +extern digitalio_digitalinout_obj_t power_pin; +extern digitalio_digitalinout_obj_t discharge_pin; + + +#endif // _BOARDS_SWAN_R5_BOARD_H_ diff --git a/ports/stm/boards/swan_r5/mpconfigboard.h b/ports/stm/boards/swan_r5/mpconfigboard.h index da07d6530b..94cc58ff9d 100644 --- a/ports/stm/boards/swan_r5/mpconfigboard.h +++ b/ports/stm/boards/swan_r5/mpconfigboard.h @@ -64,3 +64,6 @@ #define DEFAULT_UART_BUS_RX (&pin_PA10) #define DEFAULT_UART_BUS_TX (&pin_PA09) + +#define SWAN_R5_DISCHARGE_3V3 (&pin_PE06) +#define SWAN_R5_ENABLE_3V3 (&pin_PE04) diff --git a/ports/stm/boards/swan_r5/mpconfigboard.mk b/ports/stm/boards/swan_r5/mpconfigboard.mk index 24b73e332d..2ebaa9c23f 100644 --- a/ports/stm/boards/swan_r5/mpconfigboard.mk +++ b/ports/stm/boards/swan_r5/mpconfigboard.mk @@ -14,6 +14,7 @@ LD_DEFAULT = boards/STM32L4R5_default.ld # UF2 boot option LD_BOOT = boards/STM32L4R5_boot.ld UF2_OFFSET = 0x8010000 +UF2_BOOTLOADER ?= 1 # Turn all of the below off while trying to get the thing to run # These modules are implemented in ports//common-hal: @@ -41,7 +42,7 @@ CIRCUITPY_PWMIO = 1 CIRCUITPY_AUDIOPWMIO = 1 CIRCUITPY_CANIO = 0 CIRCUITPY_AUDIOBUSIO = 0 -CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_I2CTARGET = 0 # Requires SPI, PulseIO (stub ok): CIRCUITPY_DISPLAYIO = 0 @@ -49,8 +50,6 @@ CIRCUITPY_DISPLAYIO = 0 # any port once their prerequisites in common-hal are complete. # Requires DigitalIO: CIRCUITPY_BITBANGIO = 1 -# Requires DigitalIO -CIRCUITPY_GAMEPADSHIFT = 1 # Requires neopixel_write or SPI (dotstar) CIRCUITPY_PIXELBUF = 0 # Requires OS @@ -71,3 +70,6 @@ CIRCUITPY_BLEIO = 0 CIRCUITPY_BUSDEVICE = 0 CIRCUITPY_KEYPAD = 1 CIRCUITPY_RGBMATRIX = 0 +CIRCUITPY_RTC = 1 + +CIRCUITPY_BUILD_EXTENSIONS = bin,uf2 diff --git a/ports/stm/boards/swan_r5/pins.c b/ports/stm/boards/swan_r5/pins.c index f630d05997..cf97c3587a 100644 --- a/ports/stm/boards/swan_r5/pins.c +++ b/ports/stm/boards/swan_r5/pins.c @@ -1,14 +1,24 @@ #include "py/objtuple.h" #include "shared-bindings/board/__init__.h" +#include "board.h" -// Core Feather Pins -STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS +// extended pins +STATIC const mp_rom_map_elem_t board_module_carrier_table[] = { + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PD09) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PD08) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PF15) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PE13) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PE03) }, - { MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), MP_ROM_PTR(&pin_PE04) }, - { MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), MP_ROM_PTR(&pin_PE06) }, - { MP_ROM_QSTR(MP_QSTR_DISABLE_DISCHARGING), MP_ROM_TRUE }, - { MP_ROM_QSTR(MP_QSTR_ENABLE_DISCHARGING), MP_ROM_FALSE }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PD01) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PD00) }, + + { MP_ROM_QSTR(MP_QSTR_RTS), MP_ROM_PTR(&pin_PG12) }, + { MP_ROM_QSTR(MP_QSTR_CTS), MP_ROM_PTR(&pin_PB04) }, + { MP_ROM_QSTR(MP_QSTR_RX0), MP_ROM_PTR(&pin_PG08) }, + { MP_ROM_QSTR(MP_QSTR_TX0), MP_ROM_PTR(&pin_PG07) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, @@ -16,34 +26,105 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PC01) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PC02) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PE01) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_SCL3), MP_ROM_PTR(&pin_PC00) }, + { MP_ROM_QSTR(MP_QSTR_SDA3), MP_ROM_PTR(&pin_PC09) }, + + { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_PD06) }, + { MP_ROM_QSTR(MP_QSTR_RTS2), MP_ROM_PTR(&pin_PD04) }, + { MP_ROM_QSTR(MP_QSTR_CTS2), MP_ROM_PTR(&pin_PD03) }, + { MP_ROM_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_RTS3), MP_ROM_PTR(&pin_PD02) }, + { MP_ROM_QSTR(MP_QSTR_CTS3), MP_ROM_PTR(&pin_PB13) }, + + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) }, + { MP_ROM_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_PF01) }, + { MP_ROM_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_PF00) }, + + { MP_ROM_QSTR(MP_QSTR_QEN), MP_ROM_PTR(&pin_PD05) }, + { MP_ROM_QSTR(MP_QSTR_QCS), MP_ROM_PTR(&pin_PC11) }, + { MP_ROM_QSTR(MP_QSTR_QCLK), MP_ROM_PTR(&pin_PE10) }, + + { MP_ROM_QSTR(MP_QSTR_EN), MP_ROM_PTR(&pin_PE04) }, + { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA04) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PF12) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PF13) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, + { MP_ROM_QSTR(MP_QSTR_QIO3), MP_ROM_PTR(&pin_PE15) }, + { MP_ROM_QSTR(MP_QSTR_QIO2), MP_ROM_PTR(&pin_PE14) }, + { MP_ROM_QSTR(MP_QSTR_QIO1), MP_ROM_PTR(&pin_PB00) }, + { MP_ROM_QSTR(MP_QSTR_QIO0), MP_ROM_PTR(&pin_PE12) }, + +}; + +MP_DEFINE_CONST_DICT(board_module_carrier, board_module_carrier_table); + +const mp_obj_type_t carrier_type = { + { &mp_type_type }, + .name = MP_QSTR_Ext, + .locals_dict = (mp_obj_dict_t *)&board_module_carrier, +}; + + +// Core Feather Pins +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_ext), MP_ROM_PTR(&carrier_type) }, + + { MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), &power_pin }, + { MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), &discharge_pin }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, // PWM, ADC + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, // PWM, ADC + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, // ADC + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PC01) }, // ADC + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, // ADC + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, // ADC + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_BUTTON_USR), MP_ROM_PTR(&pin_PC13) }, { MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_PE04) }, - { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PB02) }, // boot button, but looks like it's wired to GND on the schematic + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA04) }, // DAC1 output also - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) }, // PWM + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) }, // PWM + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) }, // PWM + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA04) }, // ADC, DAC1 output also + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) }, // ADC, PWM + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) }, // ADC, PWM { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PE02) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, // DAC1 output also + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, // ADC, PWM, DAC2 output also - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) }, // PWM + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) }, // PWM { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA04) }, // D10 { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_PA05) }, // D13 { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PD00) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PD01) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, // PWM? + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) }, // PWM? - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA09) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA09) }, // ADC, PWM + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA10) }, // PWM { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, diff --git a/ports/stm/boards/thunderpack_v11/board.c b/ports/stm/boards/thunderpack_v11/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/thunderpack_v11/board.c +++ b/ports/stm/boards/thunderpack_v11/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/thunderpack_v11/mpconfigboard.mk b/ports/stm/boards/thunderpack_v11/mpconfigboard.mk index 5b5c098e16..0aa8ce6746 100644 --- a/ports/stm/boards/thunderpack_v11/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v11/mpconfigboard.mk @@ -21,3 +21,4 @@ CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_VECTORIO = 0 CIRCUITPY_ULAB = 0 +CIRCUITPY_ZLIB = 0 diff --git a/ports/stm/boards/thunderpack_v12/board.c b/ports/stm/boards/thunderpack_v12/board.c index b4070e72dc..fb1ce4fb83 100644 --- a/ports/stm/boards/thunderpack_v12/board.c +++ b/ports/stm/boards/thunderpack_v12/board.c @@ -26,16 +26,4 @@ #include "supervisor/board.h" -void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - -} - -void board_deinit(void) { -} +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk index 16a0c60f2a..526415ca30 100644 --- a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk @@ -14,6 +14,7 @@ EXTERNAL_FLASH_DEVICES = GD25Q16C CIRCUITPY_NVM = 1 CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_ZLIB = 0 MCU_SERIES = F4 MCU_VARIANT = STM32F411xE diff --git a/ports/stm/common-hal/alarm/__init__.c b/ports/stm/common-hal/alarm/__init__.c index 466c2d5199..26099b0503 100644 --- a/ports/stm/common-hal/alarm/__init__.c +++ b/ports/stm/common-hal/alarm/__init__.c @@ -144,7 +144,10 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj return wake_alarm; } -void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms) { +void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms, size_t n_dios, digitalio_digitalinout_obj_t **preserve_dios) { + if (n_dios > 0) { + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_preserve_dios); + } _setup_sleep_alarms(true, n_alarms, alarms); } diff --git a/ports/stm/common-hal/alarm/time/TimeAlarm.c b/ports/stm/common-hal/alarm/time/TimeAlarm.c index 6fb1fc629d..2eb8ee4a81 100644 --- a/ports/stm/common-hal/alarm/time/TimeAlarm.c +++ b/ports/stm/common-hal/alarm/time/TimeAlarm.c @@ -84,7 +84,7 @@ void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_ continue; } if (timealarm_set) { - mp_raise_ValueError(translate("Only one alarm.time alarm can be set.")); + mp_raise_ValueError(translate("Only one alarm.time alarm can be set")); } timealarm = MP_OBJ_TO_PTR(alarms[i]); timealarm_set = true; diff --git a/ports/stm/common-hal/analogio/AnalogIn.c b/ports/stm/common-hal/analogio/AnalogIn.c index ed2575493e..7bed932c71 100644 --- a/ports/stm/common-hal/analogio/AnalogIn.c +++ b/ports/stm/common-hal/analogio/AnalogIn.c @@ -27,7 +27,7 @@ #include "common-hal/analogio/AnalogIn.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/microcontroller/Pin.h" @@ -51,7 +51,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, // No ADC function on pin if (pin->adc_unit == 0x00) { - mp_raise_ValueError(translate("Pin does not have ADC capabilities")); + raise_ValueError_invalid_pin(); } // TODO: add ADC traits to structure? @@ -65,7 +65,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC3); #endif } else { - mp_raise_ValueError(translate("Invalid ADC Unit value")); + mp_raise_RuntimeError(translate("Invalid ADC Unit value")); } common_hal_mcu_pin_claim(pin); self->pin = pin; @@ -147,7 +147,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { ADCx = ADC3; #endif } else { - mp_raise_ValueError(translate("Invalid ADC Unit value")); + mp_raise_RuntimeError(translate("Invalid ADC Unit value")); } LL_GPIO_SetPinMode(pin_port(self->pin->port), (uint32_t)pin_mask(self->pin->number), LL_GPIO_MODE_ANALOG); @@ -204,8 +204,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { uint16_t value = (uint16_t)HAL_ADC_GetValue(&AdcHandle); HAL_ADC_Stop(&AdcHandle); - // // Shift the value to be 16 bit. - return value << 4; + // Stretch 12-bit ADC reading to 16-bit range + return (value << 4) | (value >> 8); } float common_hal_analogio_analogin_get_reference_voltage(analogio_analogin_obj_t *self) { diff --git a/ports/stm/common-hal/analogio/AnalogOut.c b/ports/stm/common-hal/analogio/AnalogOut.c index 0320b1f99b..3c2860c9ad 100644 --- a/ports/stm/common-hal/analogio/AnalogOut.c +++ b/ports/stm/common-hal/analogio/AnalogOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/analogio/AnalogOut.h" #include "shared-bindings/microcontroller/Pin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "common-hal/microcontroller/Pin.h" @@ -65,7 +65,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self, self->channel = DAC_CHANNEL_2; self->dac_index = 1; } else { - mp_raise_ValueError(translate("Invalid DAC pin supplied")); + raise_ValueError_invalid_pin(); } // Only init if the shared DAC is empty or reset diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c index 5ede538b12..4faa5ca2ef 100644 --- a/ports/stm/common-hal/busio/I2C.c +++ b/ports/stm/common-hal/busio/I2C.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/microcontroller/Pin.h" // I2C timing specs for the H7 and F7 @@ -120,7 +120,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, if (i2c_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); } else { - mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_I2C); + raise_ValueError_invalid_pins(); } } @@ -155,7 +155,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } else if (frequency == 100000) { self->handle.Init.Timing = CPY_I2CSTANDARD_TIMINGR; } else { - mp_raise_ValueError(translate("Unsupported baudrate")); + mp_arg_error_invalid(MP_QSTR_frequency); } #else self->handle.Init.ClockSpeed = frequency; @@ -171,7 +171,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, self->handle.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; self->handle.State = HAL_I2C_STATE_RESET; if (HAL_I2C_Init(&(self->handle)) != HAL_OK) { - mp_raise_RuntimeError(translate("I2C Init Error")); + mp_raise_RuntimeError(translate("I2C init error")); } common_hal_mcu_pin_claim(sda); common_hal_mcu_pin_claim(scl); diff --git a/ports/stm/common-hal/busio/SPI.c b/ports/stm/common-hal/busio/SPI.c index f7961f8cef..7886e18a0c 100644 --- a/ports/stm/common-hal/busio/SPI.c +++ b/ports/stm/common-hal/busio/SPI.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "supervisor/board.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/microcontroller/Pin.h" // Note that any bugs introduced in this file can cause crashes at startup @@ -165,7 +165,7 @@ STATIC int check_pins(busio_spi_obj_t *self, if (spi_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); } else { - mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_SPI); + raise_ValueError_invalid_pin(); } } @@ -206,6 +206,10 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, spi_clock_enable(1 << (self->sck->periph_index - 1)); reserved_spi[self->sck->periph_index - 1] = true; + // Always start at 250khz which is what SD cards need. They are sensitive to + // SPI bus noise before they are put into SPI mode. + const uint32_t default_baudrate = 250000UL; + self->handle.Instance = SPIx; self->handle.Init.Mode = SPI_MODE_MASTER; // Direction change only required for RX-only, see RefMan RM0090:884 @@ -218,16 +222,16 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, self->handle.Init.CLKPolarity = SPI_POLARITY_LOW; self->handle.Init.CLKPhase = SPI_PHASE_1EDGE; self->handle.Init.NSS = SPI_NSS_SOFT; - self->handle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256; + self->handle.Init.BaudRatePrescaler = stm32_baud_to_spi_div(default_baudrate, &self->prescaler, get_busclock(self->handle.Instance)); self->handle.Init.FirstBit = SPI_FIRSTBIT_MSB; self->handle.Init.TIMode = SPI_TIMODE_DISABLE; self->handle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; self->handle.Init.CRCPolynomial = 10; if (HAL_SPI_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("SPI Init Error")); + mp_raise_ValueError(translate("SPI init error")); } - self->baudrate = (get_busclock(SPIx) / 16); - self->prescaler = 16; + self->baudrate = default_baudrate; + // self->prescaler = 16; // Initialised above by stm32_baud_to_spi_div self->half_duplex = half_duplex; self->polarity = 0; self->phase = 0; @@ -306,7 +310,7 @@ bool common_hal_busio_spi_configure(busio_spi_obj_t *self, get_busclock(self->handle.Instance)); if (HAL_SPI_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("SPI Re-initialization error")); + mp_raise_RuntimeError(translate("SPI re-init")); } self->baudrate = baudrate; @@ -346,7 +350,7 @@ void common_hal_busio_spi_unlock(busio_spi_obj_t *self) { bool common_hal_busio_spi_write(busio_spi_obj_t *self, const uint8_t *data, size_t len) { if (self->mosi == NULL) { - mp_raise_ValueError(translate("No MOSI Pin")); + mp_raise_ValueError(translate("No MOSI pin")); } HAL_StatusTypeDef result = HAL_SPI_Transmit(&self->handle, (uint8_t *)data, (uint16_t)len, HAL_MAX_DELAY); return result == HAL_OK; @@ -355,9 +359,9 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self, bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_value) { if (self->miso == NULL && !self->half_duplex) { - mp_raise_ValueError(translate("No MISO Pin")); + mp_raise_ValueError(translate("No MISO pin")); } else if (self->half_duplex && self->mosi == NULL) { - mp_raise_ValueError(translate("No MOSI Pin")); + mp_raise_ValueError(translate("No MOSI pin")); } HAL_StatusTypeDef result = HAL_OK; if ((!self->half_duplex && self->mosi == NULL) || (self->half_duplex && self->mosi != NULL && self->miso == NULL)) { @@ -372,7 +376,7 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self, bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { if (self->miso == NULL || self->mosi == NULL) { - mp_raise_ValueError(translate("Missing MISO or MOSI Pin")); + mp_raise_ValueError(translate("Missing MISO or MOSI pin")); } HAL_StatusTypeDef result = HAL_SPI_TransmitReceive(&self->handle, (uint8_t *)data_out, data_in, (uint16_t)len,HAL_MAX_DELAY); @@ -381,7 +385,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, uint32_t common_hal_busio_spi_get_frequency(busio_spi_obj_t *self) { // returns actual frequency - uint32_t result = HAL_RCC_GetPCLK2Freq() / self->prescaler; + uint32_t result = get_busclock(self->handle.Instance) / self->prescaler; return result; } diff --git a/ports/stm/common-hal/busio/UART.c b/ports/stm/common-hal/busio/UART.c index 7e35ad86dd..171e915dd9 100644 --- a/ports/stm/common-hal/busio/UART.c +++ b/ports/stm/common-hal/busio/UART.c @@ -35,7 +35,7 @@ #include "py/mperrno.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define ALL_UARTS 0xFFFF @@ -58,7 +58,7 @@ STATIC USART_TypeDef *assign_uart_or_throw(busio_uart_obj_t *self, bool pin_eval if (uart_taken) { mp_raise_ValueError(translate("Hardware in use, try alternative pins")); } else { - mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_UART); + raise_ValueError_invalid_pin(); } } } @@ -93,7 +93,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, uint8_t periph_index = 0; // origin 0 corrected if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert == true)) { - mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device")); + mp_raise_NotImplementedError(translate("RS485")); } // Can have both pins, or either @@ -164,14 +164,11 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, } // Other errors - if (receiver_buffer_size == 0) { - mp_raise_ValueError(translate("Invalid buffer size")); - } - if (bits != 8 && bits != 9) { - mp_raise_ValueError(translate("Invalid word/bit length")); - } + mp_arg_validate_length_min(receiver_buffer_size, 1, MP_QSTR_receiver_buffer_size); + mp_arg_validate_int_range(bits, 8, 9, MP_QSTR_bits); + if (USARTx == NULL) { // this can only be hit if the periph file is wrong - mp_raise_ValueError(translate("Internal define error")); + mp_raise_RuntimeError(translate("Internal define error")); } // GPIO Init @@ -211,7 +208,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->handle.Init.HwFlowCtl = UART_HWCONTROL_NONE; self->handle.Init.OverSampling = UART_OVERSAMPLING_16; if (HAL_UART_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART Init Error")); + mp_raise_RuntimeError(translate("UART init")); } @@ -221,7 +218,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, self->ringbuf = (ringbuf_t) { receiver_buffer, receiver_buffer_size }; } else { if (!ringbuf_alloc(&self->ringbuf, receiver_buffer_size, true)) { - mp_raise_ValueError(translate("UART Buffer allocation error")); + m_malloc_fail(receiver_buffer_size); } } common_hal_mcu_pin_claim(rx); @@ -235,7 +232,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self, // start the interrupt series if ((HAL_UART_GetState(&self->handle) & HAL_UART_STATE_BUSY_RX) == HAL_UART_STATE_BUSY_RX) { - mp_raise_ValueError(translate("Could not start interrupt, RX busy")); + mp_raise_RuntimeError(translate("Could not start interrupt, RX busy")); } // start the receive interrupt chain @@ -338,7 +335,7 @@ size_t common_hal_busio_uart_write(busio_uart_obj_t *self, const uint8_t *data, Status = HAL_UART_GetState(&self->handle); } } else { - mp_raise_ValueError(translate("UART write error")); + mp_raise_RuntimeError(translate("UART write")); } return len; @@ -408,11 +405,11 @@ void common_hal_busio_uart_set_baudrate(busio_uart_obj_t *self, uint32_t baudrat // Otherwise de-init and set new rate if (HAL_UART_DeInit(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART De-init error")); + mp_raise_RuntimeError(translate("UART de-init")); } self->handle.Init.BaudRate = baudrate; if (HAL_UART_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("UART Re-init error")); + mp_raise_RuntimeError(translate("UART re-init")); } self->baudrate = baudrate; diff --git a/ports/stm/common-hal/canio/CAN.c b/ports/stm/common-hal/canio/CAN.c index 74ff7f964b..992745b80a 100644 --- a/ports/stm/common-hal/canio/CAN.c +++ b/ports/stm/common-hal/canio/CAN.c @@ -59,13 +59,13 @@ void common_hal_canio_can_construct(canio_can_obj_t *self, const mcu_pin_obj_t * const mcu_periph_obj_t *mcu_tx = find_pin_function(mcu_can_tx_list, can_tx_len, tx, -1); if (!mcu_tx) { - mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_tx); + raise_ValueError_invalid_pin_name(MP_QSTR_tx); } int periph_index = mcu_tx->periph_index; const mcu_periph_obj_t *mcu_rx = find_pin_function(mcu_can_rx_list, can_rx_len, rx, periph_index); if (!mcu_rx) { - mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_rx); + raise_ValueError_invalid_pin_name(MP_QSTR_rx); } if (reserved_can[periph_index]) { diff --git a/ports/stm/common-hal/digitalio/DigitalInOut.c b/ports/stm/common-hal/digitalio/DigitalInOut.c index 39c72b73c9..3a0e27943b 100644 --- a/ports/stm/common-hal/digitalio/DigitalInOut.c +++ b/ports/stm/common-hal/digitalio/DigitalInOut.c @@ -28,7 +28,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/Pin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // The HAL is sparse on obtaining register information, so we use the LLs here. #if (CPY_STM32H7) diff --git a/ports/stm/common-hal/microcontroller/Processor.c b/ports/stm/common-hal/microcontroller/Processor.c index 13c661a60a..67cf9a73e4 100644 --- a/ports/stm/common-hal/microcontroller/Processor.c +++ b/ports/stm/common-hal/microcontroller/Processor.c @@ -32,7 +32,7 @@ #endif #include "common-hal/microcontroller/Processor.h" #include "shared-bindings/microcontroller/ResetReason.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include STM32_HAL_H diff --git a/ports/stm/common-hal/microcontroller/__init__.c b/ports/stm/common-hal/microcontroller/__init__.c index 3bb850f5d3..c399951f54 100644 --- a/ports/stm/common-hal/microcontroller/__init__.c +++ b/ports/stm/common-hal/microcontroller/__init__.c @@ -36,7 +36,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" - +#include "supervisor/port.h" #include "supervisor/filesystem.h" #include "supervisor/shared/safe_mode.h" @@ -73,15 +73,25 @@ void common_hal_mcu_enable_interrupts(void) { __enable_irq(); } +static bool next_reset_to_bootloader = false; + void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { if (runmode == RUNMODE_SAFE_MODE) { safe_mode_on_next_reset(PROGRAMMATIC_SAFE_MODE); } + if (runmode == RUNMODE_BOOTLOADER) { + next_reset_to_bootloader = true; + } } void common_hal_mcu_reset(void) { filesystem_flush(); // TODO: implement as part of flash improvements - NVIC_SystemReset(); + + if (next_reset_to_bootloader) { + reset_to_bootloader(); + } else { + NVIC_SystemReset(); + } } // The singleton microcontroller.Processor object, bound to microcontroller.cpu diff --git a/ports/stm/common-hal/neopixel_write/__init__.c b/ports/stm/common-hal/neopixel_write/__init__.c index f5dabe7f99..99529793fa 100644 --- a/ports/stm/common-hal/neopixel_write/__init__.c +++ b/ports/stm/common-hal/neopixel_write/__init__.c @@ -38,8 +38,8 @@ uint64_t next_start_raw_ticks = 0; // sysclock divisors #define MAGIC_800_INT 900000 // ~1.11 us -> 1.2 field -#define MAGIC_800_T0H 2800000 // ~0.36 us -> 0.44 field -#define MAGIC_800_T1H 1350000 // ~0.74 us -> 0.84 field +#define MAGIC_800_T0H 3500000 // 300ns actual; 880 low +#define MAGIC_800_T1H 1350000 // 768ns actual; 412 low #pragma GCC push_options #pragma GCC optimize ("Os") diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c index 70e1851939..1c323ad711 100644 --- a/ports/stm/common-hal/pulseio/PulseIn.c +++ b/ports/stm/common-hal/pulseio/PulseIn.c @@ -89,7 +89,7 @@ STATIC void pulsein_exti_event_handler(uint8_t num) { if (self->len < self->maxlen) { self->len++; } else { - self->start++; + self->start = (self->start + 1) % self->maxlen; } } @@ -123,8 +123,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu self->buffer = (uint16_t *)m_malloc(maxlen * sizeof(uint16_t), false); if (self->buffer == NULL) { // TODO: free the EXTI here? - mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate RX buffer of %d bytes"), - maxlen * sizeof(uint16_t)); + m_malloc_fail(maxlen * sizeof(uint16_t)); } // Set internal variables @@ -257,7 +256,7 @@ uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t *self, int16_ } if (index < 0 || index >= self->len) { stm_peripherals_exti_enable(self->pin->number); - mp_raise_IndexError_varg(translate("%q index out of range"), MP_QSTR_PulseIn); + mp_raise_IndexError_varg(translate("%q out of range"), MP_QSTR_index); } uint16_t value = self->buffer[(self->start + index) % self->maxlen]; stm_peripherals_exti_enable(self->pin->number); diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index fe3caa08b2..7725d8cdde 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -33,7 +33,7 @@ #include "py/runtime.h" #include "shared-bindings/pulseio/PulseOut.h" #include "shared-bindings/pwmio/PWMOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include STM32_HAL_H #include "shared-bindings/microcontroller/Pin.h" diff --git a/ports/stm/common-hal/pwmio/PWMOut.c b/ports/stm/common-hal/pwmio/PWMOut.c index e5dc18cd79..45f00b901b 100644 --- a/ports/stm/common-hal/pwmio/PWMOut.c +++ b/ports/stm/common-hal/pwmio/PWMOut.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "common-hal/pwmio/PWMOut.h" #include "shared-bindings/pwmio/PWMOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/microcontroller/__init__.h" #include STM32_HAL_H @@ -279,16 +279,16 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t fr // restart everything, adjusting for new speed if (HAL_TIM_PWM_Init(&self->handle) != HAL_OK) { - mp_raise_ValueError(translate("Could not re-init timer")); + mp_raise_RuntimeError(translate("timer re-init")); } self->chan_handle.Pulse = timer_get_internal_duty(self->duty_cycle, period); if (HAL_TIM_PWM_ConfigChannel(&self->handle, &self->chan_handle, self->channel) != HAL_OK) { - mp_raise_ValueError(translate("Could not re-init channel")); + mp_raise_RuntimeError(translate("channel re-init")); } if (HAL_TIM_PWM_Start(&self->handle, self->channel) != HAL_OK) { - mp_raise_ValueError(translate("Could not restart PWM")); + mp_raise_RuntimeError(translate("PWM restart")); } tim_frequencies[self->tim->tim_index] = frequency; diff --git a/ports/stm/common-hal/rtc/RTC.c b/ports/stm/common-hal/rtc/RTC.c new file mode 100644 index 0000000000..48c47fda8c --- /dev/null +++ b/ports/stm/common-hal/rtc/RTC.c @@ -0,0 +1,54 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 20212 Matthew McGowan for Blues Wireless 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 + +#include "py/obj.h" +#include "py/runtime.h" +#include "shared/timeutils/timeutils.h" +#include "shared-bindings/rtc/__init__.h" +#include "common-hal/rtc/RTC.h" +#include "shared-bindings/rtc/RTC.h" +#include "supervisor/port.h" +#include "supervisor/shared/translate/translate.h" +#include "peripherals/rtc.h" + + +void common_hal_rtc_set_time(timeutils_struct_time_t *tm) { + stm32_peripherals_rtc_set_time(tm); +} + +void common_hal_rtc_get_time(timeutils_struct_time_t *tm) { + stm32_peripherals_rtc_get_time(tm); +} + +int common_hal_rtc_get_calibration(void) { + return 0; +} + +void common_hal_rtc_set_calibration(int calibration) { + mp_raise_NotImplementedError_varg(translate("%q"), MP_QSTR_calibration); +} diff --git a/ports/stm/common-hal/rtc/RTC.h b/ports/stm/common-hal/rtc/RTC.h new file mode 100644 index 0000000000..d0ba720bfc --- /dev/null +++ b/ports/stm/common-hal/rtc/RTC.h @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Matthew McGowan for Blues Wireless 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. + */ + +#ifndef MICROPY_INCLUDED_STM_COMMON_HAL_RTC_RTC_H +#define MICROPY_INCLUDED_STM_COMMON_HAL_RTC_RTC_H + +extern void rtc_init(void); +extern void rtc_reset(void); + +#endif // MICROPY_INCLUDED_STM_COMMON_HAL_RTC_RTC_H diff --git a/ports/stm/common-hal/rtc/__init__.c b/ports/stm/common-hal/rtc/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/stm/common-hal/rtc/__init__.h b/ports/stm/common-hal/rtc/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/stm/common-hal/sdioio/SDCard.c b/ports/stm/common-hal/sdioio/SDCard.c index c7472a459f..8eeae2781d 100644 --- a/ports/stm/common-hal/sdioio/SDCard.c +++ b/ports/stm/common-hal/sdioio/SDCard.c @@ -32,7 +32,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/util.h" #include "supervisor/board.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Pin.h" @@ -115,7 +115,7 @@ STATIC int check_pins(sdioio_sdcard_obj_t *self, if (sdio_taken) { mp_raise_ValueError(translate("Hardware busy, try alternative pins")); } else { - mp_raise_ValueError_varg(translate("Invalid %q pin selection"), MP_QSTR_SDIO); + raise_ValueError_invalid_pin(); } } diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index ba383d41d2..cb578e76e2 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -10,6 +10,10 @@ ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F405xx STM32F407xx)) USB_NUM_ENDPOINT_PAIRS = 4 endif +ifeq ($(MCU_VARIANT),STM32F407xx) + UF2_FAMILY_ID ?= 0x6d0922fa +endif + ifeq ($(MCU_SERIES),F4) # Audio via PWM CIRCUITPY_AUDIOIO = 0 @@ -20,11 +24,12 @@ ifeq ($(MCU_SERIES),F4) CIRCUITPY_AUDIOBUSIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CPERIPHERAL ?= 0 + CIRCUITPY_I2CTARGET ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 - CIRCUITPY_RTC ?= 0 + CIRCUITPY_RTC ?= 1 USB_NUM_ENDPOINT_PAIRS = 4 + UF2_FAMILY_ID ?= 0x57755a57 endif ifeq ($(MCU_SERIES),H7) @@ -34,15 +39,16 @@ ifeq ($(MCU_SERIES),H7) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CPERIPHERAL ?= 0 + CIRCUITPY_I2CTARGET ?= 0 CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_PULSEIO ?= 0 CIRCUITPY_PWMIO ?= 0 CIRCUITPY_ROTARYIO ?= 0 - CIRCUITPY_RTC ?= 0 + CIRCUITPY_RTC ?= 1 USB_NUM_ENDPOINT_PAIRS = 9 + UF2_FAMILY_ID ?= 0x6db66082 endif ifeq ($(MCU_SERIES),F7) @@ -52,13 +58,14 @@ ifeq ($(MCU_SERIES),F7) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CPERIPHERAL ?= 0 + CIRCUITPY_I2CTARGET ?= 0 CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 - CIRCUITPY_RTC ?= 0 + CIRCUITPY_RTC ?= 1 USB_NUM_ENDPOINT_PAIRS = 6 + UF2_FAMILY_ID ?= 0x53b80f00 endif ifeq ($(MCU_SERIES),L4) @@ -68,15 +75,17 @@ ifeq ($(MCU_SERIES),L4) CIRCUITPY_AUDIOIO ?= 0 CIRCUITPY_COUNTIO ?= 0 CIRCUITPY_FREQUENCYIO ?= 0 - CIRCUITPY_I2CPERIPHERAL ?= 0 + CIRCUITPY_I2CTARGET ?= 0 CIRCUITPY_NEOPIXEL_WRITE ?= 0 CIRCUITPY_NVM ?= 0 CIRCUITPY_ROTARYIO ?= 0 - CIRCUITPY_RTC ?= 0 + CIRCUITPY_RTC ?= 1 # todo - this varies between devices in the series # This slide deck https://www.st.com/content/ccc/resource/training/technical/product_training/98/89/c8/6c/3e/e9/49/79/STM32L4_Peripheral_USB.pdf/files/STM32L4_Peripheral_USB.pdf/jcr:content/translations/en.STM32L4_Peripheral_USB.pdf # cites 16 endpoints, 8 endpoint pairs, while section 3.39 of the L4R5 datasheet states 6 endpoint pairs. USB_NUM_ENDPOINT_PAIRS = 6 + UF2_FAMILY_ID ?= 0x00ff6919 endif CIRCUITPY_PARALLELDISPLAY := 0 +CIRCUITPY_BUILD_EXTENSIONS ?= bin diff --git a/ports/stm/peripherals/rtc.c b/ports/stm/peripherals/rtc.c index 13cda1aac8..bd65ccbf17 100644 --- a/ports/stm/peripherals/rtc.c +++ b/ports/stm/peripherals/rtc.c @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2021 Lucian Copeland for Adafruit Industries + * Copyright (c) 2022 Matthew McGowan for Blues Wireless 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 @@ -76,6 +77,46 @@ void stm32_peripherals_rtc_init(void) { HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); } +#if CIRCUITPY_RTC +void stm32_peripherals_rtc_get_time(timeutils_struct_time_t *tm) { + RTC_DateTypeDef date = {0}; + RTC_TimeTypeDef time = {0}; + + int code; + if ((code = HAL_RTC_GetTime(&hrtc, &time, RTC_FORMAT_BIN)) == HAL_OK && + (code = HAL_RTC_GetDate(&hrtc, &date, RTC_FORMAT_BIN)) == HAL_OK) { + tm->tm_hour = time.Hours; + tm->tm_min = time.Minutes; + tm->tm_sec = time.Seconds; + tm->tm_wday = date.WeekDay - 1; + tm->tm_mday = date.Date; + tm->tm_mon = date.Month; + tm->tm_year = date.Year + 2000; + tm->tm_yday = -1; + } +} + +void stm32_peripherals_rtc_set_time(timeutils_struct_time_t *tm) { + RTC_DateTypeDef date = {0}; + RTC_TimeTypeDef time = {0}; + + time.Hours = tm->tm_hour; + time.Minutes = tm->tm_min; + time.Seconds = tm->tm_sec; + date.WeekDay = tm->tm_wday + 1; + date.Date = tm->tm_mday; + date.Month = tm->tm_mon; + date.Year = tm->tm_year - 2000; + time.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; + time.StoreOperation = RTC_STOREOPERATION_RESET; + + if (HAL_RTC_SetTime(&hrtc, &time, RTC_FORMAT_BIN) != HAL_OK || + HAL_RTC_SetDate(&hrtc, &date, RTC_FORMAT_BIN) != HAL_OK) { + // todo - throw an exception + } +} +#endif + // This function is called often for timing so we cache the seconds elapsed computation based on the // register value. The STM HAL always does shifts and conversion if we use it directly. uint64_t stm32_peripherals_rtc_raw_ticks(uint8_t *subticks) { @@ -86,7 +127,7 @@ uint64_t stm32_peripherals_rtc_raw_ticks(uint8_t *subticks) { uint32_t time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); uint32_t date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK); uint32_t ssr = (uint32_t)(RTC->SSR); - while (ssr != first_ssr) { + if (ssr != first_ssr) { first_ssr = ssr; time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK); @@ -184,13 +225,16 @@ void stm32_peripherals_rtc_set_alarm(uint8_t alarm_idx, uint32_t ticks) { alarm.AlarmTime.SubSeconds = rtc_clock_frequency - 1 - ((raw_ticks % TICK_DIVISOR) * 32); + if (alarm.AlarmTime.SubSeconds > rtc_clock_frequency) { + alarm.AlarmTime.SubSeconds = alarm.AlarmTime.SubSeconds + + rtc_clock_frequency; + } alarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; alarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_SET; // Masking here means that the bits are ignored so we set none of them. alarm.AlarmSubSecondMask = RTC_ALARMSUBSECONDMASK_NONE; alarm.AlarmDateWeekDaySel = RTC_ALARMDATEWEEKDAYSEL_DATE; alarm.Alarm = (alarm_idx == PERIPHERALS_ALARM_A) ? RTC_ALARM_A : RTC_ALARM_B; - HAL_RTC_SetAlarm_IT(&hrtc, &alarm, RTC_FORMAT_BIN); HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn); alarmed_already[alarm_idx] = false; diff --git a/ports/stm/peripherals/rtc.h b/ports/stm/peripherals/rtc.h index 65cae14d1c..474cba1881 100644 --- a/ports/stm/peripherals/rtc.h +++ b/ports/stm/peripherals/rtc.h @@ -4,6 +4,7 @@ * The MIT License (MIT) * * Copyright (c) 2021 Lucian Copeland for Adafruit Industries + * Copyright (c) 2022 Matthew McGowan for Blues Wireless 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 @@ -48,4 +49,10 @@ void stm32_peripherals_rtc_assign_alarm_callback(uint8_t alarm_idx, void (*callb void stm32_peripherals_rtc_set_alarm(uint8_t alarm_idx, uint32_t ticks); bool stm32_peripherals_rtc_alarm_triggered(uint8_t alarm_idx); +#if CIRCUITPY_RTC +typedef struct _timeutils_struct_time_t timeutils_struct_time_t; +void stm32_peripherals_rtc_get_time(timeutils_struct_time_t *tm); +void stm32_peripherals_rtc_set_time(timeutils_struct_time_t *tm); +#endif + #endif // __MICROPY_INCLUDED_STM32_PERIPHERALS_RTC_H__ diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index f0054648fc..371b8f414b 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -29,7 +29,7 @@ #include "py/gc.h" #include "py/obj.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" diff --git a/ports/stm/supervisor/internal_flash.c b/ports/stm/supervisor/internal_flash.c index 8d8ca2e0e1..cd693d0c66 100644 --- a/ports/stm/supervisor/internal_flash.c +++ b/ports/stm/supervisor/internal_flash.c @@ -95,12 +95,8 @@ STATIC const flash_layout_t flash_layout[] = { STATIC uint8_t _flash_cache[0x20000] __attribute__((aligned(4))); #elif defined(STM32L4) -// todo - the L4 devices can have different flash sizes and different page sizes -// depending upon the dual bank configuration -// This is hardcoded for the Swan R5. When support for other devices is needed more conditionals will be required -// to differentiate. STATIC const flash_layout_t flash_layout[] = { - { 0x08000000, 0x1000, 256 }, + { 0x08100000, 0x1000, 256 }, }; STATIC uint8_t _flash_cache[0x1000] __attribute__((aligned(4))); @@ -174,6 +170,9 @@ uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *si } void supervisor_flash_init(void) { + #ifdef STM32L4 + // todo - check that the device is in dual bank mode + #endif } uint32_t supervisor_flash_get_block_size(void) { @@ -202,7 +201,7 @@ void port_internal_flash_flush(void) { FLASH_EraseInitTypeDef EraseInitStruct = {}; #if CPY_STM32L4 EraseInitStruct.TypeErase = TYPEERASE_PAGES; - EraseInitStruct.Banks = FLASH_BANK_1; + EraseInitStruct.Banks = FLASH_BANK_2; // filesystem stored in upper 1MB of flash in dual bank mode #else EraseInitStruct.TypeErase = TYPEERASE_SECTORS; EraseInitStruct.VoltageRange = VOLTAGE_RANGE_3; // voltage range needs to be 2.7V to 3.6V diff --git a/ports/stm/supervisor/internal_flash.h b/ports/stm/supervisor/internal_flash.h index 421ee63267..98c55d30e8 100644 --- a/ports/stm/supervisor/internal_flash.h +++ b/ports/stm/supervisor/internal_flash.h @@ -97,9 +97,9 @@ #endif #ifdef STM32L4R5xx -#define STM32_FLASH_SIZE 0x100000 // 1MB // for now just use the first bank -#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x20000 // 128KiB -#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x080e0000 +#define STM32_FLASH_SIZE 0x200000 // 2MB +#define INTERNAL_FLASH_FILESYSTEM_SIZE 0x100000 // 1024KiB +#define INTERNAL_FLASH_FILESYSTEM_START_ADDR 0x08100000 #endif #define INTERNAL_FLASH_FILESYSTEM_NUM_BLOCKS (INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index e4cce571ea..7f31f3c7e5 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -61,6 +61,9 @@ #if CIRCUITPY_ALARM #include "common-hal/alarm/__init__.h" #endif +#if CIRCUITPY_RTC +#include "shared-bindings/rtc/__init__.h" +#endif #include "peripherals/clocks.h" #include "peripherals/gpio.h" @@ -241,6 +244,11 @@ void SysTick_Handler(void) { void reset_port(void) { reset_all_pins(); + + #if CIRCUITPY_RTC + rtc_reset(); + #endif + #if CIRCUITPY_AUDIOPWMIO audiopwmout_reset(); #endif @@ -268,7 +276,39 @@ void reset_port(void) { } void reset_to_bootloader(void) { + +/* +From STM AN2606: +Before jumping to bootloader user must: +• Disable all peripheral clocks +• Disable used PLL +• Disable interrupts +• Clear pending interrupts +System memory boot mode can be exited by getting out from bootloader activation +condition and generating hardware reset or using Go command to execute user code +*/ + HAL_RCC_DeInit(); + HAL_DeInit(); + + // disable all interupts + __disable_irq(); + + // Clear all pending interrupts + for (uint8_t i = 0; i < (sizeof(NVIC->ICPR) / NVIC->ICPR[0]); ++i) { + NVIC->ICPR[i] = 0xFFFFFFFF; + } + // information about jump addresses has been taken from STM AN2606. + #if defined(STM32F4) + __set_MSP(*((uint32_t *)0x1FFF0000)); + ((void (*)(void)) * ((uint32_t *)0x1FFF0004))(); + #else + // DFU mode for STM32 variant note implemented. NVIC_SystemReset(); + #endif + + while (true) { + asm ("nop;"); + } } void reset_cpu(void) { diff --git a/ports/unix/Makefile b/ports/unix/Makefile index 9857ec5f88..c0d2bdfc63 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -37,8 +37,8 @@ INC += -I$(BUILD) # compiler settings CWARN = -Wall -Werror -CWARN += -Wextra -Wno-unused-parameter -Wpointer-arith -Wdouble-promotion -Wfloat-conversion -CFLAGS += $(INC) $(CWARN) -std=gnu99 -DUNIX $(CFLAGS_MOD) $(COPT) -I$(VARIANT_DIR) $(CFLAGS_EXTRA) +CWARN += -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wpointer-arith -Wdouble-promotion -Wfloat-conversion +CFLAGS += $(INC) $(CWARN) -std=gnu11 -DUNIX $(CFLAGS_MOD) $(COPT) -I$(VARIANT_DIR) $(CFLAGS_EXTRA) # Debugging/Optimization ifdef DEBUG @@ -233,7 +233,7 @@ SRC_C += \ supervisor/stub/filesystem.c \ supervisor/stub/safe_mode.c \ supervisor/stub/stack.c \ - supervisor/shared/translate.c \ + supervisor/shared/translate/translate.c \ $(SRC_MOD) \ $(wildcard $(VARIANT_DIR)/*.c) @@ -363,4 +363,4 @@ install: $(PROG) uninstall: -rm $(BINDIR)/$(PROG) -$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h +$(BUILD)/supervisor/shared/translate/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h diff --git a/ports/unix/modffi.c b/ports/unix/modffi.c index d1966c51f0..d8b63b571e 100644 --- a/ports/unix/modffi.c +++ b/ports/unix/modffi.c @@ -38,7 +38,7 @@ #include "py/objint.h" #include "py/gc.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" /* * modffi uses character codes to encode a value type, based on "struct" diff --git a/ports/unix/modmachine.c b/ports/unix/modmachine.c index 04ff325eef..987c70b26e 100644 --- a/ports/unix/modmachine.c +++ b/ports/unix/modmachine.c @@ -36,7 +36,7 @@ #include "extmod/machine_signal.h" #include "extmod/machine_pulse.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PLAT_DEV_MEM #include diff --git a/ports/unix/variants/coverage/mpconfigvariant.mk b/ports/unix/variants/coverage/mpconfigvariant.mk index 59f443e760..3377bf20d3 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.mk +++ b/ports/unix/variants/coverage/mpconfigvariant.mk @@ -36,6 +36,7 @@ SRC_BITMAP := \ shared-bindings/rainbowio/__init__.c \ shared-bindings/traceback/__init__.c \ shared-bindings/util.c \ + shared-bindings/zlib/__init__.c \ shared-module/aesio/aes.c \ shared-module/aesio/__init__.c \ shared-module/bitmaptools/__init__.c \ @@ -44,7 +45,8 @@ SRC_BITMAP := \ shared-module/displayio/ColorConverter.c \ shared-module/displayio/ColorConverter.c \ shared-module/rainbowio/__init__.c \ - shared-module/traceback/__init__.c + shared-module/traceback/__init__.c \ + shared-module/zlib/__init__.c \ $(info $(SRC_BITMAP)) SRC_C += $(SRC_BITMAP) @@ -55,7 +57,8 @@ CFLAGS += \ -DCIRCUITPY_DISPLAYIO_UNIX=1 \ -DCIRCUITPY_GIFIO=1 \ -DCIRCUITPY_RAINBOWIO=1 \ - -DCIRCUITPY_TRACEBACK=1 + -DCIRCUITPY_TRACEBACK=1 \ + -DCIRCUITPY_ZLIB=1 SRC_C += coverage.c SRC_CXX += coveragecpp.cpp diff --git a/py/argcheck.c b/py/argcheck.c index c2066a7c39..cabfaeeaae 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -29,7 +29,7 @@ #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void mp_arg_check_num_sig(size_t n_args, size_t n_kw, uint32_t sig) { // TODO maybe take the function name as an argument so we can print nicer error messages @@ -156,6 +156,13 @@ NORETURN void mp_arg_error_unimpl_kw(void) { #endif +mp_int_t mp_arg_validate_int(mp_int_t i, mp_int_t required_i, qstr arg_name) { + if (i != required_i) { + mp_raise_ValueError_varg(translate("%q must be %d"), arg_name, required_i); + } + return i; +} + mp_int_t mp_arg_validate_int_min(mp_int_t i, mp_int_t min, qstr arg_name) { if (i < min) { mp_raise_ValueError_varg(translate("%q must be >= %d"), arg_name, min); @@ -194,6 +201,35 @@ mp_uint_t mp_arg_validate_length_range(mp_uint_t length, mp_uint_t min, mp_uint_ return length; } +mp_uint_t mp_arg_validate_length_min(mp_uint_t length, mp_uint_t min, qstr arg_name) { + if (length < min) { + mp_raise_ValueError_varg(translate("%q length must be >= %d"), arg_name, min); + } + return length; +} + +mp_uint_t mp_arg_validate_length_max(mp_uint_t length, mp_uint_t max, qstr arg_name) { + if (length > max) { + mp_raise_ValueError_varg(translate("%q length must be <= %d"), arg_name, max); + } + return length; +} + +mp_uint_t mp_arg_validate_length(mp_uint_t length, mp_uint_t required_length, qstr arg_name) { + if (length != required_length) { + mp_raise_ValueError_varg(translate("%q length must be %d"), arg_name, required_length); + } + return length; +} + +// int instead of uint because an index can be negative in some cases. +mp_int_t mp_arg_validate_index_range(mp_int_t index, mp_int_t min, mp_int_t max, qstr arg_name) { + if (index < min || index > max) { + mp_raise_IndexError_varg(translate("%q out of range"), arg_name, min, max); + } + return index; +} + mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_name) { if (!mp_obj_is_type(obj, type)) { mp_raise_TypeError_varg(translate("%q must be of type %q"), arg_name, type->name); @@ -201,9 +237,21 @@ mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_ return obj; } -mp_obj_t mp_arg_validate_string(mp_obj_t obj, qstr arg_name) { +mp_obj_t mp_arg_validate_type_string(mp_obj_t obj, qstr arg_name) { if (!mp_obj_is_str(obj)) { mp_raise_TypeError_varg(translate("%q must be a string"), arg_name); } return obj; } + +mp_int_t mp_arg_validate_type_int(mp_obj_t obj, qstr arg_name) { + mp_int_t an_int; + if (!mp_obj_get_int_maybe(obj, &an_int)) { + mp_raise_TypeError_varg(translate("%q must be an int"), arg_name); + } + return an_int; +} + +NORETURN void mp_arg_error_invalid(qstr arg_name) { + mp_raise_ValueError_varg(translate("Invalid %q"), arg_name); +} diff --git a/py/bc.c b/py/bc.c index 33b94c4a9f..e1645dbff0 100644 --- a/py/bc.c +++ b/py/bc.c @@ -33,7 +33,7 @@ #include "py/bc0.h" #include "py/bc.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) diff --git a/py/binary.c b/py/binary.c index 06f0157567..439993c0f7 100644 --- a/py/binary.c +++ b/py/binary.c @@ -36,7 +36,7 @@ #include "py/objint.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Helpers to work with binary-encoded data diff --git a/py/builtinevex.c b/py/builtinevex.c index a96a3a5344..46d4a1277a 100644 --- a/py/builtinevex.c +++ b/py/builtinevex.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "py/builtin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_COMPILE diff --git a/py/builtinhelp.c b/py/builtinhelp.c index 7411c57aae..86632f6dde 100644 --- a/py/builtinhelp.c +++ b/py/builtinhelp.c @@ -32,6 +32,8 @@ #include "py/mpconfig.h" #include "py/objmodule.h" +#include "supervisor/shared/translate/translate.h" + #if MICROPY_PY_BUILTINS_HELP const char mp_help_default_text[] = diff --git a/py/builtinimport.c b/py/builtinimport.c index dbacc3d657..92f3150306 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -39,7 +39,7 @@ #include "py/builtin.h" #include "py/frozenmod.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) @@ -282,7 +282,7 @@ STATIC void evaluate_relative_import(mp_int_t level, const char **module_name, s #endif // If we have a __path__ in the globals dict, then we're a package. - bool is_pkg = mp_map_lookup(&mp_globals_get()->map, MP_OBJ_NEW_QSTR(MP_QSTR___path__), MP_MAP_LOOKUP); + bool is_pkg = mp_map_lookup(&mp_globals_get()->map, MP_OBJ_NEW_QSTR(MP_QSTR___path__), MP_MAP_LOOKUP) != NULL; #if DEBUG_PRINT DEBUG_printf("Current module/package: "); @@ -455,6 +455,10 @@ STATIC mp_obj_t process_import_at_level(qstr full_mod_name, qstr level_mod_name, // not a package. This will be caught on the next iteration // because the file will not exist. } + + // Loading a module thrashes the heap significantly so we explicitly clean up + // afterwards. + gc_collect(); } if (outer_module_obj != MP_OBJ_NULL && VERIFY_PTR(MP_OBJ_TO_PTR(outer_module_obj))) { diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 550396f2ba..80377f1a65 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -67,6 +67,20 @@ else CFLAGS += -DCIRCUITPY_DEBUG=0 endif +CIRCUITPY_LTO ?= 0 +CIRCUITPY_LTO_PARTITION ?= balanced +ifeq ($(CIRCUITPY_LTO),1) +CFLAGS += -flto -flto-partition=$(CIRCUITPY_LTO_PARTITION) -DCIRCUITPY_LTO=1 +else +CFLAGS += -DCIRCUITPY_LTO=0 +endif + +# Produce an object file for translate.c instead of including it in a header. +# The header version can be optimized on non-LTO builds *if* inlining is allowed +# otherwise, it blows up the binary sizes with tons of translate copies. +CIRCUITPY_TRANSLATE_OBJECT ?= $(CIRCUITPY_LTO) +CFLAGS += -DCIRCUITPY_TRANSLATE_OBJECT=$(CIRCUITPY_TRANSLATE_OBJECT) + ### # Handle frozen modules. @@ -87,6 +101,7 @@ endif ### # Select which builtin modules to compile and include. +# Keep alphabetical. ifeq ($(CIRCUITPY_AESIO),1) SRC_PATTERNS += aesio/% @@ -94,6 +109,9 @@ endif ifeq ($(CIRCUITPY_ALARM),1) SRC_PATTERNS += alarm/% endif +ifeq ($(CIRCUITPY_ANALOGBUFIO),1) +SRC_PATTERNS += analogbufio/% +endif ifeq ($(CIRCUITPY_ANALOGIO),1) SRC_PATTERNS += analogio/% endif @@ -158,29 +176,24 @@ endif ifeq ($(CIRCUITPY_DISPLAYIO),1) SRC_PATTERNS += displayio/% endif -ifeq ($(CIRCUITPY_PARALLELDISPLAY),1) -SRC_PATTERNS += paralleldisplay/% -endif -ifeq ($(CIRCUITPY_VECTORIO),1) -SRC_PATTERNS += vectorio/% -endif -ifeq ($(CIRCUITPY_FRAMEBUFFERIO),1) -SRC_PATTERNS += framebufferio/% +ifeq ($(CIRCUITPY_DOTENV),1) +SRC_PATTERNS += dotenv/% endif ifeq ($(CIRCUITPY__EVE),1) SRC_PATTERNS += _eve/% endif +ifeq ($(CIRCUITPY_FLOPPYIO),1) +SRC_PATTERNS += floppyio/% +endif +ifeq ($(CIRCUITPY_FRAMEBUFFERIO),1) +SRC_PATTERNS += framebufferio/% +endif ifeq ($(CIRCUITPY_FREQUENCYIO),1) SRC_PATTERNS += frequencyio/% endif - ifeq ($(CIRCUITPY_FUTURE),1) SRC_PATTERNS += __future__/% endif - -ifeq ($(CIRCUITPY_GAMEPADSHIFT),1) -SRC_PATTERNS += gamepadshift/% -endif ifeq ($(CIRCUITPY_GETPASS),1) SRC_PATTERNS += getpass/% endif @@ -190,8 +203,11 @@ endif ifeq ($(CIRCUITPY_GNSS),1) SRC_PATTERNS += gnss/% endif -ifeq ($(CIRCUITPY_I2CPERIPHERAL),1) -SRC_PATTERNS += i2cperipheral/% +ifeq ($(CIRCUITPY_HASHLIB),1) +SRC_PATTERNS += hashlib/% +endif +ifeq ($(CIRCUITPY_I2CTARGET),1) +SRC_PATTERNS += i2ctarget/% endif ifeq ($(CIRCUITPY_IMAGECAPTURE),1) SRC_PATTERNS += imagecapture/% @@ -217,6 +233,9 @@ endif ifeq ($(CIRCUITPY_MDNS),1) SRC_PATTERNS += mdns/% endif +ifeq ($(CIRCUITPY_MSGPACK),1) +SRC_PATTERNS += msgpack/% +endif ifeq ($(CIRCUITPY_NEOPIXEL_WRITE),1) SRC_PATTERNS += neopixel_write/% endif @@ -232,6 +251,12 @@ endif ifeq ($(CIRCUITPY_DUALBANK),1) SRC_PATTERNS += dualbank/% endif +ifeq ($(CIRCUITPY_PARALLELDISPLAY),1) +SRC_PATTERNS += paralleldisplay/% +endif +ifeq ($(CIRCUITPY_PEW),1) +SRC_PATTERNS += _pew/% +endif ifeq ($(CIRCUITPY_PIXELBUF),1) SRC_PATTERNS += adafruit_pixelbuf/% endif @@ -301,6 +326,9 @@ endif ifeq ($(CIRCUITPY_TERMINALIO),1) SRC_PATTERNS += terminalio/% fontio/% endif +ifeq ($(CIRCUITPY_FONTIO),1) +SRC_PATTERNS += fontio/% +endif ifeq ($(CIRCUITPY_TIME),1) SRC_PATTERNS += time/% endif @@ -331,6 +359,9 @@ endif ifeq ($(CIRCUITPY_USTACK),1) SRC_PATTERNS += ustack/% endif +ifeq ($(CIRCUITPY_VECTORIO),1) +SRC_PATTERNS += vectorio/% +endif ifeq ($(CIRCUITPY_VIDEOCORE),1) SRC_PATTERNS += videocore/% endif @@ -340,11 +371,8 @@ endif ifeq ($(CIRCUITPY_WIFI),1) SRC_PATTERNS += wifi/% endif -ifeq ($(CIRCUITPY_PEW),1) -SRC_PATTERNS += _pew/% -endif -ifeq ($(CIRCUITPY_MSGPACK),1) -SRC_PATTERNS += msgpack/% +ifeq ($(CIRCUITPY_ZLIB),1) +SRC_PATTERNS += zlib/% endif # All possible sources are listed here, and are filtered by SRC_PATTERNS in SRC_COMMON_HAL @@ -366,6 +394,8 @@ SRC_COMMON_HAL_ALL = \ alarm/pin/PinAlarm.c \ alarm/time/TimeAlarm.c \ alarm/touch/TouchAlarm.c \ + analogbufio/BufferedIn.c \ + analogbufio/__init__.c \ analogio/AnalogIn.c \ analogio/AnalogOut.c \ analogio/__init__.c \ @@ -399,8 +429,10 @@ SRC_COMMON_HAL_ALL = \ gnss/GNSS.c \ gnss/PositionFix.c \ gnss/SatelliteSystem.c \ - i2cperipheral/I2CPeripheral.c \ - i2cperipheral/__init__.c \ + hashlib/__init__.c \ + hashlib/Hash.c \ + i2ctarget/I2CTarget.c \ + i2ctarget/__init__.c \ microcontroller/Pin.c \ microcontroller/Processor.c \ microcontroller/__init__.c \ @@ -454,7 +486,6 @@ SRC_C += \ endif - SRC_COMMON_HAL = $(filter $(SRC_PATTERNS), $(SRC_COMMON_HAL_ALL)) # These don't have corresponding files in each port but are still located in @@ -486,6 +517,7 @@ $(filter $(SRC_PATTERNS), \ qrio/PixelPolicy.c \ qrio/QRInfo.c \ supervisor/RunReason.c \ + supervisor/StatusBar.c \ wifi/AuthMode.c \ wifi/Packet.c \ ) @@ -542,12 +574,12 @@ SRC_SHARED_MODULE_ALL = \ displayio/TileGrid.c \ displayio/area.c \ displayio/__init__.c \ + dotenv/__init__.c \ + floppyio/__init__.c \ fontio/BuiltinFont.c \ fontio/__init__.c \ framebufferio/FramebufferDisplay.c \ framebufferio/__init__.c \ - gamepadshift/GamePadShift.c \ - gamepadshift/__init__.c \ getpass/__init__.c \ gifio/__init__.c \ gifio/GifWriter.c \ @@ -586,6 +618,8 @@ SRC_SHARED_MODULE_ALL = \ socket/__init__.c \ storage/__init__.c \ struct/__init__.c \ + supervisor/__init__.c \ + supervisor/StatusBar.c \ synthio/MidiTrack.c \ synthio/__init__.c \ terminalio/Terminal.c \ @@ -597,6 +631,7 @@ SRC_SHARED_MODULE_ALL = \ usb/core/__init__.c \ usb/core/Device.c \ ustack/__init__.c \ + zlib/__init__.c \ vectorio/Circle.c \ vectorio/Polygon.c \ vectorio/Rectangle.c \ @@ -653,6 +688,17 @@ SRC_MOD += $(addprefix lib/protomatter/src/, \ $(BUILD)/lib/protomatter/src/core.o: CFLAGS += -include "shared-module/rgbmatrix/allocator.h" -DCIRCUITPY -Wno-missing-braces -Wno-missing-prototypes endif +ifeq ($(CIRCUITPY_ZLIB),1) +SRC_MOD += $(addprefix lib/uzlib/, \ + tinflate.c \ + tinfzlib.c \ + tinfgzip.c \ + adler32.c \ + crc32.c \ +) +$(BUILD)/lib/uzlib/tinflate.o: CFLAGS += -Wno-missing-braces -Wno-missing-prototypes +endif + # All possible sources are listed here, and are filtered by SRC_PATTERNS. SRC_SHARED_MODULE_INTERNAL = \ $(filter $(SRC_PATTERNS), \ @@ -738,3 +784,6 @@ endif check-release-needs-clean-build: @echo "RELEASE_NEEDS_CLEAN_BUILD = $(RELEASE_NEEDS_CLEAN_BUILD)" + +# Ignore these errors +$(BUILD)/lib/libm/kf_rem_pio2.o: CFLAGS += -Wno-maybe-uninitialized diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index ec9274464b..acdf08e6a4 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -198,10 +198,11 @@ typedef long mp_off_t; // extra built in names to add to the global namespace +// Not indented so as not to confused the editor. #define MICROPY_PORT_BUILTINS \ - { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ + { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \ - { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, \ ////////////////////////////////////////////////////////////////////////////////////////////////// // board-specific definitions, which control and may override definitions below. @@ -213,7 +214,7 @@ typedef long mp_off_t; #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) #endif #define MICROPY_PY_BUILTINS_POW3 (CIRCUITPY_BUILTINS_POW3) -#define MICROPY_PY_FSTRINGS (MICROPY_CPYTHON_COMPAT) +#define MICROPY_PY_FSTRINGS (1) #define MICROPY_MODULE_WEAK_LINKS (0) #define MICROPY_PY_ALL_SPECIAL_METHODS (CIRCUITPY_FULL_BUILD) #ifndef MICROPY_PY_BUILTINS_COMPLEX @@ -226,11 +227,14 @@ typedef long mp_off_t; #ifndef MICROPY_PY_COLLECTIONS_ORDEREDDICT #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (CIRCUITPY_FULL_BUILD) #endif +#ifndef MICROPY_PY_COLLECTIONS_DEQUE +#define MICROPY_PY_COLLECTIONS_DEQUE (CIRCUITPY_FULL_BUILD) +#endif #define MICROPY_PY_URE_MATCH_GROUPS (CIRCUITPY_RE) #define MICROPY_PY_URE_MATCH_SPAN_START_END (CIRCUITPY_RE) #define MICROPY_PY_URE_SUB (CIRCUITPY_RE) -#define CIRCUITPY_MICROPYTHON_ADVANCED (CIRCUITPY_FULL_BUILD) +#define CIRCUITPY_MICROPYTHON_ADVANCED (0) #ifndef MICROPY_FATFS_EXFAT #define MICROPY_FATFS_EXFAT (CIRCUITPY_FULL_BUILD) @@ -293,6 +297,22 @@ typedef long mp_off_t; #define BOARD_UART_ROOT_POINTER mp_obj_t board_uart_bus; #endif +#if MICROPY_PY_ASYNC_AWAIT && !CIRCUITPY_TRACEBACK +#error CIRCUITPY_ASYNCIO requires CIRCUITPY_TRACEBACK +#endif + +#if defined(CIRCUITPY_CONSOLE_UART_RX) || defined(CIRCUITPY_CONSOLE_UART_TX) +#if !(defined(CIRCUITPY_CONSOLE_UART_RX) && defined(CIRCUITPY_CONSOLE_UART_TX)) +#error Both CIRCUITPY_CONSOLE_UART_RX and CIRCUITPY_CONSOLE_UART_TX must be defined if one is defined. +#endif +#define CIRCUITPY_CONSOLE_UART (1) +#ifndef CIRCUITPY_CONSOLE_UART_BAUDRATE +#define CIRCUITPY_CONSOLE_UART_BAUDRATE (115200) +#endif +#else +#define CIRCUITPY_CONSOLE_UART (0) +#endif + // These CIRCUITPY_xxx values should all be defined in the *.mk files as being on or off. // So if any are not defined in *.mk, they'll throw an error here. @@ -311,14 +331,6 @@ typedef long mp_off_t; #define CIRCUITPY_DISPLAY_AREA_BUFFER_SIZE (0) #endif -#if CIRCUITPY_GAMEPADSHIFT -// Scan gamepad every 32ms -#define CIRCUITPY_GAMEPAD_TICKS 0x1f -#define GAMEPAD_ROOT_POINTERS mp_obj_t gamepad_singleton; -#else -#define GAMEPAD_ROOT_POINTERS -#endif - #if CIRCUITPY_KEYPAD #define KEYPAD_ROOT_POINTERS mp_obj_t keypad_scanners_linked_list; #else @@ -419,7 +431,6 @@ struct _supervisor_allocation_node; #define CIRCUITPY_COMMON_ROOT_POINTERS \ FLASH_ROOT_POINTERS \ KEYPAD_ROOT_POINTERS \ - GAMEPAD_ROOT_POINTERS \ BOARD_UART_ROOT_POINTER \ WIFI_MONITOR_ROOT_POINTERS \ MEMORYMONITOR_ROOT_POINTERS \ @@ -553,6 +564,10 @@ void supervisor_run_background_tasks_if_tick(void); #error "CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR must be at least 1" #endif +#ifndef CIRCUITPY_PORT_NUM_SUPERVISOR_ALLOCATIONS +#define CIRCUITPY_PORT_NUM_SUPERVISOR_ALLOCATIONS (0) +#endif + #ifndef USB_MIDI_EP_NUM_OUT #define USB_MIDI_EP_NUM_OUT (0) #endif @@ -573,4 +588,6 @@ void supervisor_run_background_tasks_if_tick(void); #define MICROPY_WRAP_MP_EXECUTE_BYTECODE PLACE_IN_ITCM #endif +#define MICROPY_PY_OPTIMIZE_PROPERTY_FLASH_SIZE (CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE) + #endif // __INCLUDED_MPCONFIG_CIRCUITPY_H diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 87fcc8ff60..0f4269c522 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -32,6 +32,11 @@ CIRCUITPY_FULL_BUILD ?= 1 CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) +# Reduce the size of in-flash properties. Requires support in the .ld linker +# file, so not enabled by default. +CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE ?= 0 +CFLAGS += -DCIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE=$(CIRCUITPY_OPTIMIZE_PROPERTY_FLASH_SIZE) + # async/await language keyword support MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DMICROPY_PY_ASYNC_AWAIT=$(MICROPY_PY_ASYNC_AWAIT) @@ -49,16 +54,17 @@ CFLAGS += -DMICROPY_PY_USELECT=$(MICROPY_PY_USELECT) MICROPY_PY_USELECT_SELECT ?= $(MICROPY_PY_USELECT) CFLAGS += -DMICROPY_PY_USELECT_SELECT=$(MICROPY_PY_USELECT_SELECT) - CIRCUITPY_AESIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO) -# TODO: CIRCUITPY_ALARM will gradually be added to -# as many ports as possible +# TODO: CIRCUITPY_ALARM will gradually be added to as many ports as possible # so make this 1 or CIRCUITPY_FULL_BUILD eventually CIRCUITPY_ALARM ?= 0 CFLAGS += -DCIRCUITPY_ALARM=$(CIRCUITPY_ALARM) +CIRCUITPY_ANALOGBUFIO ?= 0 +CFLAGS += -DCIRCUITPY_ANALOGBUFIO=$(CIRCUITPY_ANALOGBUFIO) + CIRCUITPY_ANALOGIO ?= 1 CFLAGS += -DCIRCUITPY_ANALOGIO=$(CIRCUITPY_ANALOGIO) @@ -165,9 +171,6 @@ CFLAGS += -DCIRCUITPY_OPT_LOAD_ATTR_FAST_PATH=$(CIRCUITPY_OPT_LOAD_ATTR_FAST_PAT CIRCUITPY_OPT_MAP_LOOKUP_CACHE ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_OPT_MAP_LOOKUP_CACHE=$(CIRCUITPY_OPT_MAP_LOOKUP_CACHE) -CIRCUITPY_CONSOLE_UART ?= 0 -CFLAGS += -DCIRCUITPY_CONSOLE_UART=$(CIRCUITPY_CONSOLE_UART) - CIRCUITPY_COUNTIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) @@ -195,6 +198,9 @@ CFLAGS += -DCIRCUITPY_BITMAPTOOLS=$(CIRCUITPY_BITMAPTOOLS) CFLAGS += -DCIRCUITPY_FRAMEBUFFERIO=$(CIRCUITPY_FRAMEBUFFERIO) CFLAGS += -DCIRCUITPY_VECTORIO=$(CIRCUITPY_VECTORIO) +CIRCUITPY_DOTENV ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_DOTENV=$(CIRCUITPY_DOTENV) + CIRCUITPY_DUALBANK ?= 0 CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK) @@ -211,23 +217,26 @@ CFLAGS += -DCIRCUITPY_ERRNO=$(CIRCUITPY_ERRNO) CIRCUITPY_ESPIDF ?= 0 CFLAGS += -DCIRCUITPY_ESPIDF=$(CIRCUITPY_ESPIDF) +CIRCUITPY_ESP32_CAMERA ?= 0 +CFLAGS += -DCIRCUITPY_ESP32_CAMERA=$(CIRCUITPY_ESP32_CAMERA) + CIRCUITPY__EVE ?= 0 CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE) +CIRCUITPY_FLOPPYIO ?= 0 +CFLAGS += -DCIRCUITPY_FLOPPYIO=$(CIRCUITPY_FLOPPYIO) + CIRCUITPY_FREQUENCYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_FREQUENCYIO=$(CIRCUITPY_FREQUENCYIO) CIRCUITPY_FUTURE ?= 1 CFLAGS += -DCIRCUITPY_FUTURE=$(CIRCUITPY_FUTURE) -CIRCUITPY_GAMEPADSHIFT ?= 0 -CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) - CIRCUITPY_GETPASS ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_GETPASS=$(CIRCUITPY_GETPASS) ifeq ($(CIRCUITPY_DISPLAYIO),1) -CIRCUITPY_GIFIO ?= $(CIRCUITPY_FULL_BUILD) +CIRCUITPY_GIFIO ?= $(CIRCUITPY_CAMERA) else CIRCUITPY_GIFIO ?= 0 endif @@ -236,8 +245,11 @@ CFLAGS += -DCIRCUITPY_GIFIO=$(CIRCUITPY_GIFIO) CIRCUITPY_GNSS ?= 0 CFLAGS += -DCIRCUITPY_GNSS=$(CIRCUITPY_GNSS) -CIRCUITPY_I2CPERIPHERAL ?= $(CIRCUITPY_FULL_BUILD) -CFLAGS += -DCIRCUITPY_I2CPERIPHERAL=$(CIRCUITPY_I2CPERIPHERAL) +CIRCUITPY_HASHLIB ?= $(CIRCUITPY_WEB_WORKFLOW) +CFLAGS += -DCIRCUITPY_HASHLIB=$(CIRCUITPY_HASHLIB) + +CIRCUITPY_I2CTARGET ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_I2CTARGET=$(CIRCUITPY_I2CTARGET) CIRCUITPY_IMAGECAPTURE ?= 0 CFLAGS += -DCIRCUITPY_IMAGECAPTURE=$(CIRCUITPY_IMAGECAPTURE) @@ -347,6 +359,9 @@ CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO) CIRCUITPY_SERIAL_BLE ?= 0 CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE) +CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY?= 0 +CFLAGS += -DCIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY=$(CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY) + CIRCUITPY_SHARPDISPLAY ?= $(CIRCUITPY_FRAMEBUFFERIO) CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY) @@ -360,6 +375,9 @@ CFLAGS += -DCIRCUITPY_SSL=$(CIRCUITPY_SSL) CIRCUITPY_STAGE ?= 0 CFLAGS += -DCIRCUITPY_STAGE=$(CIRCUITPY_STAGE) +CIRCUITPY_STATUS_BAR ?= 1 +CFLAGS += -DCIRCUITPY_STATUS_BAR=$(CIRCUITPY_STATUS_BAR) + CIRCUITPY_STORAGE ?= 1 CFLAGS += -DCIRCUITPY_STORAGE=$(CIRCUITPY_STORAGE) @@ -375,6 +393,11 @@ CFLAGS += -DCIRCUITPY_SYNTHIO=$(CIRCUITPY_SYNTHIO) CIRCUITPY_TERMINALIO ?= $(CIRCUITPY_DISPLAYIO) CFLAGS += -DCIRCUITPY_TERMINALIO=$(CIRCUITPY_TERMINALIO) +ifeq ($(CIRCUITPY_DISPLAYIO),1) +CIRCUITPY_FONTIO ?= $(CIRCUITPY_TERMINALIO) +endif +CFLAGS += -DCIRCUITPY_FONTIO=$(CIRCUITPY_FONTIO) + CIRCUITPY_TIME ?= 1 CFLAGS += -DCIRCUITPY_TIME=$(CIRCUITPY_TIME) @@ -450,6 +473,10 @@ CFLAGS += -DUSB_NUM_ENDPOINT_PAIRS=$(USB_NUM_ENDPOINT_PAIRS) CIRCUITPY_USTACK ?= 0 CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) +# for decompressing utlities +CIRCUITPY_ZLIB ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_ZLIB=$(CIRCUITPY_ZLIB) + # ulab numerics library CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ULAB=$(CIRCUITPY_ULAB) @@ -467,6 +494,9 @@ CFLAGS += -DCIRCUITPY_WATCHDOG=$(CIRCUITPY_WATCHDOG) CIRCUITPY_WIFI ?= 0 CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI) +CIRCUITPY_WEB_WORKFLOW ?= $(CIRCUITPY_WIFI) +CFLAGS += -DCIRCUITPY_WEB_WORKFLOW=$(CIRCUITPY_WEB_WORKFLOW) + # tinyusb port tailored configuration CIRCUITPY_TUSB_MEM_ALIGN ?= 4 CFLAGS += -DCIRCUITPY_TUSB_MEM_ALIGN=$(CIRCUITPY_TUSB_MEM_ALIGN) diff --git a/py/compile.c b/py/compile.c index e5f341a656..432aeca561 100644 --- a/py/compile.c +++ b/py/compile.c @@ -37,7 +37,7 @@ #include "py/asmbase.h" #include "py/persistentcode.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_ENABLE_COMPILER diff --git a/py/enum.c b/py/enum.c index 4728c7f11d..681c3b3103 100644 --- a/py/enum.c +++ b/py/enum.c @@ -27,6 +27,8 @@ #include "py/enum.h" #include "py/runtime.h" +#include "supervisor/shared/translate/translate.h" + mp_obj_t cp_enum_find(const mp_obj_type_t *type, int value) { const mp_obj_dict_t *dict = type->locals_dict; for (size_t i = 0; i < dict->map.used; i++) { diff --git a/py/formatfloat.c b/py/formatfloat.c index 06775167c0..d75cfc6658 100644 --- a/py/formatfloat.c +++ b/py/formatfloat.c @@ -25,6 +25,7 @@ */ #include "py/mpconfig.h" +#include "py/misc.h" #if MICROPY_FLOAT_IMPL != MICROPY_FLOAT_IMPL_NONE #include @@ -96,7 +97,16 @@ static inline int fp_isless1(float x) { #define fp_iszero(x) (x == 0) #define fp_isless1(x) (x < 1.0) -#endif +#endif // MICROPY_FLOAT_IMPL == MICROPY_FLOAT_IMPL_FLOAT/DOUBLE + +static inline int fp_ge_eps(FPTYPE x, FPTYPE y) { + mp_float_union_t fb_y = {y}; + // Back off 2 eps. + // This is valid for almost all values, but in practice + // it's only used when y = 1eX for X>=0. + fb_y.i -= 2; + return x >= fb_y.f; +} static const FPTYPE g_pos_pow[] = { #if FPDECEXP > 32 @@ -173,6 +183,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch int num_digits = 0; const FPTYPE *pos_pow = g_pos_pow; const FPTYPE *neg_pow = g_neg_pow; + int signed_e = 0; if (fp_iszero(f)) { e = 0; @@ -192,31 +203,24 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch } } } else if (fp_isless1(f)) { - // We need to figure out what an integer digit will be used - // in case 'f' is used (or we revert other format to it below). - // As we just tested number to be <1, this is obviously 0, - // but we can round it up to 1 below. - char first_dig = '0'; - if (f >= FPROUND_TO_ONE) { - first_dig = '1'; - } - + FPTYPE f_mod = f; // Build negative exponent for (e = 0, e1 = FPDECEXP; e1; e1 >>= 1, pos_pow++, neg_pow++) { - if (*neg_pow > f) { + if (*neg_pow > f_mod) { e += e1; - f *= *pos_pow; + f_mod *= *pos_pow; } } + char e_sign_char = '-'; - if (fp_isless1(f) && f >= FPROUND_TO_ONE) { - f = FPCONST(1.0); + if (fp_isless1(f_mod) && f_mod >= FPROUND_TO_ONE) { + f_mod = FPCONST(1.0); if (e == 0) { e_sign_char = '+'; } - } else if (fp_isless1(f)) { + } else if (fp_isless1(f_mod)) { e++; - f *= FPCONST(10.0); + f_mod *= FPCONST(10.0); } // If the user specified 'g' format, and e is <= 4, then we'll switch @@ -224,8 +228,7 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch if (fmt == 'f' || (fmt == 'g' && e <= 4)) { fmt = 'f'; - dec = -1; - *s++ = first_dig; + dec = 0; if (org_fmt == 'g') { prec += (e - 1); @@ -237,13 +240,8 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch } num_digits = prec; - if (num_digits) { - *s++ = '.'; - while (--e && num_digits) { - *s++ = '0'; - num_digits--; - } - } + signed_e = 0; + ++num_digits; } else { // For e & g formats, we'll be printing the exponent, so set the // sign. @@ -256,22 +254,29 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch prec++; } } + signed_e = -e; } } else { - // Build positive exponent - for (e = 0, e1 = FPDECEXP; e1; e1 >>= 1, pos_pow++, neg_pow++) { - if (*pos_pow <= f) { + // Build positive exponent. + // We don't modify f at this point to avoid innaccuracies from + // scaling it. Instead, we find the product of powers of 10 + // that is not greater than it, and use that to start the + // mantissa. + FPTYPE u_base = FPCONST(1.0); + for (e = 0, e1 = FPDECEXP; e1; e1 >>= 1, pos_pow++) { + FPTYPE next_u = u_base * *pos_pow; + // fp_ge_eps performs "f >= (next_u - 2eps)" so that if, for + // numerical reasons, f is very close to a power of ten but + // not strictly equal, we still treat it as that power of 10. + // The comparison was failing for maybe 10% of 1eX values, but + // although rounding fixed many of them, there were still some + // rendering as 9.99999998e(X-1). + if (fp_ge_eps(f, next_u)) { + u_base = next_u; e += e1; - f *= *neg_pow; } } - // It can be that f was right on the edge of an entry in pos_pow needs to be reduced - if ((int)f >= 10) { - e += 1; - f *= FPCONST(0.1); - } - // If the user specified fixed format (fmt == 'f') and e makes the // number too big to fit into the available buffer, then we'll // switch to the 'e' format. @@ -310,15 +315,15 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch } else { e_sign = '+'; } + signed_e = e; } if (prec < 0) { // This can happen when the prec is trimmed to prevent buffer overflow prec = 0; } - // We now have num.f as a floating point number between >= 1 and < 10 - // (or equal to zero), and e contains the absolute value of the power of - // 10 exponent. and (dec + 1) == the number of dgits before the decimal. + // At this point e contains the absolute value of the power of 10 exponent. + // (dec + 1) == the number of dgits before the decimal. // For e, prec is # digits after the decimal // For f, prec is # digits after the decimal @@ -336,25 +341,63 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch num_digits = prec; } - // Print the digits of the mantissa - for (int i = 0; i < num_digits; ++i, --dec) { - int32_t d = (int32_t)f; - if (d < 0) { - *s++ = '0'; - } else { - *s++ = '0' + d; + if (signed_e < 0) { + // The algorithm below treats numbers smaller than 1 by scaling them + // repeatedly by 10 to bring the new digit to the top. Our input number + // was smaller than 1, so scale it up to be 1 <= f < 10. + FPTYPE u_base = FPCONST(1.0); + const FPTYPE *pow_u = g_pos_pow; + for (int m = FPDECEXP; m; m >>= 1, pow_u++) { + if (m & e) { + u_base *= *pow_u; + } } - if (dec == 0 && prec > 0) { - *s++ = '.'; - } - f -= (FPTYPE)d; - f *= FPCONST(10.0); + f *= u_base; } - // Round - // If we print non-exponential format (i.e. 'f'), but a digit we're going - // to round by (e) is too far away, then there's nothing to round. - if ((org_fmt != 'f' || e <= num_digits) && f >= FPCONST(5.0)) { + int d = 0; + int num_digits_left = num_digits; + for (int digit_index = signed_e; num_digits_left >= 0; --digit_index) { + FPTYPE u_base = FPCONST(1.0); + if (digit_index > 0) { + // Generate 10^digit_index for positive digit_index. + const FPTYPE *pow_u = g_pos_pow; + int target_index = digit_index; + for (int m = FPDECEXP; m; m >>= 1, pow_u++) { + if (m & target_index) { + u_base *= *pow_u; + } + } + } + for (d = 0; d < 9; ++d) { + // This is essentially "if (f < u_base)", but with 2eps margin + // so that if f is just a tiny bit smaller, we treat it as + // equal (and accept the additional digit value). + if (!fp_ge_eps(f, u_base)) { + break; + } + f -= u_base; + } + // We calculate one more digit than we display, to use in rounding + // below. So only emit the digit if it's one that we display. + if (num_digits_left > 0) { + // Emit this number (the leading digit). + *s++ = '0' + d; + if (dec == 0 && prec > 0) { + *s++ = '.'; + } + } + --dec; + --num_digits_left; + if (digit_index <= 0) { + // Once we get below 1.0, we scale up f instead of calculting + // negative powers of 10 in u_base. This provides better + // renditions of exact decimals like 1/16 etc. + f *= FPCONST(10.0); + } + } + // Rounding. If the next digit to print is >= 5, round up. + if (d >= 5) { char *rs = s; rs--; while (1) { @@ -394,7 +437,10 @@ int mp_format_float(FPTYPE f, char *buf, size_t buf_size, char fmt, int prec, ch } } else { // Need at extra digit at the end to make room for the leading '1' - s++; + // but if we're at the buffer size limit, just drop the final digit. + if ((size_t)(s + 1 - buf) < buf_size) { + s++; + } } char *ss = s; while (ss > rs) { diff --git a/py/gc.h b/py/gc.h index ddd07fb4c0..b9036ff4ba 100644 --- a/py/gc.h +++ b/py/gc.h @@ -35,11 +35,16 @@ #define WORDS_PER_BLOCK ((MICROPY_BYTES_PER_GC_BLOCK) / MP_BYTES_PER_OBJ_WORD) #define BYTES_PER_BLOCK (MICROPY_BYTES_PER_GC_BLOCK) +#define HEAP_PTR(ptr) ( \ + MP_STATE_MEM(gc_pool_start) != 0 /* Not on the heap if it isn't inited */ \ + && ptr >= (void *)MP_STATE_MEM(gc_pool_start) /* must be above start of pool */ \ + && ptr < (void *)MP_STATE_MEM(gc_pool_end) /* must be below end of pool */ \ + ) + // ptr should be of type void* #define VERIFY_PTR(ptr) ( \ ((uintptr_t)(ptr) & (BYTES_PER_BLOCK - 1)) == 0 /* must be aligned on a block */ \ - && ptr >= (void *)MP_STATE_MEM(gc_pool_start) /* must be above start of pool */ \ - && ptr < (void *)MP_STATE_MEM(gc_pool_end) /* must be below end of pool */ \ + && HEAP_PTR(ptr) \ ) void gc_init(void *start, void *end); diff --git a/py/lexer.c b/py/lexer.c index 196f9a2644..0d6de0d522 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -32,7 +32,7 @@ #include "py/lexer.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_ENABLE_COMPILER diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index 74ad78c47d..2abbdedefd 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -4,7 +4,7 @@ Process raw qstr file and output qstr data with length, hash and data bytes. This script works with Python 2.7, 3.3 and 3.4. For documentation about the format of compressed translated strings, see -supervisor/shared/translate.h +supervisor/shared/translate/translate.h """ from __future__ import print_function @@ -24,10 +24,6 @@ if hasattr(sys.stdout, "reconfigure"): py = os.path.dirname(sys.argv[0]) top = os.path.dirname(py) -sys.path.append(os.path.join(top, "tools/huffman")) - -import huffman - # Python 2/3 compatibility: # - iterating through bytes is different # - codepoint2name lives in a different module @@ -262,325 +258,6 @@ def compute_hash(qstr, bytes_hash): return (hash & ((1 << (8 * bytes_hash)) - 1)) or 1 -def translate(translation_file, i18ns): - with open(translation_file, "rb") as f: - table = gettext.GNUTranslations(f) - - translations = [] - for original in i18ns: - unescaped = original - for s in C_ESCAPES: - unescaped = unescaped.replace(C_ESCAPES[s], s) - translation = table.gettext(unescaped) - # Add in carriage returns to work in terminals - translation = translation.replace("\n", "\r\n") - translations.append((original, translation)) - return translations - - -class TextSplitter: - def __init__(self, words): - words = sorted(words, key=lambda x: len(x), reverse=True) - self.words = set(words) - if words: - pat = "|".join(re.escape(w) for w in words) + "|." - else: - pat = "." - self.pat = re.compile(pat, flags=re.DOTALL) - - def iter_words(self, text): - s = [] - words = self.words - for m in self.pat.finditer(text): - t = m.group(0) - if t in words: - if s: - yield (False, "".join(s)) - s = [] - yield (True, t) - else: - s.append(t) - if s: - yield (False, "".join(s)) - - def iter(self, text): - for m in self.pat.finditer(text): - yield m.group(0) - - -def iter_substrings(s, minlen, maxlen): - len_s = len(s) - maxlen = min(len_s, maxlen) - for n in range(minlen, maxlen + 1): - for begin in range(0, len_s - n + 1): - yield s[begin : begin + n] - - -def compute_huffman_coding(translations, compression_filename): - texts = [t[1] for t in translations] - words = [] - - start_unused = 0x80 - end_unused = 0xFF - max_ord = 0 - for text in texts: - for c in text: - ord_c = ord(c) - max_ord = max(ord_c, max_ord) - if 0x80 <= ord_c < 0xFF: - end_unused = min(ord_c, end_unused) - max_words = end_unused - 0x80 - - bits_per_codepoint = 16 if max_ord > 255 else 8 - values_type = "uint16_t" if max_ord > 255 else "uint8_t" - while len(words) < max_words: - # Until the dictionary is filled to capacity, use a heuristic to find - # the best "word" (2- to 11-gram) to add to it. - # - # The TextSplitter allows us to avoid considering parts of the text - # that are already covered by a previously chosen word, for example - # if "the" is in words then not only will "the" not be considered - # again, neither will "there" or "wither", since they have "the" - # as substrings. - extractor = TextSplitter(words) - counter = collections.Counter() - for t in texts: - for atom in extractor.iter(t): - counter[atom] += 1 - cb = huffman.codebook(counter.items()) - lengths = sorted(dict((v, len(cb[k])) for k, v in counter.items()).items()) - - def bit_length(s): - return sum(len(cb[c]) for c in s) - - def est_len(occ): - idx = bisect.bisect_left(lengths, (occ, 0)) - return lengths[idx][1] + 1 - - # The cost of adding a dictionary word is just its storage size - # while its savings is close to the difference between the original - # huffman bit-length of the string and the estimated bit-length - # of the dictionary word, times the number of times the word appears. - # - # The savings is not strictly accurate because including a word into - # the Huffman tree bumps up the encoding lengths of all words in the - # same subtree. In the extreme case when the new word is so frequent - # that it gets a one-bit encoding, all other words will cost an extra - # bit each. This is empirically modeled by the constant factor added to - # cost, but the specific value used isn't "proven" to be correct. - # - # Another source of inaccuracy is that compressed strings end up - # on byte boundaries, not bit boundaries, so saving 1 bit somewhere - # might not save a byte. - # - # In fact, when this change was first made, some translations (luckily, - # ones on boards not at all close to full) wasted up to 40 bytes, - # while the most constrained boards typically gained 100 bytes or - # more. - # - # The difference between the two is the estimated net savings, in bits. - def est_net_savings(s, occ): - savings = occ * (bit_length(s) - est_len(occ)) - cost = len(s) * bits_per_codepoint + 24 - return savings - cost - - counter = collections.Counter() - for t in texts: - for (found, word) in extractor.iter_words(t): - if not found: - for substr in iter_substrings(word, minlen=2, maxlen=11): - counter[substr] += 1 - - # Score the candidates we found. This is a semi-empirical formula that - # attempts to model the number of bits saved as closely as possible. - # - # It attempts to compute the codeword lengths of the original word - # to the codeword length the dictionary entry would get, times - # the number of occurrences, less the ovehead of the entries in the - # words[] array. - - scores = sorted( - ((s, -est_net_savings(s, occ)) for (s, occ) in counter.items()), key=lambda x: x[1] - ) - - # Pick the one with the highest score. The score must be negative. - if not scores or scores[0][-1] >= 0: - break - - word = scores[0][0] - words.append(word) - - words.sort(key=len) - extractor = TextSplitter(words) - counter = collections.Counter() - for t in texts: - for atom in extractor.iter(t): - counter[atom] += 1 - cb = huffman.codebook(counter.items()) - - word_start = start_unused - word_end = word_start + len(words) - 1 - print("// # words", len(words)) - print("// words", words) - - values = [] - length_count = {} - renumbered = 0 - last_length = None - canonical = {} - for atom, code in sorted(cb.items(), key=lambda x: (len(x[1]), x[0])): - values.append(atom) - length = len(code) - if length not in length_count: - length_count[length] = 0 - length_count[length] += 1 - if last_length: - renumbered <<= length - last_length - canonical[atom] = "{0:0{width}b}".format(renumbered, width=length) - # print(f"atom={repr(atom)} code={code}", file=sys.stderr) - if len(atom) > 1: - o = words.index(atom) + 0x80 - s = "".join(C_ESCAPES.get(ch1, ch1) for ch1 in atom) - else: - s = C_ESCAPES.get(atom, atom) - o = ord(atom) - print("//", o, s, counter[atom], canonical[atom], renumbered) - renumbered += 1 - last_length = length - lengths = bytearray() - print("// length count", length_count) - - for i in range(1, max(length_count) + 2): - lengths.append(length_count.get(i, 0)) - print("// values", values, "lengths", len(lengths), lengths) - - print("//", values, lengths) - values = [(atom if len(atom) == 1 else chr(0x80 + words.index(atom))) for atom in values] - max_translation_encoded_length = max( - len(translation.encode("utf-8")) for (original, translation) in translations - ) - - maxlen = len(words[-1]) - minlen = len(words[0]) - wlencount = [len([None for w in words if len(w) == l]) for l in range(minlen, maxlen + 1)] - - with open(compression_filename, "w") as f: - f.write("typedef {} mchar_t;".format(values_type)) - f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) - f.write( - "const mchar_t values[] = {{ {} }};\n".format(", ".join(str(ord(u)) for u in values)) - ) - f.write( - "#define compress_max_length_bits ({})\n".format( - max_translation_encoded_length.bit_length() - ) - ) - f.write( - "const mchar_t words[] = {{ {} }};\n".format( - ", ".join(str(ord(c)) for w in words for c in w) - ) - ) - f.write( - "const uint8_t wlencount[] = {{ {} }};\n".format(", ".join(str(p) for p in wlencount)) - ) - f.write("#define word_start {}\n".format(word_start)) - f.write("#define word_end {}\n".format(word_end)) - f.write("#define minlen {}\n".format(minlen)) - f.write("#define maxlen {}\n".format(maxlen)) - - return (values, lengths, words, canonical, extractor) - - -def decompress(encoding_table, encoded, encoded_length_bits): - (values, lengths, words, _, _) = encoding_table - dec = [] - this_byte = 0 - this_bit = 7 - b = encoded[this_byte] - bits = 0 - for i in range(encoded_length_bits): - bits <<= 1 - if 0x80 & b: - bits |= 1 - - b <<= 1 - if this_bit == 0: - this_bit = 7 - this_byte += 1 - if this_byte < len(encoded): - b = encoded[this_byte] - else: - this_bit -= 1 - length = bits - - i = 0 - while i < length: - bits = 0 - bit_length = 0 - max_code = lengths[0] - searched_length = lengths[0] - while True: - bits <<= 1 - if 0x80 & b: - bits |= 1 - - b <<= 1 - bit_length += 1 - if this_bit == 0: - this_bit = 7 - this_byte += 1 - if this_byte < len(encoded): - b = encoded[this_byte] - else: - this_bit -= 1 - if max_code > 0 and bits < max_code: - # print('{0:0{width}b}'.format(bits, width=bit_length)) - break - max_code = (max_code << 1) + lengths[bit_length] - searched_length += lengths[bit_length] - - v = values[searched_length + bits - max_code] - if v >= chr(0x80) and v < chr(0x80 + len(words)): - v = words[ord(v) - 0x80] - i += len(v.encode("utf-8")) - dec.append(v) - return "".join(dec) - - -def compress(encoding_table, decompressed, encoded_length_bits, len_translation_encoded): - if not isinstance(decompressed, str): - raise TypeError() - (_, _, _, canonical, extractor) = encoding_table - - enc = bytearray(len(decompressed) * 3) - current_bit = 7 - current_byte = 0 - - bits = encoded_length_bits + 1 - for i in range(bits - 1, 0, -1): - if len_translation_encoded & (1 << (i - 1)): - enc[current_byte] |= 1 << current_bit - if current_bit == 0: - current_bit = 7 - current_byte += 1 - else: - current_bit -= 1 - - for atom in extractor.iter(decompressed): - for b in canonical[atom]: - if b == "1": - enc[current_byte] |= 1 << current_bit - if current_bit == 0: - current_bit = 7 - current_byte += 1 - else: - current_bit -= 1 - - if current_bit != 7: - current_byte += 1 - return enc[:current_byte] - - def qstr_escape(qst): def esc_char(m): c = ord(m.group(0)) @@ -694,7 +371,7 @@ def make_bytes(cfg_bytes_len, cfg_bytes_hash, qstr): return '%d, %d, "%s"' % (qhash, qlen, qdata) -def print_qstr_data(encoding_table, qcfgs, qstrs, i18ns): +def print_qstr_data(qcfgs, qstrs, i18ns): # get config variables cfg_bytes_len = int(qcfgs["BYTES_IN_LEN"]) cfg_bytes_hash = int(qcfgs["BYTES_IN_HASH"]) @@ -707,7 +384,6 @@ def print_qstr_data(encoding_table, qcfgs, qstrs, i18ns): print('QDEF(MP_QSTRnull, 0, 0, "")') total_qstr_size = 0 - total_qstr_compressed_size = 0 # go through each qstr and print it out for order, ident, qstr in sorted(qstrs.values(), key=lambda x: x[0]): qbytes = make_bytes(cfg_bytes_len, cfg_bytes_hash, qstr) @@ -715,34 +391,14 @@ def print_qstr_data(encoding_table, qcfgs, qstrs, i18ns): total_qstr_size += len(qstr) - total_text_size = 0 - total_text_compressed_size = 0 - max_translation_encoded_length = max( - len(translation.encode("utf-8")) for original, translation in i18ns + print( + "// Enumerate translated texts but don't actually include translations. Instead, the linker will link them in." ) - encoded_length_bits = max_translation_encoded_length.bit_length() - for original, translation in i18ns: - translation_encoded = translation.encode("utf-8") - compressed = compress( - encoding_table, translation, encoded_length_bits, len(translation_encoded) - ) - total_text_compressed_size += len(compressed) - decompressed = decompress(encoding_table, compressed, encoded_length_bits) - assert decompressed == translation - for c in C_ESCAPES: - decompressed = decompressed.replace(c, C_ESCAPES[c]) - print( - 'TRANSLATION("{}", {}) // {}'.format( - original, ", ".join(["{:d}".format(x) for x in compressed]), decompressed - ) - ) - total_text_size += len(translation.encode("utf-8")) + for i, original in enumerate(i18ns): + print('TRANSLATION("{}", {})'.format(original, i)) print() print("// {} bytes worth of qstr".format(total_qstr_size)) - print("// {} bytes worth of translations".format(total_text_size)) - print("// {} bytes worth of translations compressed".format(total_text_compressed_size)) - print("// {} bytes saved".format(total_text_size - total_text_compressed_size)) def print_qstr_enums(qstrs): @@ -768,19 +424,18 @@ if __name__ == "__main__": "infiles", metavar="N", type=str, nargs="+", help="an integer for the accumulator" ) parser.add_argument( - "--translation", default=None, type=str, help="translations for i18n() items" - ) - parser.add_argument( - "--compression_filename", default=None, type=str, help="header for compression info" + "--output_type", + default="enums", + type=str, + help="output definitions", + choices=("enums", "data"), ) args = parser.parse_args() qcfgs, qstrs, i18ns = parse_input_headers(args.infiles) - if args.translation: + if args.output_type == "data": i18ns = sorted(i18ns) - translations = translate(args.translation, i18ns) - encoding_table = compute_huffman_coding(translations, args.compression_filename) - print_qstr_data(encoding_table, qcfgs, qstrs, translations) + print_qstr_data(qcfgs, qstrs, i18ns) else: print_qstr_enums(qstrs) diff --git a/py/maketranslationdata.py b/py/maketranslationdata.py new file mode 100644 index 0000000000..c0ae85f4e0 --- /dev/null +++ b/py/maketranslationdata.py @@ -0,0 +1,526 @@ +""" +Process raw qstr file and output qstr data with length, hash and data bytes. + +This script works with Python 2.7, 3.3 and 3.4. + +For documentation about the format of compressed translated strings, see +supervisor/shared/translate/translate.h +""" + +from __future__ import print_function + +import bisect +import re +import sys + +import collections +import gettext +import os.path + +if hasattr(sys.stdout, "reconfigure"): + sys.stdout.reconfigure(encoding="utf-8") + sys.stderr.reconfigure(errors="backslashreplace") + +py = os.path.dirname(sys.argv[0]) +top = os.path.dirname(py) + +sys.path.append(os.path.join(top, "tools/huffman")) + +import huffman + +# Python 2/3 compatibility: +# - iterating through bytes is different +# - codepoint2name lives in a different module +import platform + +if platform.python_version_tuple()[0] == "2": + bytes_cons = lambda val, enc=None: bytearray(val) + from htmlentitydefs import codepoint2name +elif platform.python_version_tuple()[0] == "3": + bytes_cons = bytes + from html.entities import codepoint2name +# end compatibility code + +codepoint2name[ord("-")] = "hyphen" + +# add some custom names to map characters that aren't in HTML +codepoint2name[ord(" ")] = "space" +codepoint2name[ord("'")] = "squot" +codepoint2name[ord(",")] = "comma" +codepoint2name[ord(".")] = "dot" +codepoint2name[ord(":")] = "colon" +codepoint2name[ord(";")] = "semicolon" +codepoint2name[ord("/")] = "slash" +codepoint2name[ord("%")] = "percent" +codepoint2name[ord("#")] = "hash" +codepoint2name[ord("(")] = "paren_open" +codepoint2name[ord(")")] = "paren_close" +codepoint2name[ord("[")] = "bracket_open" +codepoint2name[ord("]")] = "bracket_close" +codepoint2name[ord("{")] = "brace_open" +codepoint2name[ord("}")] = "brace_close" +codepoint2name[ord("*")] = "star" +codepoint2name[ord("!")] = "bang" +codepoint2name[ord("\\")] = "backslash" +codepoint2name[ord("+")] = "plus" +codepoint2name[ord("$")] = "dollar" +codepoint2name[ord("=")] = "equals" +codepoint2name[ord("?")] = "question" +codepoint2name[ord("@")] = "at_sign" +codepoint2name[ord("^")] = "caret" +codepoint2name[ord("|")] = "pipe" +codepoint2name[ord("~")] = "tilde" + +C_ESCAPES = { + "\a": "\\a", + "\b": "\\b", + "\f": "\\f", + "\n": "\\n", + "\r": "\\r", + "\t": "\\t", + "\v": "\\v", + "'": "\\'", + '"': '\\"', +} + +# this must match the equivalent function in qstr.c +def compute_hash(qstr, bytes_hash): + hash = 5381 + for b in qstr: + hash = (hash * 33) ^ b + # Make sure that valid hash is never zero, zero means "hash not computed" + return (hash & ((1 << (8 * bytes_hash)) - 1)) or 1 + + +def translate(translation_file, i18ns): + with open(translation_file, "rb") as f: + table = gettext.GNUTranslations(f) + + translations = [] + for original in i18ns: + unescaped = original + for s in C_ESCAPES: + unescaped = unescaped.replace(C_ESCAPES[s], s) + translation = table.gettext(unescaped) + # Add in carriage returns to work in terminals + translation = translation.replace("\n", "\r\n") + translations.append((original, translation)) + return translations + + +class TextSplitter: + def __init__(self, words): + words = sorted(words, key=lambda x: len(x), reverse=True) + self.words = set(words) + if words: + pat = "|".join(re.escape(w) for w in words) + "|." + else: + pat = "." + self.pat = re.compile(pat, flags=re.DOTALL) + + def iter_words(self, text): + s = [] + words = self.words + for m in self.pat.finditer(text): + t = m.group(0) + if t in words: + if s: + yield (False, "".join(s)) + s = [] + yield (True, t) + else: + s.append(t) + if s: + yield (False, "".join(s)) + + def iter(self, text): + for m in self.pat.finditer(text): + yield m.group(0) + + +def iter_substrings(s, minlen, maxlen): + len_s = len(s) + maxlen = min(len_s, maxlen) + for n in range(minlen, maxlen + 1): + for begin in range(0, len_s - n + 1): + yield s[begin : begin + n] + + +def compute_huffman_coding(translations, f): + texts = [t[1] for t in translations] + words = [] + + start_unused = 0x80 + end_unused = 0xFF + max_ord = 0 + for text in texts: + for c in text: + ord_c = ord(c) + max_ord = max(ord_c, max_ord) + if 0x80 <= ord_c < 0xFF: + end_unused = min(ord_c, end_unused) + max_words = end_unused - 0x80 + + bits_per_codepoint = 16 if max_ord > 255 else 8 + values_type = "uint16_t" if max_ord > 255 else "uint8_t" + while len(words) < max_words: + # Until the dictionary is filled to capacity, use a heuristic to find + # the best "word" (2- to 11-gram) to add to it. + # + # The TextSplitter allows us to avoid considering parts of the text + # that are already covered by a previously chosen word, for example + # if "the" is in words then not only will "the" not be considered + # again, neither will "there" or "wither", since they have "the" + # as substrings. + extractor = TextSplitter(words) + counter = collections.Counter() + for t in texts: + for atom in extractor.iter(t): + counter[atom] += 1 + cb = huffman.codebook(counter.items()) + lengths = sorted(dict((v, len(cb[k])) for k, v in counter.items()).items()) + + def bit_length(s): + return sum(len(cb[c]) for c in s) + + def est_len(occ): + idx = bisect.bisect_left(lengths, (occ, 0)) + return lengths[idx][1] + 1 + + # The cost of adding a dictionary word is just its storage size + # while its savings is close to the difference between the original + # huffman bit-length of the string and the estimated bit-length + # of the dictionary word, times the number of times the word appears. + # + # The savings is not strictly accurate because including a word into + # the Huffman tree bumps up the encoding lengths of all words in the + # same subtree. In the extreme case when the new word is so frequent + # that it gets a one-bit encoding, all other words will cost an extra + # bit each. This is empirically modeled by the constant factor added to + # cost, but the specific value used isn't "proven" to be correct. + # + # Another source of inaccuracy is that compressed strings end up + # on byte boundaries, not bit boundaries, so saving 1 bit somewhere + # might not save a byte. + # + # In fact, when this change was first made, some translations (luckily, + # ones on boards not at all close to full) wasted up to 40 bytes, + # while the most constrained boards typically gained 100 bytes or + # more. + # + # The difference between the two is the estimated net savings, in bits. + def est_net_savings(s, occ): + savings = occ * (bit_length(s) - est_len(occ)) + cost = len(s) * bits_per_codepoint + 24 + return savings - cost + + counter = collections.Counter() + for t in texts: + for (found, word) in extractor.iter_words(t): + if not found: + for substr in iter_substrings(word, minlen=2, maxlen=11): + counter[substr] += 1 + + # Score the candidates we found. This is a semi-empirical formula that + # attempts to model the number of bits saved as closely as possible. + # + # It attempts to compute the codeword lengths of the original word + # to the codeword length the dictionary entry would get, times + # the number of occurrences, less the ovehead of the entries in the + # words[] array. + + scores = sorted( + ((s, -est_net_savings(s, occ)) for (s, occ) in counter.items() if occ > 1), + key=lambda x: x[1], + ) + + # Pick the one with the highest score. The score must be negative. + if not scores or scores[0][-1] >= 0: + break + + word = scores[0][0] + words.append(word) + + words.sort(key=len) + extractor = TextSplitter(words) + counter = collections.Counter() + for t in texts: + for atom in extractor.iter(t): + counter[atom] += 1 + cb = huffman.codebook(counter.items()) + + word_start = start_unused + word_end = word_start + len(words) - 1 + f.write(f"// # words {len(words)}\n") + f.write(f"// words {words}\n") + + values = [] + length_count = {} + renumbered = 0 + last_length = None + canonical = {} + for atom, code in sorted(cb.items(), key=lambda x: (len(x[1]), x[0])): + values.append(atom) + length = len(code) + if length not in length_count: + length_count[length] = 0 + length_count[length] += 1 + if last_length: + renumbered <<= length - last_length + canonical[atom] = "{0:0{width}b}".format(renumbered, width=length) + # print(f"atom={repr(atom)} code={code}", file=sys.stderr) + if len(atom) > 1: + o = words.index(atom) + 0x80 + s = "".join(C_ESCAPES.get(ch1, ch1) for ch1 in atom) + else: + s = C_ESCAPES.get(atom, atom) + o = ord(atom) + f.write(f"// {o} {s} {counter[atom]} {canonical[atom]} {renumbered}\n") + renumbered += 1 + last_length = length + lengths = bytearray() + f.write(f"// length count {length_count}\n") + + for i in range(1, max(length_count) + 2): + lengths.append(length_count.get(i, 0)) + f.write(f"// values {values} lengths {len(lengths)} {lengths}\n") + + f.write(f"// {values} {lengths}\n") + values = [(atom if len(atom) == 1 else chr(0x80 + words.index(atom))) for atom in values] + max_translation_encoded_length = max( + len(translation.encode("utf-8")) for (original, translation) in translations + ) + + maxlen = len(words[-1]) + minlen = len(words[0]) + wlencount = [len([None for w in words if len(w) == l]) for l in range(minlen, maxlen + 1)] + + f.write("typedef {} mchar_t;\n".format(values_type)) + f.write("const uint8_t lengths[] = {{ {} }};\n".format(", ".join(map(str, lengths)))) + f.write("const mchar_t values[] = {{ {} }};\n".format(", ".join(str(ord(u)) for u in values))) + f.write( + "#define compress_max_length_bits ({})\n".format( + max_translation_encoded_length.bit_length() + ) + ) + f.write( + "const mchar_t words[] = {{ {} }};\n".format( + ", ".join(str(ord(c)) for w in words for c in w) + ) + ) + f.write("const uint8_t wlencount[] = {{ {} }};\n".format(", ".join(str(p) for p in wlencount))) + f.write("#define word_start {}\n".format(word_start)) + f.write("#define word_end {}\n".format(word_end)) + f.write("#define minlen {}\n".format(minlen)) + f.write("#define maxlen {}\n".format(maxlen)) + + return (values, lengths, words, canonical, extractor) + + +def decompress(encoding_table, encoded, encoded_length_bits): + (values, lengths, words, _, _) = encoding_table + dec = [] + this_byte = 0 + this_bit = 7 + b = encoded[this_byte] + bits = 0 + for i in range(encoded_length_bits): + bits <<= 1 + if 0x80 & b: + bits |= 1 + + b <<= 1 + if this_bit == 0: + this_bit = 7 + this_byte += 1 + if this_byte < len(encoded): + b = encoded[this_byte] + else: + this_bit -= 1 + length = bits + + i = 0 + while i < length: + bits = 0 + bit_length = 0 + max_code = lengths[0] + searched_length = lengths[0] + while True: + bits <<= 1 + if 0x80 & b: + bits |= 1 + + b <<= 1 + bit_length += 1 + if this_bit == 0: + this_bit = 7 + this_byte += 1 + if this_byte < len(encoded): + b = encoded[this_byte] + else: + this_bit -= 1 + if max_code > 0 and bits < max_code: + # print('{0:0{width}b}'.format(bits, width=bit_length)) + break + max_code = (max_code << 1) + lengths[bit_length] + searched_length += lengths[bit_length] + + v = values[searched_length + bits - max_code] + if v >= chr(0x80) and v < chr(0x80 + len(words)): + v = words[ord(v) - 0x80] + i += len(v.encode("utf-8")) + dec.append(v) + return "".join(dec) + + +def compress(encoding_table, decompressed, encoded_length_bits, len_translation_encoded): + if not isinstance(decompressed, str): + raise TypeError() + (_, _, _, canonical, extractor) = encoding_table + + enc = bytearray(len(decompressed) * 3) + current_bit = 7 + current_byte = 0 + + bits = encoded_length_bits + 1 + for i in range(bits - 1, 0, -1): + if len_translation_encoded & (1 << (i - 1)): + enc[current_byte] |= 1 << current_bit + if current_bit == 0: + current_bit = 7 + current_byte += 1 + else: + current_bit -= 1 + + for atom in extractor.iter(decompressed): + for b in canonical[atom]: + if b == "1": + enc[current_byte] |= 1 << current_bit + if current_bit == 0: + current_bit = 7 + current_byte += 1 + else: + current_bit -= 1 + + if current_bit != 7: + current_byte += 1 + return enc[:current_byte] + + +def qstr_escape(qst): + def esc_char(m): + c = ord(m.group(0)) + try: + name = codepoint2name[c] + except KeyError: + name = "0x%02x" % c + return "_" + name + "_" + + return re.sub(r"[^A-Za-z0-9_]", esc_char, qst) + + +def parse_input_headers(infiles): + i18ns = set() + + # read the qstrs in from the input files + for infile in infiles: + with open(infile, "rt") as f: + for line in f: + line = line.strip() + + match = re.match(r'^TRANSLATE\("(.*)"\)$', line) + if match: + i18ns.add(match.group(1)) + continue + + return i18ns + + +def escape_bytes(qstr): + if all(32 <= ord(c) <= 126 and c != "\\" and c != '"' for c in qstr): + # qstr is all printable ASCII so render it as-is (for easier debugging) + return qstr + else: + # qstr contains non-printable codes so render entire thing as hex pairs + qbytes = bytes_cons(qstr, "utf8") + return "".join(("\\x%02x" % b) for b in qbytes) + + +def make_bytes(cfg_bytes_len, cfg_bytes_hash, qstr): + qbytes = bytes_cons(qstr, "utf8") + qlen = len(qbytes) + qhash = compute_hash(qbytes, cfg_bytes_hash) + if qlen >= (1 << (8 * cfg_bytes_len)): + print("qstr is too long:", qstr) + assert False + qdata = escape_bytes(qstr) + return '%d, %d, "%s"' % (qhash, qlen, qdata) + + +def output_translation_data(encoding_table, i18ns, out): + # print out the starter of the generated C file + out.write("// This file was automatically generated by maketranslatedata.py\n") + out.write('#include "supervisor/shared/translate/compressed_string.h"\n') + out.write("\n") + + total_text_size = 0 + total_text_compressed_size = 0 + max_translation_encoded_length = max( + len(translation.encode("utf-8")) for original, translation in i18ns + ) + encoded_length_bits = max_translation_encoded_length.bit_length() + for i, translation in enumerate(i18ns): + original, translation = translation + translation_encoded = translation.encode("utf-8") + compressed = compress( + encoding_table, translation, encoded_length_bits, len(translation_encoded) + ) + total_text_compressed_size += len(compressed) + decompressed = decompress(encoding_table, compressed, encoded_length_bits) + assert decompressed == translation + for c in C_ESCAPES: + decompressed = decompressed.replace(c, C_ESCAPES[c]) + formatted = ["{:d}".format(x) for x in compressed] + out.write( + "const compressed_string_t translation{} = {{ .data = {}, .tail = {{ {} }} }}; // {}\n".format( + i, formatted[0], ", ".join(formatted[1:]), original, decompressed + ) + ) + total_text_size += len(translation.encode("utf-8")) + + out.write("\n") + out.write("// {} bytes worth of translations\n".format(total_text_size)) + out.write("// {} bytes worth of translations compressed\n".format(total_text_compressed_size)) + out.write("// {} bytes saved\n".format(total_text_size - total_text_compressed_size)) + + +if __name__ == "__main__": + import argparse + + parser = argparse.ArgumentParser( + description="Process QSTR definitions into headers for compilation" + ) + parser.add_argument( + "infiles", metavar="N", type=str, nargs="+", help="an integer for the accumulator" + ) + parser.add_argument( + "--translation", default=None, type=str, help="translations for i18n() items" + ) + parser.add_argument( + "--compression_filename", + type=argparse.FileType("w", encoding="UTF-8"), + help="header for compression info", + ) + parser.add_argument( + "--translation_filename", + type=argparse.FileType("w", encoding="UTF-8"), + help="c file for translation data", + ) + + args = parser.parse_args() + + i18ns = parse_input_headers(args.infiles) + i18ns = sorted(i18ns) + translations = translate(args.translation, i18ns) + encoding_table = compute_huffman_coding(translations, args.compression_filename) + output_translation_data(encoding_table, translations, args.translation_filename) diff --git a/py/makeversionhdr.py b/py/makeversionhdr.py index da6f7c9f59..6576c3abbb 100644 --- a/py/makeversionhdr.py +++ b/py/makeversionhdr.py @@ -19,16 +19,14 @@ def get_version_info_from_git(): # Note: git describe doesn't work if no tag is available try: git_tag = subprocess.check_output( - [tools_describe], - stderr=subprocess.STDOUT, - universal_newlines=True, + [tools_describe], stderr=subprocess.STDOUT, universal_newlines=True, shell=True ).strip() except subprocess.CalledProcessError as er: if er.returncode == 128: # git exit code of 128 means no repository found return None git_tag = "" - except OSError: + except OSError as e: return None try: git_hash = subprocess.check_output( @@ -61,29 +59,25 @@ def get_version_info_from_git(): return git_tag, git_hash, ver -def get_version_info_from_docs_conf(): - with open(os.path.join(os.path.dirname(sys.argv[0]), "..", "conf.py")) as f: - for line in f: - if line.startswith("version = release = '"): - ver = line.strip().split(" = ")[2].strip("'") - git_tag = "v" + ver - ver = ver.split(".") - if len(ver) == 2: - ver.append("0") - return git_tag, "", ver - return None +def cannot_determine_version(): + raise SystemExit( + """Cannot determine version. + +CircuitPython must be built from a git clone with tags. +If you cloned from a fork, fetch the tags from adafruit/circuitpython as follows: + + git fetch --tags --recurse-submodules=no --shallow-since="2021-07-01" https://github.com/adafruit/circuitpython HEAD""" + ) def make_version_header(filename): - # Get version info using git, with fallback to docs/conf.py + # Get version info using git (required) info = get_version_info_from_git() if info is None: - info = get_version_info_from_docs_conf() - + cannot_determine_version() git_tag, git_hash, ver = info if len(ver) < 3: - ver = ("0", "0", "0") - version_string = git_hash + cannot_determine_version() else: version_string = ".".join(ver) diff --git a/py/mkrules.mk b/py/mkrules.mk index 6bef64fd82..ef0f66117d 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -58,11 +58,11 @@ $(Q)$(CXX) $(CXXFLAGS) -c -MD -o $@ $< endef vpath %.c . $(TOP) $(USER_C_MODULES) $(DEVICES_MODULES) -$(BUILD)/%.o: %.c +$(BUILD)/%.o: %.c | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/qstrdefs.enum.h $(call compile_c) vpath %.cpp . $(TOP) $(USER_C_MODULES) -$(BUILD)/%.o: %.cpp +$(BUILD)/%.o: %.cpp | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/qstrdefs.enum.h $(call compile_cxx) QSTR_GEN_EXTRA_CFLAGS += -DNO_QSTR -x c @@ -89,7 +89,7 @@ $(BUILD)/%.pp: %.c # the right .o's to get recompiled if the generated.h file changes. Adding # an order-only dependency to all of the .o's will cause the generated .h # to get built before we try to compile any of them. -$(OBJ): | $(HEADER_BUILD)/qstrdefs.enum.h $(HEADER_BUILD)/mpversion.h +$(OBJ): | $(HEADER_BUILD)/mpversion.h # The logic for qstr regeneration (applied by makeqstrdefs.py) is: # - if anything in QSTR_GLOBAL_DEPENDENCIES is newer, then process all source files ($^) diff --git a/py/modbuiltins.c b/py/modbuiltins.c index ebdbd52dff..4e9fbfcd93 100644 --- a/py/modbuiltins.c +++ b/py/modbuiltins.c @@ -35,7 +35,7 @@ #include "py/builtin.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT #include @@ -190,8 +190,8 @@ STATIC mp_obj_t mp_builtin_dir(size_t n_args, const mp_obj_t *args) { // Implemented by probing all possible qstrs with mp_load_method_maybe size_t nqstr = QSTR_TOTAL(); for (size_t i = MP_QSTR_ + 1; i < nqstr; ++i) { - mp_obj_t dest[2]; - mp_load_method_protected(args[0], i, dest, false); + mp_obj_t dest[2] = {}; + mp_load_method_protected(args[0], i, dest, true); if (dest[0] != MP_OBJ_NULL) { #if MICROPY_PY_ALL_SPECIAL_METHODS // Support for __dir__: see if we can dispatch to this special method diff --git a/py/modmath.c b/py/modmath.c index 103310db5e..167d46d02b 100644 --- a/py/modmath.c +++ b/py/modmath.c @@ -27,7 +27,7 @@ #include "py/builtin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_MATH diff --git a/py/modmicropython.c b/py/modmicropython.c index 0465a4eef8..42c84e5292 100644 --- a/py/modmicropython.c +++ b/py/modmicropython.c @@ -32,7 +32,7 @@ #include "py/gc.h" #include "py/mphal.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Various builtins specific to MicroPython runtime, // living in micropython module diff --git a/py/modstruct.c b/py/modstruct.c index c0b0fb7890..17dfc548ab 100644 --- a/py/modstruct.c +++ b/py/modstruct.c @@ -33,7 +33,7 @@ #include "py/objtuple.h" #include "py/binary.h" #include "py/parsenum.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_STRUCT diff --git a/py/modthread.c b/py/modthread.c index 333d750a36..a3960cddcb 100644 --- a/py/modthread.c +++ b/py/modthread.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "py/stackctrl.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_THREAD diff --git a/py/moduerrno.c b/py/moduerrno.c index 56d903f115..0ac0503ccc 100644 --- a/py/moduerrno.c +++ b/py/moduerrno.c @@ -30,7 +30,7 @@ #include "py/obj.h" #include "py/mperrno.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // This list can be defined per port in mpconfigport.h to tailor it to a // specific port's needs. If it's not defined then we provide a default. @@ -140,7 +140,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) { const compressed_string_t *desc = NULL; switch (MP_OBJ_SMALL_INT_VALUE(errno_val)) { case EPERM: - desc = MP_ERROR_TEXT("Permission denied"); + desc = MP_ERROR_TEXT("Operation not permitted"); break; case ENOENT: desc = MP_ERROR_TEXT("No such file/directory"); @@ -155,7 +155,7 @@ const char *mp_common_errno_to_str(mp_obj_t errno_val, char *buf, size_t len) { desc = MP_ERROR_TEXT("File exists"); break; case ENODEV: - desc = MP_ERROR_TEXT("Unsupported operation"); + desc = MP_ERROR_TEXT("No such device"); break; case EINVAL: desc = MP_ERROR_TEXT("Invalid argument"); diff --git a/py/mpconfig.h b/py/mpconfig.h index d66d615996..386a9765eb 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1078,6 +1078,11 @@ typedef double mp_float_t; #define MICROPY_PY_BUILTINS_PROPERTY (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_CORE_FEATURES) #endif +// Whether to optimize property flash storage size (requires linker script support) +#ifndef MICROPY_PY_BUILTINS_PROPERTY +#define MICROPY_PY_BUILTINS_PROPERTY (0) +#endif + // Whether to implement the start/stop/step attributes (readback) on // the "range" builtin type. Rarely used, and costs ~60 bytes (x86). #ifndef MICROPY_PY_BUILTINS_RANGE_ATTRS diff --git a/py/obj.c b/py/obj.c index cc7f9006e8..da609aa8ce 100644 --- a/py/obj.c +++ b/py/obj.c @@ -41,7 +41,7 @@ #include "supervisor/linker.h" #include "supervisor/shared/stack.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" const mp_obj_type_t *MICROPY_WRAP_MP_OBJ_GET_TYPE(mp_obj_get_type)(mp_const_obj_t o_in) { #if MICROPY_OBJ_IMMEDIATE_OBJS && MICROPY_OBJ_REPR == MICROPY_OBJ_REPR_A diff --git a/py/obj.h b/py/obj.h index b31320f7e0..8f38a4c7c0 100644 --- a/py/obj.h +++ b/py/obj.h @@ -34,7 +34,7 @@ #include "py/mpprint.h" #include "py/runtime0.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/compressed_string.h" // This is the definition of the opaque MicroPython object type. // All concrete objects have an encoding within this type and the @@ -356,11 +356,7 @@ typedef struct _mp_rom_obj_t { mp_const_obj_t o; } mp_rom_obj_t; #define MP_DEFINE_CONST_PROP_GET(obj_name, fun_name) \ const mp_obj_fun_builtin_fixed_t fun_name##_obj = {{&mp_type_fun_builtin_1}, .fun._1 = fun_name}; \ - const mp_obj_property_t obj_name = { \ - .base.type = &mp_type_property, \ - .proxy = {(mp_obj_t)&fun_name##_obj, \ - MP_ROM_NONE, \ - MP_ROM_NONE}, } + MP_PROPERTY_GETTER(obj_name, (mp_obj_t)&fun_name##_obj); // These macros are used to define constant or mutable map/dict objects // You can put "static" in front of the definition to make it local @@ -1111,7 +1107,7 @@ typedef struct _mp_rom_obj_static_class_method_t { } mp_rom_obj_static_class_method_t; // property -const mp_obj_t *mp_obj_property_get(mp_obj_t self_in); +const mp_obj_t *mp_obj_property_get(mp_obj_t self_in, size_t *n_proxy); // sequence helpers diff --git a/py/objarray.c b/py/objarray.c index b71687fb35..a66a73a5ac 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -34,7 +34,7 @@ #include "py/objstr.h" #include "py/objarray.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_ARRAY || MICROPY_PY_BUILTINS_BYTEARRAY || MICROPY_PY_BUILTINS_MEMORYVIEW diff --git a/py/objcomplex.c b/py/objcomplex.c index b37b059d59..f205249bb4 100644 --- a/py/objcomplex.c +++ b/py/objcomplex.c @@ -31,7 +31,7 @@ #include "py/parsenum.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_COMPLEX diff --git a/py/objdeque.c b/py/objdeque.c index 2d29d71e3b..59c4c709fc 100644 --- a/py/objdeque.c +++ b/py/objdeque.c @@ -28,7 +28,7 @@ #include #include "py/mpconfig.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_COLLECTIONS_DEQUE diff --git a/py/objdict.c b/py/objdict.c index 5f233741fa..306205d12f 100644 --- a/py/objdict.c +++ b/py/objdict.c @@ -34,7 +34,7 @@ #include "py/objstr.h" #include "supervisor/linker.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" const mp_obj_dict_t mp_const_empty_dict_obj = { .base = { .type = &mp_type_dict }, diff --git a/py/objexcept.c b/py/objexcept.c index fc0787631f..230f9d11ba 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -39,7 +39,7 @@ #include "py/gc.h" #include "py/mperrno.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Number of items per traceback entry (file, line, block) #define TRACEBACK_ENTRY_LEN (3) diff --git a/py/objfloat.c b/py/objfloat.c index 6d1d10188c..f8261df933 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -32,7 +32,7 @@ #include "py/parsenum.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT diff --git a/py/objgenerator.c b/py/objgenerator.c index c63ea6b816..b18101cfa1 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -35,7 +35,7 @@ #include "py/objfun.h" #include "py/stackctrl.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Instance of GeneratorExit exception - needed by generator.close() const mp_obj_exception_t mp_const_GeneratorExit_obj = {{&mp_type_GeneratorExit}, (mp_obj_tuple_t *)&mp_const_empty_tuple_obj, (mp_obj_traceback_t *)&mp_const_empty_traceback_obj}; diff --git a/py/objint.c b/py/objint.c index 50bcbf56f8..b44a2e3b4a 100644 --- a/py/objint.c +++ b/py/objint.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "py/binary.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT #include @@ -480,19 +480,33 @@ MP_DEFINE_CONST_FUN_OBJ_1(int_bit_length_obj, int_bit_length); #endif // this is a classmethod -STATIC mp_obj_t int_from_bytes(size_t n_args, const mp_obj_t *args) { +STATIC mp_obj_t int_from_bytes(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { // TODO: Support signed param (assumes signed=False at the moment) - (void)n_args; + + enum { ARG_bytes, ARG_byteorder, ARG_signed }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_bytes, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_byteorder, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_signed, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + if (args[ARG_signed].u_bool) { + mp_raise_NotImplementedError_varg(MP_ERROR_TEXT("%q=%q"), MP_QSTR_signed, MP_QSTR_True); + } // get the buffer info mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(args[ARG_bytes].u_obj, &bufinfo, MP_BUFFER_READ); const byte *buf = (const byte *)bufinfo.buf; int delta = 1; - if (args[2] == MP_OBJ_NEW_QSTR(MP_QSTR_little)) { + if (args[ARG_byteorder].u_obj == MP_OBJ_NEW_QSTR(MP_QSTR_little)) { buf += bufinfo.len - 1; delta = -1; + } else if (args[ARG_byteorder].u_obj != MP_OBJ_NEW_QSTR(MP_QSTR_big)) { + mp_arg_error_invalid(MP_QSTR_byteorder); } mp_uint_t value = 0; @@ -501,7 +515,7 @@ STATIC mp_obj_t int_from_bytes(size_t n_args, const mp_obj_t *args) { #if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE if (value > (MP_SMALL_INT_MAX >> 8)) { // Result will overflow a small-int so construct a big-int - return mp_obj_int_from_bytes_impl(args[2] != MP_OBJ_NEW_QSTR(MP_QSTR_little), bufinfo.len, bufinfo.buf); + return mp_obj_int_from_bytes_impl(args[ARG_byteorder].u_obj != MP_OBJ_NEW_QSTR(MP_QSTR_little), bufinfo.len, bufinfo.buf); } #endif value = (value << 8) | *buf; @@ -509,7 +523,7 @@ STATIC mp_obj_t int_from_bytes(size_t n_args, const mp_obj_t *args) { return mp_obj_new_int_from_uint(value); } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(int_from_bytes_fun_obj, 3, 4, int_from_bytes); +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(int_from_bytes_fun_obj, 3, int_from_bytes); STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(int_from_bytes_obj, MP_ROM_PTR(&int_from_bytes_fun_obj)); STATIC mp_obj_t int_to_bytes(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { diff --git a/py/objint_longlong.c b/py/objint_longlong.c index 368c74ec1d..67ec844f47 100644 --- a/py/objint_longlong.c +++ b/py/objint_longlong.c @@ -32,7 +32,7 @@ #include "py/objint.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT #include diff --git a/py/objint_mpz.c b/py/objint_mpz.c index b804ce28af..fd74803fe7 100644 --- a/py/objint_mpz.c +++ b/py/objint_mpz.c @@ -33,7 +33,7 @@ #include "py/objint.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT #include diff --git a/py/objlist.c b/py/objlist.c index 9d1949b7dc..434bca7d0a 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "py/stackctrl.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" STATIC mp_obj_t mp_obj_new_list_iterator(mp_obj_t list, size_t cur, mp_obj_iter_buf_t *iter_buf); STATIC mp_obj_list_t *list_new(size_t n); diff --git a/py/objnamedtuple.c b/py/objnamedtuple.c index c970d1afba..60a0a31847 100644 --- a/py/objnamedtuple.c +++ b/py/objnamedtuple.c @@ -33,7 +33,7 @@ #include "py/objnamedtuple.h" #include "py/objtype.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_COLLECTIONS diff --git a/py/objobject.c b/py/objobject.c index d9c75faff9..b32e5fac0d 100644 --- a/py/objobject.c +++ b/py/objobject.c @@ -29,7 +29,7 @@ #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" typedef struct _mp_obj_object_t { mp_obj_base_t base; diff --git a/py/objproperty.c b/py/objproperty.c index ebb70014a4..e8ae5094fa 100644 --- a/py/objproperty.c +++ b/py/objproperty.c @@ -95,9 +95,24 @@ const mp_obj_type_t mp_type_property = { .locals_dict = (mp_obj_dict_t *)&property_locals_dict, }; -const mp_obj_t *mp_obj_property_get(mp_obj_t self_in) { +#if MICROPY_PY_OPTIMIZE_PROPERTY_FLASH_SIZE +extern const mp_obj_property_t __property_getter_start, __property_getter_end, __property_getset_start, __property_getset_end; +#endif + +const mp_obj_t *mp_obj_property_get(mp_obj_t self_in, size_t *n_proxy) { mp_check_self(mp_obj_is_type(self_in, &mp_type_property)); mp_obj_property_t *self = MP_OBJ_TO_PTR(self_in); + #if MICROPY_PY_OPTIMIZE_PROPERTY_FLASH_SIZE + if (self >= &__property_getter_start && self < &__property_getter_end) { + *n_proxy = 1; + } else if (self >= &__property_getset_start && self < &__property_getset_end) { + *n_proxy = 2; + } else { + *n_proxy = 3; + } + #else + *n_proxy = 3; + #endif return self->proxy; } diff --git a/py/objproperty.h b/py/objproperty.h index f3ade89d92..c1b5dba460 100644 --- a/py/objproperty.h +++ b/py/objproperty.h @@ -35,6 +35,28 @@ typedef struct _mp_obj_property_t { mp_obj_t proxy[3]; // getter, setter, deleter } mp_obj_property_t; +#if MICROPY_PY_OPTIMIZE_PROPERTY_FLASH_SIZE +typedef struct _mp_obj_property_getter_t { + mp_obj_base_t base; + mp_obj_t proxy[1]; // getter +} mp_obj_property_getter_t; + +typedef struct _mp_obj_property_getset_t { + mp_obj_base_t base; + mp_obj_t proxy[2]; // getter, setter +} mp_obj_property_getset_t; + +#define MP_PROPERTY_GETTER(P, G) const mp_obj_property_getter_t P __attribute((section(".property_getter"))) = {.base.type = &mp_type_property, .proxy = {G}} +#define MP_PROPERTY_GETSET(P, G, S) const mp_obj_property_getset_t P __attribute((section(".property_getset"))) = {.base.type = &mp_type_property, .proxy = {G, S}} + +#else +typedef struct _mp_obj_property_t mp_obj_property_getter_t; +typedef struct _mp_obj_property_t mp_obj_property_getset_t; + +#define MP_PROPERTY_GETTER(P, G) const mp_obj_property_t P = {.base.type = &mp_type_property, .proxy = {G, MP_ROM_NONE, MP_ROM_NONE}} +#define MP_PROPERTY_GETSET(P, G, S) const mp_obj_property_t P = {.base.type = &mp_type_property, .proxy = {G, S, MP_ROM_NONE}} +#endif + #endif // MICROPY_PY_BUILTINS_PROPERTY #endif // MICROPY_INCLUDED_PY_OBJPROPERTY_H diff --git a/py/objrange.c b/py/objrange.c index b23ab23bd7..b0c74815dc 100644 --- a/py/objrange.c +++ b/py/objrange.c @@ -28,7 +28,7 @@ #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" /******************************************************************************/ /* range iterator */ diff --git a/py/objset.c b/py/objset.c index d7dda6ba59..237e4c2471 100644 --- a/py/objset.c +++ b/py/objset.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "py/builtin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_SET diff --git a/py/objslice.c b/py/objslice.c index 142f62fdac..3172f798c0 100644 --- a/py/objslice.c +++ b/py/objslice.c @@ -30,7 +30,7 @@ #include "py/obj.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" /******************************************************************************/ /* slice object */ diff --git a/py/objstr.c b/py/objstr.c index 3d45383bb3..df735a45cd 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "py/stackctrl.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_STR_OP_MODULO STATIC mp_obj_t str_modulo_format(mp_obj_t pattern, size_t n_args, const mp_obj_t *args, mp_obj_t dict); diff --git a/py/objstringio.c b/py/objstringio.c index 336a041baf..c6d22d6c89 100644 --- a/py/objstringio.c +++ b/py/objstringio.c @@ -33,7 +33,7 @@ #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_IO diff --git a/py/objstrunicode.c b/py/objstrunicode.c index eb79d54991..0f26da62cf 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -32,7 +32,7 @@ #include "py/objlist.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_STR_UNICODE diff --git a/py/objtuple.c b/py/objtuple.c index 90b0773bb4..87d16905df 100644 --- a/py/objtuple.c +++ b/py/objtuple.c @@ -32,7 +32,7 @@ #include "py/runtime.h" #include "py/objtype.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" /******************************************************************************/ diff --git a/py/objtype.c b/py/objtype.c index d247987ce2..071065041f 100644 --- a/py/objtype.c +++ b/py/objtype.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "supervisor/shared/stack.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) @@ -660,7 +660,8 @@ STATIC void mp_obj_instance_load_attr(mp_obj_t self_in, qstr attr, mp_obj_t *des // be called by the descriptor code down below. But that way // requires overhead for the nested mp_call's and overhead for // the code. - const mp_obj_t *proxy = mp_obj_property_get(member); + size_t n_proxy; + const mp_obj_t *proxy = mp_obj_property_get(member, &n_proxy); if (proxy[0] == mp_const_none) { mp_raise_AttributeError(MP_ERROR_TEXT("unreadable attribute")); } else { @@ -740,11 +741,12 @@ STATIC bool mp_obj_instance_store_attr(mp_obj_t self_in, qstr attr, mp_obj_t val // would be called by the descriptor code down below. But that way // requires overhead for the nested mp_call's and overhead for // the code. - const mp_obj_t *proxy = mp_obj_property_get(member[0]); + size_t n_proxy; + const mp_obj_t *proxy = mp_obj_property_get(member[0], &n_proxy); mp_obj_t dest[2] = {self_in, value}; if (value == MP_OBJ_NULL) { // delete attribute - if (proxy[2] == mp_const_none) { + if (n_proxy < 3 || proxy[2] == mp_const_none) { // TODO better error message? return false; } else { @@ -753,7 +755,7 @@ STATIC bool mp_obj_instance_store_attr(mp_obj_t self_in, qstr attr, mp_obj_t val } } else { // store attribute - if (proxy[1] == mp_const_none) { + if (n_proxy < 2 || proxy[1] == mp_const_none) { // TODO better error message? return false; } else { @@ -1374,7 +1376,8 @@ STATIC void super_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { // here... #if MICROPY_PY_BUILTINS_PROPERTY if (mp_obj_is_type(member, &mp_type_property)) { - const mp_obj_t *proxy = mp_obj_property_get(member); + size_t n_proxy; + const mp_obj_t *proxy = mp_obj_property_get(member, &n_proxy); if (proxy[0] == mp_const_none) { mp_raise_AttributeError(MP_ERROR_TEXT("unreadable attribute")); } else { diff --git a/py/parse.c b/py/parse.c index dee662b4ec..b3be279c5b 100644 --- a/py/parse.c +++ b/py/parse.c @@ -39,7 +39,7 @@ #include "py/objstr.h" #include "py/builtin.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_ENABLE_COMPILER diff --git a/py/parsenum.c b/py/parsenum.c index bd41488204..adf2a4d84d 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -32,7 +32,7 @@ #include "py/parsenum.h" #include "py/smallint.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT #include diff --git a/py/persistentcode.c b/py/persistentcode.c index e604569fe2..787f724bf6 100644 --- a/py/persistentcode.c +++ b/py/persistentcode.c @@ -36,7 +36,7 @@ #include "py/objstr.h" #include "py/mpthread.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PERSISTENT_CODE_LOAD || MICROPY_PERSISTENT_CODE_SAVE diff --git a/py/proto.c b/py/proto.c index 9f110b9f9a..d70a9d2aac 100644 --- a/py/proto.c +++ b/py/proto.c @@ -28,6 +28,8 @@ #include "py/proto.h" #include "py/runtime.h" +#include "supervisor/shared/translate/translate.h" + #ifndef MICROPY_UNSAFE_PROTO const void *mp_proto_get(uint16_t name, mp_const_obj_t obj) { const mp_obj_type_t *type = mp_obj_get_type(obj); diff --git a/py/py.mk b/py/py.mk index f1864e58b3..6827fbe786 100644 --- a/py/py.mk +++ b/py/py.mk @@ -252,19 +252,24 @@ $(HEADER_BUILD)/qstrdefs.preprocessed.h: $(PY_QSTR_DEFS) $(QSTR_DEFS) $(QSTR_DEF # qstr data $(HEADER_BUILD)/qstrdefs.enum.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/qstrdefs.preprocessed.h $(STEPECHO) "GEN $@" - $(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@ + $(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py --output_type=enums $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@ # Adding an order only dependency on $(HEADER_BUILD) causes $(HEADER_BUILD) to get # created before we run the script to generate the .h # Note: we need to protect the qstr names from the preprocessor, so we wrap # the lines in "" and then unwrap after the preprocessor is finished. -$(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h +$(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/qstrdefs.preprocessed.h $(STEPECHO) "GEN $@" - $(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py --compression_filename $(HEADER_BUILD)/compression.generated.h --translation $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@ + $(Q)$(PYTHON) $(PY_SRC)/makeqstrdata.py --output_type=data $(HEADER_BUILD)/qstrdefs.preprocessed.h > $@ + +$(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/compression.generated.h: $(PY_SRC)/maketranslationdata.py $(HEADER_BUILD)/$(TRANSLATION).mo $(HEADER_BUILD)/qstrdefs.preprocessed.h + $(STEPECHO) "GEN $@" + $(Q)$(PYTHON) $(PY_SRC)/maketranslationdata.py --compression_filename $(HEADER_BUILD)/compression.generated.h --translation $(HEADER_BUILD)/$(TRANSLATION).mo --translation_filename $(PY_BUILD)/translations-$(TRANSLATION).c $(HEADER_BUILD)/qstrdefs.preprocessed.h + +PY_CORE_O += $(PY_BUILD)/translations-$(TRANSLATION).o $(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h - # build a list of registered modules for py/objmodule.c. $(HEADER_BUILD)/moduledefs.h: $(SRC_QSTR) $(QSTR_GLOBAL_DEPENDENCIES) | $(HEADER_BUILD)/mpversion.h @$(ECHO) "GEN $@" diff --git a/py/qstr.c b/py/qstr.c index 41176ec5ab..083e12d6f0 100644 --- a/py/qstr.c +++ b/py/qstr.c @@ -35,6 +35,7 @@ #include "py/runtime.h" #include "supervisor/linker.h" +#include "supervisor/shared/translate/translate.h" // NOTE: we are using linear arrays to store and search for qstr's (unique strings, interned strings) // ultimately we will replace this with a static hash table of some kind diff --git a/py/ringbuf.c b/py/ringbuf.c index 72e164946a..fe47b50068 100644 --- a/py/ringbuf.c +++ b/py/ringbuf.c @@ -28,7 +28,6 @@ #include "ringbuf.h" bool ringbuf_init(ringbuf_t *r, uint8_t *buf, size_t capacity) { - r->heap = false; r->buf = buf; r->size = capacity; r->iget = r->iput = 0; @@ -40,7 +39,6 @@ bool ringbuf_init(ringbuf_t *r, uint8_t *buf, size_t capacity) { // size of the buffer is one greater than that, due to how the buffer // handles empty and full statuses. bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) { - r->heap = true; r->buf = gc_alloc(capacity + 1, false, long_lived); r->size = capacity + 1; r->iget = r->iput = 0; @@ -48,9 +46,8 @@ bool ringbuf_alloc(ringbuf_t *r, size_t capacity, bool long_lived) { } void ringbuf_free(ringbuf_t *r) { - if (r->heap) { - gc_free(r->buf); - } + // Free buf by letting gc take care of it. If the VM has finished already, + // this will be safe. r->buf = (uint8_t *)NULL; r->size = 0; ringbuf_clear(r); diff --git a/py/ringbuf.h b/py/ringbuf.h index 8f7e7b1760..d868eff1e4 100644 --- a/py/ringbuf.h +++ b/py/ringbuf.h @@ -37,7 +37,6 @@ typedef struct _ringbuf_t { uint32_t size; uint32_t iget; uint32_t iput; - bool heap; } ringbuf_t; // Note that the capacity of the buffer is N-1! diff --git a/py/runtime.c b/py/runtime.c index bf44234434..7fcad7366a 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -45,7 +45,7 @@ #include "py/stackctrl.h" #include "py/gc.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_DEBUG_VERBOSE // print debugging info #define DEBUG_PRINT (1) @@ -1087,7 +1087,8 @@ void mp_convert_member_lookup(mp_obj_t self, const mp_obj_type_t *type, mp_obj_t // be called by the descriptor code down below. But that way // requires overhead for the nested mp_call's and overhead for // the code. - const mp_obj_t *proxy = mp_obj_property_get(member); + size_t n_proxy; + const mp_obj_t *proxy = mp_obj_property_get(member, &n_proxy); if (proxy[0] == mp_const_none) { mp_raise_AttributeError(MP_ERROR_TEXT("unreadable attribute")); } else { @@ -1226,15 +1227,16 @@ void mp_store_attr(mp_obj_t base, qstr attr, mp_obj_t value) { // would be called by the descriptor code down below. But that way // requires overhead for the nested mp_call's and overhead for // the code. - const mp_obj_t *proxy = mp_obj_property_get(elem->value); + size_t n_proxy; + const mp_obj_t *proxy = mp_obj_property_get(elem->value, &n_proxy); mp_obj_t dest[2] = {base, value}; if (value == MP_OBJ_NULL) { // delete attribute - if (proxy[2] != mp_const_none) { + if (n_proxy == 3 && proxy[2] != mp_const_none) { mp_call_function_n_kw(proxy[2], 1, 0, dest); return; } - } else if (proxy[1] != mp_const_none) { + } else if (n_proxy > 1 && proxy[1] != mp_const_none) { mp_call_function_n_kw(proxy[1], 2, 0, dest); return; } diff --git a/py/runtime.h b/py/runtime.h index 4a309f3975..a78969780b 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -33,6 +33,8 @@ #include "supervisor/linker.h" +#include "supervisor/shared/translate/translate.h" + typedef enum { MP_VM_RETURN_NORMAL, MP_VM_RETURN_YIELD, @@ -92,15 +94,22 @@ void mp_arg_parse_all_kw_array(size_t n_pos, size_t n_kw, const mp_obj_t *args, NORETURN void mp_arg_error_terse_mismatch(void); NORETURN void mp_arg_error_unimpl_kw(void); +NORETURN void mp_arg_error_invalid(qstr arg_name); +mp_int_t mp_arg_validate_int(mp_int_t i, mp_int_t required_i, qstr arg_name); mp_int_t mp_arg_validate_int_min(mp_int_t i, mp_int_t min, qstr arg_name); mp_int_t mp_arg_validate_int_max(mp_int_t i, mp_int_t j, qstr arg_name); mp_int_t mp_arg_validate_int_range(mp_int_t i, mp_int_t min, mp_int_t max, qstr arg_name); #if MICROPY_PY_BUILTINS_FLOAT mp_float_t mp_arg_validate_obj_float_non_negative(mp_obj_t float_in, mp_float_t default_for_null, qstr arg_name); #endif +mp_uint_t mp_arg_validate_length_min(mp_uint_t length, mp_uint_t min, qstr arg_name); +mp_uint_t mp_arg_validate_length_max(mp_uint_t length, mp_uint_t max, qstr arg_name); mp_uint_t mp_arg_validate_length_range(mp_uint_t length, mp_uint_t min, mp_uint_t max, qstr arg_name); +mp_uint_t mp_arg_validate_length(mp_uint_t length, mp_uint_t required_length, qstr arg_name); +mp_int_t mp_arg_validate_index_range(mp_int_t index, mp_int_t min, mp_int_t max, qstr arg_name); mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_name); -mp_obj_t mp_arg_validate_string(mp_obj_t obj, qstr arg_name); +mp_int_t mp_arg_validate_type_int(mp_obj_t obj, qstr arg_name); +mp_obj_t mp_arg_validate_type_string(mp_obj_t obj, qstr arg_name); static inline mp_obj_dict_t *PLACE_IN_ITCM(mp_locals_get)(void) { return MP_STATE_THREAD(dict_locals); diff --git a/py/sequence.c b/py/sequence.c index ee400ccd8d..7befc85763 100644 --- a/py/sequence.c +++ b/py/sequence.c @@ -28,7 +28,7 @@ #include #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Helpers for sequence types diff --git a/py/stream.c b/py/stream.c index b12d693c62..e7e77341bd 100644 --- a/py/stream.c +++ b/py/stream.c @@ -31,7 +31,8 @@ #include "py/objstr.h" #include "py/stream.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "py/unicode.h" +#include "supervisor/shared/translate/translate.h" // This file defines generic Python stream read/write methods which // dispatch to the underlying stream interface of an object. @@ -43,6 +44,13 @@ STATIC mp_obj_t stream_readall(mp_obj_t self_in); #define STREAM_CONTENT_TYPE(stream) (((stream)->is_text) ? &mp_type_str : &mp_type_bytes) +static mp_obj_t mp_obj_new_str_from_vstr_check(const mp_obj_type_t *type, vstr_t *vstr) { + if (type == &mp_type_str && !utf8_check((void *)vstr->buf, vstr->len)) { + mp_raise_msg(&mp_type_UnicodeError, NULL); + } + return mp_obj_new_str_from_vstr(type, vstr); +} + // Returns error condition in *errcode, if non-zero, return value is number of bytes written // before error condition occurred. If *errcode == 0, returns total bytes written (which will // be equal to input size). @@ -201,8 +209,7 @@ STATIC mp_obj_t stream_read_generic(size_t n_args, const mp_obj_t *args, byte fl } } } - - return mp_obj_new_str_from_vstr(&mp_type_str, &vstr); + return mp_obj_new_str_from_vstr_check(&mp_type_str, &vstr); } #endif @@ -223,7 +230,7 @@ STATIC mp_obj_t stream_read_generic(size_t n_args, const mp_obj_t *args, byte fl mp_raise_OSError(error); } else { vstr.len = out_sz; - return mp_obj_new_str_from_vstr(STREAM_CONTENT_TYPE(stream_p), &vstr); + return mp_obj_new_str_from_vstr_check(STREAM_CONTENT_TYPE(stream_p), &vstr); } } @@ -364,7 +371,7 @@ STATIC mp_obj_t stream_readall(mp_obj_t self_in) { } vstr.len = total_size; - return mp_obj_new_str_from_vstr(STREAM_CONTENT_TYPE(stream_p), &vstr); + return mp_obj_new_str_from_vstr_check(STREAM_CONTENT_TYPE(stream_p), &vstr); } // Unbuffered, inefficient implementation of readline() for raw I/O files. @@ -417,7 +424,7 @@ STATIC mp_obj_t stream_unbuffered_readline(size_t n_args, const mp_obj_t *args) } } - return mp_obj_new_str_from_vstr(STREAM_CONTENT_TYPE(stream_p), &vstr); + return mp_obj_new_str_from_vstr_check(STREAM_CONTENT_TYPE(stream_p), &vstr); } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_unbuffered_readline_obj, 1, 2, stream_unbuffered_readline); diff --git a/py/vm.c b/py/vm.c index 63eb7f46d9..12a0f2d445 100644 --- a/py/vm.c +++ b/py/vm.c @@ -37,6 +37,7 @@ #include "py/profile.h" #include "supervisor/linker.h" +#include "supervisor/shared/translate/translate.h" // *FORMAT-OFF* @@ -739,8 +740,8 @@ unwind_jump:; obj = mp_getiter(obj, iter_buf); if (obj != MP_OBJ_FROM_PTR(iter_buf)) { // Iterator didn't use the stack so indicate that with MP_OBJ_NULL. - sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] = MP_OBJ_NULL; - sp[-MP_OBJ_ITER_BUF_NSLOTS + 2] = obj; + *(sp - MP_OBJ_ITER_BUF_NSLOTS + 1) = MP_OBJ_NULL; + *(sp - MP_OBJ_ITER_BUF_NSLOTS + 2) = obj; } DISPATCH(); } @@ -751,8 +752,8 @@ unwind_jump:; DECODE_ULABEL; // the jump offset if iteration finishes; for labels are always forward code_state->sp = sp; mp_obj_t obj; - if (sp[-MP_OBJ_ITER_BUF_NSLOTS + 1] == MP_OBJ_NULL) { - obj = sp[-MP_OBJ_ITER_BUF_NSLOTS + 2]; + if (*(sp - MP_OBJ_ITER_BUF_NSLOTS + 1) == MP_OBJ_NULL) { + obj = *(sp - MP_OBJ_ITER_BUF_NSLOTS + 2); } else { obj = MP_OBJ_FROM_PTR(&sp[-MP_OBJ_ITER_BUF_NSLOTS + 1]); } diff --git a/requirements-dev.txt b/requirements-dev.txt index 9c574567f7..f65c13fa69 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,13 +1,12 @@ -# For string compression -huffman - # For nvm.toml cascadetoml jinja2 -typer +# Undo this pin when click and typer are again compatible. +typer==0.4.0 sh -click +# Undo this pin when click and typer are again compatible. +click==8.0.4 cpp-coveralls requests requests-cache @@ -18,6 +17,7 @@ polib # For pre-commit pyyaml black +pre-commit # for combining the Nordic SoftDevice with CircuitPython intelhex @@ -27,3 +27,7 @@ pyelftools # for stubs and annotations adafruit-circuitpython-typing + +# for web workflow minify +minify_html +jsmin diff --git a/requirements-doc.txt b/requirements-doc.txt index 2eaf513d3d..40ab2ad4ac 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -5,7 +5,7 @@ isort twine wheel astroid -setuptools +setuptools>=45 setuptools_scm # For sphinx diff --git a/runtime.py b/runtime.py new file mode 100644 index 0000000000..28bf98962e --- /dev/null +++ b/runtime.py @@ -0,0 +1,10 @@ +import pathlib +paths = pathlib.Path(".").glob("**/*.c") +translate_h = "#include \"supervisor/shared/translate/translate.h\"" +for p in paths: + if "esp-idf" in p: + continue + lines = p.read_text().split("\n") + if "#include \"py/runtime.h\"" in lines and translate_h in lines: + lines.remove(translate_h) + p.write_text("\n".join(lines)) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index baff277b69..53bd6be3c2 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -128,12 +128,9 @@ static mp_obj_t bleio_adapter_set_enabled(mp_obj_t self, mp_obj_t value) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_adapter_set_enabled_obj, bleio_adapter_set_enabled); -const mp_obj_property_t bleio_adapter_enabled_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_adapter_get_enabled_obj, - (mp_obj_t)&bleio_adapter_set_enabled_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(bleio_adapter_enabled_obj, + (mp_obj_t)&bleio_adapter_get_enabled_obj, + (mp_obj_t)&bleio_adapter_set_enabled_obj); //| address: Address //| """MAC address of the BLE adapter.""" @@ -152,22 +149,19 @@ STATIC mp_obj_t bleio_adapter_set_address(mp_obj_t self, mp_obj_t new_address) { } MP_DEFINE_CONST_FUN_OBJ_2(bleio_adapter_set_address_obj, bleio_adapter_set_address); -const mp_obj_property_t bleio_adapter_address_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_adapter_get_address_obj, - (mp_obj_t)&bleio_adapter_set_address_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(bleio_adapter_address_obj, + (mp_obj_t)&bleio_adapter_get_address_obj, + (mp_obj_t)&bleio_adapter_set_address_obj); //| name: str //| """name of the BLE adapter used once connected. //| The name is "CIRCUITPY" + the last four hex digits of ``adapter.address``, //| to make it easy to distinguish multiple CircuitPython boards.""" //| -STATIC mp_obj_t bleio_adapter_get_name(mp_obj_t self) { +STATIC mp_obj_t _bleio_adapter_get_name(mp_obj_t self) { return MP_OBJ_FROM_PTR(common_hal_bleio_adapter_get_name(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_name_obj, bleio_adapter_get_name); +MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_name_obj, _bleio_adapter_get_name); STATIC mp_obj_t bleio_adapter_set_name(mp_obj_t self, mp_obj_t new_name) { @@ -176,12 +170,9 @@ STATIC mp_obj_t bleio_adapter_set_name(mp_obj_t self, mp_obj_t new_name) { } MP_DEFINE_CONST_FUN_OBJ_2(bleio_adapter_set_name_obj, bleio_adapter_set_name); -const mp_obj_property_t bleio_adapter_name_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_adapter_get_name_obj, - (mp_obj_t)&bleio_adapter_set_name_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(bleio_adapter_name_obj, + (mp_obj_t)&bleio_adapter_get_name_obj, + (mp_obj_t)&bleio_adapter_set_name_obj); //| def start_advertising(self, data: ReadableBuffer, *, //| scan_response: Optional[ReadableBuffer] = None, connectable: bool = True, @@ -380,12 +371,8 @@ STATIC mp_obj_t bleio_adapter_get_advertising(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_advertising_obj, bleio_adapter_get_advertising); -const mp_obj_property_t bleio_adapter_advertising_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_adapter_get_advertising_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_adapter_advertising_obj, + (mp_obj_t)&bleio_adapter_get_advertising_obj); //| connected: bool //| """True when the adapter is connected to another device regardless of who initiated the @@ -397,12 +384,8 @@ STATIC mp_obj_t bleio_adapter_get_connected(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_connected_obj, bleio_adapter_get_connected); -const mp_obj_property_t bleio_adapter_connected_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_adapter_get_connected_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_adapter_connected_obj, + (mp_obj_t)&bleio_adapter_get_connected_obj); //| connections: Tuple[Connection] //| """Tuple of active connections including those initiated through @@ -413,12 +396,8 @@ STATIC mp_obj_t bleio_adapter_get_connections(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_get_connections_obj, bleio_adapter_get_connections); -const mp_obj_property_t bleio_adapter_connections_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_adapter_get_connections_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_adapter_connections_obj, + (mp_obj_t)&bleio_adapter_get_connections_obj); //| def connect(self, address: Address, *, timeout: float) -> Connection: //| """Attempts a connection to the device with the given address. diff --git a/shared-bindings/_bleio/Adapter.h b/shared-bindings/_bleio/Adapter.h index 1dce615a40..49bb4421e7 100644 --- a/shared-bindings/_bleio/Adapter.h +++ b/shared-bindings/_bleio/Adapter.h @@ -50,6 +50,9 @@ extern bool common_hal_bleio_adapter_get_connected(bleio_adapter_obj_t *self); extern bleio_address_obj_t *common_hal_bleio_adapter_get_address(bleio_adapter_obj_t *self); extern bool common_hal_bleio_adapter_set_address(bleio_adapter_obj_t *self, bleio_address_obj_t *address); +// Copies the adapter name into the given buffer up to len and returns the full length (may be more +// than len if the buffer was too short.) +uint16_t bleio_adapter_get_name(char *buf, uint16_t len); extern mp_obj_str_t *common_hal_bleio_adapter_get_name(bleio_adapter_obj_t *self); extern void common_hal_bleio_adapter_set_name(bleio_adapter_obj_t *self, const char *name); diff --git a/shared-bindings/_bleio/Address.c b/shared-bindings/_bleio/Address.c index 97322bbb79..26aeec3036 100644 --- a/shared-bindings/_bleio/Address.c +++ b/shared-bindings/_bleio/Address.c @@ -69,7 +69,7 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args, const mp_int_t address_type = args[ARG_address_type].u_int; if (address_type < BLEIO_ADDRESS_TYPE_MIN || address_type > BLEIO_ADDRESS_TYPE_MAX) { - mp_raise_ValueError(translate("Address type out of range")); + mp_arg_error_invalid(MP_QSTR_address_type); } common_hal_bleio_address_construct(self, buf_info.buf, address_type); @@ -101,12 +101,8 @@ STATIC mp_obj_t bleio_address_get_address_bytes(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bleio_address_get_address_bytes_obj, bleio_address_get_address_bytes); -const mp_obj_property_t bleio_address_address_bytes_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&bleio_address_get_address_bytes_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(bleio_address_address_bytes_obj, + (mp_obj_t)&bleio_address_get_address_bytes_obj); //| type: int //| """The address type (read-only). @@ -121,12 +117,8 @@ STATIC mp_obj_t bleio_address_get_type(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bleio_address_get_type_obj, bleio_address_get_type); -const mp_obj_property_t bleio_address_type_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&bleio_address_get_type_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(bleio_address_type_obj, + (mp_obj_t)&bleio_address_get_type_obj); //| def __eq__(self, other: object) -> bool: //| """Two Address objects are equal if their addresses and address types are equal.""" diff --git a/shared-bindings/_bleio/Characteristic.c b/shared-bindings/_bleio/Characteristic.c index f4c77405d1..6f72d96056 100644 --- a/shared-bindings/_bleio/Characteristic.c +++ b/shared-bindings/_bleio/Characteristic.c @@ -100,7 +100,7 @@ STATIC mp_obj_t bleio_characteristic_add_to_service(size_t n_args, const mp_obj_ const bleio_characteristic_properties_t properties = args[ARG_properties].u_int; if (properties & ~CHAR_PROP_ALL) { - mp_raise_ValueError(translate("Invalid properties")); + mp_arg_error_invalid(MP_QSTR_properties); } const bleio_attribute_security_mode_t read_perm = args[ARG_read_perm].u_int; @@ -109,10 +109,8 @@ STATIC mp_obj_t bleio_characteristic_add_to_service(size_t n_args, const mp_obj_ const bleio_attribute_security_mode_t write_perm = args[ARG_write_perm].u_int; common_hal_bleio_attribute_security_mode_check_valid(write_perm); - const mp_int_t max_length_int = args[ARG_max_length].u_int; - if (max_length_int < 0) { - mp_raise_ValueError(translate("max_length must be >= 0")); - } + const mp_int_t max_length_int = mp_arg_validate_int_min(args[ARG_max_length].u_int, 0, MP_QSTR_max_length); + const size_t max_length = (size_t)max_length_int; const bool fixed_length = args[ARG_fixed_length].u_bool; mp_obj_t initial_value = args[ARG_initial_value].u_obj; @@ -167,12 +165,8 @@ STATIC mp_obj_t bleio_characteristic_get_properties(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_properties_obj, bleio_characteristic_get_properties); -const mp_obj_property_t bleio_characteristic_properties_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_characteristic_get_properties_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_characteristic_properties_obj, + (mp_obj_t)&bleio_characteristic_get_properties_obj); //| uuid: Optional[UUID] //| """The UUID of this characteristic. (read-only) @@ -187,12 +181,8 @@ STATIC mp_obj_t bleio_characteristic_get_uuid(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_uuid_obj, bleio_characteristic_get_uuid); -const mp_obj_property_t bleio_characteristic_uuid_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_characteristic_get_uuid_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_characteristic_uuid_obj, + (mp_obj_t)&bleio_characteristic_get_uuid_obj); //| value: bytearray //| """The value of this characteristic.""" @@ -218,12 +208,9 @@ STATIC mp_obj_t bleio_characteristic_set_value(mp_obj_t self_in, mp_obj_t value_ } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_characteristic_set_value_obj, bleio_characteristic_set_value); -const mp_obj_property_t bleio_characteristic_value_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_characteristic_get_value_obj, - (mp_obj_t)&bleio_characteristic_set_value_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(bleio_characteristic_value_obj, + (mp_obj_t)&bleio_characteristic_get_value_obj, + (mp_obj_t)&bleio_characteristic_set_value_obj); //| max_length: int //| """The max length of this characteristic.""" @@ -235,12 +222,8 @@ STATIC mp_obj_t bleio_characteristic_get_max_length(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_max_length_obj, bleio_characteristic_get_max_length); -const mp_obj_property_t bleio_characteristic_max_length_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_characteristic_get_max_length_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_characteristic_max_length_obj, + (mp_obj_t)&bleio_characteristic_get_max_length_obj); //| descriptors: Descriptor //| """A tuple of :py:class:`Descriptor` objects related to this characteristic. (read-only)""" @@ -253,12 +236,8 @@ STATIC mp_obj_t bleio_characteristic_get_descriptors(mp_obj_t self_in) { STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_descriptors_obj, bleio_characteristic_get_descriptors); -const mp_obj_property_t bleio_characteristic_descriptors_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_characteristic_get_descriptors_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_characteristic_descriptors_obj, + (mp_obj_t)&bleio_characteristic_get_descriptors_obj); //| service: Service //| """The Service this Characteristic is a part of.""" @@ -270,12 +249,8 @@ STATIC mp_obj_t bleio_characteristic_get_service(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_get_service_obj, bleio_characteristic_get_service); -const mp_obj_property_t bleio_characteristic_service_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_characteristic_get_service_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_characteristic_service_obj, + (mp_obj_t)&bleio_characteristic_get_service_obj); //| def set_cccd(self, *, notify: bool = False, indicate: bool = False) -> None: //| """Set the remote characteristic's CCCD to enable or disable notification and indication. diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c index 81562028e7..aea77fb633 100644 --- a/shared-bindings/_bleio/CharacteristicBuffer.c +++ b/shared-bindings/_bleio/CharacteristicBuffer.c @@ -70,15 +70,9 @@ STATIC mp_obj_t bleio_characteristic_buffer_make_new(const mp_obj_type_t *type, bleio_characteristic_obj_t *characteristic = mp_arg_validate_type(args[ARG_characteristic].u_obj, &bleio_characteristic_type, MP_QSTR_characteristic); - mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); - if (timeout < 0.0f) { - mp_raise_ValueError(translate("timeout must be >= 0.0")); - } + mp_float_t timeout = mp_arg_validate_obj_float_non_negative(args[ARG_timeout].u_obj, 1.0f, MP_QSTR_timeout); - const int buffer_size = args[ARG_buffer_size].u_int; - if (buffer_size < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_buffer_size); - } + const mp_int_t buffer_size = mp_arg_validate_int_min(args[ARG_buffer_size].u_int, 1, MP_QSTR_buffer_size); bleio_characteristic_buffer_obj_t *self = m_new_obj(bleio_characteristic_buffer_obj_t); self->base.type = &bleio_characteristic_buffer_type; @@ -173,12 +167,8 @@ STATIC mp_obj_t bleio_characteristic_buffer_obj_get_in_waiting(mp_obj_t self_in) } MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_buffer_get_in_waiting_obj, bleio_characteristic_buffer_obj_get_in_waiting); -const mp_obj_property_t bleio_characteristic_buffer_in_waiting_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&bleio_characteristic_buffer_get_in_waiting_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(bleio_characteristic_buffer_in_waiting_obj, + (mp_obj_t)&bleio_characteristic_buffer_get_in_waiting_obj); //| def reset_input_buffer(self) -> None: //| """Discard any unread characters in the input buffer.""" diff --git a/shared-bindings/_bleio/Connection.c b/shared-bindings/_bleio/Connection.c index a7c50a0d07..7a85ccddc2 100644 --- a/shared-bindings/_bleio/Connection.c +++ b/shared-bindings/_bleio/Connection.c @@ -161,12 +161,8 @@ STATIC mp_obj_t bleio_connection_get_connected(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_connected_obj, bleio_connection_get_connected); -const mp_obj_property_t bleio_connection_connected_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_connection_get_connected_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_connection_connected_obj, + (mp_obj_t)&bleio_connection_get_connected_obj); //| paired: bool @@ -179,12 +175,8 @@ STATIC mp_obj_t bleio_connection_get_paired(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_paired_obj, bleio_connection_get_paired); -const mp_obj_property_t bleio_connection_paired_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_connection_get_paired_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_connection_paired_obj, + (mp_obj_t)&bleio_connection_get_paired_obj); //| connection_interval: float @@ -235,19 +227,12 @@ STATIC mp_obj_t bleio_connection_set_connection_interval(mp_obj_t self_in, mp_ob } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_connection_set_connection_interval_obj, bleio_connection_set_connection_interval); -const mp_obj_property_t bleio_connection_connection_interval_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_connection_get_connection_interval_obj, - (mp_obj_t)&bleio_connection_set_connection_interval_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(bleio_connection_connection_interval_obj, + (mp_obj_t)&bleio_connection_get_connection_interval_obj, + (mp_obj_t)&bleio_connection_set_connection_interval_obj); -const mp_obj_property_t bleio_connection_max_packet_length_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_connection_get_max_packet_length_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_connection_max_packet_length_obj, + (mp_obj_t)&bleio_connection_get_max_packet_length_obj); STATIC const mp_rom_map_elem_t bleio_connection_locals_dict_table[] = { // Methods diff --git a/shared-bindings/_bleio/Descriptor.c b/shared-bindings/_bleio/Descriptor.c index d4dd9372f3..0e662655c4 100644 --- a/shared-bindings/_bleio/Descriptor.c +++ b/shared-bindings/_bleio/Descriptor.c @@ -94,10 +94,8 @@ STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_o const bleio_attribute_security_mode_t write_perm = args[ARG_write_perm].u_int; common_hal_bleio_attribute_security_mode_check_valid(write_perm); - const mp_int_t max_length_int = args[ARG_max_length].u_int; - if (max_length_int < 0) { - mp_raise_ValueError(translate("max_length must be >= 0")); - } + const mp_int_t max_length_int = mp_arg_validate_int_min(args[ARG_max_length].u_int, 0, MP_QSTR_max_length); + const size_t max_length = (size_t)max_length_int; const bool fixed_length = args[ARG_fixed_length].u_bool; mp_obj_t initial_value = args[ARG_initial_value].u_obj; @@ -144,12 +142,8 @@ STATIC mp_obj_t bleio_descriptor_get_uuid(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(bleio_descriptor_get_uuid_obj, bleio_descriptor_get_uuid); -const mp_obj_property_t bleio_descriptor_uuid_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&bleio_descriptor_get_uuid_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(bleio_descriptor_uuid_obj, + (mp_obj_t)&bleio_descriptor_get_uuid_obj); //| characteristic: Characteristic //| """The Characteristic this Descriptor is a part of.""" @@ -161,12 +155,8 @@ STATIC mp_obj_t bleio_descriptor_get_characteristic(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_descriptor_get_characteristic_obj, bleio_descriptor_get_characteristic); -const mp_obj_property_t bleio_descriptor_characteristic_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_descriptor_get_characteristic_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_descriptor_characteristic_obj, + (mp_obj_t)&bleio_descriptor_get_characteristic_obj); //| value: bytearray //| """The value of this descriptor.""" @@ -192,12 +182,9 @@ STATIC mp_obj_t bleio_descriptor_set_value(mp_obj_t self_in, mp_obj_t value_in) } STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_descriptor_set_value_obj, bleio_descriptor_set_value); -const mp_obj_property_t bleio_descriptor_value_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_descriptor_get_value_obj, - (mp_obj_t)&bleio_descriptor_set_value_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(bleio_descriptor_value_obj, + (mp_obj_t)&bleio_descriptor_get_value_obj, + (mp_obj_t)&bleio_descriptor_set_value_obj); STATIC const mp_rom_map_elem_t bleio_descriptor_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_add_to_characteristic), MP_ROM_PTR(&bleio_descriptor_add_to_characteristic_obj) }, diff --git a/shared-bindings/_bleio/PacketBuffer.c b/shared-bindings/_bleio/PacketBuffer.c index aa6c860a60..30eb8dd8c7 100644 --- a/shared-bindings/_bleio/PacketBuffer.c +++ b/shared-bindings/_bleio/PacketBuffer.c @@ -73,10 +73,7 @@ STATIC mp_obj_t bleio_packet_buffer_make_new(const mp_obj_type_t *type, size_t n bleio_characteristic_obj_t *characteristic = mp_arg_validate_type(args[ARG_characteristic].u_obj, &bleio_characteristic_type, MP_QSTR_characteristic); - const mp_int_t buffer_size = args[ARG_buffer_size].u_int; - if (buffer_size < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_buffer_size); - } + const mp_int_t buffer_size = mp_arg_validate_int_min(args[ARG_buffer_size].u_int, 1, MP_QSTR_buffer_size); size_t max_packet_size = common_hal_bleio_characteristic_get_max_length(characteristic); if (args[ARG_max_packet_size].u_obj != mp_const_none) { @@ -197,12 +194,8 @@ STATIC mp_obj_t bleio_packet_buffer_get_incoming_packet_length(mp_obj_t self_in) } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_incoming_packet_length_obj, bleio_packet_buffer_get_incoming_packet_length); -const mp_obj_property_t bleio_packet_buffer_incoming_packet_length_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_packet_buffer_get_incoming_packet_length_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_packet_buffer_incoming_packet_length_obj, + (mp_obj_t)&bleio_packet_buffer_get_incoming_packet_length_obj); //| outgoing_packet_length: int //| """Maximum length in bytes of a packet we are writing.""" @@ -218,12 +211,8 @@ STATIC mp_obj_t bleio_packet_buffer_get_outgoing_packet_length(mp_obj_t self_in) } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_get_outgoing_packet_length_obj, bleio_packet_buffer_get_outgoing_packet_length); -const mp_obj_property_t bleio_packet_buffer_outgoing_packet_length_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_packet_buffer_get_outgoing_packet_length_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_packet_buffer_outgoing_packet_length_obj, + (mp_obj_t)&bleio_packet_buffer_get_outgoing_packet_length_obj); STATIC const mp_rom_map_elem_t bleio_packet_buffer_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&bleio_packet_buffer_deinit_obj) }, diff --git a/shared-bindings/_bleio/ScanEntry.c b/shared-bindings/_bleio/ScanEntry.c index 5a0f6eb1be..a5009088a5 100644 --- a/shared-bindings/_bleio/ScanEntry.c +++ b/shared-bindings/_bleio/ScanEntry.c @@ -48,25 +48,22 @@ //| def matches(self, prefixes: ScanEntry, *, match_all: bool = True) -> bool: //| """Returns True if the ScanEntry matches all prefixes when ``match_all`` is True. This is stricter //| than the scan filtering which accepts any advertisements that match any of the prefixes -//| where ``match_all`` is False. -//| -//| ``all`` also works for ``match_all`` but will be removed in CircuitPython 8.""" +//| where ``match_all`` is False.""" //| ... //| STATIC mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { bleio_scanentry_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - enum { ARG_prefixes, ARG_all, ARG_match_all }; + enum { ARG_prefixes, ARG_match_all }; static const mp_arg_t allowed_args[] = { { MP_QSTR_prefixes, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_all, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_match_all, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - bool match_all = args[ARG_all].u_bool && args[ARG_match_all].u_bool; + bool match_all = args[ARG_match_all].u_bool; mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[ARG_prefixes].u_obj, &bufinfo, MP_BUFFER_READ); @@ -83,12 +80,8 @@ STATIC mp_obj_t bleio_scanentry_get_address(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_scanentry_get_address_obj, bleio_scanentry_get_address); -const mp_obj_property_t bleio_scanentry_address_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_scanentry_get_address_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_scanentry_address_obj, + (mp_obj_t)&bleio_scanentry_get_address_obj); //| advertisement_bytes: bytes //| """All the advertisement data present in the packet, returned as a ``bytes`` object. (read-only)""" @@ -99,12 +92,8 @@ STATIC mp_obj_t scanentry_get_advertisement_bytes(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_scanentry_get_advertisement_bytes_obj, scanentry_get_advertisement_bytes); -const mp_obj_property_t bleio_scanentry_advertisement_bytes_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_scanentry_get_advertisement_bytes_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_scanentry_advertisement_bytes_obj, + (mp_obj_t)&bleio_scanentry_get_advertisement_bytes_obj); //| rssi: int //| """The signal strength of the device at the time of the scan, in integer dBm. (read-only)""" @@ -115,12 +104,8 @@ STATIC mp_obj_t scanentry_get_rssi(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_scanentry_get_rssi_obj, scanentry_get_rssi); -const mp_obj_property_t bleio_scanentry_rssi_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_scanentry_get_rssi_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_scanentry_rssi_obj, + (mp_obj_t)&bleio_scanentry_get_rssi_obj); //| connectable: bool //| """True if the device can be connected to. (read-only)""" @@ -131,12 +116,8 @@ STATIC mp_obj_t scanentry_get_connectable(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_scanentry_get_connectable_obj, scanentry_get_connectable); -const mp_obj_property_t bleio_scanentry_connectable_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_scanentry_get_connectable_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_scanentry_connectable_obj, + (mp_obj_t)&bleio_scanentry_get_connectable_obj); //| scan_response: bool //| """True if the entry was a scan response. (read-only)""" @@ -147,12 +128,8 @@ STATIC mp_obj_t scanentry_get_scan_response(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_scanentry_get_scan_response_obj, scanentry_get_scan_response); -const mp_obj_property_t bleio_scanentry_scan_response_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_scanentry_get_scan_response_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_scanentry_scan_response_obj, + (mp_obj_t)&bleio_scanentry_get_scan_response_obj); STATIC const mp_rom_map_elem_t bleio_scanentry_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&bleio_scanentry_address_obj) }, diff --git a/shared-bindings/_bleio/Service.c b/shared-bindings/_bleio/Service.c index ff1d8c9e21..ddbdecdf79 100644 --- a/shared-bindings/_bleio/Service.c +++ b/shared-bindings/_bleio/Service.c @@ -80,12 +80,8 @@ STATIC mp_obj_t bleio_service_get_characteristics(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_service_get_characteristics_obj, bleio_service_get_characteristics); -const mp_obj_property_t bleio_service_characteristics_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_service_get_characteristics_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_service_characteristics_obj, + (mp_obj_t)&bleio_service_get_characteristics_obj); //| remote: bool //| """True if this is a service provided by a remote device. (read-only)""" @@ -97,12 +93,8 @@ STATIC mp_obj_t bleio_service_get_remote(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_service_get_remote_obj, bleio_service_get_remote); -const mp_obj_property_t bleio_service_remote_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_service_get_remote_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_service_remote_obj, + (mp_obj_t)&bleio_service_get_remote_obj); //| secondary: bool //| """True if this is a secondary service. (read-only)""" @@ -114,12 +106,8 @@ STATIC mp_obj_t bleio_service_get_secondary(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_service_get_secondary_obj, bleio_service_get_secondary); -const mp_obj_property_t bleio_service_secondary_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_service_get_secondary_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_service_secondary_obj, + (mp_obj_t)&bleio_service_get_secondary_obj); //| uuid: Optional[UUID] //| """The UUID of this service. (read-only) @@ -134,12 +122,8 @@ STATIC mp_obj_t bleio_service_get_uuid(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_service_get_uuid_obj, bleio_service_get_uuid); -const mp_obj_property_t bleio_service_uuid_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&bleio_service_get_uuid_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(bleio_service_uuid_obj, + (mp_obj_t)&bleio_service_get_uuid_obj); STATIC const mp_rom_map_elem_t bleio_service_locals_dict_table[] = { diff --git a/shared-bindings/_bleio/UUID.c b/shared-bindings/_bleio/UUID.c index 4e3154eb03..599a89a581 100644 --- a/shared-bindings/_bleio/UUID.c +++ b/shared-bindings/_bleio/UUID.c @@ -132,12 +132,8 @@ STATIC mp_obj_t bleio_uuid_get_uuid16(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(bleio_uuid_get_uuid16_obj, bleio_uuid_get_uuid16); -const mp_obj_property_t bleio_uuid_uuid16_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&bleio_uuid_get_uuid16_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(bleio_uuid_uuid16_obj, + (mp_obj_t)&bleio_uuid_get_uuid16_obj); //| uuid128: bytes //| """The 128-bit value of the UUID @@ -158,12 +154,8 @@ STATIC mp_obj_t bleio_uuid_get_uuid128(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(bleio_uuid_get_uuid128_obj, bleio_uuid_get_uuid128); -const mp_obj_property_t bleio_uuid_uuid128_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&bleio_uuid_get_uuid128_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(bleio_uuid_uuid128_obj, + (mp_obj_t)&bleio_uuid_get_uuid128_obj); //| size: int //| """128 if this UUID represents a 128-bit vendor-specific UUID. 16 if this UUID represents a @@ -178,12 +170,8 @@ STATIC mp_obj_t bleio_uuid_get_size(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(bleio_uuid_get_size_obj, bleio_uuid_get_size); -const mp_obj_property_t bleio_uuid_size_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&bleio_uuid_get_size_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(bleio_uuid_size_obj, + (mp_obj_t)&bleio_uuid_get_size_obj); //| def pack_into(self, buffer: WriteableBuffer, offset: int = 0) -> None: diff --git a/shared-bindings/_bleio/__init__.h b/shared-bindings/_bleio/__init__.h index 55b527cfa5..f34df306b7 100644 --- a/shared-bindings/_bleio/__init__.h +++ b/shared-bindings/_bleio/__init__.h @@ -54,6 +54,11 @@ extern const mp_obj_type_t mp_type_bleio_BluetoothError; extern const mp_obj_type_t mp_type_bleio_RoleError; extern const mp_obj_type_t mp_type_bleio_SecurityError; +// Resets all user created BLE state in preparation for the heap disappearing. +// It will maintain BLE workflow and connections. +void bleio_user_reset(void); + +// Completely resets the BLE stack including BLE connections. void bleio_reset(void); extern mp_obj_t bleio_set_adapter(mp_obj_t adapter_obj); diff --git a/shared-bindings/_pew/PewPew.c b/shared-bindings/_pew/PewPew.c index 4015d31161..1a4356c719 100644 --- a/shared-bindings/_pew/PewPew.c +++ b/shared-bindings/_pew/PewPew.c @@ -32,7 +32,7 @@ #include "shared-bindings/util.h" #include "PewPew.h" #include "common-hal/_pew/PewPew.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PewPew: //| """This is an internal module to be used by the ``pew.py`` library from diff --git a/shared-bindings/_stage/Layer.c b/shared-bindings/_stage/Layer.c index c3c0aa1801..9e64a252db 100644 --- a/shared-bindings/_stage/Layer.c +++ b/shared-bindings/_stage/Layer.c @@ -28,7 +28,7 @@ #include "__init__.h" #include "Layer.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Layer: //| """Keep information about a single layer of graphics""" diff --git a/shared-bindings/_stage/Text.c b/shared-bindings/_stage/Text.c index d6b22171d6..48747bfd67 100644 --- a/shared-bindings/_stage/Text.c +++ b/shared-bindings/_stage/Text.c @@ -28,7 +28,7 @@ #include "__init__.h" #include "Text.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Text: //| """Keep information about a single grid of text""" diff --git a/shared-bindings/adafruit_bus_device/i2c_device/I2CDevice.c b/shared-bindings/adafruit_bus_device/i2c_device/I2CDevice.c index 327e8e72b4..3ae5fc2a2f 100644 --- a/shared-bindings/adafruit_bus_device/i2c_device/I2CDevice.c +++ b/shared-bindings/adafruit_bus_device/i2c_device/I2CDevice.c @@ -36,7 +36,7 @@ #include "shared/runtime/context_manager_helpers.h" #include "py/runtime.h" #include "py/smallint.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class I2CDevice: diff --git a/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c b/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c index 2c5708b831..2f34a60e86 100644 --- a/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c +++ b/shared-bindings/adafruit_bus_device/spi_device/SPIDevice.c @@ -35,13 +35,13 @@ #include "shared/runtime/buffer_helper.h" #include "shared/runtime/context_manager_helpers.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class SPIDevice: //| """SPI Device Manager""" //| -//| def __init__(self, spi: busio.SPI, chip_select: microcontroller.Pin, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, extra_clocks : int = 0) -> None: +//| def __init__(self, spi: busio.SPI, chip_select: digitalio.DigitalInOut, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, extra_clocks : int = 0) -> None: //| //| """ //| Represents a single SPI device and manages locking the bus and the device address. @@ -89,6 +89,8 @@ STATIC mp_obj_t adafruit_bus_device_spidevice_make_new(const mp_obj_type_t *type busio_spi_obj_t *spi = args[ARG_spi].u_obj; + mp_arg_validate_type(args[ARG_chip_select].u_obj, &digitalio_digitalinout_type, MP_QSTR_chip_select); + common_hal_adafruit_bus_device_spidevice_construct(MP_OBJ_TO_PTR(self), spi, args[ARG_chip_select].u_obj, args[ARG_cs_active_value].u_bool, args[ARG_baudrate].u_int, args[ARG_polarity].u_int, args[ARG_phase].u_int, args[ARG_extra_clocks].u_int); diff --git a/shared-bindings/adafruit_pixelbuf/PixelBuf.c b/shared-bindings/adafruit_pixelbuf/PixelBuf.c index 7be059fa6b..8f1ea4eac2 100644 --- a/shared-bindings/adafruit_pixelbuf/PixelBuf.c +++ b/shared-bindings/adafruit_pixelbuf/PixelBuf.c @@ -44,6 +44,10 @@ #include "extmod/ulab/code/ndarray.h" #endif +static NORETURN void invalid_byteorder(void) { + mp_arg_error_invalid(MP_QSTR_byteorder); +} + static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t *parsed); //| class PixelBuf: @@ -124,7 +128,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t size_t bo_len; const char *byteorder = mp_obj_str_get_data(byteorder_obj, &bo_len); if (bo_len < 3 || bo_len > 4) { - mp_raise_ValueError(translate("Invalid byteorder string")); + invalid_byteorder(); } parsed->order_string = byteorder_obj; @@ -136,7 +140,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t char *w = strchr(byteorder, 'W'); int num_chars = (dotstar ? 1 : 0) + (w ? 1 : 0) + (r ? 1 : 0) + (g ? 1 : 0) + (b ? 1 : 0); if ((num_chars < parsed->bpp) || !(r && b && g)) { - mp_raise_ValueError(translate("Invalid byteorder string")); + invalid_byteorder(); } parsed->is_dotstar = dotstar ? true : false; parsed->has_white = w ? true : false; @@ -146,10 +150,10 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t parsed->byteorder.w = w ? w - byteorder : 0; // The dotstar brightness byte is always first (as it goes with the pixel start bits) if (dotstar && byteorder[0] != 'P') { - mp_raise_ValueError(translate("Invalid byteorder string")); + invalid_byteorder(); } if (parsed->has_white && parsed->is_dotstar) { - mp_raise_ValueError(translate("Invalid byteorder string")); + invalid_byteorder(); } } @@ -161,12 +165,8 @@ STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_bpp(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_pixelbuf_get_bpp_obj, pixelbuf_pixelbuf_obj_get_bpp); -const mp_obj_property_t pixelbuf_pixelbuf_bpp_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&pixelbuf_pixelbuf_get_bpp_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(pixelbuf_pixelbuf_bpp_obj, + (mp_obj_t)&pixelbuf_pixelbuf_get_bpp_obj); //| brightness: float @@ -193,12 +193,9 @@ STATIC mp_obj_t pixelbuf_pixelbuf_obj_set_brightness(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(pixelbuf_pixelbuf_set_brightness_obj, pixelbuf_pixelbuf_obj_set_brightness); -const mp_obj_property_t pixelbuf_pixelbuf_brightness_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&pixelbuf_pixelbuf_get_brightness_obj, - (mp_obj_t)&pixelbuf_pixelbuf_set_brightness_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(pixelbuf_pixelbuf_brightness_obj, + (mp_obj_t)&pixelbuf_pixelbuf_get_brightness_obj, + (mp_obj_t)&pixelbuf_pixelbuf_set_brightness_obj); //| auto_write: bool //| """Whether to automatically write the pixels after each update.""" @@ -215,12 +212,9 @@ STATIC mp_obj_t pixelbuf_pixelbuf_obj_set_auto_write(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(pixelbuf_pixelbuf_set_auto_write_obj, pixelbuf_pixelbuf_obj_set_auto_write); -const mp_obj_property_t pixelbuf_pixelbuf_auto_write_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&pixelbuf_pixelbuf_get_auto_write_obj, - (mp_obj_t)&pixelbuf_pixelbuf_set_auto_write_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(pixelbuf_pixelbuf_auto_write_obj, + (mp_obj_t)&pixelbuf_pixelbuf_get_auto_write_obj, + (mp_obj_t)&pixelbuf_pixelbuf_set_auto_write_obj); //| byteorder: str //| """byteorder string for the buffer (read-only)""" @@ -230,12 +224,8 @@ STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_byteorder(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_pixelbuf_get_byteorder_str, pixelbuf_pixelbuf_obj_get_byteorder); -const mp_obj_property_t pixelbuf_pixelbuf_byteorder_str = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&pixelbuf_pixelbuf_get_byteorder_str, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(pixelbuf_pixelbuf_byteorder_str, + (mp_obj_t)&pixelbuf_pixelbuf_get_byteorder_str); STATIC mp_obj_t pixelbuf_pixelbuf_unary_op(mp_unary_op_t op, mp_obj_t self_in) { switch (op) { diff --git a/shared-bindings/aesio/__init__.c b/shared-bindings/aesio/__init__.c index 716d20393e..f3e1d7dd17 100644 --- a/shared-bindings/aesio/__init__.c +++ b/shared-bindings/aesio/__init__.c @@ -34,7 +34,11 @@ //| """AES encryption routines //| //| The `AES` module contains classes used to implement encryption -//| and decryption. It aims to be low overhead in terms of memory.""" +//| and decryption. It aims to be low overhead in terms of memory. +//| +//| For more information on AES, refer to `the Wikipedia entry +//| `_. +//| """ STATIC const mp_obj_tuple_t mp_aes_key_size_obj = { diff --git a/shared-bindings/aesio/aes.c b/shared-bindings/aesio/aes.c index 4acadc5ab6..27d52d8566 100644 --- a/shared-bindings/aesio/aes.c +++ b/shared-bindings/aesio/aes.c @@ -63,15 +63,12 @@ STATIC mp_obj_t aesio_aes_make_new(const mp_obj_type_t *type, size_t n_args, const uint8_t *key = NULL; uint32_t key_length = 0; - if (mp_get_buffer(args[ARG_key].u_obj, &bufinfo, MP_BUFFER_READ)) { - if ((bufinfo.len != 16) && (bufinfo.len != 24) && (bufinfo.len != 32)) { - mp_raise_TypeError(translate("Key must be 16, 24, or 32 bytes long")); - } - key = bufinfo.buf; - key_length = bufinfo.len; - } else { - mp_raise_TypeError(translate("No key was specified")); + mp_get_buffer_raise(args[ARG_key].u_obj, &bufinfo, MP_BUFFER_READ); + if ((bufinfo.len != 16) && (bufinfo.len != 24) && (bufinfo.len != 32)) { + mp_raise_TypeError(translate("Key must be 16, 24, or 32 bytes long")); } + key = bufinfo.buf; + key_length = bufinfo.len; int mode = args[ARG_mode].u_int; switch (args[ARG_mode].u_int) { @@ -246,11 +243,9 @@ STATIC mp_obj_t aesio_aes_set_mode(mp_obj_t aesio_obj, mp_obj_t mode_obj) { } MP_DEFINE_CONST_FUN_OBJ_2(aesio_aes_set_mode_obj, aesio_aes_set_mode); -const mp_obj_property_t aesio_aes_mode_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&aesio_aes_get_mode_obj, - (mp_obj_t)&aesio_aes_set_mode_obj, MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(aesio_aes_mode_obj, + (mp_obj_t)&aesio_aes_get_mode_obj, + (mp_obj_t)&aesio_aes_set_mode_obj); STATIC const mp_rom_map_elem_t aesio_locals_dict_table[] = { // Methods diff --git a/shared-bindings/alarm/SleepMemory.c b/shared-bindings/alarm/SleepMemory.c index 7de36f0cec..b4e68c964c 100644 --- a/shared-bindings/alarm/SleepMemory.c +++ b/shared-bindings/alarm/SleepMemory.c @@ -31,7 +31,7 @@ #include "py/runtime0.h" #include "shared-bindings/alarm/SleepMemory.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class SleepMemory: //| """Store raw bytes in RAM that persists during deep sleep. @@ -159,9 +159,8 @@ STATIC mp_obj_t alarm_sleep_memory_subscr(mp_obj_t self_in, mp_obj_t index_in, m } else { // store mp_int_t byte_value = mp_obj_get_int(value); - if (byte_value > 0xff || byte_value < 0) { - mp_raise_ValueError(translate("Bytes must be between 0 and 255.")); - } + mp_arg_validate_int_range(byte_value, 0, 255, MP_QSTR_bytes); + uint8_t short_value = byte_value; if (!common_hal_alarm_sleep_memory_set_bytes(self, index, &short_value, 1)) { mp_raise_RuntimeError(translate("Unable to write to sleep_memory.")); diff --git a/shared-bindings/alarm/__init__.c b/shared-bindings/alarm/__init__.c index 2d532664b9..3b81dd479f 100644 --- a/shared-bindings/alarm/__init__.c +++ b/shared-bindings/alarm/__init__.c @@ -32,6 +32,7 @@ #include "shared-bindings/alarm/pin/PinAlarm.h" #include "shared-bindings/alarm/time/TimeAlarm.h" #include "shared-bindings/alarm/touch/TouchAlarm.h" +#include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/supervisor/Runtime.h" #include "shared-bindings/time/__init__.h" #include "supervisor/shared/workflow.h" @@ -55,6 +56,9 @@ //| //| For both light sleep and deep sleep, if CircuitPython is connected to a host computer, //| maintaining the connection takes priority and power consumption may not be reduced. +//| +//| For more information about working with alarms and light/deep sleep in CircuitPython, +//| see `this Learn guide `_. //| """ //| sleep_memory: SleepMemory @@ -77,7 +81,7 @@ STATIC void validate_objs_are_alarms(size_t n_args, const mp_obj_t *objs) { mp_obj_is_type(objs[i], &alarm_touch_touchalarm_type)) { continue; } - mp_raise_TypeError_varg(translate("Expected an alarm")); + mp_raise_TypeError_varg(translate("Expected an %q"), MP_QSTR_Alarm); } } @@ -109,7 +113,7 @@ STATIC mp_obj_t alarm_light_sleep_until_alarms(size_t n_args, const mp_obj_t *ar } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(alarm_light_sleep_until_alarms_obj, 1, MP_OBJ_FUN_ARGS_MAX, alarm_light_sleep_until_alarms); -//| def exit_and_deep_sleep_until_alarms(*alarms: circuitpython_typing.Alarm) -> None: +//| def exit_and_deep_sleep_until_alarms(*alarms: circuitpython_typing.Alarm, preserve_dios: Sequence[digitalio.DigitalInOut] = ()) -> None: //| """Exit the program and go into a deep sleep, until awakened by one of the alarms. //| This function does not return. //| @@ -123,6 +127,22 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(alarm_light_sleep_until_alarms_obj, 1, MP_OB //| //| If no alarms are specified, the microcontroller will deep sleep until reset. //| +//| :param circuitpython_typing.Alarm alarms: the alarms that can wake the microcontroller. +//| :param Sequence[digitalio.DigitalInOut] preserve_dios: A sequence of `DigitalInOut` objects +//| whose state should be preserved during deep sleep. +//| If a `DigitalInOut` in the sequence is set to be an output, +//| its current `DigitalInOut.value` (``True`` or ``False``) +//| will be preserved during the deep sleep. +//| If a `DigitalInOut` in the sequence is set to be an input, +//| its current `DigitalInOut.pull` value (``DOWN``, ``UP``, or ``None``) +//| will be preserved during deep sleep. +//| +//| Preserving `DigitalInOut` states during deep sleep can be used to ensure that +//| external or on-board devices are powered or unpowered during sleep, among other purposes. +//| +//| On some microcontrollers, some pins cannot remain in their original state for hardware reasons. +//| +//| //| **If CircuitPython is connected to a host computer via USB or BLE //| the first time a deep sleep is requested, //| the connection will be maintained and the system will not go into deep sleep.** @@ -133,28 +153,50 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(alarm_light_sleep_until_alarms_obj, 1, MP_OB //| the next deep sleep will still be a true deep sleep. You must do a hard reset //| or power-cycle to exit a true deep sleep loop. //| -//| Here is skeletal example that deep-sleeps and restarts every 60 seconds: +//| Here is a skeletal example: //| //| .. code-block:: python //| //| import alarm //| import time +//| import board //| //| print("Waking up") //| -//| # Set an alarm for 60 seconds from now. +//| # Create an alarm for 60 seconds from now, and also a pin alarm. //| time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 60) +//| pin_alarm = alarm.pin.PinAlarm(board.D7, False) //| -//| # Deep sleep until the alarm goes off. Then restart the program. -//| alarm.exit_and_deep_sleep_until_alarms(time_alarm) +//| # Deep sleep until one of the alarm goes off. Then restart the program. +//| alarm.exit_and_deep_sleep_until_alarms(time_alarm, pin_alarm) //| """ //| ... //| -STATIC mp_obj_t alarm_exit_and_deep_sleep_until_alarms(size_t n_args, const mp_obj_t *args) { - validate_objs_are_alarms(n_args, args); +STATIC mp_obj_t alarm_exit_and_deep_sleep_until_alarms(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_preserve_dios }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_preserve_dios, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_empty_tuple} }, + }; - // Validate the alarms and set them. - common_hal_alarm_set_deep_sleep_alarms(n_args, args); + // args will contain only the value for preserve_dios. The *alarms args are in pos_args. + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(0, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + validate_objs_are_alarms(n_args, pos_args); + + mp_obj_t preserve_dios = args[ARG_preserve_dios].u_obj; + const size_t num_dios = (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(preserve_dios)); + digitalio_digitalinout_obj_t *dios_array[num_dios]; + + for (mp_uint_t i = 0; i < num_dios; i++) { + mp_obj_t dio = mp_obj_subscr(preserve_dios, MP_OBJ_NEW_SMALL_INT(i), MP_OBJ_SENTINEL); + if (!mp_obj_is_type(dio, &digitalio_digitalinout_type)) { + mp_raise_TypeError_varg(translate("Expected a %q"), MP_QSTR_DigitalInOut); + } + dios_array[i] = MP_OBJ_TO_PTR(dio); + } + + common_hal_alarm_set_deep_sleep_alarms(n_args, pos_args, num_dios, dios_array); // Raise an exception, which will be processed in main.c. mp_raise_type_arg(&mp_type_DeepSleepRequest, NULL); @@ -162,7 +204,7 @@ STATIC mp_obj_t alarm_exit_and_deep_sleep_until_alarms(size_t n_args, const mp_o // Doesn't get here. return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(alarm_exit_and_deep_sleep_until_alarms_obj, 1, MP_OBJ_FUN_ARGS_MAX, alarm_exit_and_deep_sleep_until_alarms); +MP_DEFINE_CONST_FUN_OBJ_KW(alarm_exit_and_deep_sleep_until_alarms_obj, 0, alarm_exit_and_deep_sleep_until_alarms); STATIC const mp_map_elem_t alarm_pin_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_pin) }, diff --git a/shared-bindings/alarm/__init__.h b/shared-bindings/alarm/__init__.h index eb67917dce..ea86e44f2f 100644 --- a/shared-bindings/alarm/__init__.h +++ b/shared-bindings/alarm/__init__.h @@ -30,6 +30,7 @@ #include "py/obj.h" #include "common-hal/alarm/__init__.h" +#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 @@ -42,7 +43,7 @@ extern mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const // supervisor will idle using `port_wait_for_interrupt`. After each call, it will // call alarm_woken_from_sleep to see if we've been woken by an alarm and if so, // it will exit idle as if deep sleep was exited -extern void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms); +extern void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms, size_t n_dios, digitalio_digitalinout_obj_t **preserve_dios); extern NORETURN void common_hal_alarm_enter_deep_sleep(void); diff --git a/shared-bindings/alarm/pin/PinAlarm.c b/shared-bindings/alarm/pin/PinAlarm.c index 50bdfa00de..06ad77c56d 100644 --- a/shared-bindings/alarm/pin/PinAlarm.c +++ b/shared-bindings/alarm/pin/PinAlarm.c @@ -33,7 +33,7 @@ #include "py/obj.h" #include "py/objproperty.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PinAlarm: //| """Trigger an alarm when a pin changes state.""" @@ -97,12 +97,8 @@ STATIC mp_obj_t alarm_pin_pinalarm_obj_get_pin(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(alarm_pin_pinalarm_get_pin_obj, alarm_pin_pinalarm_obj_get_pin); -const mp_obj_property_t alarm_pin_pinalarm_pin_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&alarm_pin_pinalarm_get_pin_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(alarm_pin_pinalarm_pin_obj, + (mp_obj_t)&alarm_pin_pinalarm_get_pin_obj); //| value: bool //| """The value on which to trigger.""" @@ -113,12 +109,8 @@ STATIC mp_obj_t alarm_pin_pinalarm_obj_get_value(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(alarm_pin_pinalarm_get_value_obj, alarm_pin_pinalarm_obj_get_value); -const mp_obj_property_t alarm_pin_pinalarm_value_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&alarm_pin_pinalarm_get_value_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(alarm_pin_pinalarm_value_obj, + (mp_obj_t)&alarm_pin_pinalarm_get_value_obj); STATIC const mp_rom_map_elem_t alarm_pin_pinalarm_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_pin), MP_ROM_PTR(&alarm_pin_pinalarm_pin_obj) }, diff --git a/shared-bindings/alarm/time/TimeAlarm.c b/shared-bindings/alarm/time/TimeAlarm.c index bd7502e891..0b77913c9b 100644 --- a/shared-bindings/alarm/time/TimeAlarm.c +++ b/shared-bindings/alarm/time/TimeAlarm.c @@ -33,7 +33,7 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/time/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_LONGINT_IMPL != MICROPY_LONGINT_IMPL_NONE mp_obj_t MP_WEAK rtc_get_time_source_time(void) { @@ -123,12 +123,8 @@ STATIC mp_obj_t alarm_time_timealarm_obj_get_monotonic_time(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(alarm_time_timealarm_get_monotonic_time_obj, alarm_time_timealarm_obj_get_monotonic_time); -const mp_obj_property_t alarm_time_timealarm_monotonic_time_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&alarm_time_timealarm_get_monotonic_time_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(alarm_time_timealarm_monotonic_time_obj, + (mp_obj_t)&alarm_time_timealarm_get_monotonic_time_obj); STATIC const mp_rom_map_elem_t alarm_time_timealarm_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_monotonic_time), MP_ROM_PTR(&alarm_time_timealarm_monotonic_time_obj) }, diff --git a/shared-bindings/alarm/touch/TouchAlarm.c b/shared-bindings/alarm/touch/TouchAlarm.c index 60b3f97c18..ce5074f7c0 100644 --- a/shared-bindings/alarm/touch/TouchAlarm.c +++ b/shared-bindings/alarm/touch/TouchAlarm.c @@ -71,12 +71,8 @@ STATIC mp_obj_t alarm_touch_touchalarm_obj_get_pin(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(alarm_touch_touchalarm_get_pin_obj, alarm_touch_touchalarm_obj_get_pin); -const mp_obj_property_t alarm_touch_touchalarm_pin_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&alarm_touch_touchalarm_get_pin_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(alarm_touch_touchalarm_pin_obj, + (mp_obj_t)&alarm_touch_touchalarm_get_pin_obj); STATIC const mp_rom_map_elem_t alarm_touch_touchalarm_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_pin), MP_ROM_PTR(&alarm_touch_touchalarm_pin_obj) }, diff --git a/shared-bindings/analogbufio/BufferedIn.c b/shared-bindings/analogbufio/BufferedIn.c new file mode 100644 index 0000000000..12a8d90e61 --- /dev/null +++ b/shared-bindings/analogbufio/BufferedIn.c @@ -0,0 +1,185 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 Lee Atkinson, MeanStride Technology, Inc. + * + * TODO: Based on analogio/AnalogIn.c from Scott Shaw + * + * 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 "shared/runtime/context_manager_helpers.h" +#include "py/binary.h" +#include "py/mphal.h" +#include "py/nlr.h" +#include "py/objproperty.h" +#include "py/runtime.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/analogbufio/BufferedIn.h" +#include "shared-bindings/util.h" + +//| class BufferedIn: +//| """Capture multiple analog voltage levels to the supplied buffer +//| +//| Usage:: +//| +//| import board +//| import analogbufio +//| import array +//| +//| length = 1000 +//| mybuffer = array.array("H", 0x0000 for i in range(length)) +//| rate = 500000 +//| adcbuf = analogbufio.BufferedIn(board.GP26, mybuffer, rate) +//| adcbuf.read() +//| adcbuf.deinit() +//| for i in range(length): +//| print(i, mybuffer[i]) +//| +//| (TODO) The reference voltage varies by platform so use +//| ``reference_voltage`` to read the configured setting. +//| (TODO) Provide mechanism to read CPU Temperature.""" +//| + +//| def __init__(self, pin: microcontroller.Pin, buffer: WriteableBuffer, *, sample_rate: int = 500000) -> None: +//| """Create a `BufferedIn` on the given pin. ADC values will be read +//| into the given buffer at the supplied sample_rate. Depending on the +//| buffer typecode, 'b', 'B', 'h', 'H', samples are 8-bit byte-arrays or +//| 16-bit half-words and are signed or unsigned. +//| The ADC most significant bits of the ADC are kept. (See +//| https://docs.circuitpython.org/en/latest/docs/library/array.html) +//| +//| :param ~microcontroller.Pin pin: the pin to read from +//| :param ~circuitpython_typing.WriteableBuffer buffer: buffer: A buffer for samples +//| :param ~int sample_rate: rate: sampling frequency, in samples per second""" +//| ... +//| +STATIC mp_obj_t analogbufio_bufferedin_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { + enum { ARG_pin, ARG_buffer, ARG_sample_rate }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_pin, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_buffer, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_sample_rate, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 500000} }, + }; + 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); + + // Validate Pin + const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); + + // Buffer defined and allocated by user + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[ARG_buffer].u_obj, &bufinfo, MP_BUFFER_READ); + + // signed or unsigned, byte per sample + bool signed_samples = bufinfo.typecode == 'b' || bufinfo.typecode == 'h'; + uint8_t bytes_per_sample = 1; + + // Bytes Per Sample + if (bufinfo.typecode == 'h' || bufinfo.typecode == 'H') { + bytes_per_sample = 2; + } else if (bufinfo.typecode != 'b' && bufinfo.typecode != 'B' && bufinfo.typecode != BYTEARRAY_TYPECODE) { + mp_raise_ValueError_varg(translate("%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'"), MP_QSTR_buffer); + } + + // Validate sample rate here + uint32_t sample_rate = (uint32_t)mp_arg_validate_int_range(args[ARG_sample_rate].u_int, 1, 500000, MP_QSTR_sample_rate); + + // Create local object + analogbufio_bufferedin_obj_t *self = m_new_obj(analogbufio_bufferedin_obj_t); + self->base.type = &analogbufio_bufferedin_type; + + // Call local intereface in ports/common-hal/analogbufio + common_hal_analogbufio_bufferedin_construct(self, + pin, + ((uint8_t *)bufinfo.buf), + bufinfo.len, + bytes_per_sample, + signed_samples, + sample_rate + ); + + return MP_OBJ_FROM_PTR(self); +} + +//| def deinit(self) -> None: +//| """Shut down the `BufferedIn` and release the pin for other use.""" +//| ... +//| +STATIC mp_obj_t analogbufio_bufferedin_deinit(mp_obj_t self_in) { + analogbufio_bufferedin_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_analogbufio_bufferedin_deinit(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(analogbufio_bufferedin_deinit_obj, analogbufio_bufferedin_deinit); + +STATIC void check_for_deinit(analogbufio_bufferedin_obj_t *self) { + if (common_hal_analogbufio_bufferedin_deinited(self)) { + raise_deinited_error(); + } +} +//| def __enter__(self) -> BufferedIn: +//| """No-op used by Context Managers.""" +//| ... +//| +// Provided by context manager helper. + +//| def __exit__(self) -> None: +//| """Automatically deinitializes the hardware when exiting a context. See +//| :ref:`lifetime-and-contextmanagers` for more info.""" +//| ... +//| +STATIC mp_obj_t analogbufio_bufferedin___exit__(size_t n_args, const mp_obj_t *args) { + (void)n_args; + common_hal_analogbufio_bufferedin_deinit(args[0]); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(analogbufio_bufferedin___exit___obj, 4, 4, analogbufio_bufferedin___exit__); + +//| def read(self) -> None: +//| """Fills the provided buffer with ADC voltage values.""" +//| ... +//| +STATIC mp_obj_t analogbufio_bufferedin_obj_read(mp_obj_t self_in) { + analogbufio_bufferedin_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + common_hal_analogbufio_bufferedin_read(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(analogbufio_bufferedin_read_obj, analogbufio_bufferedin_obj_read); + +STATIC const mp_rom_map_elem_t analogbufio_bufferedin_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&analogbufio_bufferedin_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&analogbufio_bufferedin___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&analogbufio_bufferedin_read_obj)}, + +}; + +STATIC MP_DEFINE_CONST_DICT(analogbufio_bufferedin_locals_dict, analogbufio_bufferedin_locals_dict_table); + +const mp_obj_type_t analogbufio_bufferedin_type = { + { &mp_type_type }, + .name = MP_QSTR_BufferedIn, + .make_new = analogbufio_bufferedin_make_new, + .locals_dict = (mp_obj_t)&analogbufio_bufferedin_locals_dict, +}; diff --git a/shared-bindings/analogbufio/BufferedIn.h b/shared-bindings/analogbufio/BufferedIn.h new file mode 100644 index 0000000000..7d59720cb4 --- /dev/null +++ b/shared-bindings/analogbufio/BufferedIn.h @@ -0,0 +1,40 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 Lee Atkinson, MeanStride Technology, 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_ANALOGBUFIO_BUFFEREDIN_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_ANALOGBUFIO_BUFFEREDIN_H + +#include "common-hal/microcontroller/Pin.h" +#include "common-hal/analogbufio/BufferedIn.h" + +extern const mp_obj_type_t analogbufio_bufferedin_type; + +void common_hal_analogbufio_bufferedin_construct(analogbufio_bufferedin_obj_t *self, const mcu_pin_obj_t *pin, uint8_t *buffer, uint32_t len, uint8_t bytes_per_sample, bool samples_signed, uint32_t sample_rate); +void common_hal_analogbufio_bufferedin_deinit(analogbufio_bufferedin_obj_t *self); +bool common_hal_analogbufio_bufferedin_deinited(analogbufio_bufferedin_obj_t *self); +void common_hal_analogbufio_bufferedin_read(analogbufio_bufferedin_obj_t *self); + +#endif // __MICROPY_INCLUDED_SHARED_BINDINGS_ANALOGBUFIO_BUFFEREDIN_H__ diff --git a/shared-bindings/analogbufio/__init__.c b/shared-bindings/analogbufio/__init__.c new file mode 100644 index 0000000000..b47fe4b897 --- /dev/null +++ b/shared-bindings/analogbufio/__init__.c @@ -0,0 +1,79 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 Lee Atkinson, MeanStride Technology, 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 +#include "py/obj.h" +#include "py/runtime.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/analogbufio/__init__.h" +#include "shared-bindings/analogbufio/BufferedIn.h" + +//| """Analog Buffered IO Hardware Support +//| +//| The `analogbufio` module contains classes to provide access to analog-to-digital +//| conversion and digital-to-analog (DAC) for multiple value transfer. +//| +//| All classes change hardware state and should be deinitialized when they +//| are no longer needed if the program continues after use. To do so, either +//| call :py:meth:`!deinit` or use a context manager. See +//| :ref:`lifetime-and-contextmanagers` for more info. +//| +//| For example:: +//| +//| import analogbufio +//| import array +//| from board import * +//| +//| length = 5000000 +//| mybuffer = array.array("H", 0x0000 for i in range(length)) +//| adc_in = analogbufio.BufferedIn(GP26, mybuffer, length) +//| analogbufio.read() +//| print(*mybuffer) +//| adc_in.deinit() +//| +//| This example will initialize the the device, read and fill +//| :py:data:`~analogbufio.BufferedIn` to mybuffer +//| +//| TODO: For the essentials of `analogbufio`, see the `CircuitPython Essentials +//| Learn guide `_ +//| +//| TODO: For more information on using `analogbufio`, see `this additional Learn guide +//| `_ +//| """ +//| + +STATIC const mp_rom_map_elem_t analogbufio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_analogbufio) }, + { MP_ROM_QSTR(MP_QSTR_BufferedIn), MP_ROM_PTR(&analogbufio_bufferedin_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(analogbufio_module_globals, analogbufio_module_globals_table); + +const mp_obj_module_t analogbufio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&analogbufio_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_analogbufio, analogbufio_module, CIRCUITPY_ANALOGBUFIO); diff --git a/ports/espressif/supervisor/esp_port.h b/shared-bindings/analogbufio/__init__.h similarity index 78% rename from ports/espressif/supervisor/esp_port.h rename to shared-bindings/analogbufio/__init__.h index 90ba3f65f1..d66dd4e8d6 100644 --- a/ports/espressif/supervisor/esp_port.h +++ b/shared-bindings/analogbufio/__init__.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2019 Lucian Copeland for Adafruit Industries + * SPDX-FileCopyrightText: Copyright (c) 2022 Lee Atkinson, MeanStride Technology, 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 @@ -24,12 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESPRESSIF_SUPERVISOR_PORT_H -#define MICROPY_INCLUDED_ESPRESSIF_SUPERVISOR_PORT_H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_ANALOGBUFIO___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_ANALOGBUFIO___INIT___H -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" +#include "py/obj.h" -extern TaskHandle_t circuitpython_task; +// Nothing now. -#endif // MICROPY_INCLUDED_ESPRESSIF_SUPERVISOR_PORT_H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_ANALOGBUFIO___INIT___H diff --git a/shared-bindings/analogio/AnalogIn.c b/shared-bindings/analogio/AnalogIn.c index 636c2500bf..f2c888f727 100644 --- a/shared-bindings/analogio/AnalogIn.c +++ b/shared-bindings/analogio/AnalogIn.c @@ -117,12 +117,8 @@ STATIC mp_obj_t analogio_analogin_obj_get_value(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogin_get_value_obj, analogio_analogin_obj_get_value); -const mp_obj_property_t analogio_analogin_value_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&analogio_analogin_get_value_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(analogio_analogin_value_obj, + (mp_obj_t)&analogio_analogin_get_value_obj); //| reference_voltage: float //| """The maximum voltage measurable (also known as the reference voltage) as a @@ -143,12 +139,8 @@ STATIC mp_obj_t analogio_analogin_obj_get_reference_voltage(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(analogio_analogin_get_reference_voltage_obj, analogio_analogin_obj_get_reference_voltage); -const mp_obj_property_t analogio_analogin_reference_voltage_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&analogio_analogin_get_reference_voltage_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(analogio_analogin_reference_voltage_obj, + (mp_obj_t)&analogio_analogin_get_reference_voltage_obj); STATIC const mp_rom_map_elem_t analogio_analogin_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&analogio_analogin_deinit_obj) }, diff --git a/shared-bindings/analogio/AnalogOut.c b/shared-bindings/analogio/AnalogOut.c index aad298ba07..41c9b053eb 100644 --- a/shared-bindings/analogio/AnalogOut.c +++ b/shared-bindings/analogio/AnalogOut.c @@ -34,7 +34,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/analogio/AnalogOut.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class AnalogOut: //| """Output analog values (a specific voltage). @@ -108,21 +108,16 @@ STATIC mp_obj_t analogio_analogout_obj_set_value(mp_obj_t self_in, mp_obj_t valu if (common_hal_analogio_analogout_deinited(self)) { raise_deinited_error(); } - uint32_t v = mp_obj_get_int(value); - if (v >= (1 << 16)) { - mp_raise_ValueError(translate("AnalogOut is only 16 bits. Value must be less than 65536.")); - } + uint16_t v = mp_arg_validate_int_range(mp_obj_get_int(value), 0, 65535, MP_QSTR_value); + common_hal_analogio_analogout_set_value(self, v); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(analogio_analogout_set_value_obj, analogio_analogout_obj_set_value); -const mp_obj_property_t analogio_analogout_value_obj = { - .base.type = &mp_type_property, - .proxy = {MP_ROM_NONE, - (mp_obj_t)&analogio_analogout_set_value_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(analogio_analogout_value_obj, + MP_ROM_NONE, + (mp_obj_t)&analogio_analogout_set_value_obj); STATIC const mp_rom_map_elem_t analogio_analogout_locals_dict_table[] = { // instance methods diff --git a/shared-bindings/analogio/__init__.c b/shared-bindings/analogio/__init__.c index 51f8a21537..eb956d0eb7 100644 --- a/shared-bindings/analogio/__init__.c +++ b/shared-bindings/analogio/__init__.c @@ -57,7 +57,14 @@ //| This example will initialize the the device, read //| :py:data:`~analogio.AnalogIn.value` and then //| :py:meth:`~analogio.AnalogIn.deinit` the hardware. The last step is optional -//| because CircuitPython will do it automatically after the program finishes.""" +//| because CircuitPython will do it automatically after the program finishes. +//| +//| For the essentials of `analogio`, see the `CircuitPython Essentials +//| Learn guide `_ +//| +//| For more information on using `analogio`, see `this additional Learn guide +//| `_ +//| """ //| STATIC const mp_rom_map_elem_t analogio_module_globals_table[] = { diff --git a/shared-bindings/atexit/__init__.c b/shared-bindings/atexit/__init__.c index e6d1372ccf..dd27adaa98 100644 --- a/shared-bindings/atexit/__init__.c +++ b/shared-bindings/atexit/__init__.c @@ -34,6 +34,7 @@ //| These functions are run in the reverse order in which they were registered; //| if you register ``A``, ``B``, and ``C``, they will be run in the order ``C``, ``B``, ``A``. //| +//| |see_cpython_module| :mod:`cpython:atexit`. //| """ //| ... //| diff --git a/shared-bindings/audiobusio/I2SOut.c b/shared-bindings/audiobusio/I2SOut.c index 6254f7cde2..7c660abc4a 100644 --- a/shared-bindings/audiobusio/I2SOut.c +++ b/shared-bindings/audiobusio/I2SOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/audiobusio/I2SOut.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class I2SOut: //| """Output an I2S audio signal""" @@ -203,12 +203,8 @@ STATIC mp_obj_t audiobusio_i2sout_obj_get_playing(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_get_playing_obj, audiobusio_i2sout_obj_get_playing); -const mp_obj_property_t audiobusio_i2sout_playing_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiobusio_i2sout_get_playing_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiobusio_i2sout_playing_obj, + (mp_obj_t)&audiobusio_i2sout_get_playing_obj); //| def pause(self) -> None: //| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" @@ -252,12 +248,8 @@ STATIC mp_obj_t audiobusio_i2sout_obj_get_paused(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_i2sout_get_paused_obj, audiobusio_i2sout_obj_get_paused); -const mp_obj_property_t audiobusio_i2sout_paused_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiobusio_i2sout_get_paused_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiobusio_i2sout_paused_obj, + (mp_obj_t)&audiobusio_i2sout_get_paused_obj); #endif // CIRCUITPY_AUDIOBUSIO_I2SOUT STATIC const mp_rom_map_elem_t audiobusio_i2sout_locals_dict_table[] = { diff --git a/shared-bindings/audiobusio/PDMIn.c b/shared-bindings/audiobusio/PDMIn.c index 201b6abcec..29752a442c 100644 --- a/shared-bindings/audiobusio/PDMIn.c +++ b/shared-bindings/audiobusio/PDMIn.c @@ -34,7 +34,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/audiobusio/PDMIn.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PDMIn: //| """Record an input PDM audio stream""" @@ -226,12 +226,8 @@ STATIC mp_obj_t audiobusio_pdmin_obj_get_sample_rate(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiobusio_pdmin_get_sample_rate_obj, audiobusio_pdmin_obj_get_sample_rate); -const mp_obj_property_t audiobusio_pdmin_sample_rate_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiobusio_pdmin_get_sample_rate_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiobusio_pdmin_sample_rate_obj, + (mp_obj_t)&audiobusio_pdmin_get_sample_rate_obj); STATIC const mp_rom_map_elem_t audiobusio_pdmin_locals_dict_table[] = { // Methods diff --git a/shared-bindings/audiocore/RawSample.c b/shared-bindings/audiocore/RawSample.c index 05c5b14b5e..85ad752bab 100644 --- a/shared-bindings/audiocore/RawSample.c +++ b/shared-bindings/audiocore/RawSample.c @@ -32,7 +32,7 @@ #include "py/runtime.h" #include "shared-bindings/util.h" #include "shared-bindings/audiocore/RawSample.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class RawSample: //| """A raw audio sample buffer in memory""" @@ -88,7 +88,7 @@ STATIC mp_obj_t audioio_rawsample_make_new(const mp_obj_type_t *type, size_t n_a if (bufinfo.typecode == 'h' || bufinfo.typecode == 'H') { bytes_per_sample = 2; } else if (bufinfo.typecode != 'b' && bufinfo.typecode != 'B' && bufinfo.typecode != BYTEARRAY_TYPECODE) { - mp_raise_ValueError(translate("sample_source buffer must be a bytearray or array of type 'h', 'H', 'b' or 'B'")); + mp_raise_ValueError_varg(translate("%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'"), MP_QSTR_buffer); } common_hal_audioio_rawsample_construct(self, ((uint8_t *)bufinfo.buf), bufinfo.len, bytes_per_sample, signed_samples, args[ARG_channel_count].u_int, @@ -153,12 +153,9 @@ STATIC mp_obj_t audioio_rawsample_obj_set_sample_rate(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(audioio_rawsample_set_sample_rate_obj, audioio_rawsample_obj_set_sample_rate); -const mp_obj_property_t audioio_rawsample_sample_rate_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audioio_rawsample_get_sample_rate_obj, - (mp_obj_t)&audioio_rawsample_set_sample_rate_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(audioio_rawsample_sample_rate_obj, + (mp_obj_t)&audioio_rawsample_get_sample_rate_obj, + (mp_obj_t)&audioio_rawsample_set_sample_rate_obj); STATIC const mp_rom_map_elem_t audioio_rawsample_locals_dict_table[] = { // Methods diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index 1a8b5cae11..b1c51a9746 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "shared-bindings/audiocore/WaveFile.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class WaveFile: //| """Load a wave file for audio playback @@ -148,12 +148,9 @@ STATIC mp_obj_t audioio_wavefile_obj_set_sample_rate(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(audioio_wavefile_set_sample_rate_obj, audioio_wavefile_obj_set_sample_rate); -const mp_obj_property_t audioio_wavefile_sample_rate_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audioio_wavefile_get_sample_rate_obj, - (mp_obj_t)&audioio_wavefile_set_sample_rate_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(audioio_wavefile_sample_rate_obj, + (mp_obj_t)&audioio_wavefile_get_sample_rate_obj, + (mp_obj_t)&audioio_wavefile_set_sample_rate_obj); //| bits_per_sample: int //| """Bits per sample. (read only)""" @@ -165,12 +162,8 @@ STATIC mp_obj_t audioio_wavefile_obj_get_bits_per_sample(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_wavefile_get_bits_per_sample_obj, audioio_wavefile_obj_get_bits_per_sample); -const mp_obj_property_t audioio_wavefile_bits_per_sample_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audioio_wavefile_get_bits_per_sample_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audioio_wavefile_bits_per_sample_obj, + (mp_obj_t)&audioio_wavefile_get_bits_per_sample_obj); //| channel_count: int //| """Number of audio channels. (read only)""" //| @@ -181,12 +174,8 @@ STATIC mp_obj_t audioio_wavefile_obj_get_channel_count(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_wavefile_get_channel_count_obj, audioio_wavefile_obj_get_channel_count); -const mp_obj_property_t audioio_wavefile_channel_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audioio_wavefile_get_channel_count_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audioio_wavefile_channel_count_obj, + (mp_obj_t)&audioio_wavefile_get_channel_count_obj); STATIC const mp_rom_map_elem_t audioio_wavefile_locals_dict_table[] = { diff --git a/shared-bindings/audioio/AudioOut.c b/shared-bindings/audioio/AudioOut.c index 2fd4c0c452..75ba7b5ec5 100644 --- a/shared-bindings/audioio/AudioOut.c +++ b/shared-bindings/audioio/AudioOut.c @@ -34,7 +34,7 @@ #include "shared-bindings/audioio/AudioOut.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class AudioOut: //| """Output an analog audio signal""" @@ -197,12 +197,8 @@ STATIC mp_obj_t audioio_audioout_obj_get_playing(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_get_playing_obj, audioio_audioout_obj_get_playing); -const mp_obj_property_t audioio_audioout_playing_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audioio_audioout_get_playing_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audioio_audioout_playing_obj, + (mp_obj_t)&audioio_audioout_get_playing_obj); //| def pause(self) -> None: //| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" @@ -246,12 +242,8 @@ STATIC mp_obj_t audioio_audioout_obj_get_paused(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audioio_audioout_get_paused_obj, audioio_audioout_obj_get_paused); -const mp_obj_property_t audioio_audioout_paused_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audioio_audioout_get_paused_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audioio_audioout_paused_obj, + (mp_obj_t)&audioio_audioout_get_paused_obj); STATIC const mp_rom_map_elem_t audioio_audioout_locals_dict_table[] = { // Methods diff --git a/shared-bindings/audioio/__init__.c b/shared-bindings/audioio/__init__.c index 9f8411f484..f03ffd612a 100644 --- a/shared-bindings/audioio/__init__.c +++ b/shared-bindings/audioio/__init__.c @@ -42,6 +42,10 @@ //| call :py:meth:`!deinit` or use a context manager. See //| :ref:`lifetime-and-contextmanagers` for more info. //| +//| For more information on working with this module, refer to the +//| `CircuitPython Essentials Learn Guide +//| `_. +//| //| Since CircuitPython 5, `RawSample` and `WaveFile` are moved //| to :mod:`audiocore`, and `Mixer` is moved to :mod:`audiomixer`. //| diff --git a/shared-bindings/audiomixer/Mixer.c b/shared-bindings/audiomixer/Mixer.c index 3248e649c9..47dbd94f19 100644 --- a/shared-bindings/audiomixer/Mixer.c +++ b/shared-bindings/audiomixer/Mixer.c @@ -36,7 +36,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Mixer: //| """Mixes one or more audio samples together into one sample.""" @@ -91,19 +91,9 @@ STATIC mp_obj_t audiomixer_mixer_make_new(const mp_obj_type_t *type, size_t n_ar 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 voice_count = args[ARG_voice_count].u_int; - if (voice_count < 1 || voice_count > 255) { - mp_raise_ValueError(translate("Invalid voice count")); - } - - mp_int_t channel_count = args[ARG_channel_count].u_int; - if (channel_count < 1 || channel_count > 2) { - mp_raise_ValueError(translate("Invalid channel count")); - } - mp_int_t sample_rate = args[ARG_sample_rate].u_int; - if (sample_rate < 1) { - mp_raise_ValueError(translate("Sample rate must be positive")); - } + mp_int_t voice_count = mp_arg_validate_int_range(args[ARG_voice_count].u_int, 1, 255, MP_QSTR_voice_count); + mp_int_t channel_count = mp_arg_validate_int_range(args[ARG_channel_count].u_int, 1, 2, MP_QSTR_channel_count); + mp_int_t sample_rate = mp_arg_validate_int_min(args[ARG_sample_rate].u_int, 1, MP_QSTR_sample_rate); mp_int_t bits_per_sample = args[ARG_bits_per_sample].u_int; if (bits_per_sample != 8 && bits_per_sample != 16) { mp_raise_ValueError(translate("bits_per_sample must be 8 or 16")); @@ -166,12 +156,8 @@ STATIC mp_obj_t audiomixer_mixer_obj_get_playing(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiomixer_mixer_get_playing_obj, audiomixer_mixer_obj_get_playing); -const mp_obj_property_t audiomixer_mixer_playing_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomixer_mixer_get_playing_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiomixer_mixer_playing_obj, + (mp_obj_t)&audiomixer_mixer_get_playing_obj); //| sample_rate: int //| """32 bit value that dictates how quickly samples are played in Hertz (cycles per second).""" @@ -183,12 +169,8 @@ STATIC mp_obj_t audiomixer_mixer_obj_get_sample_rate(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiomixer_mixer_get_sample_rate_obj, audiomixer_mixer_obj_get_sample_rate); -const mp_obj_property_t audiomixer_mixer_sample_rate_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomixer_mixer_get_sample_rate_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiomixer_mixer_sample_rate_obj, + (mp_obj_t)&audiomixer_mixer_get_sample_rate_obj); //| voice: Tuple[MixerVoice, ...] //| """A tuple of the mixer's `audiomixer.MixerVoice` object(s). @@ -204,12 +186,8 @@ STATIC mp_obj_t audiomixer_mixer_obj_get_voice(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiomixer_mixer_get_voice_obj, audiomixer_mixer_obj_get_voice); -const mp_obj_property_t audiomixer_mixer_voice_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomixer_mixer_get_voice_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiomixer_mixer_voice_obj, + (mp_obj_t)&audiomixer_mixer_get_voice_obj); //| def play(self, sample: circuitpython_typing.AudioSample, *, voice: int = 0, loop: bool = False) -> None: //| """Plays the sample once when loop=False and continuously when loop=True. @@ -234,7 +212,7 @@ STATIC mp_obj_t audiomixer_mixer_obj_play(size_t n_args, const mp_obj_t *pos_arg uint8_t v = args[ARG_voice].u_int; if (v > (self->voice_count - 1)) { - mp_raise_ValueError(translate("Invalid voice")); + mp_arg_error_invalid(MP_QSTR_voice); } audiomixer_mixervoice_obj_t *voice = MP_OBJ_TO_PTR(self->voice[v]); mp_obj_t sample = args[ARG_sample].u_obj; @@ -260,7 +238,7 @@ STATIC mp_obj_t audiomixer_mixer_obj_stop_voice(size_t n_args, const mp_obj_t *p uint8_t v = args[ARG_voice].u_int; if (v > (self->voice_count - 1)) { - mp_raise_ValueError(translate("Invalid voice")); + mp_arg_error_invalid(MP_QSTR_voice); } audiomixer_mixervoice_obj_t *voice = MP_OBJ_TO_PTR(self->voice[v]); common_hal_audiomixer_mixervoice_stop(voice); diff --git a/shared-bindings/audiomixer/MixerVoice.c b/shared-bindings/audiomixer/MixerVoice.c index 82b6972864..f7bf16fb49 100644 --- a/shared-bindings/audiomixer/MixerVoice.c +++ b/shared-bindings/audiomixer/MixerVoice.c @@ -35,7 +35,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class MixerVoice: //| """Voice objects used with Mixer @@ -130,12 +130,9 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_set_level(size_t n_args, const mp_obj_ } MP_DEFINE_CONST_FUN_OBJ_KW(audiomixer_mixervoice_set_level_obj, 1, audiomixer_mixervoice_obj_set_level); -const mp_obj_property_t audiomixer_mixervoice_level_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomixer_mixervoice_get_level_obj, - (mp_obj_t)&audiomixer_mixervoice_set_level_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(audiomixer_mixervoice_level_obj, + (mp_obj_t)&audiomixer_mixervoice_get_level_obj, + (mp_obj_t)&audiomixer_mixervoice_set_level_obj); //| playing: bool //| """True when this voice is being output. (read-only)""" @@ -149,12 +146,8 @@ STATIC mp_obj_t audiomixer_mixervoice_obj_get_playing(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiomixer_mixervoice_get_playing_obj, audiomixer_mixervoice_obj_get_playing); -const mp_obj_property_t audiomixer_mixervoice_playing_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomixer_mixervoice_get_playing_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiomixer_mixervoice_playing_obj, + (mp_obj_t)&audiomixer_mixervoice_get_playing_obj); STATIC const mp_rom_map_elem_t audiomixer_mixervoice_locals_dict_table[] = { // Methods diff --git a/shared-bindings/audiomp3/MP3Decoder.c b/shared-bindings/audiomp3/MP3Decoder.c index 4761feacd8..8251b26c73 100644 --- a/shared-bindings/audiomp3/MP3Decoder.c +++ b/shared-bindings/audiomp3/MP3Decoder.c @@ -32,10 +32,17 @@ #include "py/runtime.h" #include "shared-bindings/audiomp3/MP3Decoder.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class MP3Decoder: -//| """Load a mp3 file for audio playback""" +//| """Load a mp3 file for audio playback +//| +//| .. note:: +//| +//| ``MP3Decoder`` uses a lot of contiguous memory, so care should be given to +//| optimizing memory usage. More information and recommendations can be found here: +//| https://learn.adafruit.com/Memory-saving-tips-for-CircuitPython/reducing-memory-fragmentation +//| """ //| //| def __init__(self, file: typing.BinaryIO, buffer: WriteableBuffer) -> None: //| @@ -44,6 +51,20 @@ //| :param typing.BinaryIO file: Already opened mp3 file //| :param ~circuitpython_typing.WriteableBuffer buffer: Optional pre-allocated buffer, that will be split in half and used for double-buffering of the data. If not provided, two buffers are allocated internally. The specific buffer size required depends on the mp3 file. //| +//| Playback of mp3 audio is CPU intensive, and the +//| exact limit depends on many factors such as the particular +//| microcontroller, SD card or flash performance, and other +//| code in use such as displayio. If playback is garbled, +//| skips, or plays as static, first try using a "simpler" mp3: +//| +//| * Use constant bit rate (CBR) not VBR or ABR (variable or average bit rate) when encoding your mp3 file +//| * Use a lower sample rate (e.g., 11.025kHz instead of 48kHz) +//| * Use a lower bit rate (e.g., 32kbit/s instead of 256kbit/s) +//| +//| Reduce activity taking place at the same time as +//| mp3 playback. For instance, only update small portions of a +//| displayio screen if audio is playing. Disable auto-refresh +//| and explicitly call refresh. //| //| Playing a mp3 file from flash:: //| @@ -145,12 +166,9 @@ STATIC mp_obj_t audiomp3_mp3file_obj_set_file(mp_obj_t self_in, mp_obj_t file) { } MP_DEFINE_CONST_FUN_OBJ_2(audiomp3_mp3file_set_file_obj, audiomp3_mp3file_obj_set_file); -const mp_obj_property_t audiomp3_mp3file_file_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomp3_mp3file_get_file_obj, - (mp_obj_t)&audiomp3_mp3file_set_file_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(audiomp3_mp3file_file_obj, + (mp_obj_t)&audiomp3_mp3file_get_file_obj, + (mp_obj_t)&audiomp3_mp3file_set_file_obj); @@ -174,12 +192,9 @@ STATIC mp_obj_t audiomp3_mp3file_obj_set_sample_rate(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(audiomp3_mp3file_set_sample_rate_obj, audiomp3_mp3file_obj_set_sample_rate); -const mp_obj_property_t audiomp3_mp3file_sample_rate_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomp3_mp3file_get_sample_rate_obj, - (mp_obj_t)&audiomp3_mp3file_set_sample_rate_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(audiomp3_mp3file_sample_rate_obj, + (mp_obj_t)&audiomp3_mp3file_get_sample_rate_obj, + (mp_obj_t)&audiomp3_mp3file_set_sample_rate_obj); //| bits_per_sample: int //| """Bits per sample. (read only)""" @@ -191,12 +206,8 @@ STATIC mp_obj_t audiomp3_mp3file_obj_get_bits_per_sample(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_get_bits_per_sample_obj, audiomp3_mp3file_obj_get_bits_per_sample); -const mp_obj_property_t audiomp3_mp3file_bits_per_sample_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomp3_mp3file_get_bits_per_sample_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiomp3_mp3file_bits_per_sample_obj, + (mp_obj_t)&audiomp3_mp3file_get_bits_per_sample_obj); //| channel_count: int //| """Number of audio channels. (read only)""" @@ -208,12 +219,8 @@ STATIC mp_obj_t audiomp3_mp3file_obj_get_channel_count(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_get_channel_count_obj, audiomp3_mp3file_obj_get_channel_count); -const mp_obj_property_t audiomp3_mp3file_channel_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomp3_mp3file_get_channel_count_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiomp3_mp3file_channel_count_obj, + (mp_obj_t)&audiomp3_mp3file_get_channel_count_obj); //| rms_level: float //| """The RMS audio level of a recently played moment of audio. (read only)""" @@ -225,12 +232,8 @@ STATIC mp_obj_t audiomp3_mp3file_obj_get_rms_level(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_get_rms_level_obj, audiomp3_mp3file_obj_get_rms_level); -const mp_obj_property_t audiomp3_mp3file_rms_level_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomp3_mp3file_get_rms_level_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiomp3_mp3file_rms_level_obj, + (mp_obj_t)&audiomp3_mp3file_get_rms_level_obj); //| samples_decoded: int //| """The number of audio samples decoded from the current file. (read only)""" @@ -242,12 +245,8 @@ STATIC mp_obj_t audiomp3_mp3file_obj_get_samples_decoded(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiomp3_mp3file_get_samples_decoded_obj, audiomp3_mp3file_obj_get_samples_decoded); -const mp_obj_property_t audiomp3_mp3file_samples_decoded_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiomp3_mp3file_get_samples_decoded_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiomp3_mp3file_samples_decoded_obj, + (mp_obj_t)&audiomp3_mp3file_get_samples_decoded_obj); STATIC const mp_rom_map_elem_t audiomp3_mp3file_locals_dict_table[] = { // Methods diff --git a/shared-bindings/audiomp3/__init__.c b/shared-bindings/audiomp3/__init__.c index d6c408b143..13f02b1ea9 100644 --- a/shared-bindings/audiomp3/__init__.c +++ b/shared-bindings/audiomp3/__init__.c @@ -31,7 +31,12 @@ #include "shared-bindings/audiomp3/MP3Decoder.h" -//| """Support for MP3-compressed audio files""" +//| """Support for MP3-compressed audio files +//| +//| For more infomration about working with MP3 files in CircuitPython, +//| see `this CircuitPython Essentials Learn guide page +//| `_. +//| """ //| STATIC const mp_rom_map_elem_t audiomp3_module_globals_table[] = { diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 85332d0fac..f4f3675750 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -34,7 +34,7 @@ #include "shared-bindings/audiopwmio/PWMAudioOut.h" #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PWMAudioOut: //| """Output an analog audio signal by varying the PWM duty cycle.""" @@ -198,12 +198,8 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_get_playing(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_get_playing_obj, audiopwmio_pwmaudioout_obj_get_playing); -const mp_obj_property_t audiopwmio_pwmaudioout_playing_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiopwmio_pwmaudioout_get_playing_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiopwmio_pwmaudioout_playing_obj, + (mp_obj_t)&audiopwmio_pwmaudioout_get_playing_obj); //| def pause(self) -> None: //| """Stops playback temporarily while remembering the position. Use `resume` to resume playback.""" @@ -247,12 +243,8 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_obj_get_paused(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(audiopwmio_pwmaudioout_get_paused_obj, audiopwmio_pwmaudioout_obj_get_paused); -const mp_obj_property_t audiopwmio_pwmaudioout_paused_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&audiopwmio_pwmaudioout_get_paused_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(audiopwmio_pwmaudioout_paused_obj, + (mp_obj_t)&audiopwmio_pwmaudioout_get_paused_obj); STATIC const mp_rom_map_elem_t audiopwmio_pwmaudioout_locals_dict_table[] = { // Methods diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index c65b184ca0..9c0555dd5a 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -35,7 +35,7 @@ #include "shared/runtime/context_manager_helpers.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class I2C: //| """Two wire serial protocol""" @@ -188,9 +188,7 @@ STATIC void readfrom(bitbangio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffe size_t length = bufinfo.len; normalize_buffer_bounds(&start, end, &length); - if (length == 0) { - mp_raise_ValueError(translate("Buffer must be at least length 1")); - } + mp_arg_validate_length_min(length, 1, MP_QSTR_buffer); uint8_t status = shared_module_bitbangio_i2c_read(self, address, ((uint8_t *)bufinfo.buf) + start, length); if (status != 0) { diff --git a/shared-bindings/bitbangio/SPI.c b/shared-bindings/bitbangio/SPI.c index 2c29c09bf9..103dd9fbaa 100644 --- a/shared-bindings/bitbangio/SPI.c +++ b/shared-bindings/bitbangio/SPI.c @@ -37,7 +37,7 @@ #include "shared/runtime/context_manager_helpers.h" #include "py/mperrno.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class SPI: //| """A 3-4 wire serial protocol @@ -156,18 +156,10 @@ STATIC mp_obj_t bitbangio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - uint8_t polarity = args[ARG_polarity].u_int; - if (polarity != 0 && polarity != 1) { - mp_raise_ValueError(translate("Invalid polarity")); - } - uint8_t phase = args[ARG_phase].u_int; - if (phase != 0 && phase != 1) { - mp_raise_ValueError(translate("Invalid phase")); - } - uint8_t bits = args[ARG_bits].u_int; - if (bits != 8 && bits != 9) { - mp_raise_ValueError(translate("Invalid number of bits")); - } + uint8_t polarity = (uint8_t)mp_arg_validate_int_range(args[ARG_polarity].u_int, 0, 1, MP_QSTR_polarity); + uint8_t phase = (uint8_t)mp_arg_validate_int_range(args[ARG_phase].u_int, 0, 1, MP_QSTR_phase); + uint8_t bits = (uint8_t)mp_arg_validate_int_range(args[ARG_bits].u_int, 8, 9, MP_QSTR_bits); + shared_module_bitbangio_spi_configure(self, args[ARG_baudrate].u_int, polarity, phase, bits); return mp_const_none; diff --git a/shared-bindings/bitbangio/__init__.c b/shared-bindings/bitbangio/__init__.c index 57348a3c1e..43117db494 100644 --- a/shared-bindings/bitbangio/__init__.c +++ b/shared-bindings/bitbangio/__init__.c @@ -34,7 +34,6 @@ #include "shared-bindings/bitbangio/__init__.h" #include "shared-bindings/bitbangio/I2C.h" -#include "shared-bindings/onewireio/OneWire.h" #include "shared-bindings/bitbangio/SPI.h" #include "py/runtime.h" @@ -72,9 +71,6 @@ STATIC const mp_rom_map_elem_t bitbangio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_bitbangio) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&bitbangio_i2c_type) }, - #if CIRCUITPY_ONEWIREIO - { MP_ROM_QSTR(MP_QSTR_OneWire), MP_ROM_PTR(&onewireio_onewire_type) }, - #endif { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&bitbangio_spi_type) }, }; diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index df6292afec..9339db8f66 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -43,7 +43,13 @@ #include "extmod/vfs_posix.h" #endif -//| """Collection of bitmap manipulation tools""" +//| """Collection of bitmap manipulation tools +//| +//| .. note:: If you're looking for information about displaying bitmaps on +//| screens in CircuitPython, see `this Learn guide +//| `_ +//| for information about using the :py:mod:`displayio` module. +//| """ //| STATIC int16_t validate_point(mp_obj_t point, int16_t default_value) { @@ -133,23 +139,29 @@ STATIC void validate_clip_region(displayio_bitmap_t *bitmap, mp_obj_t clip0_tupl //| :param bitmap dest_bitmap: Destination bitmap that will be copied into //| :param bitmap source_bitmap: Source bitmap that contains the graphical region to be copied //| :param int ox: Horizontal pixel location in destination bitmap where source bitmap -//| point (px,py) is placed +//| point (px,py) is placed. Defaults to None which causes it to use the horizontal +//| midway point of the destination bitmap. //| :param int oy: Vertical pixel location in destination bitmap where source bitmap -//| point (px,py) is placed +//| point (px,py) is placed. Defaults to None which causes it to use the vertical +//| midway point of the destination bitmap. //| :param Tuple[int,int] dest_clip0: First corner of rectangular destination clipping //| region that constrains region of writing into destination bitmap //| :param Tuple[int,int] dest_clip1: Second corner of rectangular destination clipping //| region that constrains region of writing into destination bitmap //| :param int px: Horizontal pixel location in source bitmap that is placed into the -//| destination bitmap at (ox,oy) +//| destination bitmap at (ox,oy). Defaults to None which causes it to use the +//| horizontal midway point in the source bitmap. //| :param int py: Vertical pixel location in source bitmap that is placed into the -//| destination bitmap at (ox,oy) +//| destination bitmap at (ox,oy). Defaults to None which causes it to use the +//| vertical midway point in the source bitmap. //| :param Tuple[int,int] source_clip0: First corner of rectangular source clipping //| region that constrains region of reading from the source bitmap //| :param Tuple[int,int] source_clip1: Second corner of rectangular source clipping //| region that constrains region of reading from the source bitmap -//| :param float angle: Angle of rotation, in radians (positive is clockwise direction) -//| :param float scale: Scaling factor +//| :param float angle: Angle of rotation, in radians (positive is clockwise direction). +//| Defaults to None which gets treated as 0.0 radians or no rotation. +//| :param float scale: Scaling factor. Defaults to None which gets treated as 1.0 or same +//| as original source size. //| :param int skip_index: Bitmap palette index in the source that will not be copied, //| set to None to copy all pixels""" //| ... @@ -255,7 +267,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_rotozoom_obj, 0, bitmaptools_obj_rotozoom // requires at least 2 arguments (destination bitmap and source bitmap) //| -//| def alphablend(dest_bitmap: displayio.Bitmap , source_bitmap_1: displayio.Bitmap, source_bitmap_2: displayio.Bitmap, colorspace: displayio.Colorspace, factor1: float=.5, factor2: float=None) -> None: +//| def alphablend(dest_bitmap: displayio.Bitmap , source_bitmap_1: displayio.Bitmap, source_bitmap_2: displayio.Bitmap, colorspace: displayio.Colorspace, factor1: float=.5, factor2: Optional[float]=None) -> None: //| """Alpha blend the two source bitmaps into the destination. //| //| It is permitted for the destination bitmap to be one of the two diff --git a/shared-bindings/bitops/__init__.c b/shared-bindings/bitops/__init__.c index 5b455dcb0f..0b6b98a8d1 100644 --- a/shared-bindings/bitops/__init__.c +++ b/shared-bindings/bitops/__init__.c @@ -64,10 +64,7 @@ STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - int width = args[ARG_width].u_int; - if (width < 2 || width > 8) { - mp_raise_ValueError_varg(translate("width must be from 2 to 8 (inclusive), not %d"), width); - } + mp_int_t width = mp_arg_validate_int_range(args[ARG_width].u_int, 2, 8, MP_QSTR_width); mp_buffer_info_t input_bufinfo; mp_get_buffer_raise(args[ARG_input].u_obj, &input_bufinfo, MP_BUFFER_READ); @@ -80,9 +77,9 @@ STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t mp_get_buffer_raise(args[ARG_output].u_obj, &output_bufinfo, MP_BUFFER_WRITE); int avail = output_bufinfo.len; int outlen = 8 * (inlen / width); - if (avail < outlen) { - mp_raise_ValueError_varg(translate("Output buffer must be at least %d bytes"), outlen); - } + + mp_arg_validate_length_min(avail, outlen, MP_QSTR_output); + common_hal_bitops_bit_transpose(output_bufinfo.buf, input_bufinfo.buf, inlen, width); return args[ARG_output].u_obj; } diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 8b2738a248..e4003d4f6b 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -43,6 +43,14 @@ //| 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 +//| the default pins and settings. For more information about serial communcication +//| in CircuitPython, see the :mod:`busio`. +//| +//| For more information regarding the typical usage of :py:mod:`board`, refer to the `CircuitPython +//| Essentials Learn guide +//| `_ +//| //| .. warning:: The board module varies by board. The APIs documented here may or may not be //| available on a specific board.""" diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 2d67281df0..b3afd9801d 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -34,7 +34,7 @@ #include "shared/runtime/buffer_helper.h" #include "shared/runtime/context_manager_helpers.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class I2C: //| """Two wire serial protocol""" @@ -210,9 +210,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, int32_t start = args[ARG_start].u_int; const int32_t end = args[ARG_end].u_int; normalize_buffer_bounds(&start, end, &length); - if (length == 0) { - mp_raise_ValueError_varg(translate("%q length must be >= 1"), MP_QSTR_buffer); - } + mp_arg_validate_length_min(length, 1, MP_QSTR_buffer); uint8_t status = common_hal_busio_i2c_read(self, args[ARG_address].u_int, ((uint8_t *)bufinfo.buf) + start, length); diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index df364fcbb9..eb89746d05 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -38,7 +38,7 @@ #include "py/mperrno.h" #include "py/objproperty.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class SPI: @@ -106,7 +106,7 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, siz common_hal_busio_spi_construct(self, clock, mosi, miso, args[ARG_half_duplex].u_bool); return MP_OBJ_FROM_PTR(self); #else - mp_raise_ValueError(translate("Invalid pins")); + raise_ValueError_invalid_pins(); #endif // CIRCUITPY_BUSIO_SPI } @@ -191,18 +191,9 @@ STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - uint8_t polarity = args[ARG_polarity].u_int; - if (polarity != 0 && polarity != 1) { - mp_raise_ValueError(translate("Invalid polarity")); - } - uint8_t phase = args[ARG_phase].u_int; - if (phase != 0 && phase != 1) { - mp_raise_ValueError(translate("Invalid phase")); - } - uint8_t bits = args[ARG_bits].u_int; - if (bits != 8 && bits != 9) { - mp_raise_ValueError(translate("Invalid number of bits")); - } + uint8_t polarity = (uint8_t)mp_arg_validate_int_range(args[ARG_polarity].u_int, 0, 1, MP_QSTR_polarity); + uint8_t phase = (uint8_t)mp_arg_validate_int_range(args[ARG_phase].u_int, 0, 1, MP_QSTR_phase); + uint8_t bits = (uint8_t)mp_arg_validate_int_range(args[ARG_bits].u_int, 8, 9, MP_QSTR_bits); if (!common_hal_busio_spi_configure(self, args[ARG_baudrate].u_int, polarity, phase, bits)) { @@ -299,7 +290,9 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 1, busio_spi_write); //| //| :param WriteableBuffer buffer: read bytes into this buffer //| :param int start: beginning of buffer slice -//| :param int end: end of buffer slice; if not specified, use ``len(buffer)`` +//| :param int end: end of buffer slice; if not specified, it will be the equivalent value +//| of ``len(buffer)`` and for any value provided it will take the value of +//| ``min(end, len(buffer))`` //| :param int write_value: value to write while reading //| """ //| ... @@ -423,12 +416,8 @@ STATIC mp_obj_t busio_spi_obj_get_frequency(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_spi_get_frequency_obj, busio_spi_obj_get_frequency); -const mp_obj_property_t busio_spi_frequency_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&busio_spi_get_frequency_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(busio_spi_frequency_obj, + (mp_obj_t)&busio_spi_get_frequency_obj); #endif // CIRCUITPY_BUSIO_SPI diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index 1819748992..d849d63ae8 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -38,7 +38,7 @@ #include "py/objtype.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define STREAM_DEBUG(...) (void)0 // #define STREAM_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) @@ -63,7 +63,12 @@ //| :param int receiver_buffer_size: the character length of the read buffer (0 to disable). (When a character is 9 bits the buffer will be 2 * receiver_buffer_size bytes.) //| //| *New in CircuitPython 4.0:* ``timeout`` has incompatibly changed units from milliseconds to seconds. -//| The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds.""" +//| The new upper limit on ``timeout`` is meant to catch mistaken use of milliseconds. +//| +//| .. note:: RS485 support on i.MX and Raspberry Pi RP2040 is implemented in software. +//| The timing for the ``rs485_dir`` pin signal is done on a best-effort basis, and may not meet +//| RS485 specifications intermittently. +//| """ //| ... //| typedef struct { @@ -108,10 +113,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si mp_raise_ValueError(translate("tx and rx cannot both be None")); } - if (args[ARG_bits].u_int < 5 || args[ARG_bits].u_int > 9) { - mp_raise_ValueError(translate("bits must be in range 5 to 9")); - } - uint8_t bits = args[ARG_bits].u_int; + uint8_t bits = (uint8_t)mp_arg_validate_int_range(args[ARG_bits].u_int, 5, 9, MP_QSTR_bits); busio_uart_parity_t parity = BUSIO_UART_PARITY_NONE; if (args[ARG_parity].u_obj == MP_OBJ_FROM_PTR(&busio_uart_parity_even_obj)) { @@ -120,10 +122,7 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, si parity = BUSIO_UART_PARITY_ODD; } - uint8_t stop = args[ARG_stop].u_int; - if (stop != 1 && stop != 2) { - mp_raise_ValueError(translate("stop must be 1 or 2")); - } + uint8_t stop = (uint8_t)mp_arg_validate_int_range(args[ARG_stop].u_int, 1, 2, MP_QSTR_stop); mp_float_t timeout = mp_obj_get_float(args[ARG_timeout].u_obj); validate_timeout(timeout); @@ -201,10 +200,14 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ // These are standard stream methods. Code is in py/stream.c. // //| def read(self, nbytes: Optional[int] = None) -> Optional[bytes]: -//| """Read characters. If ``nbytes`` is specified then read at most that many +//| """Read bytes. If ``nbytes`` is specified then read at most that many //| bytes. Otherwise, read everything that arrives until the connection //| times out. Providing the number of bytes expected is highly recommended -//| because it will be faster. +//| because it will be faster. If no bytes are read, return ``None``. +//| +//| .. note:: When no bytes are read due to a timeout, this function returns ``None``. +//| This matches the behavior of `io.RawIOBase.read` in Python 3, but +//| differs from pyserial which returns ``b''`` in that situation. //| //| :return: Data read //| :rtype: bytes or None""" @@ -223,15 +226,16 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_uart___exit___obj, 4, 4, busio_ //| def readline(self) -> bytes: //| """Read a line, ending in a newline character, or -//| return None if a timeout occurs sooner, or -//| return everything readable if no newline is found and timeout=0 +//| return ``None`` if a timeout occurs sooner, or +//| return everything readable if no newline is found and +//| ``timeout=0`` //| //| :return: the line read //| :rtype: bytes or None""" //| ... //| -//| def write(self, buf: WriteableBuffer) -> Optional[int]: +//| def write(self, buf: ReadableBuffer) -> Optional[int]: //| """Write the buffer of bytes to the bus. //| //| *New in CircuitPython 4.0:* ``buf`` must be bytes, not a string. @@ -303,12 +307,9 @@ STATIC mp_obj_t busio_uart_obj_set_baudrate(mp_obj_t self_in, mp_obj_t baudrate) MP_DEFINE_CONST_FUN_OBJ_2(busio_uart_set_baudrate_obj, busio_uart_obj_set_baudrate); -const mp_obj_property_t busio_uart_baudrate_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&busio_uart_get_baudrate_obj, - (mp_obj_t)&busio_uart_set_baudrate_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(busio_uart_baudrate_obj, + (mp_obj_t)&busio_uart_get_baudrate_obj, + (mp_obj_t)&busio_uart_set_baudrate_obj); //| in_waiting: int //| """The number of bytes in the input buffer, available to be read""" @@ -320,12 +321,8 @@ STATIC mp_obj_t busio_uart_obj_get_in_waiting(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_get_in_waiting_obj, busio_uart_obj_get_in_waiting); -const mp_obj_property_t busio_uart_in_waiting_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&busio_uart_get_in_waiting_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(busio_uart_in_waiting_obj, + (mp_obj_t)&busio_uart_get_in_waiting_obj); //| timeout: float //| """The current timeout, in seconds (float).""" @@ -348,12 +345,9 @@ STATIC mp_obj_t busio_uart_obj_set_timeout(mp_obj_t self_in, mp_obj_t timeout) { MP_DEFINE_CONST_FUN_OBJ_2(busio_uart_set_timeout_obj, busio_uart_obj_set_timeout); -const mp_obj_property_t busio_uart_timeout_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&busio_uart_get_timeout_obj, - (mp_obj_t)&busio_uart_set_timeout_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(busio_uart_timeout_obj, + (mp_obj_t)&busio_uart_get_timeout_obj, + (mp_obj_t)&busio_uart_set_timeout_obj); //| def reset_input_buffer(self) -> None: //| """Discard any unread characters in the input buffer.""" diff --git a/shared-bindings/busio/__init__.c b/shared-bindings/busio/__init__.c index 13115eb793..969c10e938 100644 --- a/shared-bindings/busio/__init__.c +++ b/shared-bindings/busio/__init__.c @@ -34,9 +34,6 @@ #include "shared-bindings/busio/I2C.h" #include "shared-bindings/busio/SPI.h" #include "shared-bindings/busio/UART.h" -#if CIRCUITPY_ONEWIREIO -#include "shared-bindings/onewireio/OneWire.h" -#endif #include "py/runtime.h" @@ -68,16 +65,25 @@ //| This example will initialize the the device, run //| :py:meth:`~busio.I2C.scan` and then :py:meth:`~busio.I2C.deinit` the //| hardware. The last step is optional because CircuitPython automatically -//| resets hardware after a program finishes.""" +//| resets hardware after a program finishes. +//| +//| Note that drivers will typically handle communication if provided the bus +//| instance (such as ``busio.I2C(board.SCL, board.SDA)``), and that many of +//| the methods listed here are lower level functionalities that are needed +//| for working with custom drivers. +//| +//| Tutorial for I2C and SPI: +//| https://learn.adafruit.com/circuitpython-basics-i2c-and-spi +//| +//| Tutorial for UART: +//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-uart-serial +//| """ //| STATIC const mp_rom_map_elem_t busio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_busio) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&busio_i2c_type) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&busio_spi_type) }, - #if CIRCUITPY_ONEWIREIO - { MP_ROM_QSTR(MP_QSTR_OneWire), MP_ROM_PTR(&onewireio_onewire_type) }, - #endif { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&busio_uart_type) }, }; diff --git a/shared-bindings/canio/CAN.c b/shared-bindings/canio/CAN.c index ec9c2b8a68..e8aec7f0a1 100644 --- a/shared-bindings/canio/CAN.c +++ b/shared-bindings/canio/CAN.c @@ -112,12 +112,9 @@ STATIC mp_obj_t canio_can_auto_restart_set(mp_obj_t self_in, mp_obj_t flag_in) { } MP_DEFINE_CONST_FUN_OBJ_2(canio_can_auto_restart_set_obj, canio_can_auto_restart_set); -STATIC const mp_obj_property_t canio_can_auto_restart_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_auto_restart_get_obj, - (mp_obj_t)&canio_can_auto_restart_set_obj, - (mp_obj_t)mp_const_none}, -}; +MP_PROPERTY_GETSET(canio_can_auto_restart_obj, + (mp_obj_t)&canio_can_auto_restart_get_obj, + (mp_obj_t)&canio_can_auto_restart_set_obj); //| baudrate: int @@ -130,12 +127,8 @@ STATIC mp_obj_t canio_can_baudrate_get(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(canio_can_baudrate_get_obj, canio_can_baudrate_get); -STATIC const mp_obj_property_t canio_can_baudrate_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_baudrate_get_obj, - (mp_obj_t)mp_const_none, - (mp_obj_t)mp_const_none}, -}; +MP_PROPERTY_GETTER(canio_can_baudrate_obj, + (mp_obj_t)&canio_can_baudrate_get_obj); //| transmit_error_count: int //| """The number of transmit errors (read-only). Increased for a detected transmission error, decreased for successful transmission. Limited to the range from 0 to 255 inclusive. Also called TEC.""" @@ -147,12 +140,8 @@ STATIC mp_obj_t canio_can_transmit_error_count_get(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(canio_can_transmit_error_count_get_obj, canio_can_transmit_error_count_get); -STATIC const mp_obj_property_t canio_can_transmit_error_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_transmit_error_count_get_obj, - (mp_obj_t)mp_const_none, - (mp_obj_t)mp_const_none}, -}; +MP_PROPERTY_GETTER(canio_can_transmit_error_count_obj, + (mp_obj_t)&canio_can_transmit_error_count_get_obj); //| receive_error_count: int //| """The number of receive errors (read-only). Increased for a detected reception error, decreased for successful reception. Limited to the range from 0 to 255 inclusive. Also called REC.""" @@ -164,12 +153,8 @@ STATIC mp_obj_t canio_can_receive_error_count_get(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(canio_can_receive_error_count_get_obj, canio_can_receive_error_count_get); -STATIC const mp_obj_property_t canio_can_receive_error_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_receive_error_count_get_obj, - (mp_obj_t)mp_const_none, - (mp_obj_t)mp_const_none}, -}; +MP_PROPERTY_GETTER(canio_can_receive_error_count_obj, + (mp_obj_t)&canio_can_receive_error_count_get_obj); //| state: BusState //| """The current state of the bus. (read-only)""" @@ -181,12 +166,8 @@ STATIC mp_obj_t canio_can_state_get(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(canio_can_state_get_obj, canio_can_state_get); -STATIC const mp_obj_property_t canio_can_state_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_state_get_obj, - (mp_obj_t)mp_const_none, - (mp_obj_t)mp_const_none}, -}; +MP_PROPERTY_GETTER(canio_can_state_obj, + (mp_obj_t)&canio_can_state_get_obj); //| def restart(self) -> None: @@ -283,12 +264,8 @@ STATIC mp_obj_t canio_can_loopback_get(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(canio_can_loopback_get_obj, canio_can_loopback_get); -STATIC const mp_obj_property_t canio_can_loopback_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_loopback_get_obj, - (mp_obj_t)mp_const_none, - (mp_obj_t)mp_const_none}, -}; +MP_PROPERTY_GETTER(canio_can_loopback_obj, + (mp_obj_t)&canio_can_loopback_get_obj); //| def send(self, message: Union[RemoteTransmissionRequest, Message]) -> None: @@ -322,12 +299,8 @@ STATIC mp_obj_t canio_can_silent_get(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(canio_can_silent_get_obj, canio_can_silent_get); -STATIC const mp_obj_property_t canio_can_silent_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_can_silent_get_obj, - (mp_obj_t)mp_const_none, - (mp_obj_t)mp_const_none}, -}; +MP_PROPERTY_GETTER(canio_can_silent_obj, + (mp_obj_t)&canio_can_silent_get_obj); //| def deinit(self) -> None: diff --git a/shared-bindings/canio/Listener.c b/shared-bindings/canio/Listener.c index 6f4e53282f..e59801d4e4 100644 --- a/shared-bindings/canio/Listener.c +++ b/shared-bindings/canio/Listener.c @@ -150,12 +150,9 @@ STATIC mp_obj_t canio_listener_timeout_set(mp_obj_t self_in, mp_obj_t timeout_in } STATIC MP_DEFINE_CONST_FUN_OBJ_2(canio_listener_timeout_set_obj, canio_listener_timeout_set); -STATIC const mp_obj_property_t canio_listener_timeout_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_listener_timeout_get_obj, - (mp_obj_t)&canio_listener_timeout_set_obj, - (mp_obj_t)mp_const_none}, -}; +MP_PROPERTY_GETSET(canio_listener_timeout_obj, + (mp_obj_t)&canio_listener_timeout_get_obj, + (mp_obj_t)&canio_listener_timeout_set_obj); diff --git a/shared-bindings/canio/Match.c b/shared-bindings/canio/Match.c index e8379d3eda..52262b0a6c 100644 --- a/shared-bindings/canio/Match.c +++ b/shared-bindings/canio/Match.c @@ -82,12 +82,8 @@ STATIC mp_obj_t canio_match_id_get(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(canio_match_id_get_obj, canio_match_id_get); -const mp_obj_property_t canio_match_id_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_match_id_get_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(canio_match_id_obj, + (mp_obj_t)&canio_match_id_get_obj); //| //| mask: int @@ -100,12 +96,8 @@ STATIC mp_obj_t canio_match_mask_get(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(canio_match_mask_get_obj, canio_match_mask_get); -const mp_obj_property_t canio_match_mask_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_match_mask_get_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(canio_match_mask_obj, + (mp_obj_t)&canio_match_mask_get_obj); //| extended: bool //| """True to match extended ids, False to match standard ides""" @@ -117,12 +109,8 @@ STATIC mp_obj_t canio_match_extended_get(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(canio_match_extended_get_obj, canio_match_extended_get); -const mp_obj_property_t canio_match_extended_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_match_extended_get_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(canio_match_extended_obj, + (mp_obj_t)&canio_match_extended_get_obj); STATIC const mp_rom_map_elem_t canio_match_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_match_id_obj) }, diff --git a/shared-bindings/canio/Message.c b/shared-bindings/canio/Message.c index 8ed1352dcc..28c445316a 100644 --- a/shared-bindings/canio/Message.c +++ b/shared-bindings/canio/Message.c @@ -57,9 +57,7 @@ STATIC mp_obj_t canio_message_make_new(const mp_obj_type_t *type, size_t n_args, mp_buffer_info_t data; mp_get_buffer_raise(args[ARG_data].u_obj, &data, MP_BUFFER_READ); - if (data.len > 8) { - mp_raise_ValueError(translate("Messages limited to 8 bytes")); - } + mp_arg_validate_length_range(data.len, 0, 8, MP_QSTR_data); canio_message_obj_t *self = m_new_obj(canio_message_obj_t); self->base.type = &canio_message_type; @@ -83,12 +81,9 @@ STATIC mp_obj_t canio_message_id_set(const mp_obj_t self_in, const mp_obj_t id) } MP_DEFINE_CONST_FUN_OBJ_2(canio_message_id_set_obj, canio_message_id_set); -STATIC const mp_obj_property_t canio_message_id_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_message_id_get_obj, - (mp_obj_t)&canio_message_id_set_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(canio_message_id_obj, + (mp_obj_t)&canio_message_id_get_obj, + (mp_obj_t)&canio_message_id_set_obj); //| data: bytes //| """The content of the message""" @@ -103,21 +98,18 @@ STATIC mp_obj_t canio_message_data_set(const mp_obj_t self_in, const mp_obj_t da canio_message_obj_t *self = self_in; mp_buffer_info_t data; mp_get_buffer_raise(data_in, &data, MP_BUFFER_READ); - if (data.len > 8) { - mp_raise_ValueError(translate("Messages limited to 8 bytes")); - } + + mp_arg_validate_length_range(data.len, 0, 8, MP_QSTR_data); + common_hal_canio_message_set_data(self, data.buf, data.len); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(canio_message_data_set_obj, canio_message_data_set); -STATIC const mp_obj_property_t canio_message_data_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_message_data_get_obj, - (mp_obj_t)&canio_message_data_set_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(canio_message_data_obj, + (mp_obj_t)&canio_message_data_get_obj, + (mp_obj_t)&canio_message_data_set_obj); //| extended: bool @@ -137,12 +129,9 @@ STATIC mp_obj_t canio_message_extended_set(const mp_obj_t self_in, const mp_obj_ MP_DEFINE_CONST_FUN_OBJ_2(canio_message_extended_set_obj, canio_message_extended_set); -STATIC const mp_obj_property_t canio_message_extended_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_message_extended_get_obj, - (mp_obj_t)&canio_message_extended_set_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(canio_message_extended_obj, + (mp_obj_t)&canio_message_extended_get_obj, + (mp_obj_t)&canio_message_extended_set_obj); STATIC const mp_rom_map_elem_t canio_message_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_message_id_obj) }, diff --git a/shared-bindings/canio/RemoteTransmissionRequest.c b/shared-bindings/canio/RemoteTransmissionRequest.c index 3267cf914d..58ac3aa2de 100644 --- a/shared-bindings/canio/RemoteTransmissionRequest.c +++ b/shared-bindings/canio/RemoteTransmissionRequest.c @@ -82,12 +82,9 @@ STATIC mp_obj_t canio_remote_transmission_request_id_set(const mp_obj_t self_in, } MP_DEFINE_CONST_FUN_OBJ_2(canio_remote_transmission_request_id_set_obj, canio_remote_transmission_request_id_set); -STATIC const mp_obj_property_t canio_remote_transmission_request_id_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_remote_transmission_request_id_get_obj, - (mp_obj_t)&canio_remote_transmission_request_id_set_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(canio_remote_transmission_request_id_obj, + (mp_obj_t)&canio_remote_transmission_request_id_get_obj, + (mp_obj_t)&canio_remote_transmission_request_id_set_obj); //| extended: bool //| """True if the message's id is an extended id""" @@ -106,12 +103,9 @@ STATIC mp_obj_t canio_remote_transmission_request_extended_set(const mp_obj_t se MP_DEFINE_CONST_FUN_OBJ_2(canio_remote_transmission_request_extended_set_obj, canio_remote_transmission_request_extended_set); -STATIC const mp_obj_property_t canio_remote_transmission_request_extended_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_remote_transmission_request_extended_get_obj, - (mp_obj_t)&canio_remote_transmission_request_extended_set_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(canio_remote_transmission_request_extended_obj, + (mp_obj_t)&canio_remote_transmission_request_extended_get_obj, + (mp_obj_t)&canio_remote_transmission_request_extended_set_obj); //| length: int //| """The length of the requested message.""" @@ -134,12 +128,9 @@ STATIC mp_obj_t canio_remote_transmission_request_length_set(const mp_obj_t self MP_DEFINE_CONST_FUN_OBJ_2(canio_remote_transmission_request_length_set_obj, canio_remote_transmission_request_length_set); -STATIC const mp_obj_property_t canio_remote_transmission_request_length_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&canio_remote_transmission_request_length_get_obj, - (mp_obj_t)&canio_remote_transmission_request_length_set_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(canio_remote_transmission_request_length_obj, + (mp_obj_t)&canio_remote_transmission_request_length_get_obj, + (mp_obj_t)&canio_remote_transmission_request_length_set_obj); STATIC const mp_rom_map_elem_t canio_remote_transmission_request_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_id), MP_ROM_PTR(&canio_remote_transmission_request_id_obj) }, diff --git a/shared-bindings/canio/__init__.c b/shared-bindings/canio/__init__.c index ef1b90df97..ecef7ebde6 100644 --- a/shared-bindings/canio/__init__.c +++ b/shared-bindings/canio/__init__.c @@ -54,6 +54,9 @@ //| Other implementations of the CAN device may exist (for instance, attached //| via an SPI bus). If so their constructor arguments may differ, but //| otherwise we encourage implementors to follow the API that the core uses. +//| +//| For more information on working with this module, refer to +//| `this Learn Guide on using it `_. //| """ //| diff --git a/shared-bindings/countio/Counter.c b/shared-bindings/countio/Counter.c index f165eda202..79ac3e75da 100644 --- a/shared-bindings/countio/Counter.c +++ b/shared-bindings/countio/Counter.c @@ -30,7 +30,7 @@ //| import countio //| //| # Count rising edges only. -//| pin_counter = countio.Counter(board.D1, edge=Edge.RISE) +//| pin_counter = countio.Counter(board.D1, edge=countio.Edge.RISE) //| # Reset the count after 100 counts. //| while True: //| if pin_counter.count >= 100: @@ -114,12 +114,9 @@ STATIC mp_obj_t countio_counter_obj_set_count(mp_obj_t self_in, mp_obj_t new_cou } MP_DEFINE_CONST_FUN_OBJ_2(countio_counter_set_count_obj, countio_counter_obj_set_count); -const mp_obj_property_t countio_counter_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&countio_counter_get_count_obj, - (mp_obj_t)&countio_counter_set_count_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(countio_counter_count_obj, + (mp_obj_t)&countio_counter_get_count_obj, + (mp_obj_t)&countio_counter_set_count_obj); //| def reset(self) -> None: //| """Resets the count back to 0.""" diff --git a/shared-bindings/countio/Edge.h b/shared-bindings/countio/Edge.h index ca4cddbef3..86112fb4a3 100644 --- a/shared-bindings/countio/Edge.h +++ b/shared-bindings/countio/Edge.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2021 an Halbertfor Adafruit Industries + * Copyright (c) 2021 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 diff --git a/shared-bindings/countio/__init__.c b/shared-bindings/countio/__init__.c index d72ed9fd25..307966c202 100644 --- a/shared-bindings/countio/__init__.c +++ b/shared-bindings/countio/__init__.c @@ -13,6 +13,10 @@ //| //| The `countio` module contains logic to read and count edge transistions //| +//| For more information on the applications of counting edges, see +//| `this Learn Guide on sequential circuits +//| `_. +//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See diff --git a/shared-bindings/digitalio/DigitalInOut.c b/shared-bindings/digitalio/DigitalInOut.c index af7defd911..ae72b5cb55 100644 --- a/shared-bindings/digitalio/DigitalInOut.c +++ b/shared-bindings/digitalio/DigitalInOut.c @@ -41,7 +41,7 @@ #include "shared-bindings/digitalio/DriveMode.h" #include "shared-bindings/digitalio/Pull.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class DigitalInOut: //| """Digital input and output @@ -207,18 +207,15 @@ STATIC mp_obj_t digitalio_digitalinout_obj_set_direction(mp_obj_t self_in, mp_ob mp_raise_NotImplementedError(translate("Pin is input only")); } } else { - mp_raise_ValueError(translate("Invalid direction.")); + mp_arg_error_invalid(MP_QSTR_direction); } return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(digitalio_digitalinout_set_direction_obj, digitalio_digitalinout_obj_set_direction); -const mp_obj_property_t digitalio_digitalio_direction_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&digitalio_digitalinout_get_direction_obj, - (mp_obj_t)&digitalio_digitalinout_set_direction_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(digitalio_digitalio_direction_obj, + (mp_obj_t)&digitalio_digitalinout_get_direction_obj, + (mp_obj_t)&digitalio_digitalinout_set_direction_obj); //| value: bool //| """The digital logic level of the pin.""" @@ -243,12 +240,9 @@ STATIC mp_obj_t digitalio_digitalinout_obj_set_value(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(digitalio_digitalinout_set_value_obj, digitalio_digitalinout_obj_set_value); -const mp_obj_property_t digitalio_digitalinout_value_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&digitalio_digitalinout_get_value_obj, - (mp_obj_t)&digitalio_digitalinout_set_value_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(digitalio_digitalinout_value_obj, + (mp_obj_t)&digitalio_digitalinout_get_value_obj, + (mp_obj_t)&digitalio_digitalinout_set_value_obj); //| drive_mode: DriveMode //| """The pin drive mode. One of: @@ -287,12 +281,9 @@ STATIC mp_obj_t digitalio_digitalinout_obj_set_drive_mode(mp_obj_t self_in, mp_o } MP_DEFINE_CONST_FUN_OBJ_2(digitalio_digitalinout_set_drive_mode_obj, digitalio_digitalinout_obj_set_drive_mode); -const mp_obj_property_t digitalio_digitalio_drive_mode_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&digitalio_digitalinout_get_drive_mode_obj, - (mp_obj_t)&digitalio_digitalinout_set_drive_mode_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(digitalio_digitalio_drive_mode_obj, + (mp_obj_t)&digitalio_digitalinout_get_drive_mode_obj, + (mp_obj_t)&digitalio_digitalinout_set_drive_mode_obj); //| pull: Optional[Pull] //| """The pin pull direction. One of: @@ -333,12 +324,9 @@ STATIC mp_obj_t digitalio_digitalinout_obj_set_pull(mp_obj_t self_in, mp_obj_t p } MP_DEFINE_CONST_FUN_OBJ_2(digitalio_digitalinout_set_pull_obj, digitalio_digitalinout_obj_set_pull); -const mp_obj_property_t digitalio_digitalio_pull_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&digitalio_digitalinout_get_pull_obj, - (mp_obj_t)&digitalio_digitalinout_set_pull_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(digitalio_digitalio_pull_obj, + (mp_obj_t)&digitalio_digitalinout_get_pull_obj, + (mp_obj_t)&digitalio_digitalinout_set_pull_obj); STATIC const mp_rom_map_elem_t digitalio_digitalinout_locals_dict_table[] = { // instance methods diff --git a/shared-bindings/digitalio/DigitalInOut.h b/shared-bindings/digitalio/DigitalInOut.h index ebc94fa1a6..b6edbc63aa 100644 --- a/shared-bindings/digitalio/DigitalInOut.h +++ b/shared-bindings/digitalio/DigitalInOut.h @@ -41,6 +41,14 @@ typedef enum { DIGITALINOUT_INPUT_ONLY } digitalinout_result_t; +typedef enum { + DIGITALINOUT_REG_READ, + DIGITALINOUT_REG_WRITE, + DIGITALINOUT_REG_SET, + DIGITALINOUT_REG_RESET, + DIGITALINOUT_REG_TOGGLE, +} digitalinout_reg_op_t; + digitalinout_result_t common_hal_digitalio_digitalinout_construct(digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin); void common_hal_digitalio_digitalinout_deinit(digitalio_digitalinout_obj_t *self); bool common_hal_digitalio_digitalinout_deinited(digitalio_digitalinout_obj_t *self); @@ -56,4 +64,7 @@ digitalio_pull_t common_hal_digitalio_digitalinout_get_pull(digitalio_digitalino void common_hal_digitalio_digitalinout_never_reset(digitalio_digitalinout_obj_t *self); digitalio_digitalinout_obj_t *assert_digitalinout(mp_obj_t obj); +volatile uint32_t *common_hal_digitalio_digitalinout_get_reg(digitalio_digitalinout_obj_t *self, digitalinout_reg_op_t op, uint32_t *mask); +bool common_hal_digitalio_has_reg_op(digitalinout_reg_op_t op); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DIGITALIO_DIGITALINOUT_H diff --git a/shared-bindings/digitalio/Pull.c b/shared-bindings/digitalio/Pull.c index 4db68dda10..364be05de0 100644 --- a/shared-bindings/digitalio/Pull.c +++ b/shared-bindings/digitalio/Pull.c @@ -26,6 +26,7 @@ #include "py/runtime.h" #include "shared-bindings/digitalio/Pull.h" +#include "supervisor/shared/translate/translate.h" //| class Pull: //| """Defines the pull of a digital input pin""" diff --git a/shared-bindings/digitalio/__init__.c b/shared-bindings/digitalio/__init__.c index e3f4e9992d..9a9db69816 100644 --- a/shared-bindings/digitalio/__init__.c +++ b/shared-bindings/digitalio/__init__.c @@ -71,8 +71,14 @@ //| led.value = True //| time.sleep(0.1) //| led.value = False -//| time.sleep(0.1)""" +//| time.sleep(0.1) //| +//| For the essentials of `digitalio`, see the `CircuitPython Essentials +//| Learn guide `_ +//| +//| For more information on using `digitalio`, see `this additional Learn guide +//| `_ +//| """ STATIC const mp_rom_map_elem_t digitalio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_digitalio) }, diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index f8f47d34f4..ef5727261c 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -34,7 +34,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Bitmap: //| """Stores values of a certain size in a 2D array @@ -97,12 +97,8 @@ STATIC mp_obj_t displayio_bitmap_obj_get_width(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(displayio_bitmap_get_width_obj, displayio_bitmap_obj_get_width); -const mp_obj_property_t displayio_bitmap_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_bitmap_get_width_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_bitmap_width_obj, + (mp_obj_t)&displayio_bitmap_get_width_obj); //| height: int //| """Height of the bitmap. (read only)""" @@ -115,12 +111,8 @@ STATIC mp_obj_t displayio_bitmap_obj_get_height(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(displayio_bitmap_get_height_obj, displayio_bitmap_obj_get_height); -const mp_obj_property_t displayio_bitmap_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_bitmap_get_height_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_bitmap_height_obj, + (mp_obj_t)&displayio_bitmap_get_height_obj); //| def __getitem__(self, index: Union[Tuple[int, int], int]) -> int: //| """Returns the value at the given index. The index can either be an x,y tuple or an int equal diff --git a/shared-bindings/displayio/Bitmap.h b/shared-bindings/displayio/Bitmap.h index 458047510a..074f7dfa5c 100644 --- a/shared-bindings/displayio/Bitmap.h +++ b/shared-bindings/displayio/Bitmap.h @@ -33,6 +33,8 @@ extern const mp_obj_type_t displayio_bitmap_type; void common_hal_displayio_bitmap_construct(displayio_bitmap_t *self, uint32_t width, uint32_t height, uint32_t bits_per_value); +void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, uint32_t width, + uint32_t height, uint32_t bits_per_value, uint32_t *data, bool read_only); void common_hal_displayio_bitmap_load_row(displayio_bitmap_t *self, uint16_t y, uint8_t *data, uint16_t len); diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index f2ca006ced..7b33b1ec8f 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -34,7 +34,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class ColorConverter: //| """Converts one color format to another.""" @@ -103,12 +103,9 @@ STATIC mp_obj_t displayio_colorconverter_obj_set_dither(mp_obj_t self_in, mp_obj } MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_set_dither_obj, displayio_colorconverter_obj_set_dither); -const mp_obj_property_t displayio_colorconverter_dither_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_colorconverter_get_dither_obj, - (mp_obj_t)&displayio_colorconverter_set_dither_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_colorconverter_dither_obj, + (mp_obj_t)&displayio_colorconverter_get_dither_obj, + (mp_obj_t)&displayio_colorconverter_set_dither_obj); //| def make_transparent(self, color: int) -> None: //| """Set the transparent color or index for the ColorConverter. This will diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index f7b3305439..b01de20cf8 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| _DisplayBus = Union['FourWire', 'paralleldisplay.ParallelBus', 'I2CDisplay'] //| """:py:class:`FourWire`, :py:class:`paralleldisplay.ParallelBus` or :py:class:`I2CDisplay`""" @@ -54,7 +54,7 @@ //| Most people should not use this class directly. Use a specific display driver instead that will //| contain the initialization sequence at minimum.""" //| -//| def __init__(self, display_bus: _DisplayBus, init_sequence: ReadableBuffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: Optional[int] = None, brightness: float = 1.0, auto_brightness: bool = False, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60, backlight_on_high: bool = True, SH1107_addressing: bool = False) -> None: +//| def __init__(self, display_bus: _DisplayBus, init_sequence: ReadableBuffer, *, width: int, height: int, colstart: int = 0, rowstart: int = 0, rotation: int = 0, color_depth: int = 16, grayscale: bool = False, pixels_in_byte_share_row: bool = True, bytes_per_cell: int = 1, reverse_pixels_in_byte: bool = False, set_column_command: int = 0x2a, set_row_command: int = 0x2b, write_ram_command: int = 0x2c, backlight_pin: Optional[microcontroller.Pin] = None, brightness_command: Optional[int] = None, brightness: float = 1.0, single_byte_bounds: bool = False, data_as_commands: bool = False, auto_refresh: bool = True, native_frames_per_second: int = 60, backlight_on_high: bool = True, SH1107_addressing: bool = False) -> None: //| r"""Create a Display object on the given display bus (`FourWire`, `ParallelBus` or `I2CDisplay`). //| //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a @@ -102,8 +102,7 @@ //| :param int write_ram_command: Command used to write pixels values into the update region. Ignored if data_as_commands is set. //| :param microcontroller.Pin backlight_pin: Pin connected to the display's backlight //| :param int brightness_command: Command to set display brightness. Usually available in OLED controllers. -//| :param float brightness: Initial display brightness. This value is ignored if auto_brightness is True. -//| :param bool auto_brightness: If True, brightness is controlled via an ambient light sensor or other mechanism. +//| :param float brightness: Initial display brightness. //| :param bool single_byte_bounds: Display column and row commands use single bytes //| :param bool data_as_commands: Treat all init and boundary data as SPI commands. Certain displays require this. //| :param bool auto_refresh: Automatically refresh the screen @@ -111,6 +110,7 @@ //| :param bool backlight_on_high: If True, pulling the backlight pin high turns the backlight on. //| :param bool SH1107_addressing: Special quirk for SH1107, use upper/lower column set and page set //| :param int set_vertical_scroll: This parameter is accepted but ignored for backwards compatibility. It will be removed in a future release. +//| :param int backlight_pwm_frequency: The frequency to use to drive the PWM for backlight brightness control. Default is 50000. //| """ //| ... //| @@ -121,9 +121,9 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a ARG_bytes_per_cell, ARG_reverse_pixels_in_byte, ARG_reverse_bytes_in_word, ARG_set_column_command, ARG_set_row_command, ARG_write_ram_command, ARG_set_vertical_scroll, ARG_backlight_pin, ARG_brightness_command, - ARG_brightness, ARG_auto_brightness, ARG_single_byte_bounds, ARG_data_as_commands, + ARG_brightness, ARG_single_byte_bounds, ARG_data_as_commands, ARG_auto_refresh, ARG_native_frames_per_second, ARG_backlight_on_high, - ARG_SH1107_addressing }; + ARG_SH1107_addressing, ARG_backlight_pwm_frequency }; static const mp_arg_t allowed_args[] = { { MP_QSTR_display_bus, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_init_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -145,13 +145,13 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a { MP_QSTR_backlight_pin, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, { MP_QSTR_brightness_command, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = NO_BRIGHTNESS_COMMAND} }, { MP_QSTR_brightness, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NEW_SMALL_INT(1)} }, - { MP_QSTR_auto_brightness, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, { MP_QSTR_single_byte_bounds, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, { MP_QSTR_data_as_commands, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, { MP_QSTR_auto_refresh, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, { MP_QSTR_native_frames_per_second, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 60} }, { MP_QSTR_backlight_on_high, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = true} }, - { MP_QSTR_SH1107_addressing, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} } + { MP_QSTR_SH1107_addressing, MP_ARG_BOOL | MP_ARG_KW_ONLY, {.u_bool = false} }, + { MP_QSTR_backlight_pwm_frequency, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 50000} } }; 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); @@ -170,14 +170,20 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a mp_raise_ValueError(translate("Display rotation must be in 90 degree increments")); } + const bool sh1107_addressing = args[ARG_SH1107_addressing].u_bool; + const mp_int_t color_depth = args[ARG_color_depth].u_int; + if (sh1107_addressing && color_depth != 1) { + mp_raise_ValueError_varg(translate("%q must be 1 when %q is True"), MP_QSTR_color_depth, MP_QSTR_SH1107_addressing); + } + primary_display_t *disp = allocate_display_or_raise(); displayio_display_obj_t *self = &disp->display; - ; + self->base.type = &displayio_display_type; common_hal_displayio_display_construct( self, display_bus, args[ARG_width].u_int, args[ARG_height].u_int, args[ARG_colstart].u_int, args[ARG_rowstart].u_int, rotation, - args[ARG_color_depth].u_int, args[ARG_grayscale].u_bool, + color_depth, args[ARG_grayscale].u_bool, args[ARG_pixels_in_byte_share_row].u_bool, args[ARG_bytes_per_cell].u_bool, args[ARG_reverse_pixels_in_byte].u_bool, @@ -188,13 +194,13 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a MP_OBJ_TO_PTR(backlight_pin), args[ARG_brightness_command].u_int, brightness, - args[ARG_auto_brightness].u_bool, args[ARG_single_byte_bounds].u_bool, args[ARG_data_as_commands].u_bool, args[ARG_auto_refresh].u_bool, args[ARG_native_frames_per_second].u_int, args[ARG_backlight_on_high].u_bool, - args[ARG_SH1107_addressing].u_bool + sh1107_addressing, + args[ARG_backlight_pwm_frequency].u_int ); return self; @@ -297,17 +303,12 @@ STATIC mp_obj_t displayio_display_obj_set_auto_refresh(mp_obj_t self_in, mp_obj_ } MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_set_auto_refresh_obj, displayio_display_obj_set_auto_refresh); -const mp_obj_property_t displayio_display_auto_refresh_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_display_get_auto_refresh_obj, - (mp_obj_t)&displayio_display_set_auto_refresh_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_display_auto_refresh_obj, + (mp_obj_t)&displayio_display_get_auto_refresh_obj, + (mp_obj_t)&displayio_display_set_auto_refresh_obj); //| brightness: float -//| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When -//| `auto_brightness` is True, the value of `brightness` will change automatically. -//| If `brightness` is set, `auto_brightness` will be disabled and will be set to False.""" +//| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness.""" //| STATIC mp_obj_t displayio_display_obj_get_brightness(mp_obj_t self_in) { displayio_display_obj_t *self = native_display(self_in); @@ -321,7 +322,6 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_brightness_obj, displayio_displa STATIC mp_obj_t displayio_display_obj_set_brightness(mp_obj_t self_in, mp_obj_t brightness_obj) { displayio_display_obj_t *self = native_display(self_in); - common_hal_displayio_display_set_auto_brightness(self, false); mp_float_t brightness = mp_obj_get_float(brightness_obj); if (brightness < 0 || brightness > 1.0) { mp_raise_ValueError(translate("Brightness must be 0-1.0")); @@ -334,43 +334,9 @@ STATIC mp_obj_t displayio_display_obj_set_brightness(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_set_brightness_obj, displayio_display_obj_set_brightness); -const mp_obj_property_t displayio_display_brightness_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_display_get_brightness_obj, - (mp_obj_t)&displayio_display_set_brightness_obj, - MP_ROM_NONE}, -}; - -//| auto_brightness: bool -//| """True when the display brightness is adjusted automatically, based on an ambient -//| light sensor or other method. Note that some displays may have this set to True by default, -//| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False -//| if `brightness` is set manually.""" -//| -STATIC mp_obj_t displayio_display_obj_get_auto_brightness(mp_obj_t self_in) { - displayio_display_obj_t *self = native_display(self_in); - return mp_obj_new_bool(common_hal_displayio_display_get_auto_brightness(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_auto_brightness_obj, displayio_display_obj_get_auto_brightness); - -STATIC mp_obj_t displayio_display_obj_set_auto_brightness(mp_obj_t self_in, mp_obj_t auto_brightness) { - displayio_display_obj_t *self = native_display(self_in); - - common_hal_displayio_display_set_auto_brightness(self, mp_obj_is_true(auto_brightness)); - - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_set_auto_brightness_obj, displayio_display_obj_set_auto_brightness); - -const mp_obj_property_t displayio_display_auto_brightness_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_display_get_auto_brightness_obj, - (mp_obj_t)&displayio_display_set_auto_brightness_obj, - MP_ROM_NONE}, -}; - - - +MP_PROPERTY_GETSET(displayio_display_brightness_obj, + (mp_obj_t)&displayio_display_get_brightness_obj, + (mp_obj_t)&displayio_display_set_brightness_obj); //| width: int //| """Gets the width of the board""" @@ -381,12 +347,8 @@ STATIC mp_obj_t displayio_display_obj_get_width(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_width_obj, displayio_display_obj_get_width); -const mp_obj_property_t displayio_display_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_display_get_width_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_display_width_obj, + (mp_obj_t)&displayio_display_get_width_obj); //| height: int //| """Gets the height of the board""" @@ -397,12 +359,8 @@ STATIC mp_obj_t displayio_display_obj_get_height(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_height_obj, displayio_display_obj_get_height); -const mp_obj_property_t displayio_display_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_display_get_height_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_display_height_obj, + (mp_obj_t)&displayio_display_get_height_obj); //| rotation: int //| """The rotation of the display as an int in degrees.""" @@ -420,12 +378,9 @@ STATIC mp_obj_t displayio_display_obj_set_rotation(mp_obj_t self_in, mp_obj_t va MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_set_rotation_obj, displayio_display_obj_set_rotation); -const mp_obj_property_t displayio_display_rotation_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_display_get_rotation_obj, - (mp_obj_t)&displayio_display_set_rotation_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_display_rotation_obj, + (mp_obj_t)&displayio_display_get_rotation_obj, + (mp_obj_t)&displayio_display_set_rotation_obj); //| bus: _DisplayBus //| """The bus being used by the display""" @@ -437,12 +392,8 @@ STATIC mp_obj_t displayio_display_obj_get_bus(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_bus_obj, displayio_display_obj_get_bus); -const mp_obj_property_t displayio_display_bus_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_display_get_bus_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_display_bus_obj, + (mp_obj_t)&displayio_display_get_bus_obj); //| root_group: Group //| """The root group on the display.""" @@ -454,12 +405,8 @@ STATIC mp_obj_t displayio_display_obj_get_root_group(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_root_group_obj, displayio_display_obj_get_root_group); -const mp_obj_property_t displayio_display_root_group_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_display_get_root_group_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_display_root_group_obj, + (mp_obj_t)&displayio_display_get_root_group_obj); //| def fill_row(self, y: int, buffer: WriteableBuffer) -> WriteableBuffer: @@ -528,7 +475,6 @@ STATIC const mp_rom_map_elem_t displayio_display_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_auto_refresh), MP_ROM_PTR(&displayio_display_auto_refresh_obj) }, { MP_ROM_QSTR(MP_QSTR_brightness), MP_ROM_PTR(&displayio_display_brightness_obj) }, - { MP_ROM_QSTR(MP_QSTR_auto_brightness), MP_ROM_PTR(&displayio_display_auto_brightness_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_display_width_obj) }, { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&displayio_display_height_obj) }, diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index f193e61d2f..35ba0d479a 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -42,9 +42,9 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, bool pixels_in_byte_share_row, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word, uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t *init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t *backlight_pin, uint16_t brightness_command, - mp_float_t brightness, bool auto_brightness, + mp_float_t brightness, bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, - bool backlight_on_high, bool SH1107_addressing); + bool backlight_on_high, bool SH1107_addressing, uint16_t backlight_pwm_frequency); bool common_hal_displayio_display_show(displayio_display_obj_t *self, displayio_group_t *root_group); @@ -59,9 +59,6 @@ uint16_t common_hal_displayio_display_get_height(displayio_display_obj_t *self); uint16_t common_hal_displayio_display_get_rotation(displayio_display_obj_t *self); void common_hal_displayio_display_set_rotation(displayio_display_obj_t *self, int rotation); -bool common_hal_displayio_display_get_auto_brightness(displayio_display_obj_t *self); -void common_hal_displayio_display_set_auto_brightness(displayio_display_obj_t *self, bool auto_brightness); - bool common_hal_displayio_display_get_dither(displayio_display_obj_t *self); void common_hal_displayio_display_set_dither(displayio_display_obj_t *self, bool dither); diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index aa14594d97..81863b2a7a 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class EPaperDisplay: //| """Manage updating an epaper display over a display bus @@ -268,12 +268,8 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_get_time_to_refresh(mp_obj_t self_in } MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_time_to_refresh_obj, displayio_epaperdisplay_obj_get_time_to_refresh); -const mp_obj_property_t displayio_epaperdisplay_time_to_refresh_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_epaperdisplay_get_time_to_refresh_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_epaperdisplay_time_to_refresh_obj, + (mp_obj_t)&displayio_epaperdisplay_get_time_to_refresh_obj); //| busy: bool //| """True when the display is refreshing. This uses the ``busy_pin`` when available or the @@ -285,12 +281,8 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_get_busy(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_busy_obj, displayio_epaperdisplay_obj_get_busy); -const mp_obj_property_t displayio_epaperdisplay_busy_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_epaperdisplay_get_busy_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_epaperdisplay_busy_obj, + (mp_obj_t)&displayio_epaperdisplay_get_busy_obj); //| width: int //| """Gets the width of the display in pixels""" @@ -301,12 +293,8 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_get_width(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_width_obj, displayio_epaperdisplay_obj_get_width); -const mp_obj_property_t displayio_epaperdisplay_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_epaperdisplay_get_width_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_epaperdisplay_width_obj, + (mp_obj_t)&displayio_epaperdisplay_get_width_obj); //| height: int //| """Gets the height of the display in pixels""" @@ -317,12 +305,8 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_get_height(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_height_obj, displayio_epaperdisplay_obj_get_height); -const mp_obj_property_t displayio_epaperdisplay_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_epaperdisplay_get_height_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_epaperdisplay_height_obj, + (mp_obj_t)&displayio_epaperdisplay_get_height_obj); //| rotation: int //| """The rotation of the display as an int in degrees.""" @@ -340,12 +324,9 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_set_rotation(mp_obj_t self_in, mp_ob MP_DEFINE_CONST_FUN_OBJ_2(displayio_epaperdisplay_set_rotation_obj, displayio_epaperdisplay_obj_set_rotation); -const mp_obj_property_t displayio_epaperdisplay_rotation_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_epaperdisplay_get_rotation_obj, - (mp_obj_t)&displayio_epaperdisplay_set_rotation_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_epaperdisplay_rotation_obj, + (mp_obj_t)&displayio_epaperdisplay_get_rotation_obj, + (mp_obj_t)&displayio_epaperdisplay_set_rotation_obj); //| bus: _DisplayBus //| """The bus being used by the display""" @@ -356,12 +337,8 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_get_bus(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_epaperdisplay_get_bus_obj, displayio_epaperdisplay_obj_get_bus); -const mp_obj_property_t displayio_epaperdisplay_bus_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_epaperdisplay_get_bus_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_epaperdisplay_bus_obj, + (mp_obj_t)&displayio_epaperdisplay_get_bus_obj); STATIC const mp_rom_map_elem_t displayio_epaperdisplay_locals_dict_table[] = { diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 90aa5c6c17..7e72169230 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -37,7 +37,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class FourWire: //| """Manage updating a display over SPI four wire protocol in the background while Python code runs. @@ -89,14 +89,8 @@ STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_ displayio_fourwire_obj_t *self = &allocate_display_bus_or_raise()->fourwire_bus; self->base.type = &displayio_fourwire_type; - uint8_t polarity = args[ARG_polarity].u_int; - if (polarity != 0 && polarity != 1) { - mp_raise_ValueError(translate("Invalid polarity")); - } - uint8_t phase = args[ARG_phase].u_int; - if (phase != 0 && phase != 1) { - mp_raise_ValueError(translate("Invalid phase")); - } + uint8_t polarity = (uint8_t)mp_arg_validate_int_range(args[ARG_polarity].u_int, 0, 1, MP_QSTR_polarity); + uint8_t phase = (uint8_t)mp_arg_validate_int_range(args[ARG_phase].u_int, 0, 1, MP_QSTR_phase); common_hal_displayio_fourwire_construct(self, MP_OBJ_TO_PTR(spi), command, chip_select, reset, args[ARG_baudrate].u_int, polarity, phase); @@ -133,10 +127,8 @@ STATIC mp_obj_t displayio_fourwire_obj_send(size_t n_args, const mp_obj_t *pos_a mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_int_t command_int = args[ARG_command].u_int; - if (command_int > 255 || command_int < 0) { - mp_raise_ValueError(translate("Command must be an int between 0 and 255")); - } + mp_int_t command_int = mp_arg_validate_int_range(args[ARG_command].u_int, 0, 255, MP_QSTR_command); + displayio_fourwire_obj_t *self = pos_args[0]; uint8_t command = command_int; mp_buffer_info_t bufinfo; diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 33329e5ece..4a57b4a5f1 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -33,7 +33,7 @@ #include "py/objproperty.h" #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Group: //| """Manage a group of sprites and groups and how they are inter-related.""" @@ -57,10 +57,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 = args[ARG_scale].u_int; - if (scale < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_scale); - } + mp_int_t scale = mp_arg_validate_int_min(args[ARG_scale].u_int, 1, MP_QSTR_scale); displayio_group_t *self = m_new_obj(displayio_group_t); self->base.type = &displayio_group_type; @@ -97,12 +94,9 @@ STATIC mp_obj_t displayio_group_obj_set_hidden(mp_obj_t self_in, mp_obj_t hidden } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_set_hidden_obj, displayio_group_obj_set_hidden); -const mp_obj_property_t displayio_group_hidden_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_group_get_hidden_obj, - (mp_obj_t)&displayio_group_set_hidden_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_group_hidden_obj, + (mp_obj_t)&displayio_group_get_hidden_obj, + (mp_obj_t)&displayio_group_set_hidden_obj); //| scale: int //| """Scales each pixel within the Group in both directions. For example, when scale=2 each pixel @@ -117,21 +111,16 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_group_get_scale_obj, displayio_group_obj_get STATIC mp_obj_t displayio_group_obj_set_scale(mp_obj_t self_in, mp_obj_t scale_obj) { displayio_group_t *self = native_group(self_in); - mp_int_t scale = mp_obj_get_int(scale_obj); - if (scale < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_scale); - } + mp_int_t scale = mp_arg_validate_int_min(mp_obj_get_int(scale_obj), 1, MP_QSTR_scale); + common_hal_displayio_group_set_scale(self, scale); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_set_scale_obj, displayio_group_obj_set_scale); -const mp_obj_property_t displayio_group_scale_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_group_get_scale_obj, - (mp_obj_t)&displayio_group_set_scale_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_group_scale_obj, + (mp_obj_t)&displayio_group_get_scale_obj, + (mp_obj_t)&displayio_group_set_scale_obj); //| x: int //| """X position of the Group in the parent.""" @@ -151,12 +140,9 @@ STATIC mp_obj_t displayio_group_obj_set_x(mp_obj_t self_in, mp_obj_t x_obj) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_set_x_obj, displayio_group_obj_set_x); -const mp_obj_property_t displayio_group_x_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_group_get_x_obj, - (mp_obj_t)&displayio_group_set_x_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_group_x_obj, + (mp_obj_t)&displayio_group_get_x_obj, + (mp_obj_t)&displayio_group_set_x_obj); //| y: int //| """Y position of the Group in the parent.""" @@ -176,12 +162,9 @@ STATIC mp_obj_t displayio_group_obj_set_y(mp_obj_t self_in, mp_obj_t y_obj) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_set_y_obj, displayio_group_obj_set_y); -const mp_obj_property_t displayio_group_y_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_group_get_y_obj, - (mp_obj_t)&displayio_group_set_y_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_group_y_obj, + (mp_obj_t)&displayio_group_get_y_obj, + (mp_obj_t)&displayio_group_set_y_obj); //| def append(self, layer: Union[vectorio.Circle, vectorio.Rectangle, vectorio.Polygon, Group, TileGrid]) -> None: //| """Append a layer to the group. It will be drawn above other layers.""" diff --git a/shared-bindings/displayio/I2CDisplay.c b/shared-bindings/displayio/I2CDisplay.c index fbfbd04c64..86138d8a36 100644 --- a/shared-bindings/displayio/I2CDisplay.c +++ b/shared-bindings/displayio/I2CDisplay.c @@ -37,7 +37,7 @@ #include "shared-bindings/busio/I2C.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class I2CDisplay: //| """Manage updating a display over I2C in the background while Python code runs. @@ -98,10 +98,9 @@ MP_DEFINE_CONST_FUN_OBJ_1(displayio_i2cdisplay_reset_obj, displayio_i2cdisplay_o //| ... //| STATIC mp_obj_t displayio_i2cdisplay_obj_send(mp_obj_t self, mp_obj_t command_obj, mp_obj_t data_obj) { - mp_int_t command_int = MP_OBJ_SMALL_INT_VALUE(command_obj); - if (!mp_obj_is_small_int(command_obj) || command_int > 255 || command_int < 0) { - mp_raise_ValueError(translate("Command must be an int between 0 and 255")); - } + mp_int_t command_int = mp_obj_get_int(command_obj); + mp_arg_validate_int_range(command_int, 0, 255, MP_QSTR_command); + uint8_t command = command_int; mp_buffer_info_t bufinfo; mp_get_buffer_raise(data_obj, &bufinfo, MP_BUFFER_READ); diff --git a/shared-bindings/displayio/OnDiskBitmap.c b/shared-bindings/displayio/OnDiskBitmap.c index 0564b48fe8..f71c3cfe82 100644 --- a/shared-bindings/displayio/OnDiskBitmap.c +++ b/shared-bindings/displayio/OnDiskBitmap.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "py/objproperty.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/displayio/OnDiskBitmap.h" //| class OnDiskBitmap: @@ -48,7 +48,6 @@ //| import time //| import pulseio //| -//| board.DISPLAY.auto_brightness = False //| board.DISPLAY.brightness = 0 //| splash = displayio.Group() //| board.DISPLAY.show(splash) @@ -109,13 +108,8 @@ STATIC mp_obj_t displayio_ondiskbitmap_obj_get_width(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(displayio_ondiskbitmap_get_width_obj, displayio_ondiskbitmap_obj_get_width); -const mp_obj_property_t displayio_ondiskbitmap_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_ondiskbitmap_get_width_obj, - MP_ROM_NONE, - MP_ROM_NONE}, - -}; +MP_PROPERTY_GETTER(displayio_ondiskbitmap_width_obj, + (mp_obj_t)&displayio_ondiskbitmap_get_width_obj); //| height: int //| """Height of the bitmap. (read only)""" @@ -128,13 +122,8 @@ STATIC mp_obj_t displayio_ondiskbitmap_obj_get_height(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(displayio_ondiskbitmap_get_height_obj, displayio_ondiskbitmap_obj_get_height); -const mp_obj_property_t displayio_ondiskbitmap_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_ondiskbitmap_get_height_obj, - MP_ROM_NONE, - MP_ROM_NONE}, - -}; +MP_PROPERTY_GETTER(displayio_ondiskbitmap_height_obj, + (mp_obj_t)&displayio_ondiskbitmap_get_height_obj); //| pixel_shader: Union[ColorConverter, Palette] //| """The image's pixel_shader. The type depends on the underlying diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index ad6d7c319a..89460bfc03 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -34,7 +34,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Palette: //| """Map a pixel palette_index to a full color. Colors are transformed to the display's format internally to @@ -160,6 +160,8 @@ STATIC mp_obj_t displayio_palette_obj_make_transparent(mp_obj_t self_in, mp_obj_ if (!mp_obj_get_int_maybe(palette_index_obj, &palette_index)) { mp_raise_ValueError(translate("palette_index should be an int")); } + palette_index = mp_arg_validate_int_range(palette_index, 0, common_hal_displayio_palette_get_len(self) - 1, MP_QSTR_palette_index); + common_hal_displayio_palette_make_transparent(self, palette_index); return mp_const_none; } @@ -175,6 +177,8 @@ STATIC mp_obj_t displayio_palette_obj_make_opaque(mp_obj_t self_in, mp_obj_t pal if (!mp_obj_get_int_maybe(palette_index_obj, &palette_index)) { mp_raise_ValueError(translate("palette_index should be an int")); } + palette_index = mp_arg_validate_int_range(palette_index, 0, common_hal_displayio_palette_get_len(self) - 1, MP_QSTR_palette_index); + common_hal_displayio_palette_make_opaque(self, palette_index); return mp_const_none; } @@ -191,6 +195,8 @@ STATIC mp_obj_t displayio_palette_obj_is_transparent(mp_obj_t self_in, mp_obj_t if (!mp_obj_get_int_maybe(palette_index_obj, &palette_index)) { mp_raise_ValueError(translate("palette_index should be an int")); } + palette_index = mp_arg_validate_int_range(palette_index, 0, common_hal_displayio_palette_get_len(self) - 1, MP_QSTR_palette_index); + return mp_obj_new_bool(common_hal_displayio_palette_is_transparent(self, palette_index)); } MP_DEFINE_CONST_FUN_OBJ_2(displayio_palette_is_transparent_obj, displayio_palette_obj_is_transparent); diff --git a/shared-bindings/displayio/Shape.c b/shared-bindings/displayio/Shape.c index f39e7820a9..30a51dadce 100644 --- a/shared-bindings/displayio/Shape.c +++ b/shared-bindings/displayio/Shape.c @@ -32,7 +32,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Shape: //| """Represents a shape made by defining boundaries that may be mirrored.""" @@ -58,14 +58,8 @@ STATIC mp_obj_t displayio_shape_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 width = args[ARG_width].u_int; - if (width < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_width); - } - mp_int_t height = args[ARG_height].u_int; - if (height < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_height); - } + mp_int_t width = mp_arg_validate_int_min(args[ARG_width].u_int, 1, MP_QSTR_width); + mp_int_t height = mp_arg_validate_int_min(args[ARG_height].u_int, 1, MP_QSTR_height); displayio_shape_t *self = m_new_obj(displayio_shape_t); self->base.type = &displayio_shape_type; diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index 4cecd0f0f1..d84ff5f20f 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -38,7 +38,7 @@ #include "shared-bindings/displayio/OnDiskBitmap.h" #include "shared-bindings/displayio/Palette.h" #include "shared-bindings/displayio/Shape.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class TileGrid: //| """A grid of tiles sourced out of one bitmap @@ -53,6 +53,8 @@ //| convert the value and its location to a display native pixel color. This may be a simple color //| palette lookup, a gradient, a pattern or a color transformer. //| +//| To save RAM usage, tile values are only allowed in the range from 0 to 255 inclusive (single byte values). +//| //| tile_width and tile_height match the height of the bitmap by default. //| //| :param Bitmap,OnDiskBitmap,Shape bitmap: The bitmap storing one or more tiles. @@ -141,6 +143,7 @@ static displayio_tilegrid_t *native_tilegrid(mp_obj_t tilegrid_obj) { mp_obj_assert_native_inited(native_tilegrid); return MP_OBJ_TO_PTR(native_tilegrid); } + //| hidden: bool //| """True when the TileGrid is hidden. This may be False even when a part of a hidden Group.""" //| @@ -158,12 +161,9 @@ STATIC mp_obj_t displayio_tilegrid_obj_set_hidden(mp_obj_t self_in, mp_obj_t hid } MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_set_hidden_obj, displayio_tilegrid_obj_set_hidden); -const mp_obj_property_t displayio_tilegrid_hidden_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_hidden_obj, - (mp_obj_t)&displayio_tilegrid_set_hidden_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_tilegrid_hidden_obj, + (mp_obj_t)&displayio_tilegrid_get_hidden_obj, + (mp_obj_t)&displayio_tilegrid_set_hidden_obj); //| x: int //| """X position of the left edge in the parent.""" @@ -183,12 +183,9 @@ STATIC mp_obj_t displayio_tilegrid_obj_set_x(mp_obj_t self_in, mp_obj_t x_obj) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_set_x_obj, displayio_tilegrid_obj_set_x); -const mp_obj_property_t displayio_tilegrid_x_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_x_obj, - (mp_obj_t)&displayio_tilegrid_set_x_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_tilegrid_x_obj, + (mp_obj_t)&displayio_tilegrid_get_x_obj, + (mp_obj_t)&displayio_tilegrid_set_x_obj); //| y: int //| """Y position of the top edge in the parent.""" @@ -208,12 +205,9 @@ STATIC mp_obj_t displayio_tilegrid_obj_set_y(mp_obj_t self_in, mp_obj_t y_obj) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_set_y_obj, displayio_tilegrid_obj_set_y); -const mp_obj_property_t displayio_tilegrid_y_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_y_obj, - (mp_obj_t)&displayio_tilegrid_set_y_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_tilegrid_y_obj, + (mp_obj_t)&displayio_tilegrid_get_y_obj, + (mp_obj_t)&displayio_tilegrid_set_y_obj); //| width: int //| """Width of the tilegrid in tiles.""" @@ -224,11 +218,8 @@ STATIC mp_obj_t displayio_tilegrid_obj_get_width(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_width_obj, displayio_tilegrid_obj_get_width); -const mp_obj_property_t displayio_tilegrid_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_width_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_tilegrid_width_obj, + (mp_obj_t)&displayio_tilegrid_get_width_obj); //| height: int //| """Height of the tilegrid in tiles.""" @@ -239,11 +230,8 @@ STATIC mp_obj_t displayio_tilegrid_obj_get_height(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_height_obj, displayio_tilegrid_obj_get_height); -const mp_obj_property_t displayio_tilegrid_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_height_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_tilegrid_height_obj, + (mp_obj_t)&displayio_tilegrid_get_height_obj); //| tile_width: int //| """Width of a single tile in pixels.""" @@ -254,11 +242,8 @@ STATIC mp_obj_t displayio_tilegrid_obj_get_tile_width(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_tile_width_obj, displayio_tilegrid_obj_get_tile_width); -const mp_obj_property_t displayio_tilegrid_tile_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_tile_width_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_tilegrid_tile_width_obj, + (mp_obj_t)&displayio_tilegrid_get_tile_width_obj); //| tile_height: int //| """Height of a single tile in pixels.""" @@ -269,11 +254,8 @@ STATIC mp_obj_t displayio_tilegrid_obj_get_tile_height(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_tile_height_obj, displayio_tilegrid_obj_get_tile_height); -const mp_obj_property_t displayio_tilegrid_tile_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_tile_height_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(displayio_tilegrid_tile_height_obj, + (mp_obj_t)&displayio_tilegrid_get_tile_height_obj); //| flip_x: bool //| """If true, the left edge rendered will be the right edge of the right-most tile.""" @@ -292,12 +274,9 @@ STATIC mp_obj_t displayio_tilegrid_obj_set_flip_x(mp_obj_t self_in, mp_obj_t fli } MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_set_flip_x_obj, displayio_tilegrid_obj_set_flip_x); -const mp_obj_property_t displayio_tilegrid_flip_x_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_flip_x_obj, - (mp_obj_t)&displayio_tilegrid_set_flip_x_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_tilegrid_flip_x_obj, + (mp_obj_t)&displayio_tilegrid_get_flip_x_obj, + (mp_obj_t)&displayio_tilegrid_set_flip_x_obj); //| flip_y: bool //| """If true, the top edge rendered will be the bottom edge of the bottom-most tile.""" @@ -316,12 +295,9 @@ STATIC mp_obj_t displayio_tilegrid_obj_set_flip_y(mp_obj_t self_in, mp_obj_t fli } MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_set_flip_y_obj, displayio_tilegrid_obj_set_flip_y); -const mp_obj_property_t displayio_tilegrid_flip_y_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_flip_y_obj, - (mp_obj_t)&displayio_tilegrid_set_flip_y_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_tilegrid_flip_y_obj, + (mp_obj_t)&displayio_tilegrid_get_flip_y_obj, + (mp_obj_t)&displayio_tilegrid_set_flip_y_obj); //| transpose_xy: bool @@ -342,12 +318,27 @@ STATIC mp_obj_t displayio_tilegrid_obj_set_transpose_xy(mp_obj_t self_in, mp_obj } MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_set_transpose_xy_obj, displayio_tilegrid_obj_set_transpose_xy); -const mp_obj_property_t displayio_tilegrid_transpose_xy_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_transpose_xy_obj, - (mp_obj_t)&displayio_tilegrid_set_transpose_xy_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_tilegrid_transpose_xy_obj, + (mp_obj_t)&displayio_tilegrid_get_transpose_xy_obj, + (mp_obj_t)&displayio_tilegrid_set_transpose_xy_obj); + +//| def contains(self, touch_tuple: tuple) -> bool: +//| """Returns True if the first two values in ``touch_tuple`` represent an x,y coordinate +//| inside the tilegrid rectangle bounds.""" +//| +STATIC mp_obj_t displayio_tilegrid_obj_contains(mp_obj_t self_in, mp_obj_t touch_tuple) { + displayio_tilegrid_t *self = MP_OBJ_TO_PTR(self_in); + + mp_obj_t *touch_tuple_items; + mp_obj_get_array_fixed_n(touch_tuple, 3, &touch_tuple_items); + uint16_t x = 0; + uint16_t y = 0; + x = mp_obj_get_int(touch_tuple_items[0]); + y = mp_obj_get_int(touch_tuple_items[1]); + + return mp_obj_new_bool(common_hal_displayio_tilegrid_contains(self, x, y)); +} +MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_contains_obj, displayio_tilegrid_obj_contains); //| pixel_shader: Union[ColorConverter, Palette] //| """The pixel shader of the tilegrid.""" @@ -370,12 +361,72 @@ STATIC mp_obj_t displayio_tilegrid_obj_set_pixel_shader(mp_obj_t self_in, mp_obj } MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_set_pixel_shader_obj, displayio_tilegrid_obj_set_pixel_shader); -const mp_obj_property_t displayio_tilegrid_pixel_shader_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&displayio_tilegrid_get_pixel_shader_obj, - (mp_obj_t)&displayio_tilegrid_set_pixel_shader_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(displayio_tilegrid_pixel_shader_obj, + (mp_obj_t)&displayio_tilegrid_get_pixel_shader_obj, + (mp_obj_t)&displayio_tilegrid_set_pixel_shader_obj); + +//| bitmap: Union[Bitmap,OnDiskBitmap,Shape] +//| """The bitmap of the tilegrid.""" +//| +STATIC mp_obj_t displayio_tilegrid_obj_get_bitmap(mp_obj_t self_in) { + displayio_tilegrid_t *self = native_tilegrid(self_in); + return common_hal_displayio_tilegrid_get_bitmap(self); +} +MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_bitmap_obj, displayio_tilegrid_obj_get_bitmap); + +STATIC mp_obj_t displayio_tilegrid_obj_set_bitmap(mp_obj_t self_in, mp_obj_t bitmap) { + displayio_tilegrid_t *self = native_tilegrid(self_in); + + uint16_t new_bitmap_width; + uint16_t new_bitmap_height; + mp_obj_t native = mp_obj_cast_to_native_base(bitmap, &displayio_shape_type); + if (native != MP_OBJ_NULL) { + displayio_shape_t *bmp = MP_OBJ_TO_PTR(native); + new_bitmap_width = bmp->width; + new_bitmap_height = bmp->height; + } else if (mp_obj_is_type(bitmap, &displayio_bitmap_type)) { + displayio_bitmap_t *bmp = MP_OBJ_TO_PTR(bitmap); + native = bitmap; + new_bitmap_width = bmp->width; + new_bitmap_height = bmp->height; + } else if (mp_obj_is_type(bitmap, &displayio_ondiskbitmap_type)) { + displayio_ondiskbitmap_t *bmp = MP_OBJ_TO_PTR(bitmap); + native = bitmap; + new_bitmap_width = bmp->width; + new_bitmap_height = bmp->height; + } else { + mp_raise_TypeError_varg(translate("unsupported %q type"), MP_QSTR_bitmap); + } + + mp_obj_t old_native = mp_obj_cast_to_native_base(self->bitmap, &displayio_shape_type); + if (old_native != MP_OBJ_NULL) { + displayio_shape_t *old_bmp = MP_OBJ_TO_PTR(old_native); + if (old_bmp->width != new_bitmap_width || old_bmp->height != new_bitmap_height) { + mp_raise_ValueError(translate("New bitmap must be same size as old bitmap")); + } + } else if (mp_obj_is_type(self->bitmap, &displayio_bitmap_type)) { + displayio_bitmap_t *old_bmp = MP_OBJ_TO_PTR(self->bitmap); + old_native = self->bitmap; + if (old_bmp->width != new_bitmap_width || old_bmp->height != new_bitmap_height) { + mp_raise_ValueError(translate("New bitmap must be same size as old bitmap")); + } + } else if (mp_obj_is_type(self->bitmap, &displayio_ondiskbitmap_type)) { + displayio_ondiskbitmap_t *old_bmp = MP_OBJ_TO_PTR(self->bitmap); + old_native = self->bitmap; + if (old_bmp->width != new_bitmap_width || old_bmp->height != new_bitmap_height) { + mp_raise_ValueError(translate("New bitmap must be same size as old bitmap")); + } + } + + common_hal_displayio_tilegrid_set_bitmap(self, bitmap); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_set_bitmap_obj, displayio_tilegrid_obj_set_bitmap); + +MP_PROPERTY_GETSET(displayio_tilegrid_bitmap_obj, + (mp_obj_t)&displayio_tilegrid_get_bitmap_obj, + (mp_obj_t)&displayio_tilegrid_set_bitmap_obj); //| def __getitem__(self, index: Union[Tuple[int, int], int]) -> int: //| """Returns the tile index at the given index. The index can either be an x,y tuple or an int equal @@ -431,9 +482,8 @@ STATIC mp_obj_t tilegrid_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t v return MP_OBJ_NULL; // op not supported } else { mp_int_t value = mp_obj_get_int(value_obj); - if (value < 0 || value > 255) { - mp_raise_ValueError(translate("Tile value out of bounds")); - } + mp_arg_validate_int_range(value, 0, 255, MP_QSTR_tile); + common_hal_displayio_tilegrid_set_tile(self, x, y, value); } } @@ -452,7 +502,9 @@ STATIC const mp_rom_map_elem_t displayio_tilegrid_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_flip_x), MP_ROM_PTR(&displayio_tilegrid_flip_x_obj) }, { MP_ROM_QSTR(MP_QSTR_flip_y), MP_ROM_PTR(&displayio_tilegrid_flip_y_obj) }, { MP_ROM_QSTR(MP_QSTR_transpose_xy), MP_ROM_PTR(&displayio_tilegrid_transpose_xy_obj) }, - { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&displayio_tilegrid_pixel_shader_obj) }, + { MP_ROM_QSTR(MP_QSTR_contains), MP_ROM_PTR(&displayio_tilegrid_contains_obj) }, + { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&displayio_tilegrid_pixel_shader_obj) }, + { MP_ROM_QSTR(MP_QSTR_bitmap), MP_ROM_PTR(&displayio_tilegrid_bitmap_obj) }, }; STATIC MP_DEFINE_CONST_DICT(displayio_tilegrid_locals_dict, displayio_tilegrid_locals_dict_table); diff --git a/shared-bindings/displayio/TileGrid.h b/shared-bindings/displayio/TileGrid.h index 2cf0be501c..fb56ba6101 100644 --- a/shared-bindings/displayio/TileGrid.h +++ b/shared-bindings/displayio/TileGrid.h @@ -45,6 +45,9 @@ void common_hal_displayio_tilegrid_set_y(displayio_tilegrid_t *self, mp_int_t y) mp_obj_t common_hal_displayio_tilegrid_get_pixel_shader(displayio_tilegrid_t *self); void common_hal_displayio_tilegrid_set_pixel_shader(displayio_tilegrid_t *self, mp_obj_t pixel_shader); +mp_obj_t common_hal_displayio_tilegrid_get_bitmap(displayio_tilegrid_t *self); +void common_hal_displayio_tilegrid_set_bitmap(displayio_tilegrid_t *self, mp_obj_t bitmap); + bool common_hal_displayio_tilegrid_get_flip_x(displayio_tilegrid_t *self); void common_hal_displayio_tilegrid_set_flip_x(displayio_tilegrid_t *self, bool flip_x); @@ -53,6 +56,8 @@ void common_hal_displayio_tilegrid_set_flip_y(displayio_tilegrid_t *self, bool f bool common_hal_displayio_tilegrid_get_transpose_xy(displayio_tilegrid_t *self); void common_hal_displayio_tilegrid_set_transpose_xy(displayio_tilegrid_t *self, bool transpose_xy); +bool common_hal_displayio_tilegrid_contains(displayio_tilegrid_t *self, uint16_t x, uint16_t y); + uint16_t common_hal_displayio_tilegrid_get_width(displayio_tilegrid_t *self); uint16_t common_hal_displayio_tilegrid_get_height(displayio_tilegrid_t *self); @@ -64,5 +69,6 @@ void common_hal_displayio_tilegrid_set_tile(displayio_tilegrid_t *self, uint16_t // Private API for scrolling the TileGrid. void common_hal_displayio_tilegrid_set_top_left(displayio_tilegrid_t *self, uint16_t x, uint16_t y); +void common_hal_displayio_tilegrid_set_all_tiles(displayio_tilegrid_t *self, uint8_t tile_index); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_TILEGRID_H diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index 5588dc83e9..2e52f12e84 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -49,7 +49,12 @@ //| """Native helpers for driving displays //| //| The `displayio` module contains classes to manage display output -//| including synchronizing with refresh rates and partial updating.""" +//| including synchronizing with refresh rates and partial updating. +//| +//| For more a more thorough explanation and guide for using `displayio`, please +//| refer to `this Learn guide +//| `_. +//| """ //| //| import paralleldisplay diff --git a/shared-bindings/dotenv/__init__.c b/shared-bindings/dotenv/__init__.c new file mode 100644 index 0000000000..89f6fe6792 --- /dev/null +++ b/shared-bindings/dotenv/__init__.c @@ -0,0 +1,105 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 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 + +#include "extmod/vfs.h" +#include "lib/oofatfs/ff.h" +#include "lib/oofatfs/diskio.h" +#include "py/mpstate.h" +#include "py/obj.h" +#include "py/objstr.h" +#include "py/runtime.h" +#include "shared-bindings/dotenv/__init__.h" + +//| """Functions to manage environment variables from a .env file. +//| +//| A subset of the CPython `dotenv library `_. It does +//| not support variables or double quotes. +//| +//| The simplest way to define keys and values is to put them in single quotes. \ and ' are +//| escaped by \ in single quotes. Newlines can occur in quotes for multiline values. Comments +//| start with # and apply for the rest of the line. +//| +//| File format example: +//| +//| .. code-block:: +//| +//| key=value +//| key2 = value2 +//| 'key3' = 'value with spaces' +//| # comment +//| key4 = value3 # comment 2 +//| 'key5'=value4 +//| key=value5 # overrides the first one +//| multiline = 'hello +//| world +//| how are you?' +//| +//| """ +//| +//| import typing + +//| def get_key(dotenv_path: str, key_to_get: str) -> Optional[str]: +//| """Get the value for the given key from the given .env file. If the key occurs multiple +//| times in the file, then the last value will be returned. +//| +//| Returns None if the key isn't found or doesn't have a value.""" +//| ... +//| +STATIC mp_obj_t _dotenv_get_key(mp_obj_t path_in, mp_obj_t key_to_get_in) { + return common_hal_dotenv_get_key(mp_obj_str_get_str(path_in), + mp_obj_str_get_str(key_to_get_in)); +} +MP_DEFINE_CONST_FUN_OBJ_2(dotenv_get_key_obj, _dotenv_get_key); + +//| def load_dotenv() -> None: +//| """Does nothing in CircuitPython because os.getenv will automatically read .env when +//| available. +//| +//| Present in CircuitPython so CPython-compatible code can use it without error.""" +//| ... +//| +STATIC mp_obj_t dotenv_load_dotenv(void) { + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_0(dotenv_load_dotenv_obj, dotenv_load_dotenv); + +STATIC const mp_rom_map_elem_t dotenv_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_dotenv) }, + + { MP_ROM_QSTR(MP_QSTR_get_key), MP_ROM_PTR(&dotenv_get_key_obj) }, + { MP_ROM_QSTR(MP_QSTR_load_dotenv), MP_ROM_PTR(&dotenv_load_dotenv_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(dotenv_module_globals, dotenv_module_globals_table); + +const mp_obj_module_t dotenv_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&dotenv_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_dotenv, dotenv_module, CIRCUITPY_DOTENV); diff --git a/shared-bindings/dotenv/__init__.h b/shared-bindings/dotenv/__init__.h new file mode 100644 index 0000000000..18a6c280dd --- /dev/null +++ b/shared-bindings/dotenv/__init__.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DOTENV___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_DOTENV___INIT___H + +#include +#include + +#include "py/objtuple.h" + +#include "shared-module/dotenv/__init__.h" + +mp_obj_t common_hal_dotenv_get_key(const char *path, const char *key); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DOTENV___INIT___H diff --git a/shared-bindings/dualbank/__init__.c b/shared-bindings/dualbank/__init__.c index f907c91e0e..fa4c2af691 100644 --- a/shared-bindings/dualbank/__init__.c +++ b/shared-bindings/dualbank/__init__.c @@ -56,7 +56,7 @@ //| ... //| -//| def flash(*buffer: ReadableBuffer, offset: int=0) -> None: +//| def flash(buffer: ReadableBuffer, offset: int=0) -> None: //| """Writes one of two app partitions at the given offset. //| //| This can be called multiple times when flashing the firmware diff --git a/shared-bindings/floppyio/__init__.c b/shared-bindings/floppyio/__init__.c new file mode 100644 index 0000000000..a6b041c4a0 --- /dev/null +++ b/shared-bindings/floppyio/__init__.c @@ -0,0 +1,127 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "shared-bindings/floppyio/__init__.h" +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "common-hal/floppyio/__init__.h" + +#include + +#include "py/binary.h" +#include "py/obj.h" +#include "py/runtime.h" + +//| def flux_readinto(buffer: WriteableBuffer, data: digitalio.DigitalInOut, index: digitalio.DigitalInOut) -> int: +//| """Read flux transition information into the buffer. +//| +//| The function returns when the buffer has filled, or when the index input +//| indicates that one full revolution of data has been recorded. Due to +//| technical limitations, this process may not be interruptible by +//| KeyboardInterrupt. +//| +//| :param buffer: Read data into this buffer. Each element represents the time between successive zero-to-one transitions. +//| :param data: Pin on which the flux data appears +//| :param index: Pin on which the index pulse appears +//| :return: The actual number of bytes of read +//| """ +//| ... +//| +STATIC mp_obj_t floppyio_flux_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_buffer, ARG_data, ARG_index }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_index, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[ARG_buffer].u_obj, &bufinfo, MP_BUFFER_WRITE); + digitalio_digitalinout_obj_t *data = assert_digitalinout(args[ARG_data].u_obj); + digitalio_digitalinout_obj_t *index = assert_digitalinout(args[ARG_index].u_obj); + + return MP_OBJ_NEW_SMALL_INT(common_hal_floppyio_flux_readinto(bufinfo.buf, bufinfo.len, data, index)); +} +MP_DEFINE_CONST_FUN_OBJ_KW(floppyio_flux_readinto_obj, 0, floppyio_flux_readinto); + +//| def mfm_readinto(buffer: WriteableBuffer, data: digitalio.DigitalInOut, index: digitalio.DigitalInOut) -> int: +//| """Read mfm blocks into the buffer. +//| +//| The track is assumed to consist of 512-byte sectors. +//| +//| The function returns when all sectors have been successfully read, or +//| a number of index pulses have occurred. Due to technical limitations, this +//| process may not be interruptible by KeyboardInterrupt. +//| +//| :param buffer: Read data into this buffer. Must be a multiple of 512. +//| :param data: Pin on which the mfm data appears +//| :param index: Pin on which the index pulse appears +//| :return: The actual number of sectors read +//| """ +//| ... +//| +STATIC mp_obj_t floppyio_mfm_readinto(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_buffer, ARG_data, ARG_index }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_buffer, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_index, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(args[ARG_buffer].u_obj, &bufinfo, MP_BUFFER_WRITE); + digitalio_digitalinout_obj_t *data = assert_digitalinout(args[ARG_data].u_obj); + digitalio_digitalinout_obj_t *index = assert_digitalinout(args[ARG_index].u_obj); + + if (bufinfo.len % 512 != 0) { + mp_raise_ValueError(translate("Buffer must be a multiple of 512 bytes")); + } + size_t n_sectors = bufinfo.len / 512; + return MP_OBJ_NEW_SMALL_INT(common_hal_floppyio_mfm_readinto(bufinfo.buf, n_sectors, data, index)); +} +MP_DEFINE_CONST_FUN_OBJ_KW(floppyio_mfm_readinto_obj, 0, floppyio_mfm_readinto); + +//| samplerate: int +//| """The approximate sample rate in Hz used by flux_readinto.""" +//| + +STATIC const mp_rom_map_elem_t floppyio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_floppyio) }, + { MP_ROM_QSTR(MP_QSTR_flux_readinto), MP_ROM_PTR(&floppyio_flux_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_mfm_readinto), MP_ROM_PTR(&floppyio_mfm_readinto_obj) }, + { MP_ROM_QSTR(MP_QSTR_samplerate), MP_ROM_INT(FLOPPYIO_SAMPLERATE) }, +}; +STATIC MP_DEFINE_CONST_DICT(floppyio_module_globals, floppyio_module_globals_table); + +const mp_obj_module_t floppyio_module = { + .base = {&mp_type_module }, + .globals = (mp_obj_dict_t *)&floppyio_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_floppyio, floppyio_module, CIRCUITPY_FLOPPYIO); diff --git a/ports/espressif/modules/wroom.c b/shared-bindings/floppyio/__init__.h similarity index 73% rename from ports/espressif/modules/wroom.c rename to shared-bindings/floppyio/__init__.h index 5e530701bf..322bbe7d43 100644 --- a/ports/espressif/modules/wroom.c +++ b/shared-bindings/floppyio/__init__.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2022 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 @@ -24,14 +24,9 @@ * THE SOFTWARE. */ -#include "modules/module.h" +#pragma once -void never_reset_module_internal_pins(void) { - // SPI Flash - common_hal_never_reset_pin(&pin_GPIO27); - common_hal_never_reset_pin(&pin_GPIO28); - common_hal_never_reset_pin(&pin_GPIO29); - common_hal_never_reset_pin(&pin_GPIO30); - common_hal_never_reset_pin(&pin_GPIO31); - common_hal_never_reset_pin(&pin_GPIO32); -} +#include "common-hal/digitalio/DigitalInOut.h" + +int common_hal_floppyio_flux_readinto(void *buf, size_t len, digitalio_digitalinout_obj_t *data, digitalio_digitalinout_obj_t *index); +int common_hal_floppyio_mfm_readinto(void *buf, size_t n_sector, digitalio_digitalinout_obj_t *data, digitalio_digitalinout_obj_t *index); diff --git a/shared-bindings/fontio/BuiltinFont.c b/shared-bindings/fontio/BuiltinFont.c index fcbde4e80d..02d3373797 100644 --- a/shared-bindings/fontio/BuiltinFont.c +++ b/shared-bindings/fontio/BuiltinFont.c @@ -34,7 +34,7 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| from typing_extensions import Protocol # for compat with python < 3.8 //| @@ -76,12 +76,8 @@ STATIC mp_obj_t fontio_builtinfont_obj_get_bitmap(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bitmap_obj, fontio_builtinfont_obj_get_bitmap); -const mp_obj_property_t fontio_builtinfont_bitmap_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&fontio_builtinfont_get_bitmap_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(fontio_builtinfont_bitmap_obj, + (mp_obj_t)&fontio_builtinfont_get_bitmap_obj); //| def get_bounding_box(self) -> Tuple[int, int]: //| """Returns the maximum bounds of all glyphs in the font in a tuple of two values: width, height.""" @@ -102,10 +98,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(fontio_builtinfont_get_bounding_box_obj, fontio_builti STATIC mp_obj_t fontio_builtinfont_obj_get_glyph(mp_obj_t self_in, mp_obj_t codepoint_obj) { fontio_builtinfont_t *self = MP_OBJ_TO_PTR(self_in); - mp_int_t codepoint; - if (!mp_obj_get_int_maybe(codepoint_obj, &codepoint)) { - mp_raise_ValueError_varg(translate("%q should be an int"), MP_QSTR_codepoint); - } + mp_int_t codepoint = mp_arg_validate_type_int(codepoint_obj, MP_QSTR_codepoint); return common_hal_fontio_builtinfont_get_glyph(self, codepoint); } MP_DEFINE_CONST_FUN_OBJ_2(fontio_builtinfont_get_glyph_obj, fontio_builtinfont_obj_get_glyph); diff --git a/shared-bindings/fontio/__init__.c b/shared-bindings/fontio/__init__.c index fc5c011eb3..d4048dbeff 100644 --- a/shared-bindings/fontio/__init__.c +++ b/shared-bindings/fontio/__init__.c @@ -33,7 +33,15 @@ #include "shared-bindings/fontio/BuiltinFont.h" #include "shared-bindings/fontio/Glyph.h" -//| """Core font related data structures""" +//| """Core font related data structures +//| +//| .. note:: This module is intended only for low-level usage. For working with +//| fonts in CircuitPython see the `adafruit_bitmap_font library +//| `_. +//| For information on creating custom fonts for use in CircuitPython, see +//| `this Learn guide `_ +//| +//| """ //| STATIC const mp_rom_map_elem_t fontio_module_globals_table[] = { @@ -49,4 +57,4 @@ const mp_obj_module_t fontio_module = { .globals = (mp_obj_dict_t *)&fontio_module_globals, }; -MP_REGISTER_MODULE(MP_QSTR_fontio, fontio_module, CIRCUITPY_DISPLAYIO && CIRCUITPY_TERMINALIO); +MP_REGISTER_MODULE(MP_QSTR_fontio, fontio_module, CIRCUITPY_FONTIO); diff --git a/shared-bindings/framebufferio/FramebufferDisplay.c b/shared-bindings/framebufferio/FramebufferDisplay.c index acc50d7561..00adef62a6 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.c +++ b/shared-bindings/framebufferio/FramebufferDisplay.c @@ -38,7 +38,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class FramebufferDisplay: //| """Manage updating a display with framebuffer in RAM @@ -168,17 +168,12 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_auto_refresh(mp_obj_t s } MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_set_auto_refresh_obj, framebufferio_framebufferdisplay_obj_set_auto_refresh); -const mp_obj_property_t framebufferio_framebufferdisplay_auto_refresh_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_auto_refresh_obj, - (mp_obj_t)&framebufferio_framebufferdisplay_set_auto_refresh_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(framebufferio_framebufferdisplay_auto_refresh_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_get_auto_refresh_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_set_auto_refresh_obj); //| brightness: float -//| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness. When -//| `auto_brightness` is True, the value of `brightness` will change automatically. -//| If `brightness` is set, `auto_brightness` will be disabled and will be set to False.""" +//| """The brightness of the display as a float. 0.0 is off and 1.0 is full brightness.""" //| STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_brightness(mp_obj_t self_in) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); @@ -192,7 +187,6 @@ MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_brightness_obj, f STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_brightness(mp_obj_t self_in, mp_obj_t brightness_obj) { framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); - common_hal_framebufferio_framebufferdisplay_set_auto_brightness(self, false); mp_float_t brightness = mp_obj_get_float(brightness_obj); if (brightness < 0.0f || brightness > 1.0f) { mp_raise_ValueError(translate("Brightness must be 0-1.0")); @@ -205,43 +199,9 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_brightness(mp_obj_t sel } MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_set_brightness_obj, framebufferio_framebufferdisplay_obj_set_brightness); -const mp_obj_property_t framebufferio_framebufferdisplay_brightness_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_brightness_obj, - (mp_obj_t)&framebufferio_framebufferdisplay_set_brightness_obj, - MP_ROM_NONE}, -}; - -//| auto_brightness: bool -//| """True when the display brightness is adjusted automatically, based on an ambient -//| light sensor or other method. Note that some displays may have this set to True by default, -//| but not actually implement automatic brightness adjustment. `auto_brightness` is set to False -//| if `brightness` is set manually.""" -//| -STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_auto_brightness(mp_obj_t self_in) { - framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); - return mp_obj_new_bool(common_hal_framebufferio_framebufferdisplay_get_auto_brightness(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_auto_brightness_obj, framebufferio_framebufferdisplay_obj_get_auto_brightness); - -STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_auto_brightness(mp_obj_t self_in, mp_obj_t auto_brightness) { - framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); - - bool ok = common_hal_framebufferio_framebufferdisplay_set_auto_brightness(self, mp_obj_is_true(auto_brightness)); - if (!ok) { - mp_raise_RuntimeError(translate("Brightness not adjustable")); - } - - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_set_auto_brightness_obj, framebufferio_framebufferdisplay_obj_set_auto_brightness); - -const mp_obj_property_t framebufferio_framebufferdisplay_auto_brightness_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_auto_brightness_obj, - (mp_obj_t)&framebufferio_framebufferdisplay_set_auto_brightness_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(framebufferio_framebufferdisplay_brightness_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_get_brightness_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_set_brightness_obj); //| width: int //| """Gets the width of the framebuffer""" @@ -252,12 +212,8 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_width(mp_obj_t self_in) } MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_width_obj, framebufferio_framebufferdisplay_obj_get_width); -const mp_obj_property_t framebufferio_framebufferdisplay_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_width_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(framebufferio_framebufferdisplay_width_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_get_width_obj); //| height: int //| """Gets the height of the framebuffer""" @@ -268,12 +224,8 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_height(mp_obj_t self_in } MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_height_obj, framebufferio_framebufferdisplay_obj_get_height); -const mp_obj_property_t framebufferio_framebufferdisplay_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_height_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(framebufferio_framebufferdisplay_height_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_get_height_obj); //| rotation: int //| """The rotation of the display as an int in degrees.""" @@ -291,12 +243,9 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_set_rotation(mp_obj_t self_ MP_DEFINE_CONST_FUN_OBJ_2(framebufferio_framebufferdisplay_set_rotation_obj, framebufferio_framebufferdisplay_obj_set_rotation); -const mp_obj_property_t framebufferio_framebufferdisplay_rotation_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_rotation_obj, - (mp_obj_t)&framebufferio_framebufferdisplay_set_rotation_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(framebufferio_framebufferdisplay_rotation_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_get_rotation_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_set_rotation_obj); //| framebuffer: circuitpython_typing.FrameBuffer //| """The framebuffer being used by the display""" @@ -308,12 +257,8 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_framebuffer(mp_obj_t se } MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_framebuffer_obj, framebufferio_framebufferdisplay_obj_get_framebuffer); -const mp_obj_property_t framebufferio_framebufferframebuffer_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&framebufferio_framebufferdisplay_get_framebuffer_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(framebufferio_framebufferframebuffer_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_get_framebuffer_obj); //| def fill_row(self, y: int, buffer: WriteableBuffer) -> WriteableBuffer: @@ -377,6 +322,19 @@ STATIC mp_obj_t framebufferio_framebufferdisplay_obj_fill_row(size_t n_args, con } MP_DEFINE_CONST_FUN_OBJ_KW(framebufferio_framebufferdisplay_fill_row_obj, 1, framebufferio_framebufferdisplay_obj_fill_row); +//| root_group: displayio.Group +//| """The root group on the display.""" +//| +//| +STATIC mp_obj_t framebufferio_framebufferdisplay_obj_get_root_group(mp_obj_t self_in) { + framebufferio_framebufferdisplay_obj_t *self = native_display(self_in); + return common_hal_framebufferio_framebufferdisplay_get_root_group(self); +} +MP_DEFINE_CONST_FUN_OBJ_1(framebufferio_framebufferdisplay_get_root_group_obj, framebufferio_framebufferdisplay_obj_get_root_group); + +MP_PROPERTY_GETTER(framebufferio_framebufferdisplay_root_group_obj, + (mp_obj_t)&framebufferio_framebufferdisplay_get_root_group_obj); + STATIC const mp_rom_map_elem_t framebufferio_framebufferdisplay_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&framebufferio_framebufferdisplay_show_obj) }, { MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&framebufferio_framebufferdisplay_refresh_obj) }, @@ -385,12 +343,12 @@ STATIC const mp_rom_map_elem_t framebufferio_framebufferdisplay_locals_dict_tabl { MP_ROM_QSTR(MP_QSTR_auto_refresh), MP_ROM_PTR(&framebufferio_framebufferdisplay_auto_refresh_obj) }, { MP_ROM_QSTR(MP_QSTR_brightness), MP_ROM_PTR(&framebufferio_framebufferdisplay_brightness_obj) }, - { MP_ROM_QSTR(MP_QSTR_auto_brightness), MP_ROM_PTR(&framebufferio_framebufferdisplay_auto_brightness_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&framebufferio_framebufferdisplay_width_obj) }, { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&framebufferio_framebufferdisplay_height_obj) }, { MP_ROM_QSTR(MP_QSTR_rotation), MP_ROM_PTR(&framebufferio_framebufferdisplay_rotation_obj) }, { MP_ROM_QSTR(MP_QSTR_framebuffer), MP_ROM_PTR(&framebufferio_framebufferframebuffer_obj) }, + { MP_ROM_QSTR(MP_QSTR_root_group), MP_ROM_PTR(&framebufferio_framebufferdisplay_root_group_obj) }, }; STATIC MP_DEFINE_CONST_DICT(framebufferio_framebufferdisplay_locals_dict, framebufferio_framebufferdisplay_locals_dict_table); diff --git a/shared-bindings/framebufferio/FramebufferDisplay.h b/shared-bindings/framebufferio/FramebufferDisplay.h index f96b47eb55..7c63587df7 100644 --- a/shared-bindings/framebufferio/FramebufferDisplay.h +++ b/shared-bindings/framebufferio/FramebufferDisplay.h @@ -55,13 +55,11 @@ uint16_t common_hal_framebufferio_framebufferdisplay_get_height(framebufferio_fr uint16_t common_hal_framebufferio_framebufferdisplay_get_rotation(framebufferio_framebufferdisplay_obj_t *self); void common_hal_framebufferio_framebufferdisplay_set_rotation(framebufferio_framebufferdisplay_obj_t *self, int rotation); -bool common_hal_framebufferio_framebufferdisplay_get_auto_brightness(framebufferio_framebufferdisplay_obj_t *self); -bool common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebufferio_framebufferdisplay_obj_t *self, bool auto_brightness); - mp_float_t common_hal_framebufferio_framebufferdisplay_get_brightness(framebufferio_framebufferdisplay_obj_t *self); bool common_hal_framebufferio_framebufferdisplay_set_brightness(framebufferio_framebufferdisplay_obj_t *self, mp_float_t brightness); mp_obj_t common_hal_framebufferio_framebufferdisplay_framebuffer(framebufferio_framebufferdisplay_obj_t *self); +mp_obj_t common_hal_framebufferio_framebufferdisplay_get_root_group(framebufferio_framebufferdisplay_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYIO_FRAMEBUFFERDISPLAY_H diff --git a/shared-bindings/frequencyio/FrequencyIn.c b/shared-bindings/frequencyio/FrequencyIn.c index a59d7a7302..b72627b19f 100644 --- a/shared-bindings/frequencyio/FrequencyIn.c +++ b/shared-bindings/frequencyio/FrequencyIn.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/frequencyio/FrequencyIn.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class FrequencyIn: //| """Read a frequency signal @@ -193,12 +193,9 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_set_capture_period(mp_obj_t self_in, } MP_DEFINE_CONST_FUN_OBJ_2(frequencyio_frequency_set_capture_period_obj, frequencyio_frequencyin_obj_set_capture_period); -const mp_obj_property_t frequencyio_frequencyin_capture_period_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&frequencyio_frequency_get_capture_period_obj, - (mp_obj_t)&frequencyio_frequency_set_capture_period_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(frequencyio_frequencyin_capture_period_obj, + (mp_obj_t)&frequencyio_frequency_get_capture_period_obj, + (mp_obj_t)&frequencyio_frequency_set_capture_period_obj); //| def __get__(self, index: int) -> int: //| """Returns the value of the last frequency captured.""" @@ -213,12 +210,8 @@ STATIC mp_obj_t frequencyio_frequencyin_obj_get_value(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(frequencyio_frequencyin_get_value_obj, frequencyio_frequencyin_obj_get_value); -const mp_obj_property_t frequencyio_frequencyin_value_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&frequencyio_frequencyin_get_value_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(frequencyio_frequencyin_value_obj, + (mp_obj_t)&frequencyio_frequencyin_get_value_obj); STATIC const mp_rom_map_elem_t frequencyio_frequencyin_locals_dict_table[] = { // Methods diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c deleted file mode 100644 index 1c43eeac7b..0000000000 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Radomir Dopieralski 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 "py/obj.h" -#include "py/runtime.h" -#include "py/mphal.h" -#include "py/gc.h" -#include "py/mpstate.h" -#include "shared-bindings/gamepadshift/GamePadShift.h" -#include "shared-bindings/gamepadshift/__init__.h" -#include "supervisor/shared/translate.h" -#include "supervisor/shared/tick.h" - -//| class GamePadShift: -//| """Scan buttons for presses through a shift register""" -//| -//| def __init__(self, clock: digitalio.DigitalInOut, data: digitalio.DigitalInOut, latch: digitalio.DigitalInOut) -> None: -//| """Initializes button scanning routines. -//| -//| The ``clock``, ``data`` and ``latch`` parameters are ``DigitalInOut`` -//| objects connected to the shift register controlling the buttons. -//| -//| The button presses are accumulated, until the ``get_pressed`` method -//| is called, at which point the button state is cleared, and the new -//| button presses start to be recorded. -//| -//| Only one `gamepadshift.GamePadShift` may be used at a time.""" -//| ... -//| -STATIC mp_obj_t gamepadshift_make_new(const mp_obj_type_t *type, size_t n_args, - size_t n_kw, const mp_obj_t *all_args) { - - enum { ARG_clock, ARG_data, ARG_latch }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_clock, MP_ARG_REQUIRED | MP_ARG_OBJ}, - { MP_QSTR_data, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_latch, MP_ARG_REQUIRED | MP_ARG_OBJ}, - }; - 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); - - digitalio_digitalinout_obj_t *clock_pin = assert_digitalinout(args[ARG_clock].u_obj); - digitalio_digitalinout_obj_t *data_pin = assert_digitalinout(args[ARG_data].u_obj); - digitalio_digitalinout_obj_t *latch_pin = assert_digitalinout(args[ARG_latch].u_obj); - - gamepadshift_obj_t *gamepad_singleton = MP_STATE_VM(gamepad_singleton); - if (!gamepad_singleton || - !mp_obj_is_type(MP_OBJ_FROM_PTR(gamepad_singleton), - &gamepadshift_type)) { - gamepad_singleton = m_new_ll_obj(gamepadshift_obj_t); - gamepad_singleton->base.type = &gamepadshift_type; - if (!MP_STATE_VM(gamepad_singleton)) { - supervisor_enable_tick(); - } - MP_STATE_VM(gamepad_singleton) = gamepad_singleton; - } - common_hal_gamepadshift_gamepadshift_init(gamepad_singleton, clock_pin, data_pin, latch_pin); - return MP_OBJ_FROM_PTR(gamepad_singleton); -} - -//| def get_pressed(self) -> int: -//| """Get the status of buttons pressed since the last call and clear it. -//| -//| Returns an 8-bit number, with bits that correspond to buttons, -//| which have been pressed (or held down) since the last call to this -//| function set to 1, and the remaining bits set to 0. Then it clears -//| the button state, so that new button presses (or buttons that are -//| held down) can be recorded for the next call.""" -//| ... -//| -STATIC mp_obj_t gamepadshift_get_pressed(mp_obj_t self_in) { - gamepadshift_obj_t *gamepad_singleton = MP_STATE_VM(gamepad_singleton); - mp_obj_t pressed = MP_OBJ_NEW_SMALL_INT(gamepad_singleton->pressed); - gamepad_singleton->pressed = gamepad_singleton->last; - return pressed; -} -MP_DEFINE_CONST_FUN_OBJ_1(gamepadshift_get_pressed_obj, gamepadshift_get_pressed); - -//| def deinit(self) -> None: -//| """Disable button scanning.""" -//| ... -//| -STATIC mp_obj_t gamepadshift_deinit(mp_obj_t self_in) { - common_hal_gamepadshift_gamepadshift_deinit(self_in); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(gamepadshift_deinit_obj, gamepadshift_deinit); - - -STATIC const mp_rom_map_elem_t gamepadshift_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_get_pressed), MP_ROM_PTR(&gamepadshift_get_pressed_obj)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gamepadshift_deinit_obj)}, -}; -STATIC MP_DEFINE_CONST_DICT(gamepadshift_locals_dict, gamepadshift_locals_dict_table); -const mp_obj_type_t gamepadshift_type = { - { &mp_type_type }, - .name = MP_QSTR_GamePadShift, - .make_new = gamepadshift_make_new, - .locals_dict = (mp_obj_dict_t *)&gamepadshift_locals_dict, -}; diff --git a/shared-bindings/gamepadshift/__init__.c b/shared-bindings/gamepadshift/__init__.c deleted file mode 100644 index 816fd8d7b0..0000000000 --- a/shared-bindings/gamepadshift/__init__.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Radomir Dopieralski 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 "py/obj.h" -#include "py/runtime.h" -#include "py/mphal.h" -#include "shared-bindings/gamepadshift/GamePadShift.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "shared-bindings/util.h" - -//| """Tracks button presses read through a shift register. -//| -//| .. note:: `gamepadshift` is deprecated in CircuitPython 7.0.0 and will be removed in 8.0.0. -//| Use `keypad` instead. -//| """ -//| -STATIC const mp_rom_map_elem_t gamepadshift_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gamepadshift) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_GamePadShift), MP_ROM_PTR(&gamepadshift_type)}, -}; - -STATIC MP_DEFINE_CONST_DICT(gamepadshift_module_globals, gamepadshift_module_globals_table); - -const mp_obj_module_t gamepadshift_module = { - .base = { &mp_type_module }, - .globals = (mp_obj_dict_t *)&gamepadshift_module_globals, -}; - -MP_REGISTER_MODULE(MP_QSTR_gamepadshift, gamepadshift_module, CIRCUITPY_GAMEPADSHIFT); diff --git a/shared-bindings/gnss/GNSS.c b/shared-bindings/gnss/GNSS.c index e304f0a0a2..0bd800bdc6 100644 --- a/shared-bindings/gnss/GNSS.c +++ b/shared-bindings/gnss/GNSS.c @@ -108,12 +108,8 @@ STATIC mp_obj_t gnss_obj_get_latitude(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_latitude_obj, gnss_obj_get_latitude); -const mp_obj_property_t gnss_latitude_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&gnss_get_latitude_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(gnss_latitude_obj, + (mp_obj_t)&gnss_get_latitude_obj); //| longitude: float //| """Longitude of current position in degrees (float).""" @@ -125,12 +121,8 @@ STATIC mp_obj_t gnss_obj_get_longitude(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_longitude_obj, gnss_obj_get_longitude); -const mp_obj_property_t gnss_longitude_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&gnss_get_longitude_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(gnss_longitude_obj, + (mp_obj_t)&gnss_get_longitude_obj); //| altitude: float //| """Altitude of current position in meters (float).""" @@ -142,12 +134,8 @@ STATIC mp_obj_t gnss_obj_get_altitude(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_altitude_obj, gnss_obj_get_altitude); -const mp_obj_property_t gnss_altitude_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&gnss_get_altitude_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(gnss_altitude_obj, + (mp_obj_t)&gnss_get_altitude_obj); //| timestamp: time.struct_time //| """Time when the position data was updated.""" @@ -161,12 +149,8 @@ STATIC mp_obj_t gnss_obj_get_timestamp(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_timestamp_obj, gnss_obj_get_timestamp); -const mp_obj_property_t gnss_timestamp_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&gnss_get_timestamp_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(gnss_timestamp_obj, + (mp_obj_t)&gnss_get_timestamp_obj); //| fix: PositionFix //| """Fix mode.""" @@ -178,12 +162,8 @@ STATIC mp_obj_t gnss_obj_get_fix(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(gnss_get_fix_obj, gnss_obj_get_fix); -const mp_obj_property_t gnss_fix_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&gnss_get_fix_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(gnss_fix_obj, + (mp_obj_t)&gnss_get_fix_obj); STATIC const mp_rom_map_elem_t gnss_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gnss_deinit_obj) }, diff --git a/shared-bindings/hashlib/Hash.c b/shared-bindings/hashlib/Hash.c new file mode 100644 index 0000000000..896526983a --- /dev/null +++ b/shared-bindings/hashlib/Hash.c @@ -0,0 +1,97 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "shared-bindings/hashlib/Hash.h" + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/objstr.h" +#include "py/runtime.h" + +//| class Hash: +//| """In progress hash algorithm. This object is always created by a `hashlib.new()`. It has no +//| user-visible constructor.""" +//| + +//| digest_size: int +//| """Digest size in bytes""" +//| +STATIC mp_obj_t hashlib_hash_digest_size_get(mp_obj_t self_in) { + mp_check_self(mp_obj_is_type(self_in, &hashlib_hash_type)); + hashlib_hash_obj_t *self = MP_OBJ_TO_PTR(self_in); + return MP_OBJ_NEW_SMALL_INT(common_hal_hashlib_hash_get_digest_size(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(hashlib_hash_digest_size_get_obj, hashlib_hash_digest_size_get); +MP_PROPERTY_GETTER(hashlib_hash_digest_size_obj, (mp_obj_t)&hashlib_hash_digest_size_get_obj); + +//| def update(self, data: ReadableBuffer) -> None: +//| """Update the hash with the given bytes. +//| +//| :param ~circuitpython_typing.ReadableBuffer data: Update the hash from data in this buffer""" +//| ... +//| +mp_obj_t hashlib_hash_update(mp_obj_t self_in, mp_obj_t buf_in) { + mp_check_self(mp_obj_is_type(self_in, &hashlib_hash_type)); + hashlib_hash_obj_t *self = MP_OBJ_TO_PTR(self_in); + + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ); + + common_hal_hashlib_hash_update(self, bufinfo.buf, bufinfo.len); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_2(hashlib_hash_update_obj, hashlib_hash_update); + +//| def digest(self) -> bytes: +//| """Returns the current digest as bytes() with a length of `hashlib.Hash.digest_size`.""" +//| ... +//| +STATIC mp_obj_t hashlib_hash_digest(mp_obj_t self_in) { + mp_check_self(mp_obj_is_type(self_in, &hashlib_hash_type)); + hashlib_hash_obj_t *self = MP_OBJ_TO_PTR(self_in); + + size_t size = common_hal_hashlib_hash_get_digest_size(self); + mp_obj_t obj = mp_obj_new_bytes_of_zeros(size); + mp_obj_str_t *o = MP_OBJ_TO_PTR(obj); + + common_hal_hashlib_hash_digest(self, (uint8_t *)o->data, size); + return obj; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(hashlib_hash_digest_obj, hashlib_hash_digest); + +STATIC const mp_rom_map_elem_t hashlib_hash_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_digest_size), MP_ROM_PTR(&hashlib_hash_digest_size_obj) }, + { MP_ROM_QSTR(MP_QSTR_update), MP_ROM_PTR(&hashlib_hash_update_obj) }, + { MP_ROM_QSTR(MP_QSTR_digest), MP_ROM_PTR(&hashlib_hash_digest_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(hashlib_hash_locals_dict, hashlib_hash_locals_dict_table); + +const mp_obj_type_t hashlib_hash_type = { + { &mp_type_type }, + .name = MP_QSTR_Hash, + .locals_dict = (mp_obj_dict_t *)&hashlib_hash_locals_dict, +}; diff --git a/shared-bindings/hashlib/Hash.h b/shared-bindings/hashlib/Hash.h new file mode 100644 index 0000000000..f3845b02ff --- /dev/null +++ b/shared-bindings/hashlib/Hash.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB_HASH_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB_HASH_H + +#include "py/obj.h" + +#include "common-hal/hashlib/Hash.h" + +extern const mp_obj_type_t hashlib_hash_type; + +// So that new can call it when given data. +mp_obj_t hashlib_hash_update(mp_obj_t self_in, mp_obj_t buf_in); + +void common_hal_hashlib_hash_update(hashlib_hash_obj_t *self, const uint8_t *data, size_t datalen); +void common_hal_hashlib_hash_digest(hashlib_hash_obj_t *self, uint8_t *data, size_t datalen); +size_t common_hal_hashlib_hash_get_digest_size(hashlib_hash_obj_t *self); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB_HASH_H diff --git a/shared-bindings/hashlib/__init__.c b/shared-bindings/hashlib/__init__.c new file mode 100644 index 0000000000..4b5be0165b --- /dev/null +++ b/shared-bindings/hashlib/__init__.c @@ -0,0 +1,90 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 + +#include "py/obj.h" +#include "py/mpconfig.h" +#include "py/runtime.h" +#include "shared-bindings/hashlib/__init__.h" +#include "shared-bindings/hashlib/Hash.h" +#include "supervisor/shared/translate/translate.h" + +//| """Hashing related functions +//| +//| |see_cpython_module| :mod:`cpython:hashlib`. +//| """ +//| +//| def new(name, data=b"") -> hashlib.Hash: +//| """Returns a Hash object setup for the named algorithm. Raises ValueError when the named +//| algorithm is unsupported. +//| +//| :return: a hash object for the given algorithm +//| :rtype: hashlib.Hash""" +//| ... +//| +STATIC mp_obj_t hashlib_new(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_name, ARG_data }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_name, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_data, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + const char *algorithm = mp_obj_str_get_str(args[ARG_name].u_obj); + + hashlib_hash_obj_t *self = m_new_obj(hashlib_hash_obj_t); + self->base.type = &hashlib_hash_type; + + if (!common_hal_hashlib_new(self, algorithm)) { + mp_raise_ValueError(translate("Unsupported hash algorithm")); + } + + if (args[ARG_data].u_obj != mp_const_none) { + hashlib_hash_update(self, args[ARG_data].u_obj); + } + return self; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(hashlib_new_obj, 1, hashlib_new); + +STATIC const mp_rom_map_elem_t hashlib_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_hashlib) }, + + { MP_ROM_QSTR(MP_QSTR_new), MP_ROM_PTR(&hashlib_new_obj) }, + + // Hash is deliberately omitted here because CPython doesn't expose the + // object on `hashlib` only the internal `_hashlib`. +}; + +STATIC MP_DEFINE_CONST_DICT(hashlib_module_globals, hashlib_module_globals_table); + +const mp_obj_module_t hashlib_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&hashlib_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_hashlib, hashlib_module, CIRCUITPY_HASHLIB); diff --git a/shared-bindings/hashlib/__init__.h b/shared-bindings/hashlib/__init__.h new file mode 100644 index 0000000000..ae47b546a4 --- /dev/null +++ b/shared-bindings/hashlib/__init__.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB___INIT___H + +#include + +#include "shared-bindings/hashlib/Hash.h" + +bool common_hal_hashlib_new(hashlib_hash_obj_t *self, const char *algorithm); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_HASHLIB___INIT___H diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.c b/shared-bindings/i2ctarget/I2CTarget.c similarity index 51% rename from shared-bindings/i2cperipheral/I2CPeripheral.c rename to shared-bindings/i2ctarget/I2CTarget.c index b63e8a891b..1680585ba5 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.c +++ b/shared-bindings/i2ctarget/I2CTarget.c @@ -25,7 +25,7 @@ */ #include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/i2cperipheral/I2CPeripheral.h" +#include "shared-bindings/i2ctarget/I2CTarget.h" #include "shared-bindings/time/__init__.h" #include "shared-bindings/util.h" @@ -39,33 +39,33 @@ #include "py/objproperty.h" #include "py/runtime.h" -STATIC mp_obj_t mp_obj_new_i2cperipheral_i2c_peripheral_request(i2cperipheral_i2c_peripheral_obj_t *peripheral, uint8_t address, bool is_read, bool is_restart) { - i2cperipheral_i2c_peripheral_request_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_request_obj_t); - self->base.type = &i2cperipheral_i2c_peripheral_request_type; - self->peripheral = peripheral; +STATIC mp_obj_t mp_obj_new_i2ctarget_i2c_target_request(i2ctarget_i2c_target_obj_t *target, uint8_t address, bool is_read, bool is_restart) { + i2ctarget_i2c_target_request_obj_t *self = m_new_obj(i2ctarget_i2c_target_request_obj_t); + self->base.type = &i2ctarget_i2c_target_request_type; + self->target = target; self->address = address; self->is_read = is_read; self->is_restart = is_restart; return (mp_obj_t)self; } -//| class I2CPeripheral: -//| """Two wire serial protocol peripheral""" +//| class I2CTarget: +//| """Two wire serial protocol target""" //| //| def __init__(self, scl: microcontroller.Pin, sda: microcontroller.Pin, addresses: Sequence[int], smbus: bool = False) -> None: //| """I2C is a two-wire protocol for communicating between devices. -//| This implements the peripheral (sensor, secondary) side. +//| This implements the target (peripheral, sensor, secondary) side. //| //| :param ~microcontroller.Pin scl: The clock pin //| :param ~microcontroller.Pin sda: The data pin -//| :param addresses: The I2C addresses to respond to (how many is hw dependent). +//| :param addresses: The I2C addresses to respond to (how many is hardware dependent). //| :type addresses: list[int] //| :param bool smbus: Use SMBUS timings if the hardware supports it""" //| ... //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - i2cperipheral_i2c_peripheral_obj_t *self = m_new_obj(i2cperipheral_i2c_peripheral_obj_t); - self->base.type = &i2cperipheral_i2c_peripheral_type; +STATIC mp_obj_t i2ctarget_i2c_target_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { + i2ctarget_i2c_target_obj_t *self = m_new_obj(i2ctarget_i2c_target_obj_t); + self->base.type = &i2ctarget_i2c_target_type; enum { ARG_scl, ARG_sda, ARG_addresses, ARG_smbus }; static const mp_arg_t allowed_args[] = { { MP_QSTR_scl, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -99,7 +99,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, mp_raise_ValueError(translate("addresses is empty")); } - common_hal_i2cperipheral_i2c_peripheral_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); + common_hal_i2ctarget_i2c_target_construct(self, scl, sda, addresses, i, args[ARG_smbus].u_bool); return (mp_obj_t)self; } @@ -107,15 +107,15 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_make_new(const mp_obj_type_t *type, //| """Releases control of the underlying hardware so other classes can use it.""" //| ... //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj_deinit(mp_obj_t self_in) { - mp_check_self(mp_obj_is_type(self_in, &i2cperipheral_i2c_peripheral_type)); - i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_i2cperipheral_i2c_peripheral_deinit(self); +STATIC mp_obj_t i2ctarget_i2c_target_obj_deinit(mp_obj_t self_in) { + mp_check_self(mp_obj_is_type(self_in, &i2ctarget_i2c_target_type)); + i2ctarget_i2c_target_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_i2ctarget_i2c_target_deinit(self); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_deinit_obj, i2cperipheral_i2c_peripheral_obj_deinit); +MP_DEFINE_CONST_FUN_OBJ_1(i2ctarget_i2c_target_deinit_obj, i2ctarget_i2c_target_obj_deinit); -//| def __enter__(self) -> I2CPeripheral: +//| def __enter__(self) -> I2CTarget: //| """No-op used in Context Managers.""" //| ... //| @@ -126,25 +126,25 @@ MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_deinit_obj, i2cperipheral //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_obj___exit__(size_t n_args, const mp_obj_t *args) { - mp_check_self(mp_obj_is_type(args[0], &i2cperipheral_i2c_peripheral_type)); - i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(args[0]); - common_hal_i2cperipheral_i2c_peripheral_deinit(self); +STATIC mp_obj_t i2ctarget_i2c_target_obj___exit__(size_t n_args, const mp_obj_t *args) { + mp_check_self(mp_obj_is_type(args[0], &i2ctarget_i2c_target_type)); + i2ctarget_i2c_target_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_i2ctarget_i2c_target_deinit(self); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_obj___exit__); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2ctarget_i2c_target___exit___obj, 4, 4, i2ctarget_i2c_target_obj___exit__); -//| def request(self, timeout: float = -1) -> I2CPeripheralRequest: +//| def request(self, timeout: float = -1) -> I2CTargetRequest: //| """Wait for an I2C request. //| //| :param float timeout: Timeout in seconds. Zero means wait forever, a negative value means check once -//| :return: I2C Slave Request or None if timeout=-1 and there's no request -//| :rtype: ~i2cperipheral.I2CPeripheralRequest""" +//| :return: I2CTargetRequest or None if timeout=-1 and there's no request +//| :rtype: ~i2ctarget.I2CTargetRequest""" //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_check_self(mp_obj_is_type(pos_args[0], &i2cperipheral_i2c_peripheral_type)); - i2cperipheral_i2c_peripheral_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - if (common_hal_i2cperipheral_i2c_peripheral_deinited(self)) { +STATIC mp_obj_t i2ctarget_i2c_target_request(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_check_self(mp_obj_is_type(pos_args[0], &i2ctarget_i2c_target_type)); + i2ctarget_i2c_target_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + if (common_hal_i2ctarget_i2c_target_deinited(self)) { raise_deinited_error(); } enum { ARG_timeout }; @@ -181,7 +181,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request(size_t n_args, const mp_obj return mp_const_none; } - int status = common_hal_i2cperipheral_i2c_peripheral_is_addressed(self, &address, &is_read, &is_restart); + int status = common_hal_i2ctarget_i2c_target_is_addressed(self, &address, &is_read, &is_restart); if (status < 0) { // On error try one more time before bailing out if (last_error) { @@ -199,7 +199,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request(size_t n_args, const mp_obj continue; } - return mp_obj_new_i2cperipheral_i2c_peripheral_request(self, address, is_read, is_restart); + return mp_obj_new_i2ctarget_i2c_target_request(self, address, is_read, is_restart); } while (forever || common_hal_time_monotonic_ms() < timeout_end); if (timeout_ms > 0) { @@ -207,42 +207,42 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request(size_t n_args, const mp_obj } return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_obj, 1, i2cperipheral_i2c_peripheral_request); +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(i2ctarget_i2c_target_request_obj, 1, i2ctarget_i2c_target_request); -STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_deinit_obj) }, +STATIC const mp_rom_map_elem_t i2ctarget_i2c_target_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&i2ctarget_i2c_target_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_request), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2ctarget_i2c_target___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_request), MP_ROM_PTR(&i2ctarget_i2c_target_request_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_locals_dict, i2cperipheral_i2c_peripheral_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(i2ctarget_i2c_target_locals_dict, i2ctarget_i2c_target_locals_dict_table); -const mp_obj_type_t i2cperipheral_i2c_peripheral_type = { +const mp_obj_type_t i2ctarget_i2c_target_type = { { &mp_type_type }, - .name = MP_QSTR_I2CPeripheral, - .make_new = i2cperipheral_i2c_peripheral_make_new, - .locals_dict = (mp_obj_dict_t *)&i2cperipheral_i2c_peripheral_locals_dict, + .name = MP_QSTR_I2CTarget, + .make_new = i2ctarget_i2c_target_make_new, + .locals_dict = (mp_obj_dict_t *)&i2ctarget_i2c_target_locals_dict, }; -//| class I2CPeripheralRequest: +//| class I2CTargetRequest: //| -//| def __init__(self, peripheral: i2cperipheral.I2CPeripheral, address: int, is_read: bool, is_restart: bool) -> None: +//| def __init__(self, target: i2ctarget.I2CTarget, address: int, is_read: bool, is_restart: bool) -> None: //| """Information about an I2C transfer request -//| This cannot be instantiated directly, but is returned by :py:meth:`I2CPeripheral.request`. +//| This cannot be instantiated directly, but is returned by :py:meth:`I2CTarget.request`. //| -//| :param peripheral: The I2CPeripheral object receiving this request +//| :param target: The I2CTarget object receiving this request //| :param address: I2C address -//| :param is_read: True if the main peripheral is requesting data +//| :param is_read: True if the main target is requesting data //| :param is_restart: Repeated Start Condition""" //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { +STATIC mp_obj_t i2ctarget_i2c_target_request_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 4, 4, false); - return mp_obj_new_i2cperipheral_i2c_peripheral_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); + return mp_obj_new_i2ctarget_i2c_target_request(args[0], mp_obj_get_int(args[1]), mp_obj_is_true(args[2]), mp_obj_is_true(args[3])); } -//| def __enter__(self) -> I2CPeripheralRequest: +//| def __enter__(self) -> I2CTargetRequest: //| """No-op used in Context Managers.""" //| ... //| @@ -252,56 +252,56 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_make_new(const mp_obj_type_ //| """Close the request.""" //| ... //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_obj___exit__(size_t n_args, const mp_obj_t *args) { - mp_check_self(mp_obj_is_type(args[0], &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); - common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); +STATIC mp_obj_t i2ctarget_i2c_target_request_obj___exit__(size_t n_args, const mp_obj_t *args) { + mp_check_self(mp_obj_is_type(args[0], &i2ctarget_i2c_target_request_type)); + i2ctarget_i2c_target_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); + common_hal_i2ctarget_i2c_target_close(self->target); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request___exit___obj, 4, 4, i2cperipheral_i2c_peripheral_request_obj___exit__); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2ctarget_i2c_target_request___exit___obj, 4, 4, i2ctarget_i2c_target_request_obj___exit__); //| address: int //| """The I2C address of the request.""" //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_address(mp_obj_t self_in) { - mp_check_self(mp_obj_is_type(self_in, &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2ctarget_i2c_target_request_get_address(mp_obj_t self_in) { + mp_check_self(mp_obj_is_type(self_in, &i2ctarget_i2c_target_request_type)); + i2ctarget_i2c_target_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_int(self->address); } -MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_address_obj, i2cperipheral_i2c_peripheral_request_get_address); +MP_DEFINE_CONST_PROP_GET(i2ctarget_i2c_target_request_address_obj, i2ctarget_i2c_target_request_get_address); //| is_read: bool -//| """The I2C main controller is reading from this peripheral.""" +//| """The I2C main controller is reading from this target.""" //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_read(mp_obj_t self_in) { - mp_check_self(mp_obj_is_type(self_in, &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2ctarget_i2c_target_request_get_is_read(mp_obj_t self_in) { + mp_check_self(mp_obj_is_type(self_in, &i2ctarget_i2c_target_request_type)); + i2ctarget_i2c_target_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_bool(self->is_read); } -MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_read_obj, i2cperipheral_i2c_peripheral_request_get_is_read); +MP_DEFINE_CONST_PROP_GET(i2ctarget_i2c_target_request_is_read_obj, i2ctarget_i2c_target_request_get_is_read); //| is_restart: bool //| """Is Repeated Start Condition.""" //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_get_is_restart(mp_obj_t self_in) { - mp_check_self(mp_obj_is_type(self_in, &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2ctarget_i2c_target_request_get_is_restart(mp_obj_t self_in) { + mp_check_self(mp_obj_is_type(self_in, &i2ctarget_i2c_target_request_type)); + i2ctarget_i2c_target_request_obj_t *self = MP_OBJ_TO_PTR(self_in); return mp_obj_new_bool(self->is_restart); } -MP_DEFINE_CONST_PROP_GET(i2cperipheral_i2c_peripheral_request_is_restart_obj, i2cperipheral_i2c_peripheral_request_get_is_restart); +MP_DEFINE_CONST_PROP_GET(i2ctarget_i2c_target_request_is_restart_obj, i2ctarget_i2c_target_request_get_is_restart); //| def read(self, n: int = -1, ack: bool = True) -> bytearray: //| """Read data. -//| If ack=False, the caller is responsible for calling :py:meth:`I2CPeripheralRequest.ack`. +//| If ack=False, the caller is responsible for calling :py:meth:`I2CTargetRequest.ack`. //| //| :param n: Number of bytes to read (negative means all) //| :param ack: Whether or not to send an ACK after the n'th byte //| :return: Bytes read""" //| ... //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - mp_check_self(mp_obj_is_type(pos_args[0], &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); +STATIC mp_obj_t i2ctarget_i2c_target_request_read(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + mp_check_self(mp_obj_is_type(pos_args[0], &i2ctarget_i2c_target_request_type)); + i2ctarget_i2c_target_request_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); enum { ARG_n, ARG_ack }; static const mp_arg_t allowed_args[] = { { MP_QSTR_n, MP_ARG_INT, {.u_int = -1} }, @@ -330,7 +330,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_read(size_t n_args, const m } uint8_t data; - int num = common_hal_i2cperipheral_i2c_peripheral_read_byte(self->peripheral, &data); + int num = common_hal_i2ctarget_i2c_target_read_byte(self->target, &data); if (num == 0) { break; } @@ -339,16 +339,16 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_read(size_t n_args, const m buffer[i++] = data; if (i == n) { if (ack) { - common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); + common_hal_i2ctarget_i2c_target_ack(self->target, true); } break; } - common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, true); + common_hal_i2ctarget_i2c_target_ack(self->target, true); } return mp_obj_new_bytearray(i, buffer); } -MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2cperipheral_i2c_peripheral_request_read); +MP_DEFINE_CONST_FUN_OBJ_KW(i2ctarget_i2c_target_request_read_obj, 1, i2ctarget_i2c_target_request_read); //| def write(self, buffer: ReadableBuffer) -> int: //| """Write the data contained in buffer. @@ -357,9 +357,9 @@ MP_DEFINE_CONST_FUN_OBJ_KW(i2cperipheral_i2c_peripheral_request_read_obj, 1, i2c //| :return: Number of bytes written""" //| ... //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_write(mp_obj_t self_in, mp_obj_t buf_in) { - mp_check_self(mp_obj_is_type(self_in, &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2ctarget_i2c_target_request_write(mp_obj_t self_in, mp_obj_t buf_in) { + mp_check_self(mp_obj_is_type(self_in, &i2ctarget_i2c_target_request_type)); + i2ctarget_i2c_target_request_obj_t *self = MP_OBJ_TO_PTR(self_in); if (!self->is_read) { mp_raise_OSError(MP_EACCES); @@ -374,7 +374,7 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_write(mp_obj_t self_in, mp_ break; } - int num = common_hal_i2cperipheral_i2c_peripheral_write_byte(self->peripheral, ((uint8_t *)(bufinfo.buf))[i]); + int num = common_hal_i2ctarget_i2c_target_write_byte(self->target, ((uint8_t *)(bufinfo.buf))[i]); if (num == 0) { return mp_obj_new_int(i); } @@ -382,55 +382,55 @@ STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_write(mp_obj_t self_in, mp_ return mp_obj_new_int(bufinfo.len); } -STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2cperipheral_i2c_peripheral_request_write_obj, i2cperipheral_i2c_peripheral_request_write); +STATIC MP_DEFINE_CONST_FUN_OBJ_2(i2ctarget_i2c_target_request_write_obj, i2ctarget_i2c_target_request_write); //| def ack(self, ack: bool = True) -> None: //| """Acknowledge or Not Acknowledge last byte received. -//| Use together with :py:meth:`I2CPeripheralRequest.read` ack=False. +//| Use together with :py:meth:`I2CTargetRequest.read` ack=False. //| //| :param ack: Whether to send an ACK or NACK""" //| ... //| -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_ack(uint n_args, const mp_obj_t *args) { - mp_check_self(mp_obj_is_type(args[0], &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); +STATIC mp_obj_t i2ctarget_i2c_target_request_ack(uint n_args, const mp_obj_t *args) { + mp_check_self(mp_obj_is_type(args[0], &i2ctarget_i2c_target_request_type)); + i2ctarget_i2c_target_request_obj_t *self = MP_OBJ_TO_PTR(args[0]); bool ack = (n_args == 1) ? true : mp_obj_is_true(args[1]); if (self->is_read) { mp_raise_OSError(MP_EACCES); } - common_hal_i2cperipheral_i2c_peripheral_ack(self->peripheral, ack); + common_hal_i2ctarget_i2c_target_ack(self->target, ack); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2cperipheral_i2c_peripheral_request_ack_obj, 1, 2, i2cperipheral_i2c_peripheral_request_ack); +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(i2ctarget_i2c_target_request_ack_obj, 1, 2, i2ctarget_i2c_target_request_ack); -STATIC mp_obj_t i2cperipheral_i2c_peripheral_request_close(mp_obj_t self_in) { - mp_check_self(mp_obj_is_type(self_in, &i2cperipheral_i2c_peripheral_request_type)); - i2cperipheral_i2c_peripheral_request_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t i2ctarget_i2c_target_request_close(mp_obj_t self_in) { + mp_check_self(mp_obj_is_type(self_in, &i2ctarget_i2c_target_request_type)); + i2ctarget_i2c_target_request_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_i2cperipheral_i2c_peripheral_close(self->peripheral); + common_hal_i2ctarget_i2c_target_close(self->target); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(i2cperipheral_i2c_peripheral_request_close_obj, i2cperipheral_i2c_peripheral_request_close); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(i2ctarget_i2c_target_request_close_obj, i2ctarget_i2c_target_request_close); -STATIC const mp_rom_map_elem_t i2cperipheral_i2c_peripheral_request_locals_dict_table[] = { +STATIC const mp_rom_map_elem_t i2ctarget_i2c_target_request_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_address_obj) }, - { MP_ROM_QSTR(MP_QSTR_is_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_is_restart), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_is_restart_obj) }, - { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_read_obj) }, - { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_write_obj) }, - { MP_ROM_QSTR(MP_QSTR_ack), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_ack_obj) }, - { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_request_close_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&i2ctarget_i2c_target_request___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_address), MP_ROM_PTR(&i2ctarget_i2c_target_request_address_obj) }, + { MP_ROM_QSTR(MP_QSTR_is_read), MP_ROM_PTR(&i2ctarget_i2c_target_request_is_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_is_restart), MP_ROM_PTR(&i2ctarget_i2c_target_request_is_restart_obj) }, + { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&i2ctarget_i2c_target_request_read_obj) }, + { MP_ROM_QSTR(MP_QSTR_write), MP_ROM_PTR(&i2ctarget_i2c_target_request_write_obj) }, + { MP_ROM_QSTR(MP_QSTR_ack), MP_ROM_PTR(&i2ctarget_i2c_target_request_ack_obj) }, + { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&i2ctarget_i2c_target_request_close_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cperipheral_i2c_peripheral_request_locals_dict, i2cperipheral_i2c_peripheral_request_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(i2ctarget_i2c_target_request_locals_dict, i2ctarget_i2c_target_request_locals_dict_table); -const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type = { +const mp_obj_type_t i2ctarget_i2c_target_request_type = { { &mp_type_type }, - .name = MP_QSTR_I2CPeripheralRequest, - .make_new = i2cperipheral_i2c_peripheral_request_make_new, - .locals_dict = (mp_obj_dict_t *)&i2cperipheral_i2c_peripheral_request_locals_dict, + .name = MP_QSTR_I2CTargetRequest, + .make_new = i2ctarget_i2c_target_request_make_new, + .locals_dict = (mp_obj_dict_t *)&i2ctarget_i2c_target_request_locals_dict, }; diff --git a/shared-bindings/i2cperipheral/I2CPeripheral.h b/shared-bindings/i2ctarget/I2CTarget.h similarity index 54% rename from shared-bindings/i2cperipheral/I2CPeripheral.h rename to shared-bindings/i2ctarget/I2CTarget.h index d3db1b96c9..e9c9714dee 100644 --- a/shared-bindings/i2cperipheral/I2CPeripheral.h +++ b/shared-bindings/i2ctarget/I2CTarget.h @@ -24,37 +24,37 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_SLAVE_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_SLAVE_H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_TARGET_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_TARGET_H #include "py/obj.h" #include "common-hal/microcontroller/Pin.h" -#include "common-hal/i2cperipheral/I2CPeripheral.h" +#include "common-hal/i2ctarget/I2CTarget.h" typedef struct { mp_obj_base_t base; - i2cperipheral_i2c_peripheral_obj_t *peripheral; + i2ctarget_i2c_target_obj_t *target; uint16_t address; bool is_read; bool is_restart; -} i2cperipheral_i2c_peripheral_request_obj_t; +} i2ctarget_i2c_target_request_obj_t; -extern const mp_obj_type_t i2cperipheral_i2c_peripheral_request_type; +extern const mp_obj_type_t i2ctarget_i2c_target_request_type; -extern const mp_obj_type_t i2cperipheral_i2c_peripheral_type; +extern const mp_obj_type_t i2ctarget_i2c_target_type; -extern void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self, +extern void common_hal_i2ctarget_i2c_target_construct(i2ctarget_i2c_target_obj_t *self, const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint8_t *addresses, unsigned int num_addresses, bool smbus); -extern void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self); -extern bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self); +extern void common_hal_i2ctarget_i2c_target_deinit(i2ctarget_i2c_target_obj_t *self); +extern bool common_hal_i2ctarget_i2c_target_deinited(i2ctarget_i2c_target_obj_t *self); -extern int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self, +extern int common_hal_i2ctarget_i2c_target_is_addressed(i2ctarget_i2c_target_obj_t *self, uint8_t *address, bool *is_read, bool *is_restart); -extern int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data); -extern int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data); -extern void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack); -extern void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self); +extern int common_hal_i2ctarget_i2c_target_read_byte(i2ctarget_i2c_target_obj_t *self, uint8_t *data); +extern int common_hal_i2ctarget_i2c_target_write_byte(i2ctarget_i2c_target_obj_t *self, uint8_t data); +extern void common_hal_i2ctarget_i2c_target_ack(i2ctarget_i2c_target_obj_t *self, bool ack); +extern void common_hal_i2ctarget_i2c_target_close(i2ctarget_i2c_target_obj_t *self); -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_SLAVE_H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_I2C_TARGET_H diff --git a/shared-bindings/i2cperipheral/__init__.c b/shared-bindings/i2ctarget/__init__.c similarity index 73% rename from shared-bindings/i2cperipheral/__init__.c rename to shared-bindings/i2ctarget/__init__.c index fde7002daf..70c4707597 100644 --- a/shared-bindings/i2cperipheral/__init__.c +++ b/shared-bindings/i2ctarget/__init__.c @@ -30,24 +30,24 @@ #include "py/runtime.h" #include "shared-bindings/microcontroller/Pin.h" -// #include "shared-bindings/i2cperipheral/__init__.h" -#include "shared-bindings/i2cperipheral/I2CPeripheral.h" +// #include "shared-bindings/i2ctarget/__init__.h" +#include "shared-bindings/i2ctarget/I2CTarget.h" #include "py/runtime.h" -//| """Two wire serial protocol peripheral +//| """Two wire serial protocol target //| -//| The `i2cperipheral` module contains classes to support an I2C peripheral. +//| The `i2ctarget` module contains classes to support an I2C target. //| -//| Example emulating a peripheral with 2 addresses (read and write):: +//| Example emulating a target with 2 addresses (read and write):: //| //| import board -//| from i2cperipheral import I2CPeripheral +//| from i2ctarget import I2CTarget //| //| regs = [0] * 16 //| index = 0 //| -//| with I2CPeripheral(board.SCL, board.SDA, (0x40, 0x41)) as device: +//| with I2CTarget(board.SCL, board.SDA, (0x40, 0x41)) as device: //| while True: //| r = device.request() //| if not r: @@ -84,7 +84,7 @@ //| 0xaa //| //| .. warning:: -//| I2CPeripheral makes use of clock stretching in order to slow down +//| I2CTarget makes use of clock stretching in order to slow down //| the host. //| Make sure the I2C host supports this. //| @@ -93,16 +93,21 @@ //| Since the RPi firmware uses the hw i2c, it's not possible to emulate a HAT eeprom.""" //| -STATIC const mp_rom_map_elem_t i2cperipheral_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2cperipheral) }, - { MP_ROM_QSTR(MP_QSTR_I2CPeripheral), MP_ROM_PTR(&i2cperipheral_i2c_peripheral_type) }, +STATIC const mp_rom_map_elem_t i2ctarget_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_i2ctarget) }, + { MP_ROM_QSTR(MP_QSTR_I2CTarget), MP_ROM_PTR(&i2ctarget_i2c_target_type) }, + // TODO: Remove for CircuitPython 9.0.0 + { MP_ROM_QSTR(MP_QSTR_I2CPeripheral), MP_ROM_PTR(&i2ctarget_i2c_target_type) }, }; -STATIC MP_DEFINE_CONST_DICT(i2cperipheral_module_globals, i2cperipheral_module_globals_table); +STATIC MP_DEFINE_CONST_DICT(i2ctarget_module_globals, i2ctarget_module_globals_table); -const mp_obj_module_t i2cperipheral_module = { +const mp_obj_module_t i2ctarget_module = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t *)&i2cperipheral_module_globals, + .globals = (mp_obj_dict_t *)&i2ctarget_module_globals, }; -MP_REGISTER_MODULE(MP_QSTR_i2cperipheral, i2cperipheral_module, CIRCUITPY_I2CPERIPHERAL); +MP_REGISTER_MODULE(MP_QSTR_i2ctarget, i2ctarget_module, CIRCUITPY_I2CTARGET); + +// TODO: Remove for CircuitPython 9.0.0 +MP_REGISTER_MODULE(MP_QSTR_i2cperipheral, i2ctarget_module, CIRCUITPY_I2CTARGET); diff --git a/shared-bindings/imagecapture/ParallelImageCapture.c b/shared-bindings/imagecapture/ParallelImageCapture.c index 7f90f0923b..bbe96026bf 100644 --- a/shared-bindings/imagecapture/ParallelImageCapture.c +++ b/shared-bindings/imagecapture/ParallelImageCapture.c @@ -47,6 +47,8 @@ //| ) -> None: //| """Create a parallel image capture object //| +//| This object is usually used with a camera-specific wrapper library such as `adafruit_ov5640 `_. +//| //| :param List[microcontroller.Pin] data_pins: The data pins. //| :param microcontroller.Pin clock: The pixel clock input. //| :param microcontroller.Pin vsync: The vertical sync input, which has a negative-going pulse at the beginning of each frame. diff --git a/shared-bindings/imagecapture/__init__.c b/shared-bindings/imagecapture/__init__.c index 0e5092aee8..fdd4424114 100644 --- a/shared-bindings/imagecapture/__init__.c +++ b/shared-bindings/imagecapture/__init__.c @@ -31,9 +31,13 @@ #include "shared-bindings/imagecapture/ParallelImageCapture.h" -//| """Support for "Parallel capture" interfaces""" +//| """Support for "Parallel capture" interfaces //| - +//| .. seealso:: +//| +//| Espressif microcontrollers use the `esp32_camera` module together. +//| +//| """ STATIC const mp_rom_map_elem_t imagecapture_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_imagecapture) }, { MP_ROM_QSTR(MP_QSTR_ParallelImageCapture), MP_ROM_PTR(&imagecapture_parallelimagecapture_type) }, diff --git a/shared-bindings/ipaddress/IPv4Address.c b/shared-bindings/ipaddress/IPv4Address.c index f62e373937..23204329d3 100644 --- a/shared-bindings/ipaddress/IPv4Address.c +++ b/shared-bindings/ipaddress/IPv4Address.c @@ -96,12 +96,8 @@ STATIC mp_obj_t ipaddress_ipv4address_get_packed(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(ipaddress_ipv4address_get_packed_obj, ipaddress_ipv4address_get_packed); -const mp_obj_property_t ipaddress_ipv4address_packed_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&ipaddress_ipv4address_get_packed_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(ipaddress_ipv4address_packed_obj, + (mp_obj_t)&ipaddress_ipv4address_get_packed_obj); //| version: int //| """4 for IPv4, 6 for IPv6""" @@ -120,12 +116,8 @@ STATIC mp_obj_t ipaddress_ipv4address_get_version(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(ipaddress_ipv4address_get_version_obj, ipaddress_ipv4address_get_version); -const mp_obj_property_t ipaddress_ipv4address_version_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&ipaddress_ipv4address_get_version_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(ipaddress_ipv4address_version_obj, + (mp_obj_t)&ipaddress_ipv4address_get_version_obj); //| def __eq__(self, other: object) -> bool: //| """Two Address objects are equal if their addresses and address types are equal.""" diff --git a/shared-bindings/is31fl3741/FrameBuffer.c b/shared-bindings/is31fl3741/FrameBuffer.c index 597024500d..e1a87e8ee0 100644 --- a/shared-bindings/is31fl3741/FrameBuffer.c +++ b/shared-bindings/is31fl3741/FrameBuffer.c @@ -166,12 +166,9 @@ STATIC mp_obj_t is31fl3741_FrameBuffer_set_brightness(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(is31fl3741_FrameBuffer_set_brightness_obj, is31fl3741_FrameBuffer_set_brightness); -const mp_obj_property_t is31fl3741_FrameBuffer_brightness_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&is31fl3741_FrameBuffer_get_brightness_obj, - (mp_obj_t)&is31fl3741_FrameBuffer_set_brightness_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(is31fl3741_FrameBuffer_brightness_obj, + (mp_obj_t)&is31fl3741_FrameBuffer_get_brightness_obj, + (mp_obj_t)&is31fl3741_FrameBuffer_set_brightness_obj); //| def refresh(self) -> None: //| """Transmits the color data in the buffer to the pixels so that @@ -195,12 +192,8 @@ STATIC mp_obj_t is31fl3741_FrameBuffer_get_width(mp_obj_t self_in) { return MP_OBJ_NEW_SMALL_INT(common_hal_is31fl3741_FrameBuffer_get_width(self)); } MP_DEFINE_CONST_FUN_OBJ_1(is31fl3741_FrameBuffer_get_width_obj, is31fl3741_FrameBuffer_get_width); -const mp_obj_property_t is31fl3741_FrameBuffer_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&is31fl3741_FrameBuffer_get_width_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(is31fl3741_FrameBuffer_width_obj, + (mp_obj_t)&is31fl3741_FrameBuffer_get_width_obj); //| height: int //| """The height of the display, in pixels""" @@ -211,12 +204,8 @@ STATIC mp_obj_t is31fl3741_FrameBuffer_get_height(mp_obj_t self_in) { return MP_OBJ_NEW_SMALL_INT(common_hal_is31fl3741_FrameBuffer_get_height(self)); } MP_DEFINE_CONST_FUN_OBJ_1(is31fl3741_FrameBuffer_get_height_obj, is31fl3741_FrameBuffer_get_height); -const mp_obj_property_t is31fl3741_FrameBuffer_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&is31fl3741_FrameBuffer_get_height_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(is31fl3741_FrameBuffer_height_obj, + (mp_obj_t)&is31fl3741_FrameBuffer_get_height_obj); STATIC const mp_rom_map_elem_t is31fl3741_FrameBuffer_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&is31fl3741_FrameBuffer_deinit_obj) }, diff --git a/shared-bindings/is31fl3741/IS31FL3741.h b/shared-bindings/is31fl3741/IS31FL3741.h index 2b81b01617..62302a3ac2 100644 --- a/shared-bindings/is31fl3741/IS31FL3741.h +++ b/shared-bindings/is31fl3741/IS31FL3741.h @@ -46,4 +46,4 @@ void common_hal_is31fl3741_send_reset(is31fl3741_IS31FL3741_obj_t *self); void common_hal_is31fl3741_set_current(is31fl3741_IS31FL3741_obj_t *self, uint8_t current); uint8_t common_hal_is31fl3741_get_current(is31fl3741_IS31FL3741_obj_t *self); void common_hal_is31fl3741_set_led(is31fl3741_IS31FL3741_obj_t *self, uint16_t led, uint8_t level, uint8_t page); -void common_hal_is31fl3741_draw_pixel(is31fl3741_IS31FL3741_obj_t *self, int16_t x, int16_t y, uint32_t color, uint16_t *mapping); +void common_hal_is31fl3741_draw_pixel(is31fl3741_IS31FL3741_obj_t *self, int16_t x, int16_t y, uint32_t color, uint16_t *mapping, uint8_t display_height); diff --git a/shared-bindings/keypad/Event.c b/shared-bindings/keypad/Event.c index fda44d3521..380b6b5b41 100644 --- a/shared-bindings/keypad/Event.c +++ b/shared-bindings/keypad/Event.c @@ -36,7 +36,7 @@ //| def __init__(self, key_number: int=0, pressed: bool=True, timestamp:Optional[int]=None) -> None: //| """Create a key transition event, which reports a key-pressed or key-released transition. //| -//| :param int key_number: the key number +//| :param int key_number: The key number. //| :param bool pressed: ``True`` if the key was pressed; ``False`` if it was released. //| :param int timestamp: The time in milliseconds that the keypress occurred in the `supervisor.ticks_ms` time system. If specified as None, the current value of `supervisor.ticks_ms` is used. //| """ @@ -76,12 +76,8 @@ STATIC mp_obj_t keypad_event_get_key_number(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(keypad_event_get_key_number_obj, keypad_event_get_key_number); -const mp_obj_property_t keypad_event_key_number_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_event_get_key_number_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(keypad_event_key_number_obj, + (mp_obj_t)&keypad_event_get_key_number_obj); //| pressed: bool //| """``True`` if the event represents a key down (pressed) transition. @@ -94,12 +90,8 @@ STATIC mp_obj_t keypad_event_get_pressed(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(keypad_event_get_pressed_obj, keypad_event_get_pressed); -const mp_obj_property_t keypad_event_pressed_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_event_get_pressed_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(keypad_event_pressed_obj, + (mp_obj_t)&keypad_event_get_pressed_obj); //| released: bool //| """``True`` if the event represents a key up (released) transition. @@ -112,15 +104,11 @@ STATIC mp_obj_t keypad_event_get_released(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(keypad_event_get_released_obj, keypad_event_get_released); -const mp_obj_property_t keypad_event_released_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_event_get_released_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(keypad_event_released_obj, + (mp_obj_t)&keypad_event_get_released_obj); //| timestamp: int -//| """The timestamp""" +//| """The timestamp.""" //| STATIC mp_obj_t keypad_event_get_timestamp(mp_obj_t self_in) { keypad_event_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -128,12 +116,8 @@ STATIC mp_obj_t keypad_event_get_timestamp(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(keypad_event_get_timestamp_obj, keypad_event_get_timestamp); -const mp_obj_property_t keypad_event_timestamp_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_event_get_timestamp_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(keypad_event_timestamp_obj, + (mp_obj_t)&keypad_event_get_timestamp_obj); //| def __eq__(self, other: object) -> bool: diff --git a/shared-bindings/keypad/EventQueue.c b/shared-bindings/keypad/EventQueue.c index 2cb449551b..ed182033dc 100644 --- a/shared-bindings/keypad/EventQueue.c +++ b/shared-bindings/keypad/EventQueue.c @@ -24,8 +24,11 @@ * THE SOFTWARE. */ +#include "py/ioctl.h" +#include "py/mperrno.h" #include "py/objproperty.h" #include "py/runtime.h" +#include "py/stream.h" #include "shared-bindings/keypad/Event.h" #include "shared-bindings/keypad/EventQueue.h" @@ -45,7 +48,7 @@ //| If a new event arrives when the queue is full, the event is discarded, and //| `overflowed` is set to ``True``. //| -//| :return: the next queued key transition `Event` +//| :return: The next queued key transition `Event`. //| :rtype: Optional[Event] //| """ //| ... @@ -129,12 +132,8 @@ STATIC mp_obj_t keypad_eventqueue_get_overflowed(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(keypad_eventqueue_get_overflowed_obj, keypad_eventqueue_get_overflowed); -const mp_obj_property_t keypad_eventqueue_overflowed_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_eventqueue_get_overflowed_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(keypad_eventqueue_overflowed_obj, + (mp_obj_t)&keypad_eventqueue_get_overflowed_obj); STATIC const mp_rom_map_elem_t keypad_eventqueue_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_clear), MP_ROM_PTR(&keypad_eventqueue_clear_obj) }, @@ -145,12 +144,41 @@ STATIC const mp_rom_map_elem_t keypad_eventqueue_locals_dict_table[] = { STATIC MP_DEFINE_CONST_DICT(keypad_eventqueue_locals_dict, keypad_eventqueue_locals_dict_table); +#if MICROPY_PY_USELECT +STATIC mp_uint_t eventqueue_ioctl(mp_obj_t self_in, mp_uint_t request, uintptr_t arg, int *errcode) { + (void)errcode; + keypad_eventqueue_obj_t *self = MP_OBJ_TO_PTR(self_in); + switch (request) { + case MP_STREAM_POLL: { + mp_uint_t flags = arg; + mp_uint_t ret = 0; + if ((flags & MP_IOCTL_POLL_RD) && common_hal_keypad_eventqueue_get_length(self)) { + ret |= MP_IOCTL_POLL_RD; + } + return ret; + } + default: + *errcode = MP_EINVAL; + return MP_STREAM_ERROR; + } +} + +STATIC const mp_stream_p_t eventqueue_p = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) + .ioctl = eventqueue_ioctl, +}; +#endif + + const mp_obj_type_t keypad_eventqueue_type = { { &mp_type_type }, .flags = MP_TYPE_FLAG_EXTENDED, .name = MP_QSTR_EventQueue, MP_TYPE_EXTENDED_FIELDS( .unary_op = keypad_eventqueue_unary_op, + #if MICROPY_PY_USELECT + .protocol = &eventqueue_p, + #endif ), .locals_dict = (mp_obj_t)&keypad_eventqueue_locals_dict, }; diff --git a/shared-bindings/keypad/KeyMatrix.c b/shared-bindings/keypad/KeyMatrix.c index 486fa0b9b5..9e65471a2b 100644 --- a/shared-bindings/keypad/KeyMatrix.c +++ b/shared-bindings/keypad/KeyMatrix.c @@ -28,6 +28,7 @@ #include "py/binary.h" #include "py/objproperty.h" #include "py/runtime.h" +#include "shared-bindings/keypad/__init__.h" #include "shared-bindings/keypad/Event.h" #include "shared-bindings/keypad/KeyMatrix.h" #include "shared-bindings/microcontroller/Pin.h" @@ -138,7 +139,7 @@ STATIC mp_obj_t keypad_keymatrix___exit__(size_t n_args, const mp_obj_t *args) { STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(keypad_keymatrix___exit___obj, 4, 4, keypad_keymatrix___exit__); STATIC void check_for_deinit(keypad_keymatrix_obj_t *self) { - if (common_hal_keypad_keymatrix_deinited(self)) { + if (common_hal_keypad_deinited(self)) { raise_deinited_error(); } } @@ -150,35 +151,13 @@ STATIC void check_for_deinit(keypad_keymatrix_obj_t *self) { //| """ //| ... //| -STATIC mp_obj_t keypad_keymatrix_reset(mp_obj_t self_in) { - keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_keypad_keymatrix_reset(self); - return MP_ROM_NONE; -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keymatrix_reset_obj, keypad_keymatrix_reset); //| key_count: int //| """The number of keys that are being scanned. (read-only) //| """ //| -STATIC mp_obj_t keypad_keymatrix_get_key_count(mp_obj_t self_in) { - keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_keymatrix_get_key_count(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keymatrix_get_key_count_obj, keypad_keymatrix_get_key_count); - -const mp_obj_property_t keypad_keymatrix_key_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_keymatrix_get_key_count_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; - -//| def key_number_to_row_column(self, row: int, column: int) -> Tuple[int]: +//| def key_number_to_row_column(self, key_number: int) -> Tuple[int]: //| """Return the row and column for the given key number. //| The row is ``key_number // len(column_pins)``. //| The column is ``key_number % len(column_pins)``. @@ -194,7 +173,7 @@ STATIC mp_obj_t keypad_keymatrix_key_number_to_row_column(mp_obj_t self_in, mp_o const mp_uint_t key_number = (mp_uint_t)mp_arg_validate_int_range( mp_obj_get_int(key_number_in), - 0, (mp_int_t)common_hal_keypad_keymatrix_get_key_count(self), + 0, (mp_int_t)common_hal_keypad_generic_get_key_count(self), MP_QSTR_key_number); mp_uint_t row; @@ -234,29 +213,15 @@ MP_DEFINE_CONST_FUN_OBJ_3(keypad_keymatrix_row_column_to_key_number_obj, keypad_ //| """The `EventQueue` associated with this `Keys` object. (read-only) //| """ //| -STATIC mp_obj_t keypad_keymatrix_get_events(mp_obj_t self_in) { - keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return common_hal_keypad_keymatrix_get_events(self); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keymatrix_get_events_obj, keypad_keymatrix_get_events); - -const mp_obj_property_t keypad_keymatrix_events_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_keymatrix_get_events_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; STATIC const mp_rom_map_elem_t keypad_keymatrix_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&keypad_keymatrix_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&keypad_keymatrix___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_keymatrix_events_obj) }, - { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_keymatrix_key_count_obj) }, - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_keymatrix_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_generic_events_obj) }, + { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_generic_key_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_generic_reset_obj) }, { MP_ROM_QSTR(MP_QSTR_key_number_to_row_column), MP_ROM_PTR(&keypad_keymatrix_key_number_to_row_column_obj) }, { MP_ROM_QSTR(MP_QSTR_row_column_to_key_number), MP_ROM_PTR(&keypad_keymatrix_row_column_to_key_number_obj) }, }; diff --git a/shared-bindings/keypad/KeyMatrix.h b/shared-bindings/keypad/KeyMatrix.h index 29a94fbf66..bdf77dd32a 100644 --- a/shared-bindings/keypad/KeyMatrix.h +++ b/shared-bindings/keypad/KeyMatrix.h @@ -35,16 +35,11 @@ extern const mp_obj_type_t keypad_keymatrix_type; void common_hal_keypad_keymatrix_construct(keypad_keymatrix_obj_t *self, mp_uint_t num_row_pins, const mcu_pin_obj_t *row_pins[], mp_uint_t num_column_pins, const mcu_pin_obj_t *column_pins[], bool columns_to_anodes, mp_float_t interval, size_t max_events); void common_hal_keypad_keymatrix_deinit(keypad_keymatrix_obj_t *self); -bool common_hal_keypad_keymatrix_deinited(keypad_keymatrix_obj_t *self); void common_hal_keypad_keymatrix_key_number_to_row_column(keypad_keymatrix_obj_t *self, mp_uint_t key_number, mp_uint_t *row, mp_uint_t *column); mp_uint_t common_hal_keypad_keymatrix_row_column_to_key_number(keypad_keymatrix_obj_t *self, mp_uint_t row, mp_uint_t column); -size_t common_hal_keypad_keymatrix_get_key_count(keypad_keymatrix_obj_t *self); size_t common_hal_keypad_keymatrix_get_column_count(keypad_keymatrix_obj_t *self); size_t common_hal_keypad_keymatrix_get_row_count(keypad_keymatrix_obj_t *self); -mp_obj_t common_hal_keypad_keymatrix_get_events(keypad_keymatrix_obj_t *self); -void common_hal_keypad_keymatrix_reset(keypad_keymatrix_obj_t *self); - #endif // MICROPY_INCLUDED_SHARED_BINDINGS_KEYPAD_KEYMATRIX_H diff --git a/shared-bindings/keypad/Keys.c b/shared-bindings/keypad/Keys.c index 2da55bccba..6ac705eba6 100644 --- a/shared-bindings/keypad/Keys.c +++ b/shared-bindings/keypad/Keys.c @@ -28,6 +28,7 @@ #include "py/binary.h" #include "py/objproperty.h" #include "py/runtime.h" +#include "shared-bindings/keypad/__init__.h" #include "shared-bindings/keypad/Event.h" #include "shared-bindings/keypad/Keys.h" #include "shared-bindings/microcontroller/Pin.h" @@ -129,11 +130,6 @@ STATIC mp_obj_t keypad_keys___exit__(size_t n_args, const mp_obj_t *args) { } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(keypad_keys___exit___obj, 4, 4, keypad_keys___exit__); -STATIC void check_for_deinit(keypad_keys_obj_t *self) { - if (common_hal_keypad_keys_deinited(self)) { - raise_deinited_error(); - } -} //| def reset(self) -> None: //| """Reset the internal state of the scanner to assume that all keys are now released. @@ -142,61 +138,24 @@ STATIC void check_for_deinit(keypad_keys_obj_t *self) { //| """ //| ... //| -STATIC mp_obj_t keypad_keys_reset(mp_obj_t self_in) { - keypad_keys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_keypad_keys_reset(self); - return MP_ROM_NONE; -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keys_reset_obj, keypad_keys_reset); //| key_count: int //| """The number of keys that are being scanned. (read-only) //| """ //| -STATIC mp_obj_t keypad_keys_get_key_count(mp_obj_t self_in) { - keypad_keys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_keys_get_key_count(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keys_get_key_count_obj, keypad_keys_get_key_count); - -const mp_obj_property_t keypad_keys_key_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_keys_get_key_count_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; //| events: EventQueue //| """The `EventQueue` associated with this `Keys` object. (read-only) //| """ //| -STATIC mp_obj_t keypad_keys_get_events(mp_obj_t self_in) { - keypad_keys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return common_hal_keypad_keys_get_events(self); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_keys_get_events_obj, keypad_keys_get_events); - -const mp_obj_property_t keypad_keys_events_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_keys_get_events_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; - STATIC const mp_rom_map_elem_t keypad_keys_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&keypad_keys_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&keypad_keys___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_keys_events_obj) }, - { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_keys_key_count_obj) }, - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_keys_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_generic_events_obj) }, + { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_generic_key_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_generic_reset_obj) }, }; STATIC MP_DEFINE_CONST_DICT(keypad_keys_locals_dict, keypad_keys_locals_dict_table); diff --git a/shared-bindings/keypad/Keys.h b/shared-bindings/keypad/Keys.h index 89da18189a..eb833b97d6 100644 --- a/shared-bindings/keypad/Keys.h +++ b/shared-bindings/keypad/Keys.h @@ -35,10 +35,5 @@ extern const mp_obj_type_t keypad_keys_type; void common_hal_keypad_keys_construct(keypad_keys_obj_t *self, mp_uint_t num_pins, const mcu_pin_obj_t *pins[], bool value_when_pressed, bool pull, mp_float_t interval, size_t max_events); void common_hal_keypad_keys_deinit(keypad_keys_obj_t *self); -bool common_hal_keypad_keys_deinited(keypad_keys_obj_t *self); - -mp_obj_t common_hal_keypad_keys_get_events(keypad_keys_obj_t *self); -size_t common_hal_keypad_keys_get_key_count(keypad_keys_obj_t *self); -void common_hal_keypad_keys_reset(keypad_keys_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_KEYPAD_KEYS_H diff --git a/shared-bindings/keypad/ShiftRegisterKeys.c b/shared-bindings/keypad/ShiftRegisterKeys.c index 0032a45438..14ab87436b 100644 --- a/shared-bindings/keypad/ShiftRegisterKeys.c +++ b/shared-bindings/keypad/ShiftRegisterKeys.c @@ -28,6 +28,7 @@ #include "py/binary.h" #include "py/objproperty.h" #include "py/runtime.h" +#include "shared-bindings/keypad/__init__.h" #include "shared-bindings/keypad/Event.h" #include "shared-bindings/keypad/ShiftRegisterKeys.h" #include "shared-bindings/microcontroller/Pin.h" @@ -133,12 +134,6 @@ STATIC mp_obj_t keypad_shiftregisterkeys___exit__(size_t n_args, const mp_obj_t } STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(keypad_shiftregisterkeys___exit___obj, 4, 4, keypad_shiftregisterkeys___exit__); -STATIC void check_for_deinit(keypad_shiftregisterkeys_obj_t *self) { - if (common_hal_keypad_shiftregisterkeys_deinited(self)) { - raise_deinited_error(); - } -} - //| def reset(self) -> None: //| """Reset the internal state of the scanner to assume that all keys are now released. //| Any key that is already pressed at the time of this call will therefore immediately cause @@ -146,61 +141,25 @@ STATIC void check_for_deinit(keypad_shiftregisterkeys_obj_t *self) { //| """ //| ... //| -STATIC mp_obj_t keypad_shiftregisterkeys_reset(mp_obj_t self_in) { - keypad_shiftregisterkeys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - common_hal_keypad_shiftregisterkeys_reset(self); - return MP_ROM_NONE; -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_shiftregisterkeys_reset_obj, keypad_shiftregisterkeys_reset); //| key_count: int //| """The number of keys that are being scanned. (read-only) //| """ //| -STATIC mp_obj_t keypad_shiftregisterkeys_get_key_count(mp_obj_t self_in) { - keypad_shiftregisterkeys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_shiftregisterkeys_get_key_count(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_shiftregisterkeys_get_key_count_obj, keypad_shiftregisterkeys_get_key_count); - -const mp_obj_property_t keypad_shiftregisterkeys_key_count_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_shiftregisterkeys_get_key_count_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; //| events: EventQueue //| """The `EventQueue` associated with this `Keys` object. (read-only) //| """ //| -STATIC mp_obj_t keypad_shiftregisterkeys_get_events(mp_obj_t self_in) { - keypad_shiftregisterkeys_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return common_hal_keypad_shiftregisterkeys_get_events(self); -} -MP_DEFINE_CONST_FUN_OBJ_1(keypad_shiftregisterkeys_get_events_obj, keypad_shiftregisterkeys_get_events); - -const mp_obj_property_t keypad_shiftregisterkeys_events_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&keypad_shiftregisterkeys_get_events_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; STATIC const mp_rom_map_elem_t keypad_shiftregisterkeys_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&keypad_shiftregisterkeys_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&keypad_shiftregisterkeys___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_shiftregisterkeys_events_obj) }, - { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_shiftregisterkeys_key_count_obj) }, - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_shiftregisterkeys_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_events), MP_ROM_PTR(&keypad_generic_events_obj) }, + { MP_ROM_QSTR(MP_QSTR_key_count), MP_ROM_PTR(&keypad_generic_key_count_obj) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&keypad_generic_reset_obj) }, }; STATIC MP_DEFINE_CONST_DICT(keypad_shiftregisterkeys_locals_dict, keypad_shiftregisterkeys_locals_dict_table); diff --git a/shared-bindings/keypad/ShiftRegisterKeys.h b/shared-bindings/keypad/ShiftRegisterKeys.h index 62ab14d340..bc91c78ab0 100644 --- a/shared-bindings/keypad/ShiftRegisterKeys.h +++ b/shared-bindings/keypad/ShiftRegisterKeys.h @@ -35,10 +35,5 @@ extern const mp_obj_type_t keypad_shiftregisterkeys_type; void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_t *self, const mcu_pin_obj_t *clock_pin, const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *latch_pin, bool value_to_latch, size_t key_count, bool value_when_pressed, mp_float_t interval, size_t max_events); void common_hal_keypad_shiftregisterkeys_deinit(keypad_shiftregisterkeys_obj_t *self); -bool common_hal_keypad_shiftregisterkeys_deinited(keypad_shiftregisterkeys_obj_t *self); - -mp_obj_t common_hal_keypad_shiftregisterkeys_get_events(keypad_shiftregisterkeys_obj_t *self); -size_t common_hal_keypad_shiftregisterkeys_get_key_count(keypad_shiftregisterkeys_obj_t *self); -void common_hal_keypad_shiftregisterkeys_reset(keypad_shiftregisterkeys_obj_t *self); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_KEYPAD_SHIFTREGISTERKEYS_H diff --git a/shared-bindings/keypad/__init__.c b/shared-bindings/keypad/__init__.c index 4450e892ca..3822b8ea53 100644 --- a/shared-bindings/keypad/__init__.c +++ b/shared-bindings/keypad/__init__.c @@ -32,6 +32,53 @@ #include "shared-bindings/keypad/KeyMatrix.h" #include "shared-bindings/keypad/Keys.h" #include "shared-bindings/keypad/ShiftRegisterKeys.h" +#include "shared-bindings/util.h" + +STATIC void check_for_deinit(keypad_keymatrix_obj_t *self) { + if (common_hal_keypad_deinited(self)) { + raise_deinited_error(); + } +} + +STATIC mp_obj_t keypad_generic_reset(mp_obj_t self_in) { + keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + common_hal_keypad_generic_reset(self); + return MP_ROM_NONE; +} +MP_DEFINE_CONST_FUN_OBJ_1(keypad_generic_reset_obj, keypad_generic_reset); + +STATIC mp_obj_t keypad_generic_get_key_count(mp_obj_t self_in) { + keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + return MP_OBJ_NEW_SMALL_INT(common_hal_keypad_generic_get_key_count(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(keypad_generic_get_key_count_obj, keypad_generic_get_key_count); + +const mp_obj_property_t keypad_generic_key_count_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&keypad_generic_get_key_count_obj, + MP_ROM_NONE, + MP_ROM_NONE}, +}; + +STATIC mp_obj_t keypad_generic_get_events(mp_obj_t self_in) { + keypad_keymatrix_obj_t *self = MP_OBJ_TO_PTR(self_in); + check_for_deinit(self); + + return common_hal_keypad_generic_get_events(self); +} +MP_DEFINE_CONST_FUN_OBJ_1(keypad_generic_get_events_obj, keypad_generic_get_events); + +const mp_obj_property_t keypad_generic_events_obj = { + .base.type = &mp_type_property, + .proxy = {(mp_obj_t)&keypad_generic_get_events_obj, + MP_ROM_NONE, + MP_ROM_NONE}, +}; + //| """Support for scanning keys and key matrices //| @@ -39,6 +86,9 @@ //| connected independently to individual pins, //| connected to a shift register, //| or connected in a row-and-column matrix. +//| +//| For more information about working with the `keypad` module in CircuitPython, +//| see `this Learn guide `_. //| """ //| diff --git a/shared-bindings/keypad/__init__.h b/shared-bindings/keypad/__init__.h index 5e484dc5ed..eb3b16aa4b 100644 --- a/shared-bindings/keypad/__init__.h +++ b/shared-bindings/keypad/__init__.h @@ -28,14 +28,17 @@ #define SHARED_BINDINGS_KEYPAD_H #include "py/obj.h" -#include "py/objtuple.h" +#include "py/objproperty.h" #include "shared-module/keypad/__init__.h" -extern mp_obj_tuple_t common_hal_keypad_devices; +bool common_hal_keypad_deinited(void *self); +void common_hal_keypad_generic_reset(void *self); +size_t common_hal_keypad_generic_get_key_count(void *self); +mp_obj_t common_hal_keypad_generic_get_events(void *self); -void keypad_set_devices(mp_obj_t devices); +MP_DECLARE_CONST_FUN_OBJ_1(keypad_generic_reset_obj); -bool common_hal_keypad_disable(void); -bool common_hal_keypad_enable(const mp_obj_t devices_seq); +extern const mp_obj_property_t keypad_generic_events_obj; +extern const mp_obj_property_t keypad_generic_key_count_obj; #endif // SHARED_BINDINGS_KEYPAD_H diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index d41097ad8e..f5fb45cb4d 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -27,7 +27,7 @@ #include "py/builtin.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #if MICROPY_PY_BUILTINS_FLOAT @@ -41,7 +41,10 @@ //| """mathematical functions //| //| The `math` module provides some basic mathematical functions for -//| working with floating-point numbers.""" +//| working with floating-point numbers. +//| +//| |see_cpython_module| :mod:`cpython:math`. +//| """ //| STATIC NORETURN void math_error(void) { @@ -157,6 +160,11 @@ STATIC NORETURN void math_error(void) { //| """Return ``x * (2**exp)``.""" //| ... //| +//| def log(x: float, base: float = e) -> float: +//| """Return the logarithm of x to the given base. If base is not specified, +//| returns the natural logarithm (base e) of x""" +//| ... +//| //| def modf(x: float) -> Tuple[float, float]: //| """Return a tuple of two floats, being the fractional and integral parts of //| ``x``. Both return values have the same sign as ``x``.""" diff --git a/shared-bindings/mdns/RemoteService.c b/shared-bindings/mdns/RemoteService.c index ecded5561f..49eda58557 100644 --- a/shared-bindings/mdns/RemoteService.c +++ b/shared-bindings/mdns/RemoteService.c @@ -52,12 +52,8 @@ STATIC mp_obj_t mdns_remoteservice_get_hostname(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mdns_remoteservice_get_hostname_obj, mdns_remoteservice_get_hostname); -const mp_obj_property_t mdns_remoteservice_hostname_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&mdns_remoteservice_get_hostname_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(mdns_remoteservice_hostname_obj, + (mp_obj_t)&mdns_remoteservice_get_hostname_obj); //| instance_name: str //| """The human readable instance name for the service. (read-only)""" @@ -69,12 +65,8 @@ STATIC mp_obj_t remoteservice_get_instance_name(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mdns_remoteservice_get_instance_name_obj, remoteservice_get_instance_name); -const mp_obj_property_t mdns_remoteservice_instance_name_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&mdns_remoteservice_get_instance_name_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(mdns_remoteservice_instance_name_obj, + (mp_obj_t)&mdns_remoteservice_get_instance_name_obj); //| service_type: str //| """The service type string such as ``_http``. (read-only)""" @@ -86,12 +78,8 @@ STATIC mp_obj_t remoteservice_get_service_type(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mdns_remoteservice_get_service_type_obj, remoteservice_get_service_type); -const mp_obj_property_t mdns_remoteservice_service_type_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&mdns_remoteservice_get_service_type_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(mdns_remoteservice_service_type_obj, + (mp_obj_t)&mdns_remoteservice_get_service_type_obj); //| protocol: str //| """The protocol string such as ``_tcp``. (read-only)""" @@ -103,12 +91,8 @@ STATIC mp_obj_t remoteservice_get_protocol(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mdns_remoteservice_get_protocol_obj, remoteservice_get_protocol); -const mp_obj_property_t mdns_remoteservice_protocol_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&mdns_remoteservice_get_protocol_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(mdns_remoteservice_protocol_obj, + (mp_obj_t)&mdns_remoteservice_get_protocol_obj); //| port: int //| """Port number used for the service. (read-only)""" @@ -119,12 +103,20 @@ STATIC mp_obj_t remoteservice_get_port(mp_obj_t self_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(mdns_remoteservice_get_port_obj, remoteservice_get_port); -const mp_obj_property_t mdns_remoteservice_port_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&mdns_remoteservice_get_port_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(mdns_remoteservice_port_obj, + (mp_obj_t)&mdns_remoteservice_get_port_obj); + +//| ipv4_address: Optional[ipaddress.IPv4Address] +//| """IP v4 Address of the remote service. None if no A records are found.""" +//| +STATIC mp_obj_t _mdns_remoteservice_get_ipv4_address(mp_obj_t self) { + return common_hal_mdns_remoteservice_get_ipv4_address(self); + +} +MP_DEFINE_CONST_FUN_OBJ_1(mdns_remoteservice_get_ipv4_address_obj, _mdns_remoteservice_get_ipv4_address); + +MP_PROPERTY_GETTER(mdns_remoteservice_ipv4_address_obj, + (mp_obj_t)&mdns_remoteservice_get_ipv4_address_obj); //| def __del__(self) -> None: //| """Deletes the RemoteService object.""" @@ -143,6 +135,7 @@ STATIC const mp_rom_map_elem_t mdns_remoteservice_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_service_type), MP_ROM_PTR(&mdns_remoteservice_service_type_obj) }, { MP_ROM_QSTR(MP_QSTR_protocol), MP_ROM_PTR(&mdns_remoteservice_protocol_obj) }, { MP_ROM_QSTR(MP_QSTR_port), MP_ROM_PTR(&mdns_remoteservice_port_obj) }, + { MP_ROM_QSTR(MP_QSTR_ipv4_address), MP_ROM_PTR(&mdns_remoteservice_ipv4_address_obj) }, { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&mdns_remoteservice_deinit_obj) }, }; diff --git a/shared-bindings/mdns/RemoteService.h b/shared-bindings/mdns/RemoteService.h index f751b683ed..4783170e88 100644 --- a/shared-bindings/mdns/RemoteService.h +++ b/shared-bindings/mdns/RemoteService.h @@ -38,4 +38,8 @@ const char *common_hal_mdns_remoteservice_get_protocol(mdns_remoteservice_obj_t const char *common_hal_mdns_remoteservice_get_instance_name(mdns_remoteservice_obj_t *self); const char *common_hal_mdns_remoteservice_get_hostname(mdns_remoteservice_obj_t *self); mp_int_t common_hal_mdns_remoteservice_get_port(mdns_remoteservice_obj_t *self); +mp_obj_t common_hal_mdns_remoteservice_get_ipv4_address(mdns_remoteservice_obj_t *self); void common_hal_mdns_remoteservice_deinit(mdns_remoteservice_obj_t *self); + +// For internal use. +uint32_t mdns_remoteservice_get_ipv4_address(mdns_remoteservice_obj_t *self); diff --git a/shared-bindings/mdns/Server.c b/shared-bindings/mdns/Server.c index 132d218aeb..bcf761d72a 100644 --- a/shared-bindings/mdns/Server.c +++ b/shared-bindings/mdns/Server.c @@ -99,12 +99,9 @@ static mp_obj_t mdns_server_set_hostname(mp_obj_t self, mp_obj_t hostname) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(mdns_server_set_hostname_obj, mdns_server_set_hostname); -const mp_obj_property_t mdns_server_hostname_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&mdns_server_get_hostname_obj, - (mp_obj_t)&mdns_server_set_hostname_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(mdns_server_hostname_obj, + (mp_obj_t)&mdns_server_get_hostname_obj, + (mp_obj_t)&mdns_server_set_hostname_obj); //| instance_name: str //| """Human readable name to describe the device.""" @@ -123,12 +120,9 @@ STATIC mp_obj_t mdns_server_set_instance_name(mp_obj_t self, mp_obj_t new_instan } MP_DEFINE_CONST_FUN_OBJ_2(mdns_server_set_instance_name_obj, mdns_server_set_instance_name); -const mp_obj_property_t mdns_server_instance_name_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&mdns_server_get_instance_name_obj, - (mp_obj_t)&mdns_server_set_instance_name_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(mdns_server_instance_name_obj, + (mp_obj_t)&mdns_server_get_instance_name_obj, + (mp_obj_t)&mdns_server_set_instance_name_obj); //| def find(self, service_type: str, protocol: str, *, timeout: float = 1) -> Tuple[RemoteService]: @@ -142,7 +136,7 @@ const mp_obj_property_t mdns_server_instance_name_obj = { //| :param float/int timeout: Time to wait for responses""" //| ... //| -STATIC mp_obj_t mdns_server_find(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +STATIC mp_obj_t _mdns_server_find(mp_uint_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { mdns_server_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); check_for_deinit(self); @@ -162,11 +156,14 @@ STATIC mp_obj_t mdns_server_find(mp_uint_t n_args, const mp_obj_t *pos_args, mp_ return common_hal_mdns_server_find(self, service_type, protocol, timeout); } -STATIC MP_DEFINE_CONST_FUN_OBJ_KW(mdns_server_find_obj, 1, mdns_server_find); +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(mdns_server_find_obj, 1, _mdns_server_find); //| def advertise_service(self, *, service_type: str, protocol: str, port: int) -> None: //| """Respond to queries for the given service with the given port. //| +//| ``service_type`` and ``protocol`` can only occur on one port. Any call after the first +//| will update the entry's port. +//| //| :param str service_type: The service type such as "_http" //| :param str protocol: The service protocol such as "_tcp" //| :param int port: The port used by the service""" diff --git a/shared-bindings/mdns/Server.h b/shared-bindings/mdns/Server.h index a178e9bd2d..351ab664b2 100644 --- a/shared-bindings/mdns/Server.h +++ b/shared-bindings/mdns/Server.h @@ -30,6 +30,8 @@ #include "common-hal/mdns/Server.h" +#include "shared-bindings/mdns/RemoteService.h" + extern const mp_obj_type_t mdns_server_type; void common_hal_mdns_server_construct(mdns_server_obj_t *self, mp_obj_t network_interface); @@ -41,3 +43,8 @@ const char *common_hal_mdns_server_get_instance_name(mdns_server_obj_t *self); void common_hal_mdns_server_set_instance_name(mdns_server_obj_t *self, const char *instance_name); mp_obj_t common_hal_mdns_server_find(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_float_t timeout); void common_hal_mdns_server_advertise_service(mdns_server_obj_t *self, const char *service_type, const char *protocol, mp_int_t port); + +// For internal use. +void mdns_server_construct(mdns_server_obj_t *self, bool workflow); +size_t mdns_server_find(mdns_server_obj_t *self, const char *service_type, const char *protocol, + mp_float_t timeout, mdns_remoteservice_obj_t *out, size_t out_len); diff --git a/shared-bindings/memorymonitor/AllocationAlarm.c b/shared-bindings/memorymonitor/AllocationAlarm.c index b54645225a..45e7019912 100644 --- a/shared-bindings/memorymonitor/AllocationAlarm.c +++ b/shared-bindings/memorymonitor/AllocationAlarm.c @@ -31,7 +31,7 @@ #include "py/runtime0.h" #include "shared-bindings/memorymonitor/AllocationAlarm.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class AllocationAlarm: //| @@ -63,10 +63,10 @@ STATIC mp_obj_t memorymonitor_allocationalarm_make_new(const mp_obj_type_t *type }; 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 minimum_block_count = args[ARG_minimum_block_count].u_int; - if (minimum_block_count < 1) { - mp_raise_ValueError_varg(translate("%q must be >= 1"), MP_QSTR_minimum_block_count); - } + + mp_int_t minimum_block_count = + mp_arg_validate_int_min(args[ARG_minimum_block_count].u_int, 1, MP_QSTR_minimum_block_count); + memorymonitor_allocationalarm_obj_t *self = m_new_obj(memorymonitor_allocationalarm_obj_t); self->base.type = &memorymonitor_allocationalarm_type; @@ -90,9 +90,8 @@ STATIC mp_obj_t memorymonitor_allocationalarm_make_new(const mp_obj_type_t *type //| STATIC mp_obj_t memorymonitor_allocationalarm_obj_ignore(mp_obj_t self_in, mp_obj_t count_obj) { mp_int_t count = mp_obj_get_int(count_obj); - if (count < 0) { - mp_raise_ValueError_varg(translate("%q must be >= 0"), MP_QSTR_count); - } + mp_arg_validate_int_min(count, 0, MP_QSTR_count); + common_hal_memorymonitor_allocationalarm_set_ignore(self_in, count); return self_in; } diff --git a/shared-bindings/memorymonitor/AllocationSize.c b/shared-bindings/memorymonitor/AllocationSize.c index 5679b30c3f..ed8252b67a 100644 --- a/shared-bindings/memorymonitor/AllocationSize.c +++ b/shared-bindings/memorymonitor/AllocationSize.c @@ -31,7 +31,7 @@ #include "py/runtime0.h" #include "shared-bindings/memorymonitor/AllocationSize.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class AllocationSize: //| @@ -105,12 +105,8 @@ STATIC mp_obj_t memorymonitor_allocationsize_obj_get_bytes_per_block(mp_obj_t se } MP_DEFINE_CONST_FUN_OBJ_1(memorymonitor_allocationsize_get_bytes_per_block_obj, memorymonitor_allocationsize_obj_get_bytes_per_block); -const mp_obj_property_t memorymonitor_allocationsize_bytes_per_block_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&memorymonitor_allocationsize_get_bytes_per_block_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(memorymonitor_allocationsize_bytes_per_block_obj, + (mp_obj_t)&memorymonitor_allocationsize_get_bytes_per_block_obj); //| def __len__(self) -> int: //| """Returns the number of allocation buckets. diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index ee8336fa8a..840f468e2a 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -31,7 +31,7 @@ #include "py/nlr.h" #include "py/obj.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Pin: //| """Identifies an IO pin on the microcontroller.""" @@ -43,6 +43,12 @@ //| ... //| +//| def __hash__(self) -> int: +//| """Returns a hash for the Pin.""" +//| ... +//| +// Provided by mp_generic_unary_op(). + static void get_pin_name(const mcu_pin_obj_t *self, qstr *package, qstr *module, qstr *name) { const mp_map_t *board_map = &board_module_globals.map; for (uint8_t i = 0; i < board_map->alloc; i++) { @@ -80,8 +86,12 @@ STATIC void mcu_pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_ki const mp_obj_type_t mcu_pin_type = { { &mp_type_type }, + .flags = MP_TYPE_FLAG_EXTENDED, .name = MP_QSTR_Pin, - .print = mcu_pin_print + .print = mcu_pin_print, + MP_TYPE_EXTENDED_FIELDS( + .unary_op = mp_generic_unary_op, + ) }; const mcu_pin_obj_t *validate_obj_is_pin(mp_obj_t obj) { @@ -184,3 +194,15 @@ void validate_pins(qstr what, uint8_t *pin_nos, mp_int_t max_pins, mp_obj_t seq, pin_nos[i] = common_hal_mcu_pin_number(pins[i]); } } + +NORETURN void raise_ValueError_invalid_pin(void) { + mp_arg_error_invalid(MP_QSTR_pin); +} + +NORETURN void raise_ValueError_invalid_pins(void) { + mp_arg_error_invalid(MP_QSTR_pins); +} + +NORETURN void raise_ValueError_invalid_pin_name(qstr pin_name) { + mp_raise_ValueError_varg(translate("Invalid %q pin"), pin_name); +} diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index a7378ea98e..12ff422a4a 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -41,6 +41,9 @@ void validate_no_duplicate_pins(mp_obj_t seq, qstr arg_name); void validate_no_duplicate_pins_2(mp_obj_t seq1, mp_obj_t seq2, qstr arg_name1, qstr arg_name2); void validate_list_is_free_pins(qstr what, const mcu_pin_obj_t **pins_out, mp_int_t max_pins, mp_obj_t seq, uint8_t *count_out); void validate_pins(qstr what, uint8_t *pin_nos, mp_int_t max_pins, mp_obj_t seq, uint8_t *count_out); +NORETURN void raise_ValueError_invalid_pin(void); +NORETURN void raise_ValueError_invalid_pins(void); +NORETURN void raise_ValueError_invalid_pin_name(qstr pin_name); void assert_pin_free(const mcu_pin_obj_t *pin); diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c index dfcafcd324..067d6b0097 100644 --- a/shared-bindings/microcontroller/Processor.c +++ b/shared-bindings/microcontroller/Processor.c @@ -30,9 +30,16 @@ #include #include -#include "py/objproperty.h" +#include "shared-bindings/util.h" +#include "shared/runtime/buffer_helper.h" +#include "shared/runtime/context_manager_helpers.h" +#include "py/mperrno.h" +#include "py/objtype.h" +#include "py/objproperty.h" #include "py/runtime.h" +#include "supervisor/shared/translate/translate.h" + //| class Processor: //| """Microcontroller CPU information and control @@ -61,19 +68,29 @@ //| frequency: int //| """The CPU operating frequency in Hertz. (read-only)""" //| + +STATIC mp_obj_t mcu_processor_set_frequency(mp_obj_t self, mp_obj_t freq) { + #if CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY + uint32_t value_of_freq = (uint32_t)mp_arg_validate_int_min(mp_obj_get_int(freq), 0, MP_QSTR_frequency); + common_hal_mcu_processor_set_frequency(self, value_of_freq); + #else + mp_raise_msg(&mp_type_NotImplementedError,translate("frequency is read-only for this board")); + #endif + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_2(mcu_processor_set_frequency_obj, mcu_processor_set_frequency); + + STATIC mp_obj_t mcu_processor_get_frequency(mp_obj_t self) { return mp_obj_new_int_from_uint(common_hal_mcu_processor_get_frequency()); } MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_frequency_obj, mcu_processor_get_frequency); -const mp_obj_property_t mcu_processor_frequency_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&mcu_processor_get_frequency_obj, // getter - MP_ROM_NONE, // no setter - MP_ROM_NONE, // no deleter - }, -}; +MP_PROPERTY_GETSET(mcu_processor_frequency_obj, + (mp_obj_t)&mcu_processor_get_frequency_obj, + (mp_obj_t)&mcu_processor_set_frequency_obj); //| reset_reason: microcontroller.ResetReason //| """The reason the microcontroller started up from reset state.""" @@ -84,13 +101,8 @@ STATIC mp_obj_t mcu_processor_get_reset_reason(mp_obj_t self) { MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_reset_reason_obj, mcu_processor_get_reset_reason); -const mp_obj_property_t mcu_processor_reset_reason_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&mcu_processor_get_reset_reason_obj, // getter - MP_ROM_NONE, // no setter - MP_ROM_NONE, // no deleter - }, -}; +MP_PROPERTY_GETTER(mcu_processor_reset_reason_obj, + (mp_obj_t)&mcu_processor_get_reset_reason_obj); //| temperature: Optional[float] //| """The on-chip temperature, in Celsius, as a float. (read-only) @@ -104,13 +116,8 @@ STATIC mp_obj_t mcu_processor_get_temperature(mp_obj_t self) { MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_temperature_obj, mcu_processor_get_temperature); -const mp_obj_property_t mcu_processor_temperature_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&mcu_processor_get_temperature_obj, // getter - MP_ROM_NONE, // no setter - MP_ROM_NONE, // no deleter - }, -}; +MP_PROPERTY_GETTER(mcu_processor_temperature_obj, + (mp_obj_t)&mcu_processor_get_temperature_obj); //| uid: bytearray //| """The unique id (aka serial number) of the chip as a `bytearray`. (read-only)""" @@ -123,13 +130,8 @@ STATIC mp_obj_t mcu_processor_get_uid(mp_obj_t self) { MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_uid_obj, mcu_processor_get_uid); -const mp_obj_property_t mcu_processor_uid_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&mcu_processor_get_uid_obj, // getter - MP_ROM_NONE, // no setter - MP_ROM_NONE, // no deleter - }, -}; +MP_PROPERTY_GETTER(mcu_processor_uid_obj, + (mp_obj_t)&mcu_processor_get_uid_obj); //| voltage: Optional[float] //| """The input voltage to the microcontroller, as a float. (read-only) @@ -143,13 +145,8 @@ STATIC mp_obj_t mcu_processor_get_voltage(mp_obj_t self) { MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_voltage_obj, mcu_processor_get_voltage); -const mp_obj_property_t mcu_processor_voltage_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&mcu_processor_get_voltage_obj, // getter - MP_ROM_NONE, // no setter - MP_ROM_NONE, // no deleter - }, -}; +MP_PROPERTY_GETTER(mcu_processor_voltage_obj, + (mp_obj_t)&mcu_processor_get_voltage_obj); STATIC const mp_rom_map_elem_t mcu_processor_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_frequency), MP_ROM_PTR(&mcu_processor_frequency_obj) }, diff --git a/shared-bindings/microcontroller/Processor.h b/shared-bindings/microcontroller/Processor.h index 98d4790876..9a2f22b245 100644 --- a/shared-bindings/microcontroller/Processor.h +++ b/shared-bindings/microcontroller/Processor.h @@ -39,5 +39,6 @@ mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void); float common_hal_mcu_processor_get_temperature(void); void common_hal_mcu_processor_get_uid(uint8_t raw_id[]); float common_hal_mcu_processor_get_voltage(void); +uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self, uint32_t frequency); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER_PROCESSOR_H diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index ceba9be1ba..46382dc3e6 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -39,12 +39,13 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """Pin references and cpu functionality //| -//| The `microcontroller` module defines the pins from the perspective of the -//| microcontroller. See :py:mod:`board` for board-specific pin mappings.""" +//| The `microcontroller` module defines the pins and other bare-metal hardware +//| from the perspective of the microcontroller. See :py:mod:`board` for +//| board-specific pin mappings.""" //| //| from nvm import ByteArray //| from watchdog import WatchDogTimer @@ -118,7 +119,7 @@ STATIC mp_obj_t mcu_on_next_reset(mp_obj_t run_mode_obj) { } else if (run_mode_obj == MP_OBJ_FROM_PTR(&mcu_runmode_bootloader_obj)) { run_mode = RUNMODE_BOOTLOADER; } else { - mp_raise_ValueError(translate("Invalid run mode.")); + mp_arg_error_invalid(MP_QSTR_run_mode); } common_hal_mcu_on_next_reset(run_mode); return mp_const_none; diff --git a/shared-bindings/msgpack/ExtType.c b/shared-bindings/msgpack/ExtType.c index 892dd91696..94c699d469 100644 --- a/shared-bindings/msgpack/ExtType.c +++ b/shared-bindings/msgpack/ExtType.c @@ -47,10 +47,8 @@ STATIC mp_obj_t mod_msgpack_exttype_make_new(const mp_obj_type_t *type, size_t n 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); - int code = args[ARG_code].u_int; - if (code < 0 || code > 127) { - mp_raise_AttributeError(translate("code outside range 0~127")); - } + int code = mp_arg_validate_int_range(args[ARG_code].u_int, 0, 127, MP_QSTR_code); + self->code = code; mp_obj_t data = args[ARG_data].u_obj; @@ -80,12 +78,9 @@ STATIC mp_obj_t mod_msgpack_exttype_set_code(mp_obj_t self_in, mp_obj_t code_in) } MP_DEFINE_CONST_FUN_OBJ_2(mod_msgpack_exttype_set_code_obj, mod_msgpack_exttype_set_code); -const mp_obj_property_t mod_msgpack_exttype_code_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&mod_msgpack_exttype_get_code_obj, - (mp_obj_t)&mod_msgpack_exttype_set_code_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(mod_msgpack_exttype_code_obj, + (mp_obj_t)&mod_msgpack_exttype_get_code_obj, + (mp_obj_t)&mod_msgpack_exttype_set_code_obj); //| data: bytes //| """Data.""" @@ -104,12 +99,9 @@ STATIC mp_obj_t mod_msgpack_exttype_set_data(mp_obj_t self_in, mp_obj_t data_in) } MP_DEFINE_CONST_FUN_OBJ_2(mod_msgpack_exttype_set_data_obj, mod_msgpack_exttype_set_data); -const mp_obj_property_t mod_msgpack_exttype_data_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&mod_msgpack_exttype_get_data_obj, - (mp_obj_t)&mod_msgpack_exttype_set_data_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(mod_msgpack_exttype_data_obj, + (mp_obj_t)&mod_msgpack_exttype_get_data_obj, + (mp_obj_t)&mod_msgpack_exttype_set_data_obj); STATIC mp_rom_map_elem_t mod_msgpack_exttype_locals_dict_table[] = { // Properties diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index 65374fb443..e13fb28819 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -41,6 +41,9 @@ //| //| Not implemented: 64-bit int, uint, float. //| +//| For more information about working with msgpack, +//| see `the CPython Library Documentation `_. +//| //| Example 1:: //| //| import msgpack diff --git a/shared-bindings/multiterminal/__init__.c b/shared-bindings/multiterminal/__init__.c index f3f8d1ab6c..8726e9a655 100644 --- a/shared-bindings/multiterminal/__init__.c +++ b/shared-bindings/multiterminal/__init__.c @@ -28,7 +28,7 @@ #include "py/obj.h" #include "py/mphal.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """Manage additional terminal sources //| diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index a95020ad46..e45e970179 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -30,7 +30,43 @@ #include "py/runtime.h" #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" + +// RGB LED timing information: + +// From the WS2811 datasheet: high speed mode +// - T0H 0 code,high voltage time 0.25 us +-150ns +// - T1H 1 code,high voltage time 0.6 us +-150ns +// - T0L 0 code,low voltage time 1.0 us +-150ns +// - T1L 1 code,low voltage time 0.65 us +-150ns +// - RES low voltage time Above 50us + +// From the SK6812 datasheet: +// - T0H 0 code, high level time 0.3us +-0.15us +// - T1H 1 code, high level time 0.6us +-0.15us +// - T0L 0 code, low level time 0.9us +-0.15us +// - T1L 1 code, low level time 0.6us +-0.15us +// - Trst Reset code,low level time 80us + +// From the WS2812 datasheet: +// - T0H 0 code, high voltage time 0.35us +-150ns +// - T1H 1 code, high voltage time 0.7us +-150ns +// - T0L 0 code, low voltage time 0.8us +-150ns +// - T1L 1 code, low voltage time 0.6us +-150ns +// - RES low voltage time Above 50us + +// From the WS28212B datasheet: +// - T0H 0 code, high voltage time 0.4us +-150ns +// - T1H 1 code, high voltage time 0.8us +-150ns +// - T0L 0 code, low voltage time 0.85us +-150ns +// - T1L 1 code, low voltage time 0.45us +-150ns +// - RES low voltage time Above 50us + +// The timings used in various ports do not always follow the guidelines above. +// In general, a zero bit is about 300ns high, 900ns low. +// A one bit is about 700ns high, 500ns low. +// But the ports vary based on implementation considerations; the proof is in the testing. +// https://adafru.it/5225 is more sensitive to timing and should be included in testing. STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) { if (common_hal_digitalio_digitalinout_deinited(self)) { @@ -55,7 +91,19 @@ STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) { //| pin = digitalio.DigitalInOut(board.NEOPIXEL) //| pin.direction = digitalio.Direction.OUTPUT //| pixel_off = bytearray([0, 0, 0]) -//| neopixel_write.neopixel_write(pin, pixel_off)""" +//| neopixel_write.neopixel_write(pin, pixel_off) +//| +//| .. note:: +//| +//| This module is typically not used by user level code. +//| +//| For more information on actually using NeoPixels, refer to the `CircuitPython +//| Essentials Learn guide `_ +//| +//| For a much more thorough guide about using NeoPixels, refer to the `Adafruit NeoPixel Überguide +//| `_. +//| +//| """ //| //| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: ReadableBuffer) -> None: //| """Write buf out on the given DigitalInOut. diff --git a/shared-bindings/nvm/ByteArray.c b/shared-bindings/nvm/ByteArray.c index 6e34b76bd9..936e3bcee5 100644 --- a/shared-bindings/nvm/ByteArray.c +++ b/shared-bindings/nvm/ByteArray.c @@ -29,7 +29,7 @@ #include "py/runtime.h" #include "py/runtime0.h" #include "shared-bindings/nvm/ByteArray.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class ByteArray: //| r"""Presents a stretch of non-volatile memory as a bytearray. @@ -153,9 +153,8 @@ STATIC mp_obj_t nvm_bytearray_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj } else { // store mp_int_t byte_value = mp_obj_get_int(value); - if (byte_value > 0xff || byte_value < 0) { - mp_raise_ValueError(translate("Bytes must be between 0 and 255.")); - } + mp_arg_validate_int_range(byte_value, 0, 255, MP_QSTR_bytes); + uint8_t short_value = byte_value; if (!common_hal_nvm_bytearray_set_bytes(self, index, &short_value, 1)) { mp_raise_RuntimeError(translate("Unable to write to nvm.")); diff --git a/shared-bindings/onewireio/OneWire.c b/shared-bindings/onewireio/OneWire.c index a167c86cc8..6ce5b659e7 100644 --- a/shared-bindings/onewireio/OneWire.c +++ b/shared-bindings/onewireio/OneWire.c @@ -42,9 +42,6 @@ //| //| :param ~microcontroller.Pin pin: Pin connected to the OneWire bus //| -//| .. note:: The OneWire class is available on `busio` and `bitbangio` in CircuitPython -//| 7.x for backwards compatibility but will be removed in CircuitPython 8.0.0. -//| //| Read a short series of pulses:: //| //| import onewireio diff --git a/shared-bindings/os/__init__.c b/shared-bindings/os/__init__.c index 02efd41988..407fa02558 100644 --- a/shared-bindings/os/__init__.c +++ b/shared-bindings/os/__init__.c @@ -36,12 +36,12 @@ #include "py/objstr.h" #include "py/runtime.h" #include "shared-bindings/os/__init__.h" +#include "supervisor/shared/translate/translate.h" //| """functions that an OS normally provides //| -//| The `os` module is a strict subset of the CPython `cpython:os` module. So, -//| code written in CircuitPython will work in CPython but not necessarily the -//| other way around.""" +//| |see_cpython_module| :mod:`cpython:os`. +//| """ //| //| import typing @@ -84,6 +84,25 @@ STATIC mp_obj_t os_getcwd(void) { } MP_DEFINE_CONST_FUN_OBJ_0(os_getcwd_obj, os_getcwd); +//| def getenv(key: str, default: Optional[str] = None) -> Optional[str]: +//| """Get the environment variable value for the given key or return ``default``. +//| +//| This may load values from disk so cache the result instead of calling this often.""" +//| ... +//| +STATIC mp_obj_t os_getenv(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_key, ARG_default }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_key, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_default, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + }; + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + return common_hal_os_getenv(mp_obj_str_get_str(args[ARG_key].u_obj), args[ARG_default].u_obj); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(os_getenv_obj, 1, os_getenv); + //| def listdir(dir: str) -> str: //| """With no argument, list the current directory. Otherwise list the given directory.""" //| ... @@ -147,6 +166,20 @@ MP_DEFINE_CONST_FUN_OBJ_1(os_rmdir_obj, os_rmdir); //| def stat(path: str) -> Tuple[int, int, int, int, int, int, int, int, int, int]: //| """Get the status of a file or directory. //| +//| Returns a tuple with the status of a file or directory in the following order: +//| +//| +//| * ``st_mode`` -- File type, regular or directory +//| * ``st_ino`` -- Set to 0 +//| * ``st_dev`` -- Set to 0 +//| * ``st_nlink`` -- Set to 0 +//| * ``st_uid`` -- Set to 0 +//| * ``st_gid`` -- Set to 0 +//| * ``st_size`` -- Size of the file in bytes +//| * ``st_atime`` -- Time of most recent access expressed in seconds +//| * ``st_mtime`` -- Time of most recent content modification expressed in seconds. +//| * ``st_ctime`` -- Time of most recent content modification expressed in seconds. +//| //| .. note:: On builds without long integers, the number of seconds //| for contemporary dates will not fit in a small integer. //| So the time fields return 946684800, @@ -221,6 +254,7 @@ STATIC const mp_rom_map_elem_t os_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_chdir), MP_ROM_PTR(&os_chdir_obj) }, { MP_ROM_QSTR(MP_QSTR_getcwd), MP_ROM_PTR(&os_getcwd_obj) }, + { MP_ROM_QSTR(MP_QSTR_getenv), MP_ROM_PTR(&os_getenv_obj) }, { MP_ROM_QSTR(MP_QSTR_listdir), MP_ROM_PTR(&os_listdir_obj) }, { MP_ROM_QSTR(MP_QSTR_mkdir), MP_ROM_PTR(&os_mkdir_obj) }, { MP_ROM_QSTR(MP_QSTR_remove), MP_ROM_PTR(&os_remove_obj) }, diff --git a/shared-bindings/os/__init__.h b/shared-bindings/os/__init__.h index f6f0a25c93..5a27f309b4 100644 --- a/shared-bindings/os/__init__.h +++ b/shared-bindings/os/__init__.h @@ -37,6 +37,7 @@ extern const mp_rom_obj_tuple_t common_hal_os_uname_info_obj; mp_obj_t common_hal_os_uname(void); void common_hal_os_chdir(const char *path); mp_obj_t common_hal_os_getcwd(void); +mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_); mp_obj_t common_hal_os_listdir(const char *path); void common_hal_os_mkdir(const char *path); void common_hal_os_remove(const char *path); diff --git a/shared-bindings/paralleldisplay/ParallelBus.c b/shared-bindings/paralleldisplay/ParallelBus.c index 6e6e778259..a8b37fa956 100644 --- a/shared-bindings/paralleldisplay/ParallelBus.c +++ b/shared-bindings/paralleldisplay/ParallelBus.c @@ -35,7 +35,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/util.h" #include "shared-module/displayio/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class ParallelBus: //| """Manage updating a display over 8-bit parallel bus in the background while Python code runs. This @@ -126,10 +126,8 @@ MP_DEFINE_CONST_FUN_OBJ_1(paralleldisplay_parallelbus_reset_obj, paralleldisplay //| ... //| STATIC mp_obj_t paralleldisplay_parallelbus_obj_send(mp_obj_t self, mp_obj_t command_obj, mp_obj_t data_obj) { - mp_int_t command_int = MP_OBJ_SMALL_INT_VALUE(command_obj); - if (!mp_obj_is_small_int(command_obj) || command_int > 255 || command_int < 0) { - mp_raise_ValueError(translate("Command must be an int between 0 and 255")); - } + mp_int_t command_int = mp_arg_validate_int_range(mp_obj_get_int(command_obj), 0, 255, MP_QSTR_command); + uint8_t command = command_int; mp_buffer_info_t bufinfo; mp_get_buffer_raise(data_obj, &bufinfo, MP_BUFFER_READ); diff --git a/shared-bindings/ps2io/Ps2.c b/shared-bindings/ps2io/Ps2.c index a0fb6d607b..d84e788de5 100644 --- a/shared-bindings/ps2io/Ps2.c +++ b/shared-bindings/ps2io/Ps2.c @@ -34,7 +34,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/ps2io/Ps2.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Ps2: //| """Communicate with a PS/2 keyboard or mouse @@ -68,21 +68,21 @@ //| ... //| STATIC mp_obj_t ps2io_ps2_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_datapin, ARG_clkpin }; + enum { ARG_data_pin, ARG_clock_pin }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_datapin, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_clkpin, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_data_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_clock_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, }; 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); - const mcu_pin_obj_t *clkpin = validate_obj_is_free_pin(args[ARG_clkpin].u_obj); - const mcu_pin_obj_t *datapin = validate_obj_is_free_pin(args[ARG_datapin].u_obj); + const mcu_pin_obj_t *clock_pin = validate_obj_is_free_pin(args[ARG_clock_pin].u_obj); + const mcu_pin_obj_t *data_pin = validate_obj_is_free_pin(args[ARG_data_pin].u_obj); ps2io_ps2_obj_t *self = m_new_obj(ps2io_ps2_obj_t); self->base.type = &ps2io_ps2_type; - common_hal_ps2io_ps2_construct(self, datapin, clkpin); + common_hal_ps2io_ps2_construct(self, data_pin, clock_pin); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/ps2io/Ps2.h b/shared-bindings/ps2io/Ps2.h index da4c6ba2fe..861fd40232 100644 --- a/shared-bindings/ps2io/Ps2.h +++ b/shared-bindings/ps2io/Ps2.h @@ -34,7 +34,7 @@ extern const mp_obj_type_t ps2io_ps2_type; extern void common_hal_ps2io_ps2_construct(ps2io_ps2_obj_t *self, - const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *clk_pin); + const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *clock_pin); extern void common_hal_ps2io_ps2_deinit(ps2io_ps2_obj_t *self); extern bool common_hal_ps2io_ps2_deinited(ps2io_ps2_obj_t *self); extern uint16_t common_hal_ps2io_ps2_get_len(ps2io_ps2_obj_t *self); diff --git a/shared-bindings/pulseio/PulseIn.c b/shared-bindings/pulseio/PulseIn.c index 13721c8106..a966160e2b 100644 --- a/shared-bindings/pulseio/PulseIn.c +++ b/shared-bindings/pulseio/PulseIn.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/pulseio/PulseIn.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PulseIn: //| """Measure a series of active and idle pulses. This is commonly used in infrared receivers @@ -87,7 +87,8 @@ STATIC mp_obj_t pulseio_pulsein_make_new(const mp_obj_type_t *type, size_t n_arg mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); const mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); - pulseio_pulsein_obj_t *self = m_new_obj(pulseio_pulsein_obj_t); + // Make object long-lived to avoid moving between imports + pulseio_pulsein_obj_t *self = m_new_ll_obj(pulseio_pulsein_obj_t); self->base.type = &pulseio_pulsein_type; common_hal_pulseio_pulsein_construct(self, pin, args[ARG_maxlen].u_int, @@ -208,12 +209,8 @@ STATIC mp_obj_t pulseio_pulsein_obj_get_maxlen(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_get_maxlen_obj, pulseio_pulsein_obj_get_maxlen); -const mp_obj_property_t pulseio_pulsein_maxlen_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&pulseio_pulsein_get_maxlen_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(pulseio_pulsein_maxlen_obj, + (mp_obj_t)&pulseio_pulsein_get_maxlen_obj); //| paused: bool //| """True when pulse capture is paused as a result of :py:func:`pause` or an error during capture @@ -227,12 +224,8 @@ STATIC mp_obj_t pulseio_pulsein_obj_get_paused(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(pulseio_pulsein_get_paused_obj, pulseio_pulsein_obj_get_paused); -const mp_obj_property_t pulseio_pulsein_paused_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&pulseio_pulsein_get_paused_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(pulseio_pulsein_paused_obj, + (mp_obj_t)&pulseio_pulsein_get_paused_obj); //| def __bool__(self) -> bool: ... //| diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index ac568231b9..f812043e13 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -34,7 +34,7 @@ #include "shared-bindings/pulseio/PulseOut.h" #include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PulseOut: //| """Pulse PWM "carrier" output on and off. This is commonly used in infrared remotes. The @@ -48,9 +48,6 @@ //| :param int frequency: Carrier signal frequency in Hertz //| :param int duty_cycle: 16-bit duty cycle of carrier frequency (0 - 65536) //| -//| For backwards compatibility, ``pin`` may be a PWMOut object used as the carrier. This -//| compatibility will be removed in CircuitPython 8.0.0. -//| //| Send a short series of pulses:: //| //| import array @@ -82,14 +79,6 @@ STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_ar const mcu_pin_obj_t *pin = args[ARG_pin].u_obj; mp_int_t frequency = args[ARG_frequency].u_int; mp_int_t duty_cycle = args[ARG_duty_cycle].u_int; - if (mp_obj_is_type(args[ARG_pin].u_obj, &pwmio_pwmout_type)) { - pwmio_pwmout_obj_t *pwmout = args[ARG_pin].u_obj; - duty_cycle = common_hal_pwmio_pwmout_get_duty_cycle(pwmout); - frequency = common_hal_pwmio_pwmout_get_frequency(pwmout); - pin = common_hal_pwmio_pwmout_get_pin(pwmout); - // Deinit the pin so we can use it. - common_hal_pwmio_pwmout_deinit(pwmout); - } validate_obj_is_free_pin(MP_OBJ_FROM_PTR(pin)); pulseio_pulseout_obj_t *self = m_new_obj(pulseio_pulseout_obj_t); self->base.type = &pulseio_pulseout_type; diff --git a/shared-bindings/pwmio/PWMOut.c b/shared-bindings/pwmio/PWMOut.c index 1c0110653b..4acb2a6a8a 100644 --- a/shared-bindings/pwmio/PWMOut.c +++ b/shared-bindings/pwmio/PWMOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" void common_hal_pwmio_pwmout_raise_error(pwmout_result_t result) { @@ -41,10 +41,10 @@ void common_hal_pwmio_pwmout_raise_error(pwmout_result_t result) { case PWMOUT_OK: break; case PWMOUT_INVALID_PIN: - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); break; case PWMOUT_INVALID_FREQUENCY: - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); break; case PWMOUT_INVALID_FREQUENCY_ON_PIN: mp_raise_ValueError(translate("Frequency must match existing PWMOut using this timer")); @@ -212,20 +212,17 @@ STATIC mp_obj_t pwmio_pwmout_obj_set_duty_cycle(mp_obj_t self_in, mp_obj_t duty_ pwmio_pwmout_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); mp_int_t duty = mp_obj_get_int(duty_cycle); - if (duty < 0 || duty > 0xffff) { - mp_raise_ValueError(translate("PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)")); - } + + mp_arg_validate_int_range(duty, 0, 0xffff, MP_QSTR_duty_cycle); + common_hal_pwmio_pwmout_set_duty_cycle(self, duty); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(pwmio_pwmout_set_duty_cycle_obj, pwmio_pwmout_obj_set_duty_cycle); -const mp_obj_property_t pwmio_pwmout_duty_cycle_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&pwmio_pwmout_get_duty_cycle_obj, - (mp_obj_t)&pwmio_pwmout_set_duty_cycle_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(pwmio_pwmout_duty_cycle_obj, + (mp_obj_t)&pwmio_pwmout_get_duty_cycle_obj, + (mp_obj_t)&pwmio_pwmout_set_duty_cycle_obj); //| frequency: int //| """32 bit value that dictates the PWM frequency in Hertz (cycles per @@ -254,19 +251,16 @@ STATIC mp_obj_t pwmio_pwmout_obj_set_frequency(mp_obj_t self_in, mp_obj_t freque } mp_int_t freq = mp_obj_get_int(frequency); if (freq == 0) { - mp_raise_ValueError(translate("Invalid PWM frequency")); + mp_arg_error_invalid(MP_QSTR_frequency); } common_hal_pwmio_pwmout_set_frequency(self, freq); return mp_const_none; } MP_DEFINE_CONST_FUN_OBJ_2(pwmio_pwmout_set_frequency_obj, pwmio_pwmout_obj_set_frequency); -const mp_obj_property_t pwmio_pwmout_frequency_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&pwmio_pwmout_get_frequency_obj, - (mp_obj_t)&pwmio_pwmout_set_frequency_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(pwmio_pwmout_frequency_obj, + (mp_obj_t)&pwmio_pwmout_get_frequency_obj, + (mp_obj_t)&pwmio_pwmout_set_frequency_obj); STATIC const mp_rom_map_elem_t pwmio_pwmout_locals_dict_table[] = { // Methods diff --git a/shared-bindings/pwmio/__init__.c b/shared-bindings/pwmio/__init__.c index c9f7a50155..90aff45819 100644 --- a/shared-bindings/pwmio/__init__.c +++ b/shared-bindings/pwmio/__init__.c @@ -57,7 +57,11 @@ //| :py:data:`~pwmio.PWMOut.duty_cycle`, and then sleep 0.1 seconds. //| CircuitPython will automatically turn off the PWM when it resets all //| hardware after program completion. Use ``deinit()`` or a ``with`` statement -//| to do it yourself.""" +//| to do it yourself. +//| +//| For the essentials of `pwmio`, see the `CircuitPython Essentials +//| Learn guide `_. +//| """ //| STATIC const mp_rom_map_elem_t pwmio_module_globals_table[] = { diff --git a/shared-bindings/qrio/PixelPolicy.c b/shared-bindings/qrio/PixelPolicy.c index 6887081b24..deb164d02d 100644 --- a/shared-bindings/qrio/PixelPolicy.c +++ b/shared-bindings/qrio/PixelPolicy.c @@ -34,18 +34,28 @@ //| """The input buffer to `QRDecoder.decode` consists of greyscale values in every byte""" //| //| EVEN_BYTES: PixelPolicy -//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 0, 2, …, and ignored bytes in positions 1, 3, …. This can decode directly from YUV images where the even bytes hold the Y (luminance) data.""" +//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 0, 2, …, and ignored bytes in positions 1, 3, …. This can decode directly from YUV images where the even bytes hold the Y (luminance) data.""" //| //| ODD_BYTES: PixelPolicy -//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 1, 3, …, and ignored bytes in positions 0, 2, …. This can decode directly from YUV images where the odd bytes hold the Y (luminance) data""" +//| """The input buffer to `QRDecoder.decode` consists of greyscale values in positions 1, 3, …, and ignored bytes in positions 0, 2, …. This can decode directly from YUV images where the odd bytes hold the Y (luminance) data""" +//| +//| RGB565_SWAPPED: PixelPolicy +//| """The input buffer to `QRDecoder.decode` consists of RGB565 values in byte-swapped order. Most cameras produce data in byte-swapped order. The green component is used.""" +//| +//| RGB565: PixelPolicy +//| """The input buffer to `QRDecoder.decode` consists of RGB565 values in native order. The green component is used.""" //| MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, EVERY_BYTE, QRIO_EVERY_BYTE); +MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, RGB565, QRIO_RGB565); +MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, RGB565_SWAPPED, QRIO_RGB565_SWAPPED); MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, EVEN_BYTES, QRIO_EVEN_BYTES); MAKE_ENUM_VALUE(qrio_pixel_policy_type, qrio_pixel_policy, ODD_BYTES, QRIO_EVEN_BYTES); MAKE_ENUM_MAP(qrio_pixel_policy) { MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, EVERY_BYTE), + MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, RGB565), + MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, RGB565_SWAPPED), MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, EVEN_BYTES), MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, ODD_BYTES), }; diff --git a/shared-bindings/qrio/PixelPolicy.h b/shared-bindings/qrio/PixelPolicy.h index 8be5dde1cc..36c1d271fd 100644 --- a/shared-bindings/qrio/PixelPolicy.h +++ b/shared-bindings/qrio/PixelPolicy.h @@ -33,7 +33,7 @@ extern const mp_obj_type_t qrio_pixel_policy_type; typedef enum { - QRIO_EVERY_BYTE, QRIO_EVEN_BYTES, QRIO_ODD_BYTES + QRIO_EVERY_BYTE, QRIO_EVEN_BYTES, QRIO_ODD_BYTES, QRIO_RGB565, QRIO_RGB565_SWAPPED } qrio_pixel_policy_t; extern const cp_enum_obj_t qrio_pixel_policy_EVERY_BYTE_obj; diff --git a/shared-bindings/qrio/QRDecoder.c b/shared-bindings/qrio/QRDecoder.c index c8382de42e..d2d4785ed8 100644 --- a/shared-bindings/qrio/QRDecoder.c +++ b/shared-bindings/qrio/QRDecoder.c @@ -107,12 +107,9 @@ STATIC mp_obj_t qrio_qrdecoder_set_width(mp_obj_t self_in, mp_obj_t width_in) { } MP_DEFINE_CONST_FUN_OBJ_2(qrio_qrdecoder_set_width_obj, qrio_qrdecoder_set_width); -const mp_obj_property_t qrio_qrdecoder_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&qrio_qrdecoder_get_width_obj, - (mp_obj_t)&qrio_qrdecoder_set_width_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(qrio_qrdecoder_width_obj, + (mp_obj_t)&qrio_qrdecoder_get_width_obj, + (mp_obj_t)&qrio_qrdecoder_set_width_obj); //| height: int //| """The height of image the decoder expects""" @@ -131,12 +128,9 @@ STATIC mp_obj_t qrio_qrdecoder_set_height(mp_obj_t self_in, mp_obj_t height_in) } MP_DEFINE_CONST_FUN_OBJ_2(qrio_qrdecoder_set_height_obj, qrio_qrdecoder_set_height); -const mp_obj_property_t qrio_qrdecoder_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&qrio_qrdecoder_get_height_obj, - (mp_obj_t)&qrio_qrdecoder_set_height_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(qrio_qrdecoder_height_obj, + (mp_obj_t)&qrio_qrdecoder_get_height_obj, + (mp_obj_t)&qrio_qrdecoder_set_height_obj); STATIC const mp_rom_map_elem_t qrio_qrdecoder_locals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_QRDecoder) }, diff --git a/shared-bindings/qrio/__init__.c b/shared-bindings/qrio/__init__.c index b848190d7e..04c86fd1ee 100644 --- a/shared-bindings/qrio/__init__.c +++ b/shared-bindings/qrio/__init__.c @@ -31,9 +31,15 @@ #include "py/obj.h" #include "py/enum.h" -//| """`qrio` module. +//| """Low-level QR code decoding //| -//| Provides the `QRDecoder` object.""" +//| Provides the `QRDecoder` object used for decoding QR codes. For more +//| information about working with QR codes, see +//| `this Learn guide `_. +//| +//| .. note:: This module only handles decoding QR codes. If you are looking +//| to generate a QR code, use the +//| `adafruit_miniqr library `_""" //| STATIC const mp_rom_map_elem_t qrio_module_globals_table[] = { diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index d6aecbf322..eee574d29e 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -31,13 +31,11 @@ #include "py/obj.h" #include "py/runtime.h" #include "shared-bindings/random/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """pseudo-random numbers and choices //| -//| The `random` module is a strict subset of the CPython `cpython:random` -//| module. So, code written in CircuitPython will work in CPython but not -//| necessarily the other way around. +//| |see_cpython_module| :mod:`cpython:random`. //| //| Like its CPython cousin, CircuitPython's random seeds itself on first use //| with a true random from os.urandom() when available or the uptime otherwise. @@ -75,8 +73,13 @@ STATIC mp_obj_t random_getrandbits(mp_obj_t num_in) { } STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_getrandbits_obj, random_getrandbits); -//| def randrange(stop: Tuple[int, int, int]) -> int: -//| """Returns a randomly selected integer from ``range(start, stop, step)``.""" +//| @overload +//| def randrange(stop: int) -> int: ... +//| @overload +//| def randrange(start: int, stop: int) -> int: ... +//| @overload +//| def randrange(start: int, stop: int, step: int) -> int: +//| """Returns a randomly selected integer from ``range(start[, stop[, step]])``.""" //| ... //| STATIC mp_obj_t random_randrange(size_t n_args, const mp_obj_t *args) { diff --git a/shared-bindings/rgbmatrix/RGBMatrix.c b/shared-bindings/rgbmatrix/RGBMatrix.c index 70d6328ab0..fc9f438766 100644 --- a/shared-bindings/rgbmatrix/RGBMatrix.c +++ b/shared-bindings/rgbmatrix/RGBMatrix.c @@ -207,11 +207,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n uint8_t clock_pin = validate_pin(args[ARG_clock_pin].u_obj); uint8_t latch_pin = validate_pin(args[ARG_latch_pin].u_obj); uint8_t output_enable_pin = validate_pin(args[ARG_output_enable_pin].u_obj); - int bit_depth = args[ARG_bit_depth].u_int; - - if (bit_depth <= 0 || bit_depth > 6) { - mp_raise_ValueError_varg(translate("Bit depth must be from 1 to 6 inclusive, not %d"), bit_depth); - } + mp_int_t bit_depth = mp_arg_validate_int_range(args[ARG_bit_depth].u_int, 1, 6, MP_QSTR_bit_depth); validate_pins(MP_QSTR_rgb_pins, rgb_pins, MP_ARRAY_SIZE(self->rgb_pins), args[ARG_rgb_list].u_obj, &rgb_count); validate_pins(MP_QSTR_addr_pins, addr_pins, MP_ARRAY_SIZE(self->addr_pins), args[ARG_addr_list].u_obj, &addr_count); @@ -220,12 +216,7 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n mp_raise_ValueError_varg(translate("Must use a multiple of 6 rgb pins, not %d"), rgb_count); } - int tile = args[ARG_tile].u_int; - - if (tile <= 0) { - mp_raise_ValueError_varg( - translate("tile must be greater than zero")); - } + int tile = mp_arg_validate_int_min(args[ARG_tile].u_int, 1, MP_QSTR_tile); int computed_height = (rgb_count / 3) * (1 << (addr_count)) * tile; if (args[ARG_height].u_int != 0) { @@ -235,21 +226,18 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_make_new(const mp_obj_type_t *type, size_t n } } - if (args[ARG_width].u_int <= 0) { - mp_raise_ValueError(translate("width must be greater than zero")); - } + mp_int_t width = mp_arg_validate_int_min(args[ARG_width].u_int, 1, MP_QSTR_width); preflight_pins_or_throw(clock_pin, rgb_pins, rgb_count, true); mp_obj_t framebuffer = args[ARG_framebuffer].u_obj; if (framebuffer == mp_const_none) { - int width = args[ARG_width].u_int; int bufsize = 2 * width * computed_height; framebuffer = mp_obj_new_bytearray_of_zeros(bufsize); } common_hal_rgbmatrix_rgbmatrix_construct(self, - args[ARG_width].u_int, + width, bit_depth, rgb_count, rgb_pins, addr_count, addr_pins, @@ -310,12 +298,9 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_set_brightness(mp_obj_t self_in, mp_obj_t va } MP_DEFINE_CONST_FUN_OBJ_2(rgbmatrix_rgbmatrix_set_brightness_obj, rgbmatrix_rgbmatrix_set_brightness); -const mp_obj_property_t rgbmatrix_rgbmatrix_brightness_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&rgbmatrix_rgbmatrix_get_brightness_obj, - (mp_obj_t)&rgbmatrix_rgbmatrix_set_brightness_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(rgbmatrix_rgbmatrix_brightness_obj, + (mp_obj_t)&rgbmatrix_rgbmatrix_get_brightness_obj, + (mp_obj_t)&rgbmatrix_rgbmatrix_set_brightness_obj); //| def refresh(self) -> None: //| """Transmits the color data in the buffer to the pixels so that @@ -339,12 +324,8 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_get_width(mp_obj_t self_in) { return MP_OBJ_NEW_SMALL_INT(common_hal_rgbmatrix_rgbmatrix_get_width(self)); } MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_get_width_obj, rgbmatrix_rgbmatrix_get_width); -const mp_obj_property_t rgbmatrix_rgbmatrix_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&rgbmatrix_rgbmatrix_get_width_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(rgbmatrix_rgbmatrix_width_obj, + (mp_obj_t)&rgbmatrix_rgbmatrix_get_width_obj); //| height: int //| """The height of the display, in pixels""" @@ -356,12 +337,8 @@ STATIC mp_obj_t rgbmatrix_rgbmatrix_get_height(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(rgbmatrix_rgbmatrix_get_height_obj, rgbmatrix_rgbmatrix_get_height); -const mp_obj_property_t rgbmatrix_rgbmatrix_height_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&rgbmatrix_rgbmatrix_get_height_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(rgbmatrix_rgbmatrix_height_obj, + (mp_obj_t)&rgbmatrix_rgbmatrix_get_height_obj); STATIC const mp_rom_map_elem_t rgbmatrix_rgbmatrix_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&rgbmatrix_rgbmatrix_deinit_obj) }, diff --git a/shared-bindings/rotaryio/IncrementalEncoder.c b/shared-bindings/rotaryio/IncrementalEncoder.c index ef218ba024..fe1b0b171b 100644 --- a/shared-bindings/rotaryio/IncrementalEncoder.c +++ b/shared-bindings/rotaryio/IncrementalEncoder.c @@ -74,12 +74,13 @@ STATIC mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, const mcu_pin_obj_t *pin_a = validate_obj_is_free_pin(args[ARG_pin_a].u_obj); const mcu_pin_obj_t *pin_b = validate_obj_is_free_pin(args[ARG_pin_b].u_obj); - rotaryio_incrementalencoder_obj_t *self = m_new_obj(rotaryio_incrementalencoder_obj_t); + // 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); self->base.type = &rotaryio_incrementalencoder_type; common_hal_rotaryio_incrementalencoder_construct(self, pin_a, pin_b); - common_hal_rotaryio_incrementalencoder_set_divisor(self, args[ARG_divisor].u_int); + return MP_OBJ_FROM_PTR(self); } @@ -141,12 +142,9 @@ STATIC mp_obj_t rotaryio_incrementalencoder_obj_set_divisor(mp_obj_t self_in, mp } MP_DEFINE_CONST_FUN_OBJ_2(rotaryio_incrementalencoder_set_divisor_obj, rotaryio_incrementalencoder_obj_set_divisor); -const mp_obj_property_t rotaryio_incrementalencoder_divisor_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&rotaryio_incrementalencoder_get_divisor_obj, - (mp_obj_t)&rotaryio_incrementalencoder_set_divisor_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(rotaryio_incrementalencoder_divisor_obj, + (mp_obj_t)&rotaryio_incrementalencoder_get_divisor_obj, + (mp_obj_t)&rotaryio_incrementalencoder_set_divisor_obj); //| position: int //| """The current position in terms of pulses. The number of pulses per rotation is defined by the @@ -169,12 +167,9 @@ STATIC mp_obj_t rotaryio_incrementalencoder_obj_set_position(mp_obj_t self_in, m } MP_DEFINE_CONST_FUN_OBJ_2(rotaryio_incrementalencoder_set_position_obj, rotaryio_incrementalencoder_obj_set_position); -const mp_obj_property_t rotaryio_incrementalencoder_position_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&rotaryio_incrementalencoder_get_position_obj, - (mp_obj_t)&rotaryio_incrementalencoder_set_position_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(rotaryio_incrementalencoder_position_obj, + (mp_obj_t)&rotaryio_incrementalencoder_get_position_obj, + (mp_obj_t)&rotaryio_incrementalencoder_set_position_obj); STATIC const mp_rom_map_elem_t rotaryio_incrementalencoder_locals_dict_table[] = { // Methods diff --git a/shared-bindings/rotaryio/__init__.c b/shared-bindings/rotaryio/__init__.c index 43a884e9a1..fbfa9afaa2 100644 --- a/shared-bindings/rotaryio/__init__.c +++ b/shared-bindings/rotaryio/__init__.c @@ -39,6 +39,9 @@ //| `Wikipedia's Rotary Encoder page `_ for more //| background. //| +//| For more information on working with rotary encoders using this library, see +//| `this Learn Guide `_. +//| //| All classes change hardware state and should be deinitialized when they //| are no longer needed if the program continues after use. To do so, either //| call :py:meth:`!deinit` or use a context manager. See diff --git a/shared-bindings/rtc/RTC.c b/shared-bindings/rtc/RTC.c index f52871c7da..9e75576487 100644 --- a/shared-bindings/rtc/RTC.c +++ b/shared-bindings/rtc/RTC.c @@ -34,7 +34,7 @@ #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/rtc/RTC.h" #include "shared-bindings/time/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" const rtc_rtc_obj_t rtc_rtc_obj = {{&rtc_rtc_type}}; @@ -87,12 +87,9 @@ STATIC mp_obj_t rtc_rtc_obj_set_datetime(mp_obj_t self_in, mp_obj_t datetime) { } MP_DEFINE_CONST_FUN_OBJ_2(rtc_rtc_set_datetime_obj, rtc_rtc_obj_set_datetime); -const mp_obj_property_t rtc_rtc_datetime_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&rtc_rtc_get_datetime_obj, - (mp_obj_t)&rtc_rtc_set_datetime_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(rtc_rtc_datetime_obj, + (mp_obj_t)&rtc_rtc_get_datetime_obj, + (mp_obj_t)&rtc_rtc_set_datetime_obj); //| calibration: int //| """The RTC calibration value as an `int`. @@ -118,12 +115,9 @@ STATIC mp_obj_t rtc_rtc_obj_set_calibration(mp_obj_t self_in, mp_obj_t calibrati } MP_DEFINE_CONST_FUN_OBJ_2(rtc_rtc_set_calibration_obj, rtc_rtc_obj_set_calibration); -const mp_obj_property_t rtc_rtc_calibration_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&rtc_rtc_get_calibration_obj, - (mp_obj_t)&rtc_rtc_set_calibration_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(rtc_rtc_calibration_obj, + (mp_obj_t)&rtc_rtc_get_calibration_obj, + (mp_obj_t)&rtc_rtc_set_calibration_obj); STATIC const mp_rom_map_elem_t rtc_rtc_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_datetime), MP_ROM_PTR(&rtc_rtc_datetime_obj) }, diff --git a/shared-bindings/sdioio/SDCard.c b/shared-bindings/sdioio/SDCard.c index c4b23ea594..dbeb50ddf3 100644 --- a/shared-bindings/sdioio/SDCard.c +++ b/shared-bindings/sdioio/SDCard.c @@ -38,7 +38,7 @@ #include "py/mperrno.h" #include "py/objproperty.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class SDCard: //| """SD Card Block Interface with SDIO @@ -129,14 +129,10 @@ STATIC mp_obj_t sdioio_sdcard_configure(size_t n_args, const mp_obj_t *pos_args, MP_STATIC_ASSERT(MP_ARRAY_SIZE(allowed_args) == NUM_ARGS); mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_int_t frequency = args[ARG_frequency].u_int; - if (frequency < 0) { - mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_baudrate); - } - + mp_int_t frequency = mp_arg_validate_int_min(args[ARG_frequency].u_int, 1, MP_QSTR_frequency); uint8_t width = args[ARG_width].u_int; if (width != 0 && width != 1 && width != 4) { - mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_width); + mp_arg_error_invalid(MP_QSTR_width); } if (!common_hal_sdioio_sdcard_configure(self, frequency, width)) { @@ -218,12 +214,8 @@ STATIC mp_obj_t sdioio_sdcard_obj_get_frequency(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_frequency_obj, sdioio_sdcard_obj_get_frequency); -const mp_obj_property_t sdioio_sdcard_frequency_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&sdioio_sdcard_get_frequency_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(sdioio_sdcard_frequency_obj, + (mp_obj_t)&sdioio_sdcard_get_frequency_obj); //| @property //| def width(self) -> int: @@ -237,12 +229,8 @@ STATIC mp_obj_t sdioio_sdcard_obj_get_width(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(sdioio_sdcard_get_width_obj, sdioio_sdcard_obj_get_width); -const mp_obj_property_t sdioio_sdcard_width_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&sdioio_sdcard_get_width_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(sdioio_sdcard_width_obj, + (mp_obj_t)&sdioio_sdcard_get_width_obj); //| def deinit(self) -> None: //| """Disable permanently. diff --git a/shared-bindings/sharpdisplay/__init__.c b/shared-bindings/sharpdisplay/__init__.c index 8c01c8c98c..a7e0bff77d 100644 --- a/shared-bindings/sharpdisplay/__init__.c +++ b/shared-bindings/sharpdisplay/__init__.c @@ -31,9 +31,12 @@ #include "shared-bindings/sharpdisplay/SharpMemoryFramebuffer.h" -//| """Support for Sharp Memory Display framebuffers""" +//| """Support for Sharp Memory Display framebuffers +//| +//| For more information about working with Sharp Memory Displays, +//| see `this Learn guide `_. +//| """ //| - STATIC const mp_rom_map_elem_t sharpdisplay_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_sharpdisplay) }, { MP_ROM_QSTR(MP_QSTR_SharpMemoryFramebuffer), MP_ROM_PTR(&sharpdisplay_framebuffer_type) }, diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c index 2dd832f490..716ff673ee 100644 --- a/shared-bindings/socketpool/Socket.c +++ b/shared-bindings/socketpool/Socket.c @@ -46,6 +46,12 @@ //| recv that do not allocate bytes objects.""" //| +//| def __hash__(self) -> int: +//| """Returns a hash for the Socket.""" +//| ... +//| +// Provided by mp_generic_unary_op(). + //| def __enter__(self) -> Socket: //| """No-op used by Context Managers.""" //| ... @@ -69,7 +75,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket___exit___obj, 4, 4, //| creating a new socket of type SOCK_STREAM. //| Returns a tuple of (new_socket, remote_address)""" //| -STATIC mp_obj_t socketpool_socket_accept(mp_obj_t self_in) { +STATIC mp_obj_t _socketpool_socket_accept(mp_obj_t self_in) { socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); uint8_t ip[4]; uint32_t port; @@ -81,7 +87,7 @@ STATIC mp_obj_t socketpool_socket_accept(mp_obj_t self_in) { tuple_contents[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG); return mp_obj_new_tuple(2, tuple_contents); } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_accept_obj, socketpool_socket_accept); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_accept_obj, _socketpool_socket_accept); //| def bind(self, address: Tuple[str, int]) -> None: //| """Bind a socket to an address @@ -114,12 +120,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_bind_obj, socketpool_socket_b //| def close(self) -> None: //| """Closes this Socket and makes its resources available to its SocketPool.""" //| -STATIC mp_obj_t socketpool_socket_close(mp_obj_t self_in) { +STATIC mp_obj_t _socketpool_socket_close(mp_obj_t self_in) { socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); common_hal_socketpool_socket_close(self); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_close_obj, socketpool_socket_close); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_close_obj, _socketpool_socket_close); //| def connect(self, address: Tuple[str, int]) -> None: //| """Connect a socket to a remote address @@ -149,7 +155,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_connect_obj, socketpool_socke //| def listen(self, backlog: int) -> None: //| """Set socket to listen for incoming connections //| -//| :param ~int backlog: length of backlog queue for waiting connetions""" +//| :param ~int backlog: length of backlog queue for waiting connections""" //| ... //| STATIC mp_obj_t socketpool_socket_listen(mp_obj_t self_in, mp_obj_t backlog_in) { @@ -202,7 +208,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_recvfrom_into_obj, socketpool //| :param int bufsize: optionally, a maximum number of bytes to read.""" //| ... //| -STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) { +STATIC mp_obj_t _socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) { socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]); if (common_hal_socketpool_socket_get_closed(self)) { // Bad file number. @@ -232,7 +238,7 @@ STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) mp_int_t ret = common_hal_socketpool_socket_recv_into(self, (byte *)bufinfo.buf, len); return mp_obj_new_int_from_uint(ret); } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_recv_into_obj, 2, 3, socketpool_socket_recv_into); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_recv_into_obj, 2, 3, _socketpool_socket_recv_into); //| def send(self, bytes: ReadableBuffer) -> int: //| """Send some bytes to the connected remote address. @@ -241,7 +247,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_recv_into_obj, 2, 3 //| :param ~bytes bytes: some bytes to send""" //| ... //| -STATIC mp_obj_t socketpool_socket_send(mp_obj_t self_in, mp_obj_t buf_in) { +STATIC mp_obj_t _socketpool_socket_send(mp_obj_t self_in, mp_obj_t buf_in) { socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in); if (common_hal_socketpool_socket_get_closed(self)) { // Bad file number. @@ -258,7 +264,7 @@ STATIC mp_obj_t socketpool_socket_send(mp_obj_t self_in, mp_obj_t buf_in) { } return mp_obj_new_int_from_uint(ret); } -STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_send_obj, socketpool_socket_send); +STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_send_obj, _socketpool_socket_send); //| def sendto(self, bytes: ReadableBuffer, address: Tuple[str, int]) -> int: //| """Send some bytes to a specific address. @@ -366,20 +372,6 @@ STATIC mp_obj_t socketpool_socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_ } STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_settimeout_obj, socketpool_socket_settimeout); -//| def __hash__(self) -> int: -//| """Returns a hash for the Socket.""" -//| ... -//| -STATIC mp_obj_t socketpool_socket_unary_op(mp_unary_op_t op, mp_obj_t self_in) { - switch (op) { - case MP_UNARY_OP_HASH: { - return mp_obj_id(self_in); - } - default: - return MP_OBJ_NULL; // op not supported - } -} - STATIC const mp_rom_map_elem_t socketpool_socket_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&socketpool_socket___exit___obj) }, @@ -407,6 +399,6 @@ const mp_obj_type_t socketpool_socket_type = { .name = MP_QSTR_Socket, .locals_dict = (mp_obj_dict_t *)&socketpool_socket_locals_dict, MP_TYPE_EXTENDED_FIELDS( - .unary_op = socketpool_socket_unary_op, + .unary_op = mp_generic_unary_op, ) }; diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h index 1f4ab6fc35..c6c2a66630 100644 --- a/shared-bindings/socketpool/Socket.h +++ b/shared-bindings/socketpool/Socket.h @@ -47,4 +47,11 @@ mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t *self, const char *host, size_t hostlen, uint32_t port, const uint8_t *buf, uint32_t len); void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t *self, uint32_t timeout_ms); +// Non-allocating versions for internal use. +int socketpool_socket_accept(socketpool_socket_obj_t *self, uint8_t *ip, uint32_t *port); +void socketpool_socket_close(socketpool_socket_obj_t *self); +int socketpool_socket_send(socketpool_socket_obj_t *self, const uint8_t *buf, uint32_t len); +int socketpool_socket_recv_into(socketpool_socket_obj_t *self, + const uint8_t *buf, uint32_t len); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c index 447d2d7d78..a758511546 100644 --- a/shared-bindings/socketpool/SocketPool.c +++ b/shared-bindings/socketpool/SocketPool.c @@ -38,11 +38,20 @@ //| class SocketPool: //| """A pool of socket resources available for the given radio. Only one -//| SocketPool can be created for each radio. +//| SocketPool can be created for each radio. //| -//| SocketPool should be used in place of CPython's socket which provides -//| a pool of sockets provided by the underlying OS.""" +//| SocketPool should be used in place of CPython's socket which provides +//| a pool of sockets provided by the underlying OS. +//| """ //| +//| def __init__(self, radio: wifi.Radio) -> None: +//| """Create a new SocketPool object for the provided radio +//| +//| :param wifi.Radio radio: The (connected) network hardware to associate +//| with this SocketPool; currently, this will always be the object +//| returned by :py:attr:`wifi.radio` +//| """ +//| ... STATIC mp_obj_t socketpool_socketpool_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) { mp_arg_check_num(n_args, n_kw, 1, 1, false); diff --git a/shared-bindings/socketpool/SocketPool.h b/shared-bindings/socketpool/SocketPool.h index 10a943d38b..92382078e1 100644 --- a/shared-bindings/socketpool/SocketPool.h +++ b/shared-bindings/socketpool/SocketPool.h @@ -52,4 +52,10 @@ socketpool_socket_obj_t *common_hal_socketpool_socket(socketpool_socketpool_obj_ mp_obj_t common_hal_socketpool_socketpool_gethostbyname(socketpool_socketpool_obj_t *self, const char *host); +// Non-allocating version for internal use. These sockets are not registered and, therefore, not +// closed automatically. +bool socketpool_socket(socketpool_socketpool_obj_t *self, + socketpool_socketpool_addressfamily_t family, socketpool_socketpool_sock_t type, + socketpool_socket_obj_t *sock); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKETPOOL_H diff --git a/shared-bindings/socketpool/__init__.c b/shared-bindings/socketpool/__init__.c index f10196ab0d..fee81f2820 100644 --- a/shared-bindings/socketpool/__init__.c +++ b/shared-bindings/socketpool/__init__.c @@ -35,6 +35,9 @@ //| """ //| The `socketpool` module provides sockets through a pool. The pools themselves //| act like CPython's `socket` module. +//| +//| For more information about the `socket` module, see the CPython documentation: +//| https://docs.python.org/3/library/socket.html //| """ //| diff --git a/shared-bindings/socketpool/__init__.h b/shared-bindings/socketpool/__init__.h index a017e96c6d..46034f257d 100644 --- a/shared-bindings/socketpool/__init__.h +++ b/shared-bindings/socketpool/__init__.h @@ -27,4 +27,6 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL___INIT___H #define MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL___INIT___H +void socketpool_user_reset(void); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL___INIT___H diff --git a/shared-bindings/ssl/SSLContext.c b/shared-bindings/ssl/SSLContext.c index 2b38768f6a..5dfa5e599f 100644 --- a/shared-bindings/ssl/SSLContext.c +++ b/shared-bindings/ssl/SSLContext.c @@ -105,12 +105,9 @@ STATIC mp_obj_t ssl_sslcontext_set_check_hostname(mp_obj_t self_in, mp_obj_t val } STATIC MP_DEFINE_CONST_FUN_OBJ_2(ssl_sslcontext_set_check_hostname_obj, ssl_sslcontext_set_check_hostname); -const mp_obj_property_t ssl_sslcontext_check_hostname_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&ssl_sslcontext_get_check_hostname_obj, - (mp_obj_t)&ssl_sslcontext_set_check_hostname_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(ssl_sslcontext_check_hostname_obj, + (mp_obj_t)&ssl_sslcontext_get_check_hostname_obj, + (mp_obj_t)&ssl_sslcontext_set_check_hostname_obj); //| def wrap_socket(self, sock: socketpool.Socket, *, server_side: bool = False, server_hostname: Optional[str] = None) -> ssl.SSLSocket: //| """Wraps the socket into a socket-compatible class that handles SSL negotiation. diff --git a/shared-bindings/ssl/SSLSocket.c b/shared-bindings/ssl/SSLSocket.c index 9e25d7f25f..630ab28c68 100644 --- a/shared-bindings/ssl/SSLSocket.c +++ b/shared-bindings/ssl/SSLSocket.c @@ -45,6 +45,12 @@ //| recv that do not allocate bytes objects.""" //| +//| def __hash__(self) -> int: +//| """Returns a hash for the Socket.""" +//| ... +//| +// Provided by mp_generic_unary_op(). + //| def __enter__(self) -> SSLSocket: //| """No-op used by Context Managers.""" //| ... @@ -282,20 +288,6 @@ STATIC mp_obj_t ssl_sslsocket_setblocking(mp_obj_t self_in, mp_obj_t blocking) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(ssl_sslsocket_setblocking_obj, ssl_sslsocket_setblocking); -//| def __hash__(self) -> int: -//| """Returns a hash for the Socket.""" -//| ... -//| -STATIC mp_obj_t ssl_sslsocket_unary_op(mp_unary_op_t op, mp_obj_t self_in) { - switch (op) { - case MP_UNARY_OP_HASH: { - return mp_obj_id(self_in); - } - default: - return MP_OBJ_NULL; // op not supported - } -} - STATIC const mp_rom_map_elem_t ssl_sslsocket_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&ssl_sslsocket___exit___obj) }, @@ -321,6 +313,6 @@ const mp_obj_type_t ssl_sslsocket_type = { .name = MP_QSTR_SSLSocket, .locals_dict = (mp_obj_dict_t *)&ssl_sslsocket_locals_dict, MP_TYPE_EXTENDED_FIELDS( - .unary_op = ssl_sslsocket_unary_op, + .unary_op = mp_generic_unary_op, ) }; diff --git a/shared-bindings/ssl/__init__.c b/shared-bindings/ssl/__init__.c index 578c51dfbe..6967860054 100644 --- a/shared-bindings/ssl/__init__.c +++ b/shared-bindings/ssl/__init__.c @@ -33,6 +33,8 @@ //| """ //| The `ssl` module provides SSL contexts to wrap sockets in. +//| +//| |see_cpython_module| :mod:`cpython:ssl`. //| """ //| diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index 3c957468da..baf91a35c1 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -33,14 +33,19 @@ #include "py/objnamedtuple.h" #include "py/runtime.h" #include "shared-bindings/storage/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """Storage management //| //| The `storage` provides storage management functionality such as mounting and //| unmounting which is typically handled by the operating system hosting Python. //| CircuitPython does not have an OS, so this module provides this functionality -//| directly.""" +//| directly. + +//| For more information regarding using the `storage` module, refer to the `CircuitPython +//| Essentials Learn guide +//| `_. +//| """ //| //| def mount(filesystem: VfsFat, mount_path: str, *, readonly: bool = False) -> None: diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c index 84654a3afe..5b63a15f15 100644 --- a/shared-bindings/struct/__init__.c +++ b/shared-bindings/struct/__init__.c @@ -36,13 +36,11 @@ #include "py/parsenum.h" #include "shared-bindings/struct/__init__.h" #include "shared-module/struct/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """Manipulation of c-style data //| -//| This module implements a subset of the corresponding CPython module, -//| as described below. For more information, refer to the original CPython -//| documentation: struct. +//| |see_cpython_module| :mod:`cpython:struct`. //| //| Supported size/byte order prefixes: *@*, *<*, *>*, *!*. //| diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c index 08d68ec93f..bbfcb05b51 100644 --- a/shared-bindings/supervisor/Runtime.c +++ b/shared-bindings/supervisor/Runtime.c @@ -33,6 +33,8 @@ #include "shared-bindings/supervisor/RunReason.h" #include "shared-bindings/supervisor/Runtime.h" +#include "supervisor/shared/reload.h" + #if (CIRCUITPY_USB) #include "tusb.h" #endif @@ -69,12 +71,8 @@ STATIC mp_obj_t supervisor_runtime_get_usb_connected(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_usb_connected_obj, supervisor_runtime_get_usb_connected); -const mp_obj_property_t supervisor_runtime_usb_connected_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&supervisor_runtime_get_usb_connected_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(supervisor_runtime_usb_connected_obj, + (mp_obj_t)&supervisor_runtime_get_usb_connected_obj); //| serial_connected: bool //| """Returns the USB serial communication status (read-only).""" @@ -84,12 +82,8 @@ STATIC mp_obj_t supervisor_runtime_get_serial_connected(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial_connected_obj, supervisor_runtime_get_serial_connected); -const mp_obj_property_t supervisor_runtime_serial_connected_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&supervisor_runtime_get_serial_connected_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(supervisor_runtime_serial_connected_obj, + (mp_obj_t)&supervisor_runtime_get_serial_connected_obj); //| serial_bytes_available: int //| """Returns the whether any bytes are available to read @@ -101,12 +95,8 @@ STATIC mp_obj_t supervisor_runtime_get_serial_bytes_available(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial_bytes_available_obj, supervisor_runtime_get_serial_bytes_available); -const mp_obj_property_t supervisor_runtime_serial_bytes_available_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&supervisor_runtime_get_serial_bytes_available_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(supervisor_runtime_serial_bytes_available_obj, + (mp_obj_t)&supervisor_runtime_get_serial_bytes_available_obj); supervisor_run_reason_t supervisor_get_run_reason(void) { return _run_reason; @@ -117,25 +107,44 @@ void supervisor_set_run_reason(supervisor_run_reason_t run_reason) { } //| run_reason: RunReason -//| """Returns why CircuitPython started running this particular time.""" +//| """Why CircuitPython started running this particular time.""" //| STATIC mp_obj_t supervisor_runtime_get_run_reason(mp_obj_t self) { return cp_enum_find(&supervisor_run_reason_type, _run_reason); } MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_run_reason_obj, supervisor_runtime_get_run_reason); -const mp_obj_property_t supervisor_runtime_run_reason_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&supervisor_runtime_get_run_reason_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(supervisor_runtime_run_reason_obj, + (mp_obj_t)&supervisor_runtime_get_run_reason_obj); + +//| autoreload: bool +//| """Whether CircuitPython may autoreload based on workflow writes to the filesystem.""" +//| +STATIC mp_obj_t supervisor_runtime_get_autoreload(mp_obj_t self) { + return mp_obj_new_bool(autoreload_is_enabled()); +} +MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_autoreload_obj, supervisor_runtime_get_autoreload); + +STATIC mp_obj_t supervisor_runtime_set_autoreload(mp_obj_t self, mp_obj_t state_in) { + if (mp_obj_is_true(state_in)) { + autoreload_enable(); + } else { + autoreload_disable(); + } + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(supervisor_runtime_set_autoreload_obj, supervisor_runtime_set_autoreload); + +MP_PROPERTY_GETSET(supervisor_runtime_autoreload_obj, + (mp_obj_t)&supervisor_runtime_get_autoreload_obj, + (mp_obj_t)&supervisor_runtime_set_autoreload_obj); STATIC const mp_rom_map_elem_t supervisor_runtime_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_usb_connected), MP_ROM_PTR(&supervisor_runtime_usb_connected_obj) }, { MP_ROM_QSTR(MP_QSTR_serial_connected), MP_ROM_PTR(&supervisor_runtime_serial_connected_obj) }, { MP_ROM_QSTR(MP_QSTR_serial_bytes_available), MP_ROM_PTR(&supervisor_runtime_serial_bytes_available_obj) }, { MP_ROM_QSTR(MP_QSTR_run_reason), MP_ROM_PTR(&supervisor_runtime_run_reason_obj) }, + { MP_ROM_QSTR(MP_QSTR_autoreload), MP_ROM_PTR(&supervisor_runtime_autoreload_obj) }, }; STATIC MP_DEFINE_CONST_DICT(supervisor_runtime_locals_dict, supervisor_runtime_locals_dict_table); diff --git a/shared-bindings/supervisor/StatusBar.c b/shared-bindings/supervisor/StatusBar.c new file mode 100644 index 0000000000..ad6bfb401c --- /dev/null +++ b/shared-bindings/supervisor/StatusBar.c @@ -0,0 +1,127 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 by 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. + */ + +#include +#include "py/obj.h" +#include "py/enum.h" +#include "py/runtime.h" +#include "py/objproperty.h" +#include "shared-bindings/supervisor/StatusBar.h" + +//| class StatusBar: +//| """Current status of runtime objects. +//| +//| Usage:: +//| +//| import supervisor +//| +//| supervisor.status_bar.console = False +//| """ +//| + +//| def __init__(self) -> None: +//| """You cannot create an instance of `supervisor.StatusBar`. +//| Use `supervisor.status_bar` to access the sole instance available.""" +//| ... +//| + +//| console: bool +//| """Whether status bar information is sent over the console (REPL) serial connection, +//| using OSC terminal escape codes that change the terminal's title. Default is ``True``. +//| If set to ``False``, status bar will be cleared and then disabled. +//| May be set in ``boot.py`` or later. Persists across soft restarts. +//| """ +//| +STATIC mp_obj_t supervisor_status_bar_get_console(mp_obj_t self_in) { + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_bool(shared_module_supervisor_status_bar_get_console(self)); + #else + mp_raise_NotImplementedError(NULL); + #endif +} +MP_DEFINE_CONST_FUN_OBJ_1(supervisor_status_bar_get_console_obj, supervisor_status_bar_get_console); + +STATIC mp_obj_t supervisor_status_bar_set_console(mp_obj_t self_in, mp_obj_t state_in) { + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_obj_t *self = MP_OBJ_TO_PTR(self_in); + shared_module_supervisor_status_bar_set_console(self, mp_obj_is_true(state_in)); + return mp_const_none; + #else + mp_raise_NotImplementedError(NULL); + #endif +} +MP_DEFINE_CONST_FUN_OBJ_2(supervisor_status_bar_set_console_obj, supervisor_status_bar_set_console); + +MP_PROPERTY_GETSET(supervisor_status_bar_console_obj, + (mp_obj_t)&supervisor_status_bar_get_console_obj, + (mp_obj_t)&supervisor_status_bar_set_console_obj); + +//| display: bool +//| """Whether status bar information is displayed on the top line of the display. +//| Default is ``True``. If set to ``False``, status bar will be cleared and then disabled. +//| May be set in ``boot.py`` or later. Persists across soft restarts. +//| Not available if `terminalio` is not available. +//| """ +//| +STATIC mp_obj_t supervisor_status_bar_get_display(mp_obj_t self_in) { + #if CIRCUITPY_STATUS_BAR && CIRCUITPY_TERMINALIO + supervisor_status_bar_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_bool(shared_module_supervisor_status_bar_get_display(self)); + #else + mp_raise_NotImplementedError(NULL); + #endif +} +MP_DEFINE_CONST_FUN_OBJ_1(supervisor_status_bar_get_display_obj, supervisor_status_bar_get_display); + +STATIC mp_obj_t supervisor_status_bar_set_display(mp_obj_t self_in, mp_obj_t state_in) { + #if CIRCUITPY_STATUS_BAR && CIRCUITPY_TERMINALIO + supervisor_status_bar_obj_t *self = MP_OBJ_TO_PTR(self_in); + shared_module_supervisor_status_bar_set_display(self, mp_obj_is_true(state_in)); + return mp_const_none; + #else + mp_raise_NotImplementedError(NULL); + #endif +} +MP_DEFINE_CONST_FUN_OBJ_2(supervisor_status_bar_set_display_obj, supervisor_status_bar_set_display); + +MP_PROPERTY_GETSET(supervisor_status_bar_display_obj, + (mp_obj_t)&supervisor_status_bar_get_display_obj, + (mp_obj_t)&supervisor_status_bar_set_display_obj); + + +STATIC const mp_rom_map_elem_t supervisor_status_bar_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_console), MP_ROM_PTR(&supervisor_status_bar_console_obj) }, + { MP_ROM_QSTR(MP_QSTR_display), MP_ROM_PTR(&supervisor_status_bar_display_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(supervisor_status_bar_locals_dict, supervisor_status_bar_locals_dict_table); + +const mp_obj_type_t supervisor_status_bar_type = { + .base = { &mp_type_type }, + .name = MP_QSTR_Status_Bar, + .locals_dict = (mp_obj_dict_t *)&supervisor_status_bar_locals_dict, +}; diff --git a/shared-bindings/supervisor/StatusBar.h b/shared-bindings/supervisor/StatusBar.h new file mode 100644 index 0000000000..12b337ea84 --- /dev/null +++ b/shared-bindings/supervisor/StatusBar.h @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 by 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_STATUS_BAR_STATUS_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_STATUS_BAR_STATUS_H + +#include +#include "py/obj.h" +#include "shared-module/supervisor/StatusBar.h" + +extern const mp_obj_type_t supervisor_status_bar_type; + +bool shared_module_supervisor_status_bar_get_console(supervisor_status_bar_obj_t *self); +void shared_module_supervisor_status_bar_set_console(supervisor_status_bar_obj_t *self, bool enabled); + +bool shared_module_supervisor_status_bar_get_display(supervisor_status_bar_obj_t *self); +void shared_module_supervisor_status_bar_set_display(supervisor_status_bar_obj_t *self, bool enabled); + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SUPERVISOR_STATUS_BAR_H diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index fb3b2ff3b6..2a669eb3ad 100644 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -36,14 +36,18 @@ #include "supervisor/shared/reload.h" #include "supervisor/shared/stack.h" #include "supervisor/shared/traceback.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/workflow.h" + +#if CIRCUITPY_USB #include "supervisor/usb.h" +#endif #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/supervisor/__init__.h" #include "shared-bindings/time/__init__.h" #include "shared-bindings/supervisor/Runtime.h" +#include "shared-bindings/supervisor/StatusBar.h" //| """Supervisor settings""" //| @@ -54,26 +58,13 @@ //| This object is the sole instance of `supervisor.Runtime`.""" //| -//| def enable_autoreload() -> None: -//| """Enable autoreload based on USB file write activity.""" -//| ... +//| status_bar: StatusBar +//| """The status bar, shown on an attached display, and also sent to +//| an attached terminal via OSC escape codes over the REPL serial connection. +//| The status bar reports the current IP or BLE connection, what file is running, +//| the last exception name and location, and firmware version information. +//| This object is the sole instance of `supervisor.StatusBar`.""" //| -STATIC mp_obj_t supervisor_enable_autoreload(void) { - autoreload_enable(); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_0(supervisor_enable_autoreload_obj, supervisor_enable_autoreload); - -//| def disable_autoreload() -> None: -//| """Disable autoreload based on USB file write activity until -//| `enable_autoreload` is called.""" -//| ... -//| -STATIC mp_obj_t supervisor_disable_autoreload(void) { - autoreload_disable(); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_0(supervisor_disable_autoreload_obj, supervisor_disable_autoreload); //| def set_rgb_status_brightness(brightness: int) -> None: //| """Set brightness of status RGB LED from 0-255. This will take effect @@ -107,9 +98,8 @@ MP_DEFINE_CONST_FUN_OBJ_0(supervisor_reload_obj, supervisor_reload); STATIC mp_obj_t supervisor_set_next_stack_limit(mp_obj_t size_obj) { mp_int_t size = mp_obj_get_int(size_obj); - if (size < 256) { - mp_raise_ValueError(translate("Stack size must be at least 256")); - } + mp_arg_validate_int_min(size, 256, MP_QSTR_size); + set_next_stack_size(size); return mp_const_none; @@ -312,17 +302,20 @@ STATIC mp_obj_t supervisor_reset_terminal(mp_obj_t x_pixels, mp_obj_t y_pixels) } MP_DEFINE_CONST_FUN_OBJ_2(supervisor_reset_terminal_obj, supervisor_reset_terminal); -#if CIRCUITPY_USB //| def set_usb_identification(manufacturer: Optional[str] = None, product: Optional[str] = None, vid: int = -1, pid: int = -1) -> None: //| """Override identification constants in the USB Device Descriptor. //| //| If passed, `manufacturer` and `product` must be ASCII strings (or buffers) of at most 126 //| characters. Any omitted arguments will be left at their default values. //| -//| This method must be called in boot.py to have any effect.""" +//| This method must be called in boot.py to have any effect. + +//| Not available on boards without native USB support. +//| """ //| ... //| STATIC mp_obj_t supervisor_set_usb_identification(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + #if CIRCUITPY_USB static const mp_arg_t allowed_args[] = { { MP_QSTR_manufacturer, MP_ARG_OBJ, {.u_rom_obj = mp_const_none} }, { MP_QSTR_product, MP_ARG_OBJ, {.u_rom_obj = mp_const_none} }, @@ -368,14 +361,14 @@ STATIC mp_obj_t supervisor_set_usb_identification(size_t n_args, const mp_obj_t } return mp_const_none; + #else + mp_raise_NotImplementedError(NULL); + #endif } MP_DEFINE_CONST_FUN_OBJ_KW(supervisor_set_usb_identification_obj, 0, supervisor_set_usb_identification); -#endif STATIC const mp_rom_map_elem_t supervisor_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_supervisor) }, - { MP_ROM_QSTR(MP_QSTR_enable_autoreload), MP_ROM_PTR(&supervisor_enable_autoreload_obj) }, - { MP_ROM_QSTR(MP_QSTR_disable_autoreload), MP_ROM_PTR(&supervisor_disable_autoreload_obj) }, { MP_ROM_QSTR(MP_QSTR_set_rgb_status_brightness), MP_ROM_PTR(&supervisor_set_rgb_status_brightness_obj) }, { MP_ROM_QSTR(MP_QSTR_runtime), MP_ROM_PTR(&common_hal_supervisor_runtime_obj) }, { MP_ROM_QSTR(MP_QSTR_reload), MP_ROM_PTR(&supervisor_reload_obj) }, @@ -386,9 +379,8 @@ STATIC const mp_rom_map_elem_t supervisor_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_get_previous_traceback), MP_ROM_PTR(&supervisor_get_previous_traceback_obj) }, { MP_ROM_QSTR(MP_QSTR_disable_ble_workflow), MP_ROM_PTR(&supervisor_disable_ble_workflow_obj) }, { MP_ROM_QSTR(MP_QSTR_reset_terminal), MP_ROM_PTR(&supervisor_reset_terminal_obj) }, - #if CIRCUITPY_USB { MP_ROM_QSTR(MP_QSTR_set_usb_identification), MP_ROM_PTR(&supervisor_set_usb_identification_obj) }, - #endif + { MP_ROM_QSTR(MP_QSTR_status_bar), MP_ROM_PTR(&shared_module_supervisor_status_bar_obj) }, }; STATIC MP_DEFINE_CONST_DICT(supervisor_module_globals, supervisor_module_globals_table); diff --git a/shared-bindings/supervisor/__init__.h b/shared-bindings/supervisor/__init__.h index 40a1e73932..4b4dc4fc57 100644 --- a/shared-bindings/supervisor/__init__.h +++ b/shared-bindings/supervisor/__init__.h @@ -31,8 +31,10 @@ #include "py/obj.h" #include "common-hal/supervisor/Runtime.h" +#include "shared-module/supervisor/StatusBar.h" extern const super_runtime_obj_t common_hal_supervisor_runtime_obj; +extern supervisor_status_bar_obj_t shared_module_supervisor_status_bar_obj; extern mp_obj_t supervisor_ticks_ms(void); diff --git a/shared-bindings/support_matrix.rst b/shared-bindings/support_matrix.rst index 2385183c98..c54bfa94e1 100644 --- a/shared-bindings/support_matrix.rst +++ b/shared-bindings/support_matrix.rst @@ -4,7 +4,7 @@ Module Support Matrix - Which Modules Are Available on Which Boards =================================================================== The following table lists the available built-in modules for each CircuitPython -capable board. +capable board, as well as each :term:`frozen module` included on it. .. raw:: html @@ -21,6 +21,14 @@ capable board. {% for key, value in support_matrix|dictsort %} {{ '.. _' ~ key|replace(" ", "-") ~ ':' }} * - {{ key }} - - {{ ':py:mod:`' ~ value|join("`, :py:mod:`") ~ '`' }} + - {{ ':py:mod:`' ~ value.modules|join("`, :py:mod:`") ~ '`' }} + + {% for module in value.frozen_libraries %}\ + {% if loop.index == 1 %}**Frozen Modules:** {% endif %}\ + {% if loop.index > 1 %}, {% endif %}\ + {% if module[1] %}{{ '`' ~ module[0] ~ ' <' ~ module[1] ~ '>`__' }}\ + {% else %}{{ '`' ~ module[0] ~ ' <#>`__' }}\ + {% endif %}\ + {% endfor %} {% endfor %} diff --git a/shared-bindings/synthio/MidiTrack.c b/shared-bindings/synthio/MidiTrack.c index 1fb3fdbec1..e27ff903c6 100644 --- a/shared-bindings/synthio/MidiTrack.c +++ b/shared-bindings/synthio/MidiTrack.c @@ -32,7 +32,7 @@ #include "py/runtime.h" #include "shared-bindings/util.h" #include "shared-bindings/synthio/MidiTrack.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class MidiTrack: //| """Simple square-wave MIDI synth""" @@ -132,12 +132,8 @@ STATIC mp_obj_t synthio_miditrack_obj_get_sample_rate(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(synthio_miditrack_get_sample_rate_obj, synthio_miditrack_obj_get_sample_rate); -const mp_obj_property_t synthio_miditrack_sample_rate_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&synthio_miditrack_get_sample_rate_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(synthio_miditrack_sample_rate_obj, + (mp_obj_t)&synthio_miditrack_get_sample_rate_obj); STATIC const mp_rom_map_elem_t synthio_miditrack_locals_dict_table[] = { // Methods diff --git a/shared-bindings/synthio/__init__.c b/shared-bindings/synthio/__init__.c index 72fe2eb31f..106a073535 100644 --- a/shared-bindings/synthio/__init__.c +++ b/shared-bindings/synthio/__init__.c @@ -82,7 +82,7 @@ STATIC mp_obj_t synthio_from_file(size_t n_args, const mp_obj_t *pos_args, mp_ma } if (bytes_read != sizeof(chunk_header) || memcmp(chunk_header, "MThd\0\0\0\6\0\0\0\1", 12)) { - mp_raise_ValueError(translate("Invalid MIDI file")); + mp_arg_error_invalid(MP_QSTR_file); // TODO: for a multi-track MIDI (type 1), return an AudioMixer } @@ -97,7 +97,7 @@ STATIC mp_obj_t synthio_from_file(size_t n_args, const mp_obj_t *pos_args, mp_ma mp_raise_OSError(MP_EIO); } if (bytes_read != 8 || memcmp(chunk_header, "MTrk", 4)) { - mp_raise_ValueError(translate("Invalid MIDI file")); + mp_arg_error_invalid(MP_QSTR_file); } uint32_t track_size = (chunk_header[4] << 24) | (chunk_header[5] << 16) | (chunk_header[6] << 8) | chunk_header[7]; @@ -106,7 +106,7 @@ STATIC mp_obj_t synthio_from_file(size_t n_args, const mp_obj_t *pos_args, mp_ma mp_raise_OSError(MP_EIO); } if (bytes_read != track_size) { - mp_raise_ValueError(translate("Invalid MIDI file")); + mp_arg_error_invalid(MP_QSTR_file); } synthio_miditrack_obj_t *result = m_new_obj(synthio_miditrack_obj_t); diff --git a/shared-bindings/terminalio/Terminal.c b/shared-bindings/terminalio/Terminal.c index cdeca59164..948741a4f0 100644 --- a/shared-bindings/terminalio/Terminal.c +++ b/shared-bindings/terminalio/Terminal.c @@ -35,34 +35,55 @@ #include "py/runtime.h" #include "py/stream.h" #include "shared-bindings/fontio/BuiltinFont.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Terminal: -//| """Display a character stream with a TileGrid""" +//| """Display a character stream with a TileGrid //| -//| def __init__(self, tilegrid: displayio.TileGrid, font: fontio.BuiltinFont) -> None: +//| ASCII control: +//| * ``\\r`` - Move cursor to column 1 +//| * ``\\n`` - Move cursor down a row +//| * ``\\b`` - Move cursor left one if possible +//| +//| OSC control sequences: +//| * ``ESC ] 0; ESC \\`` - Set title bar to +//| * ``ESC ] ####; ESC \\`` - Ignored +//| +//| VT100 control sequences: +//| * ``ESC [ K`` - Clear the remainder of the line +//| * ``ESC [ #### D`` - Move the cursor to the left by #### +//| * ``ESC [ 2 J`` - Erase the entire display +//| * ``ESC [ nnnn ; mmmm H`` - Move the cursor to mmmm, nnnn. +//| """ +//| +//| def __init__(self, scroll_area: displayio.TileGrid, font: fontio.BuiltinFont, *, status_bar: displayio.TileGrid = None) -> None: //| """Terminal manages tile indices and cursor position based on VT100 commands. The font should be //| a `fontio.BuiltinFont` and the TileGrid's bitmap should match the font's bitmap.""" //| ... //| STATIC mp_obj_t terminalio_terminal_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_tilegrid, ARG_font }; + enum { ARG_scroll_area, ARG_font, ARG_status_bar }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_tilegrid, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_scroll_area, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_font, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_status_bar, MP_ARG_KW_ONLY | MP_ARG_OBJ, { .u_obj = mp_const_none } }, }; 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); - displayio_tilegrid_t *tilegrid = mp_arg_validate_type(args[ARG_tilegrid].u_obj, &displayio_tilegrid_type, MP_QSTR_tilegrid); + displayio_tilegrid_t *scroll_area = mp_arg_validate_type(args[ARG_scroll_area].u_obj, &displayio_tilegrid_type, MP_QSTR_scroll_area); + displayio_tilegrid_t *status_bar = NULL; + if (args[ARG_status_bar].u_obj != mp_const_none) { + status_bar = mp_arg_validate_type(args[ARG_status_bar].u_obj, &displayio_tilegrid_type, MP_QSTR_status_bar); + } fontio_builtinfont_t *font = mp_arg_validate_type(args[ARG_font].u_obj, &fontio_builtinfont_type, MP_QSTR_font); terminalio_terminal_obj_t *self = m_new_obj(terminalio_terminal_obj_t); self->base.type = &terminalio_terminal_type; - common_hal_terminalio_terminal_construct(self, tilegrid, font); + common_hal_terminalio_terminal_construct(self, scroll_area, font, status_bar); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/terminalio/Terminal.h b/shared-bindings/terminalio/Terminal.h index f884edd6d5..fda1c29bdd 100644 --- a/shared-bindings/terminalio/Terminal.h +++ b/shared-bindings/terminalio/Terminal.h @@ -34,7 +34,7 @@ extern const mp_obj_type_t terminalio_terminal_type; extern void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self, - displayio_tilegrid_t *tilegrid, const fontio_builtinfont_t *font); + displayio_tilegrid_t *scroll_area, const fontio_builtinfont_t *font, displayio_tilegrid_t *status_bar); // Write characters. len is in characters NOT bytes! extern size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, diff --git a/shared-bindings/terminalio/__init__.c b/shared-bindings/terminalio/__init__.c index 38313dc757..5fd1a2751a 100644 --- a/shared-bindings/terminalio/__init__.c +++ b/shared-bindings/terminalio/__init__.c @@ -38,7 +38,12 @@ //| """Displays text in a TileGrid //| //| The `terminalio` module contains classes to display a character stream on a display. The built -//| in font is available as ``terminalio.FONT``.""" +//| in font is available as ``terminalio.FONT``. +//| +//| .. note:: This module does not give access to the +//| `REPL `_. +//| +//| """ //| //| FONT: fontio.BuiltinFont //| """The built in font""" diff --git a/shared-bindings/time/__init__.c b/shared-bindings/time/__init__.c index 4b090fc34e..096c80d382 100644 --- a/shared-bindings/time/__init__.c +++ b/shared-bindings/time/__init__.c @@ -34,13 +34,12 @@ #include "shared/timeutils/timeutils.h" #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/time/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| """time and timing related functions //| -//| The `time` module is a strict subset of the CPython `cpython:time` module. So, code -//| using `time` written in CircuitPython will work in CPython but not necessarily the other -//| way around.""" +//| |see_cpython_module| :mod:`cpython:time`. +//| """ //| //| def monotonic() -> float: //| """Returns an always increasing value of time with an unknown reference diff --git a/shared-bindings/touchio/TouchIn.c b/shared-bindings/touchio/TouchIn.c index 537ae29776..729cf94d5d 100644 --- a/shared-bindings/touchio/TouchIn.c +++ b/shared-bindings/touchio/TouchIn.c @@ -36,7 +36,7 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/touchio/TouchIn.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class TouchIn: //| """Read the state of a capacitive touch sensor @@ -120,12 +120,8 @@ STATIC mp_obj_t touchio_touchin_obj_get_value(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(touchio_touchin_get_value_obj, touchio_touchin_obj_get_value); -const mp_obj_property_t touchio_touchin_value_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&touchio_touchin_get_value_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(touchio_touchin_value_obj, + (mp_obj_t)&touchio_touchin_get_value_obj); //| raw_value: int @@ -139,12 +135,8 @@ STATIC mp_obj_t touchio_touchin_obj_get_raw_value(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(touchio_touchin_get_raw_value_obj, touchio_touchin_obj_get_raw_value); -const mp_obj_property_t touchio_touchin_raw_value_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&touchio_touchin_get_raw_value_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(touchio_touchin_raw_value_obj, + (mp_obj_t)&touchio_touchin_get_raw_value_obj); //| threshold: Optional[int] @@ -183,12 +175,9 @@ STATIC mp_obj_t touchio_touchin_obj_set_threshold(mp_obj_t self_in, mp_obj_t thr MP_DEFINE_CONST_FUN_OBJ_2(touchio_touchin_set_threshold_obj, touchio_touchin_obj_set_threshold); -const mp_obj_property_t touchio_touchin_threshold_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&touchio_touchin_get_threshold_obj, - (mp_obj_t)&touchio_touchin_set_threshold_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(touchio_touchin_threshold_obj, + (mp_obj_t)&touchio_touchin_get_threshold_obj, + (mp_obj_t)&touchio_touchin_set_threshold_obj); STATIC const mp_rom_map_elem_t touchio_touchin_locals_dict_table[] = { diff --git a/shared-bindings/touchio/__init__.c b/shared-bindings/touchio/__init__.c index e2a6ad9317..2d6bf5f31c 100644 --- a/shared-bindings/touchio/__init__.c +++ b/shared-bindings/touchio/__init__.c @@ -45,7 +45,10 @@ //| call :py:meth:`!deinit` or use a context manager. See //| :ref:`lifetime-and-contextmanagers` for more info. //| -//| For example:: +//| For more information about working with the `touchio` module in CircuitPython, +//| see `this Learn guide page `_. +//| +//| Example:: //| //| import touchio //| from board import * diff --git a/shared-bindings/traceback/__init__.c b/shared-bindings/traceback/__init__.c index aa21210494..880fe08e85 100644 --- a/shared-bindings/traceback/__init__.c +++ b/shared-bindings/traceback/__init__.c @@ -34,6 +34,7 @@ //| This module provides a standard interface to print stack traces of programs. //| This is useful when you want to print stack traces under program control. //| +//| |see_cpython_module| :mod:`cpython:traceback`. //| """ //| ... //| diff --git a/shared-bindings/usb/core/Device.c b/shared-bindings/usb/core/Device.c index 6828a6b6f7..2ade459d5f 100644 --- a/shared-bindings/usb/core/Device.c +++ b/shared-bindings/usb/core/Device.c @@ -79,12 +79,8 @@ STATIC mp_obj_t usb_core_device_obj_get_idVendor(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_core_device_get_idVendor_obj, usb_core_device_obj_get_idVendor); -const mp_obj_property_t usb_core_device_idVendor_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_core_device_get_idVendor_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(usb_core_device_idVendor_obj, + (mp_obj_t)&usb_core_device_get_idVendor_obj); //| idProduct: int //| """The USB product ID of the device""" @@ -95,12 +91,8 @@ STATIC mp_obj_t usb_core_device_obj_get_idProduct(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_core_device_get_idProduct_obj, usb_core_device_obj_get_idProduct); -const mp_obj_property_t usb_core_device_idProduct_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_core_device_get_idProduct_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(usb_core_device_idProduct_obj, + (mp_obj_t)&usb_core_device_get_idProduct_obj); //| serial_number: str //| """The USB device's serial number string.""" @@ -111,12 +103,8 @@ STATIC mp_obj_t usb_core_device_obj_get_serial_number(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_core_device_get_serial_number_obj, usb_core_device_obj_get_serial_number); -const mp_obj_property_t usb_core_device_serial_number_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_core_device_get_serial_number_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(usb_core_device_serial_number_obj, + (mp_obj_t)&usb_core_device_get_serial_number_obj); //| product: str //| """The USB device's product string.""" @@ -127,12 +115,8 @@ STATIC mp_obj_t usb_core_device_obj_get_product(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_core_device_get_product_obj, usb_core_device_obj_get_product); -const mp_obj_property_t usb_core_device_product_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_core_device_get_product_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(usb_core_device_product_obj, + (mp_obj_t)&usb_core_device_get_product_obj); //| manufacturer: str //| """The USB device's manufacturer string.""" @@ -143,12 +127,8 @@ STATIC mp_obj_t usb_core_device_obj_get_manufacturer(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_core_device_get_manufacturer_obj, usb_core_device_obj_get_manufacturer); -const mp_obj_property_t usb_core_device_manufacturer_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_core_device_get_manufacturer_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(usb_core_device_manufacturer_obj, + (mp_obj_t)&usb_core_device_get_manufacturer_obj); //| def write(self, endpoint: int, data: ReadableBuffer, timeout = None) -> int: //| """Write data to a specific endpoint on the device. @@ -207,7 +187,7 @@ STATIC mp_obj_t usb_core_device_read(size_t n_args, const mp_obj_t *pos_args, mp MP_DEFINE_CONST_FUN_OBJ_KW(usb_core_device_read_obj, 2, usb_core_device_read); //| def ctrl_transfer(self, bmRequestType, bRequest, wValue=0, wIndex=0, -//| data_or_wLength: array.array = None, timeout = None) -> int: +//| data_or_wLength: Optional[array.array] = None, timeout = None) -> int: //| """Do a control transfer on the endpoint 0. The parameters bmRequestType, //| bRequest, wValue and wIndex are the same of the USB Standard Control //| Request format. diff --git a/shared-bindings/usb_cdc/Serial.c b/shared-bindings/usb_cdc/Serial.c index 95ecb98ccd..8a74380be3 100644 --- a/shared-bindings/usb_cdc/Serial.c +++ b/shared-bindings/usb_cdc/Serial.c @@ -33,7 +33,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Serial: //| """Receives cdc commands over USB""" @@ -157,12 +157,8 @@ STATIC mp_obj_t usb_cdc_serial_get_connected(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_connected_obj, usb_cdc_serial_get_connected); -const mp_obj_property_t usb_cdc_serial_connected_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_cdc_serial_get_connected_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(usb_cdc_serial_connected_obj, + (mp_obj_t)&usb_cdc_serial_get_connected_obj); //| in_waiting: int //| """Returns the number of bytes waiting to be read on the USB serial input. (read-only)""" @@ -173,12 +169,8 @@ STATIC mp_obj_t usb_cdc_serial_get_in_waiting(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_in_waiting_obj, usb_cdc_serial_get_in_waiting); -const mp_obj_property_t usb_cdc_serial_in_waiting_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_cdc_serial_get_in_waiting_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(usb_cdc_serial_in_waiting_obj, + (mp_obj_t)&usb_cdc_serial_get_in_waiting_obj); //| out_waiting: int //| """Returns the number of bytes waiting to be written on the USB serial output. (read-only)""" @@ -189,12 +181,8 @@ STATIC mp_obj_t usb_cdc_serial_get_out_waiting(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_out_waiting_obj, usb_cdc_serial_get_out_waiting); -const mp_obj_property_t usb_cdc_serial_out_waiting_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_cdc_serial_get_out_waiting_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(usb_cdc_serial_out_waiting_obj, + (mp_obj_t)&usb_cdc_serial_get_out_waiting_obj); //| def reset_input_buffer(self) -> None: //| """Clears any unread bytes.""" @@ -237,12 +225,9 @@ STATIC mp_obj_t usb_cdc_serial_set_timeout(mp_obj_t self_in, mp_obj_t timeout_in } MP_DEFINE_CONST_FUN_OBJ_2(usb_cdc_serial_set_timeout_obj, usb_cdc_serial_set_timeout); -const mp_obj_property_t usb_cdc_serial_timeout_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_cdc_serial_get_timeout_obj, - (mp_obj_t)&usb_cdc_serial_set_timeout_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(usb_cdc_serial_timeout_obj, + (mp_obj_t)&usb_cdc_serial_get_timeout_obj, + (mp_obj_t)&usb_cdc_serial_set_timeout_obj); //| write_timeout: Optional[float] //| """The initial value of `write_timeout` is ``None``. If ``None``, wait indefinitely to finish @@ -264,12 +249,9 @@ STATIC mp_obj_t usb_cdc_serial_set_write_timeout(mp_obj_t self_in, mp_obj_t writ } MP_DEFINE_CONST_FUN_OBJ_2(usb_cdc_serial_set_write_timeout_obj, usb_cdc_serial_set_write_timeout); -const mp_obj_property_t usb_cdc_serial_write_timeout_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_cdc_serial_get_write_timeout_obj, - (mp_obj_t)&usb_cdc_serial_set_write_timeout_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(usb_cdc_serial_write_timeout_obj, + (mp_obj_t)&usb_cdc_serial_get_write_timeout_obj, + (mp_obj_t)&usb_cdc_serial_set_write_timeout_obj); STATIC const mp_rom_map_elem_t usb_cdc_serial_locals_dict_table[] = { diff --git a/shared-bindings/usb_cdc/__init__.c b/shared-bindings/usb_cdc/__init__.c index eabe26ad07..e23e289309 100644 --- a/shared-bindings/usb_cdc/__init__.c +++ b/shared-bindings/usb_cdc/__init__.c @@ -31,6 +31,7 @@ #include "shared-bindings/usb_cdc/__init__.h" #include "shared-bindings/usb_cdc/Serial.h" +#include "supervisor/shared/translate/translate.h" #include "py/runtime.h" diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index 50f67e90cb..a41a540f7e 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -27,6 +27,7 @@ #include "py/objproperty.h" #include "shared-bindings/usb_hid/Device.h" #include "py/runtime.h" +#include "supervisor/shared/translate/translate.h" //| class Device: //| """HID Device specification""" @@ -107,17 +108,15 @@ STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args const uint16_t usage_page = usage_page_arg; const mp_int_t usage_arg = args[ARG_usage].u_int; - mp_arg_validate_int_range(usage_arg, 1, 0xFFFF, MP_QSTR_usage_page); + mp_arg_validate_int_range(usage_arg, 1, 0xFFFF, MP_QSTR_usage); const uint16_t usage = usage_arg; mp_obj_t report_ids = args[ARG_report_ids].u_obj; mp_obj_t in_report_lengths = args[ARG_in_report_lengths].u_obj; mp_obj_t out_report_lengths = args[ARG_out_report_lengths].u_obj; - size_t report_ids_count = (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(report_ids)); - if (report_ids_count < 1) { - mp_raise_ValueError_varg(translate("%q length must be >= 1"), MP_QSTR_report_ids); - } + size_t report_ids_count = + mp_arg_validate_length_min((size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(report_ids)), 1, MP_QSTR_report_ids); if ((size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(in_report_lengths)) != report_ids_count || (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(out_report_lengths)) != report_ids_count) { @@ -158,7 +157,7 @@ STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args } -//| def send_report(self, buf: ReadableBuffer, report_id: Optional[int] = None) -> None: +//| def send_report(self, report: ReadableBuffer, report_id: Optional[int] = None) -> None: //| """Send an HID report. If the device descriptor specifies zero or one report id's, //| you can supply `None` (the default) as the value of ``report_id``. //| Otherwise you must specify which report id to use when sending the report. @@ -168,9 +167,9 @@ STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args STATIC mp_obj_t usb_hid_device_send_report(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { usb_hid_device_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); - enum { ARG_buf, ARG_report_id }; + enum { ARG_report, ARG_report_id }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_buf, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_report, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_report_id, MP_ARG_OBJ, {.u_obj = mp_const_none} }, }; @@ -178,7 +177,7 @@ STATIC mp_obj_t usb_hid_device_send_report(size_t n_args, const mp_obj_t *pos_ar mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); mp_buffer_info_t bufinfo; - mp_get_buffer_raise(args[ARG_buf].u_obj, &bufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(args[ARG_report].u_obj, &bufinfo, MP_BUFFER_READ); // -1 asks common_hal to determine the report id if possible. mp_int_t report_id_arg = -1; @@ -192,10 +191,11 @@ STATIC mp_obj_t usb_hid_device_send_report(size_t n_args, const mp_obj_t *pos_ar } MP_DEFINE_CONST_FUN_OBJ_KW(usb_hid_device_send_report_obj, 1, usb_hid_device_send_report); -//| def get_last_received_report(self, report_id: Optional[int] = None) -> bytes: +//| def get_last_received_report(self, report_id: Optional[int] = None) -> Optional[bytes]: //| """Get the last received HID OUT or feature report for the given report ID. //| The report ID may be omitted if there is no report ID, or only one report ID. -//| Return `None` if nothing received. +//| Return `None` if nothing received. After returning a report, subsequent calls +//| will return `None` until next report is received. //| """ //| ... //| @@ -220,29 +220,6 @@ STATIC mp_obj_t usb_hid_device_get_last_received_report(size_t n_args, const mp_ } MP_DEFINE_CONST_FUN_OBJ_KW(usb_hid_device_get_last_received_report_obj, 1, usb_hid_device_get_last_received_report); -//| last_received_report: bytes -//| """The HID OUT report as a `bytes` (read-only). `None` if nothing received. -//| Same as `get_last_received_report()` with no argument. -//| -//| Deprecated: will be removed in CircutPython 8.0.0. Use `get_last_received_report()` instead. -//| """ -//| -STATIC mp_obj_t usb_hid_device_obj_get_last_received_report_property(mp_obj_t self_in) { - usb_hid_device_obj_t *self = MP_OBJ_TO_PTR(self_in); - - // Get the sole report_id, if there is one. - const uint8_t report_id = common_hal_usb_hid_device_validate_report_id(self, -1); - return common_hal_usb_hid_device_get_last_received_report(self, report_id); -} -MP_DEFINE_CONST_FUN_OBJ_1(usb_hid_device_get_last_received_report_property_obj, usb_hid_device_obj_get_last_received_report_property); - -const mp_obj_property_t usb_hid_device_last_received_report_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_hid_device_get_last_received_report_property_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; - //| usage_page: int //| """The device usage page identifier, which designates a category of device. (read-only)""" //| @@ -252,12 +229,8 @@ STATIC mp_obj_t usb_hid_device_obj_get_usage_page(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(usb_hid_device_get_usage_page_obj, usb_hid_device_obj_get_usage_page); -const mp_obj_property_t usb_hid_device_usage_page_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_hid_device_get_usage_page_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(usb_hid_device_usage_page_obj, + (mp_obj_t)&usb_hid_device_get_usage_page_obj); //| usage: int //| """The device usage identifier, which designates a specific kind of device. (read-only) @@ -272,17 +245,12 @@ STATIC mp_obj_t usb_hid_device_obj_get_usage(mp_obj_t self_in) { MP_DEFINE_CONST_FUN_OBJ_1(usb_hid_device_get_usage_obj, usb_hid_device_obj_get_usage); -const mp_obj_property_t usb_hid_device_usage_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&usb_hid_device_get_usage_obj, - MP_ROM_NONE, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETTER(usb_hid_device_usage_obj, + (mp_obj_t)&usb_hid_device_get_usage_obj); STATIC const mp_rom_map_elem_t usb_hid_device_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_send_report), MP_ROM_PTR(&usb_hid_device_send_report_obj) }, { MP_ROM_QSTR(MP_QSTR_get_last_received_report), MP_ROM_PTR(&usb_hid_device_get_last_received_report_obj) }, - { MP_ROM_QSTR(MP_QSTR_last_received_report), MP_ROM_PTR(&usb_hid_device_last_received_report_obj) }, { MP_ROM_QSTR(MP_QSTR_usage_page), MP_ROM_PTR(&usb_hid_device_usage_page_obj) }, { MP_ROM_QSTR(MP_QSTR_usage), MP_ROM_PTR(&usb_hid_device_usage_obj) }, diff --git a/shared-bindings/usb_hid/__init__.c b/shared-bindings/usb_hid/__init__.c index 3922ded03c..dcdf6933f7 100644 --- a/shared-bindings/usb_hid/__init__.c +++ b/shared-bindings/usb_hid/__init__.c @@ -31,6 +31,8 @@ #include "shared-bindings/usb_hid/__init__.h" #include "shared-bindings/usb_hid/Device.h" +#include "supervisor/shared/translate/translate.h" + //| """USB Human Interface Device //| //| The `usb_hid` module allows you to output data as a HID device.""" diff --git a/shared-bindings/usb_midi/PortIn.c b/shared-bindings/usb_midi/PortIn.c index 0056a0818a..273fa77b35 100644 --- a/shared-bindings/usb_midi/PortIn.c +++ b/shared-bindings/usb_midi/PortIn.c @@ -33,7 +33,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PortIn: //| """Receives midi commands over USB""" diff --git a/shared-bindings/usb_midi/PortOut.c b/shared-bindings/usb_midi/PortOut.c index c468401924..d5652be5d4 100644 --- a/shared-bindings/usb_midi/PortOut.c +++ b/shared-bindings/usb_midi/PortOut.c @@ -33,7 +33,7 @@ #include "py/objproperty.h" #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class PortOut: //| """Sends midi messages to a computer over USB""" diff --git a/shared-bindings/usb_midi/__init__.c b/shared-bindings/usb_midi/__init__.c index ec065d1e18..d3d5cf2626 100644 --- a/shared-bindings/usb_midi/__init__.c +++ b/shared-bindings/usb_midi/__init__.c @@ -32,6 +32,7 @@ #include "shared-bindings/usb_midi/__init__.h" #include "shared-bindings/usb_midi/PortIn.h" #include "shared-bindings/usb_midi/PortOut.h" +#include "supervisor/shared/translate/translate.h" #include "py/runtime.h" diff --git a/shared-bindings/util.c b/shared-bindings/util.c index c1ca01e0ad..5c5eafad4a 100644 --- a/shared-bindings/util.c +++ b/shared-bindings/util.c @@ -30,7 +30,7 @@ #include "py/runtime.h" #include "shared-bindings/util.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // If so, deinit() has already been called on the object, so complain. void raise_deinited_error(void) { diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 289bab031c..f955cd2afe 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -8,7 +8,7 @@ #include "py/objproperty.h" #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Circle: //| @@ -76,12 +76,9 @@ STATIC mp_obj_t vectorio_circle_obj_set_radius(mp_obj_t self_in, mp_obj_t radius } MP_DEFINE_CONST_FUN_OBJ_2(vectorio_circle_set_radius_obj, vectorio_circle_obj_set_radius); -const mp_obj_property_t vectorio_circle_radius_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&vectorio_circle_get_radius_obj, - (mp_obj_t)&vectorio_circle_set_radius_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(vectorio_circle_radius_obj, + (mp_obj_t)&vectorio_circle_get_radius_obj, + (mp_obj_t)&vectorio_circle_set_radius_obj); //| color_index : int //| """The color_index of the circle as 0 based index of the palette.""" @@ -99,12 +96,9 @@ STATIC mp_obj_t vectorio_circle_obj_set_color_index(mp_obj_t self_in, mp_obj_t c } MP_DEFINE_CONST_FUN_OBJ_2(vectorio_circle_set_color_index_obj, vectorio_circle_obj_set_color_index); -const mp_obj_property_t vectorio_circle_color_index_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&vectorio_circle_get_color_index_obj, - (mp_obj_t)&vectorio_circle_set_color_index_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(vectorio_circle_color_index_obj, + (mp_obj_t)&vectorio_circle_get_color_index_obj, + (mp_obj_t)&vectorio_circle_set_color_index_obj); // Documentation for properties inherited from VectorShape. diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index ea33baad55..60a4582e5a 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -9,7 +9,7 @@ #include "py/objproperty.h" #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define VECTORIO_POLYGON_DEBUG(...) (void)0 @@ -82,12 +82,9 @@ STATIC mp_obj_t vectorio_polygon_obj_set_points(mp_obj_t self_in, mp_obj_t point } MP_DEFINE_CONST_FUN_OBJ_2(vectorio_polygon_set_points_obj, vectorio_polygon_obj_set_points); -const mp_obj_property_t vectorio_polygon_points_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&vectorio_polygon_get_points_obj, - (mp_obj_t)&vectorio_polygon_set_points_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(vectorio_polygon_points_obj, + (mp_obj_t)&vectorio_polygon_get_points_obj, + (mp_obj_t)&vectorio_polygon_set_points_obj); //| color_index : int //| """The color_index of the polygon as 0 based index of the palette.""" @@ -105,12 +102,9 @@ STATIC mp_obj_t vectorio_polygon_obj_set_color_index(mp_obj_t self_in, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(vectorio_polygon_set_color_index_obj, vectorio_polygon_obj_set_color_index); -const mp_obj_property_t vectorio_polygon_color_index_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&vectorio_polygon_get_color_index_obj, - (mp_obj_t)&vectorio_polygon_set_color_index_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(vectorio_polygon_color_index_obj, + (mp_obj_t)&vectorio_polygon_get_color_index_obj, + (mp_obj_t)&vectorio_polygon_set_color_index_obj); // Documentation for properties inherited from VectorShape. diff --git a/shared-bindings/vectorio/Rectangle.c b/shared-bindings/vectorio/Rectangle.c index 739a1ba9d1..34b9e1eabe 100644 --- a/shared-bindings/vectorio/Rectangle.c +++ b/shared-bindings/vectorio/Rectangle.c @@ -7,7 +7,7 @@ #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" //| class Rectangle: //| def __init__(self, pixel_shader: Union[displayio.ColorConverter, displayio.Palette], width: int, height: int, x: int, y: int) -> None: diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index 3293466cc4..ba55cfb851 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -16,7 +16,7 @@ #include "py/objproperty.h" #include "py/objtype.h" #include "py/runtime.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // shape: The shape implementation to draw. @@ -78,6 +78,7 @@ vectorio_draw_protocol_impl_t vectorio_vector_shape_draw_protocol_impl = { .draw_update_transform = (draw_update_transform_fun)vectorio_vector_shape_update_transform, .draw_finish_refresh = (draw_finish_refresh_fun)vectorio_vector_shape_finish_refresh, .draw_get_refresh_areas = (draw_get_refresh_areas_fun)vectorio_vector_shape_get_refresh_areas, + .draw_set_dirty = (draw_set_dirty_fun)common_hal_vectorio_vector_shape_set_dirty, }; // Stub checker does not approve of these shared properties. @@ -120,12 +121,9 @@ STATIC mp_obj_t vectorio_vector_shape_obj_set_x(mp_obj_t wrapper_shape, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(vectorio_vector_shape_set_x_obj, vectorio_vector_shape_obj_set_x); -const mp_obj_property_t vectorio_vector_shape_x_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&vectorio_vector_shape_get_x_obj, - (mp_obj_t)&vectorio_vector_shape_set_x_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(vectorio_vector_shape_x_obj, + (mp_obj_t)&vectorio_vector_shape_get_x_obj, + (mp_obj_t)&vectorio_vector_shape_set_x_obj); // y: int @@ -151,12 +149,9 @@ STATIC mp_obj_t vectorio_vector_shape_obj_set_y(mp_obj_t wrapper_shape, mp_obj_t } MP_DEFINE_CONST_FUN_OBJ_2(vectorio_vector_shape_set_y_obj, vectorio_vector_shape_obj_set_y); -const mp_obj_property_t vectorio_vector_shape_y_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&vectorio_vector_shape_get_y_obj, - (mp_obj_t)&vectorio_vector_shape_set_y_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(vectorio_vector_shape_y_obj, + (mp_obj_t)&vectorio_vector_shape_get_y_obj, + (mp_obj_t)&vectorio_vector_shape_set_y_obj); // location: Tuple[int, int] @@ -181,12 +176,9 @@ STATIC mp_obj_t vectorio_vector_shape_obj_set_location(mp_obj_t wrapper_shape, m } MP_DEFINE_CONST_FUN_OBJ_2(vectorio_vector_shape_set_location_obj, vectorio_vector_shape_obj_set_location); -const mp_obj_property_t vectorio_vector_shape_location_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&vectorio_vector_shape_get_location_obj, - (mp_obj_t)&vectorio_vector_shape_set_location_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(vectorio_vector_shape_location_obj, + (mp_obj_t)&vectorio_vector_shape_get_location_obj, + (mp_obj_t)&vectorio_vector_shape_set_location_obj); // pixel_shader: Union[ColorConverter, Palette] @@ -216,12 +208,9 @@ STATIC mp_obj_t vectorio_vector_shape_obj_set_pixel_shader(mp_obj_t wrapper_shap } MP_DEFINE_CONST_FUN_OBJ_2(vectorio_vector_shape_set_pixel_shader_obj, vectorio_vector_shape_obj_set_pixel_shader); -const mp_obj_property_t vectorio_vector_shape_pixel_shader_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&vectorio_vector_shape_get_pixel_shader_obj, - (mp_obj_t)&vectorio_vector_shape_set_pixel_shader_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(vectorio_vector_shape_pixel_shader_obj, + (mp_obj_t)&vectorio_vector_shape_get_pixel_shader_obj, + (mp_obj_t)&vectorio_vector_shape_set_pixel_shader_obj); STATIC const mp_rom_map_elem_t vectorio_vector_shape_locals_dict_table[] = { diff --git a/shared-bindings/vectorio/VectorShape.h b/shared-bindings/vectorio/VectorShape.h index 959a38dff0..13f62922f3 100644 --- a/shared-bindings/vectorio/VectorShape.h +++ b/shared-bindings/vectorio/VectorShape.h @@ -38,10 +38,10 @@ void vectorio_vector_shape_update_transform(vectorio_vector_shape_t *self, displ // Composable property definition for shapes that use VectorShape extern vectorio_draw_protocol_impl_t vectorio_vector_shape_draw_protocol_impl; -extern const mp_obj_property_t vectorio_vector_shape_x_obj; -extern const mp_obj_property_t vectorio_vector_shape_y_obj; -extern const mp_obj_property_t vectorio_vector_shape_location_obj; -extern const mp_obj_property_t vectorio_vector_shape_pixel_shader_obj; +extern const mp_obj_property_getset_t vectorio_vector_shape_x_obj; +extern const mp_obj_property_getset_t vectorio_vector_shape_y_obj; +extern const mp_obj_property_getset_t vectorio_vector_shape_location_obj; +extern const mp_obj_property_getset_t vectorio_vector_shape_pixel_shader_obj; extern const mp_obj_fun_builtin_fixed_t vectorio_vector_shape_contains_obj; #endif // MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_SHAPE_H diff --git a/shared-bindings/vectorio/__init__.h b/shared-bindings/vectorio/__init__.h index a34195de26..d4f10c926c 100644 --- a/shared-bindings/vectorio/__init__.h +++ b/shared-bindings/vectorio/__init__.h @@ -17,6 +17,7 @@ typedef bool (*draw_fill_area_fun)(mp_obj_t draw_protocol_self, const _displayio typedef bool (*draw_get_dirty_area_fun)(mp_obj_t draw_protocol_self, displayio_area_t *current_dirty_area); typedef void (*draw_update_transform_fun)(mp_obj_t draw_protocol_self, displayio_buffer_transform_t *group_transform); typedef void (*draw_finish_refresh_fun)(mp_obj_t draw_protocol_self); +typedef void (*draw_set_dirty_fun)(mp_obj_t draw_protocol_self); typedef displayio_area_t *(*draw_get_refresh_areas_fun)(mp_obj_t draw_protocol_self, displayio_area_t *tail); typedef struct _vectorio_draw_protocol_impl_t { @@ -25,6 +26,7 @@ typedef struct _vectorio_draw_protocol_impl_t { draw_update_transform_fun draw_update_transform; draw_finish_refresh_fun draw_finish_refresh; draw_get_refresh_areas_fun draw_get_refresh_areas; + draw_set_dirty_fun draw_set_dirty; } vectorio_draw_protocol_impl_t; // Draw protocol diff --git a/shared-bindings/watchdog/WatchDogTimer.c b/shared-bindings/watchdog/WatchDogTimer.c index 13ab99f50e..e00b288080 100644 --- a/shared-bindings/watchdog/WatchDogTimer.c +++ b/shared-bindings/watchdog/WatchDogTimer.c @@ -107,12 +107,9 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_timeout(mp_obj_t self_in, mp_obj_ } MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_timeout_obj, watchdog_watchdogtimer_obj_set_timeout); -const mp_obj_property_t watchdog_watchdogtimer_timeout_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, - (mp_obj_t)&watchdog_watchdogtimer_set_timeout_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(watchdog_watchdogtimer_timeout_obj, + (mp_obj_t)&watchdog_watchdogtimer_get_timeout_obj, + (mp_obj_t)&watchdog_watchdogtimer_set_timeout_obj); //| mode: WatchDogMode //| """The current operating mode of the WatchDogTimer `watchdog.WatchDogMode`. @@ -158,12 +155,9 @@ STATIC mp_obj_t watchdog_watchdogtimer_obj_set_mode(mp_obj_t self_in, mp_obj_t m } MP_DEFINE_CONST_FUN_OBJ_2(watchdog_watchdogtimer_set_mode_obj, watchdog_watchdogtimer_obj_set_mode); -const mp_obj_property_t watchdog_watchdogtimer_mode_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&watchdog_watchdogtimer_get_mode_obj, - (mp_obj_t)&watchdog_watchdogtimer_set_mode_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(watchdog_watchdogtimer_mode_obj, + (mp_obj_t)&watchdog_watchdogtimer_get_mode_obj, + (mp_obj_t)&watchdog_watchdogtimer_set_mode_obj); STATIC const mp_rom_map_elem_t watchdog_watchdogtimer_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_feed), MP_ROM_PTR(&watchdog_watchdogtimer_feed_obj) }, diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index ced56a781b..a0e357e2ac 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -49,7 +49,33 @@ //| w.timeout=2.5 # Set a timeout of 2.5 seconds //| w.mode = WatchDogMode.RAISE //| w.feed()""" + +//| class WatchDogTimeout(Exception): +//| """Exception raised when the watchdog timer is set to +//| ``WatchDogMode.RAISE`` and expires. //| +//| Example:: +//| +//| import microcontroller +//| import watchdog +//| import time +//| +//| wdt = microcontroller.watchdog +//| wdt.timeout = 5 +//| +//| while True: +//| wdt.mode = watchdog.WatchDogMode.RAISE +//| print("Starting loop -- should exit after five seconds") +//| try: +//| while True: +//| time.sleep(10) # Also works with pass +//| except watchdog.WatchDogTimeout as e: +//| print("Watchdog expired") +//| except Exception as e: +//| print("Other exception") +//| +//| print("Exited loop") +//| """ const mp_obj_type_t mp_type_WatchDogTimeout = { { &mp_type_type }, diff --git a/shared-bindings/wifi/Monitor.c b/shared-bindings/wifi/Monitor.c index 4e5235ea88..235ec534aa 100644 --- a/shared-bindings/wifi/Monitor.c +++ b/shared-bindings/wifi/Monitor.c @@ -55,19 +55,14 @@ STATIC mp_obj_t wifi_monitor_make_new(const mp_obj_type_t *type, size_t n_args, 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); - if (args[ARG_channel].u_int < 1 || args[ARG_channel].u_int > 13) { - mp_raise_ValueError_varg(translate("%q out of bounds"), MP_QSTR_channel); - } - - if (args[ARG_queue].u_int < 0) { - mp_raise_ValueError_varg(translate("%q out of bounds"), MP_QSTR_channel); - } + mp_int_t channel = mp_arg_validate_int_range(args[ARG_channel].u_int, 1, 13, MP_QSTR_channel); + mp_int_t queue = mp_arg_validate_int_min(args[ARG_queue].u_int, 0, MP_QSTR_queue); wifi_monitor_obj_t *self = MP_STATE_VM(wifi_monitor_singleton); if (common_hal_wifi_monitor_deinited()) { self = m_new_obj(wifi_monitor_obj_t); self->base.type = &wifi_monitor_type; - common_hal_wifi_monitor_construct(self, args[ARG_channel].u_int, args[ARG_queue].u_int); + common_hal_wifi_monitor_construct(self, channel, queue); MP_STATE_VM(wifi_monitor_singleton) = self; } @@ -92,12 +87,9 @@ STATIC mp_obj_t wifi_monitor_obj_set_channel(mp_obj_t self_in, mp_obj_t channel) } MP_DEFINE_CONST_FUN_OBJ_2(wifi_monitor_set_channel_obj, wifi_monitor_obj_set_channel); -const mp_obj_property_t wifi_monitor_channel_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_monitor_get_channel_obj, - (mp_obj_t)&wifi_monitor_set_channel_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(wifi_monitor_channel_obj, + (mp_obj_t)&wifi_monitor_get_channel_obj, + (mp_obj_t)&wifi_monitor_set_channel_obj); //| queue: int //| """The queue size for buffering the packet.""" @@ -107,12 +99,8 @@ STATIC mp_obj_t wifi_monitor_obj_get_queue(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_monitor_get_queue_obj, wifi_monitor_obj_get_queue); -const mp_obj_property_t wifi_monitor_queue_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_monitor_get_queue_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_monitor_queue_obj, + (mp_obj_t)&wifi_monitor_get_queue_obj); //| def deinit(self) -> None: //| """De-initialize `wifi.Monitor` singleton.""" diff --git a/shared-bindings/wifi/Network.c b/shared-bindings/wifi/Network.c index 11053e629e..9a457b9499 100644 --- a/shared-bindings/wifi/Network.c +++ b/shared-bindings/wifi/Network.c @@ -50,12 +50,8 @@ STATIC mp_obj_t wifi_network_get_ssid(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_ssid_obj, wifi_network_get_ssid); -const mp_obj_property_t wifi_network_ssid_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_network_get_ssid_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_network_ssid_obj, + (mp_obj_t)&wifi_network_get_ssid_obj); //| bssid: bytes @@ -67,12 +63,8 @@ STATIC mp_obj_t wifi_network_get_bssid(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_bssid_obj, wifi_network_get_bssid); -const mp_obj_property_t wifi_network_bssid_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_network_get_bssid_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_network_bssid_obj, + (mp_obj_t)&wifi_network_get_bssid_obj); //| rssi: int @@ -84,12 +76,8 @@ STATIC mp_obj_t wifi_network_get_rssi(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_rssi_obj, wifi_network_get_rssi); -const mp_obj_property_t wifi_network_rssi_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_network_get_rssi_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_network_rssi_obj, + (mp_obj_t)&wifi_network_get_rssi_obj); //| channel: int @@ -101,12 +89,8 @@ STATIC mp_obj_t wifi_network_get_channel(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_channel_obj, wifi_network_get_channel); -const mp_obj_property_t wifi_network_channel_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_network_get_channel_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_network_channel_obj, + (mp_obj_t)&wifi_network_get_channel_obj); //| country: str //| """String id of the country code""" @@ -117,12 +101,8 @@ STATIC mp_obj_t wifi_network_get_country(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_country_obj, wifi_network_get_country); -const mp_obj_property_t wifi_network_country_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_network_get_country_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_network_country_obj, + (mp_obj_t)&wifi_network_get_country_obj); //| authmode: str //| """String id of the authmode""" @@ -133,12 +113,8 @@ STATIC mp_obj_t wifi_network_get_authmode(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_network_get_authmode_obj, wifi_network_get_authmode); -const mp_obj_property_t wifi_network_authmode_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_network_get_authmode_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_network_authmode_obj, + (mp_obj_t)&wifi_network_get_authmode_obj); STATIC const mp_rom_map_elem_t wifi_network_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_ssid), MP_ROM_PTR(&wifi_network_ssid_obj) }, diff --git a/shared-bindings/wifi/Radio.c b/shared-bindings/wifi/Radio.c index 119ab66c97..bcd998d806 100644 --- a/shared-bindings/wifi/Radio.c +++ b/shared-bindings/wifi/Radio.c @@ -69,12 +69,9 @@ static mp_obj_t wifi_radio_set_enabled(mp_obj_t self, mp_obj_t value) { } STATIC MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_enabled_obj, wifi_radio_set_enabled); -const mp_obj_property_t wifi_radio_enabled_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_enabled_obj, - (mp_obj_t)&wifi_radio_set_enabled_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(wifi_radio_enabled_obj, + (mp_obj_t)&wifi_radio_get_enabled_obj, + (mp_obj_t)&wifi_radio_set_enabled_obj); //| hostname: Union[str | ReadableBuffer] //| """Hostname for wifi interface. When the hostname is altered after interface started/connected @@ -90,9 +87,7 @@ STATIC mp_obj_t wifi_radio_set_hostname(mp_obj_t self_in, mp_obj_t hostname_in) mp_buffer_info_t hostname; mp_get_buffer_raise(hostname_in, &hostname, MP_BUFFER_READ); - if (hostname.len < 1 || hostname.len > 253) { - mp_raise_ValueError(translate("Hostname must be between 1 and 253 characters")); - } + mp_arg_validate_length_range(hostname.len, 1, 253, MP_QSTR_hostname); #ifndef CONFIG_IDF_TARGET_ESP32C3 regex_t regex; // validate hostname according to RFC 1123 @@ -110,12 +105,9 @@ STATIC mp_obj_t wifi_radio_set_hostname(mp_obj_t self_in, mp_obj_t hostname_in) } MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_hostname_obj, wifi_radio_set_hostname); -const mp_obj_property_t wifi_radio_hostname_obj = { - .base.type = &mp_type_property, - .proxy = {(mp_obj_t)&wifi_radio_get_hostname_obj, - (mp_obj_t)&wifi_radio_set_hostname_obj, - MP_ROM_NONE}, -}; +MP_PROPERTY_GETSET(wifi_radio_hostname_obj, + (mp_obj_t)&wifi_radio_get_hostname_obj, + (mp_obj_t)&wifi_radio_set_hostname_obj); //| mac_address: ReadableBuffer //| """MAC address for the station. When the address is altered after interface is connected @@ -142,12 +134,30 @@ STATIC mp_obj_t wifi_radio_set_mac_address(mp_obj_t self_in, mp_obj_t mac_addres } MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_mac_address_obj, wifi_radio_set_mac_address); -const mp_obj_property_t wifi_radio_mac_address_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_mac_address_obj, - (mp_obj_t)&wifi_radio_set_mac_address_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(wifi_radio_mac_address_obj, + (mp_obj_t)&wifi_radio_get_mac_address_obj, + (mp_obj_t)&wifi_radio_set_mac_address_obj); + +//| tx_power: float +//| """Wifi transmission power, in dBm.""" +//| +STATIC mp_obj_t wifi_radio_get_tx_power(mp_obj_t self_in) { + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_float(common_hal_wifi_radio_get_tx_power(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_tx_power_obj, wifi_radio_get_tx_power); + +STATIC mp_obj_t wifi_radio_set_tx_power(mp_obj_t self_in, mp_obj_t tx_power_in) { + mp_float_t tx_power = mp_obj_get_float(tx_power_in); + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_wifi_radio_set_tx_power(self, tx_power); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_tx_power_obj, wifi_radio_set_tx_power); + +MP_PROPERTY_GETSET(wifi_radio_tx_power_obj, + (mp_obj_t)&wifi_radio_get_tx_power_obj, + (mp_obj_t)&wifi_radio_set_tx_power_obj); //| mac_address_ap: ReadableBuffer //| """MAC address for the AP. When the address is altered after interface is started @@ -174,12 +184,9 @@ STATIC mp_obj_t wifi_radio_set_mac_address_ap(mp_obj_t self_in, mp_obj_t mac_add } MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_mac_address_ap_obj, wifi_radio_set_mac_address_ap); -const mp_obj_property_t wifi_radio_mac_address_ap_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_mac_address_ap_obj, - (mp_obj_t)&wifi_radio_set_mac_address_ap_obj, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETSET(wifi_radio_mac_address_ap_obj, + (mp_obj_t)&wifi_radio_get_mac_address_ap_obj, + (mp_obj_t)&wifi_radio_set_mac_address_ap_obj); //| def start_scanning_networks(self, *, start_channel: int = 1, stop_channel: int = 11) -> Iterable[Network]: //| """Scans for available wifi networks over the given channel range. Make sure the channels are allowed in your country.""" @@ -271,6 +278,7 @@ STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_ mp_buffer_info_t ssid; mp_get_buffer_raise(args[ARG_ssid].u_obj, &ssid, MP_BUFFER_READ); + mp_arg_validate_length_range(ssid.len, 1, 32, MP_QSTR_ssid); mp_buffer_info_t password; password.len = 0; @@ -281,9 +289,7 @@ STATIC mp_obj_t wifi_radio_start_ap(size_t n_args, const mp_obj_t *pos_args, mp_ authmode = (1 << AUTHMODE_WPA) | (1 << AUTHMODE_WPA2) | (1 << AUTHMODE_PSK); } mp_get_buffer_raise(args[ARG_password].u_obj, &password, MP_BUFFER_READ); - if (password.len > 0 && (password.len < 8 || password.len > 63)) { - mp_raise_ValueError(translate("WiFi password must be between 8 and 63 characters")); - } + mp_arg_validate_length_range(password.len, 8, 63, MP_QSTR_password); } else { authmode = 1; } @@ -346,17 +352,13 @@ STATIC mp_obj_t wifi_radio_connect(size_t n_args, const mp_obj_t *pos_args, mp_m mp_buffer_info_t ssid; ssid.len = 0; mp_get_buffer_raise(args[ARG_ssid].u_obj, &ssid, MP_BUFFER_READ); - if (ssid.len > 32) { - mp_raise_ValueError(translate("ssid can't be more than 32 bytes")); - } + mp_arg_validate_length_range(ssid.len, 1, 32, MP_QSTR_ssid); mp_buffer_info_t password; password.len = 0; if (args[ARG_password].u_obj != MP_OBJ_NULL) { mp_get_buffer_raise(args[ARG_password].u_obj, &password, MP_BUFFER_READ); - if (password.len > 0 && (password.len < 8 || password.len > 63)) { - mp_raise_ValueError(translate("WiFi password must be between 8 and 63 characters")); - } + mp_arg_validate_length_range(password.len, 8, 63, MP_QSTR_password); } #define MAC_ADDRESS_LENGTH 6 @@ -393,12 +395,8 @@ STATIC mp_obj_t wifi_radio_get_ipv4_gateway(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_gateway_obj, wifi_radio_get_ipv4_gateway); -const mp_obj_property_t wifi_radio_ipv4_gateway_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_gateway_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_radio_ipv4_gateway_obj, + (mp_obj_t)&wifi_radio_get_ipv4_gateway_obj); //| ipv4_gateway_ap: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the access point gateway, when enabled. None otherwise.""" @@ -409,12 +407,8 @@ STATIC mp_obj_t wifi_radio_get_ipv4_gateway_ap(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_gateway_ap_obj, wifi_radio_get_ipv4_gateway_ap); -const mp_obj_property_t wifi_radio_ipv4_gateway_ap_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_gateway_ap_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_radio_ipv4_gateway_ap_obj, + (mp_obj_t)&wifi_radio_get_ipv4_gateway_ap_obj); //| ipv4_subnet: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the station subnet when connected to an access point. None otherwise.""" @@ -425,12 +419,8 @@ STATIC mp_obj_t wifi_radio_get_ipv4_subnet(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_subnet_obj, wifi_radio_get_ipv4_subnet); -const mp_obj_property_t wifi_radio_ipv4_subnet_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_subnet_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_radio_ipv4_subnet_obj, + (mp_obj_t)&wifi_radio_get_ipv4_subnet_obj); //| ipv4_subnet_ap: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the access point subnet, when enabled. None otherwise.""" @@ -441,28 +431,42 @@ STATIC mp_obj_t wifi_radio_get_ipv4_subnet_ap(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_subnet_ap_obj, wifi_radio_get_ipv4_subnet_ap); -const mp_obj_property_t wifi_radio_ipv4_subnet_ap_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_subnet_ap_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_radio_ipv4_subnet_ap_obj, + (mp_obj_t)&wifi_radio_get_ipv4_subnet_ap_obj); + +//| def set_ipv4_address(self, *, ipv4: ipaddress.IPv4Address, netmask: ipaddress.IPv4Address, gateway: ipaddress.IPv4Address, ipv4_dns: Optional[ipaddress.IPv4Address]) -> None: +//| """Sets the IP v4 address of the station. Must include the netmask and gateway. DNS address is optional. +//| Setting the address manually will stop the DHCP client.""" +//| ... +STATIC mp_obj_t wifi_radio_set_ipv4_address(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_ipv4, ARG_netmask, ARG_gateway, ARG_ipv4_dns }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_ipv4, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, }, + { MP_QSTR_netmask, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, }, + { MP_QSTR_gateway, MP_ARG_REQUIRED | MP_ARG_KW_ONLY | MP_ARG_OBJ, }, + { MP_QSTR_ipv4_dns, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = MP_OBJ_NULL} }, + }; + + wifi_radio_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; + mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); + + common_hal_wifi_radio_set_ipv4_address(self, args[ARG_ipv4].u_obj, args[ARG_netmask].u_obj, args[ARG_gateway].u_obj, args[ARG_ipv4_dns].u_obj); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(wifi_radio_set_ipv4_address_obj, 1, wifi_radio_set_ipv4_address); //| ipv4_address: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the station when connected to an access point. None otherwise.""" //| -STATIC mp_obj_t wifi_radio_get_ipv4_address(mp_obj_t self) { +STATIC mp_obj_t _wifi_radio_get_ipv4_address(mp_obj_t self) { return common_hal_wifi_radio_get_ipv4_address(self); } -MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_address_obj, wifi_radio_get_ipv4_address); +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_address_obj, _wifi_radio_get_ipv4_address); -const mp_obj_property_t wifi_radio_ipv4_address_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_address_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_radio_ipv4_address_obj, + (mp_obj_t)&wifi_radio_get_ipv4_address_obj); //| ipv4_address_ap: Optional[ipaddress.IPv4Address] //| """IP v4 Address of the access point, when enabled. None otherwise.""" @@ -473,15 +477,11 @@ STATIC mp_obj_t wifi_radio_get_ipv4_address_ap(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_address_ap_obj, wifi_radio_get_ipv4_address_ap); -const mp_obj_property_t wifi_radio_ipv4_address_ap_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_address_ap_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +MP_PROPERTY_GETTER(wifi_radio_ipv4_address_ap_obj, + (mp_obj_t)&wifi_radio_get_ipv4_address_ap_obj); -//| ipv4_dns: Optional[ipaddress.IPv4Address] -//| """IP v4 Address of the DNS server in use when connected to an access point. None otherwise.""" +//| ipv4_dns: ipaddress.IPv4Address +//| """IP v4 Address of the DNS server to be used.""" //| STATIC mp_obj_t wifi_radio_get_ipv4_dns(mp_obj_t self) { return common_hal_wifi_radio_get_ipv4_dns(self); @@ -489,12 +489,16 @@ STATIC mp_obj_t wifi_radio_get_ipv4_dns(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ipv4_dns_obj, wifi_radio_get_ipv4_dns); -const mp_obj_property_t wifi_radio_ipv4_dns_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ipv4_dns_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +STATIC mp_obj_t wifi_radio_set_ipv4_dns(mp_obj_t self, mp_obj_t ipv4_dns_addr) { + common_hal_wifi_radio_set_ipv4_dns(self, ipv4_dns_addr); + + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(wifi_radio_set_ipv4_dns_obj, wifi_radio_set_ipv4_dns); + +MP_PROPERTY_GETSET(wifi_radio_ipv4_dns_obj, + (mp_obj_t)&wifi_radio_get_ipv4_dns_obj, + (mp_obj_t)&wifi_radio_set_ipv4_dns_obj); //| ap_info: Optional[Network] //| """Network object containing BSSID, SSID, authmode, channel, country and RSSI when connected to an access point. None otherwise.""" @@ -505,12 +509,28 @@ STATIC mp_obj_t wifi_radio_get_ap_info(mp_obj_t self) { } MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_get_ap_info_obj, wifi_radio_get_ap_info); -const mp_obj_property_t wifi_radio_ap_info_obj = { - .base.type = &mp_type_property, - .proxy = { (mp_obj_t)&wifi_radio_get_ap_info_obj, - MP_ROM_NONE, - MP_ROM_NONE }, -}; +//| def start_dhcp(self) -> None: +//| """Starts the DHCP client.""" +//| ... +//| +STATIC mp_obj_t wifi_radio_start_dhcp_client(mp_obj_t self) { + common_hal_wifi_radio_start_dhcp_client(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_start_dhcp_client_obj, wifi_radio_start_dhcp_client); + +//| def stop_dhcp(self) -> None: +//| """Stops the DHCP client. Needed to assign a static IP address.""" +//| ... +//| +STATIC mp_obj_t wifi_radio_stop_dhcp_client(mp_obj_t self) { + common_hal_wifi_radio_stop_dhcp_client(self); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_1(wifi_radio_stop_dhcp_client_obj, wifi_radio_stop_dhcp_client); + +MP_PROPERTY_GETTER(wifi_radio_ap_info_obj, + (mp_obj_t)&wifi_radio_get_ap_info_obj); //| def ping(self, ip: ipaddress.IPv4Address, *, timeout: Optional[float] = 0.5) -> Optional[float]: //| """Ping an IP to test connectivity. Returns echo time in seconds. @@ -550,6 +570,7 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_mac_address), MP_ROM_PTR(&wifi_radio_mac_address_obj) }, { MP_ROM_QSTR(MP_QSTR_mac_address_ap), MP_ROM_PTR(&wifi_radio_mac_address_ap_obj) }, + { MP_ROM_QSTR(MP_QSTR_tx_power), MP_ROM_PTR(&wifi_radio_tx_power_obj) }, { MP_ROM_QSTR(MP_QSTR_start_scanning_networks), MP_ROM_PTR(&wifi_radio_start_scanning_networks_obj) }, { MP_ROM_QSTR(MP_QSTR_stop_scanning_networks), MP_ROM_PTR(&wifi_radio_stop_scanning_networks_obj) }, @@ -559,6 +580,9 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_start_ap), MP_ROM_PTR(&wifi_radio_start_ap_obj) }, { MP_ROM_QSTR(MP_QSTR_stop_ap), MP_ROM_PTR(&wifi_radio_stop_ap_obj) }, + { MP_ROM_QSTR(MP_QSTR_start_dhcp), MP_ROM_PTR(&wifi_radio_start_dhcp_client_obj) }, + { MP_ROM_QSTR(MP_QSTR_stop_dhcp), MP_ROM_PTR(&wifi_radio_stop_dhcp_client_obj) }, + { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&wifi_radio_connect_obj) }, // { MP_ROM_QSTR(MP_QSTR_connect_to_enterprise), MP_ROM_PTR(&wifi_radio_connect_to_enterprise_obj) }, @@ -571,6 +595,8 @@ STATIC const mp_rom_map_elem_t wifi_radio_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_ipv4_address), MP_ROM_PTR(&wifi_radio_ipv4_address_obj) }, { MP_ROM_QSTR(MP_QSTR_ipv4_address_ap), MP_ROM_PTR(&wifi_radio_ipv4_address_ap_obj) }, + { MP_ROM_QSTR(MP_QSTR_set_ipv4_address), MP_ROM_PTR(&wifi_radio_set_ipv4_address_obj) }, + // { MP_ROM_QSTR(MP_QSTR_access_point_active), MP_ROM_PTR(&wifi_radio_access_point_active_obj) }, // { MP_ROM_QSTR(MP_QSTR_start_access_point), MP_ROM_PTR(&wifi_radio_start_access_point_obj) }, diff --git a/shared-bindings/wifi/Radio.h b/shared-bindings/wifi/Radio.h index cee9f6ef15..312e9e5395 100644 --- a/shared-bindings/wifi/Radio.h +++ b/shared-bindings/wifi/Radio.h @@ -82,6 +82,9 @@ extern void common_hal_wifi_radio_set_mac_address(wifi_radio_obj_t *self, const extern mp_obj_t common_hal_wifi_radio_get_mac_address_ap(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_set_mac_address_ap(wifi_radio_obj_t *self, const uint8_t *mac); +extern mp_float_t common_hal_wifi_radio_get_tx_power(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_set_tx_power(wifi_radio_obj_t *self, const mp_float_t power); + extern mp_obj_t common_hal_wifi_radio_start_scanning_networks(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_stop_scanning_networks(wifi_radio_obj_t *self); @@ -91,17 +94,24 @@ extern void common_hal_wifi_radio_stop_station(wifi_radio_obj_t *self); extern void common_hal_wifi_radio_start_ap(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, uint8_t authmode, uint8_t max_connections); extern void common_hal_wifi_radio_stop_ap(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_start_dhcp_client(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_stop_dhcp_client(wifi_radio_obj_t *self); + extern wifi_radio_error_t common_hal_wifi_radio_connect(wifi_radio_obj_t *self, uint8_t *ssid, size_t ssid_len, uint8_t *password, size_t password_len, uint8_t channel, mp_float_t timeout, uint8_t *bssid, size_t bssid_len); extern mp_obj_t common_hal_wifi_radio_get_ap_info(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_dns(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_set_ipv4_dns(wifi_radio_obj_t *self, mp_obj_t ipv4_dns_addr); extern mp_obj_t common_hal_wifi_radio_get_ipv4_gateway(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_gateway_ap(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_subnet_ap(wifi_radio_obj_t *self); +uint32_t wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_address(wifi_radio_obj_t *self); extern mp_obj_t common_hal_wifi_radio_get_ipv4_address_ap(wifi_radio_obj_t *self); +extern void common_hal_wifi_radio_set_ipv4_address(wifi_radio_obj_t *self, mp_obj_t ipv4, mp_obj_t netmask, mp_obj_t gateway, mp_obj_t ipv4_dns_addr); + extern mp_int_t common_hal_wifi_radio_ping(wifi_radio_obj_t *self, mp_obj_t ip_address, mp_float_t timeout); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_WIFI_RADIO_H diff --git a/shared-bindings/wifi/__init__.c b/shared-bindings/wifi/__init__.c index 0f9dee8462..f5bfd3a362 100644 --- a/shared-bindings/wifi/__init__.c +++ b/shared-bindings/wifi/__init__.c @@ -42,7 +42,7 @@ // Called when wifi is imported. STATIC mp_obj_t wifi___init__(void) { - common_hal_wifi_init(); + common_hal_wifi_init(true); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_0(wifi___init___obj, wifi___init__); diff --git a/shared-bindings/wifi/__init__.h b/shared-bindings/wifi/__init__.h index e626727e77..9553e92ce1 100644 --- a/shared-bindings/wifi/__init__.h +++ b/shared-bindings/wifi/__init__.h @@ -31,7 +31,9 @@ extern wifi_radio_obj_t common_hal_wifi_radio_obj; -void common_hal_wifi_init(void); +void common_hal_wifi_init(bool user_initiated); void common_hal_wifi_gc_collect(void); +void wifi_user_reset(void); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_WIFI___INIT___H diff --git a/shared-bindings/zlib/__init__.c b/shared-bindings/zlib/__init__.c new file mode 100644 index 0000000000..e3858d008d --- /dev/null +++ b/shared-bindings/zlib/__init__.c @@ -0,0 +1,95 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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 + +#include "py/obj.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "py/mperrno.h" +#include "py/builtin.h" +#include "py/objtuple.h" +#include "py/binary.h" +#include "py/parsenum.h" + +#include "shared-bindings/zlib/__init__.h" + +#include "supervisor/shared/translate/translate.h" + +//| """zlib decompression functionality +//| +//| The `zlib` module allows limited functionality similar to the CPython zlib library. +//| This module allows to decompress binary data compressed with DEFLATE algorithm +//| (commonly used in zlib library and gzip archiver). Compression is not yet implemented.""" +//| + +//| def zlib_decompress(data: bytes, wbits: Optional[int] = 0, bufsize: Optional[int] = 0) -> bytes: +//| """Return decompressed *data* as bytes. *wbits* is DEFLATE dictionary window +//| size used during compression (8-15, the dictionary size is power of 2 of +//| that value). Additionally, if value is positive, *data* is assumed to be +//| zlib stream (with zlib header). Otherwise, if it's negative, it's assumed +//| to be raw DEFLATE stream. +//| +//| The wbits parameter controls the size of the history buffer (or “window size”), and what header +//| and trailer format is expected. +//| +//| Common wbits values: +//| +//| * To decompress deflate format, use wbits = -15 +//| * To decompress zlib format, use wbits = 15 +//| * To decompress gzip format, use wbits = 31 +//| +//| :param bytes data: data to be decompressed +//| :param int wbits: DEFLATE dictionary window size used during compression. See above. +//| :param int bufsize: ignored for compatibility with CPython only +//| """ +//| ... +//| +STATIC mp_obj_t zlib_decompress(size_t n_args, const mp_obj_t *args) { + bool is_zlib = true; + if (n_args > 1 && MP_OBJ_SMALL_INT_VALUE(args[1]) < 0) { + is_zlib = false; + } + + return common_hal_zlib_decompress(args[0], is_zlib); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(zlib_decompress_obj, 1, 3, zlib_decompress); + +STATIC const mp_rom_map_elem_t zlib_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_zlib) }, + { MP_ROM_QSTR(MP_QSTR_decompress), MP_ROM_PTR(&zlib_decompress_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(zlib_globals, zlib_globals_table); + +const mp_obj_module_t zlib_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&zlib_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_zlib, zlib_module, CIRCUITPY_ZLIB); diff --git a/shared-module/gamepadshift/__init__.h b/shared-bindings/zlib/__init__.h similarity index 81% rename from shared-module/gamepadshift/__init__.h rename to shared-bindings/zlib/__init__.h index 225db73361..232d08e294 100644 --- a/shared-module/gamepadshift/__init__.h +++ b/shared-bindings/zlib/__init__.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2022 Mark Komus * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,10 +24,9 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_GAMEPADSHIFT___INIT___H -#define MICROPY_INCLUDED_GAMEPADSHIFT___INIT___H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB___INIT___H -void gamepadshift_tick(void); -void gamepadshift_reset(void); +mp_obj_t common_hal_zlib_decompress(mp_obj_t data, bool is_zlib); -#endif // MICROPY_INCLUDED_GAMEPADSHIFT___INIT___H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_ZLIB___INIT___H diff --git a/shared-module/_bleio/Attribute.c b/shared-module/_bleio/Attribute.c index 3acfcf1f53..9c75a69fd1 100644 --- a/shared-module/_bleio/Attribute.c +++ b/shared-module/_bleio/Attribute.c @@ -40,7 +40,7 @@ void common_hal_bleio_attribute_security_mode_check_valid(bleio_attribute_securi case SECURITY_MODE_SIGNED_WITH_MITM: break; default: - mp_raise_ValueError(translate("Invalid security_mode")); + mp_arg_error_invalid(MP_QSTR_security_mode); break; } } diff --git a/shared-module/adafruit_pixelbuf/PixelBuf.c b/shared-module/adafruit_pixelbuf/PixelBuf.c index 99980c705e..cab97feace 100644 --- a/shared-module/adafruit_pixelbuf/PixelBuf.c +++ b/shared-module/adafruit_pixelbuf/PixelBuf.c @@ -171,9 +171,7 @@ STATIC void _pixelbuf_parse_color(pixelbuf_pixelbuf_obj_t *self, mp_obj_t color, mp_obj_t *items; size_t len; mp_obj_get_array(color, &len, &items); - if (len < 3 || len > 4) { - mp_raise_ValueError_varg(translate("Expected tuple of length %d, got %d"), byteorder->bpp, len); - } + mp_arg_validate_length_range(len, 3, 4, MP_QSTR_color); *r = _pixelbuf_get_as_uint8(items[PIXEL_R]); *g = _pixelbuf_get_as_uint8(items[PIXEL_G]); diff --git a/shared-module/audiocore/WaveFile.c b/shared-module/audiocore/WaveFile.c index 0cceb979a6..1b87532551 100644 --- a/shared-module/audiocore/WaveFile.c +++ b/shared-module/audiocore/WaveFile.c @@ -33,7 +33,7 @@ #include "py/runtime.h" #include "shared-module/audiocore/WaveFile.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" struct wave_format_chunk { uint16_t audio_format; @@ -60,7 +60,7 @@ void common_hal_audioio_wavefile_construct(audioio_wavefile_obj_t *self, if (bytes_read != 16 || memcmp(chunk_header, "RIFF", 4) != 0 || memcmp(chunk_header + 8, "WAVEfmt ", 8) != 0) { - mp_raise_ValueError(translate("Invalid wave file")); + mp_arg_error_invalid(MP_QSTR_file); } uint32_t format_size; if (f_read(&self->file->fp, &format_size, 4, &bytes_read) != FR_OK) { @@ -105,7 +105,7 @@ void common_hal_audioio_wavefile_construct(audioio_wavefile_obj_t *self, mp_raise_OSError(MP_EIO); } if (bytes_read != 4) { - mp_raise_ValueError(translate("Invalid file")); + mp_arg_error_invalid(MP_QSTR_file); } self->file_length = data_length; self->data_start = self->file->fp.fptr; @@ -121,15 +121,13 @@ void common_hal_audioio_wavefile_construct(audioio_wavefile_obj_t *self, self->buffer = m_malloc(self->len, false); if (self->buffer == NULL) { common_hal_audioio_wavefile_deinit(self); - mp_raise_msg(&mp_type_MemoryError, - translate("Couldn't allocate first buffer")); + m_malloc_fail(self->len); } self->second_buffer = m_malloc(self->len, false); if (self->second_buffer == NULL) { common_hal_audioio_wavefile_deinit(self); - mp_raise_msg(&mp_type_MemoryError, - translate("Couldn't allocate second buffer")); + m_malloc_fail(self->len); } } } diff --git a/shared-module/audiomixer/Mixer.c b/shared-module/audiomixer/Mixer.c index d6569c66f0..1c5de4d934 100644 --- a/shared-module/audiomixer/Mixer.c +++ b/shared-module/audiomixer/Mixer.c @@ -47,13 +47,13 @@ void common_hal_audiomixer_mixer_construct(audiomixer_mixer_obj_t *self, self->first_buffer = m_malloc(self->len, false); if (self->first_buffer == NULL) { common_hal_audiomixer_mixer_deinit(self); - mp_raise_msg(&mp_type_MemoryError, translate("Couldn't allocate first buffer")); + m_malloc_fail(self->len); } self->second_buffer = m_malloc(self->len, false); if (self->second_buffer == NULL) { common_hal_audiomixer_mixer_deinit(self); - mp_raise_msg(&mp_type_MemoryError, translate("Couldn't allocate second buffer")); + m_malloc_fail(self->len); } self->bits_per_sample = bits_per_sample; diff --git a/shared-module/audiomp3/MP3Decoder.c b/shared-module/audiomp3/MP3Decoder.c index 2d45313814..506ed5eff2 100644 --- a/shared-module/audiomp3/MP3Decoder.c +++ b/shared-module/audiomp3/MP3Decoder.c @@ -35,7 +35,7 @@ #include "py/runtime.h" #include "shared-module/audiomp3/MP3Decoder.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/background_callback.h" #include "lib/mp3/src/mp3common.h" @@ -53,7 +53,7 @@ */ STATIC bool mp3file_update_inbuf_always(audiomp3_mp3file_obj_t *self) { // If we didn't previously reach the end of file, we can try reading now - if (!self->eof) { + if (!self->eof && self->inbuf_offset != 0) { // Move the unconsumed portion of the buffer to the start uint8_t *end_of_buffer = self->inbuf + self->inbuf_length; @@ -193,8 +193,7 @@ void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t *self, self->inbuf = m_malloc(self->inbuf_length, false); if (self->inbuf == NULL) { common_hal_audiomp3_mp3file_deinit(self); - mp_raise_msg(&mp_type_MemoryError, - translate("Couldn't allocate input buffer")); + m_malloc_fail(self->inbuf_length); } self->decoder = MP3InitDecoder(); if (self->decoder == NULL) { @@ -214,15 +213,13 @@ void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t *self, self->buffers[0] = m_malloc(MAX_BUFFER_LEN, false); if (self->buffers[0] == NULL) { common_hal_audiomp3_mp3file_deinit(self); - mp_raise_msg(&mp_type_MemoryError, - translate("Couldn't allocate first buffer")); + m_malloc_fail(MAX_BUFFER_LEN); } self->buffers[1] = m_malloc(MAX_BUFFER_LEN, false); if (self->buffers[1] == NULL) { common_hal_audiomp3_mp3file_deinit(self); - mp_raise_msg(&mp_type_MemoryError, - translate("Couldn't allocate second buffer")); + m_malloc_fail(MAX_BUFFER_LEN); } } @@ -356,6 +353,11 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t * return GET_BUFFER_DONE; } + self->samples_decoded += *buffer_length / sizeof(int16_t); + + mp3file_skip_id3v2(self); + int result = mp3file_find_sync_word(self) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE; + if (self->inbuf_offset >= 512) { background_callback_add( &self->inbuf_fill_cb, @@ -363,8 +365,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t * self); } - self->samples_decoded += *buffer_length / sizeof(int16_t); - return GET_BUFFER_MORE_DATA; + return result; } void audiomp3_mp3file_get_buffer_structure(audiomp3_mp3file_obj_t *self, bool single_channel_output, diff --git a/shared-module/bitbangio/I2C.c b/shared-module/bitbangio/I2C.c index eb897e122f..65926b8c07 100644 --- a/shared-module/bitbangio/I2C.c +++ b/shared-module/bitbangio/I2C.c @@ -32,7 +32,7 @@ #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" STATIC void delay(bitbangio_i2c_obj_t *self) { // We need to use an accurate delay to get acceptable I2C diff --git a/shared-module/bitbangio/SPI.c b/shared-module/bitbangio/SPI.c index 65511964a6..d740a214e7 100644 --- a/shared-module/bitbangio/SPI.c +++ b/shared-module/bitbangio/SPI.c @@ -32,7 +32,7 @@ #include "shared-bindings/bitbangio/SPI.h" #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #define MAX_BAUDRATE (common_hal_mcu_get_clock_frequency() / 48) @@ -41,7 +41,7 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self, const mcu_pin_obj_t *miso) { digitalinout_result_t result = common_hal_digitalio_digitalinout_construct(&self->clock, clock); if (result != DIGITALINOUT_OK) { - mp_raise_ValueError(translate("Clock pin init failed.")); + mp_raise_ValueError_varg(translate("%q init failed"), MP_QSTR_clock); } common_hal_digitalio_digitalinout_switch_to_output(&self->clock, self->polarity == 1, DRIVE_MODE_PUSH_PULL); @@ -49,7 +49,7 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self, result = common_hal_digitalio_digitalinout_construct(&self->mosi, mosi); if (result != DIGITALINOUT_OK) { common_hal_digitalio_digitalinout_deinit(&self->clock); - mp_raise_ValueError(translate("MOSI pin init failed.")); + mp_raise_ValueError_varg(translate("%q init failed"), MP_QSTR_mosi); } self->has_mosi = true; common_hal_digitalio_digitalinout_switch_to_output(&self->mosi, false, DRIVE_MODE_PUSH_PULL); @@ -63,7 +63,7 @@ void shared_module_bitbangio_spi_construct(bitbangio_spi_obj_t *self, if (mosi != NULL) { common_hal_digitalio_digitalinout_deinit(&self->mosi); } - mp_raise_ValueError(translate("MISO pin init failed.")); + mp_raise_ValueError_varg(translate("%q init failed"), MP_QSTR_miso); } self->has_miso = true; } @@ -123,7 +123,7 @@ void shared_module_bitbangio_spi_unlock(bitbangio_spi_obj_t *self) { // Writes out the given data. bool shared_module_bitbangio_spi_write(bitbangio_spi_obj_t *self, const uint8_t *data, size_t len) { if (len > 0 && !self->has_mosi) { - mp_raise_ValueError(translate("Cannot write without MOSI pin.")); + mp_raise_ValueError(translate("No MOSI pin")); } uint32_t delay_half = self->delay_half; @@ -178,7 +178,7 @@ bool shared_module_bitbangio_spi_write(bitbangio_spi_obj_t *self, const uint8_t // Reads in len bytes while outputting zeroes. bool shared_module_bitbangio_spi_read(bitbangio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_data) { if (len > 0 && !self->has_miso) { - mp_raise_ValueError(translate("Cannot read without MISO pin.")); + mp_raise_ValueError(translate("No MISO pin")); } uint32_t delay_half = self->delay_half; @@ -246,7 +246,7 @@ bool shared_module_bitbangio_spi_read(bitbangio_spi_obj_t *self, uint8_t *data, // transfer bool shared_module_bitbangio_spi_transfer(bitbangio_spi_obj_t *self, const uint8_t *dout, uint8_t *din, size_t len) { if (len > 0 && (!self->has_mosi || !self->has_miso)) { - mp_raise_ValueError(translate("Cannot transfer without MOSI and MISO pins.")); + mp_raise_ValueError(translate("Cannot transfer without MOSI and MISO pins")); } uint32_t delay_half = self->delay_half; diff --git a/shared-module/board/__init__.c b/shared-module/board/__init__.c index 7bd0d42339..5d08c368b5 100644 --- a/shared-module/board/__init__.c +++ b/shared-module/board/__init__.c @@ -27,7 +27,7 @@ #include "shared-bindings/board/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-module/board/__init__.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "mpconfigboard.h" #include "py/runtime.h" diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c index 933d3a8227..676aec2186 100644 --- a/shared-module/displayio/Bitmap.c +++ b/shared-module/displayio/Bitmap.c @@ -30,20 +30,29 @@ #include "py/runtime.h" -void common_hal_displayio_bitmap_construct(displayio_bitmap_t *self, uint32_t width, - uint32_t height, uint32_t bits_per_value) { +enum { align_bits = 8 * sizeof(uint32_t) }; + +static int stride(uint32_t width, uint32_t bits_per_value) { uint32_t row_width = width * bits_per_value; // align to uint32_t - uint8_t align_bits = 8 * sizeof(uint32_t); - if (row_width % align_bits != 0) { - self->stride = (row_width / align_bits + 1); - } else { - self->stride = row_width / align_bits; - } + return (row_width + align_bits - 1) / align_bits; +} + +void common_hal_displayio_bitmap_construct(displayio_bitmap_t *self, uint32_t width, + uint32_t height, uint32_t bits_per_value) { + common_hal_displayio_bitmap_construct_from_buffer(self, width, height, bits_per_value, NULL, false); +} + +void common_hal_displayio_bitmap_construct_from_buffer(displayio_bitmap_t *self, uint32_t width, + uint32_t height, uint32_t bits_per_value, uint32_t *data, bool read_only) { self->width = width; self->height = height; - self->data = m_malloc(self->stride * height * sizeof(uint32_t), false); - self->read_only = false; + self->stride = stride(width, bits_per_value); + if (!data) { + data = m_malloc(self->stride * height * sizeof(uint32_t), false); + } + self->data = data; + self->read_only = read_only; self->bits_per_value = bits_per_value; if (bits_per_value > 8 && bits_per_value != 16 && bits_per_value != 32) { @@ -70,6 +79,7 @@ void common_hal_displayio_bitmap_construct(displayio_bitmap_t *self, uint32_t wi self->dirty_area.y2 = height; } + uint16_t common_hal_displayio_bitmap_get_height(displayio_bitmap_t *self) { return self->height; } diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 579dca49fc..9fd55fe19d 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -51,9 +51,9 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, uint8_t bytes_per_cell, bool reverse_pixels_in_byte, bool reverse_bytes_in_word, uint8_t set_column_command, uint8_t set_row_command, uint8_t write_ram_command, uint8_t *init_sequence, uint16_t init_sequence_len, const mcu_pin_obj_t *backlight_pin, - uint16_t brightness_command, mp_float_t brightness, bool auto_brightness, + uint16_t brightness_command, mp_float_t brightness, bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, - bool backlight_on_high, bool SH1107_addressing) { + bool backlight_on_high, bool SH1107_addressing, uint16_t backlight_pwm_frequency) { // Turn off auto-refresh as we init. self->auto_refresh = false; @@ -70,11 +70,10 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, self->set_row_command = set_row_command; self->write_ram_command = write_ram_command; self->brightness_command = brightness_command; - self->auto_brightness = auto_brightness; self->first_manual_refresh = !auto_refresh; self->data_as_commands = data_as_commands; self->backlight_on_high = backlight_on_high; - self->SH1107_addressing = SH1107_addressing; + self->SH1107_addressing = SH1107_addressing && color_depth == 1; self->native_frames_per_second = native_frames_per_second; self->native_ms_per_frame = 1000 / native_frames_per_second; @@ -116,7 +115,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, if (backlight_pin != NULL && common_hal_mcu_pin_is_free(backlight_pin)) { // Avoid PWM types and functions when the module isn't enabled #if (CIRCUITPY_PWMIO) - pwmout_result_t result = common_hal_pwmio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, 50000, false); + pwmout_result_t result = common_hal_pwmio_pwmout_construct(&self->backlight_pwm, backlight_pin, 0, backlight_pwm_frequency, false); if (result != PWMOUT_OK) { self->backlight_inout.base.type = &digitalio_digitalinout_type; common_hal_digitalio_digitalinout_construct(&self->backlight_inout, backlight_pin); @@ -132,12 +131,8 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, common_hal_never_reset_pin(backlight_pin); #endif } - if (!self->auto_brightness && (self->backlight_inout.base.type != &mp_type_NoneType || - brightness_command != NO_BRIGHTNESS_COMMAND)) { - common_hal_displayio_display_set_brightness(self, brightness); - } else { - self->current_brightness = -1.0; - } + + common_hal_displayio_display_set_brightness(self, brightness); // Set the group after initialization otherwise we may send pixels while we delay in // initialization. @@ -157,20 +152,11 @@ uint16_t common_hal_displayio_display_get_height(displayio_display_obj_t *self) return displayio_display_core_get_height(&self->core); } -bool common_hal_displayio_display_get_auto_brightness(displayio_display_obj_t *self) { - return self->auto_brightness; -} - -void common_hal_displayio_display_set_auto_brightness(displayio_display_obj_t *self, bool auto_brightness) { - self->auto_brightness = auto_brightness; -} - mp_float_t common_hal_displayio_display_get_brightness(displayio_display_obj_t *self) { return self->current_brightness; } bool common_hal_displayio_display_set_brightness(displayio_display_obj_t *self, mp_float_t brightness) { - self->updating_backlight = true; if (!self->backlight_on_high) { brightness = 1.0 - brightness; } @@ -209,7 +195,6 @@ bool common_hal_displayio_display_set_brightness(displayio_display_obj_t *self, } } - self->updating_backlight = false; if (ok) { self->current_brightness = brightness; } @@ -413,23 +398,7 @@ void common_hal_displayio_display_set_auto_refresh(displayio_display_obj_t *self self->auto_refresh = auto_refresh; } -STATIC void _update_backlight(displayio_display_obj_t *self) { - if (!self->auto_brightness || self->updating_backlight) { - return; - } - if (supervisor_ticks_ms64() - self->last_backlight_refresh < 100) { - return; - } - // TODO(tannewt): Fade the backlight based on its existing value and a target value. The target - // should account for ambient light when possible. - common_hal_displayio_display_set_brightness(self, 1.0); - - self->last_backlight_refresh = supervisor_ticks_ms64(); -} - void displayio_display_background(displayio_display_obj_t *self) { - _update_backlight(self); - if (self->auto_refresh && (supervisor_ticks_ms64() - self->core.last_refresh) > self->native_ms_per_frame) { _refresh_display(self); } @@ -452,7 +421,6 @@ void release_display(displayio_display_obj_t *self) { void reset_display(displayio_display_obj_t *self) { common_hal_displayio_display_set_auto_refresh(self, true); - self->auto_brightness = true; common_hal_displayio_display_show(self, NULL); } diff --git a/shared-module/displayio/Display.h b/shared-module/displayio/Display.h index a0049f00c0..f513a9d462 100644 --- a/shared-module/displayio/Display.h +++ b/shared-module/displayio/Display.h @@ -45,7 +45,6 @@ typedef struct { pwmio_pwmout_obj_t backlight_pwm; #endif }; - uint64_t last_backlight_refresh; uint64_t last_refresh_call; mp_float_t current_brightness; uint16_t brightness_command; @@ -57,8 +56,6 @@ typedef struct { bool auto_refresh; bool first_manual_refresh; bool data_as_commands; - bool auto_brightness; - bool updating_backlight; bool backlight_on_high; // new quirk for sh1107 bool SH1107_addressing; diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index b1e998048e..0010d88d12 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -275,7 +275,7 @@ STATIC bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t * uint32_t mask[mask_length]; uint8_t passes = 1; - if (self->core.colorspace.tricolor || self->grayscale) { + if (self->write_color_ram_command != NO_COMMAND) { passes = 2; } for (uint8_t pass = 0; pass < passes; pass++) { @@ -318,11 +318,14 @@ STATIC bool displayio_epaperdisplay_refresh_area(displayio_epaperdisplay_obj_t * if (pass == 1) { if (self->grayscale) { // 4-color grayscale self->core.colorspace.grayscale_bit = 6; - } else { // Tri-color + displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer); + } else if (self->core.colorspace.tricolor) { self->core.colorspace.grayscale = false; + displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer); } + } else { + displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer); } - displayio_display_core_fill_area(&self->core, &subrectangle, mask, buffer); // Invert it all. if ((pass == 1 && self->color_bits_inverted) || diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index b9179f0a00..ad45852379 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -66,6 +66,14 @@ void common_hal_displayio_group_set_hidden(displayio_group_t *self, bool hidden) displayio_group_set_hidden_by_parent(layer, hidden); continue; } + #if CIRCUITPY_VECTORIO + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); + if (draw_protocol != NULL) { + layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); + draw_protocol->draw_protocol_impl->draw_set_dirty(layer); + continue; + } + #endif } } @@ -92,6 +100,14 @@ void displayio_group_set_hidden_by_parent(displayio_group_t *self, bool hidden) displayio_group_set_hidden_by_parent(layer, hidden); continue; } + #if CIRCUITPY_VECTORIO + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); + if (draw_protocol != NULL) { + layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); + draw_protocol->draw_protocol_impl->draw_set_dirty(layer); + continue; + } + #endif } } @@ -252,7 +268,7 @@ static void _add_layer(displayio_group_t *self, mp_obj_t layer) { if (native_layer != MP_OBJ_NULL) { displayio_tilegrid_t *tilegrid = native_layer; if (tilegrid->in_group) { - mp_raise_ValueError(translate("Layer already in a group.")); + mp_raise_ValueError(translate("Layer already in a group")); } else { tilegrid->in_group = true; } @@ -265,7 +281,7 @@ static void _add_layer(displayio_group_t *self, mp_obj_t layer) { if (native_layer != MP_OBJ_NULL) { displayio_group_t *group = native_layer; if (group->in_group) { - mp_raise_ValueError(translate("Layer already in a group.")); + mp_raise_ValueError(translate("Layer already in a group")); } else { group->in_group = true; } @@ -274,7 +290,7 @@ static void _add_layer(displayio_group_t *self, mp_obj_t layer) { group, self->hidden || self->hidden_by_parent); return; } - mp_raise_ValueError(translate("Layer must be a Group or TileGrid subclass.")); + mp_raise_ValueError(translate("Layer must be a Group or TileGrid subclass")); } static void _remove_layer(displayio_group_t *self, size_t index) { @@ -358,33 +374,35 @@ void displayio_group_construct(displayio_group_t *self, mp_obj_list_t *members, bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorspace_t *colorspace, const displayio_area_t *area, uint32_t *mask, uint32_t *buffer) { // Track if any of the layers finishes filling in the given area. We can ignore any remaining // layers at that point. - for (int32_t i = self->members->len - 1; i >= 0; i--) { - mp_obj_t layer; - #if CIRCUITPY_VECTORIO - const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); - if (draw_protocol != NULL) { - layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); - if (draw_protocol->draw_protocol_impl->draw_fill_area(layer, colorspace, area, mask, buffer)) { - return true; + if (self->hidden == false) { + for (int32_t i = self->members->len - 1; i >= 0; i--) { + mp_obj_t layer; + #if CIRCUITPY_VECTORIO + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[i]); + if (draw_protocol != NULL) { + layer = draw_protocol->draw_get_protocol_self(self->members->items[i]); + if (draw_protocol->draw_protocol_impl->draw_fill_area(layer, colorspace, area, mask, buffer)) { + return true; + } + continue; } - continue; - } - #endif - layer = mp_obj_cast_to_native_base( - self->members->items[i], &displayio_tilegrid_type); - if (layer != MP_OBJ_NULL) { - if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) { - return true; + #endif + layer = mp_obj_cast_to_native_base( + self->members->items[i], &displayio_tilegrid_type); + if (layer != MP_OBJ_NULL) { + if (displayio_tilegrid_fill_area(layer, colorspace, area, mask, buffer)) { + return true; + } + continue; } - continue; - } - layer = mp_obj_cast_to_native_base( - self->members->items[i], &displayio_group_type); - if (layer != MP_OBJ_NULL) { - if (displayio_group_fill_area(layer, colorspace, area, mask, buffer)) { - return true; + layer = mp_obj_cast_to_native_base( + self->members->items[i], &displayio_group_type); + if (layer != MP_OBJ_NULL) { + if (displayio_group_fill_area(layer, colorspace, area, mask, buffer)) { + return true; + } + continue; } - continue; } } return false; diff --git a/shared-module/displayio/OnDiskBitmap.c b/shared-module/displayio/OnDiskBitmap.c index dd2731a814..2863dffb19 100644 --- a/shared-module/displayio/OnDiskBitmap.c +++ b/shared-module/displayio/OnDiskBitmap.c @@ -50,7 +50,7 @@ void common_hal_displayio_ondiskbitmap_construct(displayio_ondiskbitmap_t *self, } if (bytes_read != 138 || memcmp(bmp_header, "BM", 2) != 0) { - mp_raise_ValueError(translate("Invalid BMP file")); + mp_arg_error_invalid(MP_QSTR_file); } // We can't cast because we're not aligned. diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c index fd0547c426..769c334ac6 100644 --- a/shared-module/displayio/TileGrid.c +++ b/shared-module/displayio/TileGrid.c @@ -221,6 +221,15 @@ void common_hal_displayio_tilegrid_set_pixel_shader(displayio_tilegrid_t *self, self->full_change = true; } +mp_obj_t common_hal_displayio_tilegrid_get_bitmap(displayio_tilegrid_t *self) { + return self->bitmap; +} + +void common_hal_displayio_tilegrid_set_bitmap(displayio_tilegrid_t *self, mp_obj_t bitmap) { + self->bitmap = bitmap; + self->full_change = true; +} + uint16_t common_hal_displayio_tilegrid_get_width(displayio_tilegrid_t *self) { return self->width_in_tiles; } @@ -287,6 +296,27 @@ void common_hal_displayio_tilegrid_set_tile(displayio_tilegrid_t *self, uint16_t self->partial_change = true; } +void common_hal_displayio_tilegrid_set_all_tiles(displayio_tilegrid_t *self, uint8_t tile_index) { + if (tile_index >= self->tiles_in_bitmap) { + mp_raise_ValueError(translate("Tile index out of bounds")); + } + uint8_t *tiles = self->tiles; + if (self->inline_tiles) { + tiles = (uint8_t *)&self->tiles; + } + if (tiles == NULL) { + return; + } + + for (uint16_t x = 0; x < self->width_in_tiles; x++) { + for (uint16_t y = 0; y < self->height_in_tiles; y++) { + tiles[y * self->width_in_tiles + x] = tile_index; + } + } + + self->full_change = true; +} + bool common_hal_displayio_tilegrid_get_flip_x(displayio_tilegrid_t *self) { return self->flip_x; } @@ -333,6 +363,13 @@ void common_hal_displayio_tilegrid_set_transpose_xy(displayio_tilegrid_t *self, self->moved = true; } +bool common_hal_displayio_tilegrid_contains(displayio_tilegrid_t *self, uint16_t x, uint16_t y) { + uint16_t right_edge = self->x + (self->width_in_tiles * self->tile_width); + uint16_t bottom_edge = self->y + (self->height_in_tiles * self->tile_height); + return x >= self->x && x < right_edge && + y >= self->y && y < bottom_edge; +} + void common_hal_displayio_tilegrid_set_top_left(displayio_tilegrid_t *self, uint16_t x, uint16_t y) { self->top_left_x = x; self->top_left_y = y; diff --git a/shared-module/dotenv/__init__.c b/shared-module/dotenv/__init__.c new file mode 100644 index 0000000000..1837cef2f5 --- /dev/null +++ b/shared-module/dotenv/__init__.c @@ -0,0 +1,250 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 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 +#include + +#include "shared-bindings/dotenv/__init__.h" + +#include "extmod/vfs.h" +#include "extmod/vfs_fat.h" +#include "py/mpstate.h" +#include "py/objstr.h" +#include "supervisor/filesystem.h" + +STATIC uint8_t consume_spaces(FIL *active_file) { + uint8_t character = ' '; + UINT quantity_read = 1; + while (unichar_isspace(character) && quantity_read > 0) { + f_read(active_file, &character, 1, &quantity_read); + } + return character; +} + +// Starting at the start of a new line, determines if the key matches the given +// key. File pointer is left after the = after the key. +STATIC bool key_matches(FIL *active_file, const char *key) { + uint8_t character = ' '; + UINT quantity_read = 1; + character = consume_spaces(active_file); + bool quoted = false; + if (character == '\'') { + quoted = true; + f_read(active_file, &character, 1, &quantity_read); + } + size_t key_pos = 0; + bool escaped = false; + bool matches = true; + size_t key_len = strlen(key); + while (quantity_read > 0) { + if (character == '\\' && !escaped && quoted) { + escaped = true; + } else if (!escaped && quoted && character == '\'') { + quoted = false; + // Move past the quoted before breaking so we can check the validity of data past it. + f_read(active_file, &character, 1, &quantity_read); + break; + } else if (!quoted && (unichar_isspace(character) || character == '=' || character == '\n' || character == '#')) { + break; + } else { + matches = matches && key[key_pos] == character; + escaped = false; + key_pos++; + } + + f_read(active_file, &character, 1, &quantity_read); + } + if (unichar_isspace(character)) { + character = consume_spaces(active_file); + } + if (character == '=' || character == '\n' || character == '#') { + // Rewind one so the value can find it. + f_lseek(active_file, f_tell(active_file) - 1); + } else { + // We're followed by something else that is invalid syntax. + matches = false; + } + return matches && key_pos == key_len; +} + +STATIC bool next_line(FIL *active_file) { + uint8_t character = ' '; + UINT quantity_read = 1; + bool quoted = false; + bool escaped = false; + // Track comments because they last until the end of the line. + bool comment = false; + FRESULT result = FR_OK; + // Consume all characters while quoted or others up to \n. + while (result == FR_OK && quantity_read > 0 && (quoted || character != '\n')) { + if (character == '#' || comment) { + // Comments consume any escaping. + comment = true; + } else if (!escaped) { + if (character == '\'') { + quoted = !quoted; + } else if (character == '\\') { + escaped = true; + } + } else { + escaped = false; + } + result = f_read(active_file, &character, 1, &quantity_read); + } + return result == FR_OK && quantity_read > 0; +} + +STATIC mp_int_t read_value(FIL *active_file, char *value, size_t value_len) { + uint8_t character = ' '; + UINT quantity_read = 1; + // Consume spaces before = + character = consume_spaces(active_file); + if (character != '=') { + if (character == '#' || character == '\n') { + // Keys without an = after them are valid with the value None. + return 0; + } + // All other characters are invalid. + return -1; + } + character = ' '; + // Consume space after = + while (unichar_isspace(character) && quantity_read > 0) { + f_read(active_file, &character, 1, &quantity_read); + } + bool quoted = false; + if (character == '\'') { + quoted = true; + f_read(active_file, &character, 1, &quantity_read); + } + if (character == '"') { + // We don't support double quoted values. + return -1; + } + // Copy the value over. + size_t value_pos = 0; + bool escaped = false; + // Count trailing spaces so we can ignore them at the end of unquoted + // values. + size_t trailing_spaces = 0; + while (quantity_read > 0) { + // Consume the first \ if the value is quoted. + if (quoted && character == '\\' && !escaped) { + escaped = true; + // Drop this slash by short circuiting the rest of the loop. + f_read(active_file, &character, 1, &quantity_read); + continue; + } + if (quoted && !escaped && character == '\'') { + // trailing ' means the value is done. + break; + } + // Unquoted values are ended by a newline or comment. + if (!quoted && (character == '\n' || character == '#')) { + if (character == '\n') { + // Rewind one so the next_line can find the \n. + f_lseek(active_file, f_tell(active_file) - 1); + } + break; + } + if (!quoted && unichar_isspace(character)) { + trailing_spaces += 1; + } else { + trailing_spaces = 0; + } + escaped = false; + // Only copy the value over if we have space. Otherwise, we'll just + // count the overall length. + if (value_pos < value_len) { + value[value_pos] = character; + } + value_pos++; + f_read(active_file, &character, 1, &quantity_read); + } + + return value_pos - trailing_spaces; +} + +mp_int_t dotenv_get_key(const char *path, const char *key, char *value, mp_int_t value_len) { + FIL active_file; + FATFS *fs = filesystem_circuitpy(); + FRESULT result = f_open(fs, &active_file, path, FA_READ); + if (result != FR_OK) { + return -1; + } + + mp_int_t actual_value_len = -1; + bool read_ok = true; + while (read_ok) { + if (key_matches(&active_file, key)) { + actual_value_len = read_value(&active_file, value, value_len); + } + + read_ok = next_line(&active_file); + } + f_close(&active_file); + return actual_value_len; +} + +mp_obj_t common_hal_dotenv_get_key(const char *path, const char *key) { + // Use the stack for short values. Longer values will require a heap allocation after we know + // the length. + char value[64]; + mp_int_t actual_len = dotenv_get_key(path, key, value, sizeof(value)); + if (actual_len <= 0) { + return mp_const_none; + } + if ((size_t)actual_len >= sizeof(value)) { + mp_obj_str_t *str = MP_OBJ_TO_PTR(mp_obj_new_str_copy(&mp_type_str, NULL, actual_len + 1)); + dotenv_get_key(path, key, (char *)str->data, actual_len + 1); + str->hash = qstr_compute_hash(str->data, actual_len); + return MP_OBJ_FROM_PTR(str); + } + return mp_obj_new_str(value, actual_len); +} + +bool dotenv_get_key_terminated(const char *path, const char *key, char *value, mp_int_t value_len) { + mp_int_t actual_len = dotenv_get_key(path, key, value, value_len - 1); + if (actual_len >= value_len) { + return false; + } + value[actual_len] = '\0'; // terminate string + return true; +} + +bool dotenv_get_key_int(const char *path, const char *key, mp_int_t *value) { + char buf[16]; + if (!dotenv_get_key_terminated(path, key, buf, (mp_int_t)sizeof(buf))) { + return false; + } + char *end; + long result = strtol(buf, &end, 0); + if (end == buf || *end) { // If the whole buffer was not consumed it's an error + return false; + } + *value = (mp_int_t)result; + return true; +} diff --git a/shared-module/dotenv/__init__.h b/shared-module/dotenv/__init__.h new file mode 100644 index 0000000000..fb27233692 --- /dev/null +++ b/shared-module/dotenv/__init__.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +// Allocation free version that returns the full length of the value. +mp_int_t dotenv_get_key(const char *path, const char *key, char *value, mp_int_t value_len); + +// Returns true and sets value to a '\0'-terminated string if key is present +// and the value (including the terminating '\0') fits strictly within +// value_len bytes. +bool dotenv_get_key_terminated(const char *path, const char *key, char *value, mp_int_t value_len); + +// Returns true and sets value to the read value. Returns false if the value was not numeric. +bool dotenv_get_key_int(const char *path, const char *key, mp_int_t *value); diff --git a/shared-module/floppyio/__init__.c b/shared-module/floppyio/__init__.c new file mode 100644 index 0000000000..6700c48078 --- /dev/null +++ b/shared-module/floppyio/__init__.c @@ -0,0 +1,110 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 "py/runtime.h" + +#include "shared-bindings/time/__init__.h" +#include "shared-bindings/floppyio/__init__.h" +#include "common-hal/floppyio/__init__.h" +#include "shared-bindings/digitalio/DigitalInOut.h" + +#ifndef T2_5 +#define T2_5 (FLOPPYIO_SAMPLERATE * 5 / 2 / 1000000) +#endif +#ifndef T3_5 +#define T3_5 (FLOPPYIO_SAMPLERATE * 7 / 2 / 1000000) +#endif + +#define MFM_IO_MMIO (1) +#include "lib/adafruit_floppy/src/mfm_impl.h" + +__attribute__((optimize("O3"))) +int common_hal_floppyio_flux_readinto(void *buf, size_t len, digitalio_digitalinout_obj_t *data, digitalio_digitalinout_obj_t *index) { + uint32_t index_mask; + volatile uint32_t *index_port = common_hal_digitalio_digitalinout_get_reg(index, DIGITALINOUT_REG_READ, &index_mask); + + uint32_t data_mask; + volatile uint32_t *data_port = common_hal_digitalio_digitalinout_get_reg(data, DIGITALINOUT_REG_READ, &data_mask); + +#undef READ_INDEX +#undef READ_DATA +#define READ_INDEX() (!!(*index_port & index_mask)) +#define READ_DATA() (!!(*data_port & data_mask)) + + memset(buf, 0, len); + + uint8_t *pulses = buf, *pulses_ptr = pulses, *pulses_end = pulses + len; + + common_hal_mcu_disable_interrupts(); + + // wait for index pulse low + while (READ_INDEX()) { /* NOTHING */ + } + + + // if data line is low, wait till it rises + while (!READ_DATA()) { /* NOTHING */ + } + + // and then till it drops down + while (READ_DATA()) { /* NOTHING */ + } + + uint32_t index_state = 0; + while (pulses_ptr < pulses_end) { + index_state = (index_state << 1) | READ_INDEX(); + if ((index_state & 3) == 2) { // a zero-to-one transition + break; + } + + unsigned pulse_count = 3; + while (!READ_DATA()) { + pulse_count++; + } + + while (READ_DATA()) { + pulse_count++; + } + + *pulses_ptr++ = MIN(255, pulse_count); + } + common_hal_mcu_enable_interrupts(); + + return pulses_ptr - pulses; +} + +int common_hal_floppyio_mfm_readinto(void *buf, size_t n_sectors, digitalio_digitalinout_obj_t *data, digitalio_digitalinout_obj_t *index) { + mfm_io_t io; + io.index_port = common_hal_digitalio_digitalinout_get_reg(index, DIGITALINOUT_REG_READ, &io.index_mask); + io.data_port = common_hal_digitalio_digitalinout_get_reg(data, DIGITALINOUT_REG_READ, &io.data_mask); + + common_hal_mcu_disable_interrupts(); + uint8_t validity[n_sectors]; + int result = read_track(io, n_sectors, buf, validity); + common_hal_mcu_enable_interrupts(); + + return result; +} diff --git a/shared-module/framebufferio/FramebufferDisplay.c b/shared-module/framebufferio/FramebufferDisplay.c index 48353b7dba..e2e7d11106 100644 --- a/shared-module/framebufferio/FramebufferDisplay.c +++ b/shared-module/framebufferio/FramebufferDisplay.c @@ -83,9 +83,8 @@ void common_hal_framebufferio_framebufferdisplay_construct(framebufferio_framebu self->framebuffer_protocol->get_bufinfo(self->framebuffer, &self->bufinfo); size_t framebuffer_size = self->first_pixel_offset + self->row_stride * self->core.height; - if (self->bufinfo.len < framebuffer_size) { - mp_raise_IndexError_varg(translate("Framebuffer requires %d bytes"), framebuffer_size); - } + + mp_arg_validate_length_min(self->bufinfo.len, framebuffer_size, MP_QSTR_framebuffer); self->first_manual_refresh = !auto_refresh; @@ -114,20 +113,6 @@ uint16_t common_hal_framebufferio_framebufferdisplay_get_height(framebufferio_fr return displayio_display_core_get_height(&self->core); } -bool common_hal_framebufferio_framebufferdisplay_get_auto_brightness(framebufferio_framebufferdisplay_obj_t *self) { - if (self->framebuffer_protocol->get_auto_brightness) { - return self->framebuffer_protocol->get_auto_brightness(self->framebuffer); - } - return true; -} - -bool common_hal_framebufferio_framebufferdisplay_set_auto_brightness(framebufferio_framebufferdisplay_obj_t *self, bool auto_brightness) { - if (self->framebuffer_protocol->set_auto_brightness) { - return self->framebuffer_protocol->set_auto_brightness(self->framebuffer, auto_brightness); - } - return false; -} - mp_float_t common_hal_framebufferio_framebufferdisplay_get_brightness(framebufferio_framebufferdisplay_obj_t *self) { if (self->framebuffer_protocol->get_brightness) { return self->framebuffer_protocol->get_brightness(self->framebuffer); @@ -373,3 +358,7 @@ void framebufferio_framebufferdisplay_reset(framebufferio_framebufferdisplay_obj release_framebufferdisplay(self); } } + +mp_obj_t common_hal_framebufferio_framebufferdisplay_get_root_group(framebufferio_framebufferdisplay_obj_t *self) { + return self->core.current_group; +} diff --git a/shared-module/framebufferio/FramebufferDisplay.h b/shared-module/framebufferio/FramebufferDisplay.h index b6138e2202..b53461aad5 100644 --- a/shared-module/framebufferio/FramebufferDisplay.h +++ b/shared-module/framebufferio/FramebufferDisplay.h @@ -43,7 +43,6 @@ typedef struct { mp_obj_t framebuffer; const struct _framebuffer_p_t *framebuffer_protocol; mp_buffer_info_t bufinfo; - uint64_t last_backlight_refresh; uint64_t last_refresh_call; uint16_t native_frames_per_second; uint16_t native_ms_per_frame; @@ -61,10 +60,8 @@ void framebufferio_framebufferdisplay_collect_ptrs(framebufferio_framebufferdisp mp_obj_t common_hal_framebufferio_framebufferdisplay_get_framebuffer(framebufferio_framebufferdisplay_obj_t *self); -typedef bool (*framebuffer_get_auto_brightness_fun)(mp_obj_t); typedef bool (*framebuffer_get_reverse_pixels_in_byte_fun)(mp_obj_t); typedef bool (*framebuffer_get_reverse_pixels_in_word_fun)(mp_obj_t); -typedef bool (*framebuffer_set_auto_brightness_fun)(mp_obj_t, bool); typedef bool (*framebuffer_set_brightness_fun)(mp_obj_t, mp_float_t); typedef int (*framebuffer_get_bytes_per_cell_fun)(mp_obj_t); typedef int (*framebuffer_get_color_depth_fun)(mp_obj_t); @@ -105,9 +102,6 @@ typedef struct _framebuffer_p_t { framebuffer_get_brightness_fun get_brightness; framebuffer_set_brightness_fun set_brightness; - // Optional -- default is no automatic brightness control - framebuffer_get_auto_brightness_fun get_auto_brightness; - framebuffer_set_auto_brightness_fun set_auto_brightness; } framebuffer_p_t; #endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_FRAMEBUFFERDISPLAY_H diff --git a/shared-module/is31fl3741/FrameBuffer.c b/shared-module/is31fl3741/FrameBuffer.c index 400f6f843d..d795c0d5e7 100644 --- a/shared-module/is31fl3741/FrameBuffer.c +++ b/shared-module/is31fl3741/FrameBuffer.c @@ -141,8 +141,7 @@ void common_hal_is31fl3741_FrameBuffer_refresh(is31fl3741_FrameBuffer_obj_t *sel if (!self->paused) { common_hal_is31fl3741_begin_transaction(self->is31fl3741); - uint8_t dirty_row_flags = 0xFF; // only supports 8 rows gotta fix - + uint8_t dirty_row_flags = 0xFF; if (self->scale) { // Based on the Arduino IS31FL3741 driver code // dirtyrows flag current not implemented for scaled displays @@ -173,7 +172,7 @@ void common_hal_is31fl3741_FrameBuffer_refresh(is31fl3741_FrameBuffer_obj_t *sel } else { color = (rsum << 16) + (gsum << 8) + bsum; } - common_hal_is31fl3741_draw_pixel(self->is31fl3741, x, y, color, self->mapping); + common_hal_is31fl3741_draw_pixel(self->is31fl3741, x, y, color, self->mapping, self->height); } } } else { @@ -194,9 +193,11 @@ void common_hal_is31fl3741_FrameBuffer_refresh(is31fl3741_FrameBuffer_obj_t *sel color = *buffer; } - common_hal_is31fl3741_draw_pixel(self->is31fl3741, x, y, color, self->mapping); + common_hal_is31fl3741_draw_pixel(self->is31fl3741, x, y, color, self->mapping, self->height); buffer++; } + } else { + buffer += self->width; // row did not have to be redrawn, skip it in the buffer } } } diff --git a/shared-module/is31fl3741/IS31FL3741.c b/shared-module/is31fl3741/IS31FL3741.c index bb92b5b32c..08598743b7 100644 --- a/shared-module/is31fl3741/IS31FL3741.c +++ b/shared-module/is31fl3741/IS31FL3741.c @@ -148,16 +148,17 @@ void common_hal_is31fl3741_set_led(is31fl3741_IS31FL3741_obj_t *self, uint16_t l common_hal_busio_i2c_write(self->i2c, self->device_address, cmd, 2); } -void common_hal_is31fl3741_draw_pixel(is31fl3741_IS31FL3741_obj_t *self, int16_t x, int16_t y, uint32_t color, uint16_t *mapping) { +void common_hal_is31fl3741_draw_pixel(is31fl3741_IS31FL3741_obj_t *self, int16_t x, int16_t y, uint32_t color, uint16_t *mapping, uint8_t display_height) { uint8_t r = color >> 16 & 0xFF; uint8_t g = color >> 8 & 0xFF; uint8_t b = color & 0xFF; - int16_t x1 = (x * 5 + y) * 3; + int16_t x1 = (x * display_height + y) * 3; uint16_t ridx = mapping[x1 + 2]; if (ridx != 65535) { uint16_t gidx = mapping[x1 + 1]; uint16_t bidx = mapping[x1 + 0]; + common_hal_is31fl3741_set_led(self, ridx, r, 0); common_hal_is31fl3741_set_led(self, gidx, g, 0); common_hal_is31fl3741_set_led(self, bidx, b, 0); diff --git a/shared-module/keypad/EventQueue.h b/shared-module/keypad/EventQueue.h index f686d45960..b523b16cac 100644 --- a/shared-module/keypad/EventQueue.h +++ b/shared-module/keypad/EventQueue.h @@ -30,7 +30,7 @@ #include "py/obj.h" #include "py/ringbuf.h" -typedef struct { +typedef struct _keypad_eventqueue_obj_t { mp_obj_base_t base; ringbuf_t encoded_events; bool overflowed; diff --git a/shared-module/keypad/KeyMatrix.c b/shared-module/keypad/KeyMatrix.c index 49b87fc882..b2520521cc 100644 --- a/shared-module/keypad/KeyMatrix.c +++ b/shared-module/keypad/KeyMatrix.c @@ -37,6 +37,14 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" +static void keymatrix_scan_now(void *self_in, mp_obj_t timestamp); +static size_t keymatrix_get_key_count(void *self_in); + +static keypad_scanner_funcs_t keymatrix_funcs = { + .scan_now = keymatrix_scan_now, + .get_key_count = keymatrix_get_key_count, +}; + static mp_uint_t row_column_to_key_number(keypad_keymatrix_obj_t *self, mp_uint_t row, mp_uint_t column) { return row * self->column_digitalinouts->len + column; } @@ -67,21 +75,13 @@ void common_hal_keypad_keymatrix_construct(keypad_keymatrix_obj_t *self, mp_uint self->previously_pressed = (bool *)gc_alloc(sizeof(bool) * num_row_pins * num_column_pins, false, false); self->columns_to_anodes = columns_to_anodes; + self->funcs = &keymatrix_funcs; - keypad_eventqueue_obj_t *events = m_new_obj(keypad_eventqueue_obj_t); - events->base.type = &keypad_eventqueue_type; - common_hal_keypad_eventqueue_construct(events, max_events); - self->events = events; - - self->interval_ticks = (mp_uint_t)(interval * 1024); // interval * 1000 * (1024/1000) - self->last_scan_ticks = port_get_raw_ticks(NULL); - - // Add self to the list of active keypad scanners. - keypad_register_scanner((keypad_scanner_obj_t *)self); + keypad_construct_common((keypad_scanner_obj_t *)self, interval, max_events); } void common_hal_keypad_keymatrix_deinit(keypad_keymatrix_obj_t *self) { - if (common_hal_keypad_keymatrix_deinited(self)) { + if (common_hal_keypad_deinited(self)) { return; } @@ -97,14 +97,7 @@ void common_hal_keypad_keymatrix_deinit(keypad_keymatrix_obj_t *self) { common_hal_digitalio_digitalinout_deinit(self->column_digitalinouts->items[column]); } self->column_digitalinouts = MP_ROM_NONE; -} - -bool common_hal_keypad_keymatrix_deinited(keypad_keymatrix_obj_t *self) { - return self->row_digitalinouts == MP_ROM_NONE; -} - -size_t common_hal_keypad_keymatrix_get_key_count(keypad_keymatrix_obj_t *self) { - return common_hal_keypad_keymatrix_get_row_count(self) * common_hal_keypad_keymatrix_get_column_count(self); + common_hal_keypad_deinit_core(self); } size_t common_hal_keypad_keymatrix_get_row_count(keypad_keymatrix_obj_t *self) { @@ -125,29 +118,13 @@ void common_hal_keypad_keymatrix_key_number_to_row_column(keypad_keymatrix_obj_t *column = key_number % num_columns; } -mp_obj_t common_hal_keypad_keymatrix_get_events(keypad_keymatrix_obj_t *self) { - return MP_OBJ_FROM_PTR(self->events); +static size_t keymatrix_get_key_count(void *self_in) { + keypad_keymatrix_obj_t *self = self_in; + return common_hal_keypad_keymatrix_get_column_count(self) * common_hal_keypad_keymatrix_get_row_count(self); } -void common_hal_keypad_keymatrix_reset(keypad_keymatrix_obj_t *self) { - const size_t key_count = common_hal_keypad_keymatrix_get_key_count(self); - - supervisor_acquire_lock(&keypad_scanners_linked_list_lock); - memset(self->previously_pressed, false, key_count); - memset(self->currently_pressed, false, key_count); - supervisor_release_lock(&keypad_scanners_linked_list_lock); -} - -void keypad_keymatrix_scan(keypad_keymatrix_obj_t *self) { - uint64_t now = port_get_raw_ticks(NULL); - if (now - self->last_scan_ticks < self->interval_ticks) { - // Too soon. Wait longer to debounce. - return; - } - - self->last_scan_ticks = now; - - mp_obj_t timestamp = supervisor_ticks_ms(); +static void keymatrix_scan_now(void *self_in, mp_obj_t timestamp) { + keypad_keymatrix_obj_t *self = self_in; // On entry, all pins are set to inputs with a pull-up or pull-down, // depending on the diode orientation. diff --git a/shared-module/keypad/KeyMatrix.h b/shared-module/keypad/KeyMatrix.h index bd7e2d23e2..8049fcbb90 100644 --- a/shared-module/keypad/KeyMatrix.h +++ b/shared-module/keypad/KeyMatrix.h @@ -35,16 +35,9 @@ #include "shared-module/keypad/EventQueue.h" typedef struct { - mp_obj_base_t base; - // All scanners have a next field here, to keep a linked list of active scanners. - keypad_scanner_obj_t *next; + KEYPAD_SCANNER_COMMON_FIELDS; mp_obj_tuple_t *row_digitalinouts; mp_obj_tuple_t *column_digitalinouts; - mp_uint_t interval_ticks; - uint64_t last_scan_ticks; - bool *previously_pressed; - bool *currently_pressed; - keypad_eventqueue_obj_t *events; bool columns_to_anodes; } keypad_keymatrix_obj_t; diff --git a/shared-module/keypad/Keys.c b/shared-module/keypad/Keys.c index ce402e4dce..d74a3ab859 100644 --- a/shared-module/keypad/Keys.c +++ b/shared-module/keypad/Keys.c @@ -36,6 +36,14 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" +static void keypad_keys_scan_now(void *self_in, mp_obj_t timestamp); +static size_t keys_get_key_count(void *self_in); + +static keypad_scanner_funcs_t keys_funcs = { + .scan_now = keypad_keys_scan_now, + .get_key_count = keys_get_key_count, +}; + void common_hal_keypad_keys_construct(keypad_keys_obj_t *self, mp_uint_t num_pins, const mcu_pin_obj_t *pins[], bool value_when_pressed, bool pull, mp_float_t interval, size_t max_events) { mp_obj_t dios[num_pins]; @@ -53,67 +61,36 @@ void common_hal_keypad_keys_construct(keypad_keys_obj_t *self, mp_uint_t num_pin self->currently_pressed = (bool *)gc_alloc(sizeof(bool) * num_pins, false, false); self->previously_pressed = (bool *)gc_alloc(sizeof(bool) * num_pins, false, false); self->value_when_pressed = value_when_pressed; + self->funcs = &keys_funcs; - self->interval_ticks = (mp_uint_t)(interval * 1024); // interval * 1000 * (1024/1000) - self->last_scan_ticks = port_get_raw_ticks(NULL); + keypad_construct_common((keypad_scanner_obj_t *)self, interval, max_events); - keypad_eventqueue_obj_t *events = m_new_obj(keypad_eventqueue_obj_t); - events->base.type = &keypad_eventqueue_type; - common_hal_keypad_eventqueue_construct(events, max_events); - self->events = events; - - // Add self to the list of active keypad scanners. - keypad_register_scanner((keypad_scanner_obj_t *)self); } void common_hal_keypad_keys_deinit(keypad_keys_obj_t *self) { - if (common_hal_keypad_keys_deinited(self)) { + if (common_hal_keypad_deinited(self)) { return; } // Remove self from the list of active keypad scanners first. keypad_deregister_scanner((keypad_scanner_obj_t *)self); - for (size_t key = 0; key < common_hal_keypad_keys_get_key_count(self); key++) { + for (size_t key = 0; key < keys_get_key_count(self); key++) { common_hal_digitalio_digitalinout_deinit(self->digitalinouts->items[key]); } self->digitalinouts = MP_ROM_NONE; + common_hal_keypad_deinit_core(self); } -bool common_hal_keypad_keys_deinited(keypad_keys_obj_t *self) { - return self->digitalinouts == MP_ROM_NONE; -} - -size_t common_hal_keypad_keys_get_key_count(keypad_keys_obj_t *self) { +size_t keys_get_key_count(void *self_in) { + keypad_keys_obj_t *self = self_in; return self->digitalinouts->len; } -mp_obj_t common_hal_keypad_keys_get_events(keypad_keys_obj_t *self) { - return MP_OBJ_FROM_PTR(self->events); -} - -void common_hal_keypad_keys_reset(keypad_keys_obj_t *self) { - const size_t key_count = common_hal_keypad_keys_get_key_count(self); - - supervisor_acquire_lock(&keypad_scanners_linked_list_lock); - memset(self->previously_pressed, false, key_count); - memset(self->currently_pressed, false, key_count); - supervisor_release_lock(&keypad_scanners_linked_list_lock); -} - -void keypad_keys_scan(keypad_keys_obj_t *self) { - uint64_t now = port_get_raw_ticks(NULL); - if (now - self->last_scan_ticks < self->interval_ticks) { - // Too soon. Wait longer to debounce. - return; - } - - self->last_scan_ticks = now; - - const size_t key_count = common_hal_keypad_keys_get_key_count(self); - - mp_obj_t timestamp = supervisor_ticks_ms(); +static void keypad_keys_scan_now(void *self_in, mp_obj_t timestamp) { + keypad_keys_obj_t *self = self_in; + size_t key_count = keys_get_key_count(self); for (mp_uint_t key_number = 0; key_number < key_count; key_number++) { // Remember the previous up/down state. diff --git a/shared-module/keypad/Keys.h b/shared-module/keypad/Keys.h index 3edae32439..6bd7d7ac31 100644 --- a/shared-module/keypad/Keys.h +++ b/shared-module/keypad/Keys.h @@ -35,15 +35,8 @@ #include "shared-module/keypad/EventQueue.h" typedef struct { - mp_obj_base_t base; - // All scanners have a next field here, to keep a linked list of active scanners. - keypad_scanner_obj_t *next; + KEYPAD_SCANNER_COMMON_FIELDS; mp_obj_tuple_t *digitalinouts; - mp_uint_t interval_ticks; - uint64_t last_scan_ticks; - bool *previously_pressed; - bool *currently_pressed; - keypad_eventqueue_obj_t *events; bool value_when_pressed; } keypad_keys_obj_t; diff --git a/shared-module/keypad/ShiftRegisterKeys.c b/shared-module/keypad/ShiftRegisterKeys.c index d185c6fca4..b2b10c65a2 100644 --- a/shared-module/keypad/ShiftRegisterKeys.c +++ b/shared-module/keypad/ShiftRegisterKeys.c @@ -36,6 +36,14 @@ #include "supervisor/port.h" #include "supervisor/shared/tick.h" +static void shiftregisterkeys_scan_now(void *self, mp_obj_t timestamp); +static size_t shiftregisterkeys_get_key_count(void *self); + +static keypad_scanner_funcs_t shiftregisterkeys_funcs = { + .scan_now = shiftregisterkeys_scan_now, + .get_key_count = shiftregisterkeys_get_key_count, +}; + void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_t *self, const mcu_pin_obj_t *clock_pin, const mcu_pin_obj_t *data_pin, const mcu_pin_obj_t *latch_pin, bool value_to_latch, size_t key_count, bool value_when_pressed, mp_float_t interval, size_t max_events) { digitalio_digitalinout_obj_t *clock = m_new_obj(digitalio_digitalinout_obj_t); @@ -52,30 +60,21 @@ void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_ digitalio_digitalinout_obj_t *latch = m_new_obj(digitalio_digitalinout_obj_t); latch->base.type = &digitalio_digitalinout_type; + common_hal_digitalio_digitalinout_construct(latch, latch_pin); common_hal_digitalio_digitalinout_switch_to_output(latch, true, DRIVE_MODE_PUSH_PULL); self->latch = latch; self->value_to_latch = value_to_latch; - self->currently_pressed = (bool *)gc_alloc(sizeof(bool) * key_count, false, false); - self->previously_pressed = (bool *)gc_alloc(sizeof(bool) * key_count, false, false); self->value_when_pressed = value_when_pressed; self->key_count = key_count; + self->funcs = &shiftregisterkeys_funcs; - self->interval_ticks = (mp_uint_t)(interval * 1024); // interval * 1000 * (1024/1000) - self->last_scan_ticks = port_get_raw_ticks(NULL); - - keypad_eventqueue_obj_t *events = m_new_obj(keypad_eventqueue_obj_t); - events->base.type = &keypad_eventqueue_type; - common_hal_keypad_eventqueue_construct(events, max_events); - self->events = events; - - // Add self to the list of active keypad scanners. - keypad_register_scanner((keypad_scanner_obj_t *)self); + keypad_construct_common((keypad_scanner_obj_t *)self, interval, max_events); } void common_hal_keypad_shiftregisterkeys_deinit(keypad_shiftregisterkeys_obj_t *self) { - if (common_hal_keypad_shiftregisterkeys_deinited(self)) { + if (common_hal_keypad_deinited(self)) { return; } @@ -91,44 +90,22 @@ void common_hal_keypad_shiftregisterkeys_deinit(keypad_shiftregisterkeys_obj_t * common_hal_digitalio_digitalinout_deinit(self->latch); self->latch = MP_ROM_NONE; + + common_hal_keypad_deinit_core(self); } -bool common_hal_keypad_shiftregisterkeys_deinited(keypad_shiftregisterkeys_obj_t *self) { - return self->clock == MP_ROM_NONE; -} - -size_t common_hal_keypad_shiftregisterkeys_get_key_count(keypad_shiftregisterkeys_obj_t *self) { +size_t shiftregisterkeys_get_key_count(void *self_in) { + keypad_shiftregisterkeys_obj_t *self = self_in; return self->key_count; } -mp_obj_t common_hal_keypad_shiftregisterkeys_get_events(keypad_shiftregisterkeys_obj_t *self) { - return MP_OBJ_FROM_PTR(self->events); -} - -void common_hal_keypad_shiftregisterkeys_reset(keypad_shiftregisterkeys_obj_t *self) { - const size_t key_count = common_hal_keypad_shiftregisterkeys_get_key_count(self); - - supervisor_acquire_lock(&keypad_scanners_linked_list_lock); - memset(self->previously_pressed, false, key_count); - memset(self->currently_pressed, false, key_count); - supervisor_release_lock(&keypad_scanners_linked_list_lock); -} - -void keypad_shiftregisterkeys_scan(keypad_shiftregisterkeys_obj_t *self) { - uint64_t now = port_get_raw_ticks(NULL); - if (now - self->last_scan_ticks < self->interval_ticks) { - // Too soon. Wait longer to debounce. - return; - } - - self->last_scan_ticks = now; - - mp_obj_t timestamp = supervisor_ticks_ms(); +static void shiftregisterkeys_scan_now(void *self_in, mp_obj_t timestamp) { + keypad_shiftregisterkeys_obj_t *self = self_in; // Latch (freeze) the current state of the input pins. common_hal_digitalio_digitalinout_set_value(self->latch, self->value_to_latch); - const size_t key_count = common_hal_keypad_shiftregisterkeys_get_key_count(self); + const size_t key_count = shiftregisterkeys_get_key_count(self); for (mp_uint_t key_number = 0; key_number < key_count; key_number++) { // Zero-th data appears on on the data pin immediately, without shifting. diff --git a/shared-module/keypad/ShiftRegisterKeys.h b/shared-module/keypad/ShiftRegisterKeys.h index b04c622679..84c66ef627 100644 --- a/shared-module/keypad/ShiftRegisterKeys.h +++ b/shared-module/keypad/ShiftRegisterKeys.h @@ -35,18 +35,11 @@ #include "shared-module/keypad/EventQueue.h" typedef struct { - mp_obj_base_t base; - // All scanners have a next field here, to keep a linked list of active scanners. - keypad_scanner_obj_t *next; + KEYPAD_SCANNER_COMMON_FIELDS; digitalio_digitalinout_obj_t *clock; digitalio_digitalinout_obj_t *data; digitalio_digitalinout_obj_t *latch; size_t key_count; - mp_uint_t interval_ticks; - uint64_t last_scan_ticks; - bool *previously_pressed; - bool *currently_pressed; - keypad_eventqueue_obj_t *events; bool value_when_pressed; bool value_to_latch; } keypad_shiftregisterkeys_obj_t; diff --git a/shared-module/keypad/__init__.c b/shared-module/keypad/__init__.c index e239c56b61..d2f5521a25 100644 --- a/shared-module/keypad/__init__.c +++ b/shared-module/keypad/__init__.c @@ -24,13 +24,20 @@ * THE SOFTWARE. */ +#include +#include "shared-bindings/keypad/__init__.h" +#include "shared-bindings/keypad/EventQueue.h" #include "shared-bindings/keypad/Keys.h" #include "shared-bindings/keypad/KeyMatrix.h" #include "shared-bindings/keypad/ShiftRegisterKeys.h" +#include "shared-bindings/supervisor/__init__.h" +#include "supervisor/port.h" #include "supervisor/shared/lock.h" #include "supervisor/shared/tick.h" supervisor_lock_t keypad_scanners_linked_list_lock; +static void keypad_scan_now(keypad_scanner_obj_t *self, uint64_t now); +static void keypad_scan_maybe(keypad_scanner_obj_t *self, uint64_t now); void keypad_tick(void) { // Fast path. Return immediately there are no scanners. @@ -40,16 +47,10 @@ void keypad_tick(void) { // Skip scanning if someone else has the lock. Don't wait for the lock. if (supervisor_try_lock(&keypad_scanners_linked_list_lock)) { + uint64_t now = port_get_raw_ticks(NULL); mp_obj_t scanner = MP_STATE_VM(keypad_scanners_linked_list); while (scanner) { - if (mp_obj_is_type(scanner, &keypad_keys_type)) { - keypad_keys_scan((keypad_keys_obj_t *)scanner); - } else if (mp_obj_is_type(scanner, &keypad_keymatrix_type)) { - keypad_keymatrix_scan((keypad_keymatrix_obj_t *)scanner); - } else if (mp_obj_is_type(scanner, &keypad_shiftregisterkeys_type)) { - keypad_shiftregisterkeys_scan((keypad_shiftregisterkeys_obj_t *)scanner); - } - + keypad_scan_maybe(scanner, now); scanner = ((keypad_scanner_obj_t *)scanner)->next; } supervisor_release_lock(&keypad_scanners_linked_list_lock); @@ -97,3 +98,60 @@ void keypad_deregister_scanner(keypad_scanner_obj_t *scanner) { } supervisor_release_lock(&keypad_scanners_linked_list_lock); } + +void keypad_construct_common(keypad_scanner_obj_t *self, mp_float_t interval, size_t max_events) { + size_t key_count = common_hal_keypad_generic_get_key_count(self); + self->currently_pressed = (bool *)gc_alloc(sizeof(bool) * key_count, false, false); + self->previously_pressed = (bool *)gc_alloc(sizeof(bool) * key_count, false, false); + + self->interval_ticks = (mp_uint_t)(interval * 1024); // interval * 1000 * (1024/1000) + + keypad_eventqueue_obj_t *events = m_new_obj(keypad_eventqueue_obj_t); + events->base.type = &keypad_eventqueue_type; + common_hal_keypad_eventqueue_construct(events, max_events); + self->events = events; + + // Add self to the list of active keypad scanners. + keypad_register_scanner(self); + keypad_scan_now(self, port_get_raw_ticks(NULL)); +} + +static void keypad_scan_now(keypad_scanner_obj_t *self, uint64_t now) { + self->next_scan_ticks = now + self->interval_ticks; + self->funcs->scan_now(self, supervisor_ticks_ms()); +} + +static void keypad_scan_maybe(keypad_scanner_obj_t *self, uint64_t now) { + if (now < self->next_scan_ticks) { + return; + } + keypad_scan_now(self, now); +} + +void common_hal_keypad_generic_reset(void *self_in) { + keypad_scanner_obj_t *self = self_in; + size_t key_count = common_hal_keypad_generic_get_key_count(self); + memset(self->previously_pressed, false, key_count); + memset(self->currently_pressed, false, key_count); + keypad_scan_now(self, port_get_raw_ticks(NULL)); +} + +void common_hal_keypad_deinit_core(void *self_in) { + keypad_scanner_obj_t *self = self_in; + self->events = NULL; +} + +bool common_hal_keypad_deinited(void *self_in) { + keypad_scanner_obj_t *self = self_in; + return !self->events; +} + +size_t common_hal_keypad_generic_get_key_count(void *self_in) { + keypad_scanner_obj_t *self = self_in; + return self->funcs->get_key_count(self); +} + +mp_obj_t common_hal_keypad_generic_get_events(void *self_in) { + keypad_scanner_obj_t *self = self_in; + return self->events; +} diff --git a/shared-module/keypad/__init__.h b/shared-module/keypad/__init__.h index c5b8fe3a0a..cc792ff791 100644 --- a/shared-module/keypad/__init__.h +++ b/shared-module/keypad/__init__.h @@ -30,12 +30,26 @@ #include "py/obj.h" #include "supervisor/shared/lock.h" -// All scanners must have a next field immediately following base. +typedef struct _keypad_scanner_funcs_t { + void (*scan_now)(void *self_in, mp_obj_t timestamp); + size_t (*get_key_count)(void *self_in); +} keypad_scanner_funcs_t; + +// All scanners must begin with these common fields. // This is an ad hoc "superclass" struct for scanners, though they do // not actually have a superclass relationship. +#define KEYPAD_SCANNER_COMMON_FIELDS \ + mp_obj_base_t base; \ + struct _keypad_scanner_obj_t *next; \ + keypad_scanner_funcs_t *funcs; \ + uint64_t next_scan_ticks; \ + bool *previously_pressed; \ + bool *currently_pressed; \ + struct _keypad_eventqueue_obj_t *events; \ + mp_uint_t interval_ticks + typedef struct _keypad_scanner_obj_t { - mp_obj_base_t base; - struct _keypad_scanner_obj_t *next; + KEYPAD_SCANNER_COMMON_FIELDS; } keypad_scanner_obj_t; extern supervisor_lock_t keypad_scanners_linked_list_lock; @@ -45,6 +59,9 @@ void keypad_reset(void); void keypad_register_scanner(keypad_scanner_obj_t *scanner); void keypad_deregister_scanner(keypad_scanner_obj_t *scanner); +void keypad_construct_common(keypad_scanner_obj_t *scanner, mp_float_t interval, size_t max_events); +size_t common_hal_keypad_generic_get_key_count(void *scanner); +void common_hal_keypad_deinit_core(void *scanner); #endif // SHARED_MODULE_KEYPAD_H diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index e1b98a9f93..d32550722c 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -36,7 +36,7 @@ #include "py/runtime.h" #include "py/stream.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/msgpack/ExtType.h" #include "shared-bindings/msgpack/__init__.h" #include "shared-module/msgpack/__init__.h" diff --git a/shared-module/os/__init__.c b/shared-module/os/__init__.c index 89c7952671..35933ebaf6 100644 --- a/shared-module/os/__init__.c +++ b/shared-module/os/__init__.c @@ -36,6 +36,10 @@ #include "py/runtime.h" #include "shared-bindings/os/__init__.h" +#if CIRCUITPY_DOTENV +#include "shared-bindings/dotenv/__init__.h" +#endif + // This provides all VFS related OS functions so that ports can share the code // as needed. It does not provide uname. @@ -107,6 +111,16 @@ mp_obj_t common_hal_os_getcwd(void) { return mp_vfs_getcwd(); } +mp_obj_t common_hal_os_getenv(const char *key, mp_obj_t default_) { + #if CIRCUITPY_DOTENV + mp_obj_t env_obj = common_hal_dotenv_get_key("/.env", key); + if (env_obj != mp_const_none) { + return env_obj; + } + #endif + return default_; +} + mp_obj_t common_hal_os_listdir(const char *path) { mp_obj_t path_out; mp_vfs_mount_t *vfs = lookup_dir_path(path, &path_out); diff --git a/shared-module/qrio/QRDecoder.c b/shared-module/qrio/QRDecoder.c index 26a609f215..f7b25362e4 100644 --- a/shared-module/qrio/QRDecoder.c +++ b/shared-module/qrio/QRDecoder.c @@ -104,6 +104,20 @@ mp_obj_t shared_module_qrio_qrdecoder_decode(qrdecoder_qrdecoder_obj_t *self, co uint8_t *src = bufinfo->buf; switch (policy) { + case QRIO_RGB565: { + uint16_t *src16 = bufinfo->buf; + for (int i = 0; i < width * height; i++) { + framebuffer[i] = (src16[i] >> 3) & 0xfc; + } + break; + } + case QRIO_RGB565_SWAPPED: { + uint16_t *src16 = bufinfo->buf; + for (int i = 0; i < width * height; i++) { + framebuffer[i] = (__builtin_bswap16(src16[i]) >> 3) & 0xfc; + } + break; + } case QRIO_EVERY_BYTE: memcpy(framebuffer, src, width * height); break; @@ -116,6 +130,7 @@ mp_obj_t shared_module_qrio_qrdecoder_decode(qrdecoder_qrdecoder_obj_t *self, co for (int i = 0; i < width * height; i++) { framebuffer[i] = src[2 * i]; } + break; } quirc_end(self->quirc); diff --git a/shared-module/rgbmatrix/RGBMatrix.c b/shared-module/rgbmatrix/RGBMatrix.c index 0bfed0aa6c..5e8f95b139 100644 --- a/shared-module/rgbmatrix/RGBMatrix.c +++ b/shared-module/rgbmatrix/RGBMatrix.c @@ -117,13 +117,13 @@ void common_hal_rgbmatrix_rgbmatrix_reconstruct(rgbmatrix_rgbmatrix_obj_t *self, common_hal_rgbmatrix_rgbmatrix_deinit(self); switch (stat) { case PROTOMATTER_ERR_PINS: - mp_raise_ValueError(translate("Invalid pin")); + raise_ValueError_invalid_pin(); break; case PROTOMATTER_ERR_ARG: - mp_raise_ValueError(translate("Invalid argument")); + mp_arg_error_invalid(MP_QSTR_args); break; case PROTOMATTER_ERR_MALLOC: - mp_raise_msg(&mp_type_MemoryError, NULL); + mp_raise_msg_varg(&mp_type_MemoryError, translate("Failed to allocate %q buffer"), MP_QSTR_RGBMatrix); break; default: mp_raise_msg_varg(&mp_type_RuntimeError, diff --git a/shared-module/storage/__init__.c b/shared-module/storage/__init__.c index e36d3ec21e..8806b7c8c6 100644 --- a/shared-module/storage/__init__.c +++ b/shared-module/storage/__init__.c @@ -38,6 +38,7 @@ #include "shared-bindings/storage/__init__.h" #include "supervisor/filesystem.h" #include "supervisor/flash.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/usb.h" #if CIRCUITPY_USB_MSC diff --git a/shared-module/struct/__init__.c b/shared-module/struct/__init__.c index a0abd16408..e87321ae79 100644 --- a/shared-module/struct/__init__.c +++ b/shared-module/struct/__init__.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "py/binary.h" #include "py/parsenum.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "shared-bindings/struct/__init__.h" STATIC void struct_validate_format(char fmt) { diff --git a/shared-module/supervisor/StatusBar.c b/shared-module/supervisor/StatusBar.c new file mode 100644 index 0000000000..0cc0552fcd --- /dev/null +++ b/shared-module/supervisor/StatusBar.c @@ -0,0 +1,89 @@ +/* + * 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. + */ + +#include +#include "py/obj.h" +#include "shared-bindings/supervisor/StatusBar.h" +#include "shared-bindings/supervisor/__init__.h" +#include "supervisor/shared/display.h" +#include "supervisor/shared/status_bar.h" + +#if CIRCUITPY_TERMINALIO +#include "shared-module/terminalio/Terminal.h" +#endif + +bool shared_module_supervisor_status_bar_get_console(supervisor_status_bar_obj_t *self) { + return self->console; +} + +void shared_module_supervisor_status_bar_set_console(supervisor_status_bar_obj_t *self, bool enabled) { + if (self->console == enabled) { + // Do nothing if not changing the state. + return; + } + + if (self->written) { + // Clear before changing state. If disabling, will remain cleared. + supervisor_status_bar_clear(); + } + + self->console = enabled; + + // Update may be ignored. + supervisor_status_bar_update(); +} + +bool shared_module_supervisor_status_bar_get_display(supervisor_status_bar_obj_t *self) { + return self->display; +} + +#if CIRCUITPY_TERMINALIO +void shared_module_supervisor_status_bar_set_display(supervisor_status_bar_obj_t *self, bool enabled) { + if (self->display == enabled) { + // Do nothing if not changing the state. + return; + } + + if (self->written) { + // Clear before changing state. If disabling, will remain cleared. + terminalio_terminal_clear_status_bar(&supervisor_terminal); + } + + self->display = enabled; + + // Update may be ignored. + supervisor_status_bar_update(); +} +#endif + +bool supervisor_status_bar_get_update_in_progress(supervisor_status_bar_obj_t *self) { + return self->update_in_progress; +} + +void supervisor_status_bar_set_update_in_progress(supervisor_status_bar_obj_t *self, bool update_in_progress) { + self->written = true; + self->update_in_progress = update_in_progress; +} diff --git a/shared-module/supervisor/StatusBar.h b/shared-module/supervisor/StatusBar.h new file mode 100644 index 0000000000..bc80d7825f --- /dev/null +++ b/shared-module/supervisor/StatusBar.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_SUPERVISOR_STATUS_BAR_H +#define MICROPY_INCLUDED_SHARED_MODULE_SUPERVISOR_STATUS_BAR_H + +#include "py/obj.h" + +typedef struct { + mp_obj_base_t base; + bool console; + bool display; + bool update_in_progress; + bool written; +} supervisor_status_bar_obj_t; + +extern bool supervisor_status_bar_get_update_in_progress(supervisor_status_bar_obj_t *self); +extern void supervisor_status_bar_set_update_in_progress(supervisor_status_bar_obj_t *self, bool in_progress); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_SUPERVISOR_STATUS_BAR_H diff --git a/shared-module/supervisor/__init__.c b/shared-module/supervisor/__init__.c new file mode 100644 index 0000000000..05e23e26e7 --- /dev/null +++ b/shared-module/supervisor/__init__.c @@ -0,0 +1,37 @@ +/* + * 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. + */ + +#include +#include "py/obj.h" +#include "shared-bindings/supervisor/StatusBar.h" +#include "shared-bindings/supervisor/__init__.h" + +// The singleton supervisor.StatusBar object, bound to supervisor.status_bar +supervisor_status_bar_obj_t shared_module_supervisor_status_bar_obj = { + .base = { + .type = &supervisor_status_bar_type, + }, +}; diff --git a/shared-module/synthio/MidiTrack.c b/shared-module/synthio/MidiTrack.c index b2693a0c59..f02747d734 100644 --- a/shared-module/synthio/MidiTrack.c +++ b/shared-module/synthio/MidiTrack.c @@ -32,13 +32,17 @@ #define BYTES_PER_SAMPLE (BITS_PER_SAMPLE / 8) #define SILENCE 0x80 +STATIC NORETURN void raise_midi_stream_error(uint32_t pos) { + mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), pos); +} + STATIC uint8_t parse_note(const uint8_t *buffer, uint32_t len, uint32_t *pos) { if (*pos + 1 >= len) { - mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), *pos); + raise_midi_stream_error(*pos); } uint8_t note = buffer[(*pos)++]; if (note > 127 || buffer[(*pos)++] > 127) { - mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), *pos); + raise_midi_stream_error(*pos); } return note; } @@ -84,7 +88,7 @@ void common_hal_synthio_miditrack_construct(synthio_miditrack_obj_t *self, } while ((c & 0x80) && (pos < len)); if (c & 0x80) { - mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), pos); + raise_midi_stream_error(pos); } dur += delta * sample_rate / tempo; @@ -128,14 +132,14 @@ void common_hal_synthio_miditrack_construct(synthio_miditrack_obj_t *self, case 12: case 13: // one data byte to ignore if (pos >= len || buffer[pos++] > 127) { - mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), pos); + raise_midi_stream_error(pos); } break; case 15: // the full syntax is too complicated, just assume it's "End of Track" event pos = len; break; default: // invalid event - mp_raise_ValueError_varg(translate("Error in MIDI stream at position %d"), pos); + raise_midi_stream_error(pos); } } terminate_span(self, &dur, &max_dur); diff --git a/shared-module/terminalio/Terminal.c b/shared-module/terminalio/Terminal.c index fc33533b17..b49f48c4e6 100644 --- a/shared-module/terminalio/Terminal.c +++ b/shared-module/terminalio/Terminal.c @@ -30,36 +30,88 @@ #include "shared-bindings/displayio/TileGrid.h" #include "shared-bindings/terminalio/Terminal.h" -void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self, displayio_tilegrid_t *tilegrid, const fontio_builtinfont_t *font) { +#if CIRCUITPY_STATUS_BAR +#include "shared-bindings/supervisor/__init__.h" +#include "shared-bindings/supervisor/StatusBar.h" +#endif + +void terminalio_terminal_clear_status_bar(terminalio_terminal_obj_t *self) { + if (self->status_bar) { + common_hal_displayio_tilegrid_set_all_tiles(self->status_bar, 0); + } +} + +void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self, + displayio_tilegrid_t *scroll_area, const fontio_builtinfont_t *font, + displayio_tilegrid_t *status_bar) { self->cursor_x = 0; self->cursor_y = 0; self->font = font; - self->tilegrid = tilegrid; + self->scroll_area = scroll_area; + self->status_bar = status_bar; + self->status_x = 0; + self->status_y = 0; self->first_row = 0; - for (uint16_t x = 0; x < self->tilegrid->width_in_tiles; x++) { - for (uint16_t y = 0; y < self->tilegrid->height_in_tiles; y++) { - common_hal_displayio_tilegrid_set_tile(self->tilegrid, x, y, 0); - } + common_hal_displayio_tilegrid_set_all_tiles(self->scroll_area, 0); + if (self->status_bar) { + common_hal_displayio_tilegrid_set_all_tiles(self->status_bar, 0); } - common_hal_displayio_tilegrid_set_top_left(self->tilegrid, 0, 1); + common_hal_displayio_tilegrid_set_top_left(self->scroll_area, 0, 1); } size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, const byte *data, size_t len, int *errcode) { // Make sure the terminal is initialized before we do anything with it. - if (self->tilegrid == NULL) { + if (self->scroll_area == NULL) { return len; } + + #if CIRCUITPY_STATUS_BAR + // Skip the status bar OSC sequence if it's disabled for the display. + const bool status_bar_write_ok = + shared_module_supervisor_status_bar_get_display(&shared_module_supervisor_status_bar_obj) || + !supervisor_status_bar_get_update_in_progress(&shared_module_supervisor_status_bar_obj); + #endif + const byte *i = data; uint16_t start_y = self->cursor_y; while (i < data + len) { unichar c = utf8_get_char(i); i = utf8_next_char(i); + if (self->in_osc_command) { + if (c == 0x1b && i[0] == '\\') { + self->in_osc_command = false; + self->status_x = 0; + self->status_y = 0; + i += 1; + } else if ( + #if CIRCUITPY_STATUS_BAR + status_bar_write_ok && + #endif + self->osc_command == 0 && + self->status_bar != NULL && + self->status_y < self->status_bar->height_in_tiles) { + uint8_t tile_index = fontio_builtinfont_get_glyph_index(self->font, c); + if (tile_index != 0xff) { + // Clear the tile grid before we start putting new info. + if (self->status_x == 0 && self->status_y == 0) { + common_hal_displayio_tilegrid_set_all_tiles(self->status_bar, 0); + } + common_hal_displayio_tilegrid_set_tile(self->status_bar, self->status_x, self->status_y, tile_index); + self->status_x++; + if (self->status_x >= self->status_bar->width_in_tiles) { + self->status_y++; + self->status_x %= self->status_bar->width_in_tiles; + } + } + } + continue; + } // Always handle ASCII. if (c < 128) { if (c >= 0x20 && c <= 0x7e) { uint8_t tile_index = fontio_builtinfont_get_glyph_index(self->font, c); - common_hal_displayio_tilegrid_set_tile(self->tilegrid, self->cursor_x, self->cursor_y, tile_index); + common_hal_displayio_tilegrid_set_tile(self->scroll_area, self->cursor_x, self->cursor_y, tile_index); self->cursor_x++; } else if (c == '\r') { self->cursor_x = 0; @@ -71,25 +123,25 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con self->cursor_x--; } } else if (c == 0x1b) { + // Handle commands of the form [ESC]. where . is not yet known. + uint16_t n = 0; + uint8_t j = 1; + for (; j < 6; j++) { + if ('0' <= i[j] && i[j] <= '9') { + n = n * 10 + (i[j] - '0'); + } else { + c = i[j]; + break; + } + } if (i[0] == '[') { if (i[1] == 'K') { // Clear the rest of the line. - for (uint16_t j = self->cursor_x; j < self->tilegrid->width_in_tiles; j++) { - common_hal_displayio_tilegrid_set_tile(self->tilegrid, j, self->cursor_y, 0); + for (uint16_t k = self->cursor_x; k < self->scroll_area->width_in_tiles; k++) { + common_hal_displayio_tilegrid_set_tile(self->scroll_area, k, self->cursor_y, 0); } i += 2; } else { - // Handle commands of the form \x1b[####D - uint16_t n = 0; - uint8_t j = 1; - for (; j < 6; j++) { - if ('0' <= i[j] && i[j] <= '9') { - n = n * 10 + (i[j] - '0'); - } else { - c = i[j]; - break; - } - } if (c == 'D') { if (n > self->cursor_x) { self->cursor_x = 0; @@ -99,14 +151,10 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con } if (c == 'J') { if (n == 2) { - common_hal_displayio_tilegrid_set_top_left(self->tilegrid, 0, 0); + common_hal_displayio_tilegrid_set_top_left(self->scroll_area, 0, 0); self->cursor_x = self->cursor_y = start_y = 0; n = 0; - for (uint16_t x = 0; x < self->tilegrid->width_in_tiles; x++) { - for (uint16_t y = 0; y < self->tilegrid->height_in_tiles; y++) { - common_hal_displayio_tilegrid_set_tile(self->tilegrid, x, y, 0); - } - } + common_hal_displayio_tilegrid_set_all_tiles(self->scroll_area, 0); } } if (c == ';') { @@ -126,13 +174,13 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con if (m > 0) { m--; } - if (n >= self->tilegrid->height_in_tiles) { - n = self->tilegrid->height_in_tiles - 1; + if (n >= self->scroll_area->height_in_tiles) { + n = self->scroll_area->height_in_tiles - 1; } - if (m >= self->tilegrid->width_in_tiles) { - m = self->tilegrid->width_in_tiles - 1; + if (m >= self->scroll_area->width_in_tiles) { + m = self->scroll_area->width_in_tiles - 1; } - n = (n + self->tilegrid->top_left_y) % self->tilegrid->height_in_tiles; + n = (n + self->scroll_area->top_left_y) % self->scroll_area->height_in_tiles; self->cursor_x = m; self->cursor_y = n; start_y = self->cursor_y; @@ -141,30 +189,34 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con i += j + 1; continue; } + } else if (i[0] == ']' && c == ';') { + self->in_osc_command = true; + self->osc_command = n; + i += j + 1; } } } else { uint8_t tile_index = fontio_builtinfont_get_glyph_index(self->font, c); if (tile_index != 0xff) { - common_hal_displayio_tilegrid_set_tile(self->tilegrid, self->cursor_x, self->cursor_y, tile_index); + common_hal_displayio_tilegrid_set_tile(self->scroll_area, self->cursor_x, self->cursor_y, tile_index); self->cursor_x++; } } - if (self->cursor_x >= self->tilegrid->width_in_tiles) { + if (self->cursor_x >= self->scroll_area->width_in_tiles) { self->cursor_y++; - self->cursor_x %= self->tilegrid->width_in_tiles; + self->cursor_x %= self->scroll_area->width_in_tiles; } - if (self->cursor_y >= self->tilegrid->height_in_tiles) { - self->cursor_y %= self->tilegrid->height_in_tiles; + if (self->cursor_y >= self->scroll_area->height_in_tiles) { + self->cursor_y %= self->scroll_area->height_in_tiles; } if (self->cursor_y != start_y) { // clear the new row in case of scroll up - if (self->cursor_y == self->tilegrid->top_left_y) { - for (uint16_t j = 0; j < self->tilegrid->width_in_tiles; j++) { - common_hal_displayio_tilegrid_set_tile(self->tilegrid, j, self->cursor_y, 0); + if (self->cursor_y == self->scroll_area->top_left_y) { + for (uint16_t j = 0; j < self->scroll_area->width_in_tiles; j++) { + common_hal_displayio_tilegrid_set_tile(self->scroll_area, j, self->cursor_y, 0); } - common_hal_displayio_tilegrid_set_top_left(self->tilegrid, 0, (self->cursor_y + self->tilegrid->height_in_tiles + 1) % self->tilegrid->height_in_tiles); + common_hal_displayio_tilegrid_set_top_left(self->scroll_area, 0, (self->cursor_y + self->scroll_area->height_in_tiles + 1) % self->scroll_area->height_in_tiles); } start_y = self->cursor_y; } @@ -173,5 +225,5 @@ size_t common_hal_terminalio_terminal_write(terminalio_terminal_obj_t *self, con } bool common_hal_terminalio_terminal_ready_to_tx(terminalio_terminal_obj_t *self) { - return self->tilegrid != NULL; + return self->scroll_area != NULL; } diff --git a/shared-module/terminalio/Terminal.h b/shared-module/terminalio/Terminal.h index 2ba7e21f72..7f0545c6be 100644 --- a/shared-module/terminalio/Terminal.h +++ b/shared-module/terminalio/Terminal.h @@ -39,8 +39,15 @@ typedef struct { const fontio_builtinfont_t *font; uint16_t cursor_x; uint16_t cursor_y; - displayio_tilegrid_t *tilegrid; + displayio_tilegrid_t *scroll_area; + displayio_tilegrid_t *status_bar; + uint16_t status_x; + uint16_t status_y; uint16_t first_row; + uint16_t osc_command; + bool in_osc_command; } terminalio_terminal_obj_t; +extern void terminalio_terminal_clear_status_bar(terminalio_terminal_obj_t *self); + #endif /* SHARED_MODULE_TERMINALIO_TERMINAL_H */ diff --git a/shared-module/touchio/TouchIn.c b/shared-module/touchio/TouchIn.c index 840c14571d..35dd56a6e4 100644 --- a/shared-module/touchio/TouchIn.c +++ b/shared-module/touchio/TouchIn.c @@ -78,6 +78,7 @@ void common_hal_touchio_touchin_construct(touchio_touchin_obj_t *self, const mcu uint16_t raw_reading = get_raw_reading(self); if (raw_reading == TIMEOUT_TICKS) { + common_hal_touchio_touchin_deinit(self); mp_raise_ValueError(translate("No pulldown on pin; 1Mohm recommended")); } self->threshold = raw_reading * 1.05 + 100; diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index 8a0c429f84..680bb83893 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#include #include #include "py/gc.h" @@ -31,7 +32,7 @@ #include "shared-bindings/usb_hid/Device.h" #include "shared-module/usb_hid/__init__.h" #include "shared-module/usb_hid/Device.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/tick.h" #include "tusb.h" @@ -181,16 +182,14 @@ uint8_t common_hal_usb_hid_device_validate_report_id(usb_hid_device_obj_t *self, } if (!(report_id_arg >= 0 && get_report_id_idx(self, (size_t)report_id_arg) < CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR)) { - mp_raise_ValueError_varg(translate("Invalid %q"), MP_QSTR_report_id); + mp_arg_error_invalid(MP_QSTR_report_id); } return (uint8_t)report_id_arg; } void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t report_descriptor, uint16_t usage_page, uint16_t usage, size_t num_report_ids, uint8_t *report_ids, uint8_t *in_report_lengths, uint8_t *out_report_lengths) { - if (num_report_ids > CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR) { - mp_raise_ValueError_varg(translate("More than %d report ids not supported"), - CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR); - } + mp_arg_validate_length_max( + num_report_ids, CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR, MP_QSTR_report_ids); // report buffer pointers are NULL at start, and are created when USB is initialized. mp_buffer_info_t bufinfo; @@ -223,10 +222,7 @@ void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t * // report_id and len have already been validated for this device. size_t id_idx = get_report_id_idx(self, report_id); - if (len != self->in_report_lengths[id_idx]) { - mp_raise_ValueError_varg(translate("Buffer incorrect size. Should be %d bytes."), - self->in_report_lengths[id_idx]); - } + mp_arg_validate_length(len, self->in_report_lengths[id_idx], MP_QSTR_report); // Wait until interface is ready, timeout = 2 seconds uint64_t end_ticks = supervisor_ticks_ms64() + 2000; @@ -235,7 +231,7 @@ void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t * } if (!tud_hid_ready()) { - mp_raise_msg(&mp_type_OSError, translate("USB busy")); + mp_raise_msg(&mp_type_OSError, translate("USB busy")); } if (!tud_hid_report(report_id, report, len)) { @@ -246,6 +242,10 @@ void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t * mp_obj_t common_hal_usb_hid_device_get_last_received_report(usb_hid_device_obj_t *self, uint8_t report_id) { // report_id has already been validated for this device. size_t id_idx = get_report_id_idx(self, report_id); + if (!self->out_report_buffers_updated[id_idx]) { + return mp_const_none; + } + self->out_report_buffers_updated[id_idx] = false; return mp_obj_new_bytes(self->out_report_buffers[id_idx], self->out_report_lengths[id_idx]); } @@ -263,6 +263,7 @@ void usb_hid_device_create_report_buffers(usb_hid_device_obj_t *self) { ? gc_alloc(self->out_report_lengths[i], false, true /*long-lived*/) : NULL; } + memset(self->out_report_buffers_updated, 0, sizeof(self->out_report_buffers_updated)); } @@ -309,6 +310,7 @@ void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t rep 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; } } } diff --git a/shared-module/usb_hid/Device.h b/shared-module/usb_hid/Device.h index f265712be4..06729f3c7d 100644 --- a/shared-module/usb_hid/Device.h +++ b/shared-module/usb_hid/Device.h @@ -38,6 +38,7 @@ typedef struct { const uint8_t *report_descriptor; uint8_t *in_report_buffers[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR]; uint8_t *out_report_buffers[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR]; + uint8_t out_report_buffers_updated[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR]; uint16_t report_descriptor_length; uint8_t report_ids[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR]; uint8_t in_report_lengths[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR]; diff --git a/shared-module/usb_hid/__init__.c b/shared-module/usb_hid/__init__.c index 89a05c77b3..99be84542f 100644 --- a/shared-module/usb_hid/__init__.c +++ b/shared-module/usb_hid/__init__.c @@ -33,6 +33,7 @@ #include "shared-bindings/usb_hid/__init__.h" #include "shared-bindings/usb_hid/Device.h" #include "supervisor/memory.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/usb.h" static const uint8_t usb_hid_descriptor_template[] = { diff --git a/shared-module/usb_midi/PortIn.c b/shared-module/usb_midi/PortIn.c index b16b77cf97..a5c73aa256 100644 --- a/shared-module/usb_midi/PortIn.c +++ b/shared-module/usb_midi/PortIn.c @@ -26,7 +26,7 @@ #include "shared-bindings/usb_midi/PortIn.h" #include "shared-module/usb_midi/PortIn.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "tusb.h" size_t common_hal_usb_midi_portin_read(usb_midi_portin_obj_t *self, uint8_t *data, size_t len, int *errcode) { diff --git a/shared-module/usb_midi/PortOut.c b/shared-module/usb_midi/PortOut.c index 4005d8b77d..c9d229635e 100644 --- a/shared-module/usb_midi/PortOut.c +++ b/shared-module/usb_midi/PortOut.c @@ -26,7 +26,7 @@ #include "shared-bindings/usb_midi/PortOut.h" #include "shared-module/usb_midi/PortOut.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "tusb.h" size_t common_hal_usb_midi_portout_write(usb_midi_portout_obj_t *self, const uint8_t *data, size_t len, int *errcode) { diff --git a/shared-module/usb_midi/__init__.c b/shared-module/usb_midi/__init__.c index 8cac2ba8af..ed1b8a0518 100644 --- a/shared-module/usb_midi/__init__.c +++ b/shared-module/usb_midi/__init__.c @@ -34,6 +34,7 @@ #include "shared-bindings/usb_midi/PortIn.h" #include "shared-bindings/usb_midi/PortOut.h" #include "supervisor/memory.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/usb.h" #include "tusb.h" diff --git a/shared-module/vectorio/Circle.c b/shared-module/vectorio/Circle.c index 2ec11fe1bb..ee83ad18b9 100644 --- a/shared-module/vectorio/Circle.c +++ b/shared-module/vectorio/Circle.c @@ -15,7 +15,7 @@ void common_hal_vectorio_circle_construct(vectorio_circle_t *self, uint16_t radi void common_hal_vectorio_circle_set_on_dirty(vectorio_circle_t *self, vectorio_event_t on_dirty) { if (self->on_dirty.obj != NULL) { - mp_raise_TypeError(translate("circle can only be registered in one parent")); + mp_raise_TypeError(translate("can only have one parent")); } self->on_dirty = on_dirty; } diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index 10ebdf1edd..24eb1c501d 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -40,9 +40,8 @@ static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple mp_obj_t *tuple_items; mp_obj_tuple_get(items[i], &tuple_len, &tuple_items); - if (tuple_len != 2) { - mp_raise_ValueError_varg(translate("%q must be a tuple of length 2"), MP_QSTR_point); - } + mp_arg_validate_length(tuple_len, 2, MP_QSTR_point); + mp_int_t x; mp_int_t y; if (!mp_obj_get_int_maybe(tuple_items[ 0 ], &x) @@ -103,7 +102,7 @@ void common_hal_vectorio_polygon_set_points(vectorio_polygon_t *self, mp_obj_t p void common_hal_vectorio_polygon_set_on_dirty(vectorio_polygon_t *self, vectorio_event_t notification) { if (self->on_dirty.obj != NULL) { - mp_raise_TypeError(translate("polygon can only be registered in one parent")); + mp_raise_TypeError(translate("can only have one parent")); } self->on_dirty = notification; } diff --git a/shared-module/vectorio/Rectangle.c b/shared-module/vectorio/Rectangle.c index fbd3d6bdf5..4c2bdc66cb 100644 --- a/shared-module/vectorio/Rectangle.c +++ b/shared-module/vectorio/Rectangle.c @@ -14,7 +14,7 @@ void common_hal_vectorio_rectangle_construct(vectorio_rectangle_t *self, uint32_ void common_hal_vectorio_rectangle_set_on_dirty(vectorio_rectangle_t *self, vectorio_event_t on_dirty) { if (self->on_dirty.obj != NULL) { - mp_raise_TypeError(translate("can only be registered in one parent")); + mp_raise_TypeError(translate("can only have one parent")); } self->on_dirty = on_dirty; } diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index 04213d36e7..f72cd5cc97 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -63,9 +63,7 @@ (u32 & 0x1 ? '1' : '0') static void short_bound_check(mp_int_t i, qstr name) { - if (i < SHRT_MIN || i > SHRT_MAX) { - mp_raise_ValueError_varg(translate("%q must be between %d and %d"), name, SHRT_MIN, SHRT_MAX); - } + mp_arg_validate_int_range(i, SHRT_MIN, SHRT_MAX, name); } inline __attribute__((always_inline)) @@ -277,9 +275,7 @@ void common_hal_vectorio_vector_shape_set_location(vectorio_vector_shape_t *self size_t tuple_len = 0; mp_obj_t *tuple_items; mp_obj_tuple_get(xy, &tuple_len, &tuple_items); - if (tuple_len != 2) { - mp_raise_TypeError(translate("(x,y) integers required")); - } + mp_arg_validate_length(tuple_len, 2, MP_QSTR_location); mp_int_t x; mp_int_t y; diff --git a/shared-module/zlib/__init__.c b/shared-module/zlib/__init__.c new file mode 100644 index 0000000000..a057e6e2f7 --- /dev/null +++ b/shared-module/zlib/__init__.c @@ -0,0 +1,100 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Mark Komus + * + * 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 + +#include "py/obj.h" +#include "py/runtime.h" +#include "py/stream.h" +#include "py/mperrno.h" +#include "py/builtin.h" +#include "py/objtuple.h" +#include "py/binary.h" +#include "py/parsenum.h" + +#include "shared-bindings/zlib/__init__.h" + +#define UZLIB_CONF_PARANOID_CHECKS (1) +#include "lib/uzlib/tinf.h" + +#if 0 // print debugging info +#define DEBUG_printf DEBUG_printf +#else // don't print debugging info +#define DEBUG_printf(...) (void)0 +#endif + +mp_obj_t common_hal_zlib_decompress(mp_obj_t data, bool is_zlib) { + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(data, &bufinfo, MP_BUFFER_READ); + + TINF_DATA *decomp = m_new_obj(TINF_DATA); + memset(decomp, 0, sizeof(*decomp)); + DEBUG_printf("sizeof(TINF_DATA)=" UINT_FMT "\n", sizeof(*decomp)); + uzlib_uncompress_init(decomp, NULL, 0); + mp_uint_t dest_buf_size = (bufinfo.len + 15) & ~15; + byte *dest_buf = m_new(byte, dest_buf_size); + + decomp->dest = dest_buf; + decomp->dest_limit = dest_buf + dest_buf_size; + DEBUG_printf("zlib: Initial out buffer: " UINT_FMT " bytes\n", decomp->destSize); + decomp->source = bufinfo.buf; + decomp->source_limit = (unsigned char *)bufinfo.buf + bufinfo.len; + int st; + + if (is_zlib) { + st = uzlib_zlib_parse_header(decomp); + if (st < 0) { + goto error; + } + } + + while (1) { + st = uzlib_uncompress_chksum(decomp); + if (st < 0) { + goto error; + } + if (st == TINF_DONE) { + break; + } + size_t offset = decomp->dest - dest_buf; + dest_buf = m_renew(byte, dest_buf, dest_buf_size, dest_buf_size + 256); + dest_buf_size += 256; + decomp->dest = dest_buf + offset; + decomp->dest_limit = dest_buf + offset + 256; + } + + mp_uint_t final_sz = decomp->dest - dest_buf; + DEBUG_printf("zlib: Resizing from " UINT_FMT " to final size: " UINT_FMT " bytes\n", dest_buf_size, final_sz); + dest_buf = (byte *)m_renew(byte, dest_buf, dest_buf_size, final_sz); + mp_obj_t res = mp_obj_new_bytearray_by_ref(final_sz, dest_buf); + m_del_obj(TINF_DATA, decomp); + return res; + +error: + mp_raise_type_arg(&mp_type_ValueError, MP_OBJ_NEW_SMALL_INT(st)); +} diff --git a/shared/libc/abort_.c b/shared/libc/abort_.c index 45a2e0dedd..0c1d860aef 100644 --- a/shared/libc/abort_.c +++ b/shared/libc/abort_.c @@ -1,6 +1,6 @@ #include -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" NORETURN void abort_(void); diff --git a/shared/netutils/netutils.c b/shared/netutils/netutils.c index fe92e8bafb..030b1535cd 100644 --- a/shared/netutils/netutils.c +++ b/shared/netutils/netutils.c @@ -31,7 +31,7 @@ #include "py/runtime.h" #include "shared/netutils/netutils.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" // Takes an array with a raw IPv4 address and returns something like '192.168.0.1'. mp_obj_t netutils_format_ipv4_addr(uint8_t *ip, netutils_endian_t endian) { diff --git a/shared/readline/readline.c b/shared/readline/readline.c index 23183342a7..d8602a9e28 100644 --- a/shared/readline/readline.c +++ b/shared/readline/readline.c @@ -177,6 +177,17 @@ int readline_process_char(int c) { vstr_cut_tail_bytes(rl.line, rl.line->len - rl.cursor_pos); // set redraw parameters redraw_from_cursor = true; + #endif + } else if (c == CHAR_CTRL_L) { + // CTRL-L is clear screen / redraw. This specific sequence is used + // (instead of a slightly more minimal sequence) for compatibility + // with the built-in Terminal class + mp_hal_stdout_tx_str("\x1b[;H\x1b[2J"); + mp_hal_stdout_tx_str(rl.prompt); + mp_hal_stdout_tx_strn(rl.line->buf + rl.orig_line_len, rl.cursor_pos - rl.orig_line_len); + // set redraw parameters + redraw_from_cursor = true; + #if MICROPY_REPL_EMACS_KEYS } else if (c == CHAR_CTRL_N) { // CTRL-N is go to next line in history goto down_arrow_key; diff --git a/shared/readline/readline.h b/shared/readline/readline.h index 4658ee19e8..9af19b181e 100644 --- a/shared/readline/readline.h +++ b/shared/readline/readline.h @@ -35,6 +35,7 @@ #define CHAR_CTRL_E (5) #define CHAR_CTRL_F (6) #define CHAR_CTRL_K (11) +#define CHAR_CTRL_L (12) #define CHAR_CTRL_N (14) #define CHAR_CTRL_P (16) #define CHAR_CTRL_U (21) diff --git a/shared/runtime/pyexec.c b/shared/runtime/pyexec.c index b1f94db5e5..87219d18f5 100644 --- a/shared/runtime/pyexec.c +++ b/shared/runtime/pyexec.c @@ -168,17 +168,21 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input } // check for SystemExit - if (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(mp_obj_get_type((mp_obj_t)nlr.ret_val)), MP_OBJ_FROM_PTR(&mp_type_SystemExit))) { + + // nlr.ret_val is an exception object. + mp_obj_t exception_obj = (mp_obj_t)nlr.ret_val; + + if (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(mp_obj_get_type(exception_obj)), MP_OBJ_FROM_PTR(&mp_type_SystemExit))) { // at the moment, the value of SystemExit is unused ret = pyexec_system_exit; #if CIRCUITPY_ALARM - } else if (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(mp_obj_get_type((mp_obj_t)nlr.ret_val)), &mp_type_DeepSleepRequest)) { + } else if (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(mp_obj_get_type(exception_obj)), MP_OBJ_FROM_PTR(&mp_type_DeepSleepRequest))) { ret = PYEXEC_DEEP_SLEEP; #endif - } else if ((mp_obj_t)nlr.ret_val == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { + } else if (exception_obj == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_reload_exception))) { ret = PYEXEC_RELOAD; } else { - mp_obj_print_exception(&mp_plat_print, MP_OBJ_FROM_PTR(nlr.ret_val)); + mp_obj_print_exception(&mp_plat_print, exception_obj); ret = PYEXEC_EXCEPTION; } @@ -199,7 +203,9 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input size_t n, *values; mp_obj_exception_get_traceback(return_value, &n, &values); if (values != NULL) { - result->exception_line = values[n - 2]; + result->exception_line = values[1]; + result->exception_filename[sizeof(result->exception_filename) - 1] = '\0'; + strncpy(result->exception_filename, qstr_str(values[0]), sizeof(result->exception_filename) - 1); } } } diff --git a/shared/runtime/pyexec.h b/shared/runtime/pyexec.h index d31a7fe816..411426eaaa 100644 --- a/shared/runtime/pyexec.h +++ b/shared/runtime/pyexec.h @@ -37,6 +37,9 @@ typedef struct { int return_code; mp_obj_t exception; int exception_line; + // Only store the first 32 characters of the filename. It is very unlikely that they can all be + // seen. + char exception_filename[33]; } pyexec_result_t; extern pyexec_mode_kind_t pyexec_mode_kind; diff --git a/supervisor/board.h b/supervisor/board.h index 605c16f5dc..e3f0af79a3 100644 --- a/supervisor/board.h +++ b/supervisor/board.h @@ -47,5 +47,4 @@ void reset_board(void); // disabling USB, BLE or flash) because CircuitPython may continue to run. void board_deinit(void); - #endif // MICROPY_INCLUDED_SUPERVISOR_BOARD_H diff --git a/supervisor/filesystem.h b/supervisor/filesystem.h index 6f4faf0b82..3954291513 100644 --- a/supervisor/filesystem.h +++ b/supervisor/filesystem.h @@ -45,4 +45,6 @@ void filesystem_set_concurrent_write_protection(fs_user_mount_t *vfs, bool concu bool filesystem_is_writable_by_python(fs_user_mount_t *vfs); bool filesystem_is_writable_by_usb(fs_user_mount_t *vfs); +FATFS *filesystem_circuitpy(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_FILESYSTEM_H diff --git a/supervisor/port.h b/supervisor/port.h index 0a8cdfd342..554baca2a4 100644 --- a/supervisor/port.h +++ b/supervisor/port.h @@ -99,8 +99,25 @@ void port_background_task(void); void port_start_background_task(void); void port_finish_background_task(void); -// Some ports need special handling to wake the main task from an interrupt -// context or other task. The port must implement the necessary code in this -// function. A default weak implementation is provided that does nothing. +// Some ports need special handling to wake the main task from another task. The +// port must implement the necessary code in this function. A default weak +// implementation is provided that does nothing. void port_wake_main_task(void); + +// Some ports need special handling to wake the main task from an interrupt +// context. The port must implement the necessary code in this function. A +// default weak implementation is provided that does nothing. +void port_wake_main_task_from_isr(void); + +// Some ports may use real RTOS tasks besides the background task framework of +// CircuitPython. Calling this will yield to other tasks and then return to the +// CircuitPython task when others are done. +void port_yield(void); + +// Some ports need special handling just after completing boot.py execution. +// This function is called once while boot.py's VM is still valid, and +// then a second time after the VM is finalized. +// A default weak implementation is provided that does nothing. +void port_post_boot_py(bool heap_valid); + #endif // MICROPY_INCLUDED_SUPERVISOR_PORT_H diff --git a/supervisor/serial.h b/supervisor/serial.h index a6646e9542..997a2bc38f 100644 --- a/supervisor/serial.h +++ b/supervisor/serial.h @@ -51,12 +51,13 @@ bool serial_connected(void); // These have no-op versions that are weak and the port can override. They work // in tandem with the cross-port mechanics like USB and BLE. +void port_serial_early_init(void); void port_serial_init(void); bool port_serial_connected(void); char port_serial_read(void); bool port_serial_bytes_available(void); void port_serial_write_substring(const char *text, uint32_t length); -int debug_uart_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); +int console_uart_printf(const char *fmt, ...) __attribute__((format(printf, 1, 2))); #endif // MICROPY_INCLUDED_SUPERVISOR_SERIAL_H diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index e53edb506f..88ffc15911 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -111,16 +111,28 @@ void background_callback_end_critical_section() { CALLBACK_CRITICAL_END; } + +// Filter out queued callbacks if they are allocated on the heap. void background_callback_reset() { + background_callback_t *new_head = NULL; + background_callback_t **previous_next = &new_head; + background_callback_t *new_tail = NULL; CALLBACK_CRITICAL_BEGIN; background_callback_t *cb = (background_callback_t *)callback_head; while (cb) { background_callback_t *next = cb->next; - memset(cb, 0, sizeof(*cb)); + if (!HEAP_PTR((void *)cb)) { + *previous_next = cb; + previous_next = &cb->next; + cb->next = NULL; + new_tail = cb; + } else { + memset(cb, 0, sizeof(*cb)); + } cb = next; } - callback_head = NULL; - callback_tail = NULL; + callback_head = new_head; + callback_tail = new_tail; in_background_callback = false; CALLBACK_CRITICAL_END; } diff --git a/supervisor/shared/bluetooth/bluetooth.c b/supervisor/shared/bluetooth/bluetooth.c index 426aad9891..472d2fa7d5 100644 --- a/supervisor/shared/bluetooth/bluetooth.c +++ b/supervisor/shared/bluetooth/bluetooth.c @@ -39,8 +39,10 @@ #include "common-hal/_bleio/__init__.h" +#include "supervisor/serial.h" #include "supervisor/shared/status_leds.h" #include "supervisor/shared/tick.h" +#include "supervisor/shared/translate/translate.h" #include "py/mpstate.h" @@ -54,6 +56,10 @@ #include "bluetooth/ble_drv.h" #endif +#if CIRCUITPY_STATUS_BAR +#include "supervisor/shared/status_bar.h" +#endif + // This standard advertisement advertises the CircuitPython editing service and a CIRCUITPY short name. const uint8_t public_advertising_data[] = { 0x02, 0x01, 0x06, // 0-2 Flags 0x02, 0x0a, 0xec, // 3-5 TX power level -20 @@ -75,18 +81,13 @@ const uint8_t public_advertising_data[] = { 0x02, 0x01, 0x06, // 0-2 Flags const uint8_t private_advertising_data[] = { 0x02, 0x01, 0x06, // 0-2 Flags 0x02, 0x0a, 0x00 // 3-5 TX power level 0 }; -// This scan response advertises the full CIRCPYXXXX device name. -uint8_t circuitpython_scan_response_data[] = { - 0x0a, 0x09, 0x43, 0x49, 0x52, 0x50, 0x59, 0x00, 0x00, 0x00, 0x00, - #if CIRCUITPY_SERIAL_BLE - 0x11, 0x06, 0x6e, 0x68, 0x74, 0x79, 0x50, 0x74, 0x69, 0x75, 0x63, 0x72, 0x69, 0x43, 0x01, 0x00, 0xaf, 0xad - #endif -}; - +// This scan response advertises the full device name (if it fits.) +uint8_t circuitpython_scan_response_data[31]; #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE STATIC bool boot_in_discovery_mode = false; STATIC bool advertising = false; +STATIC bool _private_advertising = false; STATIC bool ble_started = false; #define WORKFLOW_UNSET 0 @@ -96,6 +97,42 @@ STATIC bool ble_started = false; STATIC uint8_t workflow_state = WORKFLOW_UNSET; STATIC bool was_connected = false; +#if CIRCUITPY_STATUS_BAR +// To detect when the title bar changes. +STATIC bool _last_connected = false; +STATIC bool _last_advertising = false; +#endif + +#if CIRCUITPY_STATUS_BAR +// Title bar status +bool supervisor_bluetooth_status_dirty(void) { + return _last_advertising != advertising || + _last_connected != was_connected; +} +#endif + +#if CIRCUITPY_STATUS_BAR +void supervisor_bluetooth_status(void) { + serial_write("BLE:"); + if (advertising) { + if (_private_advertising) { + serial_write_compressed(translate("Reconnecting")); + } else { + const char *name = (char *)circuitpython_scan_response_data + 2; + int len = MIN(strlen(name), sizeof(circuitpython_scan_response_data) - 2); + serial_write_substring(name, len); + } + } else if (was_connected) { + serial_write_compressed(translate("Ok")); + } else { + serial_write_compressed(translate("Off")); + } + + _last_connected = was_connected; + _last_advertising = advertising; +} +#endif + STATIC void supervisor_bluetooth_start_advertising(void) { if (workflow_state != WORKFLOW_ENABLED) { return; @@ -118,6 +155,7 @@ STATIC void supervisor_bluetooth_start_advertising(void) { size_t adv_len = sizeof(private_advertising_data); const uint8_t *scan_response = NULL; size_t scan_response_len = 0; + _private_advertising = true; // Advertise with less power when doing so publicly to reduce who can hear us. This will make it // harder for someone with bad intentions to pair from a distance. if (!bonded) { @@ -126,6 +164,18 @@ STATIC void supervisor_bluetooth_start_advertising(void) { adv_len = sizeof(public_advertising_data); scan_response = circuitpython_scan_response_data; scan_response_len = sizeof(circuitpython_scan_response_data); + uint16_t max_name_len = sizeof(circuitpython_scan_response_data) - 2; + uint16_t name_len = bleio_adapter_get_name((char *)circuitpython_scan_response_data + 2, + max_name_len); + if (name_len > max_name_len) { + circuitpython_scan_response_data[0] = max_name_len + 1; + circuitpython_scan_response_data[1] = 0x8; + } else { + circuitpython_scan_response_data[0] = name_len + 1; + circuitpython_scan_response_data[1] = 0x9; + } + scan_response_len = circuitpython_scan_response_data[0] + 1; + _private_advertising = false; } uint32_t status = _common_hal_bleio_adapter_start_advertising(&common_hal_bleio_adapter_obj, true, @@ -232,10 +282,19 @@ void supervisor_bluetooth_background(void) { supervisor_bluetooth_file_transfer_disconnected(); #endif } + + #if CIRCUITPY_STATUS_BAR + if (was_connected != is_connected) { + supervisor_status_bar_request_update(false); + } + #endif + was_connected = is_connected; if (!is_connected) { supervisor_bluetooth_start_advertising(); return; + } else { + advertising = false; } #if CIRCUITPY_BLE_FILE_SERVICE @@ -247,7 +306,7 @@ void supervisor_bluetooth_background(void) { void supervisor_start_bluetooth(void) { #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE - if (workflow_state != WORKFLOW_ENABLED) { + if (workflow_state != WORKFLOW_ENABLED || ble_started) { return; } @@ -267,6 +326,10 @@ void supervisor_start_bluetooth(void) { // Kick off advertisements supervisor_bluetooth_background(); + #if CIRCUITPY_STATUS_BAR + supervisor_status_bar_request_update(false); + #endif + #endif } @@ -277,6 +340,8 @@ void supervisor_stop_bluetooth(void) { return; } + ble_started = false; + #if CIRCUITPY_SERIAL_BLE supervisor_stop_bluetooth_serial(); #endif diff --git a/supervisor/shared/bluetooth/bluetooth.h b/supervisor/shared/bluetooth/bluetooth.h index 9de82719a5..231fde3c54 100644 --- a/supervisor/shared/bluetooth/bluetooth.h +++ b/supervisor/shared/bluetooth/bluetooth.h @@ -38,4 +38,8 @@ void supervisor_stop_bluetooth(void); void supervisor_bluetooth_enable_workflow(void); void supervisor_bluetooth_disable_workflow(void); +// Title bar status +bool supervisor_bluetooth_status_dirty(void); +void supervisor_bluetooth_status(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_BLUETOOTH_H diff --git a/supervisor/shared/bluetooth/file_transfer.c b/supervisor/shared/bluetooth/file_transfer.c index 6c206f35c0..159c639e4d 100644 --- a/supervisor/shared/bluetooth/file_transfer.c +++ b/supervisor/shared/bluetooth/file_transfer.c @@ -43,14 +43,15 @@ #include "common-hal/_bleio/__init__.h" #include "supervisor/fatfs_port.h" +#include "supervisor/filesystem.h" #include "supervisor/shared/reload.h" #include "supervisor/shared/bluetooth/file_transfer.h" #include "supervisor/shared/bluetooth/file_transfer_protocol.h" +#include "supervisor/shared/workflow.h" #include "supervisor/shared/tick.h" #include "supervisor/usb.h" #include "py/mpstate.h" -#include "py/stackctrl.h" STATIC bleio_service_obj_t supervisor_ble_service; STATIC bleio_uuid_obj_t supervisor_ble_service_uuid; @@ -172,7 +173,7 @@ STATIC uint8_t _process_read(const uint8_t *raw_buf, size_t command_len) { char *path = (char *)((uint8_t *)command) + header_size; path[command->path_length] = '\0'; - FATFS *fs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; + FATFS *fs = filesystem_circuitpy(); FRESULT result = f_open(fs, &active_file, path, FA_READ); if (result != FR_OK) { response.status = STATUS_ERROR; @@ -289,7 +290,7 @@ STATIC uint8_t _process_write(const uint8_t *raw_buf, size_t command_len) { return ANY_COMMAND; } - FATFS *fs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; + FATFS *fs = filesystem_circuitpy(); DWORD fattime; _truncated_time = truncate_time(command->modification_time, &fattime); override_fattime(fattime); @@ -325,7 +326,6 @@ STATIC uint8_t _process_write(const uint8_t *raw_buf, size_t command_len) { if (chunk_size == 0) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); return ANY_COMMAND; } @@ -382,45 +382,11 @@ STATIC uint8_t _process_write_data(const uint8_t *raw_buf, size_t command_len) { #endif // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); return ANY_COMMAND; } return WRITE_DATA; } -STATIC FRESULT _delete_directory_contents(FATFS *fs, const TCHAR *path) { - FF_DIR dir; - FRESULT res = f_opendir(fs, &dir, path); - FILINFO file_info; - // Check the stack since we're putting paths on it. - if (mp_stack_usage() >= MP_STATE_THREAD(stack_limit)) { - return FR_INT_ERR; - } - while (res == FR_OK) { - res = f_readdir(&dir, &file_info); - if (res != FR_OK || file_info.fname[0] == '\0') { - break; - } - size_t pathlen = strlen(path); - size_t fnlen = strlen(file_info.fname); - TCHAR full_path[pathlen + 1 + fnlen]; - memcpy(full_path, path, pathlen); - full_path[pathlen] = '/'; - size_t full_pathlen = pathlen + 1 + fnlen; - memcpy(full_path + pathlen + 1, file_info.fname, fnlen); - full_path[full_pathlen] = '\0'; - if ((file_info.fattrib & AM_DIR) != 0) { - res = _delete_directory_contents(fs, full_path); - } - if (res != FR_OK) { - break; - } - res = f_unlink(fs, full_path); - } - f_closedir(&dir); - return res; -} - STATIC uint8_t _process_delete(const uint8_t *raw_buf, size_t command_len) { const struct delete_command *command = (struct delete_command *)raw_buf; size_t header_size = sizeof(struct delete_command); @@ -440,14 +406,14 @@ STATIC uint8_t _process_delete(const uint8_t *raw_buf, size_t command_len) { if (command_len < header_size + command->path_length) { return THIS_COMMAND; } - FATFS *fs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; + FATFS *fs = filesystem_circuitpy(); char *path = (char *)((uint8_t *)command) + header_size; path[command->path_length] = '\0'; FILINFO file; FRESULT result = f_stat(fs, path, &file); if (result == FR_OK) { if ((file.fattrib & AM_DIR) != 0) { - result = _delete_directory_contents(fs, path); + result = supervisor_workflow_delete_directory_contents(fs, path); } if (result == FR_OK) { result = f_unlink(fs, path); @@ -463,7 +429,6 @@ STATIC uint8_t _process_delete(const uint8_t *raw_buf, size_t command_len) { if (result == FR_OK) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); } return ANY_COMMAND; } @@ -498,14 +463,14 @@ STATIC uint8_t _process_mkdir(const uint8_t *raw_buf, size_t command_len) { if (command_len < header_size + command->path_length) { return THIS_COMMAND; } - FATFS *fs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; + FATFS *fs = filesystem_circuitpy(); char *path = (char *)command->path; _terminate_path(path, command->path_length); DWORD fattime; response.truncated_time = truncate_time(command->modification_time, &fattime); override_fattime(fattime); - FRESULT result = f_mkdir(fs, path); + FRESULT result = supervisor_workflow_mkdir_parents(fs, path); override_fattime(0); #if CIRCUITPY_USB_MSC usb_msc_unlock(); @@ -517,7 +482,6 @@ STATIC uint8_t _process_mkdir(const uint8_t *raw_buf, size_t command_len) { if (result == FR_OK) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); } return ANY_COMMAND; } @@ -556,7 +520,7 @@ STATIC uint8_t _process_listdir(uint8_t *raw_buf, size_t command_len) { return THIS_COMMAND; } - FATFS *fs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; + FATFS *fs = filesystem_circuitpy(); char *path = (char *)&command->path; _terminate_path(path, command->path_length); // mp_printf(&mp_plat_print, "list %s\n", path); @@ -644,7 +608,7 @@ STATIC uint8_t _process_move(const uint8_t *raw_buf, size_t command_len) { if (command_len < header_size + total_path_length) { return THIS_COMMAND; } - FATFS *fs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; + FATFS *fs = filesystem_circuitpy(); char *old_path = (char *)command->paths; old_path[command->old_path_length] = '\0'; @@ -664,7 +628,6 @@ STATIC uint8_t _process_move(const uint8_t *raw_buf, size_t command_len) { if (result == FR_OK) { // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); - autoreload_trigger(); } return ANY_COMMAND; } @@ -740,6 +703,14 @@ void supervisor_bluetooth_file_transfer_background(void) { } if (next_command == ANY_COMMAND) { autoreload_resume(AUTORELOAD_SUSPEND_BLE); + // Trigger a reload if the command may have mutated the file system. + if (current_state == WRITE || + current_state == WRITE_DATA || + current_state == DELETE || + current_state == MKDIR || + current_state == MOVE) { + autoreload_trigger(); + } } } running = false; diff --git a/supervisor/shared/board.c b/supervisor/shared/board.c index 427c179242..2317540c1a 100644 --- a/supervisor/shared/board.c +++ b/supervisor/shared/board.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#include "supervisor/board.h" #include "supervisor/shared/board.h" #if CIRCUITPY_DIGITALIO && CIRCUITPY_NEOPIXEL_WRITE @@ -46,3 +47,20 @@ void board_reset_user_neopixels(const mcu_pin_obj_t *pin, size_t count) { } #endif + +// Do-nothing so not all boards need to provide this function. +MP_WEAK bool board_requests_safe_mode(void) { + return false; +} + +// Do-nothing so not all boards need to provide this function. +MP_WEAK void board_init(void) { +} + +// Do-nothing so not all boards need to provide this function. +MP_WEAK void board_deinit(void) { +} + +// Do-nothing so not all boards need to provide this function. +MP_WEAK void reset_board(void) { +} diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index a8a9b056f2..8ed2f5c17e 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -45,6 +45,10 @@ #include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h" #endif +#if CIRCUITPY_STATUS_BAR +#include "supervisor/shared/status_bar.h" +#endif + #if CIRCUITPY_REPL_LOGO extern uint32_t blinka_bitmap_data[]; extern displayio_bitmap_t blinka_bitmap; @@ -61,37 +65,26 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { uint8_t scale = 2; #if CIRCUITPY_TERMINALIO - displayio_tilegrid_t *grid = &supervisor_terminal_text_grid; - bool tall = height_px > width_px; + displayio_tilegrid_t *scroll_area = &supervisor_terminal_scroll_area_text_grid; + displayio_tilegrid_t *status_bar = &supervisor_terminal_status_bar_text_grid; bool reset_tiles = false; - #if CIRCUITPY_REPL_LOGO - uint16_t terminal_width_px = tall ? width_px : width_px - blinka_bitmap.width; - uint16_t terminal_height_px = tall ? height_px - blinka_bitmap.height : height_px; - #else - uint16_t terminal_width_px = width_px; - uint16_t terminal_height_px = height_px; - #endif - uint16_t width_in_tiles = terminal_width_px / grid->tile_width; - // determine scale based on h - if (width_in_tiles < 80) { + uint16_t width_in_tiles = width_px / scroll_area->tile_width; + // determine scale based on width + if (width_in_tiles <= 80) { scale = 1; } - width_in_tiles = terminal_width_px / (grid->tile_width * scale); + width_in_tiles = width_px / (scroll_area->tile_width * scale); if (width_in_tiles < 1) { width_in_tiles = 1; } - uint16_t height_in_tiles = terminal_height_px / (grid->tile_height * scale); - uint16_t remaining_pixels = tall ? 0 : terminal_height_px % (grid->tile_height * scale); - if (height_in_tiles < 1 || remaining_pixels > 0) { - height_in_tiles += 1; - } + uint16_t height_in_tiles = height_px / (scroll_area->tile_height * scale); uint16_t total_tiles = width_in_tiles * height_in_tiles; // check if the terminal tile dimensions are the same - if ((grid->width_in_tiles != width_in_tiles) || - (grid->height_in_tiles != height_in_tiles)) { + if ((scroll_area->width_in_tiles != width_in_tiles) || + (scroll_area->height_in_tiles != height_in_tiles - 1)) { reset_tiles = true; } // Reuse the previous allocation if possible @@ -114,27 +107,45 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { uint8_t *tiles = (uint8_t *)tilegrid_tiles->ptr; #if CIRCUITPY_REPL_LOGO - grid->y = tall ? blinka_bitmap.height : 0; - grid->x = tall ? 0 : blinka_bitmap.width; + status_bar->x = supervisor_blinka_sprite.pixel_width + 1; + // Align the status bar to the bottom of the logo. + status_bar->y = supervisor_blinka_sprite.pixel_height - status_bar->tile_height; #else - grid->y = 0; - grid->x = 0; + status_bar->x = 0; + status_bar->y = 0; #endif - grid->top_left_y = 0; - if (remaining_pixels > 0) { - grid->y -= (grid->tile_height - remaining_pixels); - } - grid->width_in_tiles = width_in_tiles; - grid->height_in_tiles = height_in_tiles; + status_bar->top_left_y = 0; + status_bar->width_in_tiles = width_in_tiles; + status_bar->height_in_tiles = 1; assert(width_in_tiles > 0); - assert(height_in_tiles > 0); - grid->pixel_width = width_in_tiles * grid->tile_width; - grid->pixel_height = height_in_tiles * grid->tile_height; - grid->tiles = tiles; + status_bar->pixel_width = width_in_tiles * status_bar->tile_width; + status_bar->pixel_height = status_bar->tile_height; + status_bar->tiles = tiles; + status_bar->full_change = true; - grid->full_change = true; + scroll_area->x = 0; + scroll_area->top_left_y = 0; + scroll_area->width_in_tiles = width_in_tiles; + scroll_area->height_in_tiles = height_in_tiles - 1; + assert(width_in_tiles > 0); + assert(height_in_tiles > 1); + scroll_area->pixel_width = width_in_tiles * scroll_area->tile_width; + scroll_area->pixel_height = (height_in_tiles - 1) * scroll_area->tile_height; + #if CIRCUITPY_REPL_LOGO + scroll_area->y = blinka_bitmap.height; + #else + scroll_area->y = status_bar->tile_height; + #endif + int16_t extra_height = (scroll_area->pixel_height + scroll_area->y) - (height_px / scale); + // Subtract extra height so that the bottom line fully shows. The top line will be under the + // title bar and Blinka logo. + scroll_area->y -= extra_height; + scroll_area->tiles = tiles + width_in_tiles; + scroll_area->full_change = true; - common_hal_terminalio_terminal_construct(&supervisor_terminal, grid, &supervisor_terminal_font); + common_hal_terminalio_terminal_construct(&supervisor_terminal, scroll_area, &supervisor_terminal_font, status_bar); + + // Do not update status bar until after boot.py has run, in case it is disabled. } #endif @@ -146,18 +157,24 @@ void supervisor_stop_terminal(void) { if (tilegrid_tiles != NULL) { free_memory(tilegrid_tiles); tilegrid_tiles = NULL; - supervisor_terminal_text_grid.tiles = NULL; - supervisor_terminal.tilegrid = NULL; + supervisor_terminal_scroll_area_text_grid.tiles = NULL; + supervisor_terminal_status_bar_text_grid.tiles = NULL; + supervisor_terminal.scroll_area = NULL; + supervisor_terminal.status_bar = NULL; } #endif } void supervisor_display_move_memory(void) { #if CIRCUITPY_TERMINALIO + displayio_tilegrid_t *scroll_area = &supervisor_terminal_scroll_area_text_grid; + displayio_tilegrid_t *status_bar = &supervisor_terminal_status_bar_text_grid; if (tilegrid_tiles != NULL) { - supervisor_terminal_text_grid.tiles = (uint8_t *)tilegrid_tiles->ptr; + status_bar->tiles = (uint8_t *)tilegrid_tiles->ptr; + scroll_area->tiles = (uint8_t *)tilegrid_tiles->ptr + scroll_area->width_in_tiles; } else { - supervisor_terminal_text_grid.tiles = NULL; + scroll_area->tiles = NULL; + status_bar->tiles = NULL; } #endif @@ -179,144 +196,27 @@ void supervisor_display_move_memory(void) { #endif } -#if CIRCUITPY_REPL_LOGO -uint32_t blinka_bitmap_data[32] = { - 0x00000011, 0x11000000, - 0x00000111, 0x53100000, - 0x00000111, 0x56110000, - 0x00000111, 0x11140000, - 0x00000111, 0x20002000, - 0x00000011, 0x13000000, - 0x00000001, 0x11200000, - 0x00000000, 0x11330000, - 0x00000000, 0x01122000, - 0x00001111, 0x44133000, - 0x00032323, 0x24112200, - 0x00111114, 0x44113300, - 0x00323232, 0x34112200, - 0x11111144, 0x44443300, - 0x11111111, 0x11144401, - 0x23232323, 0x21111110 -}; - -displayio_bitmap_t blinka_bitmap = { - .base = {.type = &displayio_bitmap_type }, - .width = 16, - .height = 16, - .data = blinka_bitmap_data, - .stride = 2, - .bits_per_value = 4, - .x_shift = 3, - .x_mask = 0x7, - .bitmask = 0xf, - .read_only = true -}; - -_displayio_color_t blinka_colors[7] = { - { - .rgb888 = 0x000000, - .rgb565 = 0x0000, - .luma = 0x00, - .chroma = 0, - .transparent = true - }, - { - .rgb888 = 0x8428bc, - .rgb565 = 0x8978, - .luma = 0xff, // We cheat the luma here. It is actually 0x60 - .hue = 184, - .chroma = 148 - }, - { - .rgb888 = 0xff89bc, - .rgb565 = 0xFCB8, - .luma = 0xb5, - .hue = 222, - .chroma = 118 - }, - { - .rgb888 = 0x7beffe, - .rgb565 = 0x869F, - .luma = 0xe0, - .hue = 124, - .chroma = 131 - }, - { - .rgb888 = 0x51395f, - .rgb565 = 0x5A0D, - .luma = 0x47, - .hue = 185, - .chroma = 38 - }, - { - .rgb888 = 0xffffff, - .rgb565 = 0xffff, - .luma = 0xff, - .chroma = 0 - }, - { - .rgb888 = 0x0736a0, - .rgb565 = 0x01f5, - .luma = 0x44, - .hue = 147, - .chroma = 153 - }, -}; - -displayio_palette_t blinka_palette = { - .base = {.type = &displayio_palette_type }, - .colors = blinka_colors, - .color_count = 7, - .needs_refresh = false -}; - -displayio_tilegrid_t blinka_sprite = { - .base = {.type = &displayio_tilegrid_type }, - .bitmap = &blinka_bitmap, - .pixel_shader = &blinka_palette, - .x = 0, - .y = 0, - .pixel_width = 16, - .pixel_height = 16, - .bitmap_width_in_tiles = 1, - .width_in_tiles = 1, - .height_in_tiles = 1, - .tile_width = 16, - .tile_height = 16, - .top_left_x = 16, - .top_left_y = 16, - .tiles = 0, - .partial_change = false, - .full_change = false, - .hidden = false, - .hidden_by_parent = false, - .moved = false, - .inline_tiles = true, - .in_group = true -}; -#endif - #if CIRCUITPY_TERMINALIO #if CIRCUITPY_REPL_LOGO -mp_obj_t members[] = { &blinka_sprite, &supervisor_terminal_text_grid, }; +mp_obj_t members[] = { &supervisor_terminal_scroll_area_text_grid, &supervisor_blinka_sprite, &supervisor_terminal_status_bar_text_grid, }; +mp_obj_list_t splash_children = { + .base = {.type = &mp_type_list }, + .alloc = 3, + .len = 3, + .items = members, +}; +#else +mp_obj_t members[] = { &supervisor_terminal_scroll_area_text_grid, &supervisor_terminal_status_bar_text_grid,}; mp_obj_list_t splash_children = { .base = {.type = &mp_type_list }, .alloc = 2, .len = 2, .items = members, }; -#else -mp_obj_t members[] = { &supervisor_terminal_text_grid, }; -mp_obj_list_t splash_children = { - .base = {.type = &mp_type_list }, - .alloc = 1, - .len = 1, - .items = members, -}; #endif #else #if CIRCUITPY_REPL_LOGO -mp_obj_t members[] = { &blinka_sprite }; +mp_obj_t members[] = { &supervisor_blinka_sprite }; mp_obj_list_t splash_children = { .base = {.type = &mp_type_list }, .alloc = 1, diff --git a/supervisor/shared/display.h b/supervisor/shared/display.h index 4110cfe8e4..fcaab10818 100644 --- a/supervisor/shared/display.h +++ b/supervisor/shared/display.h @@ -29,10 +29,11 @@ #include +#include "shared-bindings/displayio/TileGrid.h" + #if CIRCUITPY_TERMINALIO #include "shared-bindings/displayio/Bitmap.h" -#include "shared-bindings/displayio/TileGrid.h" #include "shared-bindings/fontio/BuiltinFont.h" #include "shared-bindings/terminalio/Terminal.h" @@ -43,11 +44,14 @@ extern const fontio_builtinfont_t supervisor_terminal_font; // These will change so they must live in RAM. extern displayio_bitmap_t supervisor_terminal_font_bitmap; -extern displayio_tilegrid_t supervisor_terminal_text_grid; +extern displayio_tilegrid_t supervisor_terminal_scroll_area_text_grid; +extern displayio_tilegrid_t supervisor_terminal_status_bar_text_grid; extern terminalio_terminal_obj_t supervisor_terminal; - #endif +// Always shown. +extern displayio_tilegrid_t supervisor_blinka_sprite; + void supervisor_start_terminal(uint16_t width_px, uint16_t height_px); void supervisor_stop_terminal(void); diff --git a/supervisor/shared/external_flash/external_flash.c b/supervisor/shared/external_flash/external_flash.c index 33d618276c..7da45fdc99 100644 --- a/supervisor/shared/external_flash/external_flash.c +++ b/supervisor/shared/external_flash/external_flash.c @@ -588,3 +588,6 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, } return 0; // success } + +void MP_WEAK external_flash_setup(void) { +} diff --git a/supervisor/shared/external_flash/external_flash.h b/supervisor/shared/external_flash/external_flash.h index db5c677eb0..7966b64674 100644 --- a/supervisor/shared/external_flash/external_flash.h +++ b/supervisor/shared/external_flash/external_flash.h @@ -47,4 +47,9 @@ void supervisor_external_flash_flush(void); +// Configure anything that needs to get set up before the external flash +// is init'ed. For example, if GPIO needs to be configured to enable the +// flash chip, as is the case on some boards. +void external_flash_setup(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_EXTERNAL_FLASH_EXTERNAL_FLASH_H diff --git a/supervisor/shared/filesystem.c b/supervisor/shared/filesystem.c index 820dbe9783..283849adc3 100644 --- a/supervisor/shared/filesystem.c +++ b/supervisor/shared/filesystem.c @@ -92,6 +92,9 @@ bool filesystem_init(bool create_allowed, bool force_create) { vfs_fat->blockdev.flags = 0; supervisor_flash_init_vfs(vfs_fat); + mp_vfs_mount_t *vfs = &_mp_vfs; + vfs->len = 0; + // try to mount the flash FRESULT res = f_mount(&vfs_fat->fatfs); if ((res == FR_NO_FILESYSTEM && create_allowed) || force_create) { @@ -140,7 +143,6 @@ bool filesystem_init(bool create_allowed, bool force_create) { } else if (res != FR_OK) { return false; } - mp_vfs_mount_t *vfs = &_mp_vfs; vfs->str = "/"; vfs->len = 1; vfs->obj = MP_OBJ_FROM_PTR(vfs_fat); @@ -199,5 +201,12 @@ void filesystem_set_concurrent_write_protection(fs_user_mount_t *vfs, bool concu } bool filesystem_present(void) { - return true; + return _mp_vfs.len > 0; +} + +FATFS *filesystem_circuitpy(void) { + if (!filesystem_present()) { + return NULL; + } + return &_internal_vfs.fatfs; } diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index ff0382fc17..06c568b42e 100644 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -56,6 +56,8 @@ enum { #if CIRCUITPY_USB_VENDOR + 1 // usb_vendor_add_descriptor #endif + + + CIRCUITPY_PORT_NUM_SUPERVISOR_ALLOCATIONS , CIRCUITPY_SUPERVISOR_MOVABLE_ALLOC_COUNT = diff --git a/supervisor/shared/port.c b/supervisor/shared/port.c new file mode 100644 index 0000000000..e78e6a931a --- /dev/null +++ b/supervisor/shared/port.c @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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/port.h" + +MP_WEAK void port_wake_main_task(void) { +} + +MP_WEAK void port_wake_main_task_from_isr(void) { +} + +MP_WEAK void port_yield(void) { +} diff --git a/supervisor/shared/reload.h b/supervisor/shared/reload.h index cb3385e7ca..fb5e04961a 100644 --- a/supervisor/shared/reload.h +++ b/supervisor/shared/reload.h @@ -43,7 +43,8 @@ enum { enum { AUTORELOAD_SUSPEND_REPL = 0x1, AUTORELOAD_SUSPEND_BLE = 0x2, - AUTORELOAD_SUSPEND_USB = 0x4 + AUTORELOAD_SUSPEND_USB = 0x4, + AUTORELOAD_SUSPEND_WEB = 0x8 }; typedef struct { diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 7922cffc2b..aefae1e48b 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -37,7 +37,7 @@ #include "supervisor/serial.h" #include "supervisor/shared/rgb_led_colors.h" #include "supervisor/shared/status_leds.h" -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include "supervisor/shared/tick.h" #define SAFE_MODE_DATA_GUARD 0xad0000af @@ -178,7 +178,7 @@ void print_safe_mode_message(safe_mode_t reason) { message = translate("Boot device must be first device (interface #0)."); break; case WATCHDOG_RESET: - message = translate("Watchdog timer expired."); + message = translate("Internal watchdog timer expired."); break; case NO_CIRCUITPY: message = translate("CIRCUITPY drive could not be found or created."); diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c index af90fce4d7..094c532781 100644 --- a/supervisor/shared/serial.c +++ b/supervisor/shared/serial.c @@ -41,46 +41,56 @@ #include "supervisor/shared/bluetooth/serial.h" #endif +#if CIRCUITPY_STATUS_BAR +#include "shared-bindings/supervisor/__init__.h" +#include "shared-bindings/supervisor/StatusBar.h" +#endif + #if CIRCUITPY_USB #include "tusb.h" #endif -/* - * Note: DEBUG_UART currently only works on STM32 and nRF. - * Enabling on another platform will cause a crash. - */ +#if CIRCUITPY_WEB_WORKFLOW +#include "supervisor/shared/web_workflow/websocket.h" +#endif -#if defined(CIRCUITPY_DEBUG_UART_TX) || defined(CIRCUITPY_DEBUG_UART_RX) +#if CIRCUITPY_CONSOLE_UART #include "py/mpprint.h" #include "shared-bindings/busio/UART.h" -busio_uart_obj_t debug_uart; -byte buf_array[64]; + +busio_uart_obj_t console_uart; +// on Espressif, the receive buffer must be larger than the hardware FIFO length. See uart_driver_install(). +#if defined(SOC_UART_FIFO_LEN) +byte console_uart_rx_buf[SOC_UART_FIFO_LEN + 1]; +#else +byte console_uart_rx_buf[64]; +#endif #endif #if CIRCUITPY_USB_VENDOR bool tud_vendor_connected(void); #endif -#if defined(CIRCUITPY_DEBUG_UART_TX) -STATIC void debug_uart_print_strn(void *env, const char *str, size_t len) { +#if CIRCUITPY_CONSOLE_UART +STATIC void console_uart_print_strn(void *env, const char *str, size_t len) { (void)env; int uart_errcode; - common_hal_busio_uart_write(&debug_uart, (const uint8_t *)str, len, &uart_errcode); + common_hal_busio_uart_write(&console_uart, (const uint8_t *)str, len, &uart_errcode); } -const mp_print_t debug_uart_print = {NULL, debug_uart_print_strn}; +const mp_print_t console_uart_print = {NULL, console_uart_print_strn}; #endif -int debug_uart_printf(const char *fmt, ...) { - #if defined(CIRCUITPY_DEBUG_UART_TX) - // Skip prints that occur before debug serial is started. It's better than +int console_uart_printf(const char *fmt, ...) { + #if CIRCUITPY_CONSOLE_UART + // Skip prints that occur before console serial is started. It's better than // crashing. - if (common_hal_busio_uart_deinited(&debug_uart)) { + if (common_hal_busio_uart_deinited(&console_uart)) { return 0; } va_list ap; va_start(ap, fmt); - int ret = mp_vprintf(&debug_uart_print, fmt, ap); + int ret = mp_vprintf(&console_uart_print, fmt, ap); va_end(ap); return ret; #else @@ -88,6 +98,9 @@ int debug_uart_printf(const char *fmt, ...) { #endif } +MP_WEAK void port_serial_early_init(void) { +} + MP_WEAK void port_serial_init(void) { } @@ -109,29 +122,24 @@ MP_WEAK void port_serial_write_substring(const char *text, uint32_t length) { } void serial_early_init(void) { - #if defined(CIRCUITPY_DEBUG_UART_TX) || defined(CIRCUITPY_DEBUG_UART_RX) - debug_uart.base.type = &busio_uart_type; + // Set up console UART, if enabled. - #if defined(CIRCUITPY_DEBUG_UART_RX) - const mcu_pin_obj_t *rx = MP_OBJ_TO_PTR(CIRCUITPY_DEBUG_UART_RX); - #else - const mcu_pin_obj_t *rx = NULL; - #endif + #if CIRCUITPY_CONSOLE_UART + console_uart.base.type = &busio_uart_type; - #if defined(CIRCUITPY_DEBUG_UART_TX) - const mcu_pin_obj_t *tx = MP_OBJ_TO_PTR(CIRCUITPY_DEBUG_UART_TX); - #else - const mcu_pin_obj_t *tx = NULL; - #endif + const mcu_pin_obj_t *console_rx = MP_OBJ_TO_PTR(CIRCUITPY_CONSOLE_UART_RX); + const mcu_pin_obj_t *console_tx = MP_OBJ_TO_PTR(CIRCUITPY_CONSOLE_UART_TX); - common_hal_busio_uart_construct(&debug_uart, tx, rx, NULL, NULL, NULL, - false, 115200, 8, BUSIO_UART_PARITY_NONE, 1, 1.0f, 64, - buf_array, true); - common_hal_busio_uart_never_reset(&debug_uart); + common_hal_busio_uart_construct(&console_uart, console_tx, console_rx, NULL, NULL, NULL, + false, 115200, 8, BUSIO_UART_PARITY_NONE, 1, 1.0f, sizeof(console_uart_rx_buf), + console_uart_rx_buf, true); + common_hal_busio_uart_never_reset(&console_uart); // Do an initial print so that we can confirm the serial output is working. - debug_uart_printf("Serial debug setup\r\n"); + console_uart_printf("Serial console setup\r\n"); #endif + + port_serial_early_init(); } void serial_init(void) { @@ -145,7 +153,7 @@ bool serial_connected(void) { } #endif - #if defined(CIRCUITPY_DEBUG_UART_TX) && defined(CIRCUITPY_DEBUG_UART_RX) + #if CIRCUITPY_CONSOLE_UART return true; #endif @@ -165,6 +173,13 @@ bool serial_connected(void) { } #endif + #if CIRCUITPY_WEB_WORKFLOW + if (websocket_connected()) { + return true; + } + #endif + + if (port_serial_connected()) { return true; } @@ -180,11 +195,11 @@ char serial_read(void) { } #endif - #if defined(CIRCUITPY_DEBUG_UART_RX) - if (common_hal_busio_uart_rx_characters_available(&debug_uart)) { + #if CIRCUITPY_CONSOLE_UART + if (common_hal_busio_uart_rx_characters_available(&console_uart)) { int uart_errcode; char text; - common_hal_busio_uart_read(&debug_uart, (uint8_t *)&text, 1, &uart_errcode); + common_hal_busio_uart_read(&console_uart, (uint8_t *)&text, 1, &uart_errcode); return text; } #endif @@ -195,6 +210,19 @@ char serial_read(void) { } #endif + #if CIRCUITPY_WEB_WORKFLOW + if (websocket_available()) { + char c = websocket_read_char(); + if (c != -1) { + return c; + } + } + #endif + + if (port_serial_bytes_available() > 0) { + return port_serial_read(); + } + #if CIRCUITPY_USB_CDC if (!usb_cdc_console_enabled()) { return -1; @@ -204,9 +232,6 @@ char serial_read(void) { return (char)tud_cdc_read_char(); #endif - if (port_serial_bytes_available() > 0) { - return port_serial_read(); - } return -1; } @@ -217,8 +242,8 @@ bool serial_bytes_available(void) { } #endif - #if defined(CIRCUITPY_DEBUG_UART_RX) - if (common_hal_busio_uart_rx_characters_available(&debug_uart)) { + #if CIRCUITPY_CONSOLE_UART + if (common_hal_busio_uart_rx_characters_available(&console_uart)) { return true; } #endif @@ -229,6 +254,12 @@ bool serial_bytes_available(void) { } #endif + #if CIRCUITPY_WEB_WORKFLOW + if (websocket_available()) { + return true; + } + #endif + #if CIRCUITPY_USB_CDC if (usb_cdc_console_enabled() && tud_cdc_available() > 0) { return true; @@ -250,27 +281,42 @@ void serial_write_substring(const char *text, uint32_t length) { if (length == 0) { return; } + #if CIRCUITPY_TERMINALIO int errcode; + // We might be writing + // If the status bar is disabled for the display, common_hal_terminalio_terminal_write() will not write it. common_hal_terminalio_terminal_write(&supervisor_terminal, (const uint8_t *)text, length, &errcode); #endif + #if CIRCUITPY_STATUS_BAR + // If the status bar is disabled for the console, skip writing out the OSC sequence. + if (supervisor_status_bar_get_update_in_progress(&shared_module_supervisor_status_bar_obj) && + !shared_module_supervisor_status_bar_get_console(&shared_module_supervisor_status_bar_obj)) { + return; + } + #endif + #if CIRCUITPY_USB_VENDOR if (tud_vendor_connected()) { tud_vendor_write(text, length); } #endif - #if defined(CIRCUITPY_DEBUG_UART_TX) + #if CIRCUITPY_CONSOLE_UART int uart_errcode; - common_hal_busio_uart_write(&debug_uart, (const uint8_t *)text, length, &uart_errcode); + common_hal_busio_uart_write(&console_uart, (const uint8_t *)text, length, &uart_errcode); #endif #if CIRCUITPY_SERIAL_BLE ble_serial_write(text, length); #endif + #if CIRCUITPY_WEB_WORKFLOW + websocket_write(text, length); + #endif + #if CIRCUITPY_USB_CDC if (!usb_cdc_console_enabled()) { return; diff --git a/supervisor/shared/status_bar.c b/supervisor/shared/status_bar.c new file mode 100644 index 0000000000..066a8d3d10 --- /dev/null +++ b/supervisor/shared/status_bar.c @@ -0,0 +1,144 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 +#include "genhdr/mpversion.h" +#include "py/mpconfig.h" +#include "shared-bindings/supervisor/__init__.h" +#include "shared-bindings/supervisor/StatusBar.h" +#include "supervisor/background_callback.h" +#include "supervisor/serial.h" +#include "supervisor/shared/status_bar.h" + +#if CIRCUITPY_TERMINALIO +#include "shared-module/terminalio/Terminal.h" +#endif + +#if CIRCUITPY_WEB_WORKFLOW +#include "supervisor/shared/web_workflow/web_workflow.h" +#endif + +#if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE +#include "supervisor/shared/bluetooth/bluetooth.h" +#endif + +static background_callback_t status_bar_background_cb; + +static bool _forced_dirty = false; +static bool _suspended = false; + +// Clear if possible, but give up if we can't do it now. +void supervisor_status_bar_clear(void) { + if (!_suspended) { + supervisor_status_bar_set_update_in_progress(&shared_module_supervisor_status_bar_obj, true); + serial_write("\x1b" "]0;" "\x1b" "\\"); + supervisor_status_bar_set_update_in_progress(&shared_module_supervisor_status_bar_obj, false); + } +} + +void supervisor_status_bar_update(void) { + if (_suspended) { + supervisor_status_bar_request_update(true); + return; + } + _forced_dirty = false; + + supervisor_status_bar_set_update_in_progress(&shared_module_supervisor_status_bar_obj, true); + + // Neighboring "" "" are concatenated by the compiler. Without this separation, the hex code + // doesn't get terminated after two following characters and the value is invalid. + // This is the OSC command to set the title and the icon text. It can be up to 255 characters + // but some may be cut off. + serial_write("\x1b" "]0;"); + serial_write("🐍"); + + #if CIRCUITPY_WEB_WORKFLOW + supervisor_web_workflow_status(); + serial_write(" | "); + #endif + + #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE + supervisor_bluetooth_status(); + serial_write(" | "); + #endif + + supervisor_execution_status(); + serial_write(" | "); + serial_write(MICROPY_GIT_TAG); + // Send string terminator + serial_write("\x1b" "\\"); + + supervisor_status_bar_set_update_in_progress(&shared_module_supervisor_status_bar_obj, false); +} + +static void status_bar_background(void *data) { + if (_suspended) { + return; + } + bool dirty = _forced_dirty; + + #if CIRCUITPY_WEB_WORKFLOW + dirty = dirty || supervisor_web_workflow_status_dirty(); + #endif + + #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE + dirty = dirty || supervisor_bluetooth_status_dirty(); + #endif + + if (dirty) { + supervisor_status_bar_update(); + } +} + +void supervisor_status_bar_start(void) { + supervisor_status_bar_request_update(true); +} + +void supervisor_status_bar_request_update(bool force_dirty) { + if (force_dirty) { + _forced_dirty = true; + } + background_callback_add_core(&status_bar_background_cb); +} + +void supervisor_status_bar_suspend(void) { + _suspended = true; +} + +void supervisor_status_bar_resume(void) { + _suspended = false; + supervisor_status_bar_request_update(false); +} + +void supervisor_status_bar_init(void) { + status_bar_background_cb.fun = status_bar_background; + status_bar_background_cb.data = NULL; + + shared_module_supervisor_status_bar_obj.console = true; + shared_module_supervisor_status_bar_obj.display = true; + shared_module_supervisor_status_bar_obj.update_in_progress = false; + shared_module_supervisor_status_bar_obj.written = false; +} diff --git a/supervisor/shared/status_bar.h b/supervisor/shared/status_bar.h new file mode 100644 index 0000000000..062012b545 --- /dev/null +++ b/supervisor/shared/status_bar.h @@ -0,0 +1,48 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +#pragma once + +#include + +void supervisor_status_bar_init(void); + +void supervisor_status_bar_start(void); +void supervisor_status_bar_suspend(void); +void supervisor_status_bar_resume(void); + +void supervisor_status_bar_clear(void); + +// Update the title bar immediately. Useful from main.c where we know state has changed and the code +// will only be run once. +void supervisor_status_bar_update(void); + +// Use this if requesting from the background, as code is executing or if the status may not have +// changed. +void supervisor_status_bar_request_update(bool force_dirty); + +// Provided by main.c +void supervisor_execution_status(void); diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index 104083fb20..429ca35d60 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -44,10 +44,6 @@ #include "shared-module/displayio/__init__.h" #endif -#if CIRCUITPY_GAMEPADSHIFT -#include "shared-module/gamepadshift/__init__.h" -#endif - #if CIRCUITPY_KEYPAD #include "shared-module/keypad/__init__.h" #endif @@ -102,13 +98,6 @@ void supervisor_tick(void) { filesystem_tick(); #endif - #ifdef CIRCUITPY_GAMEPAD_TICKS - if (!(port_get_raw_ticks(NULL) & CIRCUITPY_GAMEPAD_TICKS)) { - #if CIRCUITPY_GAMEPADSHIFT - gamepadshift_tick(); - #endif - } - #endif #if CIRCUITPY_KEYPAD keypad_tick(); diff --git a/supervisor/shared/translate.h b/supervisor/shared/translate/compressed_string.h similarity index 90% rename from supervisor/shared/translate.h rename to supervisor/shared/translate/compressed_string.h index da58e1eb78..e331a5866f 100644 --- a/supervisor/shared/translate.h +++ b/supervisor/shared/translate/compressed_string.h @@ -24,10 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H -#define MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H +#pragma once +#include #include +#include // The format of the compressed data is: // - the size of the uncompressed string in UTF-8 bytes, encoded as a @@ -77,17 +78,7 @@ typedef struct compressed_string { // Return the compressed, translated version of a source string // Usually, due to LTO, this is optimized into a load of a constant // pointer. -const compressed_string_t *translate(const char *c); +// const compressed_string_t *translate(const char *c); void serial_write_compressed(const compressed_string_t *compressed); char *decompress(const compressed_string_t *compressed, char *decompressed); uint16_t decompress_length(const compressed_string_t *compressed); - - -// Map MicroPython's error messages to our translations. -#if defined(MICROPY_ENABLE_DYNRUNTIME) && MICROPY_ENABLE_DYNRUNTIME -#define MP_ERROR_TEXT(x) (x) -#else -#define MP_ERROR_TEXT(x) translate(x) -#endif - -#endif // MICROPY_INCLUDED_SUPERVISOR_TRANSLATE_H diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate/translate.c similarity index 88% rename from supervisor/shared/translate.c rename to supervisor/shared/translate/translate.c index fefda46006..ae6c7524e5 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate/translate.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "supervisor/shared/translate.h" +#include "supervisor/shared/translate/translate.h" #include #include @@ -135,18 +135,6 @@ char *decompress(const compressed_string_t *compressed, char *decompressed) { return decompressed; } -inline -// gcc10 -flto has issues with this being always_inline for debug builds. -#if CIRCUITPY_DEBUG < 1 -__attribute__((always_inline)) +#if CIRCUITPY_TRANSLATE_OBJECT == 1 +#include "supervisor/shared/translate/translate_impl.h" #endif -const compressed_string_t *translate(const char *original) { - #ifndef NO_QSTR - #define QDEF(id, hash, len, str) - #define TRANSLATION(id, firstbyte, ...) if (strcmp(original, id) == 0) { static const compressed_string_t v = { .data = firstbyte, .tail = { __VA_ARGS__ } }; return &v; } else - #include "genhdr/qstrdefs.generated.h" -#undef TRANSLATION -#undef QDEF - #endif - return NULL; -} diff --git a/shared-module/gamepadshift/GamePadShift.c b/supervisor/shared/translate/translate.h similarity index 52% rename from shared-module/gamepadshift/GamePadShift.c rename to supervisor/shared/translate/translate.h index 0fb7d1e8d3..8bb343cabe 100644 --- a/shared-module/gamepadshift/GamePadShift.c +++ b/supervisor/shared/translate/translate.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Radomir Dopieralski for Adafruit Industries + * Copyright (c) 2018 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 @@ -24,29 +24,32 @@ * THE SOFTWARE. */ -#include "py/mpstate.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "shared-bindings/gamepadshift/GamePadShift.h" -#include "shared-module/gamepadshift/GamePadShift.h" -#include "supervisor/shared/tick.h" +#pragma once -void common_hal_gamepadshift_gamepadshift_init(gamepadshift_obj_t *gamepadshift, - digitalio_digitalinout_obj_t *clock_pin, - digitalio_digitalinout_obj_t *data_pin, - digitalio_digitalinout_obj_t *latch_pin) { - common_hal_digitalio_digitalinout_switch_to_input(data_pin, PULL_NONE); - gamepadshift->data_pin = data_pin; - common_hal_digitalio_digitalinout_switch_to_output(clock_pin, 0, - DRIVE_MODE_PUSH_PULL); - gamepadshift->clock_pin = clock_pin; - common_hal_digitalio_digitalinout_switch_to_output(latch_pin, 1, - DRIVE_MODE_PUSH_PULL); - gamepadshift->latch_pin = latch_pin; +#include +#include +#include - gamepadshift->last = 0; -} +#include "supervisor/shared/translate/compressed_string.h" -void common_hal_gamepadshift_gamepadshift_deinit(gamepadshift_obj_t *gamepadshift) { - MP_STATE_VM(gamepad_singleton) = NULL; - supervisor_disable_tick(); -} +// Map MicroPython's error messages to our translations. +#if defined(MICROPY_ENABLE_DYNRUNTIME) && MICROPY_ENABLE_DYNRUNTIME +#define MP_ERROR_TEXT(x) (x) +#else +#define MP_ERROR_TEXT(x) translate(x) +#endif + +// translate() is a giant function with many strcmp calls. The assumption is +// that the build process will optimize this away and replace it with the +// appropriate compressed data for each call site. + +#if CIRCUITPY_TRANSLATE_OBJECT == 0 +// Without LTO, we need to include a copy of this function in each compilation +// unit so that the compile stage can do the optimization. Otherwise the linker +// will leave this as a giant function and have each call site call into it. +#include "supervisor/shared/translate/translate_impl.h" +#else +// In link time optimized (LTO) builds, we can compile this once into a .o and +// at link time the calls will be optimized. +const compressed_string_t *translate(const char *c); +#endif diff --git a/supervisor/shared/translate/translate_impl.h b/supervisor/shared/translate/translate_impl.h new file mode 100644 index 0000000000..1c144197cb --- /dev/null +++ b/supervisor/shared/translate/translate_impl.h @@ -0,0 +1,60 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2018 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. + */ + +#pragma once + +#include +#include +#include + +#include "supervisor/shared/translate/compressed_string.h" + +#ifndef NO_QSTR +#define QDEF(id, hash, len, str) +#define TRANSLATION(english_id, number) extern compressed_string_t translation##number; +#include "genhdr/qstrdefs.generated.h" +#undef TRANSLATION +#undef QDEF +#endif + +#if CIRCUITPY_TRANSLATE_OBJECT == 0 +static +#endif +inline +// gcc10 -flto has issues with this being always_inline for debug builds. +#if !CIRCUITPY_LTO || CIRCUITPY_DEBUG < 1 +__attribute__((always_inline)) +#endif +const compressed_string_t *translate(const char *original) { + #ifndef NO_QSTR + #define QDEF(id, hash, len, str) + #define TRANSLATION(english_id, number) if (strcmp(original, english_id) == 0) { return &translation##number; } else + #include "genhdr/qstrdefs.generated.h" +#undef TRANSLATION +#undef QDEF + #endif + return NULL; +} diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h index 13b4367f47..c2ad1362a3 100644 --- a/supervisor/shared/usb/tusb_config.h +++ b/supervisor/shared/usb/tusb_config.h @@ -48,8 +48,8 @@ extern "C" { // COMMON CONFIGURATION // --------------------------------------------------------------------+ -// When debugging TinyUSB, only output to the UART debug link. -#if CIRCUITPY_DEBUG_TINYUSB > 0 && defined(CIRCUITPY_DEBUG_UART_TX) +// When debugging TinyUSB, only output to the console UART link. +#if CIRCUITPY_DEBUG_TINYUSB > 0 && defined(CIRCUITPY_CONSOLE_UART) #define CFG_TUSB_DEBUG CIRCUITPY_DEBUG_TINYUSB #define CFG_TUSB_DEBUG_PRINTF debug_uart_printf #endif diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index aa239a5820..7837faaf3b 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -35,6 +35,10 @@ #include "shared/runtime/interrupt_char.h" #include "shared/readline/readline.h" +#if CIRCUITPY_STATUS_BAR +#include "supervisor/shared/status_bar.h" +#endif + #if CIRCUITPY_STORAGE #include "shared-module/storage/__init__.h" #endif @@ -266,6 +270,11 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) { if (coding.bit_rate == 1200) { reset_to_bootloader(); } + } else { + #if CIRCUITPY_STATUS_BAR + // We are connected, let's request a title bar update. + supervisor_status_bar_request_update(true); + #endif } } diff --git a/supervisor/shared/web_workflow/static/blinka_16x16.ico b/supervisor/shared/web_workflow/static/blinka_16x16.ico new file mode 100644 index 0000000000..ff2937dfee Binary files /dev/null and b/supervisor/shared/web_workflow/static/blinka_16x16.ico differ diff --git a/supervisor/shared/web_workflow/static/code.html b/supervisor/shared/web_workflow/static/code.html new file mode 100644 index 0000000000..afb707538a --- /dev/null +++ b/supervisor/shared/web_workflow/static/code.html @@ -0,0 +1,14 @@ + + + + + + + Online Code Editor + + + + +

Uh oh! It looks like you may be offline. You can go to the file browser if you'd like to work with files without connecting to the internet.

+ + diff --git a/supervisor/shared/web_workflow/static/directory.html b/supervisor/shared/web_workflow/static/directory.html new file mode 100644 index 0000000000..cf9ff507f9 --- /dev/null +++ b/supervisor/shared/web_workflow/static/directory.html @@ -0,0 +1,24 @@ + + + + + + + + + + +

 

+ + + + + +
TypeSizePathModified
+
+ + + +
+ +📁  + diff --git a/supervisor/shared/web_workflow/static/directory.js b/supervisor/shared/web_workflow/static/directory.js new file mode 100644 index 0000000000..c1d934c1a8 --- /dev/null +++ b/supervisor/shared/web_workflow/static/directory.js @@ -0,0 +1,269 @@ +let new_directory_name = document.getElementById("name"); +let files = document.getElementById("files"); +let dirs = document.getElementById("dirs"); + +var url_base = window.location; +var current_path; +var editable = undefined; + +function compareValues(a, b) { + if (a.directory == b.directory && a.name.toLowerCase() === b.name.toLowerCase()) { + return 0; + } else if (a.directory != b.directory) { + return a.directory < b.directory ? 1 : -1; + } else { + return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1; + } +} + +function set_upload_enabled(enabled) { + files.disabled = !enabled; + dirs.disabled = !enabled; +} + +async function refresh_list() { + current_path = window.location.hash.substr(1); + if (current_path == "") { + current_path = "/"; + } + // Do the fetch first because the browser will prompt for credentials. + const response = await fetch(new URL("/fs" + current_path, url_base), + { + headers: { + "Accept": "application/json" + }, + credentials: "include" + } + ); + const data = await response.json(); + var new_children = []; + var title = document.querySelector("title"); + title.textContent = current_path; + var path = document.querySelector("#path"); + path.textContent = current_path; + var template = document.querySelector('#row'); + + if (editable === undefined) { + const status = await fetch(new URL("/fs/", url_base), + { + method: "OPTIONS", + credentials: "include" + } + ); + editable = status.headers.get("Access-Control-Allow-Methods").includes("DELETE"); + new_directory_name.disabled = !editable; + set_upload_enabled(editable); + if (!editable) { + let usbwarning = document.querySelector("#usbwarning"); + usbwarning.style.display = "block"; + } + } + + if (current_path != "/") { + var clone = template.content.cloneNode(true); + var td = clone.querySelectorAll("td"); + td[0].textContent = "📁"; + var path = clone.querySelector("a"); + let parent = new URL("..", "file://" + current_path); + path.href = "#" + parent.pathname; + path.textContent = ".."; + // Remove the delete button + td[4].replaceChildren(); + td[5].replaceChildren(); + td[6].replaceChildren(); + new_children.push(clone); + } + + data.sort(compareValues); + + for (const f of data) { + // Clone the new row and insert it into the table + var clone = template.content.cloneNode(true); + var td = clone.querySelectorAll("td"); + var icon = "⬇️"; + var file_path = current_path + f.name; + let api_url = new URL("/fs" + file_path, url_base); + let edit_url = "/edit/#" + file_path; + if (f.directory) { + file_path = "#" + file_path + "/"; + api_url += "/"; + } else { + file_path = api_url; + } + + var text_file = false; + if (f.directory) { + icon = "📁"; + } else if(f.name.endsWith(".txt") || + f.name.endsWith(".env") || + f.name.endsWith(".py") || + f.name.endsWith(".js") || + f.name.endsWith(".json")) { + icon = "📄"; + text_file = true; + } else if (f.name.endsWith(".html")) { + icon = "🌐"; + text_file = true; + } + td[0].textContent = icon; + td[1].textContent = f.file_size; + var path = clone.querySelector("a.path"); + path.href = file_path; + path.textContent = f.name; + let modtime = clone.querySelector("td.modtime"); + modtime.textContent = (new Date(f.modified_ns / 1000000)).toLocaleString(); + var delete_button = clone.querySelector("button.delete"); + delete_button.value = api_url; + delete_button.disabled = !editable; + delete_button.onclick = del; + + + var rename_button = clone.querySelector("button.rename"); + rename_button.value = api_url; + rename_button.disabled = !editable; + rename_button.onclick = rename; + + let edit_link = clone.querySelector(".edit_link"); + if (text_file && editable && !f.directory) { + edit_url = new URL(edit_url, url_base); + edit_link.href = edit_url + } else if (f.directory) { + edit_link.style = "display: none;"; + } else { + edit_link.querySelector("button").disabled = true; + } + + new_children.push(clone); + } + var tbody = document.querySelector("tbody"); + tbody.replaceChildren(...new_children); +} + +async function find_devices() { + const version_response = await fetch("/cp/version.json"); + if (version_response.ok) { + url_base = new URL("/", window.location).href; + } else { + // TODO: Remove this when we've settled things. It is only used when this file isn't hosted + // by a CP device. + const response = await fetch("http://circuitpython.local/cp/devices.json"); + let url = new URL("/", response.url); + url_base = url.href; + const data = await response.json(); + } + refresh_list(); +} + +async function mkdir(e) { + const response = await fetch( + new URL("/fs" + current_path + new_directory_name.value + "/", url_base), + { + method: "PUT", + headers: { + 'X-Timestamp': Date.now() + } + } + ); + if (response.ok) { + refresh_list(); + new_directory_name.value = ""; + mkdir_button.disabled = true; + } +} + +async function upload(e) { + set_upload_enabled(false); + let progress = document.querySelector("progress"); + let made_dirs = new Set(); + progress.max = files.files.length + dirs.files.length; + progress.value = 0; + for (const file of [...files.files, ...dirs.files]) { + let file_name = file.name; + if (file.webkitRelativePath) { + file_name = file.webkitRelativePath; + let components = file_name.split("/"); + components.pop(); + let parent_dir = components.join("/"); + if (!made_dirs.has(parent_dir)) { + new_directory_name.value = parent_dir; + await mkdir(null); + made_dirs.add(parent_dir); + } + } + let file_path = new URL("/fs" + current_path + file_name, url_base); + const response = await fetch(file_path, + { + method: "PUT", + headers: { + 'Content-Type': 'application/octet-stream', + 'X-Timestamp': file.lastModified + }, + body: file + } + ) + if (response.ok) { + refresh_list(); + } + progress.value += 1; + } + files.value = ""; + dirs.value = ""; + progress.value = 0; + set_upload_enabled(true); +} + +async function del(e) { + let fn = new URL(e.target.value); + var prompt = "Delete " + fn.pathname.substr(3); + if (e.target.value.endsWith("/")) { + prompt += " and all of its contents?"; + } else { + prompt += "?"; + } + if (confirm(prompt)) { + const response = await fetch(e.target.value, + { + method: "DELETE" + } + ) + if (response.ok) { + refresh_list(); + } + } +} + +async function rename(e) { + let fn = new URL(e.target.value); + var new_fn = prompt("Rename to ", fn.pathname.substr(3)); + if (new_fn === null) { + return; + } + let new_uri = new URL("/fs" + new_fn, fn); + const response = await fetch(e.target.value, + { + method: "MOVE", + headers: { + 'X-Destination': new_uri.pathname, + }, + } + ) + if (response.ok) { + refresh_list(); + } +} + +find_devices(); + +let mkdir_button = document.getElementById("mkdir"); +mkdir_button.onclick = mkdir; + +files.onchange = upload; +dirs.onchange = upload; + +mkdir_button.disabled = new_directory_name.value.length == 0; + +new_directory_name.oninput = () => { + mkdir_button.disabled = new_directory_name.value.length == 0; +} + +window.onhashchange = refresh_list; diff --git a/supervisor/shared/web_workflow/static/edit.html b/supervisor/shared/web_workflow/static/edit.html new file mode 100644 index 0000000000..85408ed2b5 --- /dev/null +++ b/supervisor/shared/web_workflow/static/edit.html @@ -0,0 +1,16 @@ + + + + + Offline Code Edit + + + + + +

Loading

+ + + + + diff --git a/supervisor/shared/web_workflow/static/edit.js b/supervisor/shared/web_workflow/static/edit.js new file mode 100644 index 0000000000..60dd8b1073 --- /dev/null +++ b/supervisor/shared/web_workflow/static/edit.js @@ -0,0 +1,47 @@ +let $editor = document.querySelector("#code_textarea"); +let filename = location.hash.substring(1); +let $output_text = document.querySelector("#output_text"); + +fetch(`/fs/${filename}`) + .then(function (response) { + $output_text.innerText = `Loading Status: ${response.status}`; + return response.status === 200 ? response.text() : ""; + }) + .then(function (data) { + $editor.value = data; + }); + +function save() { + $output_text.innerText = "Saving..." + const requestOptions = { + method: 'PUT', + body: $editor.value + }; + fetch(`/fs/${filename}`, requestOptions) + .then(function (response) { + $output_text.innerText = `Saving Status: ${response.status}`; + return response.text(); + }) + .then(function (data) { + console.log("after fetch: " + data); + }); +} + +document.querySelector("#save_btn").onclick = function () { + console.log("Click Save!"); + save(); +} + +let isCtrl = false; +document.onkeyup=function(e){ + if(e.keyCode === 17) isCtrl=false; +} + +document.onkeydown=function(e){ + if(e.keyCode === 17) isCtrl=true; + if(e.keyCode === 83 && isCtrl === true) { + //ctrl-s pressed + save(); + return false; + } +} diff --git a/supervisor/shared/web_workflow/static/serial.html b/supervisor/shared/web_workflow/static/serial.html new file mode 100644 index 0000000000..9193953443 --- /dev/null +++ b/supervisor/shared/web_workflow/static/serial.html @@ -0,0 +1,26 @@ + + + + Simple client + + + + + + + +
+

+    
+  
+
+
+ Ctrl + + +
+ + +
+ + diff --git a/supervisor/shared/web_workflow/static/serial.js b/supervisor/shared/web_workflow/static/serial.js new file mode 100644 index 0000000000..5c644795a0 --- /dev/null +++ b/supervisor/shared/web_workflow/static/serial.js @@ -0,0 +1,83 @@ + +var ws; +var input = document.getElementById("input"); +input.value = ""; +var title = document.querySelector("title"); +var log = document.getElementById("log"); + +function set_enabled(enabled) { + input.disabled = !enabled; + var buttons = document.querySelectorAll("button"); + for (button of buttons) { + button.disabled = !enabled; + } +} + +set_enabled(false); + +function onSubmit() { + ws.send("\r"); + input.value = ""; + input.focus(); +} + +ws = new WebSocket("ws://" + window.location.host + "/cp/serial/"); + +ws.onopen = function() { + set_enabled(true); +}; + +var setting_title = false; +var encoder = new TextEncoder(); +var left_count = 0; +ws.onmessage = function(e) { + if (e.data == "\x1b]0;") { + setting_title = true; + title.textContent = ""; + } else if (e.data == "\x1b\\") { + setting_title = false; + } else if (setting_title) { + title.textContent += e.data; + } else if (e.data == "\b") { + left_count += 1; + } else if (e.data == "\x1b[K") { // Clear line + log.textContent = log.textContent.slice(0, -left_count); + left_count = 0; + } else { + log.textContent += e.data; + } + document.querySelector("span").scrollIntoView(); +}; + +ws.onclose = function() { + set_enabled(false); +}; + +ws.onerror = function(e) { + set_enabled(false); +}; + +input.addEventListener("beforeinput", function(e) { + if (e.inputType == "insertLineBreak") { + ws.send("\r"); + input.value = ""; + input.focus(); + e.preventDefault(); + } else if (e.inputType == "insertText" || e.inputType == "insertFromPaste") { + ws.send(e.data); + } else if (e.inputType == "deleteContentBackward") { + ws.send("\b"); + } else { + console.log(e); + } +}); + +let ctrl_c = document.querySelector("#c"); +ctrl_c.onclick = function() { + ws.send("\x03"); +} + +let ctrl_d = document.querySelector("#d"); +ctrl_d.onclick = function() { + ws.send("\x04"); +} diff --git a/supervisor/shared/web_workflow/static/style.css b/supervisor/shared/web_workflow/static/style.css new file mode 100644 index 0000000000..ab9dde7fb8 --- /dev/null +++ b/supervisor/shared/web_workflow/static/style.css @@ -0,0 +1,23 @@ +body { + max-width: 960px; + margin: 20px auto; + font-size: 18px; + font-family: "Proxima Nova", Verdana, sans-serif; + line-height: 20.7px; +} + + +/* for edit.html */ +#code_textarea { + width: 90%; + height: 600px; +} + +#output_text { + margin: 0; + font-size: 0.7em; +} + +:disabled { + filter: saturate(0%); +} diff --git a/supervisor/shared/web_workflow/static/welcome.html b/supervisor/shared/web_workflow/static/welcome.html new file mode 100644 index 0000000000..e773bb6a2e --- /dev/null +++ b/supervisor/shared/web_workflow/static/welcome.html @@ -0,0 +1,34 @@ + + + + CircuitPython + + + + + + + + +

 Welcome!

+ +

Welcome to CircuitPython's Web API. Go to the file browser to work with files in the CIRCUITPY drive. Go to the full code editor for a more enriching experience which requires an active internet connection. Go to the serial terminal to see code output and interact with the REPL. Make sure you've set CIRCUITPY_WEB_API_PASSWORD='somepassword' in /.env. Provide the password when the browser prompts for it. Leave the username blank.

+ +

Device Info:

+ +
+
Board:
+
+
Version:
+
+
Hostname:
+
+
IP:
+
+
+ +

Here are other CircuitPython devices on your network:

+
    +
+ + diff --git a/supervisor/shared/web_workflow/static/welcome.js b/supervisor/shared/web_workflow/static/welcome.js new file mode 100644 index 0000000000..e32d6924b5 --- /dev/null +++ b/supervisor/shared/web_workflow/static/welcome.js @@ -0,0 +1,62 @@ +var url_base = window.location; +var current_path; + +var mdns_works = url_base.hostname.endsWith(".local"); + +async function find_devices() { + var version_response = await fetch("/cp/version.json"); + if (version_response.ok) { + url_base = new URL("/", window.location).href; + } else { + // TODO: Remove this when we've settled things. It is only used when this file isn't hosted + // by a CP device. + version_response = await fetch("http://circuitpython.local/cp/version.json", {mode: "cors"}); + mdns_works = mdns_works || version_response.redirected; + if (!version_response.ok && version_response.redirected) { + version_response = await fetch(version_response.url); + } + let url = new URL("/", version_response.url); + url_base = url.href; + } + const version_info = await version_response.json(); + let version_span = document.querySelector("#version"); + version_span.textContent = version_info.version; + let board_link = document.querySelector("#board"); + board_link.href = "https://circuitpython.org/board/" + version_info.board_id + "/"; + board_link.textContent = version_info.board_name; + let hostname = document.querySelector("#hostname"); + var port = ""; + if (version_info.port != 80) { + port = ":" + version_info.port; + } + hostname.href = "http://" + version_info.hostname + ".local" + port + "/"; + hostname.textContent = version_info.hostname; + let ip = document.querySelector("#ip"); + ip.href = "http://" + version_info.ip + port + "/"; + ip.textContent = version_info.ip; + const response = await fetch(new URL("/cp/devices.json", url_base)); + const data = await response.json(); + let device_list = document.querySelector("#devices"); + let new_devices = []; + for (device of data.devices) { + let li = document.createElement("li"); + let a = document.createElement("a"); + li.appendChild(a); + var port = ""; + if (device.port != 80) { + port = ":" + device.port; + } + var server; + if (mdns_works) { + server = device.hostname + ".local"; + } else { + server = device.ip; + } + a.href = "http://" + server + port + "/"; + a.textContent = device.instance_name + " (" + device.hostname + ")"; + new_devices.push(li); + } + device_list.replaceChildren(...new_devices); +} + +find_devices(); diff --git a/supervisor/shared/web_workflow/web_workflow.c b/supervisor/shared/web_workflow/web_workflow.c new file mode 100644 index 0000000000..e09c87f624 --- /dev/null +++ b/supervisor/shared/web_workflow/web_workflow.c @@ -0,0 +1,1431 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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 + +#include "extmod/vfs.h" +#include "extmod/vfs_fat.h" +#include "genhdr/mpversion.h" +#include "py/mpstate.h" +#include "py/stackctrl.h" + +#include "shared-bindings/wifi/Radio.h" +#include "shared-module/storage/__init__.h" +#include "shared/timeutils/timeutils.h" +#include "supervisor/fatfs_port.h" +#include "supervisor/filesystem.h" +#include "supervisor/port.h" +#include "supervisor/shared/reload.h" +#include "supervisor/shared/translate/translate.h" +#include "supervisor/shared/web_workflow/web_workflow.h" +#include "supervisor/shared/web_workflow/websocket.h" +#include "supervisor/shared/workflow.h" +#include "supervisor/usb.h" + +#include "shared-bindings/hashlib/__init__.h" +#include "shared-bindings/hashlib/Hash.h" +#include "shared-bindings/mdns/RemoteService.h" +#include "shared-bindings/mdns/Server.h" +#include "shared-bindings/microcontroller/Processor.h" +#include "shared-bindings/socketpool/__init__.h" +#include "shared-bindings/socketpool/Socket.h" +#include "shared-bindings/socketpool/SocketPool.h" + +#if CIRCUITPY_WIFI +#include "shared-bindings/wifi/__init__.h" +#endif + +#if CIRCUITPY_DOTENV +#include "shared-module/dotenv/__init__.h" +#endif + +// TODO: Remove ESP specific stuff. For now, it is useful as we refine the server. +#include "esp_log.h" + +static const char *TAG = "CP webserver"; + +enum request_state { + STATE_METHOD, + STATE_PATH, + STATE_VERSION, + STATE_HEADER_KEY, + STATE_HEADER_VALUE, + STATE_BODY +}; + +typedef struct { + enum request_state state; + char method[8]; + char path[256]; + char destination[256]; + char header_key[64]; + char header_value[256]; + // We store the origin so we can reply back with it. + char origin[64]; + size_t content_length; + size_t offset; + uint64_t timestamp_ms; + bool redirect; + bool done; + bool in_progress; + bool authenticated; + bool expect; + bool json; + bool websocket; + uint32_t websocket_version; + // RFC6455 for websockets says this header should be 24 base64 characters long. + char websocket_key[24 + 1]; +} _request; + +static wifi_radio_error_t _wifi_status = WIFI_RADIO_ERROR_NONE; + +#if CIRCUITPY_STATUS_BAR +// Store various last states to compute if status bar needs an update. +static bool _last_enabled = false; +static uint32_t _last_ip = 0; +static wifi_radio_error_t _last_wifi_status = WIFI_RADIO_ERROR_NONE; +#endif + +static mdns_server_obj_t mdns; +static uint32_t web_api_port = 80; + +static socketpool_socketpool_obj_t pool; +static socketpool_socket_obj_t listening; +static socketpool_socket_obj_t active; + +static _request active_request; + +static char _api_password[64]; + +// Store the encoded IP so we don't duplicate work. +static uint32_t _encoded_ip = 0; +static char _our_ip_encoded[4 * 4]; + +// in_len is the number of bytes to encode. out_len is the number of bytes we +// have to do it. +static bool _base64_in_place(char *buf, size_t in_len, size_t out_len) { + size_t triples = (((in_len - 1) / 3) + 1); + size_t encoded_len = triples * 4; + if (encoded_len + 1 > out_len) { + return false; + } + + // First pass, we convert input buffer to numeric base 64 values + char *in = buf + (triples - 1) * 3; + char *out = buf + (triples - 1) * 4; + int r = in_len % 3; + int partial = 0; + if (r != 0) { + out[3] = 64; + if (r == 2) { + out[2] = (in[1] & 0x0F) << 2; + out[1] = (in[0] & 0x03) << 4 | (in[1] & 0xF0) >> 4; + } else { + out[2] = 64; + out[1] = (in[0] & 0x03) << 4; + } + out[0] = (in[0] & 0xFC) >> 2; + in -= 3; + out -= 4; + partial = 1; + } + buf[encoded_len] = '\0'; + for (size_t i = 0; i < triples - partial; i++) { + out[3] = in[2] & 0x3F; + out[2] = (in[1] & 0x0F) << 2 | (in[2] & 0xC0) >> 6; + out[1] = (in[0] & 0x03) << 4 | (in[1] & 0xF0) >> 4; + out[0] = (in[0] & 0xFC) >> 2; + in -= 3; + out -= 4; + } + + // Second pass, we convert number base 64 values to actual base64 ascii encoding + out = buf; + for (mp_uint_t j = 0; j < encoded_len; j++) { + if (*out < 26) { + *out += 'A'; + } else if (*out < 52) { + *out += 'a' - 26; + } else if (*out < 62) { + *out += '0' - 52; + } else if (*out == 62) { + *out = '+'; + } else if (*out == 63) { + *out = '/'; + } else { + *out = '='; + } + out++; + } + return true; +} + +STATIC void _update_encoded_ip(void) { + uint32_t ipv4_address = 0; + if (common_hal_wifi_radio_get_enabled(&common_hal_wifi_radio_obj)) { + ipv4_address = wifi_radio_get_ipv4_address(&common_hal_wifi_radio_obj); + } + if (_encoded_ip != ipv4_address) { + uint8_t *octets = (uint8_t *)&ipv4_address; + snprintf(_our_ip_encoded, sizeof(_our_ip_encoded), "%d.%d.%d.%d", octets[0], octets[1], octets[2], octets[3]); + _encoded_ip = ipv4_address; + } +} + +#if CIRCUITPY_STATUS_BAR +bool supervisor_web_workflow_status_dirty(void) { + return common_hal_wifi_radio_get_enabled(&common_hal_wifi_radio_obj) != _last_enabled || + _encoded_ip != _last_ip || + _last_wifi_status != _wifi_status; +} +#endif + +#if CIRCUITPY_STATUS_BAR +void supervisor_web_workflow_status(void) { + _last_enabled = common_hal_wifi_radio_get_enabled(&common_hal_wifi_radio_obj); + if (_last_enabled) { + uint32_t ipv4_address = wifi_radio_get_ipv4_address(&common_hal_wifi_radio_obj); + if (ipv4_address != 0) { + _update_encoded_ip(); + _last_ip = _encoded_ip; + mp_printf(&mp_plat_print, "%s", _our_ip_encoded); + if (web_api_port != 80) { + mp_printf(&mp_plat_print, ":%d", web_api_port); + } + // TODO: Use these unicode to show signal strength: ▂▄▆█ + return; + } + serial_write_compressed(translate("Wi-Fi: ")); + _last_wifi_status = _wifi_status; + if (_wifi_status == WIFI_RADIO_ERROR_AUTH_EXPIRE || + _wifi_status == WIFI_RADIO_ERROR_AUTH_FAIL) { + serial_write_compressed(translate("Authentication failure")); + } else if (_wifi_status != WIFI_RADIO_ERROR_NONE) { + mp_printf(&mp_plat_print, "%d", _wifi_status); + } else if (ipv4_address == 0) { + _last_ip = 0; + serial_write_compressed(translate("No IP")); + } else { + } + } else { + // Keep Wi-Fi print separate so its data can be matched with the one above. + serial_write_compressed(translate("Wi-Fi: ")); + serial_write_compressed(translate("off")); + } +} +#endif + +void supervisor_start_web_workflow(void) { + #if CIRCUITPY_WEB_WORKFLOW && CIRCUITPY_WIFI + + + char ssid[33]; + char password[64]; + mp_int_t ssid_len = 0; + mp_int_t password_len = 0; + + #if CIRCUITPY_DOTENV + ssid_len = dotenv_get_key("/.env", "CIRCUITPY_WIFI_SSID", ssid, sizeof(ssid) - 1); + password_len = dotenv_get_key("/.env", "CIRCUITPY_WIFI_PASSWORD", password, sizeof(password) - 1); + #endif + if (ssid_len <= 0 || (size_t)ssid_len >= sizeof(ssid) || + password_len <= 0 || (size_t)password_len >= sizeof(password)) { + return; + } + if (!common_hal_wifi_radio_get_enabled(&common_hal_wifi_radio_obj)) { + common_hal_wifi_init(false); + common_hal_wifi_radio_set_enabled(&common_hal_wifi_radio_obj, true); + } + + // TODO: Do our own scan so that we can find the channel we want before calling connect. + // Otherwise, connect will do a full slow scan to pick the best AP. + + // NUL terminate the strings because dotenv doesn't. + ssid[ssid_len] = '\0'; + password[password_len] = '\0'; + // We can all connect again because it will return early if we're already connected to the + // network. If we are connected to a different network, then it will disconnect before + // attempting to connect to the given network. + _wifi_status = common_hal_wifi_radio_connect( + &common_hal_wifi_radio_obj, (uint8_t *)ssid, ssid_len, (uint8_t *)password, password_len, + 0, 0.1, NULL, 0); + + if (_wifi_status != WIFI_RADIO_ERROR_NONE) { + common_hal_wifi_radio_set_enabled(&common_hal_wifi_radio_obj, false); + return; + } + + char port_encoded[6]; + size_t port_len = 0; + size_t new_port = web_api_port; + #if CIRCUITPY_DOTENV + port_len = dotenv_get_key("/.env", "CIRCUITPY_WEB_API_PORT", port_encoded, sizeof(port_encoded) - 1); + #endif + if (0 < port_len && port_len < sizeof(port_encoded)) { + port_encoded[port_len] = '\0'; + new_port = strtoul(port_encoded, NULL, 10); + } + + bool first_start = mdns.base.type != &mdns_server_type; + bool port_changed = new_port != web_api_port; + + if (first_start) { + ESP_LOGI(TAG, "Starting web workflow"); + mdns_server_construct(&mdns, true); + mdns.base.type = &mdns_server_type; + common_hal_mdns_server_set_instance_name(&mdns, MICROPY_HW_BOARD_NAME); + pool.base.type = &socketpool_socketpool_type; + common_hal_socketpool_socketpool_construct(&pool, &common_hal_wifi_radio_obj); + + listening.base.type = &socketpool_socket_type; + active.base.type = &socketpool_socket_type; + active.num = -1; + active.connected = false; + + websocket_init(); + } + if (port_changed) { + common_hal_socketpool_socket_close(&listening); + } + if (first_start || port_changed) { + web_api_port = new_port; + common_hal_mdns_server_advertise_service(&mdns, "_circuitpython", "_tcp", web_api_port); + socketpool_socket(&pool, SOCKETPOOL_AF_INET, SOCKETPOOL_SOCK_STREAM, &listening); + common_hal_socketpool_socket_settimeout(&listening, 0); + // Bind to any ip. + common_hal_socketpool_socket_bind(&listening, "", 0, web_api_port); + common_hal_socketpool_socket_listen(&listening, 1); + } + + mp_int_t api_password_len = dotenv_get_key("/.env", "CIRCUITPY_WEB_API_PASSWORD", _api_password + 1, sizeof(_api_password) - 2); + if (api_password_len > 0) { + _api_password[0] = ':'; + _api_password[api_password_len + 1] = '\0'; + _base64_in_place(_api_password, api_password_len + 1, sizeof(_api_password)); + } + + // TODO: + // GET /edit/ + // - Super basic editor + #endif +} + +void web_workflow_send_raw(socketpool_socket_obj_t *socket, const uint8_t *buf, int len) { + int total_sent = 0; + int sent = -EAGAIN; + while ((sent == -EAGAIN || (sent > 0 && total_sent < len)) && + common_hal_socketpool_socket_get_connected(socket)) { + sent = socketpool_socket_send(socket, buf + total_sent, len - total_sent); + if (sent > 0) { + total_sent += sent; + if (total_sent < len) { + // Yield so that network code can run. + port_yield(); + } + } + } + if (total_sent < len) { + ESP_LOGE(TAG, "short send %d %d", sent, len); + } +} + +STATIC void _print_raw(void *env, const char *str, size_t len) { + web_workflow_send_raw((socketpool_socket_obj_t *)env, (const uint8_t *)str, (size_t)len); +} + +static void _send_str(socketpool_socket_obj_t *socket, const char *str) { + web_workflow_send_raw(socket, (const uint8_t *)str, strlen(str)); +} + +// The last argument must be NULL! Otherwise, it won't stop. +static void _send_strs(socketpool_socket_obj_t *socket, ...) { + va_list ap; + va_start(ap, socket); + + const char *str = va_arg(ap, const char *); + while (str != NULL) { + _send_str(socket, str); + str = va_arg(ap, const char *); + } + va_end(ap); +} + +static void _send_chunk(socketpool_socket_obj_t *socket, const char *chunk) { + mp_print_t _socket_print = {socket, _print_raw}; + mp_printf(&_socket_print, "%X\r\n", strlen(chunk)); + web_workflow_send_raw(socket, (const uint8_t *)chunk, strlen(chunk)); + web_workflow_send_raw(socket, (const uint8_t *)"\r\n", 2); +} + +STATIC void _print_chunk(void *env, const char *str, size_t len) { + mp_print_t _socket_print = {env, _print_raw}; + mp_printf(&_socket_print, "%X\r\n", len); + web_workflow_send_raw((socketpool_socket_obj_t *)env, (const uint8_t *)str, len); + web_workflow_send_raw((socketpool_socket_obj_t *)env, (const uint8_t *)"\r\n", 2); +} + +// A bit of a misnomer because it sends all arguments as one chunk. +// The last argument must be NULL! Otherwise, it won't stop. +static void _send_chunks(socketpool_socket_obj_t *socket, ...) { + va_list strs_to_count; + va_start(strs_to_count, socket); + + va_list strs_to_send; + va_copy(strs_to_send, strs_to_count); + + size_t chunk_len = 0; + const char *str = va_arg(strs_to_count, const char *); + while (str != NULL) { + chunk_len += strlen(str); + str = va_arg(strs_to_count, const char *); + } + va_end(strs_to_count); + + + mp_print_t _socket_print = {socket, _print_raw}; + mp_printf(&_socket_print, "%X\r\n", chunk_len); + + str = va_arg(strs_to_send, const char *); + while (str != NULL) { + _send_str(socket, str); + str = va_arg(strs_to_send, const char *); + } + va_end(strs_to_send); + + _send_str(socket, "\r\n"); +} + +static bool _endswith(const char *str, const char *suffix) { + if (str == NULL || suffix == NULL) { + return false; + } + if (strlen(suffix) > strlen(str)) { + return false; + } + return strcmp(str + (strlen(str) - strlen(suffix)), suffix) == 0; +} + +const char *ok_hosts[] = { + "code.circuitpython.org", + "127.0.0.1", + "localhost", +}; + +static bool _origin_ok(const char *origin) { + const char *http = "http://"; + const char *local = ".local"; + + // note: redirected requests send an Origin of "null" and will be caught by this + if (strncmp(origin, http, strlen(http)) != 0) { + return false; + } + // These are prefix checks up to : so that any port works. + const char *hostname = common_hal_mdns_server_get_hostname(&mdns); + const char *end = origin + strlen(http) + strlen(hostname) + strlen(local); + if (strncmp(origin + strlen(http), hostname, strlen(hostname)) == 0 && + strncmp(origin + strlen(http) + strlen(hostname), local, strlen(local)) == 0 && + (end[0] == '\0' || end[0] == ':')) { + return true; + } + + _update_encoded_ip(); + end = origin + strlen(http) + strlen(_our_ip_encoded); + if (strncmp(origin + strlen(http), _our_ip_encoded, strlen(_our_ip_encoded)) == 0 && + (end[0] == '\0' || end[0] == ':')) { + return true; + } + + for (size_t i = 0; i < MP_ARRAY_SIZE(ok_hosts); i++) { + // Allows any port + end = origin + strlen(http) + strlen(ok_hosts[i]); + if (strncmp(origin + strlen(http), ok_hosts[i], strlen(ok_hosts[i])) == 0 + && (end[0] == '\0' || end[0] == ':')) { + return true; + } + } + return false; +} + +STATIC bool _usb_active(void) { + // Check to see if USB has already been mounted. If not, then we "eject" from USB until we're done. + #if CIRCUITPY_USB && CIRCUITPY_USB_MSC + if (storage_usb_enabled() && !usb_msc_lock()) { + return true; + } + #endif + return false; +} + + +static const char *OK_JSON = "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\nContent-Type: application/json\r\n"; + +static void _cors_header(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "Access-Control-Allow-Credentials: true\r\n", + "Vary: Origin, Accept, Upgrade\r\n", + "Access-Control-Allow-Origin: ", request->origin, "\r\n", + NULL); +} + +static void _reply_continue(socketpool_socket_obj_t *socket, _request *request) { + _send_str(socket, "HTTP/1.1 100 Continue\r\n"); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_created(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 201 Created\r\n", + "Content-Length: 0\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_no_content(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 204 No Content\r\n", + "Content-Length: 0\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_access_control(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 204 No Content\r\n", + "Content-Length: 0\r\n", + "Access-Control-Expose-Headers: Access-Control-Allow-Methods\r\n", + "Access-Control-Allow-Headers: X-Timestamp, X-Destination, Content-Type, Authorization\r\n", + "Access-Control-Allow-Methods:GET, OPTIONS", NULL); + if (!_usb_active()) { + _send_str(socket, ", PUT, DELETE, MOVE"); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + } + _send_str(socket, "\r\n"); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_missing(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 404 Not Found\r\n", + "Content-Length: 0\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_method_not_allowed(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 405 Method Not Allowed\r\n", + "Content-Length: 0\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_forbidden(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 403 Forbidden\r\n", + "Content-Length: 0\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_conflict(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 409 Conflict\r\n", + "Content-Length: 19\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\nUSB storage active."); +} + + +static void _reply_precondition_failed(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 412 Precondition Failed\r\n", + "Content-Length: 0\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_payload_too_large(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 413 Payload Too Large\r\n", + "Content-Length: 0\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_expectation_failed(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 417 Expectation Failed\r\n", + "Content-Length: 0\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_unauthorized(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 401 Unauthorized\r\n", + "Content-Length: 0\r\n", + "WWW-Authenticate: Basic realm=\"CircuitPython\"\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_server_error(socketpool_socket_obj_t *socket, _request *request) { + _send_strs(socket, + "HTTP/1.1 500 Internal Server Error\r\n", + "Content-Length: 0\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_redirect(socketpool_socket_obj_t *socket, _request *request, const char *path) { + int nodelay = 1; + lwip_setsockopt(socket->num, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay)); + const char *hostname = common_hal_mdns_server_get_hostname(&mdns); + _send_strs(socket, + "HTTP/1.1 307 Temporary Redirect\r\n", + "Connection: close\r\n", + "Content-Length: 0\r\n", + "Location: ", NULL); + if (request->websocket) { + _send_str(socket, "ws"); + } else { + _send_str(socket, "http"); + } + + _send_strs(socket, "://", hostname, ".local", NULL); + if (web_api_port != 80) { + mp_print_t _socket_print = {socket, _print_raw}; + mp_printf(&_socket_print, ":%d", web_api_port); + } + _send_strs(socket, path, "\r\n", NULL); + _cors_header(socket, request); + _send_str(socket, "\r\n"); +} + +static void _reply_directory_json(socketpool_socket_obj_t *socket, _request *request, FF_DIR *dir, const char *request_path, const char *path) { + socketpool_socket_send(socket, (const uint8_t *)OK_JSON, strlen(OK_JSON)); + _cors_header(socket, request); + _send_str(socket, "\r\n"); + mp_print_t _socket_print = {socket, _print_chunk}; + _send_chunk(socket, "["); + bool first = true; + + FILINFO file_info; + char *fn = file_info.fname; + FRESULT res = f_readdir(dir, &file_info); + while (res == FR_OK && fn[0] != 0) { + if (!first) { + _send_chunk(socket, ","); + } + _send_chunks(socket, + "{\"name\": \"", file_info.fname, "\",", + "\"directory\": ", NULL); + if ((file_info.fattrib & AM_DIR) != 0) { + _send_chunk(socket, "true"); + } else { + _send_chunk(socket, "false"); + } + // We use nanoseconds past Jan 1, 1970 for consistency with BLE API and + // LittleFS. + _send_chunk(socket, ", "); + + uint32_t truncated_time = timeutils_mktime(1980 + (file_info.fdate >> 9), + (file_info.fdate >> 5) & 0xf, + file_info.fdate & 0x1f, + file_info.ftime >> 11, + (file_info.ftime >> 5) & 0x1f, + (file_info.ftime & 0x1f) * 2); + + // Manually append zeros to make the time nanoseconds. Support for printing 64 bit numbers + // varies across chipsets. + mp_printf(&_socket_print, "\"modified_ns\": %lu000000000, ", truncated_time); + size_t file_size = 0; + if ((file_info.fattrib & AM_DIR) == 0) { + file_size = file_info.fsize; + } + mp_printf(&_socket_print, "\"file_size\": %d }", file_size); + + first = false; + res = f_readdir(dir, &file_info); + } + _send_chunk(socket, "]"); + _send_chunk(socket, ""); +} + +static void _reply_with_file(socketpool_socket_obj_t *socket, _request *request, const char *filename, FIL *active_file) { + uint32_t total_length = f_size(active_file); + + _send_str(socket, "HTTP/1.1 200 OK\r\n"); + mp_print_t _socket_print = {socket, _print_raw}; + mp_printf(&_socket_print, "Content-Length: %d\r\n", total_length); + // TODO: Make this a table to save space. + if (_endswith(filename, ".txt") || _endswith(filename, ".py")) { + _send_strs(socket, "Content-Type: text/plain", ";charset=UTF-8\r\n", NULL); + } else if (_endswith(filename, ".js")) { + _send_strs(socket, "Content-Type: text/javascript", ";charset=UTF-8\r\n", NULL); + } else if (_endswith(filename, ".html")) { + _send_strs(socket, "Content-Type: text/html", ";charset=UTF-8\r\n", NULL); + } else if (_endswith(filename, ".json")) { + _send_strs(socket, "Content-Type: application/json", ";charset=UTF-8\r\n", NULL); + } else { + _send_str(socket, "Content-Type: application/octet-stream\r\n"); + } + _cors_header(socket, request); + _send_str(socket, "\r\n"); + + uint32_t total_read = 0; + while (total_read < total_length) { + uint8_t data_buffer[64]; + size_t quantity_read; + f_read(active_file, data_buffer, 64, &quantity_read); + total_read += quantity_read; + uint32_t send_offset = 0; + while (send_offset < quantity_read) { + int sent = socketpool_socket_send(socket, data_buffer + send_offset, quantity_read - send_offset); + if (sent < 0) { + if (sent == -EAGAIN) { + sent = 0; + } else { + ESP_LOGE(TAG, "file send error %d", sent); + break; + } + } + send_offset += sent; + } + } + if (total_read < total_length) { + socketpool_socket_close(socket); + } +} + +static void _reply_with_devices_json(socketpool_socket_obj_t *socket, _request *request) { + mdns_remoteservice_obj_t found_devices[32]; + size_t total_results = mdns_server_find(&mdns, "_circuitpython", "_tcp", 1, found_devices, MP_ARRAY_SIZE(found_devices)); + size_t count = MIN(total_results, MP_ARRAY_SIZE(found_devices)); + socketpool_socket_send(socket, (const uint8_t *)OK_JSON, strlen(OK_JSON)); + _cors_header(socket, request); + _send_str(socket, "\r\n"); + mp_print_t _socket_print = {socket, _print_chunk}; + + mp_printf(&_socket_print, "{\"total\": %d, \"devices\": [", total_results); + for (size_t i = 0; i < count; i++) { + if (i > 0) { + _send_chunk(socket, ","); + } + const char *hostname = common_hal_mdns_remoteservice_get_hostname(&found_devices[i]); + const char *instance_name = common_hal_mdns_remoteservice_get_instance_name(&found_devices[i]); + int port = common_hal_mdns_remoteservice_get_port(&found_devices[i]); + uint32_t ipv4_address = mdns_remoteservice_get_ipv4_address(&found_devices[i]); + uint8_t *octets = (uint8_t *)&ipv4_address; + mp_printf(&_socket_print, + "{\"hostname\": \"%s\", " + "\"instance_name\": \"%s\", " + "\"port\": %d, " + "\"ip\": \"%d.%d.%d.%d\"}", hostname, instance_name, port, octets[0], octets[1], octets[2], octets[3]); + common_hal_mdns_remoteservice_deinit(&found_devices[i]); + } + _send_chunk(socket, "]}"); + // Empty chunk signals the end of the response. + _send_chunk(socket, ""); +} + +static void _reply_with_version_json(socketpool_socket_obj_t *socket, _request *request) { + _send_str(socket, OK_JSON); + _cors_header(socket, request); + _send_str(socket, "\r\n"); + mp_print_t _socket_print = {socket, _print_chunk}; + + const char *hostname = common_hal_mdns_server_get_hostname(&mdns); + _update_encoded_ip(); + // Note: this leverages the fact that C concats consecutive string literals together. + mp_printf(&_socket_print, + "{\"web_api_version\": 1, " + "\"version\": \"" MICROPY_GIT_TAG "\", " + "\"build_date\": \"" MICROPY_BUILD_DATE "\", " + "\"board_name\": \"" MICROPY_HW_BOARD_NAME "\", " + "\"mcu_name\": \"" MICROPY_HW_MCU_NAME "\", " + "\"board_id\": \"" CIRCUITPY_BOARD_ID "\", " + "\"creator_id\": %u, " + "\"creation_id\": %u, " + "\"hostname\": \"%s\", " + "\"port\": %d, ", CIRCUITPY_CREATOR_ID, CIRCUITPY_CREATION_ID, hostname, web_api_port, _our_ip_encoded); + #if CIRCUITPY_MICROCONTROLLER && COMMON_HAL_MCU_PROCESSOR_UID_LENGTH > 0 + uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH]; + common_hal_mcu_processor_get_uid(raw_id); + mp_printf(&_socket_print, "\"UID\": \""); + for (uint8_t i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) { + mp_printf(&_socket_print, "%02X", raw_id[i]); + } + mp_printf(&_socket_print, "\", "); + #endif + mp_printf(&_socket_print, "\"ip\": \"%s\"}", _our_ip_encoded); + // Empty chunk signals the end of the response. + _send_chunk(socket, ""); +} + +// FATFS has a two second timestamp resolution but the BLE API allows for nanosecond resolution. +// This function truncates the time the time to a resolution storable by FATFS and fills in the +// FATFS encoded version into fattime. +STATIC uint64_t truncate_time(uint64_t input_time, DWORD *fattime) { + timeutils_struct_time_t tm; + uint64_t seconds_since_epoch = timeutils_seconds_since_epoch_from_nanoseconds_since_1970(input_time); + timeutils_seconds_since_epoch_to_struct_time(seconds_since_epoch, &tm); + uint64_t truncated_time = timeutils_nanoseconds_since_epoch_to_nanoseconds_since_1970((seconds_since_epoch / 2) * 2 * 1000000000); + + *fattime = ((tm.tm_year - 1980) << 25) | (tm.tm_mon << 21) | (tm.tm_mday << 16) | + (tm.tm_hour << 11) | (tm.tm_min << 5) | (tm.tm_sec >> 1); + return truncated_time; +} + +STATIC void _discard_incoming(socketpool_socket_obj_t *socket, size_t amount) { + size_t discarded = 0; + while (discarded < amount) { + uint8_t bytes[64]; + size_t read_len = MIN(sizeof(bytes), amount - discarded); + int len = socketpool_socket_recv_into(socket, bytes, read_len); + if (len < 0) { + break; + } + discarded += read_len; + } +} + +static void _write_file_and_reply(socketpool_socket_obj_t *socket, _request *request, FATFS *fs, const TCHAR *path) { + FIL active_file; + + if (_usb_active()) { + _discard_incoming(socket, request->content_length); + _reply_conflict(socket, request); + return; + } + if (request->timestamp_ms > 0) { + DWORD fattime; + truncate_time(request->timestamp_ms * 1000000, &fattime); + override_fattime(fattime); + } + + FRESULT result = f_open(fs, &active_file, path, FA_WRITE); + bool new_file = false; + if (result == FR_NO_FILE) { + new_file = true; + result = f_open(fs, &active_file, path, FA_WRITE | FA_OPEN_ALWAYS); + } + + if (result == FR_NO_PATH) { + override_fattime(0); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + _discard_incoming(socket, request->content_length); + _reply_missing(socket, request); + return; + } + if (result != FR_OK) { + ESP_LOGE(TAG, "file write error %d %s", result, path); + override_fattime(0); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + _discard_incoming(socket, request->content_length); + _reply_server_error(socket, request); + return; + } else if (request->expect) { + _reply_continue(socket, request); + } + + // Change the file size to start. + f_lseek(&active_file, request->content_length); + if (f_tell(&active_file) < request->content_length) { + f_close(&active_file); + override_fattime(0); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + _discard_incoming(socket, request->content_length); + // Too large. + if (request->expect) { + _reply_expectation_failed(socket, request); + } else { + _reply_payload_too_large(socket, request); + } + + return; + } + f_truncate(&active_file); + f_rewind(&active_file); + + size_t total_read = 0; + bool error = false; + while (total_read < request->content_length && !error) { + uint8_t bytes[64]; + size_t read_len = MIN(sizeof(bytes), request->content_length - total_read); + int len = socketpool_socket_recv_into(socket, bytes, read_len); + if (len < 0) { + if (len == -EAGAIN) { + continue; + } else { + ESP_LOGE(TAG, "other error %d", len); + } + error = true; + break; + } + UINT actual; + f_write(&active_file, bytes, len, &actual); + if (actual != (UINT)len) { + ESP_LOGE(TAG, "didn't write whole file"); + } + total_read += len; + } + + f_close(&active_file); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + + override_fattime(0); + if (new_file) { + _reply_created(socket, request); + } else { + _reply_no_content(socket, request); + } +} + +#define STATIC_FILE(filename) extern uint32_t filename##_length; extern uint8_t filename[]; extern const char *filename##_content_type; + +STATIC_FILE(code_html); +STATIC_FILE(directory_html); +STATIC_FILE(directory_js); +STATIC_FILE(welcome_html); +STATIC_FILE(welcome_js); +STATIC_FILE(edit_html); +STATIC_FILE(edit_js); +STATIC_FILE(style_css); +STATIC_FILE(serial_html); +STATIC_FILE(serial_js); +STATIC_FILE(blinka_16x16_ico); + +static void _reply_static(socketpool_socket_obj_t *socket, _request *request, const uint8_t *response, size_t response_len, const char *content_type) { + uint32_t total_length = response_len; + char encoded_len[10]; + snprintf(encoded_len, sizeof(encoded_len), "%d", total_length); + + _send_strs(socket, + "HTTP/1.1 200 OK\r\n", + "Content-Encoding: gzip\r\n", + "Content-Length: ", encoded_len, "\r\n", + "Content-Type: ", content_type, "\r\n", + "\r\n", NULL); + web_workflow_send_raw(socket, response, response_len); +} + +#define _REPLY_STATIC(socket, request, filename) _reply_static(socket, request, filename, filename##_length, filename##_content_type) + +static void _reply_websocket_upgrade(socketpool_socket_obj_t *socket, _request *request) { + // Compute accept key + hashlib_hash_obj_t hash; + common_hal_hashlib_new(&hash, "sha1"); + common_hal_hashlib_hash_update(&hash, (const uint8_t *)request->websocket_key, strlen(request->websocket_key)); + const char *magic_string = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; + common_hal_hashlib_hash_update(&hash, (const uint8_t *)magic_string, strlen(magic_string)); + size_t digest_size = common_hal_hashlib_hash_get_digest_size(&hash); + size_t encoded_size = (digest_size + 1) * 4 / 3 + 1; + uint8_t encoded_accept[encoded_size]; + common_hal_hashlib_hash_digest(&hash, encoded_accept, sizeof(encoded_accept)); + _base64_in_place((char *)encoded_accept, digest_size, encoded_size); + + // Reply with upgrade + _send_strs(socket, "HTTP/1.1 101 Switching Protocols\r\n", + "Upgrade: websocket\r\n", + "Connection: Upgrade\r\n", + "Sec-WebSocket-Accept: ", encoded_accept, "\r\n", + "\r\n", NULL); + websocket_handoff(socket); + // socket is now closed and "disconnected". +} + +static uint8_t _hex2nibble(char h) { + if ('0' <= h && h <= '9') { + return h - '0'; + } else if ('A' <= h && h <= 'F') { + return h - 'A' + 0xa; + } + // Shouldn't usually use lower case. + return h - 'a' + 0xa; +} + +// Decode percent encoding in place. Only do this once on a string! +static void _decode_percents(char *str) { + size_t o = 0; + size_t i = 0; + size_t startlen = strlen(str); + while (i < startlen) { + if (str[i] == '%') { + str[o] = _hex2nibble(str[i + 1]) << 4 | _hex2nibble(str[i + 2]); + i += 3; + } else { + if (i != o) { + str[o] = str[i]; + } + i += 1; + } + o += 1; + } + if (o < i) { + str[o] = '\0'; + } +} + +static bool _reply(socketpool_socket_obj_t *socket, _request *request) { + if (request->redirect) { + _reply_redirect(socket, request, request->path); + } else if (strlen(request->origin) > 0 && !_origin_ok(request->origin)) { + ESP_LOGE(TAG, "bad origin %s", request->origin); + _reply_forbidden(socket, request); + } else if (strncmp(request->path, "/fs/", 4) == 0) { + if (strcasecmp(request->method, "OPTIONS") == 0) { + // OPTIONS is sent for CORS preflight, unauthenticated + _reply_access_control(socket, request); + } else if (!request->authenticated) { + if (_api_password[0] != '\0') { + _reply_unauthorized(socket, request); + } else { + _reply_forbidden(socket, request); + } + } else { + // Decode any percent encoded bytes so that we're left with UTF-8. + // We only do this on /fs/ paths and after redirect so that any + // path echoing we do stays encoded. + _decode_percents(request->path); + + char *path = request->path + 3; + size_t pathlen = strlen(path); + FATFS *fs = filesystem_circuitpy(); + // Trailing / is a directory. + bool directory = false; + if (path[pathlen - 1] == '/') { + // FATFS lib doesn't like a trailing / for paths besides root. + if (pathlen > 1) { + path[pathlen - 1] = '\0'; + } + directory = true; + } + // Delete is almost identical for files and directories so share the + // implementation. + if (strcasecmp(request->method, "DELETE") == 0) { + if (_usb_active()) { + _reply_conflict(socket, request); + return false; + } + + FILINFO file; + FRESULT result = f_stat(fs, path, &file); + if (result == FR_OK) { + if ((file.fattrib & AM_DIR) != 0) { + result = supervisor_workflow_delete_directory_contents(fs, path); + } + if (result == FR_OK) { + result = f_unlink(fs, path); + } + } + + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + if (result == FR_NO_PATH || result == FR_NO_FILE) { + _reply_missing(socket, request); + } else if (result != FR_OK) { + ESP_LOGE(TAG, "rm error %d %s", result, path); + _reply_server_error(socket, request); + } else { + _reply_no_content(socket, request); + return true; + } + } else if (strcasecmp(request->method, "MOVE") == 0) { + if (_usb_active()) { + _reply_conflict(socket, request); + return false; + } + + _decode_percents(request->destination); + char *destination = request->destination + 3; + size_t destinationlen = strlen(destination); + if (destination[destinationlen - 1] == '/' && destinationlen > 1) { + destination[destinationlen - 1] = '\0'; + } + + FRESULT result = f_rename(fs, path, destination); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + if (result == FR_EXIST) { // File exists and won't be overwritten. + _reply_precondition_failed(socket, request); + } else if (result == FR_NO_PATH || result == FR_NO_FILE) { // Missing higher directories or target file. + _reply_missing(socket, request); + } else if (result != FR_OK) { + ESP_LOGE(TAG, "move error %d %s", result, path); + _reply_server_error(socket, request); + } else { + _reply_created(socket, request); + return true; + } + } else if (directory) { + if (strcasecmp(request->method, "GET") == 0) { + FF_DIR dir; + FRESULT res = f_opendir(fs, &dir, path); + // Put the / back for replies. + if (pathlen > 1) { + path[pathlen - 1] = '/'; + } + if (res != FR_OK) { + _reply_missing(socket, request); + return false; + } + if (request->json) { + _reply_directory_json(socket, request, &dir, request->path, path); + } else if (pathlen == 1) { + _REPLY_STATIC(socket, request, directory_html); + } else { + _reply_missing(socket, request); + } + + f_closedir(&dir); + } else if (strcasecmp(request->method, "PUT") == 0) { + if (_usb_active()) { + _reply_conflict(socket, request); + return false; + } + + if (request->timestamp_ms > 0) { + DWORD fattime; + truncate_time(request->timestamp_ms * 1000000, &fattime); + override_fattime(fattime); + } + FRESULT result = supervisor_workflow_mkdir_parents(fs, path); + override_fattime(0); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + if (result == FR_EXIST) { + _reply_no_content(socket, request); + } else if (result == FR_NO_PATH) { + _reply_missing(socket, request); + } else if (result != FR_OK) { + ESP_LOGE(TAG, "mkdir error %d %s", result, path); + _reply_server_error(socket, request); + } else { + _reply_created(socket, request); + return true; + } + } + } else { // Dealing with a file. + if (strcasecmp(request->method, "GET") == 0) { + FIL active_file; + FRESULT result = f_open(fs, &active_file, path, FA_READ); + + if (result != FR_OK) { + _reply_missing(socket, request); + } else { + _reply_with_file(socket, request, path, &active_file); + } + + f_close(&active_file); + } else if (strcasecmp(request->method, "PUT") == 0) { + _write_file_and_reply(socket, request, fs, path); + return true; + } + } + } + } else if (strcmp(request->path, "/edit/") == 0) { + if (!request->authenticated) { + if (_api_password[0] != '\0') { + _reply_unauthorized(socket, request); + } else { + _reply_forbidden(socket, request); + } + } else { + _REPLY_STATIC(socket, request, edit_html); + } + } else if (strcmp(request->path, "/code/") == 0) { + _REPLY_STATIC(socket, request, code_html); + } else if (strncmp(request->path, "/cp/", 4) == 0) { + const char *path = request->path + 3; + if (strcasecmp(request->method, "OPTIONS") == 0) { + // handle preflight requests to /cp/ + _reply_access_control(socket, request); + } else if (strcasecmp(request->method, "GET") != 0) { + _reply_method_not_allowed(socket, request); + } else if (strcmp(path, "/devices.json") == 0) { + _reply_with_devices_json(socket, request); + } else if (strcmp(path, "/version.json") == 0) { + _reply_with_version_json(socket, request); + } else if (strcmp(path, "/serial/") == 0) { + if (!request->authenticated) { + if (_api_password[0] != '\0') { + _reply_unauthorized(socket, request); + } else { + _reply_forbidden(socket, request); + } + } else if (request->websocket) { + _reply_websocket_upgrade(socket, request); + } else { + _REPLY_STATIC(socket, request, serial_html); + } + } else { + _reply_missing(socket, request); + } + } else if (strcasecmp(request->method, "GET") != 0) { + _reply_method_not_allowed(socket, request); + } else { + if (strcmp(request->path, "/") == 0) { + // TODO: Autogenerate this based on the blinka bitmap and change the + // palette based on MAC address. + _REPLY_STATIC(socket, request, welcome_html); + } else if (strcmp(request->path, "/directory.js") == 0) { + _REPLY_STATIC(socket, request, directory_js); + } else if (strcmp(request->path, "/welcome.js") == 0) { + _REPLY_STATIC(socket, request, welcome_js); + } else if (strcmp(request->path, "/serial.js") == 0) { + _REPLY_STATIC(socket, request, serial_js); + } else if (strcmp(request->path, "/edit.js") == 0) { + _REPLY_STATIC(socket, request, edit_js); + } else if (strcmp(request->path, "/style.css") == 0) { + _REPLY_STATIC(socket, request, style_css); + } else if (strcmp(request->path, "/favicon.ico") == 0) { + // TODO: Autogenerate this based on the blinka bitmap and change the + // palette based on MAC address. + _REPLY_STATIC(socket, request, blinka_16x16_ico); + } else { + _reply_missing(socket, request); + } + } + return false; +} + +static void _reset_request(_request *request) { + request->state = STATE_METHOD; + request->origin[0] = '\0'; + request->content_length = 0; + request->offset = 0; + request->timestamp_ms = 0; + request->redirect = false; + request->done = false; + request->in_progress = false; + request->authenticated = false; + request->expect = false; + request->json = false; + request->websocket = false; +} + +static void _process_request(socketpool_socket_obj_t *socket, _request *request) { + bool more = true; + bool error = false; + uint8_t c; + // This code assumes header lines are terminated with \r\n + while (more && !error) { + int len = socketpool_socket_recv_into(socket, &c, 1); + if (len != 1) { + more = false; + break; + } + if (!request->in_progress) { + autoreload_suspend(AUTORELOAD_SUSPEND_WEB); + request->in_progress = true; + } + switch (request->state) { + case STATE_METHOD: { + if (c == ' ') { + request->method[request->offset] = '\0'; + request->offset = 0; + request->state = STATE_PATH; + } else if (request->offset > sizeof(request->method) - 1) { + // Skip methods that are too long. + } else { + request->method[request->offset] = c; + request->offset++; + } + break; + } + case STATE_PATH: { + if (c == ' ') { + request->path[request->offset] = '\0'; + request->offset = 0; + ESP_LOGI(TAG, "Request %s %s", request->method, request->path); + request->state = STATE_VERSION; + } else if (request->offset > sizeof(request->path) - 1) { + // Skip methods that are too long. + } else { + request->path[request->offset] = c; + request->offset++; + } + break; + } + case STATE_VERSION: { + const char *supported_version = "HTTP/1.1\r"; + error = supported_version[request->offset] != c; + request->offset++; + if (request->offset == strlen(supported_version)) { + request->state = STATE_HEADER_KEY; + request->offset = 0; + } + break; + } + case STATE_HEADER_KEY: { + if (c == '\r') { + request->state = STATE_BODY; + } else if (c == '\n') { + // Consume the \n + } else if (c == ':') { + request->header_key[request->offset] = '\0'; + request->offset = 0; + request->state = STATE_HEADER_VALUE; + } else if (request->offset > sizeof(request->header_key) - 1) { + // Skip methods that are too long. + } else { + request->header_key[request->offset] = c; + request->offset++; + } + break; + } + case STATE_HEADER_VALUE: { + if (request->offset == 0) { + error = c != ' '; + request->offset++; + } else if (c == '\r') { + request->header_value[request->offset - 1] = '\0'; + request->offset = 0; + request->state = STATE_HEADER_KEY; + if (strcasecmp(request->header_key, "Authorization") == 0) { + const char *prefix = "Basic "; + request->authenticated = strncmp(request->header_value, prefix, strlen(prefix)) == 0 && + strcmp(_api_password, request->header_value + strlen(prefix)) == 0; + } else if (strcasecmp(request->header_key, "Host") == 0) { + // Do a prefix check so that port is ignored. Length must be the same or the + // header ends in :. + const char *cp_local = "circuitpython.local"; + request->redirect = strncmp(request->header_value, cp_local, strlen(cp_local)) == 0 && + (strlen(request->header_value) == strlen(cp_local) || + request->header_value[strlen(cp_local)] == ':'); + } else if (strcasecmp(request->header_key, "Content-Length") == 0) { + request->content_length = strtoul(request->header_value, NULL, 10); + } else if (strcasecmp(request->header_key, "Expect") == 0) { + request->expect = strcmp(request->header_value, "100-continue") == 0; + } else if (strcasecmp(request->header_key, "Accept") == 0) { + request->json = strcasecmp(request->header_value, "application/json") == 0; + } else if (strcasecmp(request->header_key, "Origin") == 0) { + strcpy(request->origin, request->header_value); + } else if (strcasecmp(request->header_key, "X-Timestamp") == 0) { + request->timestamp_ms = strtoull(request->header_value, NULL, 10); + } else if (strcasecmp(request->header_key, "Upgrade") == 0) { + request->websocket = strcmp(request->header_value, "websocket") == 0; + } else if (strcasecmp(request->header_key, "Sec-WebSocket-Version") == 0) { + request->websocket_version = strtoul(request->header_value, NULL, 10); + } else if (strcasecmp(request->header_key, "Sec-WebSocket-Key") == 0 && + strlen(request->header_value) == 24) { + strcpy(request->websocket_key, request->header_value); + } else if (strcasecmp(request->header_key, "X-Destination") == 0) { + strcpy(request->destination, request->header_value); + } + ESP_LOGI(TAG, "Header %s %s", request->header_key, request->header_value); + } else if (request->offset > sizeof(request->header_value) - 1) { + // Skip methods that are too long. + } else { + request->header_value[request->offset - 1] = c; + request->offset++; + } + break; + } + case STATE_BODY: + request->done = true; + more = false; + break; + } + } + if (error) { + const char *error_response = "HTTP/1.1 501 Not Implemented\r\n\r\n"; + int nodelay = 1; + lwip_setsockopt(socket->num, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay)); + socketpool_socket_send(socket, (const uint8_t *)error_response, strlen(error_response)); + } + if (!request->done) { + return; + } + bool reload = _reply(socket, request); + _reset_request(request); + autoreload_resume(AUTORELOAD_SUSPEND_WEB); + if (reload) { + autoreload_trigger(); + } +} + + +void supervisor_web_workflow_background(void) { + // Otherwise, see if we have another socket to accept. + if ((!common_hal_socketpool_socket_get_connected(&active) || !active_request.in_progress) && + !common_hal_socketpool_socket_get_closed(&listening) && + listening.num > 0) { + uint32_t ip; + uint32_t port; + int newsoc = socketpool_socket_accept(&listening, (uint8_t *)&ip, &port); + if (newsoc == -EBADF) { + common_hal_socketpool_socket_close(&listening); + return; + } + if (newsoc > 0) { + // Close the active socket because we have another we accepted. + if (!common_hal_socketpool_socket_get_closed(&active)) { + common_hal_socketpool_socket_close(&active); + } + // TODO: Don't do this because it uses the private struct layout. + // Create the socket + active.num = newsoc; + active.pool = &pool; + active.connected = true; + + common_hal_socketpool_socket_settimeout(&active, 0); + + _reset_request(&active_request); + + lwip_fcntl(newsoc, F_SETFL, O_NONBLOCK); + } + } + + // If we have a request in progress, continue working on it. + if (common_hal_socketpool_socket_get_connected(&active)) { + _process_request(&active, &active_request); + } else { + // Close the active socket if it is no longer connected. + common_hal_socketpool_socket_close(&active); + } + + websocket_background(); +} + +void supervisor_stop_web_workflow(void) { +} diff --git a/supervisor/shared/web_workflow/web_workflow.h b/supervisor/shared/web_workflow/web_workflow.h new file mode 100644 index 0000000000..166219c876 --- /dev/null +++ b/supervisor/shared/web_workflow/web_workflow.h @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +#pragma once + +#include + +#include "shared-bindings/socketpool/Socket.h" + +// This background function should be called repeatedly. It cannot be done based +// on events. +void supervisor_web_workflow_background(void); +bool supervisor_web_workflow_status_dirty(void); +void supervisor_web_workflow_status(void); +void supervisor_start_web_workflow(void); +void supervisor_stop_web_workflow(void); + +// To share with websocket. +void web_workflow_send_raw(socketpool_socket_obj_t *socket, const uint8_t *buf, int len); diff --git a/supervisor/shared/web_workflow/websocket.c b/supervisor/shared/web_workflow/websocket.c new file mode 100644 index 0000000000..3901c4eefe --- /dev/null +++ b/supervisor/shared/web_workflow/websocket.c @@ -0,0 +1,266 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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/shared/web_workflow/websocket.h" + +#include "py/ringbuf.h" +#include "py/runtime.h" +#include "shared/runtime/interrupt_char.h" +#include "supervisor/shared/web_workflow/web_workflow.h" + +#if CIRCUITPY_STATUS_BAR +#include "supervisor/shared/status_bar.h" +#endif + +// TODO: Remove ESP specific stuff. For now, it is useful as we refine the server. +#include "esp_log.h" + +typedef struct { + socketpool_socket_obj_t socket; + uint8_t opcode; + uint8_t frame_len; + uint8_t payload_len_size; + bool masked; + bool closed; + uint8_t mask[4]; + int frame_index; + size_t payload_remaining; +} _websocket; + +// Buffer the incoming serial data in the background so that we can look for the +// interrupt character. +STATIC ringbuf_t _incoming_ringbuf; +STATIC uint8_t _buf[16]; + +static _websocket cp_serial; + +static const char *TAG = "CP websocket"; + +void websocket_init(void) { + cp_serial.socket.num = -1; + cp_serial.socket.connected = false; + + ringbuf_init(&_incoming_ringbuf, _buf, sizeof(_buf) - 1); +} + +void websocket_handoff(socketpool_socket_obj_t *socket) { + cp_serial.socket = *socket; + cp_serial.closed = false; + cp_serial.opcode = 0; + cp_serial.frame_index = 0; + cp_serial.frame_len = 2; + // Mark the original socket object as closed without telling the lower level. + socket->connected = false; + socket->num = -1; + + #if CIRCUITPY_STATUS_BAR + // Send the title bar for the new client. + supervisor_status_bar_request_update(true); + #endif +} + +bool websocket_connected(void) { + return _incoming_ringbuf.size > 0 && !cp_serial.closed && common_hal_socketpool_socket_get_connected(&cp_serial.socket); +} + +static bool _read_byte(uint8_t *c) { + int len = socketpool_socket_recv_into(&cp_serial.socket, c, 1); + if (len != 1) { + if (len != -EAGAIN) { + ESP_LOGE(TAG, "recv error %d", len); + } + return false; + } + return true; +} + +static void _read_next_frame_header(void) { + uint8_t h; + if (cp_serial.frame_index == 0 && _read_byte(&h)) { + cp_serial.frame_index++; + cp_serial.opcode = h & 0xf; + } + if (cp_serial.frame_index == 1 && _read_byte(&h)) { + cp_serial.frame_index++; + uint8_t len = h & 0x7f; + cp_serial.masked = (h >> 7) == 1; + if (len <= 125) { + cp_serial.payload_remaining = len; + cp_serial.payload_len_size = 0; + } else if (len == 126) { // 16 bit length + cp_serial.payload_len_size = 2; + } else if (len == 127) { // 64 bit length + cp_serial.payload_len_size = 8; + } + cp_serial.frame_len = 2 + cp_serial.payload_len_size; + if (cp_serial.masked) { + cp_serial.frame_len += 4; + } + } + while (cp_serial.frame_index >= 2 && + cp_serial.frame_index < (cp_serial.payload_len_size + 2) && + _read_byte(&h)) { + cp_serial.frame_index++; + cp_serial.payload_remaining = cp_serial.payload_remaining << 8 | h; + } + int mask_start = cp_serial.payload_len_size + 2; + while (cp_serial.frame_index >= mask_start && + cp_serial.frame_index < cp_serial.frame_len && + _read_byte(&h)) { + size_t mask_offset = cp_serial.frame_index - mask_start; + cp_serial.mask[mask_offset] = h; + cp_serial.frame_index++; + } + // Reply to PINGs and CLOSE. + while ((cp_serial.opcode == 0x8 || + cp_serial.opcode == 0x9) && + cp_serial.frame_index >= cp_serial.frame_len) { + + if (cp_serial.frame_index == cp_serial.frame_len) { + uint8_t opcode = 0x8; // CLOSE + if (cp_serial.opcode == 0x9) { + opcode = 0xA; // PONG + } else { + // Set the TCP socket to send immediately so that we send the payload back before + // closing the connection. + int nodelay = 1; + lwip_setsockopt(cp_serial.socket.num, IPPROTO_TCP, TCP_NODELAY, &nodelay, sizeof(nodelay)); + } + uint8_t frame_header[2]; + frame_header[0] = 1 << 7 | opcode; + if (cp_serial.payload_remaining > 125) { + ESP_LOGE(TAG, "CLOSE or PING has long payload"); + } + frame_header[1] = cp_serial.payload_remaining; + web_workflow_send_raw(&cp_serial.socket, (const uint8_t *)frame_header, 2); + } + + if (cp_serial.payload_remaining > 0 && _read_byte(&h)) { + // Send the payload back to the client. + cp_serial.frame_index++; + cp_serial.payload_remaining--; + web_workflow_send_raw(&cp_serial.socket, &h, 1); + } + + if (cp_serial.payload_remaining == 0) { + cp_serial.frame_index = 0; + if (cp_serial.opcode == 0x8) { + cp_serial.closed = true; + + common_hal_socketpool_socket_close(&cp_serial.socket); + } + } + } +} + +static bool _read_next_payload_byte(uint8_t *c) { + _read_next_frame_header(); + if (cp_serial.opcode == 0x1 && + cp_serial.frame_index >= cp_serial.frame_len && + cp_serial.payload_remaining > 0) { + if (_read_byte(c)) { + uint8_t mask_offset = (cp_serial.frame_index - cp_serial.frame_len) % 4; + *c ^= cp_serial.mask[mask_offset]; + cp_serial.frame_index++; + cp_serial.payload_remaining--; + if (cp_serial.payload_remaining == 0) { + cp_serial.frame_index = 0; + } + return true; + } + } + return false; +} + +bool websocket_available(void) { + if (!websocket_connected()) { + return false; + } + websocket_background(); + return ringbuf_num_filled(&_incoming_ringbuf) > 0; +} + +char websocket_read_char(void) { + websocket_background(); + if (ringbuf_num_filled(&_incoming_ringbuf) > 0) { + return ringbuf_get(&_incoming_ringbuf); + } + return -1; +} + +static void _websocket_send(_websocket *ws, const char *text, size_t len) { + if (!websocket_connected()) { + return; + } + uint32_t opcode = 1; + uint8_t frame_header[2]; + frame_header[0] = 1 << 7 | opcode; + uint8_t payload_len; + if (len <= 125) { + payload_len = len; + } else if (len < (1 << 16)) { + payload_len = 126; + } else { + payload_len = 127; + } + frame_header[1] = payload_len; + web_workflow_send_raw(&ws->socket, (const uint8_t *)frame_header, 2); + uint8_t extended_len[4]; + if (payload_len == 126) { + extended_len[0] = (len >> 8) & 0xff; + extended_len[1] = len & 0xff; + web_workflow_send_raw(&ws->socket, extended_len, 2); + } else if (payload_len == 127) { + uint32_t zero = 0; + // 64 bits where top four bytes are zero. + web_workflow_send_raw(&ws->socket, (const uint8_t *)&zero, 4); + extended_len[0] = (len >> 24) & 0xff; + extended_len[1] = (len >> 16) & 0xff; + extended_len[2] = (len >> 8) & 0xff; + extended_len[3] = len & 0xff; + web_workflow_send_raw(&ws->socket, extended_len, 4); + } + web_workflow_send_raw(&ws->socket, (const uint8_t *)text, len); +} + +void websocket_write(const char *text, size_t len) { + _websocket_send(&cp_serial, text, len); +} + +void websocket_background(void) { + if (!websocket_connected()) { + return; + } + uint8_t c; + while (ringbuf_num_empty(&_incoming_ringbuf) > 0 && + _read_next_payload_byte(&c)) { + if (c == mp_interrupt_char) { + mp_sched_keyboard_interrupt(); + continue; + } + ringbuf_put(&_incoming_ringbuf, c); + } +} diff --git a/supervisor/shared/web_workflow/websocket.h b/supervisor/shared/web_workflow/websocket.h new file mode 100644 index 0000000000..c3db2bf05c --- /dev/null +++ b/supervisor/shared/web_workflow/websocket.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2022 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. + */ + +#pragma once + +#include + +#include "shared-bindings/socketpool/Socket.h" + +void websocket_init(void); +void websocket_handoff(socketpool_socket_obj_t *socket); +bool websocket_connected(void); +bool websocket_available(void); +char websocket_read_char(void); +void websocket_background(void); +void websocket_write(const char *text, size_t len); diff --git a/supervisor/shared/workflow.c b/supervisor/shared/workflow.c index 8d2c0f74fc..f3bc99cb5e 100644 --- a/supervisor/shared/workflow.c +++ b/supervisor/shared/workflow.c @@ -26,14 +26,56 @@ #include #include "py/mpconfig.h" +#include "py/mpstate.h" +#include "py/stackctrl.h" +#include "supervisor/background_callback.h" #include "supervisor/workflow.h" +#include "supervisor/serial.h" #include "supervisor/shared/workflow.h" +#if CIRCUITPY_BLEIO +#include "shared-bindings/_bleio/__init__.h" +#include "supervisor/shared/bluetooth/bluetooth.h" +#endif + #if CIRCUITPY_USB +#include "supervisor/usb.h" #include "tusb.h" #endif +#if CIRCUITPY_WEB_WORKFLOW +#include "supervisor/shared/web_workflow/web_workflow.h" +#endif +static background_callback_t workflow_background_cb; + +static bool workflow_started = false; + +static void workflow_background(void *data) { + #if CIRCUITPY_WEB_WORKFLOW + supervisor_web_workflow_background(); + #endif +} + +// Called during a VM reset. Doesn't actually reset things. void supervisor_workflow_reset(void) { + #if CIRCUITPY_BLEIO + supervisor_start_bluetooth(); + #endif + + #if CIRCUITPY_WEB_WORKFLOW + supervisor_start_web_workflow(); + #endif + + workflow_background_cb.fun = workflow_background; + workflow_background_cb.data = NULL; + supervisor_workflow_request_background(); +} + +void supervisor_workflow_request_background(void) { + if (!workflow_started) { + return; + } + background_callback_add_core(&workflow_background_cb); } // Return true as soon as USB communication with host has started, @@ -58,3 +100,84 @@ bool supervisor_workflow_active(void) { return false; #endif } + +void supervisor_workflow_start(void) { + // Start USB after giving boot.py a chance to tweak behavior. + #if CIRCUITPY_USB + // Setup USB connection after heap is available. + // It needs the heap to build descriptors. + usb_init(); + #endif + + // Set up any other serial connection. + serial_init(); + + #if CIRCUITPY_BLEIO + bleio_reset(); + supervisor_bluetooth_enable_workflow(); + supervisor_start_bluetooth(); + #endif + + #if CIRCUITPY_WEB_WORKFLOW + supervisor_start_web_workflow(); + #endif + + workflow_started = true; +} + +FRESULT supervisor_workflow_mkdir_parents(FATFS *fs, char *path) { + FRESULT result = FR_OK; + // Make parent directories. + for (size_t j = 1; j < strlen(path); j++) { + if (path[j] == '/') { + path[j] = '\0'; + result = f_mkdir(fs, path); + path[j] = '/'; + if (result != FR_OK && result != FR_EXIST) { + return result; + } + } + } + // Make the target directory. + return f_mkdir(fs, path); +} + +FRESULT supervisor_workflow_delete_directory_contents(FATFS *fs, const TCHAR *path) { + FF_DIR dir; + FILINFO file_info; + // Check the stack since we're putting paths on it. + if (mp_stack_usage() >= MP_STATE_THREAD(stack_limit)) { + return FR_INT_ERR; + } + FRESULT res = FR_OK; + while (res == FR_OK) { + res = f_opendir(fs, &dir, path); + if (res != FR_OK) { + break; + } + res = f_readdir(&dir, &file_info); + // We close and reopen the directory every time since we're deleting + // entries and it may invalidate the directory handle. + f_closedir(&dir); + if (res != FR_OK || file_info.fname[0] == '\0') { + break; + } + size_t pathlen = strlen(path); + size_t fnlen = strlen(file_info.fname); + TCHAR full_path[pathlen + 1 + fnlen]; + memcpy(full_path, path, pathlen); + full_path[pathlen] = '/'; + size_t full_pathlen = pathlen + 1 + fnlen; + memcpy(full_path + pathlen + 1, file_info.fname, fnlen); + full_path[full_pathlen] = '\0'; + if ((file_info.fattrib & AM_DIR) != 0) { + res = supervisor_workflow_delete_directory_contents(fs, full_path); + } + if (res != FR_OK) { + break; + } + res = f_unlink(fs, full_path); + } + f_closedir(&dir); + return res; +} diff --git a/supervisor/shared/workflow.h b/supervisor/shared/workflow.h index b3c817fb8b..df483e0ebc 100644 --- a/supervisor/shared/workflow.h +++ b/supervisor/shared/workflow.h @@ -26,4 +26,10 @@ #pragma once +#include "lib/oofatfs/ff.h" + extern bool supervisor_workflow_connecting(void); + +// File system helpers for workflow code. +FRESULT supervisor_workflow_mkdir_parents(FATFS *fs, char *path); +FRESULT supervisor_workflow_delete_directory_contents(FATFS *fs, const TCHAR *path); diff --git a/supervisor/stub/filesystem.c b/supervisor/stub/filesystem.c index 650f4d8346..920a7571f2 100644 --- a/supervisor/stub/filesystem.c +++ b/supervisor/stub/filesystem.c @@ -31,6 +31,10 @@ void filesystem_background(void) { return; } +void filesystem_tick(void) { + return; +} + bool filesystem_init(bool create_allowed, bool force_create) { (void)create_allowed; (void)force_create; diff --git a/supervisor/stub/internal_flash.c b/supervisor/stub/internal_flash.c index 23e843c923..3bb71493fd 100644 --- a/supervisor/stub/internal_flash.c +++ b/supervisor/stub/internal_flash.c @@ -23,7 +23,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include "supervisor/internal_flash.h" +#include "supervisor/flash.h" #include #include @@ -46,21 +46,29 @@ uint32_t supervisor_flash_get_block_count(void) { return 0; } -void port_internal_flash_flush(void) { - return; -} - mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { return 0; // success } -bool supervisor_flash_write_block(const uint8_t *src, uint32_t block) { - return true; -} - mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { return 0; // success } +#if (0) +// See definition in supervisor/flash.c +void supervisor_flash_init_vfs(struct _fs_user_mount_t *vfs) { + return; +} + +// See definition in supervisor/flash.c +void supervisor_flash_flush(void) { + return; +} +#endif + void supervisor_flash_release_cache(void) { } + +void port_internal_flash_flush(void) { + return; +} diff --git a/supervisor/stub/misc.c b/supervisor/stub/misc.c new file mode 100644 index 0000000000..a17188beff --- /dev/null +++ b/supervisor/stub/misc.c @@ -0,0 +1,33 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * SPDX-FileCopyrightText: Copyright (c) 2022 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 "stdbool.h" + +#include "supervisor/port.h" +#include "py/mpconfig.h" + + +MP_WEAK void port_post_boot_py(bool heap_valid) { +} diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index f4ca11db43..a8deb9606d 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -8,24 +8,44 @@ SRC_SUPERVISOR = \ supervisor/shared/lock.c \ supervisor/shared/memory.c \ supervisor/shared/micropython.c \ + supervisor/shared/port.c \ supervisor/shared/reload.c \ supervisor/shared/safe_mode.c \ - supervisor/shared/serial.c \ + supervisor/shared/serial.c \ supervisor/shared/stack.c \ supervisor/shared/status_leds.c \ supervisor/shared/tick.c \ supervisor/shared/traceback.c \ - supervisor/shared/translate.c \ - supervisor/shared/workflow.c - -ifeq ($(DISABLE_FILESYSTEM),1) -SRC_SUPERVISOR += supervisor/stub/filesystem.c -else -SRC_SUPERVISOR += supervisor/shared/filesystem.c -endif + supervisor/shared/translate/translate.c \ + supervisor/shared/workflow.c \ + supervisor/stub/misc.c \ NO_USB ?= $(wildcard supervisor/usb.c) + +ifeq ($(CIRCUITPY_USB),1) +CIRCUITPY_CREATOR_ID ?= $(USB_VID) +CIRCUITPY_CREATION_ID ?= $(USB_PID) +endif + +ifneq ($(CIRCUITPY_CREATOR_ID),) +CFLAGS += -DCIRCUITPY_CREATOR_ID=$(CIRCUITPY_CREATOR_ID) +endif + +ifneq ($(CIRCUITPY_CREATION_ID),) +CFLAGS += -DCIRCUITPY_CREATION_ID=$(CIRCUITPY_CREATION_ID) +endif + +ifeq ($(CIRCUITPY_BLEIO),1) + SRC_SUPERVISOR += supervisor/shared/bluetooth/bluetooth.c + ifeq ($(CIRCUITPY_BLE_FILE_SERVICE),1) + SRC_SUPERVISOR += supervisor/shared/bluetooth/file_transfer.c + endif + ifeq ($(CIRCUITPY_SERIAL_BLE),1) + SRC_SUPERVISOR += supervisor/shared/bluetooth/serial.c + endif +endif + INTERNAL_FLASH_FILESYSTEM ?= 0 CFLAGS += -DINTERNAL_FLASH_FILESYSTEM=$(INTERNAL_FLASH_FILESYSTEM) @@ -35,18 +55,13 @@ CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM) SPI_FLASH_FILESYSTEM ?= 0 CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM) -ifeq ($(CIRCUITPY_BLEIO),1) - SRC_SUPERVISOR += supervisor/shared/bluetooth/bluetooth.c - CIRCUITPY_CREATOR_ID ?= $(USB_VID) - CIRCUITPY_CREATION_ID ?= $(USB_PID) - CFLAGS += -DCIRCUITPY_CREATOR_ID=$(CIRCUITPY_CREATOR_ID) - CFLAGS += -DCIRCUITPY_CREATION_ID=$(CIRCUITPY_CREATION_ID) - ifeq ($(CIRCUITPY_BLE_FILE_SERVICE),1) - SRC_SUPERVISOR += supervisor/shared/bluetooth/file_transfer.c - endif - ifeq ($(CIRCUITPY_SERIAL_BLE),1) - SRC_SUPERVISOR += supervisor/shared/bluetooth/serial.c - endif +DISABLE_FILESYSTEM ?= 0 +CFLAGS += -DDISABLE_FILESYSTEM=$(DISABLE_FILESYSTEM) + +ifeq ($(DISABLE_FILESYSTEM),1) +SRC_SUPERVISOR += supervisor/stub/filesystem.c +else +SRC_SUPERVISOR += supervisor/shared/filesystem.c endif # Choose which flash filesystem impl to use. @@ -82,6 +97,12 @@ ifneq ($(wildcard supervisor/serial.c),) SRC_SUPERVISOR += supervisor/serial.c endif +ifeq ($(CIRCUITPY_STATUS_BAR),1) + SRC_SUPERVISOR += \ + supervisor/shared/status_bar.c \ + +endif + ifeq ($(CIRCUITPY_USB),1) SRC_SUPERVISOR += \ lib/tinyusb/src/class/cdc/cdc_device.c \ @@ -146,6 +167,20 @@ ifeq ($(CIRCUITPY_USB),1) endif endif +STATIC_RESOURCES = $(wildcard $(TOP)/supervisor/shared/web_workflow/static/*) + +$(BUILD)/autogen_web_workflow_static.c: ../../tools/gen_web_workflow_static.py $(STATIC_RESOURCES) | $(HEADER_BUILD) + $(STEPECHO) "GEN $@" + $(Q)$(PYTHON) $< \ + --output_c_file $@ \ + $(STATIC_RESOURCES) + +ifeq ($(CIRCUITPY_WEB_WORKFLOW),1) + SRC_SUPERVISOR += supervisor/shared/web_workflow/web_workflow.c \ + supervisor/shared/web_workflow/websocket.c + SRC_SUPERVISOR += $(BUILD)/autogen_web_workflow_static.c +endif + SRC_TINYUSB = $(filter lib/tinyusb/%.c, $(SRC_SUPERVISOR)) $(patsubst %.c,$(BUILD)/%.o,$(SRC_TINYUSB)): CFLAGS += -Wno-missing-prototypes @@ -155,9 +190,8 @@ ifeq ($(CIRCUITPY_DISPLAYIO), 1) SRC_SUPERVISOR += \ supervisor/shared/display.c - ifeq ($(CIRCUITPY_TERMINALIO), 1) - SUPERVISOR_O += $(BUILD)/autogen_display_resources.o - endif + # Include the display resources because it includes the Blinka logo as well. + SUPERVISOR_O += $(BUILD)/autogen_display_resources-$(TRANSLATION).o endif # Preserve double quotes in these values by single-quoting them. @@ -190,14 +224,14 @@ endif USB_HIGHSPEED ?= 0 CFLAGS += -DUSB_HIGHSPEED=$(USB_HIGHSPEED) -$(BUILD)/supervisor/shared/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h +$(BUILD)/supervisor/shared/translate/translate.o: $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/compression.generated.h CIRCUITPY_DISPLAY_FONT ?= "../../tools/fonts/ter-u12n.bdf" -$(BUILD)/autogen_display_resources.c: ../../tools/gen_display_resources.py $(HEADER_BUILD)/qstrdefs.generated.h Makefile | $(HEADER_BUILD) +$(BUILD)/autogen_display_resources-$(TRANSLATION).c: ../../tools/gen_display_resources.py $(TOP)/locale/$(TRANSLATION).po Makefile | $(HEADER_BUILD) $(STEPECHO) "GEN $@" $(Q)install -d $(BUILD)/genhdr $(Q)$(PYTHON) ../../tools/gen_display_resources.py \ --font $(CIRCUITPY_DISPLAY_FONT) \ - --sample_file $(HEADER_BUILD)/qstrdefs.generated.h \ - --output_c_file $(BUILD)/autogen_display_resources.c + --sample_file $(TOP)/locale/$(TRANSLATION).po \ + --output_c_file $@ diff --git a/supervisor/workflow.h b/supervisor/workflow.h index 31900392cd..f550f8e88c 100755 --- a/supervisor/workflow.h +++ b/supervisor/workflow.h @@ -30,3 +30,7 @@ void supervisor_workflow_reset(void); // True when the user could be actively iterating on their code. bool supervisor_workflow_active(void); + +void supervisor_workflow_request_background(void); + +void supervisor_workflow_start(void); diff --git a/tests/circuitpython/zlib_decompress.py b/tests/circuitpython/zlib_decompress.py new file mode 100644 index 0000000000..05ea5868ee --- /dev/null +++ b/tests/circuitpython/zlib_decompress.py @@ -0,0 +1,60 @@ +try: + import zlib +except ImportError: + try: + import zlib as zlib + except ImportError: + print("SKIP") + raise SystemExit + +PATTERNS = [ + # Packed results produced by CPy's zlib.compress() + (b"0", b"x\x9c3\x00\x00\x001\x001"), + (b"a", b"x\x9cK\x04\x00\x00b\x00b"), + (b"0" * 100, b"x\x9c30\xa0=\x00\x00\xb3q\x12\xc1"), + ( + bytes(range(64)), + b"x\x9cc`dbfaec\xe7\xe0\xe4\xe2\xe6\xe1\xe5\xe3\x17\x10\x14\x12\x16\x11\x15\x13\x97\x90\x94\x92\x96\x91\x95\x93WPTRVQUS\xd7\xd0\xd4\xd2\xd6\xd1\xd5\xd370426153\xb7\xb0\xb4\xb2\xb6\xb1\xb5\xb3\x07\x00\xaa\xe0\x07\xe1", + ), + (b"hello", b"x\x01\x01\x05\x00\xfa\xffhello\x06,\x02\x15"), # compression level 0 + # adaptive/dynamic huffman tree + ( + b"13371813150|13764518736|12345678901", + b"x\x9c\x05\xc1\x81\x01\x000\x04\x04\xb1\x95\\\x1f\xcfn\x86o\x82d\x06Qq\xc8\x9d\xc5X}I}\x00\x951D>I}\x00\x951D>I}\x00\x951D>I}\x00\x951D", + b"x\x9c\x05\xc11\x01\x00\x00\x00\x010\x95\x14py\x84\x12C_\x9bR\x8cV\x8a\xd1J1Z)F\x1fw`\x089", + ), +] + +for unpacked, packed in PATTERNS: + assert zlib.decompress(packed) == unpacked + print(unpacked) + + +# Raw DEFLATE bitstream +v = b"\xcbH\xcd\xc9\xc9\x07\x00" +exp = b"hello" +out = zlib.decompress(v, -15) +assert out == exp +print(exp) +# Even when you ask CPython zlib.compress to produce Raw DEFLATE stream, +# it returns it with adler2 and oriignal size appended, as if it was a +# zlib stream. Make sure there're no random issues decompressing such. +v = b"\xcbH\xcd\xc9\xc9\x07\x00\x86\xa6\x106\x05\x00\x00\x00" +out = zlib.decompress(v, -15) +assert out == exp + +# this should error +try: + zlib.decompress(b"abc") +except Exception: + print("Exception") + +# invalid block type +try: + zlib.decompress(b"\x07", -15) # final-block, block-type=3 (invalid) +except Exception as er: + print("Exception") diff --git a/tests/extmod/qrio.py b/tests/extmod/qrio.py index 5e9ed4c12a..53c83706f8 100644 --- a/tests/extmod/qrio.py +++ b/tests/extmod/qrio.py @@ -5,7 +5,7 @@ except: raise SystemExit loc = __file__.rsplit("/", 1)[0] -with open(f"{loc}/data/qr.pgm") as f: +with open(f"{loc}/data/qr.pgm", "rb") as f: content = f.read()[-320 * 240 :] decoder = qrio.QRDecoder(320, 240) diff --git a/tests/float/float_format_ftoe.py b/tests/float/float_format_ftoe.py new file mode 100644 index 0000000000..bc4e5a4a53 --- /dev/null +++ b/tests/float/float_format_ftoe.py @@ -0,0 +1,4 @@ +# check a case where rounding was suppressed inappropriately when "f" was +# promoted to "e" for large numbers. +v = 8.888e32 +print("%.2f" % v) # '%.2f' format with e32 becomes '%.2e', expect 8.89e+32. diff --git a/tests/float/float_format_ftoe.py.exp b/tests/float/float_format_ftoe.py.exp new file mode 100644 index 0000000000..f8b1deb3ec --- /dev/null +++ b/tests/float/float_format_ftoe.py.exp @@ -0,0 +1 @@ +8.89e+32 diff --git a/tests/float/float_format_ints.py b/tests/float/float_format_ints.py new file mode 100644 index 0000000000..0bf4baf12d --- /dev/null +++ b/tests/float/float_format_ints.py @@ -0,0 +1,31 @@ +# Test that integers format to exact values. + +for b in [13, 123, 457, 23456]: + for r in range(1, 10): + e_fmt = "{:." + str(r) + "e}" + f_fmt = "{:." + str(r) + "f}" + g_fmt = "{:." + str(r) + "g}" + for e in range(0, 5): + f = b * (10**e) + title = str(b) + " x 10^" + str(e) + print(title, "with format", e_fmt, "gives", e_fmt.format(f)) + print(title, "with format", f_fmt, "gives", f_fmt.format(f)) + print(title, "with format", g_fmt, "gives", g_fmt.format(f)) + +# Check that powers of 10 (that fit in float32) format correctly. +for i in range(31): + # It works to 12 digits on all platforms *except* qemu-arm, where + # 10^11 comes out as 10000000820 or something. + print("{:.7g}".format(float("1e" + str(i)))) + +# 16777215 is 2^24 - 1, the largest integer that can be completely held +# in a float32. +print("{:f}".format(16777215)) +# 4294967040 = 16777215 * 128 is the largest integer that is exactly +# represented by a float32 and that will also fit within a (signed) int32. +# The upper bound of our integer-handling code is actually double this, +# but that constant might cause trouble on systems using 32 bit ints. +print("{:f}".format(2147483520)) +# Very large positive integers can be a test for precision and resolution. +# This is a weird way to represent 1e38 (largest power of 10 for float32). +print("{:.6e}".format(float("9" * 30 + "e8"))) diff --git a/tests/float/float_format_ints_doubleprec.py b/tests/float/float_format_ints_doubleprec.py new file mode 100644 index 0000000000..57899d6d65 --- /dev/null +++ b/tests/float/float_format_ints_doubleprec.py @@ -0,0 +1,15 @@ +# Test formatting of very large ints. +# Relies on double-precision floats. + +import array +import sys + +# Challenging way to express 1e200 and 1e100. +print("{:.12e}".format(float("9" * 400 + "e-200"))) +print("{:.12e}".format(float("9" * 400 + "e-300"))) + +# These correspond to the binary representation of 1e200 in float64s: +v1 = 0x54B249AD2594C37D # 1e100 +v2 = 0x6974E718D7D7625A # 1e200 +print("{:.12e}".format(array.array("d", v1.to_bytes(8, sys.byteorder))[0])) +print("{:.12e}".format(array.array("d", v2.to_bytes(8, sys.byteorder))[0])) diff --git a/tests/run-tests.py b/tests/run-tests.py index a6d08aabb3..751b70886a 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -426,6 +426,7 @@ def run_tests(pyb, tests, args, result_dir, num_threads=1): if upy_float_precision < 64: skip_tests.add("float/float_divmod.py") # tested by float/float_divmod_relaxed.py instead skip_tests.add("float/float2int_doubleprec_intbig.py") + skip_tests.add("float/float_format_ints_doubleprec.py") skip_tests.add("float/float_parse_doubleprec.py") if not has_complex: diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index fb97e5a6b7..582d90e1bc 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -38,12 +38,12 @@ hashlib json math qrio rainbowio re sys termios traceback ubinascii uctypes uerrno uheapq uio ujson ulab -ulab.fft ulab.linalg ulab.numpy ulab.scipy -ulab.scipy.linalg ulab.scipy.optimize -ulab.scipy.signal ulab.scipy.special -ulab.utils uos urandom ure -uselect ustruct utime utimeq -uzlib +ulab.numpy ulab.numpy.fft ulab.numpy.linalg +ulab.scipy ulab.scipy.linalg +ulab.scipy.optimize ulab.scipy.signal +ulab.scipy.special ulab.utils uos +urandom ure uselect ustruct +utime utimeq uzlib zlib ime utime utimeq diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 97192adee7..f810d942a7 100755 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -13,74 +13,17 @@ import base64 from datetime import date from sh.contrib import git -sys.path.append("../docs") -import shared_bindings_matrix - sys.path.append("adabot") import adabot.github_requests as github -from shared_bindings_matrix import SUPPORTED_PORTS -from shared_bindings_matrix import aliases_by_board +sys.path.append("../docs") +from shared_bindings_matrix import ( + SUPPORTED_PORTS, + support_matrix_by_board, + get_board_mapping, +) -BIN = ("bin",) -UF2 = ("uf2",) -BIN_UF2 = ("bin", "uf2") -HEX = ("hex",) -HEX_UF2 = ("hex", "uf2") -SPK = ("spk",) -DFU = ("dfu",) -BIN_DFU = ("bin", "dfu") -COMBINED_HEX = ("combined.hex",) -KERNEL8_IMG = ("disk.img.zip", "kernel8.img") -KERNEL_IMG = ("disk.img.zip", "kernel.img") - -# Default extensions -extension_by_port = { - "atmel-samd": UF2, - "broadcom": KERNEL8_IMG, - "cxd56": SPK, - "espressif": BIN_UF2, - "litex": DFU, - "mimxrt10xx": HEX_UF2, - "nrf": UF2, - "raspberrypi": UF2, - "stm": BIN, -} - -# Per board overrides -extension_by_board = { - # samd - "arduino_mkr1300": BIN_UF2, - "arduino_mkrzero": BIN_UF2, - "arduino_nano_33_iot": BIN_UF2, - "arduino_zero": BIN_UF2, - "feather_m0_adalogger": BIN_UF2, - "feather_m0_basic": BIN_UF2, - "feather_m0_rfm69": BIN_UF2, - "feather_m0_rfm9x": BIN_UF2, - "uchip": BIN_UF2, - # nRF52840 dev kits that may not have UF2 bootloaders, - "makerdiary_nrf52840_mdk": HEX, - "makerdiary_nrf52840_mdk_usb_dongle": HEX_UF2, - "pca10056": BIN_UF2, - "pca10059": BIN_UF2, - "electronut_labs_blip": HEX, - "microbit_v2": COMBINED_HEX, - # stm32 - "meowbit_v121": UF2, - # esp32c3 - "adafruit_qtpy_esp32c3": BIN, - "ai_thinker_esp32-c3s": BIN, - "ai_thinker_esp32-c3s-2m": BIN, - "espressif_esp32c3_devkitm_1_n4": BIN, - "lilygo_ttgo_t-01c3": BIN, - "microdev_micro_c3": BIN, - # broadcom - "raspberrypi_zero": KERNEL_IMG, - "raspberrypi_zero_w": KERNEL_IMG, -} - -language_allow_list = set( +LANGUAGE_ALLOW_LIST = set( [ "ID", "de_DE", @@ -109,47 +52,10 @@ def get_languages(list_all=False): if f.name.endswith(".po"): languages.add(f.name[:-3]) if not list_all: - languages = languages & language_allow_list + languages = languages & LANGUAGE_ALLOW_LIST return sorted(list(languages), key=str.casefold) -def get_board_mapping(): - boards = {} - for port in SUPPORTED_PORTS: - board_path = os.path.join("../ports", port, "boards") - for board_path in os.scandir(board_path): - if board_path.is_dir(): - board_files = os.listdir(board_path.path) - board_id = board_path.name - extensions = extension_by_port[port] - extensions = extension_by_board.get(board_path.name, extensions) - aliases = aliases_by_board.get(board_path.name, []) - frozen_libraries = [] - with open(os.path.join(board_path, "mpconfigboard.mk")) as mpconfig: - frozen_lines = [ - line for line in mpconfig if line.startswith("FROZEN_MPY_DIRS") - ] - frozen_libraries.extend( - [line[line.rfind("/") + 1 :].strip() for line in frozen_lines] - ) - boards[board_id] = { - "port": port, - "extensions": extensions, - "download_count": 0, - "aliases": aliases, - "frozen_libraries": frozen_libraries, - } - for alias in aliases: - boards[alias] = { - "port": port, - "extensions": extensions, - "download_count": 0, - "alias": True, - "aliases": [], - } - return boards - - def get_version_info(): version = None sha = git("rev-parse", "--short", "HEAD").stdout.decode("utf-8") @@ -284,7 +190,7 @@ def generate_download_info(): languages = get_languages() - support_matrix = shared_bindings_matrix.support_matrix_by_board(use_branded_name=False) + support_matrix = support_matrix_by_board(use_branded_name=False, withurl=False) new_stable = "-" not in new_tag @@ -311,20 +217,19 @@ def generate_download_info(): board_files = os.listdir(board_path.path) board_id = board_path.name board_info = board_mapping[board_id] - for alias in [board_id] + board_info["aliases"]: alias_info = board_mapping[alias] if alias not in current_info: changes["new_boards"].append(alias) current_info[alias] = {"downloads": 0, "versions": []} - new_version = { "stable": new_stable, "version": new_tag, - "modules": support_matrix[alias], "languages": languages, - "extensions": board_info["extensions"], - "frozen_libraries": board_info["frozen_libraries"], + # add modules, extensions, frozen_libraries explicitly + "modules": support_matrix[alias]["modules"], + "extensions": support_matrix[alias]["extensions"], + "frozen_libraries": support_matrix[alias]["frozen_libraries"], } current_info[alias]["downloads"] = alias_info["download_count"] current_info[alias]["versions"].append(new_version) @@ -334,9 +239,10 @@ def generate_download_info(): if changes["new_release"] and user: create_pr(changes, current_info, git_info, user) else: - print("No new release to update") if "DEBUG" in os.environ: print(create_json(current_info).decode("utf8")) + else: + print("No new release to update") if __name__ == "__main__": diff --git a/tools/build_release_files.py b/tools/build_release_files.py index 3fe714e393..309d91c368 100755 --- a/tools/build_release_files.py +++ b/tools/build_release_files.py @@ -12,6 +12,9 @@ import shutil import build_board_info as build_info import time +sys.path.append("../docs") +from shared_bindings_matrix import get_settings_from_makefile + for port in build_info.SUPPORTED_PORTS: result = subprocess.run("rm -rf ../ports/{port}/build*".format(port=port), shell=True) @@ -39,6 +42,7 @@ for board in build_boards: bin_directory = "../bin/{}/".format(board) os.makedirs(bin_directory, exist_ok=True) board_info = all_boards[board] + board_settings = get_settings_from_makefile("../ports/" + board_info["port"], board) for language in languages: bin_directory = "../bin/{board}/{language}".format(board=board, language=language) @@ -82,8 +86,12 @@ for board in build_boards: success = "\033[31mfailed\033[0m" other_output = "" + extensions = [ + extension.strip() + for extension in board_settings["CIRCUITPY_BUILD_EXTENSIONS"].split(",") + ] - for extension in board_info["extensions"]: + for extension in extensions: temp_filename = "../ports/{port}/{build}/firmware.{extension}".format( port=board_info["port"], build=build_dir, extension=extension ) diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index d9e7d99687..f46295f240 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -56,9 +56,12 @@ DEFAULT_CLUSTERLIST = { "espressif_esp32s3_devkitc_1_n8r8", ], "0x303A:0x7009": ["espressif_esp32s2_devkitc_1_n4", "espressif_esp32s2_devkitc_1_n4r2"], + "0x70010001:0x00100001": ["ai_thinker_esp32-c3s", "ai_thinker_esp32-c3s-2m"], } -cli_parser = argparse.ArgumentParser(description="USB VID/PID Duplicate Checker") +cli_parser = argparse.ArgumentParser( + description="USB VID/PID and Creator/Creation ID Duplicate Checker" +) def configboard_files(): @@ -71,31 +74,40 @@ def configboard_files(): return working_dir.glob("ports/**/boards/**/mpconfigboard.mk") +VID_PATTERN = re.compile(r"^USB_VID\s*=\s*(.*)", flags=re.M) +PID_PATTERN = re.compile(r"^USB_PID\s*=\s*(.*)", flags=re.M) +CREATOR_PATTERN = re.compile(r"^CIRCUITPY_CREATOR_ID\s*=\s*(.*)", flags=re.M) +CREATION_PATTERN = re.compile(r"^CIRCUITPY_CREATION_ID\s*=\s*(.*)", flags=re.M) + + def check_vid_pid(files, clusterlist): """Compiles a list of USB VID & PID values for all boards, and checks for duplicates. Exits with ``sys.exit()`` (non-zero exit code) if duplicates are found, and lists the duplicates. """ - vid_pattern = re.compile(r"^USB_VID\s*=\s*(.*)", flags=re.M) - pid_pattern = re.compile(r"^USB_PID\s*=\s*(.*)", flags=re.M) - usb_pattern = re.compile(r"^CIRCUITPY_USB\s*=\s*0$|^IDF_TARGET = esp32c3$", flags=re.M) + usb_pattern = re.compile(r"^CIRCUITPY_USB\s*=\s*0$|^IDF_TARGET = (esp32|esp32c3)$", flags=re.M) usb_ids = defaultdict(set) for board_config in files: src_text = board_config.read_text() - usb_vid = vid_pattern.search(src_text) - usb_pid = pid_pattern.search(src_text) + usb_vid = VID_PATTERN.search(src_text) + usb_pid = PID_PATTERN.search(src_text) + creator = CREATOR_PATTERN.search(src_text) + creation = CREATION_PATTERN.search(src_text) non_usb = usb_pattern.search(src_text) board_name = board_config.parts[-2] if usb_vid and usb_pid: id_group = f"0x{int(usb_vid.group(1), 16):04X}:0x{int(usb_pid.group(1), 16):04X}" elif non_usb: - continue + if creator is None or creation is None: + print(f"{board_name=} {creator=} {creation=}", file=sys.stderr) + continue + id_group = f"0x{int(creator.group(1), 16):08X}:0x{int(creation.group(1), 16):08X}" else: - raise SystemExit(f"Could not parse {board_config}") + raise SystemExit(f"Could not find expected settings in {board_config}") usb_ids[id_group].add(board_name) @@ -117,17 +129,19 @@ def check_vid_pid(files, clusterlist): duplicate_message = ( f"Duplicate VID/PID usage found!\n{duplicates}\n" f"If you are open source maker, then you can request a PID from http://pid.codes\n" + f"For boards without native USB, you can request a Creator ID from https://github.com/creationid/creators/\n" f"Otherwise, companies should pay the USB-IF for a vendor ID: https://www.usb.org/getting-vendor-id" ) sys.exit(duplicate_message) + else: - print("No USB PID duplicates found.") + print("No unexpected ID duplicates found.") if __name__ == "__main__": arguments = cli_parser.parse_args() - print("Running USB VID/PID Duplicate Checker...") + print("Running USB VID/PID and Creator/Creation ID Duplicate Checker...") board_files = configboard_files() check_vid_pid(board_files, DEFAULT_CLUSTERLIST) diff --git a/tools/ci_fetch_deps.py b/tools/ci_fetch_deps.py index d31b0d47aa..55985ffe15 100644 --- a/tools/ci_fetch_deps.py +++ b/tools/ci_fetch_deps.py @@ -16,6 +16,7 @@ print(target, ref) port_deps = { "atmel-samd": [ "extmod/ulab/", + "lib/adafruit_floppy/", "lib/mp3/", "lib/protomatter/", "lib/quirc/", @@ -30,6 +31,7 @@ port_deps = { "nrf": ["extmod/ulab/", "lib/mp3/", "lib/protomatter/", "lib/tinyusb/", "data/nvm.toml/"], "raspberrypi": [ "extmod/ulab/", + "lib/adafruit_floppy/", "lib/mp3/", "lib/protomatter/", "lib/quirc/", @@ -41,13 +43,15 @@ port_deps = { } -def run(title, command): +def run(title, command, check=True): print("::group::" + title, flush=True) print(command, flush=True) start = time.monotonic() - subprocess.run(shlex.split(command), stderr=subprocess.STDOUT) - print("Duration:", time.monotonic() - start, flush=True) - print("::endgroup::", flush=True) + try: + subprocess.run(shlex.split(command), stderr=subprocess.STDOUT, check=check) + finally: + print("Duration:", time.monotonic() - start, flush=True) + print("::endgroup::", flush=True) run( @@ -66,14 +70,15 @@ submodules = [] if target == "test": submodules = ["extmod/", "lib/", "tools/", "extmod/ulab", "lib/berkeley-db-1.xx"] elif target == "docs": - submodules = ["extmod/ulab/"] + # used in .readthedocs.yml to generate RTD + submodules = ["extmod/ulab/", "frozen/"] elif target == "mpy-cross-mac": submodules = ["tools/"] # for huffman elif target == "windows": # This builds one board from a number of ports so fill out a bunch of submodules submodules = ["extmod/", "lib/", "tools/", "ports/", "data/nvm.toml/"] elif target == "website": - submodules = ["tools/adabot/"] + submodules = ["tools/adabot/", "frozen/"] else: p = list(pathlib.Path(".").glob(f"ports/*/boards/{target}/mpconfigboard.mk")) if not p: @@ -103,7 +108,11 @@ if submodules: submodules = " ".join(submodules) # This line will fail because the submodule's need different commits than the tip of the branch. We # fix it later. - run("Init the submodules we'll need", f"git submodule update --init -N --depth 1 {submodules}") + run( + "Init the submodules we'll need", + f"git submodule update --init -N --depth 1 {submodules}", + check=False, + ) run( "Fetch the submodule sha", diff --git a/tools/ci_set_matrix.py b/tools/ci_set_matrix.py index efb4427e7e..90cf04cea6 100644 --- a/tools/ci_set_matrix.py +++ b/tools/ci_set_matrix.py @@ -21,6 +21,7 @@ import json import yaml import build_board_info +from shared_bindings_matrix import get_settings_from_makefile PORT_TO_ARCH = { "atmel-samd": "arm", @@ -53,6 +54,7 @@ def set_boards_to_build(build_all): all_board_ids = set() port_to_boards = {} board_to_port = {} + board_settings = {} for board_id in boards_info_json: info = boards_info_json[board_id] if info.get("alias", False): @@ -70,6 +72,9 @@ def set_boards_to_build(build_all): boards_to_build = set() board_pattern = re.compile(r"^ports/[^/]+/boards/([^/]+)/") port_pattern = re.compile(r"^ports/([^/]+)/") + module_pattern = re.compile( + r"^(ports/[^/]+/common-hal|shared-bindings|shared-module)/([^/]+)/" + ) for p in changed_files: # See if it is board specific board_matches = board_pattern.search(p) @@ -80,7 +85,8 @@ def set_boards_to_build(build_all): # See if it is port specific port_matches = port_pattern.search(p) - if port_matches: + module_matches = module_pattern.search(p) + if port_matches and not module_matches: port = port_matches.group(1) if port != "unix": boards_to_build.update(port_to_boards[port]) @@ -90,8 +96,50 @@ def set_boards_to_build(build_all): if p in IGNORE: continue - # Boards don't run tests so ignore those as well. - if p.startswith("tests"): + # Boards don't run tests or docs so ignore those as well. + if p.startswith("tests") or p.startswith("docs"): + continue + + # As a (nearly) last resort, for some certain files, we compute the settings from the + # makefile for each board and determine whether to build them that way. + if p.startswith("frozen") or p.startswith("supervisor") or module_matches: + for board in all_board_ids: + if board not in board_settings: + board_settings[board] = get_settings_from_makefile( + "../ports/" + board_to_port[board], board + ) + settings = board_settings[board] + + # Check frozen files to see if they are in each board. + frozen = settings.get("FROZEN_MPY_DIRS", "") + if frozen and p.startswith("frozen") and p in frozen: + boards_to_build.add(board) + continue + + # Check supervisor files. This is useful for limiting workflow changes to the + # relevant boards. + supervisor = settings["SRC_SUPERVISOR"] + if p.startswith("supervisor"): + if p in supervisor: + boards_to_build.add(board) + continue + + web_workflow = settings["CIRCUITPY_WEB_WORKFLOW"] + while web_workflow.startswith("$("): + web_workflow = settings[web_workflow[2:-1]] + if ( + p.startswith("supervisor/shared/web_workflow/static/") + and web_workflow != "0" + ): + boards_to_build.add(board) + continue + + # Check module matches + if module_matches: + module = module_matches.group(2) + "/" + if module in settings["SRC_PATTERNS"]: + boards_to_build.add(board) + continue continue # Otherwise build it all @@ -101,7 +149,7 @@ def set_boards_to_build(build_all): # Split boards by architecture. print("Building boards:") arch_to_boards = {"aarch": [], "arm": [], "riscv": [], "espressif": []} - for board in boards_to_build: + for board in sorted(boards_to_build): print(" ", board) port = board_to_port.get(board) # A board can appear due to its _deletion_ (rare) diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py index 552e5f1245..e5ce775e4a 100644 --- a/tools/gen_display_resources.py +++ b/tools/gen_display_resources.py @@ -75,8 +75,7 @@ for c in set(all_characters): if missing > 0: print("Font missing", missing, "characters", file=sys.stderr) -x, y, dx, dy = f.get_bounding_box() -tile_x, tile_y = x - dx, y - dy +tile_x, tile_y, dx, dy = f.get_bounding_box() total_bits = tile_x * len(all_characters) total_bits += 32 - total_bits % 32 bytes_per_row = total_bits // 8 @@ -105,14 +104,170 @@ c_file = args.output_c_file c_file.write( """\ +#include "shared-bindings/displayio/Bitmap.h" #include "shared-bindings/displayio/Palette.h" #include "supervisor/shared/display.h" """ ) + c_file.write( """\ +#if CIRCUITPY_REPL_LOGO +""" +) +if tile_y == 16: + blinka_size = 16 + c_file.write( + """\ +uint32_t blinka_bitmap_data[32] = { + 0x00000011, 0x11000000, + 0x00000111, 0x53100000, + 0x00000111, 0x56110000, + 0x00000111, 0x11140000, + 0x00000111, 0x20002000, + 0x00000011, 0x13000000, + 0x00000001, 0x11200000, + 0x00000000, 0x11330000, + 0x00000000, 0x01122000, + 0x00001111, 0x44133000, + 0x00032323, 0x24112200, + 0x00111114, 0x44113300, + 0x00323232, 0x34112200, + 0x11111144, 0x44443300, + 0x11111111, 0x11144401, + 0x23232323, 0x21111110 +}; +""" + ) +else: + blinka_size = 12 + c_file.write( + """\ +uint32_t blinka_bitmap_data[28] = { + 0x00000111, 0x00000000, + 0x00001153, 0x10000000, + 0x00001156, 0x11000000, + 0x00001111, 0x14000000, + 0x00000112, 0x00200000, + 0x00000011, 0x30000000, + 0x00000011, 0x20000000, + 0x00011144, 0x13000000, + 0x00232324, 0x12000000, + 0x01111444, 0x13000000, + 0x32323234, 0x12010000, + 0x11111144, 0x44100000 +}; +""" + ) + +c_file.write( + """\ +displayio_bitmap_t blinka_bitmap = {{ + .base = {{.type = &displayio_bitmap_type }}, + .width = {0}, + .height = {0}, + .data = blinka_bitmap_data, + .stride = 2, + .bits_per_value = 4, + .x_shift = 3, + .x_mask = 0x7, + .bitmask = 0xf, + .read_only = true +}}; + +_displayio_color_t blinka_colors[7] = {{ + {{ + .rgb888 = 0x000000, + .rgb565 = 0x0000, + .luma = 0x00, + .chroma = 0, + .transparent = true + }}, + {{ + .rgb888 = 0x8428bc, + .rgb565 = 0x8978, + .luma = 0xff, // We cheat the luma here. It is actually 0x60 + .hue = 184, + .chroma = 148 + }}, + {{ + .rgb888 = 0xff89bc, + .rgb565 = 0xFCB8, + .luma = 0xb5, + .hue = 222, + .chroma = 118 + }}, + {{ + .rgb888 = 0x7beffe, + .rgb565 = 0x869F, + .luma = 0xe0, + .hue = 124, + .chroma = 131 + }}, + {{ + .rgb888 = 0x51395f, + .rgb565 = 0x5A0D, + .luma = 0x47, + .hue = 185, + .chroma = 38 + }}, + {{ + .rgb888 = 0xffffff, + .rgb565 = 0xffff, + .luma = 0xff, + .chroma = 0 + }}, + {{ + .rgb888 = 0x0736a0, + .rgb565 = 0x01f5, + .luma = 0x44, + .hue = 147, + .chroma = 153 + }}, +}}; + +displayio_palette_t blinka_palette = {{ + .base = {{.type = &displayio_palette_type }}, + .colors = blinka_colors, + .color_count = 7, + .needs_refresh = false +}}; + +displayio_tilegrid_t supervisor_blinka_sprite = {{ + .base = {{.type = &displayio_tilegrid_type }}, + .bitmap = &blinka_bitmap, + .pixel_shader = &blinka_palette, + .x = 0, + .y = 0, + .pixel_width = {0}, + .pixel_height = {0}, + .bitmap_width_in_tiles = 1, + .width_in_tiles = 1, + .height_in_tiles = 1, + .tile_width = {0}, + .tile_height = {0}, + .top_left_x = {0}, + .top_left_y = {0}, + .tiles = 0, + .partial_change = false, + .full_change = false, + .hidden = false, + .hidden_by_parent = false, + .moved = false, + .inline_tiles = true, + .in_group = true +}}; +#endif +""".format( + blinka_size + ) +) + +c_file.write( + """\ +#if CIRCUITPY_TERMINALIO _displayio_color_t terminal_colors[2] = { { .rgb888 = 0x000000, @@ -139,11 +294,41 @@ displayio_palette_t supervisor_terminal_color = { c_file.write( """\ -displayio_tilegrid_t supervisor_terminal_text_grid = {{ +displayio_tilegrid_t supervisor_terminal_scroll_area_text_grid = {{ .base = {{ .type = &displayio_tilegrid_type }}, .bitmap = (displayio_bitmap_t*) &supervisor_terminal_font_bitmap, .pixel_shader = &supervisor_terminal_color, - .x = 16, + .x = 0, + .y = 0, + .pixel_width = {1}, + .pixel_height = {2}, + .bitmap_width_in_tiles = {0}, + .tiles_in_bitmap = {0}, + .width_in_tiles = 1, + .height_in_tiles = 1, + .tile_width = {1}, + .tile_height = {2}, + .tiles = NULL, + .partial_change = false, + .full_change = false, + .hidden = false, + .hidden_by_parent = false, + .moved = false, + .inline_tiles = false, + .in_group = true +}}; +""".format( + len(all_characters), tile_x, tile_y + ) +) + +c_file.write( + """\ +displayio_tilegrid_t supervisor_terminal_status_bar_text_grid = {{ + .base = {{ .type = &displayio_tilegrid_type }}, + .bitmap = (displayio_bitmap_t*) &supervisor_terminal_font_bitmap, + .pixel_shader = &supervisor_terminal_color, + .x = 0, .y = 0, .pixel_width = {1}, .pixel_height = {2}, @@ -228,7 +413,10 @@ terminalio_terminal_obj_t supervisor_terminal = { .font = &supervisor_terminal_font, .cursor_x = 0, .cursor_y = 0, - .tilegrid = NULL + .scroll_area = NULL, + .status_bar = NULL }; + +#endif """ ) diff --git a/tools/gen_web_workflow_static.py b/tools/gen_web_workflow_static.py new file mode 100644 index 0000000000..172a80dac0 --- /dev/null +++ b/tools/gen_web_workflow_static.py @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) +# +# SPDX-License-Identifier: MIT + +import argparse +import gzip +import minify_html +import jsmin +import mimetypes +import pathlib + +parser = argparse.ArgumentParser(description="Generate displayio resources.") +parser.add_argument("--output_c_file", type=argparse.FileType("w"), required=True) +parser.add_argument("files", metavar="FILE", type=argparse.FileType("rb"), nargs="+") + +args = parser.parse_args() + + +c_file = args.output_c_file + +c_file.write(f"// Autogenerated by tools/gen_web_workflow_static.py\n") +c_file.write(f"#include \n\n") + +for f in args.files: + path = pathlib.Path(f.name) + variable = path.name.replace(".", "_") + uncompressed = f.read() + ulen = len(uncompressed) + if f.name.endswith(".html"): + uncompressed = minify_html.minify(uncompressed.decode("utf-8")).encode("utf-8") + elif f.name.endswith(".js"): + uncompressed = jsmin.jsmin(uncompressed.decode("utf-8"), quote_chars="'\"`").encode( + "utf-8" + ) + compressed = gzip.compress(uncompressed) + clen = len(compressed) + compressed = ", ".join([hex(x) for x in compressed]) + mime = mimetypes.guess_type(f.name)[0] + + c_file.write(f"// {f.name}\n") + c_file.write(f"// Original length: {ulen} Compressed length: {clen}\n") + c_file.write(f"const uint32_t {variable}_length = {clen};\n") + c_file.write(f'const char* {variable}_content_type = "{mime}";\n') + c_file.write(f"const uint8_t {variable}[{clen}] = {{{compressed}}};\n\n") diff --git a/tools/tinytest-codegen.py b/tools/tinytest-codegen.py index 5c14bf2d5b..79b03f1383 100755 --- a/tools/tinytest-codegen.py +++ b/tools/tinytest-codegen.py @@ -100,6 +100,7 @@ exclude_tests = ( "float/float_divmod.py", # requires double precision floating point to work "float/float2int_doubleprec_intbig.py", + "float/float_format_ints_doubleprec.py", "float/float_parse_doubleprec.py", # inline asm FP tests (require Cortex-M4) "inlineasm/asmfpaddsub.py",