From 68a4b6448e842ec78cd2d6900bcb1596f62ae513 Mon Sep 17 00:00:00 2001 From: leoli51 Date: Sat, 28 Aug 2021 16:34:38 +0200 Subject: [PATCH 1/4] ready for pull request --- .github/workflows/build.yml | 1 + locale/circuitpython.pot | 14 +++---- .../raspberrypi/boards/melopero_shake/board.c | 40 +++++++++++++++++++ .../boards/melopero_shake/mpconfigboard.h | 12 ++++++ .../boards/melopero_shake/mpconfigboard.mk | 11 +++++ .../raspberrypi/boards/melopero_shake/pins.c | 34 ++++++++++++++++ 6 files changed, 103 insertions(+), 9 deletions(-) create mode 100644 ports/raspberrypi/boards/melopero_shake/board.c create mode 100644 ports/raspberrypi/boards/melopero_shake/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/melopero_shake/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/melopero_shake/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3cd9f6650e..d322216e68 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -291,6 +291,7 @@ jobs: - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" - "matrixportal_m4" + - "melopero_shake" - "meowbit_v121" - "meowmeow" - "metro_m0_express" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 9afa77328d..bd70fcd946 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -1185,11 +1185,6 @@ msgstr "" msgid "Input/output error" msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1506,6 +1501,11 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +msgid "Missing jmp_pin. Instruction %d jumps on pin" +msgstr "" + #: shared-bindings/busio/UART.c shared-bindings/displayio/Group.c msgid "Must be a %q subclass." msgstr "" @@ -3609,10 +3609,6 @@ msgstr "" msgid "no active exception to reraise" msgstr "" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "" diff --git a/ports/raspberrypi/boards/melopero_shake/board.c b/ports/raspberrypi/boards/melopero_shake/board.c new file mode 100644 index 0000000000..de6e424ed9 --- /dev/null +++ b/ports/raspberrypi/boards/melopero_shake/board.c @@ -0,0 +1,40 @@ +/* + * 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" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/melopero_shake/mpconfigboard.h b/ports/raspberrypi/boards/melopero_shake/mpconfigboard.h new file mode 100644 index 0000000000..7da7e8f360 --- /dev/null +++ b/ports/raspberrypi/boards/melopero_shake/mpconfigboard.h @@ -0,0 +1,12 @@ +#define MICROPY_HW_BOARD_NAME "Melopero Shake" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO18) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO19) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO20) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/melopero_shake/mpconfigboard.mk b/ports/raspberrypi/boards/melopero_shake/mpconfigboard.mk new file mode 100644 index 0000000000..bf42856b34 --- /dev/null +++ b/ports/raspberrypi/boards/melopero_shake/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x2E8A +USB_PID = 0x1005 +USB_PRODUCT = "Shake" +USB_MANUFACTURER = "Melopero" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/melopero_shake/pins.c b/ports/raspberrypi/boards/melopero_shake/pins.c new file mode 100644 index 0000000000..7e251329e4 --- /dev/null +++ b/ports/raspberrypi/boards/melopero_shake/pins.c @@ -0,0 +1,34 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO20) }, + { 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_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D6), 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_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + + { 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_global_dict_table); From bb424c75103d3abddf738c7bbe34414f910873f8 Mon Sep 17 00:00:00 2001 From: leoli51 Date: Sat, 18 Sep 2021 16:05:13 +0200 Subject: [PATCH 2/4] renamed folder and added neopixel gpio --- .github/workflows/build.yml | 2 +- .../boards/{melopero_shake => melopero_shake_rp2040}/board.c | 0 .../{melopero_shake => melopero_shake_rp2040}/mpconfigboard.h | 4 +++- .../mpconfigboard.mk | 4 ++-- .../boards/{melopero_shake => melopero_shake_rp2040}/pins.c | 2 ++ 5 files changed, 8 insertions(+), 4 deletions(-) rename ports/raspberrypi/boards/{melopero_shake => melopero_shake_rp2040}/board.c (100%) rename ports/raspberrypi/boards/{melopero_shake => melopero_shake_rp2040}/mpconfigboard.h (77%) rename ports/raspberrypi/boards/{melopero_shake => melopero_shake_rp2040}/mpconfigboard.mk (64%) rename ports/raspberrypi/boards/{melopero_shake => melopero_shake_rp2040}/pins.c (96%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d322216e68..64a5a5bbcd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -291,7 +291,7 @@ jobs: - "makerdiary_nrf52840_mdk" - "makerdiary_nrf52840_mdk_usb_dongle" - "matrixportal_m4" - - "melopero_shake" + - "melopero_shake_rp2040" - "meowbit_v121" - "meowmeow" - "metro_m0_express" diff --git a/ports/raspberrypi/boards/melopero_shake/board.c b/ports/raspberrypi/boards/melopero_shake_rp2040/board.c similarity index 100% rename from ports/raspberrypi/boards/melopero_shake/board.c rename to ports/raspberrypi/boards/melopero_shake_rp2040/board.c diff --git a/ports/raspberrypi/boards/melopero_shake/mpconfigboard.h b/ports/raspberrypi/boards/melopero_shake_rp2040/mpconfigboard.h similarity index 77% rename from ports/raspberrypi/boards/melopero_shake/mpconfigboard.h rename to ports/raspberrypi/boards/melopero_shake_rp2040/mpconfigboard.h index 7da7e8f360..b9996d94d1 100644 --- a/ports/raspberrypi/boards/melopero_shake/mpconfigboard.h +++ b/ports/raspberrypi/boards/melopero_shake_rp2040/mpconfigboard.h @@ -1,6 +1,8 @@ -#define MICROPY_HW_BOARD_NAME "Melopero Shake" +#define MICROPY_HW_BOARD_NAME "Melopero Shake RP2040" #define MICROPY_HW_MCU_NAME "rp2040" +#define MICROPY_HW_NEOPIXEL (&pin_GPIO16) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) diff --git a/ports/raspberrypi/boards/melopero_shake/mpconfigboard.mk b/ports/raspberrypi/boards/melopero_shake_rp2040/mpconfigboard.mk similarity index 64% rename from ports/raspberrypi/boards/melopero_shake/mpconfigboard.mk rename to ports/raspberrypi/boards/melopero_shake_rp2040/mpconfigboard.mk index bf42856b34..424f0e9ca7 100644 --- a/ports/raspberrypi/boards/melopero_shake/mpconfigboard.mk +++ b/ports/raspberrypi/boards/melopero_shake_rp2040/mpconfigboard.mk @@ -1,11 +1,11 @@ USB_VID = 0x2E8A USB_PID = 0x1005 -USB_PRODUCT = "Shake" +USB_PRODUCT = "Shake RP2040" USB_MANUFACTURER = "Melopero" CHIP_VARIANT = RP2040 CHIP_FAMILY = rp2 -EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" +EXTERNAL_FLASH_DEVICES = "W25Q128JVxM" CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/melopero_shake/pins.c b/ports/raspberrypi/boards/melopero_shake_rp2040/pins.c similarity index 96% rename from ports/raspberrypi/boards/melopero_shake/pins.c rename to ports/raspberrypi/boards/melopero_shake_rp2040/pins.c index 7e251329e4..8d5be961e0 100644 --- a/ports/raspberrypi/boards/melopero_shake/pins.c +++ b/ports/raspberrypi/boards/melopero_shake_rp2040/pins.c @@ -27,6 +27,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO16) }, + { 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) }, From 761b1dbf12d8c0ce44b68d9b2df6b731702de9a6 Mon Sep 17 00:00:00 2001 From: leoli51 Date: Sun, 19 Sep 2021 15:51:43 +0200 Subject: [PATCH 3/4] merged commits from main --- .github/workflows/build.yml | 274 +----- .github/workflows/ports_windows.yml | 4 +- .gitmodules | 18 +- .pre-commit-config.yaml | 2 +- BUILDING.md | 6 + Makefile | 14 +- README.rst | 11 +- WEBUSB_README.md | 2 +- conf.py | 19 +- docs/autoapi/templates/python/module.rst | 16 + docs/common_hal.md | 2 +- docs/porting.rst | 2 +- docs/redirects.txt | 3 +- docs/shared_bindings_matrix.py | 2 +- docs/supported_ports.rst | 2 +- frozen/Adafruit_CircuitPython_APDS9960 | 1 + frozen/Adafruit_CircuitPython_BLE | 2 +- .../Adafruit_CircuitPython_CircuitPlayground | 2 +- frozen/Adafruit_CircuitPython_Display_Shapes | 2 +- frozen/Adafruit_CircuitPython_Display_Text | 2 +- frozen/Adafruit_CircuitPython_HID | 2 +- frozen/Adafruit_CircuitPython_MIDI | 2 +- frozen/Adafruit_CircuitPython_NeoPixel | 2 +- frozen/Adafruit_CircuitPython_Requests | 2 +- frozen/Adafruit_CircuitPython_ST7789 | 2 +- frozen/circuitpython-stage | 2 +- lib/libc/string0.c | 2 + lib/oofatfs/ff.c | 2 + lib/oofatfs/ffconf.h | 5 +- lib/quirc | 1 + lib/tinyusb | 2 +- lib/utils/pyexec.c | 119 ++- lib/utils/pyexec.h | 4 + locale/ID.po | 387 +++++---- locale/circuitpython.pot | 372 ++++---- locale/cs.po | 384 +++++---- locale/de_DE.po | 409 +++++---- locale/el.po | 384 +++++---- locale/en_GB.po | 757 +++++++++------- locale/es.po | 430 ++++++---- locale/fil.po | 397 +++++---- locale/fr.po | 437 ++++++---- locale/hi.po | 384 +++++---- locale/it_IT.po | 389 +++++---- locale/ja.po | 398 +++++---- locale/ko.po | 384 +++++---- locale/nl.po | 416 +++++---- locale/pl.po | 390 +++++---- locale/pt_BR.po | 441 ++++++---- locale/sv.po | 455 ++++++---- locale/zh_Latn_pinyin.po | 449 ++++++---- main.c | 42 +- ports/atmel-samd/Makefile | 8 +- ports/atmel-samd/audio_dma.c | 216 +++-- ports/atmel-samd/audio_dma.h | 16 +- .../boards/8086_commander/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/8086_commander/pins.c | 6 +- .../boards/adafruit_neokey_trinkey_m0/pins.c | 6 +- .../mpconfigboard.h | 1 + .../mpconfigboard.mk | 8 +- .../adafruit_proxlight_trinkey_m0/pins.c | 6 +- .../boards/adafruit_rotary_trinkey_m0/pins.c | 6 +- .../boards/adafruit_slide_trinkey_m0/pins.c | 6 +- .../boards/aloriumtech_evo_m51/pins.c | 6 +- .../boards/arduino_mkr1300/mpconfigboard.h | 13 + .../boards/arduino_mkr1300/mpconfigboard.mk | 2 + .../atmel-samd/boards/arduino_mkr1300/pins.c | 10 +- .../atmel-samd/boards/arduino_mkrzero/pins.c | 10 +- .../arduino_nano_33_iot/mpconfigboard.h | 8 + .../arduino_nano_33_iot/mpconfigboard.mk | 2 + .../boards/arduino_nano_33_iot/pins.c | 15 +- .../boards/arduino_zero/mpconfigboard.h | 8 + .../boards/arduino_zero/mpconfigboard.mk | 2 + ports/atmel-samd/boards/arduino_zero/pins.c | 13 +- .../atmel-samd/boards/bast_pro_mini_m0/pins.c | 6 +- .../atmel-samd/boards/bdmicro_vina_d21/pins.c | 6 +- .../boards/bdmicro_vina_d51/mpconfigboard.h | 2 +- .../boards/bdmicro_vina_d51/mpconfigboard.mk | 4 +- .../atmel-samd/boards/bdmicro_vina_d51/pins.c | 24 +- .../boards/bdmicro_vina_d51_pcb7/pins.c | 6 +- .../boards/blm_badge/mpconfigboard.mk | 1 + ports/atmel-samd/boards/blm_badge/pins.c | 6 +- .../boards/capablerobot_usbhub/pins.c | 6 +- .../atmel-samd/boards/catwan_usbstick/pins.c | 9 +- .../boards/circuitbrains_basic_m0/pins.c | 8 +- .../boards/circuitbrains_deluxe_m4/pins.c | 11 +- .../circuitplayground_express/mpconfigboard.h | 3 + .../boards/circuitplayground_express/pins.c | 6 +- .../mpconfigboard.h | 3 + .../circuitplayground_express_crickit/pins.c | 6 +- .../mpconfigboard.h | 3 + .../mpconfigboard.mk | 1 + .../pins.c | 6 +- ports/atmel-samd/boards/common.template.ld | 16 +- ports/atmel-samd/boards/cp32-m4/pins.c | 6 +- ports/atmel-samd/boards/cp_sapling_m0/pins.c | 6 +- .../boards/cp_sapling_m0_revb/pins.c | 8 +- .../boards/cp_sapling_m0_spiflash/pins.c | 6 +- ports/atmel-samd/boards/datalore_ip_m4/pins.c | 6 +- .../boards/datum_distance/mpconfigboard.h | 21 + ports/atmel-samd/boards/datum_distance/pins.c | 11 +- .../boards/datum_imu/mpconfigboard.h | 19 + ports/atmel-samd/boards/datum_imu/pins.c | 11 +- .../boards/datum_light/mpconfigboard.h | 21 + ports/atmel-samd/boards/datum_light/pins.c | 11 +- .../boards/datum_weather/mpconfigboard.h | 21 + ports/atmel-samd/boards/datum_weather/pins.c | 10 +- ports/atmel-samd/boards/dynalora_usb/pins.c | 6 +- .../atmel-samd/boards/dynossat_edu_eps/pins.c | 11 +- .../boards/dynossat_edu_obc/mpconfigboard.h | 5 - .../atmel-samd/boards/dynossat_edu_obc/pins.c | 13 +- .../boards/escornabot_makech/pins.c | 8 +- .../feather_m0_adalogger/mpconfigboard.h | 18 + .../boards/feather_m0_adalogger/pins.c | 19 +- .../boards/feather_m0_basic/mpconfigboard.h | 21 + .../atmel-samd/boards/feather_m0_basic/pins.c | 6 +- .../boards/feather_m0_express/pins.c | 6 +- .../boards/feather_m0_express_crickit/pins.c | 6 +- .../atmel-samd/boards/feather_m0_rfm69/pins.c | 6 +- .../atmel-samd/boards/feather_m0_rfm9x/pins.c | 6 +- .../boards/feather_m0_supersized/pins.c | 6 +- ports/atmel-samd/boards/feather_m4_can/pins.c | 6 +- .../boards/feather_m4_express/pins.c | 6 +- ports/atmel-samd/boards/fluff_m0/pins.c | 6 +- ports/atmel-samd/boards/gemma_m0/pins.c | 6 +- .../boards/grandcentral_m4_express/pins.c | 8 +- .../boards/hallowing_m0_express/board.c | 1 - .../hallowing_m0_express/mpconfigboard.mk | 1 + .../boards/hallowing_m0_express/pins.c | 6 +- .../boards/hallowing_m4_express/board.c | 1 - .../boards/hallowing_m4_express/pins.c | 6 +- ports/atmel-samd/boards/huntercat_nfc/pins.c | 6 +- .../boards/itsybitsy_m0_express/pins.c | 6 +- .../boards/itsybitsy_m4_express/pins.c | 6 +- .../boards/kicksat-sprite/mpconfigboard.h | 2 + .../boards/kicksat-sprite/mpconfigboard.mk | 2 + ports/atmel-samd/boards/kicksat-sprite/pins.c | 6 +- .../boards/loc_ber_m4_base_board/pins.c | 16 +- .../atmel-samd/boards/matrixportal_m4/pins.c | 6 +- ports/atmel-samd/boards/meowmeow/pins.c | 14 +- .../atmel-samd/boards/metro_m0_express/pins.c | 6 +- .../boards/metro_m4_airlift_lite/pins.c | 6 +- .../atmel-samd/boards/metro_m4_express/pins.c | 6 +- ports/atmel-samd/boards/mini_sam_m4/pins.c | 6 +- ports/atmel-samd/boards/monster_m4sk/board.c | 1 - ports/atmel-samd/boards/monster_m4sk/pins.c | 6 +- .../atmel-samd/boards/ndgarage_ndbit6/pins.c | 7 +- .../boards/ndgarage_ndbit6_v2/pins.c | 7 +- .../neopixel_trinkey_m0/mpconfigboard.h | 1 + .../boards/neopixel_trinkey_m0/pins.c | 6 +- ports/atmel-samd/boards/nfc_copy_cat/pins.c | 6 +- ports/atmel-samd/boards/openbook_m4/pins.c | 9 +- ports/atmel-samd/boards/pewpew10/pins.c | 6 +- ports/atmel-samd/boards/pewpew_m4/board.c | 1 - .../boards/pewpew_m4/mpconfigboard.mk | 16 +- ports/atmel-samd/boards/pewpew_m4/pins.c | 6 +- ports/atmel-samd/boards/picoplanet/pins.c | 12 +- ports/atmel-samd/boards/pybadge/board.c | 1 - .../boards/pybadge/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pybadge/pins.c | 6 +- .../boards/pycubed/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pycubed/pins.c | 6 +- ports/atmel-samd/boards/pycubed_mram/pins.c | 6 +- ports/atmel-samd/boards/pygamer/board.c | 1 - .../boards/pygamer/mpconfigboard.mk | 2 +- ports/atmel-samd/boards/pygamer/pins.c | 6 +- ports/atmel-samd/boards/pyportal/board.c | 7 +- ports/atmel-samd/boards/pyportal/pins.c | 6 +- .../atmel-samd/boards/pyportal_titano/board.c | 7 +- .../atmel-samd/boards/pyportal_titano/pins.c | 6 +- ports/atmel-samd/boards/pyruler/pins.c | 6 +- ports/atmel-samd/boards/qtpy_m0/pins.c | 6 +- .../atmel-samd/boards/qtpy_m0_haxpress/pins.c | 6 +- ports/atmel-samd/boards/robohatmm1_m4/pins.c | 6 +- ports/atmel-samd/boards/sam32/pins.c | 6 +- .../atmel-samd/boards/same54_xplained/pins.c | 6 +- .../boards/seeeduino_wio_terminal/board.c | 1 - .../boards/seeeduino_wio_terminal/pins.c | 6 +- ports/atmel-samd/boards/seeeduino_xiao/pins.c | 6 +- .../boards/sensebox_mcu/mpconfigboard.h | 4 + .../boards/sensebox_mcu/mpconfigboard.mk | 5 + ports/atmel-samd/boards/sensebox_mcu/pins.c | 6 +- ports/atmel-samd/boards/serpente/pins.c | 6 +- ports/atmel-samd/boards/shirtty/pins.c | 6 +- .../boards/silicognition-m4-shim/pins.c | 8 +- ports/atmel-samd/boards/snekboard/pins.c | 12 +- .../boards/sparkfun_lumidrive/pins.c | 19 +- .../sparkfun_qwiic_micro_no_flash/pins.c | 9 +- .../sparkfun_qwiic_micro_with_flash/pins.c | 9 +- .../boards/sparkfun_redboard_turbo/pins.c | 18 +- .../boards/sparkfun_samd21_dev/pins.c | 6 +- .../boards/sparkfun_samd21_mini/pins.c | 6 +- .../sparkfun_samd51_micromod/mpconfigboard.h | 5 +- .../sparkfun_samd51_micromod/mpconfigboard.mk | 2 +- .../boards/sparkfun_samd51_micromod/pins.c | 286 +++++-- .../boards/sparkfun_samd51_thing_plus/pins.c | 6 +- .../boards/stackrduino_m0_pro/pins.c | 13 +- .../boards/stringcar_m0_express/pins.c | 6 +- .../boards/trellis_m4_express/pins.c | 6 +- ports/atmel-samd/boards/trinket_m0/pins.c | 6 +- .../boards/trinket_m0_haxpress/pins.c | 6 +- ports/atmel-samd/boards/uartlogger2/pins.c | 6 +- ports/atmel-samd/boards/uchip/pins.c | 6 +- ports/atmel-samd/boards/ugame10/board.c | 1 - .../boards/ugame10/mpconfigboard.mk | 3 +- ports/atmel-samd/boards/ugame10/pins.c | 6 +- .../mpconfigboard.mk | 1 + .../winterbloom_big_honking_button/pins.c | 6 +- .../boards/winterbloom_sol/mpconfigboard.mk | 1 + .../atmel-samd/boards/winterbloom_sol/pins.c | 6 +- ports/atmel-samd/boards/xinabox_cc03/pins.c | 11 +- ports/atmel-samd/boards/xinabox_cs11/pins.c | 6 +- .../atmel-samd/common-hal/audiobusio/I2SOut.c | 7 +- .../atmel-samd/common-hal/audioio/AudioOut.c | 6 +- ports/atmel-samd/common-hal/busio/I2C.c | 7 + ports/atmel-samd/common-hal/busio/OneWire.h | 33 - ports/atmel-samd/common-hal/canio/Listener.c | 7 + .../ParallelBus.c | 26 +- .../ParallelBus.h | 8 +- ports/atmel-samd/common-hal/pulseio/PulseIn.c | 6 + .../atmel-samd/common-hal/pulseio/PulseOut.c | 15 +- .../atmel-samd/common-hal/pulseio/PulseOut.h | 2 + ports/atmel-samd/common-hal/pwmio/PWMOut.c | 53 +- .../common-hal/rgbmatrix/RGBMatrix.c | 1 + ports/atmel-samd/mpconfigport.h | 10 + ports/atmel-samd/mpconfigport.mk | 1 + ports/atmel-samd/peripherals | 2 +- ports/atmel-samd/shared_timers.c | 84 ++ .../OneWire.h => atmel-samd/shared_timers.h} | 15 +- ports/atmel-samd/supervisor/port.c | 200 +++-- ports/atmel-samd/timer_handler.h | 4 - ports/cxd56/Makefile | 12 +- ports/cxd56/README.md | 2 +- ports/cxd56/boards/spresense/pins.c | 2 + ports/cxd56/common-hal/busio/SPI.c | 5 +- ports/cxd56/common-hal/pulseio/PulseOut.c | 20 +- ports/cxd56/common-hal/pulseio/PulseOut.h | 3 + ports/cxd56/common-hal/pwmio/PWMOut.c | 4 + ports/cxd56/common-hal/sdioio/SDCard.c | 1 - ports/cxd56/configs/circuitpython/defconfig | 63 +- ports/cxd56/mpconfigport.mk | 2 +- ports/cxd56/spresense-exported-sdk | 2 +- ports/cxd56/tools/flash_writer.py | 46 +- ports/cxd56/tools/requirements.txt | 2 + ports/cxd56/tools/xmodem.py | 808 ------------------ .../espressif_kaluga_1.3/mpconfigboard.mk | 23 - .../espressif_kaluga_1/mpconfigboard.mk | 23 - .../boards/muselab_nanoesp32_s2_wroom/pins.c | 48 -- .../boards/muselab_nanoesp32_s2_wrover/pins.c | 48 -- ports/esp32s2/common-hal/busio/OneWire.h | 33 - ports/esp32s2/esp-idf | 1 - ports/{esp32s2 => espressif}/.gitignore | 0 ports/{esp32s2 => espressif}/CMakeLists.txt | 0 ports/{esp32s2 => espressif}/Makefile | 0 ports/{esp32s2 => espressif}/README.rst | 0 ports/{esp32s2 => espressif}/background.c | 0 ports/{esp32s2 => espressif}/background.h | 0 .../bindings/espidf/__init__.c | 19 + .../bindings/espidf/__init__.h | 0 .../adafruit_feather_esp32s2_nopsram/board.c | 0 .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../adafruit_feather_esp32s2_nopsram/pins.c | 6 +- .../sdkconfig | 0 .../board.c | 1 - .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../pins.c | 6 +- .../sdkconfig | 0 .../boards/adafruit_funhouse/board.c | 1 - .../boards/adafruit_funhouse/mpconfigboard.h | 5 +- .../boards/adafruit_funhouse/mpconfigboard.mk | 0 .../boards/adafruit_funhouse/pins.c | 6 +- .../boards/adafruit_funhouse/sdkconfig | 0 .../adafruit_magtag_2.9_grayscale/board.c | 0 .../mpconfigboard.h | 1 + .../mpconfigboard.mk | 0 .../adafruit_magtag_2.9_grayscale/pins.c | 6 +- .../adafruit_magtag_2.9_grayscale/sdkconfig | 0 .../boards/adafruit_metro_esp32s2/board.c | 0 .../adafruit_metro_esp32s2/mpconfigboard.h | 0 .../adafruit_metro_esp32s2/mpconfigboard.mk | 0 .../boards/adafruit_metro_esp32s2/pins.c | 6 +- .../boards/adafruit_metro_esp32s2/sdkconfig | 0 .../ai_thinker_esp_12k_nodemcu}/board.c | 0 .../mpconfigboard.h | 40 + .../mpconfigboard.mk | 17 + .../boards/ai_thinker_esp_12k_nodemcu}/pins.c | 6 +- .../ai_thinker_esp_12k_nodemcu/sdkconfig | 33 + .../boards/artisense_rd00/board.c | 0 .../boards/artisense_rd00/mpconfigboard.h | 0 .../boards/artisense_rd00/mpconfigboard.mk | 0 .../boards/artisense_rd00/pins.c | 6 +- .../boards/artisense_rd00/sdkconfig | 0 .../boards/atmegazero_esp32s2/board.c | 0 .../boards/atmegazero_esp32s2/mpconfigboard.h | 0 .../atmegazero_esp32s2/mpconfigboard.mk | 0 .../boards/atmegazero_esp32s2/pins.c | 10 +- .../boards/atmegazero_esp32s2/sdkconfig | 0 .../boards/crumpspace_crumps2}/board.c | 0 .../boards/crumpspace_crumps2/mpconfigboard.h | 35 + .../crumpspace_crumps2/mpconfigboard.mk | 22 + .../boards/crumpspace_crumps2/pins.c | 55 ++ .../boards/crumpspace_crumps2/sdkconfig | 39 + .../boards/electroniccats_bastwifi}/board.c | 0 .../electroniccats_bastwifi/mpconfigboard.h | 0 .../electroniccats_bastwifi/mpconfigboard.mk | 0 .../boards/electroniccats_bastwifi/pins.c | 6 +- .../boards/electroniccats_bastwifi/sdkconfig | 0 .../boards/espressif_hmi_devkit_1/board.c | 50 ++ .../espressif_hmi_devkit_1/mpconfigboard.h | 47 + .../espressif_hmi_devkit_1/mpconfigboard.mk | 17 + .../boards/espressif_hmi_devkit_1/pins.c | 122 +++ .../boards/espressif_hmi_devkit_1}/sdkconfig | 0 .../boards/espressif_kaluga_1.3}/board.c | 0 .../espressif_kaluga_1.3/mpconfigboard.h | 0 .../espressif_kaluga_1.3/mpconfigboard.mk | 17 + .../boards/espressif_kaluga_1.3/pins.c | 6 +- .../boards/espressif_kaluga_1.3}/sdkconfig | 0 .../boards/espressif_kaluga_1}/board.c | 0 .../boards/espressif_kaluga_1/mpconfigboard.h | 0 .../espressif_kaluga_1/mpconfigboard.mk | 17 + .../boards/espressif_kaluga_1/pins.c | 6 +- .../boards/espressif_kaluga_1}/sdkconfig | 0 .../boards/espressif_saola_1_wroom}/board.c | 0 .../espressif_saola_1_wroom/mpconfigboard.h | 0 .../espressif_saola_1_wroom/mpconfigboard.mk | 0 .../boards/espressif_saola_1_wroom}/pins.c | 6 +- .../boards/espressif_saola_1_wroom/sdkconfig | 0 .../boards/espressif_saola_1_wrover}/board.c | 0 .../espressif_saola_1_wrover/mpconfigboard.h | 0 .../espressif_saola_1_wrover/mpconfigboard.mk | 0 .../boards/espressif_saola_1_wrover}/pins.c | 6 +- .../espressif_saola_1_wrover}/sdkconfig | 0 .../boards/franzininho_wifi_wroom}/board.c | 0 .../franzininho_wifi_wroom/mpconfigboard.h | 0 .../franzininho_wifi_wroom/mpconfigboard.mk | 0 .../boards/franzininho_wifi_wroom}/pins.c | 6 +- .../boards/franzininho_wifi_wroom/sdkconfig | 0 .../boards/franzininho_wifi_wrover}/board.c | 0 .../franzininho_wifi_wrover/mpconfigboard.h | 0 .../franzininho_wifi_wrover/mpconfigboard.mk | 0 .../boards/franzininho_wifi_wrover}/pins.c | 6 +- .../boards/franzininho_wifi_wrover}/sdkconfig | 0 .../boards/gravitech_cucumber_m/board.c | 51 ++ .../gravitech_cucumber_m/mpconfigboard.h | 41 + .../gravitech_cucumber_m/mpconfigboard.mk | 17 + .../boards/gravitech_cucumber_m/pins.c | 51 ++ .../boards/gravitech_cucumber_m/sdkconfig | 5 + .../boards/gravitech_cucumber_ms/board.c | 51 ++ .../gravitech_cucumber_ms/mpconfigboard.h | 44 + .../gravitech_cucumber_ms/mpconfigboard.mk | 17 + .../boards/gravitech_cucumber_ms/pins.c | 54 ++ .../boards/gravitech_cucumber_ms/sdkconfig | 5 + .../boards/gravitech_cucumber_r/board.c | 51 ++ .../gravitech_cucumber_r/mpconfigboard.h | 41 + .../gravitech_cucumber_r/mpconfigboard.mk | 17 + .../boards/gravitech_cucumber_r/pins.c | 51 ++ .../boards/gravitech_cucumber_r/sdkconfig | 39 + .../boards/gravitech_cucumber_rs/board.c | 51 ++ .../gravitech_cucumber_rs/mpconfigboard.h | 44 + .../gravitech_cucumber_rs/mpconfigboard.mk | 17 + .../boards/gravitech_cucumber_rs/pins.c | 54 ++ .../boards/gravitech_cucumber_rs/sdkconfig | 39 + .../boards/lilygo_ttgo_t8_s2_st7789/board.c | 1 - .../lilygo_ttgo_t8_s2_st7789/mpconfigboard.h | 0 .../lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk | 0 .../boards/lilygo_ttgo_t8_s2_st7789/pins.c | 10 +- .../boards/lilygo_ttgo_t8_s2_st7789/sdkconfig | 0 .../boards/lolin_s2_mini}/board.c | 0 .../boards/lolin_s2_mini/mpconfigboard.h | 42 + .../boards/lolin_s2_mini/mpconfigboard.mk | 19 + ports/espressif/boards/lolin_s2_mini/pins.c | 90 ++ .../espressif/boards/lolin_s2_mini/sdkconfig | 39 + .../boards/microdev_micro_s2}/board.c | 0 .../boards/microdev_micro_s2/mpconfigboard.h | 2 - .../boards/microdev_micro_s2/mpconfigboard.mk | 0 .../boards/microdev_micro_s2/pins.c | 6 +- .../boards/microdev_micro_s2/sdkconfig | 0 .../boards/morpheans_morphesp-240/board.c | 226 +++++ .../morpheans_morphesp-240/mpconfigboard.h | 44 + .../morpheans_morphesp-240/mpconfigboard.mk | 17 + .../boards/morpheans_morphesp-240/pins.c | 60 ++ .../boards/morpheans_morphesp-240/sdkconfig | 6 + .../boards/muselab_nanoesp32_s2_wroom/board.c | 52 ++ .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../boards/muselab_nanoesp32_s2_wroom/pins.c | 50 ++ .../muselab_nanoesp32_s2_wroom/sdkconfig | 0 .../muselab_nanoesp32_s2_wrover/board.c | 52 ++ .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../boards/muselab_nanoesp32_s2_wrover/pins.c | 50 ++ .../muselab_nanoesp32_s2_wrover/sdkconfig | 0 .../boards/odt_pixelwing_esp32_s2/board.c | 46 + .../odt_pixelwing_esp32_s2/mpconfigboard.h | 41 + .../odt_pixelwing_esp32_s2/mpconfigboard.mk | 17 + .../boards/odt_pixelwing_esp32_s2/pins.c | 16 + .../boards/odt_pixelwing_esp32_s2/sdkconfig | 39 + .../boards/targett_module_clip_wroom/board.c | 0 .../targett_module_clip_wroom/mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../boards/targett_module_clip_wroom}/pins.c | 6 +- .../targett_module_clip_wroom/sdkconfig | 0 .../boards/targett_module_clip_wrover/board.c | 0 .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../boards/targett_module_clip_wrover/pins.c | 50 ++ .../targett_module_clip_wrover/sdkconfig | 33 + .../boards/unexpectedmaker_feathers2}/board.c | 0 .../unexpectedmaker_feathers2/mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../boards/unexpectedmaker_feathers2/pins.c | 6 +- .../unexpectedmaker_feathers2/sdkconfig | 0 .../unexpectedmaker_feathers2_neo}/board.c | 0 .../mpconfigboard.h | 47 + .../mpconfigboard.mk | 20 + .../unexpectedmaker_feathers2_neo/pins.c | 121 +++ .../unexpectedmaker_feathers2_neo/sdkconfig | 39 + .../board.c | 61 ++ .../mpconfigboard.h | 0 .../mpconfigboard.mk | 0 .../pins.c | 6 +- .../sdkconfig | 0 .../boards/unexpectedmaker_tinys2/board.c | 61 ++ .../unexpectedmaker_tinys2/mpconfigboard.h | 0 .../unexpectedmaker_tinys2/mpconfigboard.mk | 2 + .../boards/unexpectedmaker_tinys2/pins.c | 6 +- .../boards/unexpectedmaker_tinys2/sdkconfig | 0 ports/{esp32s2 => espressif}/cam.c | 0 ports/{esp32s2 => espressif}/cam.h | 0 .../certificates/README.md | 0 .../certificates/nina-fw | 0 .../common-hal/alarm/SleepMemory.c | 0 .../common-hal/alarm/SleepMemory.h | 0 .../common-hal/alarm/__init__.c | 11 +- .../common-hal/alarm/__init__.h | 0 .../common-hal/alarm/pin/PinAlarm.c | 0 .../common-hal/alarm/pin/PinAlarm.h | 0 .../common-hal/alarm/time/TimeAlarm.c | 0 .../common-hal/alarm/time/TimeAlarm.h | 0 .../common-hal/alarm/touch/TouchAlarm.c | 0 .../common-hal/alarm/touch/TouchAlarm.h | 0 .../common-hal/analogio/AnalogIn.c | 0 .../common-hal/analogio/AnalogIn.h | 0 .../common-hal/analogio/AnalogOut.c | 0 .../common-hal/analogio/AnalogOut.h | 0 .../common-hal/analogio/__init__.c | 0 .../common-hal/audiobusio/I2SOut.c | 0 .../common-hal/audiobusio/I2SOut.h | 0 .../common-hal/audiobusio/PDMIn.c | 0 .../common-hal/audiobusio/PDMIn.h | 0 .../common-hal/audiobusio/__init__.c | 0 .../common-hal/audiobusio/__init__.h | 0 .../common-hal/board/__init__.c | 0 .../common-hal/busio/I2C.c | 14 +- .../common-hal/busio/I2C.h | 1 - .../common-hal/busio/SPI.c | 0 .../common-hal/busio/SPI.h | 0 .../common-hal/busio/UART.c | 0 .../common-hal/busio/UART.h | 0 .../common-hal/busio/__init__.c | 0 .../common-hal/canio/CAN.c | 0 .../common-hal/canio/CAN.h | 0 .../common-hal/canio/Listener.c | 5 + .../common-hal/canio/Listener.h | 0 .../common-hal/canio/__init__.c | 0 .../common-hal/canio/__init__.h | 0 .../common-hal/countio/Counter.c | 0 .../common-hal/countio/Counter.h | 0 .../common-hal/countio/__init__.c | 0 .../common-hal/digitalio/DigitalInOut.c | 0 .../common-hal/digitalio/DigitalInOut.h | 0 .../common-hal/digitalio/__init__.c | 0 .../common-hal/dualbank/__init__.c | 0 .../common-hal/dualbank/__init__.h | 0 .../common-hal/frequencyio/FrequencyIn.c | 0 .../common-hal/frequencyio/FrequencyIn.h | 0 .../common-hal/frequencyio/__init__.c | 0 .../imagecapture/ParallelImageCapture.c | 0 .../imagecapture/ParallelImageCapture.h | 0 .../common-hal/imagecapture/__init__.c | 0 .../common-hal/imagecapture/__init__.h | 0 .../common-hal/microcontroller/Pin.c | 0 .../common-hal/microcontroller/Pin.h | 0 .../common-hal/microcontroller/Processor.c | 0 .../common-hal/microcontroller/Processor.h | 0 .../common-hal/microcontroller/__init__.c | 0 .../common-hal/neopixel_write/__init__.c | 0 .../common-hal/nvm/ByteArray.c | 110 ++- .../common-hal/nvm/ByteArray.h | 0 .../common-hal/nvm/__init__.c | 0 .../common-hal/os/__init__.c | 0 .../common-hal/paralleldisplay}/ParallelBus.c | 26 +- .../common-hal/paralleldisplay}/ParallelBus.h | 8 +- .../common-hal/ps2io/Ps2.c | 0 .../common-hal/ps2io/Ps2.h | 0 .../common-hal/ps2io/__init__.c | 0 .../common-hal/pulseio/PulseIn.c | 0 .../common-hal/pulseio/PulseIn.h | 0 .../common-hal/pulseio/PulseOut.c | 4 - .../common-hal/pulseio/PulseOut.h | 0 .../common-hal/pulseio/__init__.c | 0 .../common-hal/pwmio/PWMOut.c | 10 +- .../common-hal/pwmio/PWMOut.h | 2 +- .../common-hal/pwmio/__init__.c | 0 .../common-hal/rgbmatrix/RGBMatrix.c | 0 .../common-hal/rgbmatrix/RGBMatrix.h | 0 .../common-hal/rgbmatrix/__init__.c | 0 .../common-hal/rgbmatrix/__init__.h | 0 .../common-hal/rotaryio/IncrementalEncoder.c | 0 .../common-hal/rotaryio/IncrementalEncoder.h | 0 .../common-hal/rotaryio/__init__.c | 0 .../common-hal/rtc/RTC.c | 0 .../common-hal/rtc/RTC.h | 0 .../common-hal/rtc/__init__.c | 0 .../common-hal/socketpool/Socket.c | 0 .../common-hal/socketpool/Socket.h | 0 .../common-hal/socketpool/SocketPool.c | 0 .../common-hal/socketpool/SocketPool.h | 0 .../common-hal/socketpool/__init__.c | 0 .../common-hal/socketpool/__init__.h | 0 .../common-hal/ssl/SSLContext.c | 0 .../common-hal/ssl/SSLContext.h | 0 .../common-hal/ssl/SSLSocket.c | 0 .../common-hal/ssl/SSLSocket.h | 0 .../common-hal/ssl/__init__.c | 0 .../common-hal/ssl/__init__.h | 0 .../common-hal/supervisor/Runtime.c | 0 .../common-hal/supervisor/Runtime.h | 0 .../common-hal/supervisor/__init__.c | 0 .../common-hal/time/__init__.c | 0 .../common-hal/touchio/TouchIn.c | 0 .../common-hal/touchio/TouchIn.h | 0 .../common-hal/touchio/__init__.c | 0 .../common-hal/watchdog/WatchDogMode.c | 0 .../common-hal/watchdog/WatchDogTimer.c | 0 .../common-hal/watchdog/WatchDogTimer.h | 0 .../common-hal/watchdog/__init__.c | 0 .../common-hal/wifi/Network.c | 0 .../common-hal/wifi/Network.h | 0 .../common-hal/wifi/Radio.c | 0 .../common-hal/wifi/Radio.h | 0 .../common-hal/wifi/ScannedNetworks.c | 0 .../common-hal/wifi/ScannedNetworks.h | 0 .../common-hal/wifi/__init__.c | 0 .../common-hal/wifi/__init__.h | 0 ports/espressif/esp-idf | 1 + .../esp-idf-config/partitions-16MB.csv | 0 .../esp-idf-config/partitions-4MB.csv | 0 .../esp-idf-config/partitions-8MB.csv | 0 .../esp-idf-config/sdkconfig-16MB.defaults | 0 .../esp-idf-config/sdkconfig-4MB.defaults | 0 .../esp-idf-config/sdkconfig-8MB.defaults | 0 .../esp-idf-config/sdkconfig-debug.defaults | 0 .../esp-idf-config/sdkconfig-opt.defaults | 0 .../esp-idf-config/sdkconfig.defaults | 0 .../esp32s2_peripherals_config.h | 0 ports/{esp32s2 => espressif}/esp_error.c | 0 ports/{esp32s2 => espressif}/fatfs_port.c | 0 ports/{esp32s2 => espressif}/modules/module.h | 0 ports/{esp32s2 => espressif}/modules/none.c | 0 ports/{esp32s2 => espressif}/modules/wroom.c | 0 ports/{esp32s2 => espressif}/modules/wrover.c | 0 ports/{esp32s2 => espressif}/mpconfigport.h | 17 +- ports/{esp32s2 => espressif}/mpconfigport.mk | 40 +- ports/{esp32s2 => espressif}/mphalport.c | 0 ports/{esp32s2 => espressif}/mphalport.h | 0 .../{esp32s2 => espressif}/peripherals/pcnt.c | 0 .../{esp32s2 => espressif}/peripherals/pcnt.h | 0 .../{esp32s2 => espressif}/peripherals/pins.c | 0 .../{esp32s2 => espressif}/peripherals/pins.h | 0 .../{esp32s2 => espressif}/peripherals/rmt.c | 0 .../{esp32s2 => espressif}/peripherals/rmt.h | 0 .../peripherals/timer.c | 0 .../peripherals/timer.h | 0 .../peripherals/touch.c | 0 .../peripherals/touch.h | 0 ports/{esp32s2 => espressif}/qstrdefsport.h | 0 .../supervisor/esp_port.h | 0 .../supervisor/internal_flash.c | 0 .../supervisor/internal_flash.h | 0 .../supervisor/internal_flash_root_pointers.h | 0 .../{esp32s2 => espressif}/supervisor/port.c | 5 +- ports/{esp32s2 => espressif}/supervisor/usb.c | 8 +- .../tools/build_memory_info.py | 0 .../tools/decode_backtrace.py | 0 ports/litex/boards/fomu/pins.c | 6 +- ports/mimxrt10xx/Makefile | 4 +- .../mimxrt10xx/boards/feather_m7_1011/pins.c | 6 +- .../boards/feather_mimxrt1011/pins.c | 6 +- .../boards/feather_mimxrt1062/pins.c | 6 +- ports/mimxrt10xx/boards/imxrt1010_evk/pins.c | 8 +- ports/mimxrt10xx/boards/imxrt1020_evk/pins.c | 7 +- ports/mimxrt10xx/boards/imxrt1060_evk/pins.c | 7 +- ports/mimxrt10xx/boards/metro_m7_1011/pins.c | 6 +- ports/mimxrt10xx/boards/teensy40/pins.c | 33 +- ports/mimxrt10xx/boards/teensy41/pins.c | 39 +- ports/mimxrt10xx/common-hal/busio/OneWire.h | 33 - .../common-hal/displayio/ParallelBus.c | 67 -- .../common-hal/displayio/ParallelBus.h | 36 - ports/mimxrt10xx/common-hal/pulseio/PulseIn.c | 246 ------ ports/mimxrt10xx/common-hal/pulseio/PulseIn.h | 55 -- .../mimxrt10xx/common-hal/pulseio/PulseOut.c | 210 ----- .../mimxrt10xx/common-hal/pulseio/PulseOut.h | 45 - .../mimxrt10xx/common-hal/pulseio/__init__.c | 1 - ports/mimxrt10xx/common-hal/pwmio/PWMOut.c | 85 +- ports/mimxrt10xx/linking/common.ld | 1 - ports/mimxrt10xx/mpconfigport.mk | 4 +- ports/mimxrt10xx/supervisor/port.c | 27 +- ports/nrf/Makefile | 16 +- ports/nrf/boards/ADM_B_NRF52840_1/pins.c | 2 + ports/nrf/boards/TG-Watch/pins.c | 2 + .../adafruit_led_glasses_nrf52840/board.c | 38 + .../mpconfigboard.h | 30 + .../mpconfigboard.mk | 10 + .../adafruit_led_glasses_nrf52840/pins.c | 26 + ports/nrf/boards/aramcon2_badge/pins.c | 2 + ports/nrf/boards/aramcon_badge_2019/pins.c | 2 + ports/nrf/boards/arduino_nano_33_ble/pins.c | 2 + ports/nrf/boards/bastble/pins.c | 2 + .../bless_dev_board_multi_sensor/pins.c | 2 + ports/nrf/boards/bluemicro840/board.c | 38 + ports/nrf/boards/bluemicro840/mpconfigboard.h | 46 + .../nrf/boards/bluemicro840/mpconfigboard.mk | 8 + ports/nrf/boards/bluemicro840/pins.c | 78 ++ .../circuitplayground_bluefruit/board.c | 26 +- .../mpconfigboard.h | 3 + .../boards/circuitplayground_bluefruit/pins.c | 2 + .../nrf/boards/clue_nrf52840_express/board.c | 1 - ports/nrf/boards/clue_nrf52840_express/pins.c | 3 + ports/nrf/boards/common.template.ld | 22 +- .../electronut_labs_blip/mpconfigboard.mk | 1 - ports/nrf/boards/electronut_labs_blip/pins.c | 3 + ports/nrf/boards/electronut_labs_papyr/pins.c | 3 + .../nrf/boards/feather_bluefruit_sense/pins.c | 3 + .../boards/feather_nrf52840_express/pins.c | 3 + ports/nrf/boards/hiibot_bluefi/board.c | 1 - ports/nrf/boards/hiibot_bluefi/pins.c | 3 + ports/nrf/boards/ikigaisense_vita/pins.c | 3 + .../boards/itsybitsy_nrf52840_express/pins.c | 3 + .../nrf/boards/makerdiary_m60_keyboard/pins.c | 2 + .../makerdiary_nrf52840_m2_devkit/board.c | 1 - .../makerdiary_nrf52840_m2_devkit/pins.c | 2 + .../nrf/boards/makerdiary_nrf52840_mdk/pins.c | 2 + .../makerdiary_nrf52840_mdk_usb_dongle/pins.c | 2 + .../nrf/boards/metro_nrf52840_express/pins.c | 5 +- ports/nrf/boards/microbit_v2/pins.c | 2 + ports/nrf/boards/nice_nano/pins.c | 2 + ports/nrf/boards/ohs2020_badge/board.c | 1 - ports/nrf/boards/ohs2020_badge/pins.c | 2 + .../nrf/boards/particle_argon/mpconfigboard.h | 8 +- ports/nrf/boards/particle_argon/pins.c | 5 + .../nrf/boards/particle_boron/mpconfigboard.h | 8 +- ports/nrf/boards/particle_boron/pins.c | 5 + ports/nrf/boards/particle_xenon/pins.c | 5 + ports/nrf/boards/pca10056/examples/buttons.py | 26 - ports/nrf/boards/pca10056/pins.c | 2 + ports/nrf/boards/pca10059/pins.c | 2 + ports/nrf/boards/pca10100/mpconfigboard.h | 5 + ports/nrf/boards/pca10100/mpconfigboard.mk | 4 + ports/nrf/boards/pca10100/pins.c | 2 + ports/nrf/boards/pitaya_go/pins.c | 2 + .../raytac_mdbt50q-db-40/mpconfigboard.h | 1 + ports/nrf/boards/raytac_mdbt50q-db-40/pins.c | 3 + ports/nrf/boards/raytac_mdbt50q-rx/board.c | 38 + .../boards/raytac_mdbt50q-rx/mpconfigboard.h | 31 + .../boards/raytac_mdbt50q-rx/mpconfigboard.mk | 8 + ports/nrf/boards/raytac_mdbt50q-rx/pins.c | 13 + ports/nrf/boards/simmel/mpconfigboard.h | 2 + ports/nrf/boards/simmel/mpconfigboard.mk | 2 + ports/nrf/boards/simmel/pins.c | 2 + .../sparkfun_nrf52840_micromod/README.md | 62 +- .../mpconfigboard.h | 5 +- .../mpconfigboard.mk | 2 +- .../boards/sparkfun_nrf52840_micromod/pins.c | 293 +++++-- .../nrf/boards/sparkfun_nrf52840_mini/pins.c | 2 + ports/nrf/boards/teknikio_bluebird/pins.c | 2 + .../tinkeringtech_scoutmakes_azul/pins.c | 3 + ports/nrf/boards/warmbit_bluepixel/board.c | 38 + .../boards/warmbit_bluepixel/mpconfigboard.h | 20 + .../boards/warmbit_bluepixel/mpconfigboard.mk | 8 + ports/nrf/boards/warmbit_bluepixel/pins.c | 38 + ports/nrf/common-hal/_bleio/Adapter.c | 17 +- ports/nrf/common-hal/alarm/__init__.c | 57 +- ports/nrf/common-hal/alarm/pin/PinAlarm.c | 11 +- ports/nrf/common-hal/alarm/time/TimeAlarm.c | 4 - ports/nrf/common-hal/audiobusio/I2SOut.c | 8 +- ports/nrf/common-hal/audiobusio/PDMIn.c | 6 +- ports/nrf/common-hal/busio/SPI.c | 14 +- ports/nrf/common-hal/countio/Counter.c | 10 +- .../common-hal/microcontroller/Processor.c | 10 + .../ParallelBus.c | 26 +- .../ParallelBus.h | 8 +- ports/nrf/common-hal/pulseio/PulseIn.c | 10 +- ports/nrf/common-hal/pulseio/PulseOut.c | 22 +- ports/nrf/common-hal/pulseio/PulseOut.h | 2 +- ports/nrf/common-hal/pwmio/PWMOut.c | 16 +- ports/nrf/common-hal/pwmio/PWMOut.h | 3 +- .../common-hal/rotaryio/IncrementalEncoder.c | 11 +- ports/nrf/common-hal/watchdog/WatchDogTimer.c | 7 +- ports/nrf/fatfs_port.c | 8 + ports/nrf/supervisor/port.c | 28 +- ports/raspberrypi/Makefile | 4 +- ports/raspberrypi/audio_dma.c | 273 +++--- ports/raspberrypi/audio_dma.h | 15 +- .../bindings/rp2pio/StateMachine.c | 25 +- .../bindings/rp2pio/StateMachine.h | 3 +- .../pico-sdk-configboard.h | 4 + .../boards/adafruit_feather_rp2040/pins.c | 6 +- .../pico-sdk-configboard.h | 4 + .../boards/adafruit_itsybitsy_rp2040/pins.c | 6 +- .../boards/adafruit_macropad_rp2040/board.c | 3 +- .../pico-sdk-configboard.h | 4 + .../boards/adafruit_macropad_rp2040/pins.c | 8 +- .../pico-sdk-configboard.h | 4 + .../boards/adafruit_qt2040_trinkey/pins.c | 6 +- .../pico-sdk-configboard.h | 4 + .../boards/adafruit_qtpy_rp2040/pins.c | 6 +- .../mpconfigboard.mk | 2 +- .../pico-sdk-configboard.h | 1 + .../boards/arduino_nano_rp2040_connect/pins.c | 6 +- .../boards/challenger_rp2040_wifi/board.c | 40 + .../challenger_rp2040_wifi/mpconfigboard.h | 10 + .../challenger_rp2040_wifi/mpconfigboard.mk | 11 + .../pico-sdk-configboard.h | 1 + .../boards/challenger_rp2040_wifi/pins.c | 73 ++ .../pico-sdk-configboard.h | 1 + .../boards/cytron_maker_pi_rp2040/pins.c | 6 +- .../jpconstantineau_encoderpad_rp2040/board.c | 45 + .../mpconfigboard.h | 11 + .../mpconfigboard.mk | 9 + .../pico-sdk-configboard.h | 4 + .../jpconstantineau_encoderpad_rp2040/pins.c | 39 + .../boards/jpconstantineau_pykey60/board.c | 45 + .../jpconstantineau_pykey60/mpconfigboard.h | 2 + .../jpconstantineau_pykey60/mpconfigboard.mk | 11 + .../pico-sdk-configboard.h | 1 + .../boards/jpconstantineau_pykey60/pins.c | 49 ++ .../boards/pimoroni_interstate75/board.c | 40 + .../pimoroni_interstate75/mpconfigboard.h | 10 + .../pimoroni_interstate75/mpconfigboard.mk | 11 + .../pico-sdk-configboard.h | 1 + .../boards/pimoroni_interstate75/pins.c | 54 ++ .../pimoroni_keybow2040/mpconfigboard.h | 31 - .../pico-sdk-configboard.h | 1 + .../boards/pimoroni_keybow2040/pins.c | 6 +- .../pimoroni_pga2040/pico-sdk-configboard.h | 1 + .../boards/pimoroni_pga2040/pins.c | 6 +- .../pimoroni_picolipo_16mb/mpconfigboard.h | 5 - .../pico-sdk-configboard.h | 1 + .../boards/pimoroni_picolipo_16mb/pins.c | 6 +- .../pimoroni_picolipo_4mb/mpconfigboard.h | 5 - .../pico-sdk-configboard.h | 1 + .../boards/pimoroni_picolipo_4mb/pins.c | 6 +- .../pimoroni_picosystem/mpconfigboard.h | 35 - .../pico-sdk-configboard.h | 1 + .../boards/pimoroni_picosystem/pins.c | 6 +- .../boards/pimoroni_plasma2040/board.c | 40 + .../pimoroni_plasma2040/mpconfigboard.h | 10 + .../pimoroni_plasma2040/mpconfigboard.mk | 11 + .../pico-sdk-configboard.h | 1 + .../boards/pimoroni_plasma2040/pins.c | 43 + .../boards/pimoroni_tiny2040/mpconfigboard.h | 18 - .../pimoroni_tiny2040/pico-sdk-configboard.h | 1 + .../boards/pimoroni_tiny2040/pins.c | 10 +- .../raspberry_pi_pico/pico-sdk-configboard.h | 1 + .../boards/raspberry_pi_pico/pins.c | 6 +- .../sparkfun_micromod_rp2040/mpconfigboard.h | 11 +- .../sparkfun_micromod_rp2040/mpconfigboard.mk | 4 +- .../pico-sdk-configboard.h | 1 + .../boards/sparkfun_micromod_rp2040/pins.c | 293 +++++-- .../pico-sdk-configboard.h | 1 + .../boards/sparkfun_pro_micro_rp2040/pins.c | 6 +- .../pico-sdk-configboard.h | 1 + .../boards/sparkfun_thing_plus_rp2040/pins.c | 6 +- .../common-hal/audiobusio/I2SOut.c | 19 +- .../raspberrypi/common-hal/audiobusio/PDMIn.c | 3 +- .../common-hal/audiopwmio/PWMAudioOut.c | 114 ++- ports/raspberrypi/common-hal/busio/I2C.c | 7 +- .../raspberrypi/common-hal/countio/Counter.c | 11 +- .../raspberrypi/common-hal/countio/Counter.h | 2 + .../imagecapture/ParallelImageCapture.c | 4 +- .../common-hal/microcontroller/Processor.c | 36 +- .../common-hal/neopixel_write/__init__.c | 3 +- .../ParallelBus.c | 30 +- .../ParallelBus.h | 8 +- .../raspberrypi/common-hal/pulseio/PulseIn.c | 3 +- .../raspberrypi/common-hal/pulseio/PulseOut.c | 55 +- .../raspberrypi/common-hal/pulseio/PulseOut.h | 3 +- ports/raspberrypi/common-hal/pwmio/PWMOut.c | 13 + .../common-hal/rotaryio/IncrementalEncoder.c | 5 +- .../common-hal/rp2pio/StateMachine.c | 34 +- .../common-hal/rp2pio/StateMachine.h | 12 +- .../sdk_config/pico/config_autogen.h | 2 + ports/raspberrypi/supervisor/port.c | 15 +- ports/raspberrypi/supervisor/usb.c | 6 + ports/stm/boards/STM32F411_nofs.ld | 26 + .../stm/boards/espruino_pico/mpconfigboard.h | 2 + .../stm/boards/espruino_pico/mpconfigboard.mk | 1 + ports/stm/boards/espruino_pico/pins.c | 2 + ports/stm/boards/espruino_wifi/pins.c | 2 + .../boards/feather_stm32f405_express/pins.c | 6 +- ports/stm/boards/meowbit_v121/board.c | 5 +- .../stm/boards/meowbit_v121/mpconfigboard.mk | 4 + ports/stm/boards/meowbit_v121/pins.c | 2 + ports/stm/boards/nucleo_f746zg/pins.c | 2 + ports/stm/boards/nucleo_f767zi/pins.c | 2 + ports/stm/boards/nucleo_h743zi_2/pins.c | 2 + ports/stm/boards/openmv_h7/pins.c | 2 + ports/stm/boards/pyb_nano_v2/mpconfigboard.h | 2 + ports/stm/boards/pyb_nano_v2/mpconfigboard.mk | 1 + ports/stm/boards/pyb_nano_v2/pins.c | 2 + ports/stm/boards/pyboard_v11/pins.c | 2 + .../sparkfun_stm32f405_micromod/board.c | 18 +- .../mpconfigboard.h | 65 ++ .../mpconfigboard.mk | 19 + .../boards/sparkfun_stm32f405_micromod/pins.c | 226 +++++ .../stm32f411ce_blackpill/mpconfigboard.mk | 2 +- ports/stm/boards/stm32f411ce_blackpill/pins.c | 2 + .../mpconfigboard.h | 2 + .../mpconfigboard.mk | 10 +- .../stm32f411ce_blackpill_with_flash/pins.c | 2 + .../stm32f411ve_discovery/mpconfigboard.h | 2 + .../stm32f411ve_discovery/mpconfigboard.mk | 2 + ports/stm/boards/stm32f411ve_discovery/pins.c | 2 + ports/stm/boards/stm32f412zg_discovery/pins.c | 2 + ports/stm/boards/stm32f4_discovery/pins.c | 2 + ports/stm/boards/stm32f746g_discovery/pins.c | 2 + .../boards/thunderpack_v11/mpconfigboard.h | 2 + .../boards/thunderpack_v11/mpconfigboard.mk | 3 + ports/stm/boards/thunderpack_v11/pins.c | 2 + ports/stm/boards/thunderpack_v12/pins.c | 2 + ports/stm/common-hal/alarm/SleepMemory.c | 34 +- ports/stm/common-hal/busio/OneWire.h | 33 - ports/stm/common-hal/canio/Listener.c | 7 + ports/stm/common-hal/displayio/ParallelBus.c | 67 -- ports/stm/common-hal/displayio/ParallelBus.h | 36 - ports/stm/common-hal/pulseio/PulseOut.c | 30 +- ports/stm/common-hal/pulseio/PulseOut.h | 2 +- ports/stm/common-hal/pwmio/PWMOut.c | 49 +- ports/stm/common-hal/pwmio/PWMOut.h | 1 + ports/stm/mpconfigport.mk | 2 + ports/stm/peripherals/periph.h | 4 +- .../peripherals/stm32f4/stm32f405xx/periph.c | 4 +- ports/stm/peripherals/timers.c | 93 +- ports/stm/supervisor/port.c | 10 +- ports/stm/tools/parse_pins_csv.py | 1 + ports/unix/Makefile | 2 +- ports/unix/mpconfigport.h | 2 +- .../unix/variants/coverage/mpconfigvariant.mk | 6 + py/argcheck.c | 8 +- py/builtinhelp.c | 25 +- py/circuitpy_defns.mk | 54 +- py/circuitpy_mpconfig.h | 641 +++----------- py/circuitpy_mpconfig.mk | 41 +- py/gc.c | 19 +- py/makeqstrdata.py | 44 +- py/mkrules.mk | 2 +- py/modmicropython.c | 28 +- py/modsys.c | 19 - py/mpconfig.h | 5 + py/mpprint.c | 49 +- py/mpprint.h | 6 + py/mpstate.h | 7 + py/obj.c | 50 +- py/obj.h | 3 + py/objexcept.c | 74 +- py/objexcept.h | 5 +- py/objfun.c | 2 +- py/objgenerator.c | 10 +- py/objmodule.c | 3 - py/objstrunicode.c | 18 +- py/objtraceback.c | 42 + py/objtraceback.h | 39 + py/profile.c | 6 +- py/py.cmake | 1 + py/py.mk | 1 + py/qstr.c | 20 +- py/runtime.c | 10 +- py/runtime.h | 2 +- py/scheduler.c | 2 +- requirements-dev.txt | 1 + shared-bindings/_bleio/Adapter.c | 4 +- shared-bindings/_bleio/__init__.c | 2 + shared-bindings/_eve/__init__.c | 2 + shared-bindings/_pew/__init__.c | 2 + shared-bindings/_stage/__init__.c | 2 + .../adafruit_bus_device/__init__.c | 2 + shared-bindings/adafruit_pixelbuf/__init__.c | 2 + shared-bindings/aesio/__init__.c | 2 + shared-bindings/alarm/__init__.c | 2 + shared-bindings/analogio/__init__.c | 2 + shared-bindings/atexit/__init__.c | 95 ++ shared-bindings/audiobusio/__init__.c | 2 + shared-bindings/audiocore/WaveFile.c | 9 +- shared-bindings/audiocore/__init__.c | 2 + shared-bindings/audioio/__init__.c | 2 + shared-bindings/audiomixer/__init__.c | 2 + shared-bindings/audiomp3/__init__.c | 2 + shared-bindings/audiopwmio/__init__.c | 2 + shared-bindings/bitbangio/I2C.c | 2 +- shared-bindings/bitbangio/OneWire.c | 172 ---- shared-bindings/bitbangio/__init__.c | 8 +- shared-bindings/bitmaptools/__init__.c | 68 +- shared-bindings/bitmaptools/__init__.h | 4 + shared-bindings/bitops/__init__.c | 2 + shared-bindings/board/__init__.c | 2 + shared-bindings/board/__init__.h | 6 + shared-bindings/busio/I2C.c | 2 +- shared-bindings/busio/OneWire.h | 43 - shared-bindings/busio/SPI.c | 2 +- shared-bindings/busio/SPI.h | 2 +- shared-bindings/busio/UART.c | 19 + shared-bindings/busio/__init__.c | 8 +- shared-bindings/camera/__init__.c | 2 + shared-bindings/canio/__init__.c | 5 +- shared-bindings/countio/__init__.c | 2 + shared-bindings/digitalio/__init__.c | 2 + shared-bindings/displayio/ColorConverter.c | 15 +- shared-bindings/displayio/Display.c | 30 +- shared-bindings/displayio/Display.h | 2 +- shared-bindings/displayio/EPaperDisplay.c | 34 +- shared-bindings/displayio/FourWire.c | 2 +- shared-bindings/displayio/Group.c | 16 +- shared-bindings/displayio/TileGrid.c | 4 +- shared-bindings/displayio/__init__.c | 12 +- shared-bindings/dualbank/__init__.c | 2 + shared-bindings/fontio/__init__.c | 2 + shared-bindings/framebufferio/__init__.c | 4 + shared-bindings/frequencyio/__init__.c | 2 + shared-bindings/gamepad/GamePad.c | 166 ---- shared-bindings/gamepad/GamePad.h | 38 - shared-bindings/gamepad/__init__.h | 31 - shared-bindings/gamepadshift/GamePadShift.c | 3 +- shared-bindings/gamepadshift/__init__.c | 9 +- shared-bindings/getpass/__init__.c | 88 ++ shared-bindings/gnss/__init__.c | 2 + shared-bindings/i2cperipheral/__init__.c | 2 + shared-bindings/imagecapture/__init__.c | 2 + shared-bindings/ipaddress/__init__.c | 2 + shared-bindings/keypad/EventQueue.c | 2 +- shared-bindings/keypad/KeyMatrix.c | 2 + shared-bindings/keypad/Keys.c | 1 + shared-bindings/keypad/__init__.c | 2 + shared-bindings/math/__init__.c | 4 +- shared-bindings/memorymonitor/__init__.c | 2 + shared-bindings/microcontroller/Pin.c | 39 + shared-bindings/microcontroller/Pin.h | 2 + shared-bindings/microcontroller/ResetReason.c | 5 + shared-bindings/microcontroller/ResetReason.h | 1 + shared-bindings/microcontroller/__init__.c | 2 + shared-bindings/msgpack/__init__.c | 2 + shared-bindings/neopixel_write/__init__.c | 2 + .../{busio => onewireio}/OneWire.c | 90 +- .../{bitbangio => onewireio}/OneWire.h | 22 +- shared-bindings/onewireio/__init__.c | 55 ++ .../onewireio/__init__.h | 11 +- .../ParallelBus.c | 49 +- .../ParallelBus.h | 23 +- .../{gamepad => paralleldisplay}/__init__.c | 33 +- shared-bindings/paralleldisplay/__init__.h | 27 + shared-bindings/ps2io/__init__.c | 2 + shared-bindings/pulseio/PulseOut.c | 55 +- shared-bindings/pulseio/PulseOut.h | 1 - shared-bindings/pulseio/__init__.c | 2 + shared-bindings/pwmio/PWMOut.c | 63 +- shared-bindings/pwmio/PWMOut.h | 5 + shared-bindings/pwmio/__init__.c | 2 + shared-bindings/qrio/PixelPolicy.c | 56 ++ shared-bindings/qrio/PixelPolicy.h | 39 + shared-bindings/qrio/QRDecoder.c | 155 ++++ shared-bindings/qrio/QRDecoder.h | 37 + shared-bindings/qrio/QRInfo.c | 64 ++ shared-bindings/qrio/QRInfo.h | 31 + shared-bindings/qrio/__init__.c | 53 ++ shared-bindings/qrio/__init__.h | 27 + shared-bindings/rainbowio/__init__.c | 2 + shared-bindings/random/__init__.c | 2 + shared-bindings/rgbmatrix/__init__.c | 2 + shared-bindings/rotaryio/__init__.c | 2 + shared-bindings/rtc/__init__.c | 2 + shared-bindings/sdcardio/__init__.c | 2 + shared-bindings/sdioio/__init__.c | 2 + shared-bindings/sharpdisplay/__init__.c | 2 + shared-bindings/socketpool/__init__.c | 2 + shared-bindings/ssl/__init__.c | 2 + shared-bindings/storage/__init__.c | 10 + shared-bindings/struct/__init__.c | 2 + shared-bindings/supervisor/__init__.c | 19 + shared-bindings/synthio/__init__.c | 2 + shared-bindings/terminalio/__init__.c | 2 + shared-bindings/touchio/__init__.c | 2 + shared-bindings/traceback/__init__.c | 174 ++++ shared-bindings/uheap/__init__.c | 2 + shared-bindings/usb_cdc/__init__.c | 2 + shared-bindings/usb_hid/Device.c | 200 +++-- shared-bindings/usb_hid/Device.h | 6 +- shared-bindings/usb_hid/__init__.c | 4 +- shared-bindings/usb_midi/__init__.c | 2 + shared-bindings/ustack/__init__.c | 2 + shared-bindings/vectorio/Circle.c | 52 +- shared-bindings/vectorio/Circle.h | 2 + shared-bindings/vectorio/Polygon.c | 59 +- shared-bindings/vectorio/Polygon.h | 2 + shared-bindings/vectorio/Rectangle.c | 55 +- shared-bindings/vectorio/Rectangle.h | 2 + shared-bindings/vectorio/VectorShape.c | 133 +-- shared-bindings/vectorio/VectorShape.h | 21 +- shared-bindings/vectorio/__init__.c | 28 +- shared-bindings/vectorio/__init__.h | 41 + shared-bindings/watchdog/__init__.c | 6 +- shared-bindings/wifi/__init__.c | 2 + shared-module/atexit/__init__.c | 92 ++ shared-module/atexit/__init__.h | 46 + shared-module/audiocore/WaveFile.c | 2 +- shared-module/audiomp3/MP3Decoder.c | 11 +- shared-module/bitmaptools/__init__.c | 142 ++- shared-module/busio/OneWire.c | 59 -- shared-module/busio/OneWire.h | 39 - shared-module/displayio/ColorConverter.c | 4 +- shared-module/displayio/ColorConverter.h | 2 +- shared-module/displayio/Display.c | 6 +- shared-module/displayio/EPaperDisplay.c | 11 +- shared-module/displayio/EPaperDisplay.h | 2 + shared-module/displayio/Group.c | 51 +- shared-module/displayio/Palette.c | 2 +- shared-module/displayio/__init__.c | 17 +- shared-module/displayio/__init__.h | 8 +- shared-module/displayio/display_core.c | 21 +- shared-module/gamepad/GamePad.c | 59 -- shared-module/gamepad/GamePad.h | 42 - shared-module/gamepad/__init__.c | 67 -- shared-module/getpass/__init__.c | 61 ++ shared-module/getpass/__init__.h | 34 + shared-module/keypad/KeyMatrix.c | 2 - shared-module/keypad/Keys.c | 2 - shared-module/keypad/ShiftRegisterKeys.c | 2 - shared-module/keypad/__init__.c | 13 +- .../{bitbangio => onewireio}/OneWire.c | 16 +- .../{bitbangio => onewireio}/OneWire.h | 8 +- shared-module/onewireio/__init__.c | 27 + shared-module/qrio/QRDecoder.c | 137 +++ shared-module/qrio/QRDecoder.h | 45 + shared-module/qrio/__init__.c | 0 shared-module/qrio/quirc_alloc.h | 14 + shared-module/terminalio/Terminal.c | 6 +- shared-module/traceback/__init__.c | 31 + shared-module/traceback/__init__.h | 36 + shared-module/usb_hid/Device.c | 215 +++-- shared-module/usb_hid/Device.h | 12 +- shared-module/usb_hid/__init__.c | 52 +- shared-module/usb_hid/__init__.h | 2 +- shared-module/vectorio/Circle.c | 5 + shared-module/vectorio/Circle.h | 1 + shared-module/vectorio/Polygon.c | 85 +- shared-module/vectorio/Polygon.h | 5 +- shared-module/vectorio/Rectangle.c | 11 +- shared-module/vectorio/Rectangle.h | 1 + shared-module/vectorio/VectorShape.c | 370 ++++++-- shared-module/vectorio/VectorShape.h | 3 +- supervisor/background_callback.h | 6 + .../OneWire.h => supervisor/fatfs_port.h | 11 +- supervisor/shared/autoreload.c | 12 +- supervisor/shared/autoreload.h | 9 +- supervisor/shared/background_callback.c | 6 +- supervisor/shared/bluetooth/bluetooth.c | 81 +- supervisor/shared/bluetooth/bluetooth.h | 4 + supervisor/shared/bluetooth/file_transfer.c | 265 +++++- .../shared/bluetooth/file_transfer_protocol.h | 55 +- supervisor/shared/bluetooth/serial.c | 81 +- supervisor/shared/display.c | 1 + supervisor/shared/memory.c | 11 +- supervisor/shared/safe_mode.c | 3 + supervisor/shared/status_leds.c | 53 +- supervisor/shared/tick.c | 15 +- supervisor/shared/translate.c | 29 +- supervisor/shared/translate.h | 11 +- supervisor/shared/usb/usb.c | 2 +- tests/circuitpython/atexit_test.py | 22 + tests/circuitpython/traceback_test.py | 25 + tests/extmod/data/qr.pgm | 5 + tests/extmod/qrio.py | 13 + tests/extmod/qrio.py.exp | 1 + tests/extmod/uctypes_print.py.exp | 8 +- tests/micropython/meminfo.py.exp | 2 +- tests/misc/sys_atexit.py | 21 - tests/misc/sys_atexit.py.exp | 2 - tests/unicode/unicode.py | 3 +- tests/unicode/unicode_repr.py | 8 + tests/unix/extra_coverage.py.exp | 22 +- tools/adabot | 2 +- tools/build_board_info.py | 12 +- tools/ci.sh | 584 ------------- tools/ci_changed_board_list.py | 94 ++ tools/ci_check_duplicate_usb_vid_pid.py | 8 +- tools/ci_new_boards_check.py | 57 -- tools/codeformat.py | 10 + tools/fonts/ter-u12n.bdf | 3 +- tools/gen_display_resources.py | 6 +- tools/merge_micropython.py | 2 +- tools/safe_mode_finder.py | 181 ++++ 1102 files changed, 16705 insertions(+), 10351 deletions(-) create mode 160000 frozen/Adafruit_CircuitPython_APDS9960 create mode 160000 lib/quirc delete mode 100644 ports/atmel-samd/common-hal/busio/OneWire.h rename ports/atmel-samd/common-hal/{displayio => paralleldisplay}/ParallelBus.c (85%) rename ports/atmel-samd/common-hal/{displayio => paralleldisplay}/ParallelBus.h (85%) create mode 100644 ports/atmel-samd/shared_timers.c rename ports/{cxd56/common-hal/busio/OneWire.h => atmel-samd/shared_timers.h} (74%) create mode 100644 ports/cxd56/tools/requirements.txt delete mode 100644 ports/cxd56/tools/xmodem.py delete mode 100644 ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.mk delete mode 100644 ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk delete mode 100644 ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/pins.c delete mode 100644 ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/pins.c delete mode 100644 ports/esp32s2/common-hal/busio/OneWire.h delete mode 160000 ports/esp32s2/esp-idf rename ports/{esp32s2 => espressif}/.gitignore (100%) rename ports/{esp32s2 => espressif}/CMakeLists.txt (100%) rename ports/{esp32s2 => espressif}/Makefile (100%) rename ports/{esp32s2 => espressif}/README.rst (100%) rename ports/{esp32s2 => espressif}/background.c (100%) rename ports/{esp32s2 => espressif}/background.h (100%) rename ports/{esp32s2 => espressif}/bindings/espidf/__init__.c (90%) rename ports/{esp32s2 => espressif}/bindings/espidf/__init__.h (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_feather_esp32s2_nopsram/board.c (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_feather_esp32s2_nopsram/pins.c (93%) rename ports/{esp32s2 => espressif}/boards/adafruit_feather_esp32s2_nopsram/sdkconfig (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c (98%) rename ports/{esp32s2 => espressif}/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_feather_esp32s2_tftback_nopsram/pins.c (93%) rename ports/{esp32s2 => espressif}/boards/adafruit_feather_esp32s2_tftback_nopsram/sdkconfig (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_funhouse/board.c (98%) rename ports/{esp32s2 => espressif}/boards/adafruit_funhouse/mpconfigboard.h (92%) rename ports/{esp32s2 => espressif}/boards/adafruit_funhouse/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_funhouse/pins.c (92%) rename ports/{esp32s2 => espressif}/boards/adafruit_funhouse/sdkconfig (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_magtag_2.9_grayscale/board.c (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h (97%) rename ports/{esp32s2 => espressif}/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_magtag_2.9_grayscale/pins.c (92%) rename ports/{esp32s2 => espressif}/boards/adafruit_magtag_2.9_grayscale/sdkconfig (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_metro_esp32s2/board.c (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_metro_esp32s2/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_metro_esp32s2/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/adafruit_metro_esp32s2/pins.c (94%) rename ports/{esp32s2 => espressif}/boards/adafruit_metro_esp32s2/sdkconfig (100%) rename ports/{esp32s2/boards/electroniccats_bastwifi => espressif/boards/ai_thinker_esp_12k_nodemcu}/board.c (100%) create mode 100644 ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h create mode 100644 ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk rename ports/{esp32s2/boards/targett_module_clip_wroom => espressif/boards/ai_thinker_esp_12k_nodemcu}/pins.c (93%) create mode 100644 ports/espressif/boards/ai_thinker_esp_12k_nodemcu/sdkconfig rename ports/{esp32s2 => espressif}/boards/artisense_rd00/board.c (100%) rename ports/{esp32s2 => espressif}/boards/artisense_rd00/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/artisense_rd00/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/artisense_rd00/pins.c (93%) rename ports/{esp32s2 => espressif}/boards/artisense_rd00/sdkconfig (100%) rename ports/{esp32s2 => espressif}/boards/atmegazero_esp32s2/board.c (100%) rename ports/{esp32s2 => espressif}/boards/atmegazero_esp32s2/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/atmegazero_esp32s2/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/atmegazero_esp32s2/pins.c (92%) rename ports/{esp32s2 => espressif}/boards/atmegazero_esp32s2/sdkconfig (100%) rename ports/{esp32s2/boards/espressif_kaluga_1.3 => espressif/boards/crumpspace_crumps2}/board.c (100%) create mode 100644 ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h create mode 100644 ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk create mode 100644 ports/espressif/boards/crumpspace_crumps2/pins.c create mode 100644 ports/espressif/boards/crumpspace_crumps2/sdkconfig rename ports/{esp32s2/boards/espressif_kaluga_1 => espressif/boards/electroniccats_bastwifi}/board.c (100%) rename ports/{esp32s2 => espressif}/boards/electroniccats_bastwifi/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/electroniccats_bastwifi/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/electroniccats_bastwifi/pins.c (94%) rename ports/{esp32s2 => espressif}/boards/electroniccats_bastwifi/sdkconfig (100%) create mode 100644 ports/espressif/boards/espressif_hmi_devkit_1/board.c create mode 100644 ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h create mode 100644 ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk create mode 100644 ports/espressif/boards/espressif_hmi_devkit_1/pins.c rename ports/{esp32s2/boards/espressif_kaluga_1.3 => espressif/boards/espressif_hmi_devkit_1}/sdkconfig (100%) rename ports/{esp32s2/boards/espressif_saola_1_wroom => espressif/boards/espressif_kaluga_1.3}/board.c (100%) rename ports/{esp32s2 => espressif}/boards/espressif_kaluga_1.3/mpconfigboard.h (100%) create mode 100644 ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk rename ports/{esp32s2 => espressif}/boards/espressif_kaluga_1.3/pins.c (97%) rename ports/{esp32s2/boards/espressif_kaluga_1 => espressif/boards/espressif_kaluga_1.3}/sdkconfig (100%) rename ports/{esp32s2/boards/espressif_saola_1_wrover => espressif/boards/espressif_kaluga_1}/board.c (100%) rename ports/{esp32s2 => espressif}/boards/espressif_kaluga_1/mpconfigboard.h (100%) create mode 100644 ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk rename ports/{esp32s2 => espressif}/boards/espressif_kaluga_1/pins.c (97%) rename ports/{esp32s2/boards/espressif_saola_1_wrover => espressif/boards/espressif_kaluga_1}/sdkconfig (100%) rename ports/{esp32s2/boards/franzininho_wifi_wroom => espressif/boards/espressif_saola_1_wroom}/board.c (100%) rename ports/{esp32s2 => espressif}/boards/espressif_saola_1_wroom/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/espressif_saola_1_wroom/mpconfigboard.mk (100%) rename ports/{esp32s2/boards/franzininho_wifi_wrover => espressif/boards/espressif_saola_1_wroom}/pins.c (93%) rename ports/{esp32s2 => espressif}/boards/espressif_saola_1_wroom/sdkconfig (100%) rename ports/{esp32s2/boards/franzininho_wifi_wrover => espressif/boards/espressif_saola_1_wrover}/board.c (100%) rename ports/{esp32s2 => espressif}/boards/espressif_saola_1_wrover/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/espressif_saola_1_wrover/mpconfigboard.mk (100%) rename ports/{esp32s2/boards/franzininho_wifi_wroom => espressif/boards/espressif_saola_1_wrover}/pins.c (93%) rename ports/{esp32s2/boards/franzininho_wifi_wrover => espressif/boards/espressif_saola_1_wrover}/sdkconfig (100%) rename ports/{esp32s2/boards/muselab_nanoesp32_s2_wroom => espressif/boards/franzininho_wifi_wroom}/board.c (100%) rename ports/{esp32s2 => espressif}/boards/franzininho_wifi_wroom/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/franzininho_wifi_wroom/mpconfigboard.mk (100%) rename ports/{esp32s2/boards/espressif_saola_1_wroom => espressif/boards/franzininho_wifi_wroom}/pins.c (93%) rename ports/{esp32s2 => espressif}/boards/franzininho_wifi_wroom/sdkconfig (100%) rename ports/{esp32s2/boards/muselab_nanoesp32_s2_wrover => espressif/boards/franzininho_wifi_wrover}/board.c (100%) rename ports/{esp32s2 => espressif}/boards/franzininho_wifi_wrover/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/franzininho_wifi_wrover/mpconfigboard.mk (100%) rename ports/{esp32s2/boards/espressif_saola_1_wrover => espressif/boards/franzininho_wifi_wrover}/pins.c (93%) rename ports/{esp32s2/boards/targett_module_clip_wrover => espressif/boards/franzininho_wifi_wrover}/sdkconfig (100%) create mode 100644 ports/espressif/boards/gravitech_cucumber_m/board.c create mode 100644 ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h create mode 100644 ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk create mode 100644 ports/espressif/boards/gravitech_cucumber_m/pins.c create mode 100644 ports/espressif/boards/gravitech_cucumber_m/sdkconfig create mode 100644 ports/espressif/boards/gravitech_cucumber_ms/board.c create mode 100644 ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h create mode 100644 ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk create mode 100644 ports/espressif/boards/gravitech_cucumber_ms/pins.c create mode 100644 ports/espressif/boards/gravitech_cucumber_ms/sdkconfig create mode 100644 ports/espressif/boards/gravitech_cucumber_r/board.c create mode 100644 ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h create mode 100644 ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk create mode 100644 ports/espressif/boards/gravitech_cucumber_r/pins.c create mode 100644 ports/espressif/boards/gravitech_cucumber_r/sdkconfig create mode 100644 ports/espressif/boards/gravitech_cucumber_rs/board.c create mode 100644 ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h create mode 100644 ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk create mode 100644 ports/espressif/boards/gravitech_cucumber_rs/pins.c create mode 100644 ports/espressif/boards/gravitech_cucumber_rs/sdkconfig rename ports/{esp32s2 => espressif}/boards/lilygo_ttgo_t8_s2_st7789/board.c (98%) rename ports/{esp32s2 => espressif}/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/lilygo_ttgo_t8_s2_st7789/pins.c (89%) rename ports/{esp32s2 => espressif}/boards/lilygo_ttgo_t8_s2_st7789/sdkconfig (100%) rename ports/{esp32s2/boards/microdev_micro_s2 => espressif/boards/lolin_s2_mini}/board.c (100%) create mode 100644 ports/espressif/boards/lolin_s2_mini/mpconfigboard.h create mode 100644 ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk create mode 100644 ports/espressif/boards/lolin_s2_mini/pins.c create mode 100644 ports/espressif/boards/lolin_s2_mini/sdkconfig rename ports/{esp32s2/boards/unexpectedmaker_feathers2 => espressif/boards/microdev_micro_s2}/board.c (100%) rename ports/{esp32s2 => espressif}/boards/microdev_micro_s2/mpconfigboard.h (96%) rename ports/{esp32s2 => espressif}/boards/microdev_micro_s2/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/microdev_micro_s2/pins.c (94%) rename ports/{esp32s2 => espressif}/boards/microdev_micro_s2/sdkconfig (100%) create mode 100644 ports/espressif/boards/morpheans_morphesp-240/board.c create mode 100644 ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h create mode 100644 ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk create mode 100644 ports/espressif/boards/morpheans_morphesp-240/pins.c create mode 100644 ports/espressif/boards/morpheans_morphesp-240/sdkconfig create mode 100644 ports/espressif/boards/muselab_nanoesp32_s2_wroom/board.c rename ports/{esp32s2 => espressif}/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk (100%) create mode 100644 ports/espressif/boards/muselab_nanoesp32_s2_wroom/pins.c rename ports/{esp32s2 => espressif}/boards/muselab_nanoesp32_s2_wroom/sdkconfig (100%) create mode 100644 ports/espressif/boards/muselab_nanoesp32_s2_wrover/board.c rename ports/{esp32s2 => espressif}/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk (100%) create mode 100644 ports/espressif/boards/muselab_nanoesp32_s2_wrover/pins.c rename ports/{esp32s2 => espressif}/boards/muselab_nanoesp32_s2_wrover/sdkconfig (100%) create mode 100644 ports/espressif/boards/odt_pixelwing_esp32_s2/board.c create mode 100644 ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h create mode 100644 ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk create mode 100644 ports/espressif/boards/odt_pixelwing_esp32_s2/pins.c create mode 100644 ports/espressif/boards/odt_pixelwing_esp32_s2/sdkconfig rename ports/{esp32s2 => espressif}/boards/targett_module_clip_wroom/board.c (100%) rename ports/{esp32s2 => espressif}/boards/targett_module_clip_wroom/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/targett_module_clip_wroom/mpconfigboard.mk (100%) rename ports/{esp32s2/boards/targett_module_clip_wrover => espressif/boards/targett_module_clip_wroom}/pins.c (93%) rename ports/{esp32s2 => espressif}/boards/targett_module_clip_wroom/sdkconfig (100%) rename ports/{esp32s2 => espressif}/boards/targett_module_clip_wrover/board.c (100%) rename ports/{esp32s2 => espressif}/boards/targett_module_clip_wrover/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/targett_module_clip_wrover/mpconfigboard.mk (100%) create mode 100644 ports/espressif/boards/targett_module_clip_wrover/pins.c create mode 100644 ports/espressif/boards/targett_module_clip_wrover/sdkconfig rename ports/{esp32s2/boards/unexpectedmaker_feathers2_prerelease => espressif/boards/unexpectedmaker_feathers2}/board.c (100%) rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_feathers2/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_feathers2/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_feathers2/pins.c (96%) rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_feathers2/sdkconfig (100%) rename ports/{esp32s2/boards/unexpectedmaker_tinys2 => espressif/boards/unexpectedmaker_feathers2_neo}/board.c (100%) create mode 100644 ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h create mode 100644 ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk create mode 100644 ports/espressif/boards/unexpectedmaker_feathers2_neo/pins.c create mode 100644 ports/espressif/boards/unexpectedmaker_feathers2_neo/sdkconfig create mode 100644 ports/espressif/boards/unexpectedmaker_feathers2_prerelease/board.c rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk (100%) rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_feathers2_prerelease/pins.c (95%) rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_feathers2_prerelease/sdkconfig (100%) create mode 100644 ports/espressif/boards/unexpectedmaker_tinys2/board.c rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_tinys2/mpconfigboard.h (100%) rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_tinys2/mpconfigboard.mk (95%) rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_tinys2/pins.c (95%) rename ports/{esp32s2 => espressif}/boards/unexpectedmaker_tinys2/sdkconfig (100%) rename ports/{esp32s2 => espressif}/cam.c (100%) rename ports/{esp32s2 => espressif}/cam.h (100%) rename ports/{esp32s2 => espressif}/certificates/README.md (100%) rename ports/{esp32s2 => espressif}/certificates/nina-fw (100%) rename ports/{esp32s2 => espressif}/common-hal/alarm/SleepMemory.c (100%) rename ports/{esp32s2 => espressif}/common-hal/alarm/SleepMemory.h (100%) rename ports/{esp32s2 => espressif}/common-hal/alarm/__init__.c (94%) rename ports/{esp32s2 => espressif}/common-hal/alarm/__init__.h (100%) rename ports/{esp32s2 => espressif}/common-hal/alarm/pin/PinAlarm.c (100%) rename ports/{esp32s2 => espressif}/common-hal/alarm/pin/PinAlarm.h (100%) rename ports/{esp32s2 => espressif}/common-hal/alarm/time/TimeAlarm.c (100%) rename ports/{esp32s2 => espressif}/common-hal/alarm/time/TimeAlarm.h (100%) rename ports/{esp32s2 => espressif}/common-hal/alarm/touch/TouchAlarm.c (100%) rename ports/{esp32s2 => espressif}/common-hal/alarm/touch/TouchAlarm.h (100%) rename ports/{esp32s2 => espressif}/common-hal/analogio/AnalogIn.c (100%) rename ports/{esp32s2 => espressif}/common-hal/analogio/AnalogIn.h (100%) rename ports/{esp32s2 => espressif}/common-hal/analogio/AnalogOut.c (100%) rename ports/{esp32s2 => espressif}/common-hal/analogio/AnalogOut.h (100%) rename ports/{esp32s2 => espressif}/common-hal/analogio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/audiobusio/I2SOut.c (100%) rename ports/{esp32s2 => espressif}/common-hal/audiobusio/I2SOut.h (100%) rename ports/{esp32s2 => espressif}/common-hal/audiobusio/PDMIn.c (100%) rename ports/{esp32s2 => espressif}/common-hal/audiobusio/PDMIn.h (100%) rename ports/{esp32s2 => espressif}/common-hal/audiobusio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/audiobusio/__init__.h (100%) rename ports/{esp32s2 => espressif}/common-hal/board/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/busio/I2C.c (93%) rename ports/{esp32s2 => espressif}/common-hal/busio/I2C.h (97%) rename ports/{esp32s2 => espressif}/common-hal/busio/SPI.c (100%) rename ports/{esp32s2 => espressif}/common-hal/busio/SPI.h (100%) rename ports/{esp32s2 => espressif}/common-hal/busio/UART.c (100%) rename ports/{esp32s2 => espressif}/common-hal/busio/UART.h (100%) rename ports/{esp32s2 => espressif}/common-hal/busio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/canio/CAN.c (100%) rename ports/{esp32s2 => espressif}/common-hal/canio/CAN.h (100%) rename ports/{esp32s2 => espressif}/common-hal/canio/Listener.c (96%) rename ports/{esp32s2 => espressif}/common-hal/canio/Listener.h (100%) rename ports/{esp32s2 => espressif}/common-hal/canio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/canio/__init__.h (100%) rename ports/{esp32s2 => espressif}/common-hal/countio/Counter.c (100%) rename ports/{esp32s2 => espressif}/common-hal/countio/Counter.h (100%) rename ports/{esp32s2 => espressif}/common-hal/countio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/digitalio/DigitalInOut.c (100%) rename ports/{esp32s2 => espressif}/common-hal/digitalio/DigitalInOut.h (100%) rename ports/{esp32s2 => espressif}/common-hal/digitalio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/dualbank/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/dualbank/__init__.h (100%) rename ports/{esp32s2 => espressif}/common-hal/frequencyio/FrequencyIn.c (100%) rename ports/{esp32s2 => espressif}/common-hal/frequencyio/FrequencyIn.h (100%) rename ports/{esp32s2 => espressif}/common-hal/frequencyio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/imagecapture/ParallelImageCapture.c (100%) rename ports/{esp32s2 => espressif}/common-hal/imagecapture/ParallelImageCapture.h (100%) rename ports/{esp32s2 => espressif}/common-hal/imagecapture/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/imagecapture/__init__.h (100%) rename ports/{esp32s2 => espressif}/common-hal/microcontroller/Pin.c (100%) rename ports/{esp32s2 => espressif}/common-hal/microcontroller/Pin.h (100%) rename ports/{esp32s2 => espressif}/common-hal/microcontroller/Processor.c (100%) rename ports/{esp32s2 => espressif}/common-hal/microcontroller/Processor.h (100%) rename ports/{esp32s2 => espressif}/common-hal/microcontroller/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/neopixel_write/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/nvm/ByteArray.c (57%) rename ports/{esp32s2 => espressif}/common-hal/nvm/ByteArray.h (100%) rename ports/{esp32s2 => espressif}/common-hal/nvm/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/os/__init__.c (100%) rename ports/{esp32s2/common-hal/displayio => espressif/common-hal/paralleldisplay}/ParallelBus.c (90%) rename ports/{esp32s2/common-hal/displayio => espressif/common-hal/paralleldisplay}/ParallelBus.h (89%) rename ports/{esp32s2 => espressif}/common-hal/ps2io/Ps2.c (100%) rename ports/{esp32s2 => espressif}/common-hal/ps2io/Ps2.h (100%) rename ports/{esp32s2 => espressif}/common-hal/ps2io/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/pulseio/PulseIn.c (100%) rename ports/{esp32s2 => espressif}/common-hal/pulseio/PulseIn.h (100%) rename ports/{esp32s2 => espressif}/common-hal/pulseio/PulseOut.c (93%) rename ports/{esp32s2 => espressif}/common-hal/pulseio/PulseOut.h (100%) rename ports/{esp32s2 => espressif}/common-hal/pulseio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/pwmio/PWMOut.c (97%) rename ports/{esp32s2 => espressif}/common-hal/pwmio/PWMOut.h (98%) rename ports/{esp32s2 => espressif}/common-hal/pwmio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/rgbmatrix/RGBMatrix.c (100%) rename ports/{esp32s2 => espressif}/common-hal/rgbmatrix/RGBMatrix.h (100%) rename ports/{esp32s2 => espressif}/common-hal/rgbmatrix/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/rgbmatrix/__init__.h (100%) rename ports/{esp32s2 => espressif}/common-hal/rotaryio/IncrementalEncoder.c (100%) rename ports/{esp32s2 => espressif}/common-hal/rotaryio/IncrementalEncoder.h (100%) rename ports/{esp32s2 => espressif}/common-hal/rotaryio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/rtc/RTC.c (100%) rename ports/{esp32s2 => espressif}/common-hal/rtc/RTC.h (100%) rename ports/{esp32s2 => espressif}/common-hal/rtc/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/socketpool/Socket.c (100%) rename ports/{esp32s2 => espressif}/common-hal/socketpool/Socket.h (100%) rename ports/{esp32s2 => espressif}/common-hal/socketpool/SocketPool.c (100%) rename ports/{esp32s2 => espressif}/common-hal/socketpool/SocketPool.h (100%) rename ports/{esp32s2 => espressif}/common-hal/socketpool/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/socketpool/__init__.h (100%) rename ports/{esp32s2 => espressif}/common-hal/ssl/SSLContext.c (100%) rename ports/{esp32s2 => espressif}/common-hal/ssl/SSLContext.h (100%) rename ports/{esp32s2 => espressif}/common-hal/ssl/SSLSocket.c (100%) rename ports/{esp32s2 => espressif}/common-hal/ssl/SSLSocket.h (100%) rename ports/{esp32s2 => espressif}/common-hal/ssl/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/ssl/__init__.h (100%) rename ports/{esp32s2 => espressif}/common-hal/supervisor/Runtime.c (100%) rename ports/{esp32s2 => espressif}/common-hal/supervisor/Runtime.h (100%) rename ports/{esp32s2 => espressif}/common-hal/supervisor/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/time/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/touchio/TouchIn.c (100%) rename ports/{esp32s2 => espressif}/common-hal/touchio/TouchIn.h (100%) rename ports/{esp32s2 => espressif}/common-hal/touchio/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/watchdog/WatchDogMode.c (100%) rename ports/{esp32s2 => espressif}/common-hal/watchdog/WatchDogTimer.c (100%) rename ports/{esp32s2 => espressif}/common-hal/watchdog/WatchDogTimer.h (100%) rename ports/{esp32s2 => espressif}/common-hal/watchdog/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/wifi/Network.c (100%) rename ports/{esp32s2 => espressif}/common-hal/wifi/Network.h (100%) rename ports/{esp32s2 => espressif}/common-hal/wifi/Radio.c (100%) rename ports/{esp32s2 => espressif}/common-hal/wifi/Radio.h (100%) rename ports/{esp32s2 => espressif}/common-hal/wifi/ScannedNetworks.c (100%) rename ports/{esp32s2 => espressif}/common-hal/wifi/ScannedNetworks.h (100%) rename ports/{esp32s2 => espressif}/common-hal/wifi/__init__.c (100%) rename ports/{esp32s2 => espressif}/common-hal/wifi/__init__.h (100%) create mode 160000 ports/espressif/esp-idf rename ports/{esp32s2 => espressif}/esp-idf-config/partitions-16MB.csv (100%) rename ports/{esp32s2 => espressif}/esp-idf-config/partitions-4MB.csv (100%) rename ports/{esp32s2 => espressif}/esp-idf-config/partitions-8MB.csv (100%) rename ports/{esp32s2 => espressif}/esp-idf-config/sdkconfig-16MB.defaults (100%) rename ports/{esp32s2 => espressif}/esp-idf-config/sdkconfig-4MB.defaults (100%) rename ports/{esp32s2 => espressif}/esp-idf-config/sdkconfig-8MB.defaults (100%) rename ports/{esp32s2 => espressif}/esp-idf-config/sdkconfig-debug.defaults (100%) rename ports/{esp32s2 => espressif}/esp-idf-config/sdkconfig-opt.defaults (100%) rename ports/{esp32s2 => espressif}/esp-idf-config/sdkconfig.defaults (100%) rename ports/{esp32s2 => espressif}/esp32s2_peripherals_config.h (100%) rename ports/{esp32s2 => espressif}/esp_error.c (100%) rename ports/{esp32s2 => espressif}/fatfs_port.c (100%) rename ports/{esp32s2 => espressif}/modules/module.h (100%) rename ports/{esp32s2 => espressif}/modules/none.c (100%) rename ports/{esp32s2 => espressif}/modules/wroom.c (100%) rename ports/{esp32s2 => espressif}/modules/wrover.c (100%) rename ports/{esp32s2 => espressif}/mpconfigport.h (65%) rename ports/{esp32s2 => espressif}/mpconfigport.mk (70%) rename ports/{esp32s2 => espressif}/mphalport.c (100%) rename ports/{esp32s2 => espressif}/mphalport.h (100%) rename ports/{esp32s2 => espressif}/peripherals/pcnt.c (100%) rename ports/{esp32s2 => espressif}/peripherals/pcnt.h (100%) rename ports/{esp32s2 => espressif}/peripherals/pins.c (100%) rename ports/{esp32s2 => espressif}/peripherals/pins.h (100%) rename ports/{esp32s2 => espressif}/peripherals/rmt.c (100%) rename ports/{esp32s2 => espressif}/peripherals/rmt.h (100%) rename ports/{esp32s2 => espressif}/peripherals/timer.c (100%) rename ports/{esp32s2 => espressif}/peripherals/timer.h (100%) rename ports/{esp32s2 => espressif}/peripherals/touch.c (100%) rename ports/{esp32s2 => espressif}/peripherals/touch.h (100%) rename ports/{esp32s2 => espressif}/qstrdefsport.h (100%) rename ports/{esp32s2 => espressif}/supervisor/esp_port.h (100%) rename ports/{esp32s2 => espressif}/supervisor/internal_flash.c (100%) rename ports/{esp32s2 => espressif}/supervisor/internal_flash.h (100%) rename ports/{esp32s2 => espressif}/supervisor/internal_flash_root_pointers.h (100%) rename ports/{esp32s2 => espressif}/supervisor/port.c (98%) rename ports/{esp32s2 => espressif}/supervisor/usb.c (95%) rename ports/{esp32s2 => espressif}/tools/build_memory_info.py (100%) rename ports/{esp32s2 => espressif}/tools/decode_backtrace.py (100%) delete mode 100644 ports/mimxrt10xx/common-hal/busio/OneWire.h delete mode 100644 ports/mimxrt10xx/common-hal/displayio/ParallelBus.c delete mode 100644 ports/mimxrt10xx/common-hal/displayio/ParallelBus.h delete mode 100644 ports/mimxrt10xx/common-hal/pulseio/PulseIn.c delete mode 100644 ports/mimxrt10xx/common-hal/pulseio/PulseIn.h delete mode 100644 ports/mimxrt10xx/common-hal/pulseio/PulseOut.c delete mode 100644 ports/mimxrt10xx/common-hal/pulseio/PulseOut.h delete mode 100644 ports/mimxrt10xx/common-hal/pulseio/__init__.c create mode 100644 ports/nrf/boards/adafruit_led_glasses_nrf52840/board.c create mode 100644 ports/nrf/boards/adafruit_led_glasses_nrf52840/mpconfigboard.h create mode 100644 ports/nrf/boards/adafruit_led_glasses_nrf52840/mpconfigboard.mk create mode 100644 ports/nrf/boards/adafruit_led_glasses_nrf52840/pins.c create mode 100644 ports/nrf/boards/bluemicro840/board.c create mode 100644 ports/nrf/boards/bluemicro840/mpconfigboard.h create mode 100644 ports/nrf/boards/bluemicro840/mpconfigboard.mk create mode 100644 ports/nrf/boards/bluemicro840/pins.c delete mode 100644 ports/nrf/boards/pca10056/examples/buttons.py create mode 100644 ports/nrf/boards/raytac_mdbt50q-rx/board.c create mode 100644 ports/nrf/boards/raytac_mdbt50q-rx/mpconfigboard.h create mode 100644 ports/nrf/boards/raytac_mdbt50q-rx/mpconfigboard.mk create mode 100644 ports/nrf/boards/raytac_mdbt50q-rx/pins.c create mode 100644 ports/nrf/boards/warmbit_bluepixel/board.c create mode 100644 ports/nrf/boards/warmbit_bluepixel/mpconfigboard.h create mode 100644 ports/nrf/boards/warmbit_bluepixel/mpconfigboard.mk create mode 100644 ports/nrf/boards/warmbit_bluepixel/pins.c rename ports/nrf/common-hal/{displayio => paralleldisplay}/ParallelBus.c (85%) rename ports/nrf/common-hal/{displayio => paralleldisplay}/ParallelBus.h (86%) create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/adafruit_itsybitsy_rp2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/adafruit_macropad_rp2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/adafruit_qt2040_trinkey/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/adafruit_qtpy_rp2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/arduino_nano_rp2040_connect/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/challenger_rp2040_wifi/board.c create mode 100644 ports/raspberrypi/boards/challenger_rp2040_wifi/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/challenger_rp2040_wifi/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/challenger_rp2040_wifi/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/challenger_rp2040_wifi/pins.c create mode 100644 ports/raspberrypi/boards/cytron_maker_pi_rp2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/board.c create mode 100644 ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/pins.c create mode 100644 ports/raspberrypi/boards/jpconstantineau_pykey60/board.c create mode 100644 ports/raspberrypi/boards/jpconstantineau_pykey60/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/jpconstantineau_pykey60/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/jpconstantineau_pykey60/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/jpconstantineau_pykey60/pins.c create mode 100644 ports/raspberrypi/boards/pimoroni_interstate75/board.c create mode 100644 ports/raspberrypi/boards/pimoroni_interstate75/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_interstate75/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/pimoroni_interstate75/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_interstate75/pins.c create mode 100644 ports/raspberrypi/boards/pimoroni_keybow2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_pga2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_picolipo_16mb/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_picolipo_4mb/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_picosystem/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_plasma2040/board.c create mode 100644 ports/raspberrypi/boards/pimoroni_plasma2040/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_plasma2040/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/pimoroni_plasma2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/pimoroni_plasma2040/pins.c create mode 100644 ports/raspberrypi/boards/pimoroni_tiny2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/raspberry_pi_pico/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/sparkfun_micromod_rp2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pico-sdk-configboard.h rename ports/raspberrypi/common-hal/{displayio => paralleldisplay}/ParallelBus.c (84%) rename ports/raspberrypi/common-hal/{displayio => paralleldisplay}/ParallelBus.h (86%) create mode 100644 ports/stm/boards/STM32F411_nofs.ld rename shared-module/gamepad/__init__.h => ports/stm/boards/sparkfun_stm32f405_micromod/board.c (83%) create mode 100644 ports/stm/boards/sparkfun_stm32f405_micromod/mpconfigboard.h create mode 100644 ports/stm/boards/sparkfun_stm32f405_micromod/mpconfigboard.mk create mode 100644 ports/stm/boards/sparkfun_stm32f405_micromod/pins.c delete mode 100644 ports/stm/common-hal/busio/OneWire.h delete mode 100644 ports/stm/common-hal/displayio/ParallelBus.c delete mode 100644 ports/stm/common-hal/displayio/ParallelBus.h create mode 100644 py/objtraceback.c create mode 100644 py/objtraceback.h create mode 100644 shared-bindings/atexit/__init__.c delete mode 100644 shared-bindings/bitbangio/OneWire.c delete mode 100644 shared-bindings/busio/OneWire.h delete mode 100644 shared-bindings/gamepad/GamePad.c delete mode 100644 shared-bindings/gamepad/GamePad.h delete mode 100644 shared-bindings/gamepad/__init__.h create mode 100644 shared-bindings/getpass/__init__.c rename shared-bindings/{busio => onewireio}/OneWire.c (54%) rename shared-bindings/{bitbangio => onewireio}/OneWire.h (63%) create mode 100644 shared-bindings/onewireio/__init__.c rename ports/nrf/common-hal/busio/OneWire.h => shared-bindings/onewireio/__init__.h (84%) rename shared-bindings/{displayio => paralleldisplay}/ParallelBus.c (71%) rename shared-bindings/{displayio => paralleldisplay}/ParallelBus.h (67%) rename shared-bindings/{gamepad => paralleldisplay}/__init__.c (60%) create mode 100644 shared-bindings/paralleldisplay/__init__.h create mode 100644 shared-bindings/qrio/PixelPolicy.c create mode 100644 shared-bindings/qrio/PixelPolicy.h create mode 100644 shared-bindings/qrio/QRDecoder.c create mode 100644 shared-bindings/qrio/QRDecoder.h create mode 100644 shared-bindings/qrio/QRInfo.c create mode 100644 shared-bindings/qrio/QRInfo.h create mode 100644 shared-bindings/qrio/__init__.c create mode 100644 shared-bindings/qrio/__init__.h create mode 100644 shared-bindings/traceback/__init__.c create mode 100644 shared-bindings/vectorio/__init__.h create mode 100644 shared-module/atexit/__init__.c create mode 100644 shared-module/atexit/__init__.h delete mode 100644 shared-module/busio/OneWire.c delete mode 100644 shared-module/busio/OneWire.h delete mode 100644 shared-module/gamepad/GamePad.c delete mode 100644 shared-module/gamepad/GamePad.h delete mode 100644 shared-module/gamepad/__init__.c create mode 100644 shared-module/getpass/__init__.c create mode 100644 shared-module/getpass/__init__.h rename shared-module/{bitbangio => onewireio}/OneWire.c (85%) rename shared-module/{bitbangio => onewireio}/OneWire.h (86%) create mode 100644 shared-module/onewireio/__init__.c create mode 100644 shared-module/qrio/QRDecoder.c create mode 100644 shared-module/qrio/QRDecoder.h create mode 100644 shared-module/qrio/__init__.c create mode 100644 shared-module/qrio/quirc_alloc.h create mode 100644 shared-module/traceback/__init__.c create mode 100644 shared-module/traceback/__init__.h rename ports/raspberrypi/common-hal/busio/OneWire.h => supervisor/fatfs_port.h (83%) create mode 100644 tests/circuitpython/atexit_test.py create mode 100644 tests/circuitpython/traceback_test.py create mode 100644 tests/extmod/data/qr.pgm create mode 100644 tests/extmod/qrio.py create mode 100644 tests/extmod/qrio.py.exp delete mode 100644 tests/misc/sys_atexit.py delete mode 100644 tests/misc/sys_atexit.py.exp create mode 100644 tests/unicode/unicode_repr.py delete mode 100755 tools/ci.sh create mode 100644 tools/ci_changed_board_list.py delete mode 100644 tools/ci_new_boards_check.py create mode 100644 tools/safe_mode_finder.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 64a5a5bbcd..72a13987ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,10 @@ on: jobs: test: runs-on: ubuntu-20.04 + outputs: + arm-boards: ${{ steps.set-matrix.outputs.arm-boards }} + riscv-boards: ${{ steps.set-matrix.outputs.riscv-boards }} + espressif-boards: ${{ steps.set-matrix.outputs.espressif-boards }} steps: - name: Dump GitHub context env: @@ -43,9 +47,6 @@ jobs: run: | gcc --version python3 --version - - name: New boards check - run: python3 -u ci_new_boards_check.py - working-directory: tools - name: Duplicate USB VID/PID Check run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid - name: Build and Validate Stubs @@ -79,6 +80,10 @@ jobs: - name: Test all run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 working-directory: tests + - name: Print failure info + run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --print-failures + if: failure() + working-directory: tests - name: Native Tests run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --emit native working-directory: tests @@ -135,6 +140,29 @@ jobs: # setup.py sdist was run by 'make stubs' [ -z "$TWINE_USERNAME" ] || echo "Uploading dev release to PyPi" [ -z "$TWINE_USERNAME" ] || twine upload circuitpython-stubs/dist/* + - uses: dorny/paths-filter@v2 + id: filter + with: + # Enable listing of files matching each filter. + # Paths to files will be available in `${FILTER_NAME}_files` output variable. + # Paths will be formatted as JSON array + list-files: json + + # Compare against this branch. (Ignored for PRs.) + base: ${{ github.ref }} + + # In this example all changed files are passed to the following action to do + # some custom processing. + filters: | + changed: + - '**' + - name: "Set boards to build" + id: set-matrix + working-directory: tools + env: + CHANGED_FILES: ${{ steps.filter.outputs.changed_files }} + run: | + python3 -u ci_changed_board_list.py mpy-cross-mac: runs-on: macos-10.15 @@ -199,198 +227,8 @@ jobs: strategy: fail-fast: false matrix: - board: - - "8086_commander" - - "ADM_B_NRF52840_1" - - "TG-Watch" - - "adafruit_feather_rp2040" - - "adafruit_itsybitsy_rp2040" - - "adafruit_macropad_rp2040" - - "adafruit_neokey_trinkey_m0" - - "adafruit_proxlight_trinkey_m0" - - "adafruit_qt2040_trinkey" - - "adafruit_qtpy_rp2040" - - "adafruit_rotary_trinkey_m0" - - "adafruit_slide_trinkey_m0" - - "aloriumtech_evo_m51" - - "aramcon2_badge" - - "aramcon_badge_2019" - - "arduino_mkr1300" - - "arduino_mkrzero" - - "arduino_nano_33_ble" - - "arduino_nano_33_iot" - - "arduino_nano_rp2040_connect" - - "arduino_zero" - - "bast_pro_mini_m0" - - "bastble" - - "bdmicro_vina_d21" - - "bdmicro_vina_d51" - - "bdmicro_vina_d51_pcb7" - - "bless_dev_board_multi_sensor" - - "blm_badge" - - "capablerobot_usbhub" - - "catwan_usbstick" - - "circuitbrains_basic_m0" - - "circuitbrains_deluxe_m4" - - "circuitplayground_bluefruit" - - "circuitplayground_express" - - "circuitplayground_express_crickit" - - "circuitplayground_express_displayio" - - "clue_nrf52840_express" - - "cp32-m4" - - "cp_sapling_m0" - - "cp_sapling_m0_revb" - - "cp_sapling_m0_spiflash" - - "cytron_maker_pi_rp2040" - - "datalore_ip_m4" - - "datum_distance" - - "datum_imu" - - "datum_light" - - "datum_weather" - - "dynalora_usb" - - "dynossat_edu_eps" - - "dynossat_edu_obc" - - "electronut_labs_blip" - - "electronut_labs_papyr" - - "escornabot_makech" - - "espruino_pico" - - "espruino_wifi" - - "feather_bluefruit_sense" - - "feather_m0_adalogger" - - "feather_m0_basic" - - "feather_m0_express" - - "feather_m0_express_crickit" - - "feather_m0_rfm69" - - "feather_m0_rfm9x" - - "feather_m0_supersized" - - "feather_m4_can" - - "feather_m4_express" - - "feather_m7_1011" - - "feather_mimxrt1011" - - "feather_mimxrt1062" - - "feather_nrf52840_express" - - "feather_stm32f405_express" - - "fluff_m0" - - "gemma_m0" - - "grandcentral_m4_express" - - "hallowing_m0_express" - - "hallowing_m4_express" - - "hiibot_bluefi" - - "huntercat_nfc" - - "ikigaisense_vita" - - "imxrt1010_evk" - - "imxrt1020_evk" - - "imxrt1060_evk" - - "itsybitsy_m0_express" - - "itsybitsy_m4_express" - - "itsybitsy_nrf52840_express" - - "kicksat-sprite" - - "loc_ber_m4_base_board" - - "makerdiary_m60_keyboard" - - "makerdiary_nrf52840_m2_devkit" - - "makerdiary_nrf52840_mdk" - - "makerdiary_nrf52840_mdk_usb_dongle" - - "matrixportal_m4" - - "melopero_shake_rp2040" - - "meowbit_v121" - - "meowmeow" - - "metro_m0_express" - - "metro_m4_airlift_lite" - - "metro_m4_express" - - "metro_m7_1011" - - "metro_nrf52840_express" - - "microbit_v2" - - "mini_sam_m4" - - "monster_m4sk" - - "ndgarage_ndbit6" - - "ndgarage_ndbit6_v2" - - "neopixel_trinkey_m0" - - "nfc_copy_cat" - - "nice_nano" - - "nucleo_f746zg" - - "nucleo_f767zi" - - "nucleo_h743zi_2" - - "ohs2020_badge" - - "openbook_m4" - - "openmv_h7" - - "particle_argon" - - "particle_boron" - - "particle_xenon" - - "pca10056" - - "pca10059" - - "pca10100" - - "pewpew10" - - "pewpew_m4" - - "picoplanet" - - "pimoroni_keybow2040" - - "pimoroni_pga2040" - - "pimoroni_picolipo_16mb" - - "pimoroni_picolipo_4mb" - - "pimoroni_picosystem" - - "pimoroni_tiny2040" - - "pitaya_go" - - "pyb_nano_v2" - - "pybadge" - - "pyboard_v11" - - "pycubed" - - "pycubed_mram" - - "pygamer" - - "pyportal" - - "pyportal_titano" - - "pyruler" - - "qtpy_m0" - - "qtpy_m0_haxpress" - - "raspberry_pi_pico" - - "raytac_mdbt50q-db-40" - - "robohatmm1_m4" - - "sam32" - - "same54_xplained" - - "seeeduino_wio_terminal" - - "seeeduino_xiao" - - "sensebox_mcu" - - "serpente" - - "shirtty" - - "silicognition-m4-shim" - - "simmel" - - "snekboard" - - "sparkfun_lumidrive" - - "sparkfun_micromod_rp2040" - - "sparkfun_nrf52840_micromod" - - "sparkfun_nrf52840_mini" - - "sparkfun_pro_micro_rp2040" - - "sparkfun_qwiic_micro_no_flash" - - "sparkfun_qwiic_micro_with_flash" - - "sparkfun_redboard_turbo" - - "sparkfun_samd21_dev" - - "sparkfun_samd21_mini" - - "sparkfun_samd51_micromod" - - "sparkfun_samd51_thing_plus" - - "sparkfun_thing_plus_rp2040" - - "spresense" - - "stackrduino_m0_pro" - - "stm32f411ce_blackpill" - - "stm32f411ce_blackpill_with_flash" - - "stm32f411ve_discovery" - - "stm32f412zg_discovery" - - "stm32f4_discovery" - - "stm32f746g_discovery" - - "stringcar_m0_express" - - "teensy40" - - "teensy41" - - "teknikio_bluebird" - - "thunderpack_v11" - - "thunderpack_v12" - - "tinkeringtech_scoutmakes_azul" - - "trellis_m4_express" - - "trinket_m0" - - "trinket_m0_haxpress" - - "uartlogger2" - - "uchip" - - "ugame10" - - "winterbloom_big_honking_button" - - "winterbloom_sol" - - "xinabox_cc03" - - "xinabox_cs11" + board: ${{ fromJSON(needs.test.outputs.arm-boards) }} + if: ${{ needs.test.outputs.arm-boards != '[]' }} steps: - name: Set up Python 3.8 @@ -440,8 +278,8 @@ jobs: strategy: fail-fast: false matrix: - board: - - "fomu" + board: ${{ fromJSON(needs.test.outputs.riscv-boards) }} + if: ${{ needs.test.outputs.riscv-boards != '[]' }} steps: - name: Set up Python 3.8 @@ -456,7 +294,7 @@ jobs: - name: Install deps run: | sudo apt-get install -y gettext - pip install requests sh click setuptools awscli + pip install -r requirements-dev.txt wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz sudo tar -C /usr --strip-components=1 -xaf riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz - name: Versions @@ -484,36 +322,14 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit') || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) - build-xtensa: + build-espressif: runs-on: ubuntu-20.04 needs: test strategy: fail-fast: false matrix: - board: - - "adafruit_feather_esp32s2_nopsram" - - "adafruit_feather_esp32s2_tftback_nopsram" - - "adafruit_funhouse" - - "adafruit_magtag_2.9_grayscale" - - "adafruit_metro_esp32s2" - - "artisense_rd00" - - "atmegazero_esp32s2" - - "electroniccats_bastwifi" - - "espressif_kaluga_1" - - "espressif_kaluga_1.3" - - "espressif_saola_1_wroom" - - "espressif_saola_1_wrover" - - "franzininho_wifi_wroom" - - "franzininho_wifi_wrover" - - "lilygo_ttgo_t8_s2_st7789" - - "microdev_micro_s2" - - "muselab_nanoesp32_s2_wroom" - - "muselab_nanoesp32_s2_wrover" - - "targett_module_clip_wroom" - - "targett_module_clip_wrover" - - "unexpectedmaker_feathers2" - - "unexpectedmaker_feathers2_prerelease" - - "unexpectedmaker_tinys2" + board: ${{ fromJSON(needs.test.outputs.espressif-boards) }} + if: ${{ needs.test.outputs.espressif-boards != '[]' }} steps: - name: Set up Python 3.8 @@ -532,12 +348,12 @@ jobs: id: idf-cache with: path: ${{ github.workspace }}/.idf_tools - key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20210716 + key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/espressif/esp-idf/HEAD') }}-20210716 - name: Clone IDF submodules run: | (cd $IDF_PATH && git submodule update --init) env: - IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf + IDF_PATH: ${{ github.workspace }}/ports/espressif/esp-idf - name: Install IDF tools run: | $IDF_PATH/tools/idf_tools.py --non-interactive install required @@ -545,7 +361,7 @@ jobs: $IDF_PATH/tools/idf_tools.py --non-interactive install-python-env rm -rf $IDF_TOOLS_PATH/dist env: - IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf + IDF_PATH: ${{ github.workspace }}/ports/espressif/esp-idf IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools - name: Install CircuitPython deps run: | @@ -553,7 +369,7 @@ jobs: pip install -r requirements-dev.txt sudo apt-get install -y gettext ninja-build env: - IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf + IDF_PATH: ${{ github.workspace }}/ports/espressif/esp-idf IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools - name: Versions run: | @@ -565,7 +381,7 @@ jobs: cmake --version shell: bash env: - IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf + IDF_PATH: ${{ github.workspace }}/ports/espressif/esp-idf IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools - name: mpy-cross run: make -C mpy-cross -j2 @@ -578,7 +394,7 @@ jobs: working-directory: tools shell: bash env: - IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf + IDF_PATH: ${{ github.workspace }}/ports/espressif/esp-idf IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools BOARDS: ${{ matrix.board }} - uses: actions/upload-artifact@v2 diff --git a/.github/workflows/ports_windows.yml b/.github/workflows/ports_windows.yml index 463684bfe9..4b86f320ed 100644 --- a/.github/workflows/ports_windows.yml +++ b/.github/workflows/ports_windows.yml @@ -99,8 +99,8 @@ jobs: # https://github.com/espressif/esp-idf/issues/7062 # # - name: prepare esp -# run: ports/esp32s2/esp-idf/install.bat +# run: ports/espressif/esp-idf/install.bat # shell: cmd # # - name: build esp -# run: . ports/esp32s2/esp-idf/export.sh && make -j2 -C ports/esp32s2 BOARD=adafruit_metro_esp32s2 +# run: . ports/espressif/esp-idf/export.sh && make -j2 -C ports/espressif BOARD=adafruit_metro_esp32s2 diff --git a/.gitmodules b/.gitmodules index 28e429129c..b261d8f408 100644 --- a/.gitmodules +++ b/.gitmodules @@ -150,12 +150,12 @@ [submodule "frozen/Adafruit_CircuitPython_RFM69"] path = frozen/Adafruit_CircuitPython_RFM69 url = https://github.com/adafruit/Adafruit_CircuitPython_RFM69.git -[submodule "ports/esp32s2/esp-idf"] - path = ports/esp32s2/esp-idf - url = https://github.com/adafruit/esp-idf.git - branch = circuitpython-v4.3 -[submodule "ports/esp32s2/certificates/nina-fw"] - path = ports/esp32s2/certificates/nina-fw +[submodule "ports/espressif/esp-idf"] + path = ports/espressif/esp-idf + url = https://github.com/espressif/esp-idf.git + branch = release/v4.3 +[submodule "ports/espressif/certificates/nina-fw"] + path = ports/espressif/certificates/nina-fw url = https://github.com/adafruit/nina-fw.git [submodule "frozen/Adafruit_CircuitPython_ST7789"] path = frozen/Adafruit_CircuitPython_ST7789 @@ -188,3 +188,9 @@ [submodule "frozen/Adafruit_CircuitPython_SimpleIO"] path = frozen/Adafruit_CircuitPython_SimpleIO url = https://github.com/adafruit/adafruit_circuitpython_simpleio +[submodule "lib/quirc"] + path = lib/quirc + url = https://github.com/adafruit/quirc.git +[submodule "frozen/Adafruit_CircuitPython_APDS9960"] + path = frozen/Adafruit_CircuitPython_APDS9960 + url = https://github.com/adafruit/Adafruit_CircuitPython_APDS9960 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a6ad210f7a..cfee897258 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: hooks: - id: check-yaml - id: end-of-file-fixer - exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/esp32s2/esp-idf-config/.*|ports/esp32s2/boards/.*/sdkconfig)' + exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*|ports/espressif/esp-idf-config/.*|ports/espressif/boards/.*/sdkconfig)' - id: trailing-whitespace exclude: '^(tests/.*\.exp|tests/cmdline/.*|tests/.*/data/.*)' - repo: local diff --git a/BUILDING.md b/BUILDING.md index 256996807d..0686df3c04 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -28,6 +28,12 @@ This project has a bunch of git submodules. You will need to update them regula git submodule sync git submodule update --init +### Required Python Packages + +Failing to install these will prevent from properly building. + + pip3 install -r requirements-dev.txt + ### mpy-cross As part of the build process, mpy-cross is needed to compile .py files into .mpy files. diff --git a/Makefile b/Makefile index a26eef5c27..db0e871256 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(BASEOPTS) # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(BASEOPTS) -TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/cxd56 ports/esp32s2 ports/mimxrt10xx ports/nrf ports/raspberrypi ports/stm py shared-bindings shared-module supervisor +TRANSLATE_SOURCES = extmod lib main.c ports/atmel-samd ports/cxd56 ports/espressif ports/mimxrt10xx ports/nrf ports/raspberrypi ports/stm py shared-bindings shared-module supervisor # Paths to exclude from TRANSLATE_SOURCES # Each must be preceded by "-path"; if any wildcards, enclose in quotes. # Separate by "-o" (Find's "or" operand) @@ -48,7 +48,7 @@ TRANSLATE_SOURCES_EXC = -path "ports/*/build-*" \ -o -path "ports/*/build" \ -o -path ports/atmel-samd/asf4 \ -o -path ports/cxd56/spresense-exported-sdk \ - -o -path ports/esp32s2/esp-idf \ + -o -path ports/espressif/esp-idf \ -o -path ports/mimxrt10xx/sdk \ -o -path ports/raspberrypi/sdk \ -o -path ports/stm/st_driver \ @@ -283,8 +283,8 @@ samd21: samd51: $(MAKE) -C ports/atmel-samd BOARD=feather_m4_express -esp32s2: - $(MAKE) -C ports/esp32s2 BOARD=espressif_saola_1_wroom +espressif: + $(MAKE) -C ports/espressif BOARD=espressif_saola_1_wroom litex: $(MAKE) -C ports/litex BOARD=fomu @@ -298,7 +298,7 @@ nrf: stm: $(MAKE) -C ports/stm BOARD=feather_stm32f405_express -clean-one-of-each: clean-samd21 clean-samd51 clean-esp32s2 clean-litex clean-mimxrt10xx clean-nrf clean-stm +clean-one-of-each: clean-samd21 clean-samd51 clean-espressif clean-litex clean-mimxrt10xx clean-nrf clean-stm clean-samd21: $(MAKE) -C ports/atmel-samd BOARD=trinket_m0 clean @@ -306,8 +306,8 @@ clean-samd21: clean-samd51: $(MAKE) -C ports/atmel-samd BOARD=feather_m4_express clean -clean-esp32s2: - $(MAKE) -C ports/esp32s2 BOARD=espressif_saola_1_wroom clean +clean-espressif: + $(MAKE) -C ports/espressif BOARD=espressif_saola_1_wroom clean clean-litex: $(MAKE) -C ports/litex BOARD=fomu clean diff --git a/README.rst b/README.rst index 86c5660417..c6e9a33994 100644 --- a/README.rst +++ b/README.rst @@ -21,7 +21,7 @@ besides a text editor (we recommend `Mu `_ for beginners.) Starting with CircuitPython 7.0.0, some boards may only be connectable over Bluetooth Low Energy (BLE). Those boards provide serial and file access over BLE instead of USB using open protocols. (Some boards may use both USB and BLE.) BLE access can be done from a variety of apps including -`code.circuitpythonn.org `_. +`code.circuitpython.org `_. CircuitPython features unified Python core APIs and a growing list of 300+ device libraries and drivers that work with it. These libraries also work on single board computers with regular @@ -108,7 +108,7 @@ CircuitPython: - Supports native USB on most boards and BLE otherwise, allowing file editing without special tools. - Floats (aka decimals) are enabled for all builds. - Error messages are translated into 10+ languages. -- Concurrenncy within Python is not well supported. Interrupts and threading are disabled. +- Concurrency within Python is not well supported. Interrupts and threading are disabled. async/await keywords are available on some boards for cooperative multitasking. Some concurrency is achieved with native modules for tasks that require it such as audio file playback. @@ -119,7 +119,7 @@ Behavior them. CircuitPython's goal is to clarify the role of each file and make each file independent from each other. - - ``boot.py`` (or ``settings.py``) runs only once on start up before + - ``boot.py`` runs only once on start up before USB is 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``. @@ -140,8 +140,7 @@ Behavior - Autoreload is disabled while the REPL is active. - Main is one of these: ``code.txt``, ``code.py``, ``main.py``, ``main.txt`` -- Boot is one of these: ``settings.txt``, ``settings.py``, ``boot.py``, - ``boot.txt`` +- Boot is one of these: ``boot.py``, ``boot.txt`` API ~~~ @@ -214,7 +213,7 @@ Supported Support status ================ ============================================================ atmel-samd ``SAMD21`` stable | ``SAMD51`` stable cxd56 stable -esp32s2 stable +espressif stable litex alpha mimxrt10xx alpha nrf stable diff --git a/WEBUSB_README.md b/WEBUSB_README.md index 8250941eb0..ecae66308a 100644 --- a/WEBUSB_README.md +++ b/WEBUSB_README.md @@ -6,7 +6,7 @@ SPDX-License-Identifier: MIT # WebUSB Serial Support -To date, this has only been tested on one port (esp32s2), on one board (espressif_kaluga_1). +To date, this has only been tested on one port (espressif), on one board (espressif_kaluga_1). ## What it does diff --git a/conf.py b/conf.py index acdb2a34da..0dac441b0d 100644 --- a/conf.py +++ b/conf.py @@ -24,6 +24,7 @@ import subprocess import sys import urllib.parse import time +from collections import defaultdict from sphinx.transforms import SphinxTransform from docutils import nodes @@ -47,9 +48,15 @@ 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: + modules_support_matrix_reverse[module].append(board) +modules_support_matrix_reverse = dict((module, sorted(boards)) for module, boards in modules_support_matrix_reverse.items()) html_context = { - 'support_matrix': modules_support_matrix + 'support_matrix': modules_support_matrix, + 'support_matrix_reverse': modules_support_matrix_reverse } # -- General configuration ------------------------------------------------ @@ -94,6 +101,8 @@ autoapi_template_dir = 'docs/autoapi/templates' autoapi_python_class_content = "both" autoapi_python_use_implicit_namespaces = True autoapi_root = "shared-bindings" +def autoapi_prepare_jinja_env(jinja_env): + jinja_env.globals['support_matrix_reverse'] = modules_support_matrix_reverse redirects_file = 'docs/redirects.txt' @@ -179,10 +188,10 @@ exclude_patterns = ["**/build*", "ports/atmel-samd/tools", "ports/cxd56/mkspk", "ports/cxd56/spresense-exported-sdk", - "ports/esp32s2/certificates", - "ports/esp32s2/esp-idf", - "ports/esp32s2/.idf_tools", - "ports/esp32s2/peripherals", + "ports/espressif/certificates", + "ports/espressif/esp-idf", + "ports/espressif/.idf_tools", + "ports/espressif/peripherals", "ports/litex/hw", "ports/minimal", "ports/mimxrt10xx/peripherals", diff --git a/docs/autoapi/templates/python/module.rst b/docs/autoapi/templates/python/module.rst index 63a1aaa76d..f1fee865f7 100644 --- a/docs/autoapi/templates/python/module.rst +++ b/docs/autoapi/templates/python/module.rst @@ -14,6 +14,22 @@ {% endif %} +{% if support_matrix_reverse[obj.name] is defined %} +.. raw:: html + +

+

+ Available on these boards +
    + {% for board in support_matrix_reverse[obj.name] %} +
  • {{ board }} + {% endfor %} +
+
+

+ +{% endif %} + {% block subpackages %} {% set visible_subpackages = obj.subpackages|selectattr("display")|list %} {% if visible_subpackages %} diff --git a/docs/common_hal.md b/docs/common_hal.md index 024c1582c2..b5ce834343 100644 --- a/docs/common_hal.md +++ b/docs/common_hal.md @@ -7,7 +7,7 @@ These instructions also apply to `analogio`, `busio`, `pulseio` and `touchio`. M Common HAL related files are found in these locations: * `shared-bindings` Shared home for the Python <-> C bindings which includes inline RST documentation for the created interfaces. The common hal functions are defined in the .h files of the corresponding C files. -* `shared-modules` Shared home for C code built on the Common HAL and used by all ports. This code only uses `common_hal` methods defined in `shared-bindings`. +* `shared-module` Shared home for C code built on the Common HAL and used by all ports. This code only uses `common_hal` methods defined in `shared-bindings`. * `/common-hal` Port-specific implementation of the Common HAL. Each folder has the substructure of / and they should match 1:1. `__init__.c` is used for module globals that are not classes (similar to `__init__.py`). diff --git a/docs/porting.rst b/docs/porting.rst index 8d0262455b..013c367291 100644 --- a/docs/porting.rst +++ b/docs/porting.rst @@ -80,7 +80,7 @@ as a natural "TODO" list. An example minimal build list is shown below: # Requires DigitalIO: CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO - CIRCUITPY_GAMEPAD = 0 + 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 6eb7ddc4d8..248a042e7a 100644 --- a/docs/redirects.txt +++ b/docs/redirects.txt @@ -71,7 +71,7 @@ shared-bindings/displayio/Group.rst shared-bindings/displayio/#displayio.Group shared-bindings/displayio/I2CDisplay.rst shared-bindings/displayio/#displayio.I2CDisplay shared-bindings/displayio/OnDiskBitmap.rst shared-bindings/displayio/#displayio.OnDiskBitmap shared-bindings/displayio/Palette.rst shared-bindings/displayio/#displayio.Palette -shared-bindings/displayio/ParallelBus.rst shared-bindings/displayio/#displayio.ParallelBus +shared-bindings/paralleldisplay/ParallelBus.rst shared-bindings/paralleldisplay/#paralleldisplay.ParallelBus shared-bindings/displayio/Shape.rst shared-bindings/displayio/#displayio.Shape shared-bindings/displayio/TileGrid.rst shared-bindings/displayio/#displayio.TileGrid shared-bindings/displayio/__init__.rst shared-bindings/displayio/ @@ -152,7 +152,6 @@ shared-bindings/ustack/__init__.rst shared-bindings/ustack/ shared-bindings/vectorio/Circle.rst shared-bindings/vectorio/#vectorio.Circle shared-bindings/vectorio/Polygon.rst shared-bindings/vectorio/#vectorio.Polygon shared-bindings/vectorio/Rectangle.rst shared-bindings/vectorio/#vectorio.Rectangle -shared-bindings/vectorio/VectorShape.rst shared-bindings/vectorio/#vectorio.VectorShape shared-bindings/vectorio/__init__.rst shared-bindings/vectorio/ shared-bindings/watchdog/WatchDogMode.rst shared-bindings/watchdog/#watchdog.WatchDogMode shared-bindings/watchdog/WatchDogTimer.rst shared-bindings/watchdog/#watchdog.WatchDogTimer diff --git a/docs/shared_bindings_matrix.py b/docs/shared_bindings_matrix.py index bfe83b3aaf..7954e96bfd 100644 --- a/docs/shared_bindings_matrix.py +++ b/docs/shared_bindings_matrix.py @@ -30,7 +30,7 @@ import sys from concurrent.futures import ThreadPoolExecutor -SUPPORTED_PORTS = ['atmel-samd', 'cxd56', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'raspberrypi', 'stm'] +SUPPORTED_PORTS = ['atmel-samd', 'cxd56', 'espressif', 'litex', 'mimxrt10xx', 'nrf', 'raspberrypi', 'stm'] aliases_by_board = { "circuitplayground_express": [ diff --git a/docs/supported_ports.rst b/docs/supported_ports.rst index b83ef12d35..fbe61e81ce 100644 --- a/docs/supported_ports.rst +++ b/docs/supported_ports.rst @@ -13,7 +13,7 @@ is limited. ../ports/atmel-samd/README ../ports/cxd56/README - ../ports/esp32s2/README + ../ports/espressif/README ../ports/litex/README ../ports/mimxrt10xx/README ../ports/nrf/README diff --git a/frozen/Adafruit_CircuitPython_APDS9960 b/frozen/Adafruit_CircuitPython_APDS9960 new file mode 160000 index 0000000000..ee411d34df --- /dev/null +++ b/frozen/Adafruit_CircuitPython_APDS9960 @@ -0,0 +1 @@ +Subproject commit ee411d34dfa2fb70a35aa99945eca77f16456619 diff --git a/frozen/Adafruit_CircuitPython_BLE b/frozen/Adafruit_CircuitPython_BLE index ad4f2d32d3..9ae0e7f870 160000 --- a/frozen/Adafruit_CircuitPython_BLE +++ b/frozen/Adafruit_CircuitPython_BLE @@ -1 +1 @@ -Subproject commit ad4f2d32d3a35b412bab7c6c0ba3b7a46d5da5aa +Subproject commit 9ae0e7f870c0dd508d8a27c179b5d63b47567f85 diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index 68b7e580fe..e0fecb6c73 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit 68b7e580fe7d162d686f92301ab3937907dcaafe +Subproject commit e0fecb6c73f11c31cfc2a9c0e9ce9805b8fb1cf1 diff --git a/frozen/Adafruit_CircuitPython_Display_Shapes b/frozen/Adafruit_CircuitPython_Display_Shapes index c6ea5d17c8..99bf9e741d 160000 --- a/frozen/Adafruit_CircuitPython_Display_Shapes +++ b/frozen/Adafruit_CircuitPython_Display_Shapes @@ -1 +1 @@ -Subproject commit c6ea5d17c8c7bd391b3977c0195cff60dddf3f25 +Subproject commit 99bf9e741dccd1271317e782eed49cbf42a4efae diff --git a/frozen/Adafruit_CircuitPython_Display_Text b/frozen/Adafruit_CircuitPython_Display_Text index c31c0ef2da..99a296fb3b 160000 --- a/frozen/Adafruit_CircuitPython_Display_Text +++ b/frozen/Adafruit_CircuitPython_Display_Text @@ -1 +1 @@ -Subproject commit c31c0ef2da48bfed7da2188039b59251f02110ea +Subproject commit 99a296fb3bdf2743f9b5f487649d7721c8f83c24 diff --git a/frozen/Adafruit_CircuitPython_HID b/frozen/Adafruit_CircuitPython_HID index 78b0fbbb00..1cb554987d 160000 --- a/frozen/Adafruit_CircuitPython_HID +++ b/frozen/Adafruit_CircuitPython_HID @@ -1 +1 @@ -Subproject commit 78b0fbbb00c0431042b460fe20a76bbc440c4793 +Subproject commit 1cb554987df86b008e5a0feaa56f0a24d806bf28 diff --git a/frozen/Adafruit_CircuitPython_MIDI b/frozen/Adafruit_CircuitPython_MIDI index 01ae093f1f..0f5651650c 160000 --- a/frozen/Adafruit_CircuitPython_MIDI +++ b/frozen/Adafruit_CircuitPython_MIDI @@ -1 +1 @@ -Subproject commit 01ae093f1f73c152941cde9f4f850b163d278df2 +Subproject commit 0f5651650c11a24e531e5dd1eadfc5654d84a478 diff --git a/frozen/Adafruit_CircuitPython_NeoPixel b/frozen/Adafruit_CircuitPython_NeoPixel index b2f21e6e42..0f4661c45a 160000 --- a/frozen/Adafruit_CircuitPython_NeoPixel +++ b/frozen/Adafruit_CircuitPython_NeoPixel @@ -1 +1 @@ -Subproject commit b2f21e6e42e681b2da91bf95d586ac8e4ad8266b +Subproject commit 0f4661c45a578d816323b5ad0f432aff73b5522f diff --git a/frozen/Adafruit_CircuitPython_Requests b/frozen/Adafruit_CircuitPython_Requests index c55425e178..03f54421a0 160000 --- a/frozen/Adafruit_CircuitPython_Requests +++ b/frozen/Adafruit_CircuitPython_Requests @@ -1 +1 @@ -Subproject commit c55425e17842cce3ec0b34489133436c3e1a3898 +Subproject commit 03f54421a050bbfda71e1c98986ddecc3862431a diff --git a/frozen/Adafruit_CircuitPython_ST7789 b/frozen/Adafruit_CircuitPython_ST7789 index 9020acbab0..460e971e32 160000 --- a/frozen/Adafruit_CircuitPython_ST7789 +++ b/frozen/Adafruit_CircuitPython_ST7789 @@ -1 +1 @@ -Subproject commit 9020acbab070d5842dcba83a5b7f7b7c86dc7414 +Subproject commit 460e971e32ea53176b39ec093ae98fdac0d39d86 diff --git a/frozen/circuitpython-stage b/frozen/circuitpython-stage index b014aa045d..d0f1c46d7f 160000 --- a/frozen/circuitpython-stage +++ b/frozen/circuitpython-stage @@ -1 +1 @@ -Subproject commit b014aa045d9014b86a4ae583f452c6b8282a61b9 +Subproject commit d0f1c46d7f879cd60562ee69900d619499d4d206 diff --git a/lib/libc/string0.c b/lib/libc/string0.c index 3ebb580989..fee2c017f8 100644 --- a/lib/libc/string0.c +++ b/lib/libc/string0.c @@ -27,7 +27,9 @@ #include #include +#ifndef likely #define likely(x) __builtin_expect((x), 1) +#endif #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" diff --git a/lib/oofatfs/ff.c b/lib/oofatfs/ff.c index 06743947e0..68c662c7a3 100644 --- a/lib/oofatfs/ff.c +++ b/lib/oofatfs/ff.c @@ -1175,6 +1175,7 @@ static DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, 2..0x7FF break; } } + MP_FALLTHROUGH /* go to default */ #endif default: @@ -5518,6 +5519,7 @@ FRESULT f_mkfs ( } st = 1; /* Do not compress short run */ /* go to next case */ + MP_FALLTHROUGH case 1: ch = si++; /* Fill the short run */ if (--j == 0) st = 0; diff --git a/lib/oofatfs/ffconf.h b/lib/oofatfs/ffconf.h index 7072edf153..a4a55a0fa2 100644 --- a/lib/oofatfs/ffconf.h +++ b/lib/oofatfs/ffconf.h @@ -163,8 +163,11 @@ / memory for the working buffer, memory management functions, ff_memalloc() and / ff_memfree() in ffsystem.c, need to be added to the project. */ - +#ifdef MICROPY_FATFS_LFN_UNICODE +#define FF_LFN_UNICODE (MICROPY_FATFS_LFN_UNICODE) +#else #define FF_LFN_UNICODE 0 +#endif /* This option switches the character encoding on the API when LFN is enabled. / / 0: ANSI/OEM in current CP (TCHAR = char) diff --git a/lib/quirc b/lib/quirc new file mode 160000 index 0000000000..8c6ffa228a --- /dev/null +++ b/lib/quirc @@ -0,0 +1 @@ +Subproject commit 8c6ffa228a4c7643daed7039d3c51d38a43991b8 diff --git a/lib/tinyusb b/lib/tinyusb index 184f1b723f..43aac7074b 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 184f1b723fb811016063deccab9e81640e5c3e7f +Subproject commit 43aac7074be0d14e72cb04eaddcddf1a926c6a74 diff --git a/lib/utils/pyexec.c b/lib/utils/pyexec.c index 2651189915..fe52fc645b 100644 --- a/lib/utils/pyexec.c +++ b/lib/utils/pyexec.c @@ -44,6 +44,10 @@ #include "lib/utils/pyexec.h" #include "genhdr/mpversion.h" +#if CIRCUITPY_ATEXIT +#include "shared-module/atexit/__init__.h" +#endif + pyexec_mode_kind_t pyexec_mode_kind = PYEXEC_MODE_FRIENDLY_REPL; int pyexec_system_exit = 0; @@ -58,6 +62,7 @@ STATIC bool repl_display_debugging_info = 0; #define EXEC_FLAG_SOURCE_IS_VSTR (16) #define EXEC_FLAG_SOURCE_IS_FILENAME (32) #define EXEC_FLAG_SOURCE_IS_READER (64) +#define EXEC_FLAG_SOURCE_IS_ATEXIT (128) // parses, compiles and executes the code in the lexer // frees the lexer before returning @@ -81,44 +86,49 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input nlr.ret_val = NULL; if (nlr_push(&nlr) == 0) { mp_obj_t module_fun; - #if MICROPY_MODULE_FROZEN_MPY - if (exec_flags & EXEC_FLAG_SOURCE_IS_RAW_CODE) { - // source is a raw_code object, create the function - module_fun = mp_make_function_from_raw_code(source, MP_OBJ_NULL, MP_OBJ_NULL); - } else + #if CIRCUITPY_ATEXIT + if (!(exec_flags & EXEC_FLAG_SOURCE_IS_ATEXIT)) #endif { - #if MICROPY_ENABLE_COMPILER - mp_lexer_t *lex; - if (exec_flags & EXEC_FLAG_SOURCE_IS_VSTR) { - const vstr_t *vstr = source; - lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, vstr->buf, vstr->len, 0); - } else if (exec_flags & EXEC_FLAG_SOURCE_IS_READER) { - lex = mp_lexer_new(MP_QSTR__lt_stdin_gt_, *(mp_reader_t *)source); - } else if (exec_flags & EXEC_FLAG_SOURCE_IS_FILENAME) { - lex = mp_lexer_new_from_file(source); - } else { - lex = (mp_lexer_t *)source; - } - // source is a lexer, parse and compile the script - qstr source_name = lex->source_name; - if (input_kind == MP_PARSE_FILE_INPUT) { - mp_store_global(MP_QSTR___file__, MP_OBJ_NEW_QSTR(source_name)); - } - mp_parse_tree_t parse_tree = mp_parse(lex, input_kind); - module_fun = mp_compile(&parse_tree, source_name, exec_flags & EXEC_FLAG_IS_REPL); - // Clear the parse tree because it has a heap pointer we don't need anymore. - *((uint32_t volatile *)&parse_tree.chunk) = 0; - #else - mp_raise_msg(&mp_type_RuntimeError, MP_ERROR_TEXT("script compilation not supported")); + #if MICROPY_MODULE_FROZEN_MPY + if (exec_flags & EXEC_FLAG_SOURCE_IS_RAW_CODE) { + // source is a raw_code object, create the function + module_fun = mp_make_function_from_raw_code(source, MP_OBJ_NULL, MP_OBJ_NULL); + } else #endif - } + { + #if MICROPY_ENABLE_COMPILER + mp_lexer_t *lex; + if (exec_flags & EXEC_FLAG_SOURCE_IS_VSTR) { + const vstr_t *vstr = source; + lex = mp_lexer_new_from_str_len(MP_QSTR__lt_stdin_gt_, vstr->buf, vstr->len, 0); + } else if (exec_flags & EXEC_FLAG_SOURCE_IS_READER) { + lex = mp_lexer_new(MP_QSTR__lt_stdin_gt_, *(mp_reader_t *)source); + } else if (exec_flags & EXEC_FLAG_SOURCE_IS_FILENAME) { + lex = mp_lexer_new_from_file(source); + } else { + lex = (mp_lexer_t *)source; + } + // source is a lexer, parse and compile the script + qstr source_name = lex->source_name; + if (input_kind == MP_PARSE_FILE_INPUT) { + mp_store_global(MP_QSTR___file__, MP_OBJ_NEW_QSTR(source_name)); + } + mp_parse_tree_t parse_tree = mp_parse(lex, input_kind); + module_fun = mp_compile(&parse_tree, source_name, exec_flags & EXEC_FLAG_IS_REPL); + // Clear the parse tree because it has a heap pointer we don't need anymore. + *((uint32_t volatile *)&parse_tree.chunk) = 0; + #else + mp_raise_msg(&mp_type_RuntimeError, MP_ERROR_TEXT("script compilation not supported")); + #endif + } - // If the code was loaded from a file it's likely to be running for a while so we'll long - // live it and collect any garbage before running. - if (input_kind == MP_PARSE_FILE_INPUT) { - module_fun = make_obj_long_lived(module_fun, 6); - gc_collect(); + // If the code was loaded from a file it's likely to be running for a while so we'll long + // live it and collect any garbage before running. + if (input_kind == MP_PARSE_FILE_INPUT) { + module_fun = make_obj_long_lived(module_fun, 6); + gc_collect(); + } } // execute code @@ -126,7 +136,15 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input #if MICROPY_REPL_INFO start = mp_hal_ticks_ms(); #endif - mp_call_function_0(module_fun); + #if CIRCUITPY_ATEXIT + if (exec_flags & EXEC_FLAG_SOURCE_IS_ATEXIT) { + atexit_callback_t *callback = (atexit_callback_t *)source; + mp_call_function_n_kw(callback->func, callback->n_pos, callback->n_kw, callback->args); + } else + #endif + { + mp_call_function_0(module_fun); + } mp_hal_set_interrupt_char(-1); // disable interrupt mp_handle_pending(true); // handle any pending exceptions (and any callbacks) nlr_pop(); @@ -149,7 +167,7 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input mp_hal_stdout_tx_strn("\x04", 1); } // check for SystemExit - if (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(((mp_obj_base_t *)nlr.ret_val)->type), MP_OBJ_FROM_PTR(&mp_type_SystemExit))) { + if (mp_obj_is_subclass_fast(mp_obj_get_type((mp_obj_t)nlr.ret_val), MP_OBJ_FROM_PTR(&mp_type_SystemExit))) { // at the moment, the value of SystemExit is unused ret = pyexec_system_exit; #if CIRCUITPY_ALARM @@ -165,7 +183,12 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input } if (result != NULL) { result->return_code = ret; + #if CIRCUITPY_ALARM + // Don't set the exception object if we exited for deep sleep. + if (ret != 0 && ret != PYEXEC_DEEP_SLEEP) { + #else if (ret != 0) { + #endif mp_obj_t return_value = (mp_obj_t)nlr.ret_val; result->exception = return_value; result->exception_line = -1; @@ -242,7 +265,7 @@ STATIC mp_uint_t mp_reader_stdin_readbyte(void *data) { mp_hal_stdout_tx_strn("\x04", 1); // indicate end to host if (c == CHAR_CTRL_C) { #if MICROPY_KBD_EXCEPTION - MP_STATE_VM(mp_kbd_exception).traceback_data = NULL; + MP_STATE_VM(mp_kbd_exception).traceback->data = NULL; nlr_raise(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))); #else mp_raise_type(&mp_type_KeyboardInterrupt); @@ -627,7 +650,21 @@ friendly_repl_reset: } vstr_reset(&line); - int ret = readline(&line, ">>> "); + + nlr_buf_t nlr; + nlr.ret_val = NULL; + int ret = 0; + if (nlr_push(&nlr) == 0) { + ret = readline(&line, ">>> "); + } else { + // Uncaught exception + mp_handle_pending(false); // clear any pending exceptions (and run any callbacks) + + // Print exceptions but stay in the REPL. There are very few delayed + // exceptions. The WatchDogTimer can raise one though. + mp_hal_stdout_tx_str("\r\n"); + mp_obj_print_exception(&mp_plat_print, MP_OBJ_FROM_PTR(nlr.ret_val)); + } mp_parse_input_kind_t parse_input_kind = MP_PARSE_SINGLE_INPUT; if (ret == CHAR_CTRL_A) { @@ -741,6 +778,12 @@ int pyexec_frozen_module(const char *name, pyexec_result_t *result) { } #endif +#if CIRCUITPY_ATEXIT +int pyexec_exit_handler(const void *source, pyexec_result_t *result) { + return parse_compile_execute(source, MP_PARSE_FILE_INPUT, EXEC_FLAG_SOURCE_IS_ATEXIT, result); +} +#endif + #if MICROPY_REPL_INFO mp_obj_t pyb_set_repl_info(mp_obj_t o_value) { repl_display_debugging_info = mp_obj_get_int(o_value); diff --git a/lib/utils/pyexec.h b/lib/utils/pyexec.h index 6f0252cfed..3d3c2d6c53 100644 --- a/lib/utils/pyexec.h +++ b/lib/utils/pyexec.h @@ -59,6 +59,10 @@ void pyexec_event_repl_init(void); int pyexec_event_repl_process_char(int c); extern uint8_t pyexec_repl_active; +#if CIRCUITPY_ATEXIT +int pyexec_exit_handler(const void *source, pyexec_result_t *result); +#endif + #if MICROPY_REPL_INFO mp_obj_t pyb_set_repl_info(mp_obj_t o_value); MP_DECLARE_CONST_FUN_OBJ_1(pyb_set_repl_info_obj); diff --git a/locale/ID.po b/locale/ID.po index 32e1bd823f..d14e751844 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -73,6 +73,14 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "%q gagal: %d" @@ -95,7 +103,11 @@ msgid "%q indices must be integers, not %s" msgstr "indeks %q harus bilangan bulat, bukan %s" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -110,14 +122,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -134,10 +138,6 @@ msgstr "%q harus >= 0" msgid "%q must be >= 1" msgstr "%q harus >= 1" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -146,7 +146,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "%q harus berupa tuple dengan panjang 2" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -175,7 +176,11 @@ msgstr "%q harus berupa int" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() mengambil posisi argumen %d tapi %d yang diberikan" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -192,7 +197,7 @@ msgstr "Objek '%q' tidak mendukung '%q'" msgid "'%q' object is not an iterator" msgstr "Objek '%q' bukan merupakan iterator" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "" @@ -325,6 +330,10 @@ 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" @@ -350,7 +359,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "Sebuah channel hardware interrupt sedang digunakan" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "ADC2 sedang digunakan oleh WiFi" @@ -363,35 +372,38 @@ msgstr "Alamat harus sepanjang %d byte" msgid "Address type out of range" msgstr "Jenis alamat di luar batas" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Semua perangkat I2C sedang digunakan" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "Semua unit PCNT sedang digunakan" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "Semua RX FIFO sedang digunakan" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Semua perangkat SPI sedang digunakan" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "Semua perangkat UART sedang digunakan" +#: 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 "" @@ -419,10 +431,10 @@ msgstr "Semua timer untuk pin ini sedang digunakan" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -443,7 +455,7 @@ msgstr "" msgid "Already running" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "" @@ -496,6 +508,10 @@ msgstr "" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -516,7 +532,7 @@ msgstr "" "Auto-reload aktif. Silahkan simpan data-data (files) melalui USB untuk " "menjalankannya atau masuk ke REPL untukmenonaktifkan.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "" @@ -613,10 +629,10 @@ msgstr "Penyangga harus memiliki panjang setidaknya 1" msgid "Buffer too short by %d bytes" msgstr "Buffer terlalu pendek untuk %d byte" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "Pin bus %d sudah digunakan" @@ -633,7 +649,7 @@ msgstr "Bytes harus di antara 0 dan 255." msgid "CBC blocks must be multiples of 16 bytes" msgstr "Blok CBC harus merupakan kelipatan 16 byte" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -641,15 +657,15 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "Panggil super().__init__() sebelum mengakses objek asli." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -695,7 +711,7 @@ msgstr "" "Tidak dapat menggunakan output di kedua channel dengan menggunakan pin yang " "sama" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -719,7 +735,7 @@ msgstr "" "Tidak dapat melakukan reset ke bootloader karena tidak ada bootloader yang " "terisi" -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -727,7 +743,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "Tidak dapat menetapkan nilai saat arah input." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Tidak dapat menentukan RTS atau CTS dalam mode RS485" @@ -746,7 +762,7 @@ msgstr "" "Tidak dapat membuat variasi frekuensi pada penghitung waktu yang sudah " "digunakan" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -784,7 +800,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "Entri kolom harus digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -812,7 +828,7 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Tidak dapat menginisialisasi UART" @@ -828,7 +844,7 @@ msgstr "Tidak dapat menginisialisasi ulang timer" msgid "Could not restart PWM" msgstr "Tidak dapat memulai ulang PWM" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -878,12 +894,12 @@ msgstr "Terjadi kesalahan saat menginisialisasi perangkat DAC" msgid "DAC already in use" msgstr "DAC sudah digunakan" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "Data 0 pin harus byte disejajarkan" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -934,7 +950,8 @@ msgstr "Mode kendara tidak digunakan saat arah input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB hanya beroperasi pada 16 byte di satu waktu" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -1013,7 +1030,7 @@ msgstr "FFT didefinisikan hanya untuk ndarrays" msgid "FFT is implemented for linear arrays only" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "" @@ -1034,7 +1051,7 @@ 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/esp32s2/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 @@ -1042,11 +1059,11 @@ msgstr "Gagal untuk mengalokasikan buffer RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Gagal untuk megalokasikan buffer RX dari %d byte" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "" @@ -1062,7 +1079,7 @@ msgstr "Gagal terhubung: kesalahan internal" msgid "Failed to connect: timeout" msgstr "Gagal terhubung: habis waktu" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "" @@ -1088,12 +1105,12 @@ msgid "File exists" msgstr "File sudah ada" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "" @@ -1115,7 +1132,7 @@ msgstr "Frekuensi harus cocok dengan PWMOut yang ada menggunakan timer ini" msgid "Function requires lock" msgstr "Fungsinya membutuhkan kunci" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1188,7 +1205,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1201,15 +1218,10 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Kesalahan input/output" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1238,6 +1250,10 @@ msgstr "Otentikasi tidak cukup" msgid "Insufficient encryption" msgstr "Enkripsi tidak cukup" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "Kesalahan definisi internal" @@ -1247,7 +1263,7 @@ msgstr "Kesalahan definisi internal" msgid "Internal error #%d" msgstr "Kesalahan internal #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "" @@ -1268,7 +1284,7 @@ msgstr "" msgid "Invalid ADC Unit value" msgstr "Nilai Unit ADC tidak valid" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1284,7 +1300,7 @@ msgstr "File BMP tidak valid" msgid "Invalid BSSID" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: 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" @@ -1295,18 +1311,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argumen tidak valid" @@ -1325,7 +1341,7 @@ msgid "Invalid byteorder string" msgstr "String byteorder tidak valid" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/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" @@ -1355,7 +1371,7 @@ msgstr "File tidak valid" msgid "Invalid format chunk size" msgstr "Ukuran potongan format tidak valid" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "" @@ -1374,8 +1390,8 @@ msgstr "Fase tidak valid" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1395,13 +1411,16 @@ msgstr "Pin untuk channel kanan tidak valid" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: 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" @@ -1422,15 +1441,15 @@ msgstr "Mode operasi tidak valid." msgid "Invalid security_mode" msgstr "security_mode tidak valid" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" @@ -1467,7 +1486,7 @@ msgstr "Layer sudah ada dalam grup." msgid "Layer must be a Group or TileGrid subclass." msgstr "Layer harus sebuah Grup atau subklas dari TileGrid." -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1526,6 +1545,16 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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." @@ -1543,7 +1572,7 @@ msgstr "Harus menggunakan kelipatan 6 pin rgb, bukan %d" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1576,25 +1605,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "Tidak ada Pin MISO" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Tidak ada Pin MOSI" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Tidak pin RX" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1658,7 +1687,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1721,11 +1751,11 @@ msgstr "Parity ganjil tidak didukung" msgid "Only 8 or 16 bit mono with " msgstr "Hanya 8 atau 16 bit mono dengan " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Hanya alamat IPv4 yang didukung" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "Hanysa socket IPv4 yang didukung" @@ -1758,11 +1788,11 @@ msgstr "" "Hanya monokrom, 4bpp atau 8bpp yang diindeks, dan 16bpp atau lebih yang " "didukung: %d bpp diberikan" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1773,19 +1803,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Waktu habis" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Kehabisan memori" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "Kehabisan socket" @@ -1826,12 +1856,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "ParallelBus belum didukung" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "Periferal sedang digunakan" @@ -1853,7 +1878,7 @@ msgstr "Jumlah pin terlalu besar" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1907,21 +1932,6 @@ msgstr "Tambahkan module apapun pada filesystem\n" msgid "Polygon needs at least 3 points" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Buffer awalan harus ada di heap" @@ -1976,12 +1986,12 @@ msgstr "Kesalahan Init RNG" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c 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/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2013,7 +2023,7 @@ msgstr "sistem file (filesystem) bersifat Read-only" msgid "Read-only object" msgstr "Objek Read-only" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2029,7 +2039,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "Mode AES yang diminta tidak didukung" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2069,7 +2079,7 @@ msgstr "Kesalahan Init SPI" msgid "SPI Re-initialization error" msgstr "Kesalahan Inisialisasi ulang SPI" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2112,7 +2122,6 @@ msgid "Size not supported" msgstr "" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2127,7 +2136,7 @@ msgstr "Potongan dan nilai panjangnya berbeda." msgid "Slices not supported" msgstr "Potongan tidak didukung" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2324,7 +2333,7 @@ msgstr "Nilai UUID bukan str, int atau byte buffer" msgid "Unable to allocate buffers for signed conversion" msgstr "Tidak dapat mengalokasikan buffer untuk signed conversion" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2358,7 +2367,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "Tipe urf nrfx tak sesuai" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2401,7 +2410,7 @@ msgstr "" "perangkat lain ditolak atau diabaikan." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2422,7 +2431,7 @@ msgstr "Operasi yang tidak didukung" msgid "Unsupported pull value." msgstr "Nilai tarikan yang tidak didukung." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2436,7 +2445,7 @@ msgstr "Panjang nilai != Panjang tetap yang dibutuhkan" msgid "Value length > max_length" msgstr "Panjang nilai > max_length" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2567,7 +2576,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "argumen num/types tidak cocok" @@ -2612,6 +2621,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "mode compile buruk" @@ -2682,7 +2695,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "byte > 8 bit tidak didukung" @@ -3131,6 +3144,10 @@ msgstr "" msgid "file must be a file opened in byte mode" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "" @@ -3292,7 +3309,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index keluar dari jangkauan" @@ -3418,6 +3435,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "format tidak valid" @@ -3455,6 +3476,10 @@ msgstr "" msgid "invalid syntax for number" msgstr "" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" @@ -3515,7 +3540,7 @@ msgstr "" msgid "long int not supported in this build" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3651,10 +3676,6 @@ msgstr "" msgid "no active exception to reraise" msgstr "" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "tidak ada ikatan/bind pada temuan nonlocal" @@ -3672,7 +3693,7 @@ msgid "no module named '%q'" msgstr "tidak ada modul yang bernama '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "" @@ -3911,7 +3932,7 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "Muncul dari PulseIn yang kosong" @@ -3936,29 +3957,40 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4148,7 +4180,7 @@ msgstr "" msgid "stop not reachable from start" msgstr "" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "" @@ -4200,7 +4232,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4267,18 +4299,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx dan rx keduanya tidak boleh kosong" @@ -4357,7 +4389,7 @@ msgid "unreadable attribute" msgstr "" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" @@ -4393,11 +4425,15 @@ msgstr "" msgid "value must fit in %d byte(s)" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4414,7 +4450,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "wifi tidak diaktifkan" @@ -4450,7 +4486,7 @@ msgstr "" msgid "x value out of bounds" msgstr "" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" @@ -4478,6 +4514,9 @@ msgstr "zi harus berjenis float" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "ParallelBus not yet supported" +#~ msgstr "ParallelBus belum didukung" + #~ msgid "Buffer too large and unable to allocate" #~ msgstr "Buffer terlalu besar dan tidak dapat dialokasikan" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index bd70fcd946..54a836cf18 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -66,6 +66,14 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "" @@ -88,7 +96,11 @@ msgid "%q indices must be integers, not %s" msgstr "" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -103,14 +115,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -127,10 +131,6 @@ msgstr "" msgid "%q must be >= 1" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -139,7 +139,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -168,7 +169,11 @@ msgstr "" msgid "%q() takes %d positional arguments but %d were given" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -185,7 +190,7 @@ msgstr "" msgid "'%q' object is not an iterator" msgstr "" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "" @@ -318,6 +323,10 @@ 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 "" @@ -343,7 +352,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "" @@ -356,35 +365,38 @@ msgstr "" msgid "Address type out of range" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "" +#: 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 "" @@ -412,10 +424,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -436,7 +448,7 @@ msgstr "" msgid "Already running" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "" @@ -489,6 +501,10 @@ msgstr "" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -507,7 +523,7 @@ msgid "" "disable.\n" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "" @@ -604,10 +620,10 @@ msgstr "" msgid "Buffer too short by %d bytes" msgstr "" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "" @@ -624,7 +640,7 @@ msgstr "" msgid "CBC blocks must be multiples of 16 bytes" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -632,15 +648,15 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -682,7 +698,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -704,7 +720,7 @@ msgstr "" msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -712,7 +728,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -729,7 +745,7 @@ msgstr "" msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -767,7 +783,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "Command must be an int between 0 and 255" msgstr "" @@ -794,7 +810,7 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -810,7 +826,7 @@ msgstr "" msgid "Could not restart PWM" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -860,12 +876,12 @@ msgstr "" msgid "DAC already in use" msgstr "" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -916,7 +932,8 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -995,7 +1012,7 @@ msgstr "" msgid "FFT is implemented for linear arrays only" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "" @@ -1016,7 +1033,7 @@ 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/esp32s2/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 @@ -1024,11 +1041,11 @@ msgstr "" msgid "Failed to allocate RX buffer of %d bytes" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "" @@ -1044,7 +1061,7 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "" @@ -1070,12 +1087,12 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "" @@ -1097,7 +1114,7 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1168,7 +1185,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1181,7 +1198,7 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "" @@ -1213,6 +1230,10 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "" @@ -1222,7 +1243,7 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "" @@ -1243,7 +1264,7 @@ msgstr "" msgid "Invalid ADC Unit value" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1259,7 +1280,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1270,18 +1291,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -1300,7 +1321,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1330,7 +1351,7 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "" @@ -1349,8 +1370,8 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1370,13 +1391,16 @@ msgstr "" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "" @@ -1397,15 +1421,15 @@ msgstr "" msgid "Invalid security_mode" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" @@ -1442,7 +1466,7 @@ msgstr "" msgid "Layer must be a Group or TileGrid subclass." msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1506,6 +1530,11 @@ 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 "" @@ -1523,7 +1552,7 @@ msgstr "" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1556,25 +1585,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1638,7 +1667,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1700,11 +1730,11 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1733,11 +1763,11 @@ msgid "" "%d bpp given" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1748,19 +1778,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "" @@ -1799,12 +1829,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1826,7 +1851,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1877,21 +1902,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1944,12 +1954,12 @@ msgstr "" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -1981,7 +1991,7 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -1997,7 +2007,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2035,7 +2045,7 @@ msgstr "" msgid "SPI Re-initialization error" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2078,7 +2088,6 @@ msgid "Size not supported" msgstr "" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2093,7 +2102,7 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2290,7 +2299,7 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2324,7 +2333,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2365,7 +2374,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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 "" @@ -2386,7 +2395,7 @@ msgstr "" msgid "Unsupported pull value." msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2400,7 +2409,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2525,7 +2534,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "" @@ -2570,6 +2579,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -2640,7 +2653,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -3089,6 +3102,10 @@ msgstr "" msgid "file must be a file opened in byte mode" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "" @@ -3250,7 +3267,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3363,7 +3380,7 @@ msgstr "" #: shared-bindings/bitmaptools/__init__.c #, c-format -msgid "invalid bits_per_pixel %d, must be, 1, 4, 8, 16, 24, or 32" +msgid "invalid bits_per_pixel %d, must be, 1, 2, 4, 8, 16, 24, or 32" msgstr "" #: shared-bindings/bitmaptools/__init__.c @@ -3376,6 +3393,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "" @@ -3413,6 +3434,10 @@ msgstr "" msgid "invalid syntax for number" msgstr "" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" @@ -3473,7 +3498,7 @@ msgstr "" msgid "long int not supported in this build" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3626,7 +3651,7 @@ msgid "no module named '%q'" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "" @@ -3864,7 +3889,7 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -3889,29 +3914,40 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4101,7 +4137,7 @@ msgstr "" msgid "stop not reachable from start" msgstr "" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "" @@ -4153,7 +4189,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4220,18 +4256,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" @@ -4310,7 +4346,7 @@ msgid "unreadable attribute" msgstr "" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" @@ -4346,11 +4382,15 @@ msgstr "" msgid "value must fit in %d byte(s)" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4367,7 +4407,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4403,7 +4443,7 @@ msgstr "" msgid "x value out of bounds" msgstr "" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" diff --git a/locale/cs.po b/locale/cs.po index b8ea4b16d5..b575c22191 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -69,6 +69,14 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "Selhání %q: %d" @@ -91,7 +99,11 @@ msgid "%q indices must be integers, not %s" msgstr "Indexy %q musí být celá Äísla, nikoli %s" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -106,14 +118,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -130,10 +134,6 @@ msgstr "%q musí být >= 0" msgid "%q must be >= 1" msgstr "%q musí být > = 1" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -142,7 +142,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "%q musí být n-tice délky 2" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -171,7 +172,11 @@ msgstr "%q by mÄ›l být int" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() vyžaduje %d poziÄních argumentů, ale %d jich bylo zadáno" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -188,7 +193,7 @@ msgstr "Objekt '%q' nepodporuje '%q'" msgid "'%q' object is not an iterator" msgstr "Objekt '%q' není iterátor" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "Objekt '%q' nelze volat" @@ -321,6 +326,10 @@ 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 "" @@ -346,7 +355,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "" @@ -359,35 +368,38 @@ msgstr "" msgid "Address type out of range" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "" +#: 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 "" @@ -415,10 +427,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -439,7 +451,7 @@ msgstr "" msgid "Already running" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "" @@ -492,6 +504,10 @@ msgstr "" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -510,7 +526,7 @@ msgid "" "disable.\n" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "" @@ -607,10 +623,10 @@ msgstr "" msgid "Buffer too short by %d bytes" msgstr "" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "" @@ -627,7 +643,7 @@ msgstr "" msgid "CBC blocks must be multiples of 16 bytes" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -635,15 +651,15 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -685,7 +701,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -707,7 +723,7 @@ msgstr "" msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -715,7 +731,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -732,7 +748,7 @@ msgstr "" msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -770,7 +786,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "Command must be an int between 0 and 255" msgstr "" @@ -797,7 +813,7 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -813,7 +829,7 @@ msgstr "" msgid "Could not restart PWM" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -863,12 +879,12 @@ msgstr "" msgid "DAC already in use" msgstr "" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -919,7 +935,8 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -998,7 +1015,7 @@ msgstr "" msgid "FFT is implemented for linear arrays only" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "" @@ -1019,7 +1036,7 @@ 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/esp32s2/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 @@ -1027,11 +1044,11 @@ msgstr "" msgid "Failed to allocate RX buffer of %d bytes" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "" @@ -1047,7 +1064,7 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "" @@ -1073,12 +1090,12 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "" @@ -1100,7 +1117,7 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1171,7 +1188,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1184,15 +1201,10 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1221,6 +1233,10 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "" @@ -1230,7 +1246,7 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "" @@ -1251,7 +1267,7 @@ msgstr "" msgid "Invalid ADC Unit value" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1267,7 +1283,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1278,18 +1294,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -1308,7 +1324,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1338,7 +1354,7 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "" @@ -1357,8 +1373,8 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1378,13 +1394,16 @@ msgstr "" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "" @@ -1405,15 +1424,15 @@ msgstr "" msgid "Invalid security_mode" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" @@ -1450,7 +1469,7 @@ msgstr "" msgid "Layer must be a Group or TileGrid subclass." msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1509,6 +1528,16 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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 "" @@ -1526,7 +1555,7 @@ msgstr "" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1559,25 +1588,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1641,7 +1670,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1703,11 +1733,11 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1736,11 +1766,11 @@ msgid "" "%d bpp given" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1751,19 +1781,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "" @@ -1802,12 +1832,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1829,7 +1854,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1880,21 +1905,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1947,12 +1957,12 @@ msgstr "" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -1984,7 +1994,7 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2000,7 +2010,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2038,7 +2048,7 @@ msgstr "" msgid "SPI Re-initialization error" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2081,7 +2091,6 @@ msgid "Size not supported" msgstr "" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2096,7 +2105,7 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2293,7 +2302,7 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2327,7 +2336,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2368,7 +2377,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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 "" @@ -2389,7 +2398,7 @@ msgstr "" msgid "Unsupported pull value." msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2403,7 +2412,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2528,7 +2537,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "" @@ -2573,6 +2582,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -2643,7 +2656,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -3092,6 +3105,10 @@ msgstr "" msgid "file must be a file opened in byte mode" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "" @@ -3253,7 +3270,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3379,6 +3396,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "" @@ -3416,6 +3437,10 @@ msgstr "" msgid "invalid syntax for number" msgstr "" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" @@ -3476,7 +3501,7 @@ msgstr "" msgid "long int not supported in this build" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3612,10 +3637,6 @@ msgstr "" msgid "no active exception to reraise" msgstr "" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "" @@ -3633,7 +3654,7 @@ msgid "no module named '%q'" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "" @@ -3871,7 +3892,7 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -3896,29 +3917,40 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4108,7 +4140,7 @@ msgstr "" msgid "stop not reachable from start" msgstr "" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "" @@ -4160,7 +4192,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4227,18 +4259,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" @@ -4317,7 +4349,7 @@ msgid "unreadable attribute" msgstr "" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" @@ -4353,11 +4385,15 @@ msgstr "" msgid "value must fit in %d byte(s)" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4374,7 +4410,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4410,7 +4446,7 @@ msgstr "" msgid "x value out of bounds" msgstr "" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 7ab3e244a2..9e114b80b7 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: 2021-06-19 20:18+0000\n" -"Last-Translator: Zoltán Vörös \n" +"PO-Revision-Date: 2021-08-23 14:19+0000\n" +"Last-Translator: Jeff Epler \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.7\n" +"X-Generator: Weblate 4.8.1-dev\n" #: main.c msgid "" @@ -74,6 +74,14 @@ msgstr "" "%d Address Pins, %d rgb Pins und %d Tiles indiziert eine Höhe von %d, nicht " "%d" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "%q Fehler: %d" @@ -96,7 +104,11 @@ msgid "%q indices must be integers, not %s" msgstr "%q Indizes müssen Integer sein, nicht %s" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -111,14 +123,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "%q muss 0-255 sein" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "%q muss 1-255 sein" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -135,10 +139,6 @@ msgstr "%q muss >= 0 sein" msgid "%q must be >= 1" msgstr "%q muss >= 1 sein" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "%q muss None oder zwischen 1 und len(report_descriptor)-1 sein" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -147,7 +147,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "%q muss ein Tupel der Länge 2 sein" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -177,7 +178,11 @@ msgid "%q() takes %d positional arguments but %d were given" msgstr "" "%q() nimmt %d Argumente ohne Schlüsselwort an, aber es wurden %d angegeben" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s Error 0x%x" @@ -194,7 +199,7 @@ msgstr "'%q' Objekt unterstützt '%q' nicht" msgid "'%q' object is not an iterator" msgstr "'%q' Objekt ist kein Iterator" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "'%q' Objekt ist kein callable" @@ -327,6 +332,10 @@ 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 "" + #: py/compile.c msgid "*x must be assignment target" msgstr "*x muss Zuordnungsziel sein" @@ -352,7 +361,7 @@ msgstr "64 bit Typen" msgid "A hardware interrupt channel is already in use" msgstr "Ein Hardware Interrupt Kanal wird schon benutzt" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "ADC2 wird vom WiFi benutzt" @@ -365,35 +374,38 @@ msgstr "Die Adresse muss %d Bytes lang sein" msgid "Address type out of range" msgstr "Adresstyp außerhalb des zulässigen Bereichs" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Alle CAN Schnittstellen sind in Benutzung" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C-Peripheriegeräte sind in Benutzung" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "Alle PCNT Einheiten sind in Benutzung" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "Alle RX FIFOs sind in Benutzung" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Alle SPI-Peripheriegeräte sind in Benutzung" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "Alle UART-Peripheriegeräte sind in Benutzung" +#: 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 "" @@ -421,10 +433,10 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -445,7 +457,7 @@ msgstr "" msgid "Already running" msgstr "Läuft bereits" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "Sucht bereits nach wifi Netzwerken" @@ -498,6 +510,10 @@ msgstr "Versuche %d Blöcke zu allokieren" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -518,7 +534,7 @@ msgstr "" "Automatisches Neuladen ist aktiv. Speichere Dateien über USB um sie " "auszuführen oder verbinde dich mit der REPL zum Deaktivieren.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "Baudrate wird von der Peripherie nicht unterstützt" @@ -615,10 +631,10 @@ msgstr "Der Puffer muss eine Mindestenslänge von 1 haben" msgid "Buffer too short by %d bytes" msgstr "Puffer um %d Bytes zu kurz" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "Bus pin %d wird schon benutzt" @@ -635,7 +651,7 @@ msgstr "Ein Bytes kann nur Werte zwischen 0 und 255 annehmen." msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC-Blöcke müssen ein Vielfaches von 16 Bytes sein" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC oder Checksumme ungültig" @@ -643,15 +659,15 @@ 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -694,7 +710,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "Kann nicht beite Kanäle auf dem gleichen Pin ausgeben" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Kann nicht 'pull' an einem 'input-only' pin." @@ -716,7 +732,7 @@ msgstr "" msgid "Cannot reset into bootloader because no bootloader is present." msgstr "Reset zum bootloader nicht möglich da bootloader nicht vorhanden." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "Socket Optionen können nicht gesetzt werden" @@ -724,7 +740,7 @@ msgstr "Socket Optionen können nicht gesetzt werden" msgid "Cannot set value when direction is input." msgstr "Der Wert kann nicht gesetzt werden, wenn die Richtung input ist." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "RTS oder CTS können im RS485-Modus nicht angegeben werden" @@ -742,7 +758,7 @@ msgid "Cannot vary frequency on a timer that is already in use" msgstr "" "Die Frequenz eines bereits verwendeten Timers kann nicht variiert werden" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "Kann nicht auf Flanke wecken, nur auf Level." @@ -780,7 +796,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "Spalteneintrag muss digitalio.DigitalInOut sein" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -809,7 +825,7 @@ 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/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Konnte UART nicht initialisieren" @@ -825,7 +841,7 @@ msgstr "Timer konnte nicht neu gestartet werden" msgid "Could not restart PWM" msgstr "PWM konnte nicht neu gestartet werden" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Clock konnte nicht ermittelt werden" @@ -875,12 +891,12 @@ msgstr "DAC Device Initialisierungs-Fehler" msgid "DAC already in use" msgstr "DAC wird schon benutzt" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "Data 0 pin muss am Byte ausgerichtet sein" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "Data 0 Pin muss Byte aligned sein." @@ -931,7 +947,8 @@ msgstr "Drive mode wird nicht verwendet, wenn die Richtung input ist." msgid "ECB only operates on 16 bytes at a time" msgstr "Die EZB arbeitet jeweils nur mit 16 Bytes" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF Speicherallozierung fehlgeschlagen" @@ -1011,7 +1028,7 @@ msgstr "FFT ist nur für ndarrays definiert" msgid "FFT is implemented for linear arrays only" msgstr "FFT ist nur für lineare Arrays implementiert" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "SSL Handshake fehlgeschlagen" @@ -1032,7 +1049,7 @@ 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/esp32s2/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 @@ -1040,11 +1057,11 @@ msgstr "Konnte keinen RX Buffer allozieren" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Konnte keine RX Buffer mit %d allozieren" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Zuweisung des Wifi Speichers ist fehlgeschlagen" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "Zuweisung des Wifi Scan Speichers ist fehlgeschlagen" @@ -1060,7 +1077,7 @@ msgstr "Verbindung fehlgeschlagen: interner Fehler" msgid "Failed to connect: timeout" msgstr "Verbindung nicht erfolgreich: timeout" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "Wifi Initialisierung ist fehlgeschlagen" @@ -1086,12 +1103,12 @@ msgid "File exists" msgstr "Datei existiert" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filter zu komplex" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "Firmware Image ist ungültig" @@ -1115,7 +1132,7 @@ msgstr "" msgid "Function requires lock" msgstr "Die Funktion erwartet, dass der 'lock'-Befehl zuvor ausgeführt wurde" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Generischer Fehler" @@ -1188,7 +1205,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Initialisierung aufgrund von Speichermangel fehlgeschlagen" @@ -1201,15 +1218,10 @@ msgstr "Input buffer länge (%d) muss ein vielfaches vom Strand Count (%d) sein" msgid "Input taking too long" msgstr "Input benötigt zu lange" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Eingabe-/Ausgabefehler" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1238,6 +1250,10 @@ msgstr "Unzureichende Authentifizierung" msgid "Insufficient encryption" msgstr "Unzureichende Verschlüsselung" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "Interner Definitionsfehler" @@ -1247,7 +1263,7 @@ msgstr "Interner Definitionsfehler" msgid "Internal error #%d" msgstr "Interner Fehler #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "Ungültiger %q" @@ -1268,7 +1284,7 @@ msgstr "Ungültige %q Pin-Auswahl" msgid "Invalid ADC Unit value" msgstr "Ungültiger ADC-Einheitenwert" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "Ungültiges AuthMode" @@ -1284,7 +1300,7 @@ msgstr "Ungültige BMP-Datei" msgid "Invalid BSSID" msgstr "Ungültige BSSID" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: 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" @@ -1295,18 +1311,18 @@ msgstr "Ungültige MIDI Datei" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "Ungültiger Pin" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Ungültiges Argument" @@ -1325,7 +1341,7 @@ msgid "Invalid byteorder string" msgstr "Ungültige Byteorder String" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/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" @@ -1355,7 +1371,7 @@ msgstr "Ungültige Datei" msgid "Invalid format chunk size" msgstr "Ungültige format chunk size" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "Ungültige Frequenz" @@ -1374,8 +1390,8 @@ msgstr "Ungültige Phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1395,13 +1411,16 @@ msgstr "Ungültiger Pin für rechten Kanal" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Ungültige Pins" @@ -1422,15 +1441,15 @@ msgstr "Ungültiger Ausführungsmodus." msgid "Invalid security_mode" msgstr "Ungültiger security_mode" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Ungültige Größe" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "Ungültiges Socket für TLS" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Ungültiger Zustand" @@ -1467,7 +1486,7 @@ 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." -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC Adresse war ungültig" @@ -1527,6 +1546,16 @@ msgstr "Fehlender first_out_pin. Instruktion %d schreibt Pin(s)" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "Fehlender first_set_pin. Instruktion %d setzt Pin(s)" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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 "Muss eine %q Unterklasse sein." @@ -1544,7 +1573,7 @@ msgstr "Muss ein Vielfaches von 6 RGB-Pins verwenden, nicht %d" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "NVS Fehler" @@ -1577,25 +1606,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "Kein MISO Pin" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Kein MOSI Pin" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Kein RX Pin" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1659,7 +1688,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1723,11 +1753,11 @@ msgstr "Eine ungerade Parität wird nicht unterstützt" msgid "Only 8 or 16 bit mono with " msgstr "Nur 8 oder 16 bit mono mit " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1760,11 +1790,11 @@ msgstr "" "Nur monochrome, indizierte 4bpp oder 8bpp, und 16bpp oder größere BMPs " "unterstützt: %d bpp wurden gegeben" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1775,19 +1805,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "" @@ -1826,12 +1856,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "ParallelBus wird noch nicht unterstützt" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1853,7 +1878,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1907,21 +1932,6 @@ msgstr "und alle Module im Dateisystem \n" msgid "Polygon needs at least 3 points" msgstr "Polygone brauchen mindestens 3 Punkte" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Der Präfixbuffer muss sich auf dem Heap befinden" @@ -1954,7 +1964,7 @@ msgstr "" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Program too large" -msgstr "" +msgstr "Das Programm ist zu groß" #: shared-bindings/digitalio/DigitalInOut.c msgid "Pull not used when direction is output." @@ -1976,12 +1986,12 @@ msgstr "RNG Init Fehler" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: 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/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2013,7 +2023,7 @@ msgstr "Schreibgeschützte Dateisystem" msgid "Read-only object" msgstr "Schreibgeschützte Objekt" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2029,7 +2039,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "Der angeforderte AES-Modus wird nicht unterstützt" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2067,7 +2077,7 @@ msgstr "SPI-Init-Fehler" msgid "SPI Re-initialization error" msgstr "SPI-Neuinitialisierungsfehler" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2110,7 +2120,6 @@ msgid "Size not supported" msgstr "" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2125,7 +2134,7 @@ msgstr "Slice und Wert (value) haben unterschiedliche Längen." msgid "Slices not supported" msgstr "Slices werden nicht unterstützt" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2325,7 +2334,7 @@ msgstr "Der UUID-Wert ist kein str-, int- oder Byte-Puffer" msgid "Unable to allocate buffers for signed conversion" msgstr "Konnte keine Buffer für Vorzeichenumwandlung allozieren" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2359,7 +2368,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "Unerwarteter nrfx uuid-Typ" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2404,7 +2413,7 @@ msgstr "" "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/esp32s2/common-hal/busio/UART.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" @@ -2425,7 +2434,7 @@ msgstr "Nicht unterstützte Operation" msgid "Unsupported pull value." msgstr "Nicht unterstützter Pull-Wert." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2439,7 +2448,7 @@ msgstr "Wert Länge != Erforderliche feste Länge" msgid "Value length > max_length" msgstr "Länge des Wertes > max_length" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2573,7 +2582,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "Anzahl/Typen der Argumente passen nicht" @@ -2618,6 +2627,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "schlechter Kompilierungsmodus" @@ -2688,7 +2701,7 @@ msgid "byteorder is not a string" msgstr "Byteorder ist kein String" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -3149,6 +3162,10 @@ msgstr "f-string: einzelne '}' nicht erlaubt" msgid "file must be a file opened in byte mode" msgstr "Die Datei muss eine im Byte-Modus geöffnete Datei sein" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "Das Dateisystem muss eine Mount-Methode bereitstellen" @@ -3312,7 +3329,7 @@ msgid "index is out of bounds" msgstr "Index ist außerhalb der Grenzen" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index außerhalb der Reichweite" @@ -3438,6 +3455,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "ungültiges Format" @@ -3475,6 +3496,10 @@ msgstr "ungültige Syntax für integer mit Basis %d" msgid "invalid syntax for number" msgstr "ungültige Syntax für number" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 muss eine Klasse sein" @@ -3541,7 +3566,7 @@ msgstr "" msgid "long int not supported in this build" msgstr "long int wird in diesem Build nicht unterstützt" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3677,10 +3702,6 @@ msgstr "" msgid "no active exception to reraise" msgstr "Keine aktive Ausnahme zu verusachen (raise)" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "kein verfügbares Netzwerkadapter (NIC)" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "Kein Binding für nonlocal gefunden" @@ -3698,7 +3719,7 @@ msgid "no module named '%q'" msgstr "Kein Modul mit dem Namen '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "kein Reset Pin verfügbar" @@ -3940,7 +3961,7 @@ msgstr "pixel_shader muss displayio.Palette oder displayio.ColorConverter sein" msgid "polygon can only be registered in one parent" msgstr "Polygon kann nur in einem übergeordneten Element registriert werden" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop von einem leeren PulseIn" @@ -3963,31 +3984,42 @@ msgstr "pow() drittes Argument darf nicht 0 sein" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "pow () mit 3 Argumenten erfordert Integer" +msgstr "pow() mit 3 Argumenten erfordert Integer" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4179,7 +4211,7 @@ msgstr "stop muss 1 oder 2 sein" msgid "stop not reachable from start" msgstr "stop ist von start aus nicht erreichbar" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "stream operation ist nicht unterstützt" @@ -4232,7 +4264,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() nimmt eine 9-Sequenz an" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4299,18 +4331,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "tupel/list hat falsche Länge" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx und rx können nicht beide None sein" @@ -4393,7 +4425,7 @@ msgid "unreadable attribute" msgstr "nicht lesbares Attribut" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "Nicht unterstützter %q-Typ" @@ -4429,11 +4461,15 @@ msgstr "nicht unterstützte Typen für %q: '%q', '%q'" msgid "value must fit in %d byte(s)" msgstr "Wert muss in %d Byte(s) passen" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "value_count muss größer als 0 sein" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4450,7 +4486,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4486,7 +4522,7 @@ msgstr "Falscher Ausgabetyp" msgid "x value out of bounds" msgstr "x Wert außerhalb der Grenzen" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" @@ -4514,6 +4550,21 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "ParallelBus not yet supported" +#~ msgstr "ParallelBus wird noch nicht unterstützt" + +#~ msgid "%q must be 0-255" +#~ msgstr "%q muss 0-255 sein" + +#~ msgid "%q must be 1-255" +#~ msgstr "%q muss 1-255 sein" + +#~ msgid "%q must be None or between 1 and len(report_descriptor)-1" +#~ msgstr "%q muss None oder zwischen 1 und len(report_descriptor)-1 sein" + +#~ msgid "no available NIC" +#~ msgstr "kein verfügbares Netzwerkadapter (NIC)" + #~ msgid "Instruction %d jumps on pin" #~ msgstr "Instruktion %d springt auf Pin" diff --git a/locale/el.po b/locale/el.po index ecc4baef85..6aaa11245b 100644 --- a/locale/el.po +++ b/locale/el.po @@ -66,6 +66,14 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "" @@ -88,7 +96,11 @@ msgid "%q indices must be integers, not %s" msgstr "" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -103,14 +115,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -127,10 +131,6 @@ msgstr "" msgid "%q must be >= 1" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -139,7 +139,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -168,7 +169,11 @@ msgstr "" msgid "%q() takes %d positional arguments but %d were given" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -185,7 +190,7 @@ msgstr "" msgid "'%q' object is not an iterator" msgstr "" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "" @@ -318,6 +323,10 @@ 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 "" @@ -343,7 +352,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "" @@ -356,35 +365,38 @@ msgstr "" msgid "Address type out of range" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "" +#: 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 "" @@ -412,10 +424,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -436,7 +448,7 @@ msgstr "" msgid "Already running" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "" @@ -489,6 +501,10 @@ msgstr "" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -507,7 +523,7 @@ msgid "" "disable.\n" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "" @@ -604,10 +620,10 @@ msgstr "" msgid "Buffer too short by %d bytes" msgstr "" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "" @@ -624,7 +640,7 @@ msgstr "" msgid "CBC blocks must be multiples of 16 bytes" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -632,15 +648,15 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -682,7 +698,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -704,7 +720,7 @@ msgstr "" msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -712,7 +728,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -729,7 +745,7 @@ msgstr "" msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -767,7 +783,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "Command must be an int between 0 and 255" msgstr "" @@ -794,7 +810,7 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -810,7 +826,7 @@ msgstr "" msgid "Could not restart PWM" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -860,12 +876,12 @@ msgstr "" msgid "DAC already in use" msgstr "" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -916,7 +932,8 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -995,7 +1012,7 @@ msgstr "" msgid "FFT is implemented for linear arrays only" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "" @@ -1016,7 +1033,7 @@ 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/esp32s2/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 @@ -1024,11 +1041,11 @@ msgstr "" msgid "Failed to allocate RX buffer of %d bytes" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "" @@ -1044,7 +1061,7 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "" @@ -1070,12 +1087,12 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "" @@ -1097,7 +1114,7 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1168,7 +1185,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1181,15 +1198,10 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1218,6 +1230,10 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "" @@ -1227,7 +1243,7 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "" @@ -1248,7 +1264,7 @@ msgstr "" msgid "Invalid ADC Unit value" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1264,7 +1280,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1275,18 +1291,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -1305,7 +1321,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1335,7 +1351,7 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "" @@ -1354,8 +1370,8 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1375,13 +1391,16 @@ msgstr "" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "" @@ -1402,15 +1421,15 @@ msgstr "" msgid "Invalid security_mode" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" @@ -1447,7 +1466,7 @@ msgstr "" msgid "Layer must be a Group or TileGrid subclass." msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1506,6 +1525,16 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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 "" @@ -1523,7 +1552,7 @@ msgstr "" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1556,25 +1585,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1638,7 +1667,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1700,11 +1730,11 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1733,11 +1763,11 @@ msgid "" "%d bpp given" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1748,19 +1778,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "" @@ -1799,12 +1829,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1826,7 +1851,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1877,21 +1902,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1944,12 +1954,12 @@ msgstr "" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -1981,7 +1991,7 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -1997,7 +2007,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2035,7 +2045,7 @@ msgstr "" msgid "SPI Re-initialization error" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2078,7 +2088,6 @@ msgid "Size not supported" msgstr "" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2093,7 +2102,7 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2290,7 +2299,7 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2324,7 +2333,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2365,7 +2374,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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 "" @@ -2386,7 +2395,7 @@ msgstr "" msgid "Unsupported pull value." msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2400,7 +2409,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2525,7 +2534,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "" @@ -2570,6 +2579,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -2640,7 +2653,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -3089,6 +3102,10 @@ msgstr "" msgid "file must be a file opened in byte mode" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "" @@ -3250,7 +3267,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3376,6 +3393,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "" @@ -3413,6 +3434,10 @@ msgstr "" msgid "invalid syntax for number" msgstr "" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" @@ -3473,7 +3498,7 @@ msgstr "" msgid "long int not supported in this build" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3609,10 +3634,6 @@ msgstr "" msgid "no active exception to reraise" msgstr "" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "" @@ -3630,7 +3651,7 @@ msgid "no module named '%q'" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "" @@ -3868,7 +3889,7 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -3893,29 +3914,40 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4105,7 +4137,7 @@ msgstr "" msgid "stop not reachable from start" msgstr "" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "" @@ -4157,7 +4189,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4224,18 +4256,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" @@ -4314,7 +4346,7 @@ msgid "unreadable attribute" msgstr "" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" @@ -4350,11 +4382,15 @@ msgstr "" msgid "value must fit in %d byte(s)" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4371,7 +4407,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4407,7 +4443,7 @@ msgstr "" msgid "x value out of bounds" msgstr "" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" diff --git a/locale/en_GB.po b/locale/en_GB.po index 0ca8c4518a..ffb4a4383c 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-04-11 01:30+0000\n" -"Last-Translator: Hugo Dahl \n" +"PO-Revision-Date: 2021-09-02 10:32+0000\n" +"Last-Translator: James Carr \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.6-dev\n" +"X-Generator: Weblate 4.8.1-dev\n" #: main.c msgid "" @@ -56,8 +56,9 @@ msgid " is of type %q\n" msgstr " is of type %q\n" #: main.c +#, fuzzy msgid " not found.\n" -msgstr "" +msgstr " not found.\n" #: main.c msgid " output:\n" @@ -75,6 +76,16 @@ msgid "" msgstr "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" +#: shared-bindings/microcontroller/Pin.c +#, fuzzy +msgid "%q and %q contain duplicate pins" +msgstr "%q and %q contain duplicate pins" + +#: shared-bindings/microcontroller/Pin.c +#, fuzzy +msgid "%q contains duplicate pins" +msgstr "%q contains duplicate pins" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "%q failure: %d" @@ -93,36 +104,38 @@ msgid "%q index out of range" msgstr "%q index out of range" #: py/obj.c +#, fuzzy msgid "%q indices must be integers, not %s" -msgstr "" +msgstr "%q indices must be integers, not %s" #: py/argcheck.c -msgid "%q length must be %q" -msgstr "" +#, fuzzy +msgid "%q length must be %d-%d" +msgstr "%q length must be %d-%d" + +#: shared-bindings/usb_hid/Device.c +#, fuzzy +msgid "%q length must be >= 1" +msgstr "%q length must be >= 1" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" msgstr "%q list must be a list" #: py/argcheck.c +#, fuzzy msgid "%q must <= %d" -msgstr "" +msgstr "%q must <= %d" #: py/argcheck.c +#, fuzzy msgid "%q must be %d-%d" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" +msgstr "%q must be %d-%d" #: py/argcheck.c +#, fuzzy msgid "%q must be >= %d" -msgstr "" +msgstr "%q must be >= %d" #: py/argcheck.c shared-bindings/memorymonitor/AllocationAlarm.c msgid "%q must be >= 0" @@ -136,29 +149,30 @@ msgstr "%q must be >= 0" msgid "%q must be >= 1" msgstr "%q must be >= 1" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c +#, fuzzy msgid "%q must be a string" -msgstr "" +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/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c +#, fuzzy msgid "%q must be between %d and %d" -msgstr "" +msgstr "%q must be between %d and %d" #: ports/atmel-samd/common-hal/busio/UART.c +#, fuzzy msgid "%q must be power of 2" -msgstr "" +msgstr "%q must be power of 2" #: py/argcheck.c +#, fuzzy msgid "%q must of type %q" -msgstr "" +msgstr "%q must of type %q" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c @@ -177,7 +191,12 @@ msgstr "%q should be an int" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() takes %d positional arguments but %d were given" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +#, fuzzy +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 #, c-format msgid "%s error 0x%x" msgstr "%s error 0x%x" @@ -194,7 +213,7 @@ msgstr "'%q' object does not support '%q'" msgid "'%q' object is not an iterator" msgstr "'%q' object is not an iterator" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "'%q' object is not callable" @@ -243,33 +262,34 @@ msgid "'%s' expects {r0, r1, ...}" msgstr "'%s' expects {r0, r1, ...}" #: py/emitinlinextensa.c -#, c-format +#, fuzzy, c-format msgid "'%s' integer %d isn't within range %d..%d" -msgstr "" +msgstr "'%s' integer %d isn't within range %d..%d" #: py/emitinlinethumb.c -#, c-format +#, fuzzy, c-format msgid "'%s' integer 0x%x doesn't fit in mask 0x%x" -msgstr "" +msgstr "'%s' integer 0x%x doesn't fit in mask 0x%x" #: py/obj.c -#, c-format +#, fuzzy, c-format msgid "'%s' object doesn't support item assignment" -msgstr "" +msgstr "'%s' object doesn't support item assignment" #: py/obj.c -#, c-format +#, fuzzy, c-format msgid "'%s' object doesn't support item deletion" -msgstr "" +msgstr "'%s' object doesn't support item deletion" #: py/runtime.c +#, fuzzy msgid "'%s' object has no attribute '%q'" -msgstr "" +msgstr "'%s' object has no attribute '%q'" #: py/obj.c -#, c-format +#, fuzzy, c-format msgid "'%s' object isn't subscriptable" -msgstr "" +msgstr "'%s' object isn't subscriptable" #: py/objstr.c msgid "'=' alignment not allowed in string format specifier" @@ -327,6 +347,11 @@ msgstr "'yield from' inside async function" msgid "'yield' outside function" msgstr "'yield' outside function" +#: shared-module/vectorio/VectorShape.c +#, fuzzy +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" @@ -352,7 +377,7 @@ msgstr "64 bit types" msgid "A hardware interrupt channel is already in use" msgstr "A hardware interrupt channel is already in use" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "ADC2 is being used by WiFi" @@ -365,35 +390,38 @@ msgstr "Address must be %d bytes long" msgid "Address type out of range" msgstr "Address type out of range" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "All CAN peripherals are in use" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "All I2C peripherals are in use" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "All PCNT units in use" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "All RX FIFOs in use" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "All SPI peripherals are in use" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "All UART peripherals are in use" +#: 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 "All channels in use" @@ -421,10 +449,10 @@ msgstr "All timers for this pin are in use" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -445,7 +473,7 @@ msgstr "Already have all-matches listener" msgid "Already running" msgstr "Already running" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "Already scanning for WiFi networks" @@ -469,8 +497,9 @@ msgid "AnalogOut not supported on given pin" msgstr "AnalogOut not supported on given pin" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c +#, fuzzy msgid "Another PWMAudioOut is already active" -msgstr "" +msgstr "Another PWMAudioOut is already active" #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c @@ -495,12 +524,19 @@ msgid "Attempt to allocate %d blocks" msgstr "Attempt to allocate %d blocks" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "Attempted heap allocation when VM not running." -msgstr "" +msgstr "Attempted heap allocation when VM not running." + +#: ports/raspberrypi/audio_dma.c +#, fuzzy +msgid "Audio conversion not implemented" +msgstr "Audio conversion not implemented" #: shared-bindings/wifi/Radio.c +#, fuzzy msgid "AuthMode.OPEN is not used with password" -msgstr "" +msgstr "AuthMode.OPEN is not used with password" #: shared-bindings/wifi/Radio.c msgid "Authentication failure" @@ -518,7 +554,7 @@ msgstr "" "Auto-reload is on. Simply save files over USB to run them or enter REPL to " "disable.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "Baudrate not supported by peripheral" @@ -615,10 +651,10 @@ msgstr "Buffer must be at least length 1" msgid "Buffer too short by %d bytes" msgstr "Buffer too short by %d bytes" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "Bus pin %d is already in use" @@ -635,7 +671,7 @@ msgstr "Bytes must be between 0 and 255." msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC blocks must be multiples of 16 bytes" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC or checksum was invalid" @@ -643,15 +679,15 @@ msgstr "CRC or checksum was invalid" msgid "Call super().__init__() before accessing native object." msgstr "Call super().__init__() before accessing native object." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "Can only alarm on one low pin while others alarm high from deep sleep." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "Can only alarm on two low pins from deep sleep." @@ -661,8 +697,9 @@ msgstr "Can't set CCCD on local Characteristic" #: shared-bindings/storage/__init__.c shared-bindings/usb_cdc/__init__.c #: shared-bindings/usb_hid/__init__.c shared-bindings/usb_midi/__init__.c +#, fuzzy msgid "Cannot change USB devices now" -msgstr "" +msgstr "Cannot change USB devices now" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" @@ -693,7 +730,7 @@ msgstr "Cannot have scan responses for extended, connectable advertisements." msgid "Cannot output both channels on the same pin" msgstr "Cannot output both channels on the same pin" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "Cannot pull on input-only pin." @@ -706,8 +743,9 @@ msgid "Cannot record to a file" msgstr "Cannot record to a file" #: shared-module/storage/__init__.c +#, fuzzy msgid "Cannot remount '/' when visible via USB." -msgstr "" +msgstr "Cannot remount '/' when visible via USB." #: ports/atmel-samd/common-hal/microcontroller/__init__.c #: ports/cxd56/common-hal/microcontroller/__init__.c @@ -715,7 +753,7 @@ msgstr "" msgid "Cannot reset into bootloader because no bootloader is present." msgstr "Cannot reset into bootloader because no bootloader is present." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "Cannot set socket options" @@ -723,7 +761,7 @@ msgstr "Cannot set socket options" msgid "Cannot set value when direction is input." msgstr "Cannot set value when direction is input." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Cannot specify RTS or CTS in RS485 mode" @@ -740,7 +778,7 @@ msgstr "Cannot transfer without MOSI and MISO pins." 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "Cannot wake on pin edge. Only level." @@ -778,7 +816,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "Column entry must be digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -807,7 +845,7 @@ 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/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Could not initialise UART" @@ -823,7 +861,7 @@ msgstr "Could not reinit timer" msgid "Could not restart PWM" msgstr "Could not restart PWM" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Could not retrieve clock" @@ -873,12 +911,12 @@ msgstr "DAC device init error" msgid "DAC already in use" msgstr "DAC already in use" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "Data 0 pin must be byte aligned" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "Data 0 pin must be byte aligned." @@ -887,16 +925,18 @@ msgid "Data chunk must follow fmt chunk" msgstr "Data chunk must follow fmt chunk" #: ports/nrf/common-hal/_bleio/Adapter.c +#, fuzzy msgid "Data not supported with directed advertising" -msgstr "" +msgstr "Data not supported with directed advertising" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Data too large for advertisement packet" msgstr "Data too large for advertisement packet" #: ports/stm/common-hal/alarm/pin/PinAlarm.c +#, fuzzy msgid "Deep sleep pins must use a rising edge with pulldown" -msgstr "" +msgstr "Deep sleep pins must use a rising edge with pulldown" #: shared-bindings/audiobusio/PDMIn.c msgid "Destination capacity is smaller than destination_length." @@ -929,7 +969,8 @@ msgstr "Drive mode not used when direction is input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB only operates on 16 bytes at a time" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF memory allocation failed" @@ -941,9 +982,9 @@ msgid "EXTINT channel already in use" msgstr "EXTINT channel already in use" #: shared-module/synthio/MidiTrack.c -#, c-format +#, fuzzy, c-format msgid "Error in MIDI stream at position %d" -msgstr "" +msgstr "Error in MIDI stream at position %d" #: extmod/modure.c msgid "Error in regex" @@ -1008,7 +1049,7 @@ msgstr "FFT is defined for ndarrays only" msgid "FFT is implemented for linear arrays only" msgstr "FFT is implemented for linear arrays only" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "Failed SSL handshake" @@ -1029,7 +1070,7 @@ 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/esp32s2/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 @@ -1037,17 +1078,18 @@ msgstr "Failed to allocate RX buffer" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Failed to allocate RX buffer of %d bytes" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Failed to allocate WiFi memory" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "Failed to allocate WiFi scan memory" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c +#, fuzzy msgid "Failed to buffer the sample" -msgstr "" +msgstr "Failed to buffer the sample" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Failed to connect: internal error" @@ -1057,7 +1099,7 @@ msgstr "Failed to connect: internal error" msgid "Failed to connect: timeout" msgstr "Failed to connect: timeout" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "Failed to init WiFi" @@ -1075,20 +1117,21 @@ msgid "Failed to write internal flash." msgstr "Failed to write internal flash." #: supervisor/shared/safe_mode.c +#, fuzzy msgid "Fatal error." -msgstr "" +msgstr "Fatal error." #: py/moduerrno.c msgid "File exists" msgstr "File exists" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filters too complex" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "Firmware image is invalid" @@ -1110,7 +1153,7 @@ msgstr "Frequency must match existing PWMOut using this timer" msgid "Function requires lock" msgstr "Function requires lock" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Generic Failure" @@ -1183,7 +1226,7 @@ msgstr "Initial set pin direction conflicts with initial out pin direction" msgid "Initial set pin state conflicts with initial out pin state" msgstr "Initial set pin state conflicts with initial out pin state" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Initialisation failed due to lack of memory" @@ -1196,15 +1239,10 @@ msgstr "Input buffer length (%d) must be a multiple of the strand count (%d)" msgid "Input taking too long" msgstr "Input taking too long" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Input/output error" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1233,6 +1271,11 @@ msgstr "Insufficient authentication" msgid "Insufficient encryption" msgstr "Insufficient encryption" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +#, fuzzy +msgid "Internal audio buffer too small" +msgstr "Internal audio buffer too small" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "Internal define error" @@ -1242,7 +1285,7 @@ msgstr "Internal define error" msgid "Internal error #%d" msgstr "Internal error #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "Invalid %q" @@ -1263,13 +1306,15 @@ msgstr "Invalid %q pin selection" msgid "Invalid ADC Unit value" msgstr "Invalid ADC unit value" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c +#, fuzzy msgid "Invalid AuthMode" -msgstr "" +msgstr "Invalid AuthMode" #: ports/nrf/common-hal/_bleio/__init__.c +#, fuzzy msgid "Invalid BLE parameter" -msgstr "" +msgstr "Invalid BLE parameter" #: shared-module/displayio/OnDiskBitmap.c msgid "Invalid BMP file" @@ -1279,29 +1324,30 @@ msgstr "Invalid BMP file" msgid "Invalid BSSID" msgstr "Invalid BSSID" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: 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/synthio/__init__.c +#, fuzzy msgid "Invalid MIDI file" -msgstr "" +msgstr "Invalid MIDI file" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "Invalid pin" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Invalid argument" @@ -1320,7 +1366,7 @@ msgid "Invalid byteorder string" msgstr "Invalid byteorder string" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/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" @@ -1329,14 +1375,14 @@ msgid "Invalid channel count" msgstr "Invalid channel count" #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format +#, fuzzy, c-format msgid "Invalid data_count %d" -msgstr "" +msgstr "Invalid data_count %d" #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format +#, fuzzy, c-format msgid "Invalid data_pins[%d]" -msgstr "" +msgstr "Invalid data_pins[%d]" #: shared-bindings/digitalio/DigitalInOut.c msgid "Invalid direction." @@ -1350,7 +1396,7 @@ msgstr "Invalid file" msgid "Invalid format chunk size" msgstr "Invalid format chunk size" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "Invalid frequency" @@ -1369,8 +1415,8 @@ msgstr "Invalid phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1390,13 +1436,16 @@ msgstr "Invalid pin for right channel" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Invalid pins" @@ -1417,15 +1466,15 @@ msgstr "Invalid run mode." msgid "Invalid security_mode" msgstr "Invalid security_mode" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Invalid size" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "Invalid socket for TLS" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Invalid state" @@ -1462,7 +1511,7 @@ msgstr "Layer already in a group." msgid "Layer must be a Group or TileGrid subclass." msgstr "Layer must be a Group or TileGrid subclass." -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC address was invalid" @@ -1521,6 +1570,16 @@ msgstr "Missing first_out_pin. Instruction %d writes pin(s)" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "Missing first_set_pin. Instruction %d sets pin(s)" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, fuzzy, c-format +msgid "Missing jmp_pin. Instruction %d jumps on pin" +msgstr "Missing jmp_pin. Instruction %d jumps on pin" + +#: shared-module/usb_hid/Device.c +#, fuzzy, 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." @@ -1535,10 +1594,11 @@ msgid "Must use a multiple of 6 rgb pins, not %d" msgstr "Must use a multiple of 6 rgb pins, not %d" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "NLR jump failed. Likely memory corruption." -msgstr "" +msgstr "NLR jump failed. Likely memory corruption." -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "NVS Error" @@ -1571,25 +1631,25 @@ msgstr "No DMA pacing timer found" msgid "No I2C device at address: %x" msgstr "No I2C device at address: %x" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "No MISO pin" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "No MOSI pin" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "No RX pin" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1641,9 +1701,9 @@ msgid "No long integer support" msgstr "No long integer support" #: shared-module/usb_hid/__init__.c -#, c-format +#, fuzzy, c-format msgid "No more than %d HID devices allowed" -msgstr "" +msgstr "No more than %d HID devices allowed" #: shared-bindings/wifi/Radio.c msgid "No network with that ssid" @@ -1653,7 +1713,8 @@ msgstr "No network with that ssid" msgid "No out in program" msgstr "No out in program" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1676,12 +1737,14 @@ msgid "No timer available" msgstr "No timer available" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "Nordic system firmware failure assertion." -msgstr "" +msgstr "Nordic system firmware failure assertion." #: ports/nrf/common-hal/_bleio/__init__.c +#, fuzzy msgid "Nordic system firmware out of memory" -msgstr "" +msgstr "Nordic system firmware out of memory" #: shared-bindings/ipaddress/IPv4Address.c shared-bindings/ipaddress/__init__.c msgid "Not a valid IP string" @@ -1716,11 +1779,11 @@ msgstr "Odd parity is not supported" msgid "Only 8 or 16 bit mono with " msgstr "Only 8 or 16 bit mono with " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Only IPv4 addresses supported" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "Only IPv4 sockets supported" @@ -1732,16 +1795,19 @@ msgstr "" "Only Windows format, uncompressed BMP supported: given header size is %d" #: shared-bindings/_bleio/Adapter.c +#, fuzzy msgid "Only connectable advertisements can be directed" -msgstr "" +msgstr "Only connectable advertisements can be directed" #: ports/stm/common-hal/alarm/pin/PinAlarm.c +#, fuzzy msgid "Only edge detection is available on this hardware" -msgstr "" +msgstr "Only edge detection is available on this hardware" #: shared-bindings/ipaddress/__init__.c +#, fuzzy msgid "Only int or string supported for ip" -msgstr "" +msgstr "Only int or string supported for ip" #: shared-module/displayio/OnDiskBitmap.c #, c-format @@ -1752,11 +1818,11 @@ msgstr "" "Only monochrome, indexed 4bpp or 8bpp, and 16bpp or greater BMPs supported: " "%d bpp given" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "Only one TouchAlarm can be set in deep sleep." -#: ports/esp32s2/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 @@ -1767,19 +1833,19 @@ 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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operation or feature not supported" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Operation timed out" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Out of memory" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "Out of sockets" @@ -1820,12 +1886,7 @@ msgstr "PWM slice already in use" msgid "PWM slice channel A already in use" msgstr "PWM slice channel A already in use" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "ParallelBus not yet supported" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "Peripheral in use" @@ -1834,8 +1895,9 @@ msgid "Permission denied" msgstr "Permission denied" #: ports/stm/common-hal/alarm/pin/PinAlarm.c +#, fuzzy msgid "Pin cannot wake from Deep Sleep" -msgstr "" +msgstr "Pin cannot wake from Deep Sleep" #: ports/raspberrypi/bindings/rp2pio/StateMachine.c msgid "Pin count must be at least 1" @@ -1847,7 +1909,7 @@ msgstr "Pin count too large" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1857,8 +1919,9 @@ msgstr "Pin does not have ADC capabilities" #: ports/stm/common-hal/alarm/pin/PinAlarm.c #: ports/stm/common-hal/pulseio/PulseIn.c +#, fuzzy msgid "Pin interrupt already in use" -msgstr "" +msgstr "Pin interrupt already in use" #: shared-bindings/adafruit_bus_device/SPIDevice.c #: shared-bindings/digitalio/DigitalInOut.c @@ -1901,25 +1964,6 @@ msgstr "Plus any modules on the filesystem\n" msgid "Polygon needs at least 3 points" msgstr "Polygon needs at least 3 points" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Prefix buffer must be on the heap" @@ -1972,12 +2016,12 @@ msgstr "RNG init Error" msgid "RS485 Not yet supported on this device" msgstr "RS485 not yet supported on this device" -#: ports/esp32s2/common-hal/busio/UART.c +#: 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/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2009,7 +2053,7 @@ msgstr "Read-only filesystem" msgid "Read-only object" msgstr "Read-only object" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Received response was invalid" @@ -2025,7 +2069,7 @@ msgstr "RemoteTransmissionRequests limited to 8 bytes" msgid "Requested AES mode is unsupported" msgstr "Requested AES mode is unsupported" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Requested resource not found" @@ -2038,8 +2082,9 @@ msgid "Row entry must be digitalio.DigitalInOut" msgstr "Row entry must be digitalio. DigitalInOut" #: main.c +#, fuzzy msgid "Running in safe mode! Not running saved code.\n" -msgstr "" +msgstr "Running in safe mode! Not running saved code.\n" #: shared-module/sdcardio/SDCard.c msgid "SD card CSD format not supported" @@ -2063,9 +2108,10 @@ msgstr "SPI init error" msgid "SPI Re-initialization error" msgstr "SPI reinitialisation error" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#, fuzzy msgid "SPI configuration failed" -msgstr "" +msgstr "SPI configuration failed" #: ports/raspberrypi/common-hal/busio/SPI.c msgid "SPI peripheral in use" @@ -2106,9 +2152,9 @@ msgid "Size not supported" msgstr "Size not supported" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c +#, fuzzy msgid "Sleep Memory not available" -msgstr "" +msgstr "Sleep Memory not available" #: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c msgid "Slice and value different lengths." @@ -2121,7 +2167,7 @@ msgstr "Slice and value different lengths." msgid "Slices not supported" msgstr "Slices not supported" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "SocketPool can only be used with wifi.radio" @@ -2166,27 +2212,37 @@ msgid "Temperature read timed out" msgstr "Temperature read timed out" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" "Increase the stack size if you know how. If not:" msgstr "" +"The CircuitPython heap was corrupted because the stack was too small.\n" +"Increase the stack size if you know how. If not:" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "" "The `microcontroller` module was used to boot into safe mode. Press reset to " "exit safe mode." msgstr "" +"The `microcontroller` module was used to boot into safe mode. Press reset to " +"exit safe mode." #: shared-bindings/rgbmatrix/RGBMatrix.c msgid "The length of rgb_pins must be 6, 12, 18, 24, or 30" msgstr "The length of rgb_pins must be 6, 12, 18, 24, or 30" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "" "The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY)." msgstr "" +"The microcontroller's power dipped. Make sure your power supply provides\n" +"enough power for the whole circuit and press reset (after ejecting " +"CIRCUITPY)." #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -2247,13 +2303,15 @@ msgid "Too many displays" msgstr "Too many displays" #: ports/nrf/common-hal/_bleio/PacketBuffer.c +#, fuzzy msgid "Total data to write is larger than %q" -msgstr "" +msgstr "Total data to write is larger than %q" #: ports/raspberrypi/common-hal/alarm/touch/TouchAlarm.c #: ports/stm/common-hal/alarm/touch/TouchAlarm.c +#, fuzzy msgid "Touch alarms not available" -msgstr "" +msgstr "Touch alarms not available" #: py/obj.c msgid "Traceback (most recent call last):\n" @@ -2284,20 +2342,24 @@ msgid "UART write error" msgstr "UART write error" #: shared-module/usb_hid/Device.c +#, fuzzy msgid "USB busy" -msgstr "" +msgstr "USB busy" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "USB devices need more endpoints than are available." -msgstr "" +msgstr "USB devices need more endpoints than are available." #: supervisor/shared/safe_mode.c +#, fuzzy msgid "USB devices specify too many interface names." -msgstr "" +msgstr "USB devices specify too many interface names." #: shared-module/usb_hid/Device.c +#, fuzzy msgid "USB error" -msgstr "" +msgstr "USB error" #: shared-bindings/_bleio/UUID.c msgid "UUID integer value must be 0-0xffff" @@ -2318,7 +2380,7 @@ msgstr "UUID value is not str, int or byte buffer" msgid "Unable to allocate buffers for signed conversion" msgstr "Unable to allocate buffers for signed conversion" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "Unable to create lock" @@ -2352,7 +2414,7 @@ msgstr "Unable to write to sleep_memory." msgid "Unexpected nrfx uuid type" msgstr "Unexpected nrfx uuid type" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "Unhandled ESP TLS error %d %d %x %d" @@ -2377,9 +2439,9 @@ msgid "Unknown security error: 0x%04x" msgstr "Unknown security error: 0x%04x" #: ports/nrf/common-hal/_bleio/__init__.c -#, c-format +#, fuzzy, c-format msgid "Unknown system firmware error: %04x" -msgstr "" +msgstr "Unknown system firmware error: %04x" #: shared-bindings/adafruit_pixelbuf/PixelBuf.c #, c-format @@ -2395,7 +2457,7 @@ msgstr "" "declined or ignored." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2416,7 +2478,7 @@ msgstr "Unsupported operation" msgid "Unsupported pull value." msgstr "Unsupported pull value." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update failed" @@ -2430,7 +2492,7 @@ msgstr "Value length != required fixed length" msgid "Value length > max_length" msgstr "Value length > max_length" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "Version was invalid" @@ -2491,13 +2553,16 @@ msgid "Writes not supported on Characteristic" msgstr "Writes not supported on Characteristic" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "You are in safe mode because:\n" -msgstr "" +msgstr "You are in safe mode because:\n" #: supervisor/shared/safe_mode.c +#, fuzzy msgid "" "You pressed the reset button during boot. Press again to exit safe mode." msgstr "" +"You pressed the reset button during boot. Press again to exit safe mode." #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2532,16 +2597,18 @@ msgid "addresses is empty" msgstr "addresses is empty" #: py/compile.c +#, fuzzy msgid "annotation must be an identifier" -msgstr "" +msgstr "annotation must be an identifier" #: py/modbuiltins.c msgid "arg is an empty sequence" msgstr "arg is an empty sequence" #: py/objobject.c +#, fuzzy msgid "arg must be user-type" -msgstr "" +msgstr "arg must be user-type" #: extmod/ulab/code/numpy/numerical.c msgid "argsort argument must be an ndarray" @@ -2556,11 +2623,12 @@ msgid "argument has wrong type" msgstr "argument has wrong type" #: py/compile.c +#, fuzzy msgid "argument name reused" -msgstr "" +msgstr "argument name reused" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "argument num/types mismatch" @@ -2605,6 +2673,11 @@ msgstr "axis must be None, or an integer" msgid "axis too long" msgstr "axis too long" +#: shared-bindings/bitmaptools/__init__.c +#, fuzzy +msgid "background value out of range of target" +msgstr "background value out of range of target" + #: py/builtinevex.c msgid "bad compile mode" msgstr "bad compile mode" @@ -2626,8 +2699,9 @@ msgid "binary op %q not implemented" msgstr "binary op %q not implemented" #: extmod/modurandom.c +#, fuzzy msgid "bits must be 32 or less" -msgstr "" +msgstr "bits must be 32 or less" #: shared-bindings/busio/UART.c msgid "bits must be in range 5 to 9" @@ -2675,7 +2749,7 @@ msgid "byteorder is not a string" msgstr "Byteorder is not a string" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "Bytes > 8 bits not supported" @@ -2716,8 +2790,9 @@ msgid "can't assign to expression" msgstr "Can't assign to expression" #: extmod/moduasyncio.c +#, fuzzy msgid "can't cancel self" -msgstr "" +msgstr "can't cancel self" #: py/obj.c py/objint.c shared-bindings/i2cperipheral/I2CPeripheral.c #: shared-module/adafruit_pixelbuf/PixelBuf.c @@ -2725,13 +2800,14 @@ msgid "can't convert %q to %q" msgstr "Can't convert %q to %q" #: py/runtime.c +#, fuzzy msgid "can't convert %q to int" -msgstr "" +msgstr "can't convert %q to int" #: py/obj.c -#, c-format +#, fuzzy, c-format msgid "can't convert %s to complex" -msgstr "" +msgstr "can't convert %s to complex" #: py/objstr.c msgid "can't convert '%q' object to %q implicitly" @@ -2742,12 +2818,14 @@ msgid "can't convert to %q" msgstr "Can't convert to %q" #: py/obj.c +#, fuzzy msgid "can't convert to complex" -msgstr "" +msgstr "can't convert to complex" #: py/runtime.c +#, fuzzy msgid "can't convert to int" -msgstr "" +msgstr "can't convert to int" #: py/objstr.c msgid "can't convert to str implicitly" @@ -2826,8 +2904,9 @@ msgstr "" "can't switch from manual field specification to automatic field numbering" #: extmod/ulab/code/ndarray.c +#, fuzzy msgid "cannot assign new shape" -msgstr "" +msgstr "cannot assign new shape" #: extmod/ulab/code/ndarray_operators.c msgid "cannot cast output with casting rule" @@ -2850,8 +2929,9 @@ msgid "cannot perform relative import" msgstr "can't perform relative import" #: extmod/moductypes.c +#, fuzzy msgid "cannot unambiguously get sizeof scalar" -msgstr "" +msgstr "cannot unambiguously get sizeof scalar" #: py/emitnative.c msgid "casting" @@ -2902,8 +2982,9 @@ msgid "color should be an int" msgstr "colour should be an int" #: py/emitnative.c +#, fuzzy msgid "comparison of int and uint" -msgstr "" +msgstr "comparison of int and uint" #: py/objcomplex.c msgid "complex division by zero" @@ -2958,9 +3039,9 @@ msgid "data must be of equal length" msgstr "cata must be of equal length" #: ports/atmel-samd/common-hal/imagecapture/ParallelImageCapture.c -#, c-format +#, fuzzy, c-format msgid "data pin #%d in use" -msgstr "" +msgstr "data pin #%d in use" #: extmod/ulab/code/ndarray.c msgid "data type not understood" @@ -3009,12 +3090,14 @@ msgid "dimensions do not match" msgstr "dimensions do not match" #: py/emitnative.c +#, fuzzy msgid "div/mod not implemented for uint" -msgstr "" +msgstr "div/mod not implemented for uint" #: py/objfloat.c py/objint_mpz.c +#, fuzzy msgid "divide by zero" -msgstr "" +msgstr "divide by zero" #: py/modmath.c py/objint_longlong.c py/runtime.c #: shared-bindings/math/__init__.c @@ -3127,6 +3210,11 @@ msgstr "f-string: single '}' is not allowed" msgid "file must be a file opened in byte mode" msgstr "file must be a file opened in byte mode" +#: shared-bindings/traceback/__init__.c +#, fuzzy +msgid "file write is not available" +msgstr "file write is not available" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "filesystem must provide mount method" @@ -3152,8 +3240,9 @@ msgid "first argument to super() must be type" msgstr "first argument to super() must be type" #: extmod/ulab/code/scipy/linalg/linalg.c +#, fuzzy msgid "first two arguments must be ndarrays" -msgstr "" +msgstr "first two arguments must be ndarrays" #: extmod/ulab/code/ndarray.c msgid "flattening order must be either 'C', or 'F'" @@ -3168,8 +3257,9 @@ msgid "float too big" msgstr "float too big" #: py/nativeglue.c +#, fuzzy msgid "float unsupported" -msgstr "" +msgstr "float unsupported" #: shared-bindings/_stage/Text.c msgid "font must be 2048 bytes long" @@ -3184,8 +3274,9 @@ msgid "full" msgstr "full" #: py/argcheck.c +#, fuzzy msgid "function doesn't take keyword arguments" -msgstr "" +msgstr "function doesn't take keyword arguments" #: py/argcheck.c #, c-format @@ -3240,16 +3331,18 @@ msgid "generator ignored GeneratorExit" msgstr "generator ignored GeneratorExit" #: py/objgenerator.c py/runtime.c +#, fuzzy msgid "generator raised StopIteration" -msgstr "" +msgstr "generator raised StopIteration" #: shared-bindings/_stage/Layer.c msgid "graphic must be 2048 bytes long" msgstr "graphic must be 2048 bytes long" #: extmod/moduhashlib.c +#, fuzzy msgid "hash is final" -msgstr "" +msgstr "hash is final" #: extmod/moduheapq.c msgid "heap must be a list" @@ -3264,12 +3357,14 @@ msgid "identifier redefined as nonlocal" msgstr "identifier redefined as nonlocal" #: py/compile.c +#, fuzzy msgid "import * not at module level" -msgstr "" +msgstr "import * not at module level" #: py/persistentcode.c +#, fuzzy msgid "incompatible native .mpy architecture" -msgstr "" +msgstr "incompatible native .mpy architecture" #: py/objstr.c msgid "incomplete format" @@ -3288,7 +3383,7 @@ msgid "index is out of bounds" msgstr "index is out of bounds" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index out of range" @@ -3383,8 +3478,9 @@ msgid "integer required" msgstr "integer required" #: extmod/ulab/code/numpy/approx.c +#, fuzzy msgid "interp is defined for 1D iterables of equal length" -msgstr "" +msgstr "interp is defined for 1D iterables of equal length" #: shared-bindings/_bleio/Adapter.c #, c-format @@ -3392,8 +3488,9 @@ msgid "interval must be in range %s-%s" msgstr "interval must be in range %s-%s" #: py/compile.c +#, fuzzy msgid "invalid architecture" -msgstr "" +msgstr "invalid architecture" #: lib/netutils/netutils.c msgid "invalid arguments" @@ -3414,6 +3511,11 @@ msgstr "invalid element size %d for bits_per_pixel %d\n" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "invalid element_size %d, must be, 1, 2, or 4" +#: shared-bindings/traceback/__init__.c +#, fuzzy +msgid "invalid exception" +msgstr "invalid exception" + #: extmod/modframebuf.c msgid "invalid format" msgstr "invalid format" @@ -3452,6 +3554,11 @@ msgstr "invalid syntax for integer with base %d" msgid "invalid syntax for number" msgstr "invalid syntax for number" +#: py/objexcept.c shared-bindings/traceback/__init__.c +#, fuzzy +msgid "invalid traceback" +msgstr "invalid traceback" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 must be a class" @@ -3512,7 +3619,7 @@ msgstr "local variable referenced before assignment" msgid "long int not supported in this build" msgstr "long int not supported in this build" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + silent mode not supported by peripheral" @@ -3576,8 +3683,9 @@ msgid "memoryview: length is not a multiple of itemsize" msgstr "memoryview: length is not a multiple of itemsize" #: extmod/ulab/code/numpy/linalg/linalg.c +#, fuzzy msgid "mode must be complete, or reduced" -msgstr "" +msgstr "mode must be complete, or reduced" #: py/builtinimport.c msgid "module not found" @@ -3616,8 +3724,9 @@ msgid "name not defined" msgstr "name not defined" #: py/asmthumb.c +#, fuzzy msgid "native method too big" -msgstr "" +msgstr "native method too big" #: py/emitnative.c msgid "native yield" @@ -3629,8 +3738,9 @@ msgid "need more than %d values to unpack" msgstr "need more than %d values to unpack" #: py/modmath.c +#, fuzzy msgid "negative factorial" -msgstr "" +msgstr "negative factorial" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" @@ -3648,10 +3758,6 @@ msgstr "no SD card" msgid "no active exception to reraise" msgstr "no active exception to reraise" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "no available NIC" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "no binding for nonlocal found" @@ -3669,7 +3775,7 @@ msgid "no module named '%q'" msgstr "no module named '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "no reset pin available" @@ -3682,8 +3788,9 @@ msgid "no such attribute" msgstr "no such attribute" #: shared-bindings/usb_hid/__init__.c +#, fuzzy msgid "non-Device in %q" -msgstr "" +msgstr "non-Device in %q" #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" @@ -3734,25 +3841,28 @@ msgid "object " msgstr "object " #: py/obj.c -#, c-format +#, fuzzy, c-format msgid "object '%s' isn't a tuple or list" -msgstr "" +msgstr "object '%s' isn't a tuple or list" #: py/obj.c +#, fuzzy msgid "object doesn't support item assignment" -msgstr "" +msgstr "object doesn't support item assignment" #: py/obj.c +#, fuzzy msgid "object doesn't support item deletion" -msgstr "" +msgstr "object doesn't support item deletion" #: py/obj.c msgid "object has no len" msgstr "object has no len" #: py/obj.c +#, fuzzy msgid "object isn't subscriptable" -msgstr "" +msgstr "object isn't subscriptable" #: py/runtime.c msgid "object not an iterator" @@ -3771,9 +3881,9 @@ msgid "object not iterable" msgstr "object not iterable" #: py/obj.c -#, c-format +#, fuzzy, c-format msgid "object of type '%s' has no len()" -msgstr "" +msgstr "object of type '%s' has no len()" #: py/obj.c msgid "object with buffer protocol required" @@ -3813,8 +3923,9 @@ msgid "only slices with step=1 (aka None) are supported" msgstr "only slices with step=1 (aka None) are supported" #: py/vm.c +#, fuzzy msgid "opcode" -msgstr "" +msgstr "opcode" #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/compare.c #: extmod/ulab/code/numpy/vector.c @@ -3822,12 +3933,14 @@ msgid "operands could not be broadcast together" msgstr "operands could not be broadcast together" #: extmod/ulab/code/numpy/linalg/linalg.c +#, fuzzy msgid "operation is defined for 2D arrays only" -msgstr "" +msgstr "operation is defined for 2D arrays only" #: extmod/ulab/code/numpy/linalg/linalg.c +#, fuzzy msgid "operation is defined for ndarrays only" -msgstr "" +msgstr "operation is defined for ndarrays only" #: extmod/ulab/code/ndarray.c msgid "operation is implemented for 1D Boolean arrays only" @@ -3851,12 +3964,14 @@ msgid "ord() expected a character, but string of length %d found" msgstr "ord() expected a character, but string of length %d found" #: extmod/ulab/code/utils/utils.c +#, fuzzy msgid "out array is too small" -msgstr "" +msgstr "out array is too small" #: extmod/ulab/code/utils/utils.c +#, fuzzy msgid "out must be a float dense array" -msgstr "" +msgstr "out must be a float dense array" #: shared-bindings/displayio/Bitmap.c msgid "out of range of source" @@ -3907,7 +4022,7 @@ msgstr "pixel_shader must be displayio.Palette or displayio.ColorConverter" msgid "polygon can only be registered in one parent" msgstr "polygon can only be registered in one parent" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop from an empty PulseIn" @@ -3932,29 +4047,40 @@ msgstr "pow() 3rd argument cannot be 0" msgid "pow() with 3 arguments requires integers" msgstr "pow() with 3 arguments requires integers" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "pressing boot button at start up.\n" @@ -3967,8 +4093,9 @@ msgid "pressing both buttons at start up.\n" msgstr "pressing both buttons at start up.\n" #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h +#, fuzzy msgid "pressing the left button at start up\n" -msgstr "" +msgstr "pressing the left button at start up\n" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" @@ -4047,16 +4174,18 @@ msgid "sampling rate out of range" msgstr "sampling rate out of range" #: py/modmicropython.c +#, fuzzy msgid "schedule queue full" -msgstr "" +msgstr "schedule queue full" #: lib/utils/pyexec.c py/builtinimport.c msgid "script compilation not supported" msgstr "script compilation not supported" #: py/nativeglue.c +#, fuzzy msgid "set unsupported" -msgstr "" +msgstr "set unsupported" #: extmod/ulab/code/ndarray.c msgid "shape must be a tuple" @@ -4095,8 +4224,9 @@ msgid "slice step cannot be zero" msgstr "slice step cannot be zero" #: py/nativeglue.c +#, fuzzy msgid "slice unsupported" -msgstr "" +msgstr "slice unsupported" #: py/objint.c py/sequence.c msgid "small int overflow" @@ -4146,7 +4276,7 @@ msgstr "stop must be 1 or 2" msgid "stop not reachable from start" msgstr "stop not reachable from start" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "stream operation not supported" @@ -4159,12 +4289,14 @@ msgid "string not supported; use bytes or bytearray" msgstr "string not supported; use bytes or bytearray" #: extmod/moductypes.c +#, fuzzy msgid "struct: can't index" -msgstr "" +msgstr "struct: can't index" #: extmod/moductypes.c +#, fuzzy msgid "struct: index out of range" -msgstr "" +msgstr "struct: index out of range" #: extmod/moductypes.c msgid "struct: no fields" @@ -4198,7 +4330,7 @@ msgstr "tile must be greater than zero" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() takes a 9-sequence" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4245,8 +4377,9 @@ msgid "too many indices" msgstr "too many indices" #: py/asmthumb.c +#, fuzzy msgid "too many locals for native method" -msgstr "" +msgstr "too many locals for native method" #: py/runtime.c #, c-format @@ -4258,25 +4391,26 @@ msgid "trapz is defined for 1D arrays of equal length" msgstr "trapz is defined for 1D arrays of equal length" #: extmod/ulab/code/numpy/approx.c +#, fuzzy msgid "trapz is defined for 1D iterables" -msgstr "" +msgstr "trapz is defined for 1D iterables" #: py/obj.c msgid "tuple/list has wrong length" msgstr "tuple/list has wrong length" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "twai_driver_install returned esp-idf error #%d" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "twai_start returned esp-idf error #%d" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx and rx cannot both be None" @@ -4355,7 +4489,7 @@ msgid "unreadable attribute" msgstr "unreadable attribute" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "unsupported %q type" @@ -4391,11 +4525,16 @@ msgstr "unsupported types for %q: '%q', '%q'" msgid "value must fit in %d byte(s)" msgstr "value must fit in %d byte(s)" +#: shared-bindings/bitmaptools/__init__.c +#, fuzzy +msgid "value out of range of target" +msgstr "value out of range of target" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "value_count must be > 0" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "WatchDog not initialised" @@ -4412,7 +4551,7 @@ msgstr "width must be from 2 to 8 (inclusive), not %d" msgid "width must be greater than zero" msgstr "width must be greater than zero" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "WiFi is not enabled" @@ -4448,7 +4587,7 @@ msgstr "wrong output type" msgid "x value out of bounds" msgstr "x value out of bounds" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "xTaskCreate failed" @@ -4476,6 +4615,40 @@ 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)" +#, fuzzy +#~ msgid "" +#~ "\n" +#~ "paste mode; Ctrl-C to cancel, Ctrl-D to finish\n" +#~ "=== " +#~ msgstr "" +#~ "\n" +#~ "paste mode; Ctrl-C to cancel, Ctrl-D to finish\n" +#~ "=== " + +#~ msgid "ParallelBus not yet supported" +#~ msgstr "ParallelBus not yet supported" + +#, fuzzy +#~ msgid "raw REPL; CTRL-B to exit\n" +#~ msgstr "raw REPL; CTRL-B to exit\n" + +#~ msgid "no available NIC" +#~ msgstr "no available NIC" + +#~ msgid "" +#~ "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +#~ "instead" +#~ msgstr "" +#~ "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +#~ "instead" + +#~ msgid "" +#~ "Port does not accept pins or frequency. Construct and pass a PWMOut " +#~ "Carrier instead" +#~ msgstr "" +#~ "Port does not accept pins or frequency. Construct and pass a PWMOut " +#~ "Carrier instead" + #~ msgid "Instruction %d jumps on pin" #~ msgstr "Instruction %d jumps on pin" diff --git a/locale/es.po b/locale/es.po index 8305b1dff5..381d2bcf57 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,15 +8,15 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2021-06-27 12:33+0000\n" -"Last-Translator: Alvaro Figueroa \n" +"PO-Revision-Date: 2021-08-23 14:19+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: \n" "Language: es\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.7.1-dev\n" +"X-Generator: Weblate 4.8.1-dev\n" #: main.c msgid "" @@ -77,6 +77,14 @@ msgstr "" "%d pines de dirección, %d pines rgb y %d tiles indican una altura de %d, y " "no de %d" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "%q fallo: %d" @@ -99,8 +107,12 @@ msgid "%q indices must be integers, not %s" msgstr "%q indices deben ser enteros, no %s" #: py/argcheck.c -msgid "%q length must be %q" -msgstr "el tamaño de %q debe ser %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" +msgstr "" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -114,14 +126,6 @@ msgstr "%q debe ser <= %d" msgid "%q must be %d-%d" msgstr "%q debe ser %d-%d" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "%q debe ser de 0-255" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "%q debe estar entre 1-255" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "%q debe ser >= %d" @@ -138,10 +142,6 @@ msgstr "%q debe ser >= 0" msgid "%q must be >= 1" msgstr "%q debe ser >= 1" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "%q debe ser None o entre 1 y len(report_descriptor)-1" - #: py/argcheck.c msgid "%q must be a string" msgstr "%q debe ser una cadena" @@ -150,7 +150,8 @@ msgstr "%q debe ser una cadena" msgid "%q must be a tuple of length 2" msgstr "%q debe ser una tupla de longitud 2" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: 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" @@ -179,7 +180,11 @@ msgstr "%q debe ser un int" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() toma %d argumentos posicionales pero %d fueron dados" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s error 0x%x" @@ -196,7 +201,7 @@ msgstr "objeto '%q' no tiene capacidad '%q'" msgid "'%q' object is not an iterator" msgstr "objeto '%q' no es un iterador" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "objeto '%q' no es llamable" @@ -329,6 +334,10 @@ 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" @@ -354,7 +363,7 @@ msgstr "tipos de 64 bit" msgid "A hardware interrupt channel is already in use" msgstr "El canal EXTINT ya está siendo utilizado" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "ADC2 está siendo usado por WiFi" @@ -367,35 +376,38 @@ msgstr "La dirección debe tener %d bytes de largo" msgid "Address type out of range" msgstr "Tipo de dirección fuera de rango" -#: ports/esp32s2/common-hal/canio/CAN.c +#: 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/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.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" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "Todas las unidades PCNT en uso" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "Todos los FIFOs de RX en uso" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Todos los periféricos SPI están siendo usados" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "Todos los periféricos UART están siendo usados" +#: 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 "Todos los canales esta en uso" @@ -425,10 +437,10 @@ msgstr "Todos los timers para este pin están siendo utilizados" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -449,7 +461,7 @@ msgstr "Ya se tiene un escucha de todas las coincidencias" msgid "Already running" msgstr "Ya está en ejecución" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "Ya se están buscando redes wifi" @@ -502,6 +514,10 @@ msgstr "Tratando de localizar %d bloques" msgid "Attempted heap allocation when VM not running." msgstr "Asignación del montículo mientras la VM no esta ejecutándose." +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN no se usa con contraseña" @@ -522,7 +538,7 @@ msgstr "" "Auto-reload habilitado. Simplemente guarda los archivos via USB para " "ejecutarlos o entra al REPL para desabilitarlos.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "El periférico no maneja el Baudrate" @@ -620,10 +636,10 @@ msgstr "Buffer debe ser de longitud 1 como minimo" msgid "Buffer too short by %d bytes" msgstr "Búffer muy corto por %d bytes" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "Bus pin %d ya está siendo utilizado" @@ -640,25 +656,25 @@ msgstr "Bytes debe estar entre 0 y 255." msgid "CBC blocks must be multiples of 16 bytes" msgstr "Los bloques CBC deben ser múltiplos de 16 bytes" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC o suma de comprobación inválida" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "Llame a super().__ init __() antes de acceder al objeto nativo." +msgstr "Llame a super().__init__() antes de acceder al objeto nativo." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" "Solo puede alertar en un pin low mientras los otros alertan en high viniendo " "de deep sleep." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "Solo puede alerta en dos low pines viniendo de deep sleep." @@ -702,7 +718,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "No se puede tener ambos canales en el mismo pin" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." @@ -724,7 +740,7 @@ msgstr "No se puede remountar '/' cuanto se es visible vía USB." msgid "Cannot reset into bootloader because no bootloader is present." msgstr "No se puede reiniciar a bootloader porque no hay bootloader presente." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "No se pueden definir opciones para enchufe" @@ -732,7 +748,7 @@ msgstr "No se pueden definir opciones para enchufe" msgid "Cannot set value when direction is input." msgstr "No se puede asignar un valor cuando la dirección es input." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "No se puede especificar RTS o CTS en modo RS485" @@ -749,7 +765,7 @@ msgstr "No se puede transmitir sin pines MOSI y MISO." 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "No puede despertar en pin edge, solo en nivel." @@ -787,7 +803,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "Entrada de columna debe ser digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -816,7 +832,7 @@ 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/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "No se puede inicializar la UART" @@ -832,7 +848,7 @@ msgstr "No se pudo reiniciar el temporizador" msgid "Could not restart PWM" msgstr "No se pudo reiniciar el PWM" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "No puedo traer el reloj" @@ -882,12 +898,12 @@ msgstr "Error de inicio del dispositivo DAC" msgid "DAC already in use" msgstr "DAC ya está siendo utilizado" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "El pin Data 0 debe estar alineado a bytes" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "El pin de datos 0 debe ser alineado a byte." @@ -939,7 +955,8 @@ msgstr "Modo Drive no se usa cuando la dirección es input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB solo opera sobre 16 bytes a la vez" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "Fallo ESP-IDF al tomar la memoria" @@ -1018,7 +1035,7 @@ msgstr "FFT se define solo para ndarrays" msgid "FFT is implemented for linear arrays only" msgstr "FFT solo esta implementado para arrays lineales" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "Fallo en saludo SSL" @@ -1039,7 +1056,7 @@ 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/esp32s2/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 @@ -1047,11 +1064,11 @@ msgstr "Ha fallado la asignación del buffer RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falló la asignación del buffer RX de %d bytes" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Fallo al tomar memoria Wifi" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "Fallo al tomar memoria para búsqueda wifi" @@ -1067,7 +1084,7 @@ msgstr "Error al conectar: error interno" msgid "Failed to connect: timeout" msgstr "Error al conectar: tiempo de espera agotado" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "Fallo al inicializar wifi" @@ -1093,12 +1110,12 @@ msgid "File exists" msgstr "El archivo ya existe" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filtros muy complejos" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "La imagen de firmware es inválida" @@ -1121,7 +1138,7 @@ msgstr "" msgid "Function requires lock" msgstr "La función requiere lock" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Fallo Genérico" @@ -1199,7 +1216,7 @@ msgstr "" "El estado inicial del pin de configuración esta en conflicto con el estado " "inicial de salida del pin" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Inicializacion fallida por falta de memoria" @@ -1214,15 +1231,10 @@ msgstr "" msgid "Input taking too long" msgstr "La entrada está durando mucho tiempo" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "error Input/output" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1251,6 +1263,10 @@ msgstr "Autenticación insuficiente" msgid "Insufficient encryption" msgstr "Cifrado insuficiente" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "Error interno de definición" @@ -1260,7 +1276,7 @@ msgstr "Error interno de definición" msgid "Internal error #%d" msgstr "Error interno #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "%q inválido" @@ -1281,7 +1297,7 @@ msgstr "selección inválida de pin %q" msgid "Invalid ADC Unit value" msgstr "Valor de unidad de ADC no válido" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "AuthMode invalido" @@ -1297,7 +1313,7 @@ msgstr "Archivo BMP inválido" msgid "Invalid BSSID" msgstr "BSSID inválido" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: 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" @@ -1308,18 +1324,18 @@ msgstr "Archivo MIDI inválido" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "Pin inválido" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -1338,7 +1354,7 @@ msgid "Invalid byteorder string" msgstr "Cadena de byteorder inválida" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/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" @@ -1368,7 +1384,7 @@ msgstr "Archivo inválido" msgid "Invalid format chunk size" msgstr "Formato de fragmento de formato no válido" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "Frecuencia inválida" @@ -1387,8 +1403,8 @@ msgstr "Fase inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1408,13 +1424,16 @@ msgstr "Pin inválido para canal derecho" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "pines inválidos" @@ -1435,15 +1454,15 @@ msgstr "Modo de ejecución inválido." msgid "Invalid security_mode" msgstr "'security_mode' no válido" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Tamaño incorrecto" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "socket invalido para TLS" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Estado invalido" @@ -1480,7 +1499,7 @@ 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." -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "La dirección MAC es incorrecta" @@ -1543,6 +1562,16 @@ msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" "first_set_pin no encontrado. La instrucción %d configura el/los pin(es)" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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." @@ -1560,7 +1589,7 @@ msgstr "Debe usar un múltiplo de 6 pines rgb, no %d" msgid "NLR jump failed. Likely memory corruption." msgstr "Salto NLR falló. Probablemente corrupción de memoria." -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "Error NVS" @@ -1593,25 +1622,25 @@ msgstr "timer por establecedor de paso DMA no encontrado" msgid "No I2C device at address: %x" msgstr "No hay dispositivo I2C en la dirección: %x" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "Sin pin MISO" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Sin pin MOSI" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Sin pin RX" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1675,7 +1704,8 @@ msgstr "No hay una red con ese ssid" msgid "No out in program" msgstr "No hay out en el programa" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1739,11 +1769,11 @@ msgstr "Paridad impar no soportada" msgid "Only 8 or 16 bit mono with " msgstr "Solo mono de 8 ó 16 bit con " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Solo hay capacidad para direcciones IPv4" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "Solo se admiten sockets IPv4" @@ -1776,11 +1806,11 @@ msgstr "" "Solo se admiten BMP monocromáticos, indexados de 4 bpp u 8 bpp y 16 bpp o " "más: %d bpp proporcionados" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "Solamente una TouchAlarm puede ser configurada durante deep sleep." -#: ports/esp32s2/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 @@ -1791,19 +1821,19 @@ 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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operación no característica no soportada" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Tiempo de espera agotado" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Memoria agotada" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "Se acabaron los enchufes" @@ -1844,12 +1874,7 @@ msgstr "Segmento PWM ya esta en uso" msgid "PWM slice channel A already in use" msgstr "Segmento del PWM canal A ya esta en uso" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "ParallelBus todavía no soportado" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "Periférico en uso" @@ -1871,7 +1896,7 @@ msgstr "Total de pines demasiado grande" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1925,25 +1950,6 @@ msgstr "Además de cualquier módulo en el sistema de archivos\n" msgid "Polygon needs at least 3 points" msgstr "El polígono necesita al menos 3 puntos" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" -"Port no acepta un carrier de PWM. Pase en cambio un pin, una frecuencia o un " -"ciclo de actividad" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" -"Port no acepta los pines o la frecuencia. Construya y pase en su lugar un " -"Carrier de PWMOut" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "El prefijo del buffer debe estar en el heap" @@ -1999,12 +2005,12 @@ msgstr "Error de inicialización de RNG" msgid "RS485 Not yet supported on this device" msgstr "RS485 no esta soportado todavía en este dispositivo" -#: ports/esp32s2/common-hal/busio/UART.c +#: 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/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2036,7 +2042,7 @@ msgstr "Sistema de archivos de solo-Lectura" msgid "Read-only object" msgstr "Objeto de solo-lectura" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "La respuesta recibida es invalida" @@ -2052,7 +2058,7 @@ msgstr "RemoteTransmissionRequests limitado a 8 bytes" msgid "Requested AES mode is unsupported" msgstr "El modo AES solicitado no es compatible" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Recurso solicitado no encontrado" @@ -2091,7 +2097,7 @@ msgstr "Error de inicio de SPI" msgid "SPI Re-initialization error" msgstr "Error de reinicialización de SPI" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "Configuración de SPI fallida" @@ -2134,7 +2140,6 @@ msgid "Size not supported" msgstr "Sin capacidades para el tamaño" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "Memoria de sueño no disponible" @@ -2149,7 +2154,7 @@ msgstr "Slice y value tienen tamaños diferentes." msgid "Slices not supported" msgstr "Rebanadas no soportadas" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "SocketPool solo se puede usar con wifi.radio" @@ -2356,7 +2361,7 @@ msgstr "UUID valor no es un str, int o byte buffer" msgid "Unable to allocate buffers for signed conversion" msgstr "No se pudieron asignar buffers para la conversión con signo" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "No se puede crear bloqueo" @@ -2390,7 +2395,7 @@ msgstr "Imposible de escribir en sleep_memory." msgid "Unexpected nrfx uuid type" msgstr "Tipo de uuid nrfx inesperado" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "Error no manejado de ESP TLS %d %d %x %d" @@ -2433,7 +2438,7 @@ msgstr "" "dispositivo fue denegada o ignorada." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2454,7 +2459,7 @@ msgstr "Operación no soportada" msgid "Unsupported pull value." msgstr "valor pull no soportado." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "La actualización fallo" @@ -2468,7 +2473,7 @@ msgstr "Tamaño del valor != del tamaño fijo requerido" msgid "Value length > max_length" msgstr "Tamaño de valor > max_length" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "La versión era invalida" @@ -2604,7 +2609,7 @@ msgid "argument name reused" msgstr "nombre de argumento reutilizado" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "argumento número/tipos no coinciden" @@ -2649,6 +2654,10 @@ msgstr "Eje tiene que ser None, o un entero" msgid "axis too long" msgstr "Eje demasiado largo" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "modo de compilación erroneo" @@ -2719,7 +2728,7 @@ msgid "byteorder is not a string" msgstr "byteorder no es una cadena" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "bytes > 8 bits no soportados" @@ -3175,6 +3184,10 @@ msgstr "cadena-f: solo '}' no está permitido" msgid "file must be a file opened in byte mode" msgstr "el archivo deberia ser una archivo abierto en modo byte" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "sistema de archivos debe proporcionar método de montaje" @@ -3336,7 +3349,7 @@ msgid "index is out of bounds" msgstr "el índice está fuera de límites" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index fuera de rango" @@ -3462,6 +3475,10 @@ msgstr "el tamaño del elemento no es valido%d por bits_per_pixel %d\n" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "el element_size %d,no es valido, debe ser 1,2 ó 4" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "formato inválido" @@ -3499,6 +3516,10 @@ msgstr "sintaxis inválida para entero con base %d" msgid "invalid syntax for number" msgstr "sintaxis inválida para número" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 debe ser una clase" @@ -3562,7 +3583,7 @@ msgstr "variable local referenciada antes de la asignación" msgid "long int not supported in this build" msgstr "long int no soportado en esta compilación" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "Loopback + modo silencioso no están soportados por periférico" @@ -3699,10 +3720,6 @@ msgstr "no hay tarjeta SD" msgid "no active exception to reraise" msgstr "exception no activa para reraise" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "NIC no disponible" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "no se ha encontrado ningún enlace para nonlocal" @@ -3720,7 +3737,7 @@ msgid "no module named '%q'" msgstr "ningún módulo se llama '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "no hay pin de reinicio disponible" @@ -3961,7 +3978,7 @@ msgstr "pixel_shader debe ser displayio.Palette o displayio.ColorConverter" msgid "polygon can only be registered in one parent" msgstr "el polígono solo se puede registrar en uno de los padres" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop de un PulseIn vacío" @@ -3986,29 +4003,40 @@ 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/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "presionando botón de arranque al inicio.\n" @@ -4200,7 +4228,7 @@ msgstr "stop debe ser 1 ó 2" msgid "stop not reachable from start" msgstr "stop no se puede alcanzar del principio" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "operación stream no soportada" @@ -4252,7 +4280,7 @@ msgstr "tile debe sera mas grande que cero" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() toma un sequencio 9" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4320,18 +4348,18 @@ msgstr "trapz está definido para iterables 1D" msgid "tuple/list has wrong length" msgstr "tupla/lista tiene una longitud incorrecta" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "twai_driver_install devolvió esp-idf error #%d" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "twai_start devolvió esp-idf error #%d" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "Ambos tx y rx no pueden ser None" @@ -4410,7 +4438,7 @@ msgid "unreadable attribute" msgstr "atributo no legible" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "tipo de %q no soportado" @@ -4446,11 +4474,15 @@ msgstr "tipos no soportados para %q: '%q', '%q'" msgid "value must fit in %d byte(s)" msgstr "el valor debe caber en %d byte(s)" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "value_count debe ser > 0" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "watchdog no inicializado" @@ -4467,7 +4499,7 @@ msgstr "ancho debe estar entre 2 y 8 (inclusivamente), no %d" msgid "width must be greater than zero" msgstr "el ancho debe ser mayor que cero" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "wifi no esta habilitado" @@ -4503,7 +4535,7 @@ msgstr "tipo de salida incorrecta" msgid "x value out of bounds" msgstr "valor x fuera de límites" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "fallo en xTaskCreate" @@ -4531,6 +4563,38 @@ 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 "ParallelBus not yet supported" +#~ msgstr "ParallelBus todavía no soportado" + +#~ msgid "%q length must be %q" +#~ msgstr "el tamaño de %q debe ser %q" + +#~ msgid "%q must be 0-255" +#~ msgstr "%q debe ser de 0-255" + +#~ msgid "%q must be 1-255" +#~ msgstr "%q debe estar entre 1-255" + +#~ msgid "%q must be None or between 1 and len(report_descriptor)-1" +#~ msgstr "%q debe ser None o entre 1 y len(report_descriptor)-1" + +#~ msgid "no available NIC" +#~ msgstr "NIC no disponible" + +#~ msgid "" +#~ "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +#~ "instead" +#~ msgstr "" +#~ "Port no acepta un carrier de PWM. Pase en cambio un pin, una frecuencia o " +#~ "un ciclo de actividad" + +#~ msgid "" +#~ "Port does not accept pins or frequency. Construct and pass a PWMOut " +#~ "Carrier instead" +#~ msgstr "" +#~ "Port no acepta los pines o la frecuencia. Construya y pase en su lugar un " +#~ "Carrier de PWMOut" + #~ msgid "Instruction %d jumps on pin" #~ msgstr "La instruction %d salta en pin" diff --git a/locale/fil.po b/locale/fil.po index e5057ab83e..6decbd47f8 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -6,14 +6,16 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2018-12-20 22:15-0800\n" -"Last-Translator: Timothy \n" +"PO-Revision-Date: 2021-08-23 14:19+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: fil\n" "Language: fil\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.1.1\n" +"Plural-Forms: nplurals=2; plural=n != 1 && n != 2 && n != 3 && (n % 10 == 4 " +"|| n % 10 == 6 || n % 10 == 9);\n" +"X-Generator: Weblate 4.8.1-dev\n" #: main.c msgid "" @@ -65,6 +67,14 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "" @@ -87,7 +97,11 @@ msgid "%q indices must be integers, not %s" msgstr "%q indeks ay dapat integers, hindi %s" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -102,14 +116,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -127,10 +133,6 @@ msgstr "" msgid "%q must be >= 1" msgstr "aarehas na haba dapat ang buffer slices" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -139,7 +141,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -170,7 +173,11 @@ msgid "%q() takes %d positional arguments but %d were given" msgstr "" "Ang %q() ay kumukuha ng %d positional arguments pero %d lang ang binigay" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -187,7 +194,7 @@ msgstr "" msgid "'%q' object is not an iterator" msgstr "" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "" @@ -320,6 +327,10 @@ 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" @@ -345,7 +356,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "Isang channel ng hardware interrupt ay ginagamit na" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "" @@ -358,36 +369,39 @@ msgstr "ang palette ay dapat 32 bytes ang haba" msgid "Address type out of range" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Lahat ng SPI peripherals ay ginagamit" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c #, fuzzy msgid "All UART peripherals are in use" msgstr "Lahat ng I2C peripherals ginagamit" +#: 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 "" @@ -415,10 +429,10 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -439,7 +453,7 @@ msgstr "" msgid "Already running" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "" @@ -492,6 +506,10 @@ msgstr "" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -512,7 +530,7 @@ msgstr "" "Ang awtomatikong pag re-reload ay ON. i-save lamang ang mga files sa USB " "para patakbuhin sila o pasukin ang REPL para i-disable ito.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "" @@ -609,10 +627,10 @@ msgstr "Buffer dapat ay hindi baba sa 1 na haba" msgid "Buffer too short by %d bytes" msgstr "" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, fuzzy, c-format msgid "Bus pin %d is already in use" msgstr "Ginagamit na ang DAC" @@ -630,7 +648,7 @@ msgstr "Sa gitna ng 0 o 255 dapat ang bytes." msgid "CBC blocks must be multiples of 16 bytes" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -638,15 +656,15 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -689,7 +707,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "Hindi maaaring output ang mga parehong channel sa parehong pin" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -711,7 +729,7 @@ msgstr "" msgid "Cannot reset into bootloader because no bootloader is present." msgstr "Hindi ma-reset sa bootloader dahil walang bootloader." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -719,7 +737,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "Hindi ma i-set ang value kapag ang direksyon ay input." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -736,7 +754,7 @@ msgstr "Hindi maaaring ilipat kapag walang MOSI at MISO pin." msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -774,7 +792,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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." @@ -802,7 +820,7 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Hindi ma-initialize ang UART" @@ -818,7 +836,7 @@ msgstr "" msgid "Could not restart PWM" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -868,13 +886,13 @@ msgstr "" msgid "DAC already in use" msgstr "Ginagamit na ang DAC" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c #, fuzzy msgid "Data 0 pin must be byte aligned" msgstr "graphic ay dapat 2048 bytes ang haba" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -927,7 +945,8 @@ msgstr "Drive mode ay hindi ginagamit kapag ang direksyon ay input." msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -1008,7 +1027,7 @@ msgstr "" msgid "FFT is implemented for linear arrays only" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "" @@ -1029,7 +1048,7 @@ 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/esp32s2/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 @@ -1037,11 +1056,11 @@ msgstr "Nabigong ilaan ang RX buffer" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nabigong ilaan ang RX buffer ng %d bytes" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "" @@ -1057,7 +1076,7 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "" @@ -1083,12 +1102,12 @@ msgid "File exists" msgstr "Mayroong file" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "" @@ -1110,7 +1129,7 @@ msgstr "" msgid "Function requires lock" msgstr "Function nangangailangan ng lock" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1183,7 +1202,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1196,15 +1215,10 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "May mali sa Input/Output" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1233,6 +1247,10 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "" @@ -1242,7 +1260,7 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "" @@ -1263,7 +1281,7 @@ msgstr "" msgid "Invalid ADC Unit value" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1279,7 +1297,7 @@ msgstr "Mali ang BMP file" msgid "Invalid BSSID" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1290,18 +1308,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Maling argumento" @@ -1320,7 +1338,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1350,7 +1368,7 @@ msgstr "Mali ang file" msgid "Invalid format chunk size" msgstr "Mali ang format ng chunk size" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "" @@ -1369,8 +1387,8 @@ msgstr "Mali ang phase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1390,13 +1408,16 @@ msgstr "Mali ang pin para sa kanang channel" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Mali ang pins" @@ -1417,15 +1438,15 @@ msgstr "Mali ang run mode." msgid "Invalid security_mode" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" @@ -1462,7 +1483,7 @@ msgstr "" msgid "Layer must be a Group or TileGrid subclass." msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1521,6 +1542,16 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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 "" @@ -1538,7 +1569,7 @@ msgstr "" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1571,25 +1602,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Walang RX pin" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1653,7 +1684,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1718,11 +1750,11 @@ msgstr "Odd na parity ay hindi supportado" msgid "Only 8 or 16 bit mono with " msgstr "Tanging 8 o 16 na bit mono na may " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1751,11 +1783,11 @@ msgid "" "%d bpp given" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1766,19 +1798,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "" @@ -1818,12 +1850,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1845,7 +1872,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1896,21 +1923,6 @@ msgstr "Kasama ang kung ano pang modules na sa filesystem\n" msgid "Polygon needs at least 3 points" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1963,12 +1975,12 @@ msgstr "" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2001,7 +2013,7 @@ msgstr "Basahin-lamang mode" msgid "Read-only object" msgstr "Basahin-lamang" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2017,7 +2029,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2055,7 +2067,7 @@ msgstr "" msgid "SPI Re-initialization error" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2098,7 +2110,6 @@ msgid "Size not supported" msgstr "" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2113,7 +2124,7 @@ msgstr "Slice at value iba't ibang haba." msgid "Slices not supported" msgstr "Hindi suportado ang Slices" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2310,7 +2321,7 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "Hindi ma-allocate ang buffers para sa naka-sign na conversion" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2345,7 +2356,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "hindi inaasahang indent" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2386,7 +2397,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2408,7 +2419,7 @@ msgstr "Hindi sinusuportahang operasyon" msgid "Unsupported pull value." msgstr "Hindi suportado ang pull value." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2422,7 +2433,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2498,7 +2509,7 @@ msgstr "Ikaw ang humiling sa safe mode sa pamamagitan ng " #: py/objtype.c msgid "__init__() should return None" -msgstr "__init __ () dapat magbalik na None" +msgstr "__init__() dapat magbalik na None" #: py/objtype.c msgid "__init__() should return None, not '%q'" @@ -2553,7 +2564,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "hindi tugma ang argument num/types" @@ -2598,6 +2609,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "masamang mode ng compile" @@ -2669,7 +2684,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -3129,6 +3144,10 @@ msgstr "" msgid "file must be a file opened in byte mode" msgstr "file ay dapat buksan sa byte mode" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "ang filesystem dapat mag bigay ng mount method" @@ -3291,7 +3310,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index wala sa sakop" @@ -3417,6 +3436,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "hindi wastong pag-format" @@ -3454,6 +3477,10 @@ msgstr "maling sintaks sa integer na may base %d" msgid "invalid syntax for number" msgstr "maling sintaks sa number" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 ay dapat na class" @@ -3518,7 +3545,7 @@ msgstr "local variable na reference bago na i-assign" msgid "long int not supported in this build" msgstr "long int hindi sinusuportahan sa build na ito" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3654,10 +3681,6 @@ msgstr "" msgid "no active exception to reraise" msgstr "walang aktibong exception para i-reraise" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "walang magagamit na NIC" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "no binding para sa nonlocal, nahanap" @@ -3675,7 +3698,7 @@ msgid "no module named '%q'" msgstr "walang module na '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "" @@ -3915,7 +3938,7 @@ msgstr "pixel_shader ay dapat displayio.Palette o displayio.ColorConverter" msgid "polygon can only be registered in one parent" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop mula sa walang laman na PulseIn" @@ -3940,29 +3963,40 @@ 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/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4155,7 +4189,7 @@ msgstr "stop dapat 1 o 2" msgid "stop not reachable from start" msgstr "stop hindi maabot sa simula" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "stream operation hindi sinusuportahan" @@ -4207,7 +4241,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kumukuha ng 9-sequence" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4275,18 +4309,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "mali ang haba ng tuple/list" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx at rx hindi pwedeng parehas na None" @@ -4365,7 +4399,7 @@ msgid "unreadable attribute" msgstr "hindi mabasa ang attribute" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "Hindi supportadong tipo ng %q" @@ -4401,11 +4435,15 @@ msgstr "" msgid "value must fit in %d byte(s)" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4422,7 +4460,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4459,7 +4497,7 @@ msgstr "" msgid "x value out of bounds" msgstr "wala sa sakop ang address" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" @@ -4488,6 +4526,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "no available NIC" +#~ msgstr "walang magagamit na NIC" + #~ msgid "USB Busy" #~ msgstr "Busy ang USB" diff --git a/locale/fr.po b/locale/fr.po index e6a3eb2ea8..b3d4dad714 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-05-21 17:47+0000\n" -"Last-Translator: Hugo Dahl \n" +"PO-Revision-Date: 2021-08-23 20:20+0000\n" +"Last-Translator: Jeff Epler \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.7-dev\n" +"X-Generator: Weblate 4.8.1-dev\n" #: main.c msgid "" @@ -58,7 +58,7 @@ msgstr " est de type %q\n" #: main.c msgid " not found.\n" -msgstr "" +msgstr " pas trouvé\n" #: main.c msgid " output:\n" @@ -77,6 +77,14 @@ msgstr "" "%d broches d'adresse, %d broches RGB et %d pour tile indique une hauteur de " "%d, et non %d" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "Échec de %q : %d" @@ -99,7 +107,11 @@ msgid "%q indices must be integers, not %s" msgstr "les indices %q doivent être des entiers, pas %s" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -114,14 +126,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "%q doit être compris entre 1 et 255" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -138,29 +142,26 @@ msgstr "%q doit être >= 0" msgid "%q must be >= 1" msgstr "%q doit être >= 1" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" -msgstr "" +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/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c msgid "%q must be power of 2" -msgstr "" +msgstr "%q doit être une puissance de 2" #: py/argcheck.c msgid "%q must of type %q" -msgstr "" +msgstr "%q doit être de type %q" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #: shared-bindings/canio/Match.c @@ -179,7 +180,11 @@ msgstr "%q doit être un chiffre entier (int)" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() prend %d paramètres positionnels mais %d ont été donnés" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s erreur 0x%x" @@ -196,7 +201,7 @@ msgstr "l'objet '%q' ne supporte pas '%q'" msgid "'%q' object is not an iterator" msgstr "l'objet '%q' n'est pas un itérateur" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "l'objet '%q' ne peut pas être appelé" @@ -262,7 +267,7 @@ msgstr "l'objet %s ne supporte pas l'assignation d'éléments" #: py/obj.c #, c-format msgid "'%s' object doesn't support item deletion" -msgstr "" +msgstr "L'objet '%s' ne prend pas en charge la suppression d'éléments" #: py/runtime.c msgid "'%s' object has no attribute '%q'" @@ -329,6 +334,10 @@ 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 "" + #: py/compile.c msgid "*x must be assignment target" msgstr "*x doit être la cible de l'assignement" @@ -354,7 +363,7 @@ msgstr "types à 64 bit" msgid "A hardware interrupt channel is already in use" msgstr "Un canal d'interruptions matériel est déjà utilisé" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "ADC2 est utilisé pars le Wifi" @@ -367,35 +376,38 @@ msgstr "L'adresse doit être longue de %d octets" msgid "Address type out of range" msgstr "Type d'adresse hors portée" -#: ports/esp32s2/common-hal/canio/CAN.c +#: 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/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.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" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "Toutes les unités PCNT sont utilisées" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "Tout les RX FIFOs sont utilisé" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Tous les périphériques SPI sont utilisés" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "Tous les périphériques UART sont utilisés" +#: 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 "Tout les canaux sont utilisés" @@ -423,10 +435,10 @@ msgstr "Tous les minuteurs pour cette broche sont utilisés" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -447,7 +459,7 @@ msgstr "Il y a déjà un auditeur all-matches" msgid "Already running" msgstr "Déjà en cours d'exécution" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "Déjà à la recherche des réseaux wifi" @@ -504,6 +516,10 @@ msgstr "" "Tentative d'allocation à la pile quand la Machine Virtuelle n'est pas en " "exécution." +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN n'est pas utilisé avec un mot de passe" @@ -524,7 +540,7 @@ msgstr "" "Auto-chargement activé. Copiez ou sauvegardez les fichiers via USB pour les " "lancer ou démarrez le REPL pour le désactiver.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "Baudrate non supporté par le périphérique" @@ -621,10 +637,10 @@ msgstr "Le tampon doit être de longueur au moins 1" msgid "Buffer too short by %d bytes" msgstr "Tampon trop court de %d octets" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "La broche %d du bus est déjà utilisée" @@ -641,25 +657,25 @@ msgstr "Les octets 'bytes' doivent être entre 0 et 255." msgid "CBC blocks must be multiples of 16 bytes" msgstr "Les blocs CBC doivent être des multiples de 16 octets" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC ou somme de contrôle invalide" #: py/objtype.c msgid "Call super().__init__() before accessing native object." -msgstr "Appelez super () .__ init __ () avant d'accéder à l'objet natif." +msgstr "Appelez super().__init__() avant d'accéder à l'objet natif." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 " @@ -672,7 +688,7 @@ msgstr "Impossible de définir CCCD sur une caractéristique locale" #: 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 "Impossible de changer de périphérique USB maintenant" #: shared-bindings/_bleio/Adapter.c msgid "Cannot create a new Adapter; use _bleio.adapter;" @@ -706,7 +722,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "Les 2 canaux de sortie ne peuvent être sur la même broche" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." @@ -729,7 +745,7 @@ 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." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "Ne peut définir les options de socket" @@ -738,7 +754,7 @@ msgid "Cannot set value when direction is input." msgstr "" "Impossible d'affecter une valeur quand la direction est entrante ('input')." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Impossible de spécifier RTS ou CTS en mode RS485" @@ -755,7 +771,7 @@ msgstr "Pas de transfert sans broches MOSI et MISO." 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." @@ -793,7 +809,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "L'entrée 'Column' doit être un digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -822,7 +838,7 @@ 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/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Impossible d'initialiser UART" @@ -838,7 +854,7 @@ msgstr "Impossible de réinitialiser le minuteur" msgid "Could not restart PWM" msgstr "Impossible de redémarrer PWM" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Impossible d’obtenir l’horloge" @@ -888,12 +904,12 @@ msgstr "Erreur d'initialisation du périphérique DAC" msgid "DAC already in use" msgstr "DAC déjà utilisé" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "La broche 'Data 0' doit être aligné sur l'octet" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "La broche Data 0 doit être aligné sur l'octet." @@ -945,7 +961,8 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "La BCE ne fonctionne que sur 16 octets à la fois" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF échec d'allocation de la mémoire" @@ -1025,7 +1042,7 @@ msgstr "La FFT est définie uniquement pour les ndarrays" msgid "FFT is implemented for linear arrays only" msgstr "FFT n'est implémenté que pour les matrices linéaires" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "Échec du handshake SSL" @@ -1046,7 +1063,7 @@ 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/esp32s2/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 @@ -1054,11 +1071,11 @@ msgstr "Echec de l'allocation du tampon RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Echec de l'allocation de %d octets du tampon RX" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Impossible d’allouer la mémoire pour Wifi" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "Impossible d'allouer la mémoire pour le scan wifi" @@ -1074,7 +1091,7 @@ msgstr "Impossible de se connecter : erreur interne" msgid "Failed to connect: timeout" msgstr "Impossible de se connecter: délai dépassé" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "Echec de l'initialisation du Wifi" @@ -1100,12 +1117,12 @@ msgid "File exists" msgstr "Le fichier existe" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filtres trop complexe" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "Image du microprogramme est invalide" @@ -1129,7 +1146,7 @@ msgstr "" msgid "Function requires lock" msgstr "La fonction nécessite un verrou ('lock')" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Échec génerique" @@ -1205,7 +1222,7 @@ msgid "Initial set pin state conflicts with initial out pin state" msgstr "" "État initial de \"set pin\" est en conflit avec l'état initial de \"out pin\"" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Échec d'initialisation par manque de mémoire" @@ -1220,15 +1237,10 @@ msgstr "" msgid "Input taking too long" msgstr "L'entrée prend trop de temps" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Erreur d'entrée/sortie" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1261,6 +1273,10 @@ msgstr "Authentification insuffisante" msgid "Insufficient encryption" msgstr "Chiffrement insuffisant" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "Erreur de définition interne" @@ -1270,7 +1286,7 @@ msgstr "Erreur de définition interne" msgid "Internal error #%d" msgstr "Erreur interne #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "%q invalide" @@ -1291,7 +1307,7 @@ msgstr "Sélection de broche %q invalide" msgid "Invalid ADC Unit value" msgstr "Valeur d'unité ADC non valide" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "AuthMode invalide" @@ -1307,7 +1323,7 @@ msgstr "Fichier BMP invalide" msgid "Invalid BSSID" msgstr "BSSID invalide" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: 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" @@ -1318,18 +1334,18 @@ msgstr "Fichier MIDI invalide" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "Broche invalide" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Paramètre invalide" @@ -1348,7 +1364,7 @@ msgid "Invalid byteorder string" msgstr "Chaîne byteorder non valide" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/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" @@ -1378,7 +1394,7 @@ msgstr "Fichier invalide" msgid "Invalid format chunk size" msgstr "Taille de bloc de formatage invalide" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "Fréquence non valide" @@ -1397,8 +1413,8 @@ msgstr "Phase invalide" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1418,13 +1434,16 @@ msgstr "Broche invalide pour le canal droit" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Broches invalides" @@ -1445,15 +1464,15 @@ msgstr "Mode de lancement invalide." msgid "Invalid security_mode" msgstr "'security_mode' invalide" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Taille invalide" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "Socket non valide pour TLS" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "État invalide" @@ -1490,7 +1509,7 @@ 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'." -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "Adresse physique (MAC) invalide" @@ -1551,6 +1570,16 @@ msgstr "first_out_pin manquant. Instruction %d écrit un/des broche(s)" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "first_set_pin manquant. L'instruction %d règle la/les broche(s)" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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 "Doit être une sous-classe de %q." @@ -1568,7 +1597,7 @@ msgstr "Doit utiliser un multiple de 6 broches RVB, pas %d" msgid "NLR jump failed. Likely memory corruption." msgstr "Saut NLR échoué. Corruption de mémoire probable." -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "Erreur NVS" @@ -1601,25 +1630,25 @@ msgstr "Aucun minuteur de rythme DMA trouvé" msgid "No I2C device at address: %x" msgstr "Pas de dispositif I2C à l'adresse : %x" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "Pas de broche MISO" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Pas de broche MOSI" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Pas de broche RX" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1683,7 +1712,8 @@ msgstr "Aucun réseau avec ce ssid" msgid "No out in program" msgstr "Aucun out dans le programme" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1747,11 +1777,11 @@ msgstr "Parité impaire non supportée" msgid "Only 8 or 16 bit mono with " msgstr "Uniquement 8 ou 16 bit mono avec " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Seulement les adresses IPv4 sont supportées" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "Seulement les sockets IPv4 sont supportés" @@ -1784,11 +1814,11 @@ msgstr "" "Seulement les BMP monochromes, 4 bpp ou 8 bpp, ou 16 bpp et plus sont " "supportés: %d bpp fournis" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: 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." -#: ports/esp32s2/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 @@ -1799,19 +1829,19 @@ 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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Opération ou fonction non supportée" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Timeout de l'opération" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Hors de mémoire" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "Plus de sockets" @@ -1854,12 +1884,7 @@ msgstr "PWM slice déja utilisée" msgid "PWM slice channel A already in use" msgstr "Canal A de PWM slice est utilisé" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "ParallelBus pas encore supporté" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "Périphérique en utilisation" @@ -1881,7 +1906,7 @@ msgstr "Nombre de broches trop élevé" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1935,25 +1960,6 @@ msgstr "Ainsi que tout autres modules présents sur le système de fichiers\n" msgid "Polygon needs at least 3 points" msgstr "Polygon a besoin d’au moins 3 points" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" -"Ce port n'accepte pas de PWM carrier. Précisez plutôt les valeurs pin, " -"frequency et duty_cycle" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" -"Ce port n'accepte pas de broches ou de fréquence. Construisez plutôt en " -"passant un PWMOut Carrier" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Le tampon de préfixe doit être sur la pile" @@ -2009,12 +2015,12 @@ msgstr "Erreur d'initialisation du RNG" msgid "RS485 Not yet supported on this device" msgstr "RS485 n'est pas encore supporté sur cet appareil" -#: ports/esp32s2/common-hal/busio/UART.c +#: 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/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2046,7 +2052,7 @@ msgstr "Système de fichier en lecture seule" msgid "Read-only object" msgstr "Objet en lecture seule" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Réponse reçue invalide" @@ -2062,7 +2068,7 @@ msgstr "RemoteTransmissionRequests limité à 8 octets" msgid "Requested AES mode is unsupported" msgstr "Le mode AES demandé n'est pas supporté" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Resource demandée non trouvée" @@ -2100,7 +2106,7 @@ msgstr "Erreur d'initialisation SPI" msgid "SPI Re-initialization error" msgstr "Erreur de réinitialisation SPI" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2143,7 +2149,6 @@ msgid "Size not supported" msgstr "Taille n'est pas supportée" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2158,7 +2163,7 @@ msgstr "Tranche et valeur de tailles différentes." msgid "Slices not supported" msgstr "Tranches non supportées" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "SocketPool ne s'utilise qu'avec wifi.radio" @@ -2359,7 +2364,7 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "Impossible d'allouer des tampons pour une conversion signée" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "Impossible de créer un verrou ('lock')" @@ -2393,7 +2398,7 @@ msgstr "Écriture impossible vers sleep_memory." msgid "Unexpected nrfx uuid type" msgstr "Type inattendu pour l'uuid nrfx" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "Erreur ESP TLS non gérée %d %d %x %d" @@ -2437,7 +2442,7 @@ msgstr "" "appareil ait été refusée ou ignorée." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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é" @@ -2458,7 +2463,7 @@ msgstr "Opération non supportée" msgid "Unsupported pull value." msgstr "Valeur de tirage 'pull' non supportée." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Mise-à-jour échouée" @@ -2472,7 +2477,7 @@ msgstr "Longueur de valeur != Longueur fixe requise" msgid "Value length > max_length" msgstr "Longueur de la valeur > max_length" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "Version est invalide" @@ -2606,7 +2611,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "Nombre/types de paramètres ne correspondent pas" @@ -2651,6 +2656,10 @@ msgstr "axis doit être None ou un entier" msgid "axis too long" msgstr "axis trop long" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "mauvais mode de compilation" @@ -2721,7 +2730,7 @@ msgid "byteorder is not a string" msgstr "byteorder n'est pas une chaîne" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "octets > 8 bits non supporté" @@ -3183,6 +3192,10 @@ msgstr "f-string : single '}' n'est pas autorisé" msgid "file must be a file opened in byte mode" msgstr "le fichier doit être un fichier ouvert en mode 'byte'" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "le system de fichier doit fournir une méthode 'mount'" @@ -3344,7 +3357,7 @@ msgid "index is out of bounds" msgstr "l'index est hors limites" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index est hors bornes" @@ -3471,6 +3484,10 @@ msgstr "taille d'élément %d est invalide pour bits_per_pixel %d\n" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "element_size %d est invalide, doit être 1, 2 ou 4" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "format invalide" @@ -3508,6 +3525,10 @@ msgstr "syntaxe invalide pour un entier de base %d" msgid "invalid syntax for number" msgstr "syntaxe invalide pour un nombre" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "l'argument 1 de issubclass() doit être une classe" @@ -3572,7 +3593,7 @@ msgstr "variable locale référencée avant d'être assignée" msgid "long int not supported in this build" msgstr "entiers longs non supportés dans cette build" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + silent mode non pris en charge par le périphérique" @@ -3708,10 +3729,6 @@ msgstr "pas de carte SD" msgid "no active exception to reraise" msgstr "aucune exception active à relever" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "adapteur réseau non disponible" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "pas de lien trouvé pour nonlocal" @@ -3729,7 +3746,7 @@ msgid "no module named '%q'" msgstr "pas de module '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "pas de broche de réinitialisation disponible" @@ -3972,7 +3989,7 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "le polygone ne peut être enregistré que dans un parent" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "'pop' d'une entrée PulseIn vide" @@ -3997,29 +4014,40 @@ 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/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "bouton boot appuyé lors du démarrage.\n" @@ -4211,7 +4239,7 @@ msgstr "stop doit être 1 ou 2" msgid "stop not reachable from start" msgstr "stop n'est pas accessible au démarrage" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "opération de flux non supportée" @@ -4264,7 +4292,7 @@ msgstr "tile doit être plus que zéro" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() prend une séquence de longueur 9" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4331,18 +4359,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "tuple/liste a une mauvaise longueur" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "twai_driver_install a renvoyé l'erreur esp-idf #%d" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "twai_start a renvoyé l'erreur esp-idf #%d" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx et rx ne peuvent être 'None' tous les deux" @@ -4421,7 +4449,7 @@ msgid "unreadable attribute" msgstr "attribut illisible" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "type %q non pris on charge" @@ -4457,11 +4485,15 @@ msgstr "types non supportés pour %q: '%q', '%q'" msgid "value must fit in %d byte(s)" msgstr "la valeur doit tenir dans %d octet(s)" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "'value_count' doit être > 0" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "chien de garde (watchdog) non initialisé" @@ -4478,7 +4510,7 @@ msgstr "width doit être entre 2 et 8 (inclusivement), non %d" msgid "width must be greater than zero" msgstr "width doit être plus que zero" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "wifi n’est pas activé" @@ -4514,7 +4546,7 @@ msgstr "type de sortie incorrect" msgid "x value out of bounds" msgstr "valeur x hors limites" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "Échec de xTaskCreate" @@ -4542,6 +4574,35 @@ 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 "ParallelBus not yet supported" +#~ msgstr "ParallelBus pas encore supporté" + +#~ msgid "%q length must be %q" +#~ msgstr "La longueur de %q doit être de %q" + +#~ msgid "%q must be 0-255" +#~ msgstr "%q doit être compris entre 0 et 255" + +#~ msgid "%q must be 1-255" +#~ msgstr "%q doit être compris entre 1 et 255" + +#~ msgid "no available NIC" +#~ msgstr "adapteur réseau non disponible" + +#~ msgid "" +#~ "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +#~ "instead" +#~ msgstr "" +#~ "Ce port n'accepte pas de PWM carrier. Précisez plutôt les valeurs pin, " +#~ "frequency et duty_cycle" + +#~ msgid "" +#~ "Port does not accept pins or frequency. Construct and pass a PWMOut " +#~ "Carrier instead" +#~ msgstr "" +#~ "Ce port n'accepte pas de broches ou de fréquence. Construisez plutôt en " +#~ "passant un PWMOut Carrier" + #~ msgid "Instruction %d jumps on pin" #~ msgstr "Instruction %d saute sur la broche" diff --git a/locale/hi.po b/locale/hi.po index 99fd695dda..a58cd097ba 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -66,6 +66,14 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "" @@ -88,7 +96,11 @@ msgid "%q indices must be integers, not %s" msgstr "" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -103,14 +115,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -127,10 +131,6 @@ msgstr "" msgid "%q must be >= 1" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -139,7 +139,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -168,7 +169,11 @@ msgstr "" msgid "%q() takes %d positional arguments but %d were given" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -185,7 +190,7 @@ msgstr "" msgid "'%q' object is not an iterator" msgstr "" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "" @@ -318,6 +323,10 @@ 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 "" @@ -343,7 +352,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "" @@ -356,35 +365,38 @@ msgstr "" msgid "Address type out of range" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "" +#: 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 "" @@ -412,10 +424,10 @@ msgstr "" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -436,7 +448,7 @@ msgstr "" msgid "Already running" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "" @@ -489,6 +501,10 @@ msgstr "" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -507,7 +523,7 @@ msgid "" "disable.\n" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "" @@ -604,10 +620,10 @@ msgstr "" msgid "Buffer too short by %d bytes" msgstr "" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "" @@ -624,7 +640,7 @@ msgstr "" msgid "CBC blocks must be multiples of 16 bytes" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -632,15 +648,15 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -682,7 +698,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -704,7 +720,7 @@ msgstr "" msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -712,7 +728,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -729,7 +745,7 @@ msgstr "" msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -767,7 +783,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "Command must be an int between 0 and 255" msgstr "" @@ -794,7 +810,7 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -810,7 +826,7 @@ msgstr "" msgid "Could not restart PWM" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -860,12 +876,12 @@ msgstr "" msgid "DAC already in use" msgstr "" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -916,7 +932,8 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -995,7 +1012,7 @@ msgstr "" msgid "FFT is implemented for linear arrays only" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "" @@ -1016,7 +1033,7 @@ 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/esp32s2/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 @@ -1024,11 +1041,11 @@ msgstr "" msgid "Failed to allocate RX buffer of %d bytes" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "" @@ -1044,7 +1061,7 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "" @@ -1070,12 +1087,12 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "" @@ -1097,7 +1114,7 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1168,7 +1185,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1181,15 +1198,10 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1218,6 +1230,10 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "" @@ -1227,7 +1243,7 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "" @@ -1248,7 +1264,7 @@ msgstr "" msgid "Invalid ADC Unit value" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1264,7 +1280,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1275,18 +1291,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -1305,7 +1321,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1335,7 +1351,7 @@ msgstr "" msgid "Invalid format chunk size" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "" @@ -1354,8 +1370,8 @@ msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1375,13 +1391,16 @@ msgstr "" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "" @@ -1402,15 +1421,15 @@ msgstr "" msgid "Invalid security_mode" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" @@ -1447,7 +1466,7 @@ msgstr "" msgid "Layer must be a Group or TileGrid subclass." msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1506,6 +1525,16 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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 "" @@ -1523,7 +1552,7 @@ msgstr "" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1556,25 +1585,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1638,7 +1667,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1700,11 +1730,11 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1733,11 +1763,11 @@ msgid "" "%d bpp given" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1748,19 +1778,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "" @@ -1799,12 +1829,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1826,7 +1851,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1877,21 +1902,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1944,12 +1954,12 @@ msgstr "" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -1981,7 +1991,7 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -1997,7 +2007,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2035,7 +2045,7 @@ msgstr "" msgid "SPI Re-initialization error" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2078,7 +2088,6 @@ msgid "Size not supported" msgstr "" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2093,7 +2102,7 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2290,7 +2299,7 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2324,7 +2333,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2365,7 +2374,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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 "" @@ -2386,7 +2395,7 @@ msgstr "" msgid "Unsupported pull value." msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2400,7 +2409,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2525,7 +2534,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "" @@ -2570,6 +2579,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -2640,7 +2653,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -3089,6 +3102,10 @@ msgstr "" msgid "file must be a file opened in byte mode" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "" @@ -3250,7 +3267,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3376,6 +3393,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "" @@ -3413,6 +3434,10 @@ msgstr "" msgid "invalid syntax for number" msgstr "" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" @@ -3473,7 +3498,7 @@ msgstr "" msgid "long int not supported in this build" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3609,10 +3634,6 @@ msgstr "" msgid "no active exception to reraise" msgstr "" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "" @@ -3630,7 +3651,7 @@ msgid "no module named '%q'" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "" @@ -3868,7 +3889,7 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -3893,29 +3914,40 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4105,7 +4137,7 @@ msgstr "" msgid "stop not reachable from start" msgstr "" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "" @@ -4157,7 +4189,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4224,18 +4256,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" @@ -4314,7 +4346,7 @@ msgid "unreadable attribute" msgstr "" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" @@ -4350,11 +4382,15 @@ msgstr "" msgid "value must fit in %d byte(s)" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4371,7 +4407,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4407,7 +4443,7 @@ msgstr "" msgid "x value out of bounds" msgstr "" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index 412d3e03fe..029871f3ae 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -75,6 +75,14 @@ msgid "" msgstr "" "%d pin indirizzo, %d pin rgb e %d tessere indicano l'altezza di %d, non %d" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "%q fallito: %d" @@ -97,7 +105,11 @@ msgid "%q indices must be integers, not %s" msgstr "gli indici %q devono essere interi, non %s" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -112,14 +124,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -137,10 +141,6 @@ msgstr "%q deve essere >= 0" msgid "%q must be >= 1" msgstr "slice del buffer devono essere della stessa lunghezza" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -149,7 +149,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "%q deve essere una tupla di lunghezza 2" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -178,7 +179,11 @@ msgstr "%q dovrebbe essere un int" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "%s errore 0x%x" @@ -195,7 +200,7 @@ msgstr "L'oggetto '%q' non supporta '%q'" msgid "'%q' object is not an iterator" msgstr "L'oggetto '%q' non è un iteratore" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "L'oggetto '%q' non è richiamabile" @@ -329,6 +334,10 @@ 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" @@ -354,7 +363,7 @@ msgstr "Tipo 64 bits" msgid "A hardware interrupt channel is already in use" msgstr "Un canale di interruzione hardware è già in uso" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "ADC2 sta usando il WiFi" @@ -367,36 +376,39 @@ msgstr "L'indirizzo deve essere lungo %d byte" msgid "Address type out of range" msgstr "Tipo di indirizzo fuori intervallo" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Tutte le periferiche CAN sono in uso" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "Tutte le unità PCNT sono in uso" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "Tutte le RX FIFO sono in uso" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Tutte le periferiche SPI sono in uso" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: ports/raspberrypi/common-hal/busio/UART.c #, fuzzy msgid "All UART peripherals are in use" msgstr "Tutte le periferiche I2C sono in uso" +#: 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 "" @@ -424,10 +436,10 @@ msgstr "Tutti i timer per questo pin sono in uso" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -448,7 +460,7 @@ msgstr "Già in possesso di tutti i listener abbinati" msgid "Already running" msgstr "Già in funzione" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "Già in ricerca di collegamenti WiFi" @@ -501,6 +513,10 @@ msgstr "Provo ad allocare %d blocchi" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -521,7 +537,7 @@ msgstr "" "L'auto-reload è attivo. Salva i file su USB per eseguirli o entra nel REPL " "per disabilitarlo.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "" @@ -619,10 +635,10 @@ msgstr "Il buffer deve essere lungo almeno 1" msgid "Buffer too short by %d bytes" msgstr "Buffer troppo piccolo di %d bytes" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "Bus pin %d è già in uso" @@ -639,7 +655,7 @@ msgstr "I byte devono essere compresi tra 0 e 255." msgid "CBC blocks must be multiples of 16 bytes" msgstr "I blocchi CBC devono essere multipli di 16 bytes" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC o controllo totale è risultato non valido" @@ -647,15 +663,15 @@ 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -698,7 +714,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "Impossibile dare in output entrambi i canal sullo stesso pin" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -721,7 +737,7 @@ msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" "Impossibile resettare nel bootloader poiché nessun bootloader è presente." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -729,7 +745,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "non si può impostare un valore quando direzione è input" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -746,7 +762,7 @@ msgstr "Impossibile trasferire senza i pin MOSI e MISO." msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -784,7 +800,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -812,7 +828,7 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Impossibile inizializzare l'UART" @@ -828,7 +844,7 @@ msgstr "" msgid "Could not restart PWM" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -878,13 +894,13 @@ msgstr "" msgid "DAC already in use" msgstr "DAC già in uso" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c #, fuzzy msgid "Data 0 pin must be byte aligned" msgstr "graphic deve essere lunga 2048 byte" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -936,7 +952,8 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -1017,7 +1034,7 @@ msgstr "" msgid "FFT is implemented for linear arrays only" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "" @@ -1038,7 +1055,7 @@ 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/esp32s2/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 @@ -1046,11 +1063,11 @@ msgstr "Impossibile allocare buffer RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Fallita allocazione del buffer RX di %d byte" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "" @@ -1066,7 +1083,7 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "" @@ -1092,12 +1109,12 @@ msgid "File exists" msgstr "File esistente" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "" @@ -1119,7 +1136,7 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1192,7 +1209,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1205,15 +1222,10 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Errore input/output" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1242,6 +1254,10 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "" @@ -1251,7 +1267,7 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "" @@ -1272,7 +1288,7 @@ msgstr "" msgid "Invalid ADC Unit value" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1288,7 +1304,7 @@ msgstr "File BMP non valido" msgid "Invalid BSSID" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1299,18 +1315,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argomento non valido" @@ -1330,7 +1346,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/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" @@ -1361,7 +1377,7 @@ msgstr "File non valido" msgid "Invalid format chunk size" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "" @@ -1380,8 +1396,8 @@ msgstr "Fase non valida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1401,13 +1417,16 @@ msgstr "Pin non valido per il canale destro" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Pin non validi" @@ -1428,15 +1447,15 @@ msgstr "Modalità di esecuzione non valida." msgid "Invalid security_mode" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" @@ -1474,7 +1493,7 @@ msgstr "" msgid "Layer must be a Group or TileGrid subclass." msgstr "Layer deve essere un Group o TileGrid subclass" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1534,6 +1553,16 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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 "" @@ -1551,7 +1580,7 @@ msgstr "" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1584,25 +1613,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Nessun pin RX" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1666,7 +1695,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1732,11 +1762,11 @@ msgstr "operazione I2C non supportata" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1765,11 +1795,11 @@ msgid "" "%d bpp given" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1780,19 +1810,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "" @@ -1836,12 +1866,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1863,7 +1888,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1915,21 +1940,6 @@ msgstr "Imposssibile rimontare il filesystem" msgid "Polygon needs at least 3 points" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1982,12 +1992,12 @@ msgstr "" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2020,7 +2030,7 @@ msgstr "Filesystem in sola lettura" msgid "Read-only object" msgstr "Sola lettura" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2036,7 +2046,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2074,7 +2084,7 @@ msgstr "" msgid "SPI Re-initialization error" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2119,7 +2129,6 @@ msgid "Size not supported" msgstr "" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2134,7 +2143,7 @@ msgstr "" msgid "Slices not supported" msgstr "Slice non supportate" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2331,7 +2340,7 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "Ipossibilitato ad allocare buffer per la conversione con segno" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2366,7 +2375,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "indentazione inaspettata" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2407,7 +2416,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2429,7 +2438,7 @@ msgstr "Operazione non supportata" msgid "Unsupported pull value." msgstr "Valore di pull non supportato." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2443,7 +2452,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2568,7 +2577,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "discrepanza di numero/tipo di argomenti" @@ -2613,6 +2622,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -2686,7 +2699,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "byte > 8 bit non supportati" @@ -3142,6 +3155,10 @@ msgstr "" msgid "file must be a file opened in byte mode" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "il filesystem deve fornire un metodo di mount" @@ -3304,7 +3321,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "indice fuori intervallo" @@ -3430,6 +3447,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "formato non valido" @@ -3467,6 +3488,10 @@ msgstr "sintassi invalida per l'intero con base %d" msgid "invalid syntax for number" msgstr "sintassi invalida per il numero" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "il primo argomento di issubclass() deve essere una classe" @@ -3532,7 +3557,7 @@ msgstr "variabile locale richiamata prima di un assegnamento" msgid "long int not supported in this build" msgstr "long int non supportata in questa build" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3668,11 +3693,6 @@ msgstr "" msgid "no active exception to reraise" msgstr "nessuna eccezione attiva da rilanciare" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -#, fuzzy -msgid "no available NIC" -msgstr "busio.UART non ancora implementato" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "nessun binding per nonlocal trovato" @@ -3690,7 +3710,7 @@ msgid "no module named '%q'" msgstr "nessun modulo chiamato '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "" @@ -3934,7 +3954,7 @@ msgstr "pixel_shader deve essere displayio.Palette o displayio.ColorConverter" msgid "polygon can only be registered in one parent" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop sun un PulseIn vuoto" @@ -3959,29 +3979,40 @@ 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/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4174,7 +4205,7 @@ msgstr "" msgid "stop not reachable from start" msgstr "stop non raggiungibile dall'inizio" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "operazione di stream non supportata" @@ -4226,7 +4257,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4294,18 +4325,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "tupla/lista ha la lunghezza sbagliata" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx e rx non possono essere entrambi None" @@ -4384,7 +4415,7 @@ msgid "unreadable attribute" msgstr "attributo non leggibile" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "tipo di %q non supportato" @@ -4420,11 +4451,15 @@ msgstr "" msgid "value must fit in %d byte(s)" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4441,7 +4476,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4478,7 +4513,7 @@ msgstr "" msgid "x value out of bounds" msgstr "indirizzo fuori limite" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" @@ -4507,6 +4542,10 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#, fuzzy +#~ msgid "no available NIC" +#~ msgstr "busio.UART non ancora implementato" + #~ msgid "Buffer too large and unable to allocate" #~ msgstr "Buffer troppo grande ed impossibile allocare" diff --git a/locale/ja.po b/locale/ja.po index a1c850be2f..e831d55d4f 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -8,15 +8,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: 2020-11-27 18:34+0000\n" -"Last-Translator: sporeball \n" +"PO-Revision-Date: 2021-08-24 06:48+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: none\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.4-dev\n" +"X-Generator: Weblate 4.8.1-dev\n" #: main.c msgid "" @@ -71,6 +71,14 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "%q 失敗: %d" @@ -93,7 +101,11 @@ msgid "%q indices must be integers, not %s" msgstr "" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -108,14 +120,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -132,10 +136,6 @@ msgstr "%qã¯0以上ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" msgid "%q must be >= 1" msgstr "%qã¯1以上ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -144,7 +144,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "%qã¯é•·ã•2ã®ã‚¿ãƒ—ルã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -173,7 +174,11 @@ msgstr "%qã¯intåž‹ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() 㯠%d 個ã®ä½ç½®å¼•æ•°ã‚’å–ã‚Šã¾ã™ãŒã€%d 個与ãˆã‚‰ã‚Œã¾ã—ãŸ" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -190,7 +195,7 @@ msgstr "'%q' オブジェクト㯠'%q' ã«å¯¾å¿œã—ã¦ã„ã¾ã›ã‚“" msgid "'%q' object is not an iterator" msgstr "オブジェクト'%q'ã¯ã‚¤ãƒ†ãƒ¬ãƒ¼ã‚¿ã§ã¯ã‚ã‚Šã¾ã›ã‚“" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "オブジェクト'%q'ã¯å‘¼ã³å‡ºã—å¯èƒ½ã§ã¯ã‚ã‚Šã¾ã›ã‚“" @@ -309,7 +314,7 @@ msgstr "'data'ã«ã¯æ•´æ•°ã®å¼•æ•°ãŒå¿…è¦" #: py/compile.c msgid "'label' requires 1 argument" -msgstr "'label'ã«ã¯ï¼‘ã¤ã®å¼•æ•°ãŒå¿…è¦" +msgstr "'label'ã«ã¯1ã¤ã®å¼•æ•°ãŒå¿…è¦" #: py/compile.c msgid "'return' outside function" @@ -323,6 +328,10 @@ 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ã¯ä»£å…¥å…ˆã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" @@ -348,7 +357,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "ãƒãƒ¼ãƒ‰ã‚¦ã‚§ã‚¢å‰²ã‚Šè¾¼ã¿ãƒãƒ£ãƒãƒ«ã¯ä½¿ç”¨ä¸­" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "" @@ -361,35 +370,38 @@ msgstr "アドレスã¯ã€%dãƒã‚¤ãƒˆé•·ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" msgid "Address type out of range" msgstr "address_typeãŒç¯„囲外" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "å…¨ã¦ã®CAN周辺機器ãŒä½¿ç”¨ä¸­" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "å…¨ã¦ã®I2C周辺機器ãŒä½¿ç”¨ä¸­" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "å…¨ã¦ã®RX FIFOãŒä½¿ç”¨ä¸­" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "å…¨ã¦ã®SPI周辺機器ãŒä½¿ç”¨ä¸­" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "å…¨ã¦ã®UART周辺機器ãŒä½¿ç”¨ä¸­" +#: 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 "" @@ -417,10 +429,10 @@ msgstr "ã“ã®ãƒ”ン用ã®å…¨ã¦ã®ã‚¿ã‚¤ãƒžãŒä½¿ç”¨ä¸­" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -441,7 +453,7 @@ msgstr "" msgid "Already running" msgstr "ã™ã§ã«å®Ÿè¡Œä¸­" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "" @@ -494,6 +506,10 @@ msgstr "%d個ã®ãƒ–ロックã®ç¢ºä¿ã‚’試ã¿ã¾ã—ãŸ" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -514,7 +530,7 @@ msgstr "" "オートリロードãŒã‚ªãƒ³ã§ã™ã€‚ファイルをUSB経由ã§ä¿å­˜ã™ã‚‹ã ã‘ã§å®Ÿè¡Œã§ãã¾ã™ã€‚REPL" "ã«å…¥ã‚‹ã¨ç„¡åŠ¹åŒ–ã—ã¾ã™ã€‚\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "" @@ -611,10 +627,10 @@ msgstr "ãƒãƒƒãƒ•ã‚¡é•·ã¯å°‘ãªãã¨ã‚‚1以上ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" msgid "Buffer too short by %d bytes" msgstr "ãƒãƒƒãƒ•ã‚¡ãŒ %d ãƒã‚¤ãƒˆè¶³ã‚Šã¾ã›ã‚“" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "Busピン%dã¯ã™ã§ã«ä½¿ç”¨ä¸­" @@ -631,7 +647,7 @@ msgstr "ãƒã‚¤ãƒˆå€¤ã¯0ã‹ã‚‰255ã®é–“ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBCブロックã¯16ãƒã‚¤ãƒˆã®æ•´æ•°å€ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -641,15 +657,15 @@ msgstr "" "ãƒã‚¤ãƒ†ã‚£ãƒ–オブジェクトã«ã‚¢ã‚¯ã‚»ã‚¹ã™ã‚‹å‰ã«super().__init__()を呼ã³å‡ºã—ã¦ãã ã•" "ã„" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -691,7 +707,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "åŒã˜ãƒ”ン上ã®ä¸¡ãƒãƒ£ãƒãƒ«ã«å‡ºåŠ›ã§ãã¾ã›ã‚“" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -713,7 +729,7 @@ msgstr "" msgid "Cannot reset into bootloader because no bootloader is present." msgstr "ブートローダãŒå­˜åœ¨ã—ãªã„ãŸã‚ブートローダã¸ã¨ãƒªã‚»ãƒƒãƒˆã§ãã¾ã›ã‚“" -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -721,7 +737,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "æ–¹å‘ãŒinputã®ã¨ãã¯å€¤ã‚’設定ã§ãã¾ã›ã‚“" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "RS485モードã«RTSã¾ãŸã¯CTSを指定ã§ãã¾ã›ã‚“" @@ -738,7 +754,7 @@ msgstr "MOSIピンã¨MISOピンãªã—ã«è»¢é€ã§ãã¾ã›ã‚“" msgid "Cannot vary frequency on a timer that is already in use" msgstr "使用中ã®ã‚¿ã‚¤ãƒžãƒ¼ä¸Šã§ã¯å‘¨æ³¢æ•°ã‚’変ãˆã‚‰ã‚Œã¾ã›ã‚“" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -776,7 +792,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "Columnã®è¦ç´ ã¯ digitalio.DigitalInOut ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "Command must be an int between 0 and 255" msgstr "commandã¯0ã‹ã‚‰255ã®é–“ã®æ•´æ•°ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" @@ -803,7 +819,7 @@ msgid "Could not initialize SDCard" msgstr "SDカードをåˆæœŸåŒ–ã§ãã¾ã›ã‚“" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "UARTã‚’åˆæœŸåŒ–ã§ãã¾ã›ã‚“" @@ -819,7 +835,7 @@ msgstr "タイマーをå†åˆæœŸåŒ–ã§ãã¾ã›ã‚“" msgid "Could not restart PWM" msgstr "PWMã‚’å†ã‚¹ã‚¿ãƒ¼ãƒˆã§ãã¾ã›ã‚“" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -869,12 +885,12 @@ msgstr "DACデãƒã‚¤ã‚¹åˆæœŸåŒ–エラー" msgid "DAC already in use" msgstr "DACã¯ã™ã§ã«ä½¿ç”¨ä¸­" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "Data 0 ピンã¯ã€ãƒã‚¤ãƒˆæ•´åˆ—ã•ã‚Œã¦ã„ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -925,7 +941,8 @@ msgstr "æ–¹å‘ãŒinputã®ã¨ãドライブモードã¯ä½¿ã‚ã‚Œã¾ã›ã‚“" msgid "ECB only operates on 16 bytes at a time" msgstr "ECBã¯ä¸€åº¦ã«16ãƒã‚¤ãƒˆã®æ¼”ç®—ã®ã¿ã‚’è¡Œã„ã¾ã™" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -1004,7 +1021,7 @@ msgstr "FFTã¯ndarrayã§ã®ã¿ä½¿ãˆã¾ã™" msgid "FFT is implemented for linear arrays only" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "" @@ -1025,7 +1042,7 @@ 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/esp32s2/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 @@ -1033,11 +1050,11 @@ msgstr "RXãƒãƒƒãƒ•ã‚¡ã®ç¢ºä¿ã«å¤±æ•—" msgid "Failed to allocate RX buffer of %d bytes" msgstr "%dãƒã‚¤ãƒˆã®RXãƒãƒƒãƒ•ã‚¡ã®ç¢ºä¿ã«å¤±æ•—" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Wi-Fiã®ãƒ¡ãƒ¢ãƒªã®ç¢ºä¿ã«å¤±æ•—" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "" @@ -1053,7 +1070,7 @@ msgstr "接続失敗: 内部エラー" msgid "Failed to connect: timeout" msgstr "接続失敗: タイムアウト" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "" @@ -1079,12 +1096,12 @@ msgid "File exists" msgstr "ファイルãŒå­˜åœ¨ã—ã¾ã™" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "" @@ -1106,7 +1123,7 @@ msgstr "ã“ã®ã‚¿ã‚¤ãƒžãƒ¼ã‚’使ã†æ—¢å­˜ã®PWMOutã¨å‘¨æ³¢æ•°ã‚’一致ã•ã›ã‚‹ msgid "Function requires lock" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1179,7 +1196,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1192,15 +1209,10 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "入力/出力エラー" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1229,6 +1241,10 @@ msgstr "èªè¨¼ãŒä¸å分" msgid "Insufficient encryption" msgstr "æš—å·åŒ–ãŒä¸å分" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "内部定義エラー" @@ -1238,7 +1254,7 @@ msgstr "内部定義エラー" msgid "Internal error #%d" msgstr "内部エラー #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "ä¸æ­£ãª %q" @@ -1259,7 +1275,7 @@ msgstr "ä¸æ­£ãª%qピンé¸æŠž" msgid "Invalid ADC Unit value" msgstr "ä¸æ­£ãªADCユニット値" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1275,7 +1291,7 @@ msgstr "ä¸æ­£ãªBMPファイル" msgid "Invalid BSSID" msgstr "ä¸æ­£ãªBSSID" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "ä¸æ­£ãªDACピンãŒä¸Žãˆã‚‰ã‚Œã¾ã—ãŸ" @@ -1286,18 +1302,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "ä¸æ­£ãªå¼•æ•°" @@ -1316,7 +1332,7 @@ msgid "Invalid byteorder string" msgstr "ä¸æ­£ãªãƒã‚¤ãƒˆã‚ªãƒ¼ãƒ€ãƒ¼æ–‡å­—列" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "ä¸æ­£ãªã‚­ãƒ£ãƒ—ãƒãƒ£å‘¨æœŸã€‚有効ãªå‘¨æœŸã¯1-500" @@ -1346,7 +1362,7 @@ msgstr "ä¸æ­£ãªãƒ•ã‚¡ã‚¤ãƒ«" msgid "Invalid format chunk size" msgstr "フォーマットãƒãƒ£ãƒ³ã‚¯ã®ã‚µã‚¤ã‚ºãŒä¸æ­£" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "ä¸æ­£ãªå‘¨æ³¢æ•°" @@ -1365,8 +1381,8 @@ msgstr "ä¸æ­£ãªphase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1386,13 +1402,16 @@ msgstr "å³ãƒãƒ£ãƒãƒ«ã®ãƒ”ンãŒä¸æ­£" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "ピンãŒä¸æ­£" @@ -1413,15 +1432,15 @@ msgstr "ä¸æ­£ãªrun mode" msgid "Invalid security_mode" msgstr "ä¸æ­£ãªsecurity_mode" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" @@ -1458,7 +1477,7 @@ msgstr "レイヤã¯ã™ã§ã«ã‚°ãƒ«ãƒ¼ãƒ—ã«å«ã¾ã‚Œã¦ã„ã¾ã™" msgid "Layer must be a Group or TileGrid subclass." msgstr "レイヤã¯Groupã‹TileGridã®ã‚µãƒ–クラスã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1517,6 +1536,16 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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 ã®ã‚µãƒ–クラスã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" @@ -1534,7 +1563,7 @@ msgstr "%d個ã§ãªã6ã®å€æ•°å€‹ã®rgbピンを使ã£ã¦ãã ã•ã„" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1567,25 +1596,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "MISOピンãªã—" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "MOSIピンãŒã‚ã‚Šã¾ã›ã‚“" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "RXピンãŒã‚ã‚Šã¾ã›ã‚“" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1649,7 +1678,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1713,11 +1743,11 @@ msgstr "奇数パリティã«ã¯å¯¾å¿œã—ã¦ã„ã¾ã›ã‚“" msgid "Only 8 or 16 bit mono with " msgstr "8ã¾ãŸã¯16ビット㮠" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1746,11 +1776,11 @@ msgid "" "%d bpp given" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1761,19 +1791,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "" @@ -1813,12 +1843,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "ParallelBusã«ã¯ã¾ã å¯¾å¿œã—ã¦ã„ã¾ã›ã‚“" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1840,7 +1865,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1891,21 +1916,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "ãƒãƒªã‚´ãƒ³ã«ã¯å°‘ãªãã¨ã‚‚3ã¤ã®ç‚¹ãŒå¿…è¦" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Prefixãƒãƒƒãƒ•ã‚¡ã¯ãƒ’ープ上ã«ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" @@ -1958,12 +1968,12 @@ msgstr "乱数生æˆå™¨ã®åˆæœŸåŒ–エラー" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -1995,7 +2005,7 @@ msgstr "読ã¿è¾¼ã¿å°‚用ã®ãƒ•ã‚¡ã‚¤ãƒ«ã‚·ã‚¹ãƒ†ãƒ " msgid "Read-only object" msgstr "読ã¿è¾¼ã¿å°‚用ã®ã‚ªãƒ–ジェクト" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2011,7 +2021,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "è¦æ±‚ã®AESモードã¯éžå¯¾å¿œ" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2049,7 +2059,7 @@ msgstr "SPIåˆæœŸåŒ–エラー" msgid "SPI Re-initialization error" msgstr "SPIå†åˆæœŸåŒ–エラー" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2092,7 +2102,6 @@ msgid "Size not supported" msgstr "サイズã¯å¯¾å¿œã—ã¦ã„ã¾ã›ã‚“" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2107,7 +2116,7 @@ msgstr "スライスã¨å€¤ã®é•·ã•ãŒä¸€è‡´ã—ã¾ã›ã‚“" msgid "Slices not supported" msgstr "スライスã¯å¯¾å¿œã—ã¦ã„ã¾ã›ã‚“" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2305,7 +2314,7 @@ msgstr "UUIDã®å€¤ãŒstr, int, bufferã®ã„ãšã‚Œã§ã‚‚ã‚ã‚Šã¾ã›ã‚“" msgid "Unable to allocate buffers for signed conversion" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2339,7 +2348,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "想定ã•ã‚Œã¦ã„ãªã„nrfx UUIDåž‹" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2380,7 +2389,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2401,7 +2410,7 @@ msgstr "éžå¯¾å¿œã®æ“作" msgid "Unsupported pull value." msgstr "éžå¯¾å¿œã®pull値" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2415,7 +2424,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2540,7 +2549,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "" @@ -2585,6 +2594,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -2655,7 +2668,7 @@ msgid "byteorder is not a string" msgstr "byteorderãŒæ–‡å­—列ã§ã¯ã‚ã‚Šã¾ã›ã‚“" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -3108,6 +3121,10 @@ msgstr "f-string: 1ã¤ã ã‘ã®'}'ã¯è¨±ã•ã‚Œã¾ã›ã‚“" msgid "file must be a file opened in byte mode" msgstr "fileã¯ãƒã‚¤ãƒˆãƒ¢ãƒ¼ãƒ‰ã§é–‹ã‹ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "filesystemã¯mountメソッドをæä¾›ã—ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" @@ -3269,7 +3286,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "インデクスãŒç¯„囲外" @@ -3396,6 +3413,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "" @@ -3433,6 +3454,10 @@ msgstr "" msgid "invalid syntax for number" msgstr "æ•°å­—ã¨ã—ã¦ä¸æ­£ãªæ§‹æ–‡" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass()ã®ç¬¬1引数ã¯ã‚¯ãƒ©ã‚¹ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" @@ -3493,7 +3518,7 @@ msgstr "" msgid "long int not supported in this build" msgstr "ã“ã®ãƒ“ルドã¯long intã«éžå¯¾å¿œ" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3629,10 +3654,6 @@ msgstr "SDカードãŒã‚ã‚Šã¾ã›ã‚“" msgid "no active exception to reraise" msgstr "" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "利用å¯èƒ½ãªNICãŒã‚ã‚Šã¾ã›ã‚“" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "nonlocalã®å¯¾è±¡ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“" @@ -3650,7 +3671,7 @@ msgid "no module named '%q'" msgstr "'%q' ã¨ã„ã†åå‰ã®ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¯ã‚ã‚Šã¾ã›ã‚“" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "利用å¯èƒ½ãªãƒªã‚»ãƒƒãƒˆãƒ”ンãŒã‚ã‚Šã¾ã›ã‚“" @@ -3890,7 +3911,7 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -3915,29 +3936,40 @@ msgstr "pow()ã®3ã¤ç›®ã®å¼•æ•°ã¯0ã«ã§ãã¾ã›ã‚“" msgid "pow() with 3 arguments requires integers" msgstr "pow()ã®ç¬¬3引数ã«ã¯æ•´æ•°ãŒå¿…è¦" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4128,7 +4160,7 @@ msgstr "stopã¯1ã¾ãŸã¯2ã®ã„ãšã‚Œã‹" msgid "stop not reachable from start" msgstr "" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "ストリームæ“作ã¯éžå¯¾å¿œ" @@ -4180,7 +4212,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time()ã¯9è¦ç´ ã®ã‚·ãƒ¼ã‚±ãƒ³ã‚¹ã‚’å—ã‘å–ã‚Šã¾ã™" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4247,18 +4279,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "タプル/リストã®é•·ã•ãŒæ­£ã—ãã‚ã‚Šã¾ã›ã‚“" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "txã¨rxを両方ã¨ã‚‚Noneã«ã§ãã¾ã›ã‚“" @@ -4337,7 +4369,7 @@ msgid "unreadable attribute" msgstr "読ã¿è¾¼ã¿ä¸å¯èƒ½ãªå±žæ€§" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "éžå¯¾å¿œã®åž‹ %q" @@ -4373,11 +4405,15 @@ msgstr "%q ãŒå¯¾å¿œã—ã¦ã„ãªã„åž‹: '%q', '%q'" msgid "value must fit in %d byte(s)" msgstr "値ã¯%dãƒã‚¤ãƒˆã«åŽã¾ã‚‰ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "value_countã¯0より大ãããªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4394,7 +4430,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4430,7 +4466,7 @@ msgstr "" msgid "x value out of bounds" msgstr "xãŒç¯„囲外" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" @@ -4458,6 +4494,12 @@ msgstr "ziã¯float値ã§ãªã‘ã‚Œã°ãªã‚Šã¾ã›ã‚“" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "ParallelBus not yet supported" +#~ msgstr "ParallelBusã«ã¯ã¾ã å¯¾å¿œã—ã¦ã„ã¾ã›ã‚“" + +#~ msgid "no available NIC" +#~ msgstr "利用å¯èƒ½ãªNICãŒã‚ã‚Šã¾ã›ã‚“" + #~ msgid "Buffer too large and unable to allocate" #~ msgstr "ãƒãƒƒãƒ•ã‚¡ãŒå¤§ãã™ãŽã¦ç¢ºä¿ã§ãã¾ã›ã‚“" diff --git a/locale/ko.po b/locale/ko.po index 556574d372..62015fc268 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -67,6 +67,14 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "" @@ -89,7 +97,11 @@ msgid "%q indices must be integers, not %s" msgstr "%q ì¸ë±ìŠ¤ëŠ” %s ê°€ ì•„ë‹Œ 정수 여야합니다" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -104,14 +116,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -128,10 +132,6 @@ msgstr "" msgid "%q must be >= 1" msgstr "%q 는 >=1ì´ì–´ì•¼í•©ë‹ˆë‹¤" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -140,7 +140,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -169,7 +170,11 @@ msgstr "%q 는 정수(int) 여야합니다" msgid "%q() takes %d positional arguments but %d were given" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -186,7 +191,7 @@ msgstr "" msgid "'%q' object is not an iterator" msgstr "" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "" @@ -319,6 +324,10 @@ 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 "" @@ -344,7 +353,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "" @@ -357,35 +366,38 @@ msgstr "" msgid "Address type out of range" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "ì‚¬ìš©ì¤‘ì¸ ëª¨ë“  I2C주변 기기" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "ì‚¬ìš©ì¤‘ì¸ ëª¨ë“  SPI주변 기기" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "ì‚¬ìš©ì¤‘ì¸ ëª¨ë“  UART주변 기기" +#: 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 "" @@ -413,10 +425,10 @@ msgstr "í•€ì˜ ëª¨ë“  타ì´ë¨¸ê°€ 사용 중입니다" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -437,7 +449,7 @@ msgstr "" msgid "Already running" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "" @@ -490,6 +502,10 @@ msgstr "" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -510,7 +526,7 @@ msgstr "" "ìžë™ 새로 ê³ ì¹¨ì´ ì¼œì ¸ 있습니다. USB를 통해 파ì¼ì„ 저장하여 실행하십시오. 비활" "성화하려면 REPLì„ ìž…ë ¥í•˜ì‹­ì‹œì˜¤.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "" @@ -607,10 +623,10 @@ msgstr "ìž˜ëª»ëœ í¬ê¸°ì˜ 버í¼. >1 여야합니다" msgid "Buffer too short by %d bytes" msgstr "" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "" @@ -627,7 +643,7 @@ msgstr "ë°”ì´íŠ¸ëŠ” 0ì—ì„œ 255 ì‚¬ì´ ì—¬ì•¼í•©ë‹ˆë‹¤." msgid "CBC blocks must be multiples of 16 bytes" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -635,15 +651,15 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -685,7 +701,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -707,7 +723,7 @@ msgstr "" msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -715,7 +731,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "" @@ -732,7 +748,7 @@ msgstr "" msgid "Cannot vary frequency on a timer that is already in use" msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -770,7 +786,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "Command must be an int between 0 and 255" msgstr "ëª…ë ¹ì€ 0ì—ì„œ 255 사ì´ì˜ 정수(int) 여야합니다" @@ -797,7 +813,7 @@ msgid "Could not initialize SDCard" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "" @@ -813,7 +829,7 @@ msgstr "" msgid "Could not restart PWM" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -863,12 +879,12 @@ msgstr "" msgid "DAC already in use" msgstr "DACê°€ 현재 사용 중입니다" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -919,7 +935,8 @@ msgstr "" msgid "ECB only operates on 16 bytes at a time" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -998,7 +1015,7 @@ msgstr "" msgid "FFT is implemented for linear arrays only" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "" @@ -1019,7 +1036,7 @@ 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/esp32s2/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 @@ -1027,11 +1044,11 @@ msgstr "" msgid "Failed to allocate RX buffer of %d bytes" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "" @@ -1047,7 +1064,7 @@ msgstr "" msgid "Failed to connect: timeout" msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "" @@ -1073,12 +1090,12 @@ msgid "File exists" msgstr "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "" @@ -1100,7 +1117,7 @@ msgstr "" msgid "Function requires lock" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1171,7 +1188,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "" @@ -1184,15 +1201,10 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1221,6 +1233,10 @@ msgstr "" msgid "Insufficient encryption" msgstr "" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "" @@ -1230,7 +1246,7 @@ msgstr "" msgid "Internal error #%d" msgstr "" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "" @@ -1251,7 +1267,7 @@ msgstr "" msgid "Invalid ADC Unit value" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1267,7 +1283,7 @@ msgstr "" msgid "Invalid BSSID" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1278,18 +1294,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "" @@ -1308,7 +1324,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c msgid "Invalid capture period. Valid range: 1 - 500" msgstr "" @@ -1338,7 +1354,7 @@ msgstr "파ì¼ì´ 유효하지 않습니다" msgid "Invalid format chunk size" msgstr "í˜•ì‹ ì²­í¬ í¬ê¸°ê°€ 잘못ë˜ì—ˆìŠµë‹ˆë‹¤" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "" @@ -1357,8 +1373,8 @@ msgstr "단계가 잘못ë˜ì—ˆìŠµë‹ˆë‹¤" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1378,13 +1394,16 @@ msgstr "오른쪽 ì±„ë„ í•€ì´ ìž˜ëª»ë˜ì—ˆìŠµë‹ˆë‹¤" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "í•€ì´ ìœ íš¨í•˜ì§€ 않습니다" @@ -1405,15 +1424,15 @@ msgstr "" msgid "Invalid security_mode" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" @@ -1450,7 +1469,7 @@ msgstr "" msgid "Layer must be a Group or TileGrid subclass." msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1509,6 +1528,16 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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 "" @@ -1526,7 +1555,7 @@ msgstr "" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1559,25 +1588,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1641,7 +1670,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1703,11 +1733,11 @@ msgstr "" msgid "Only 8 or 16 bit mono with " msgstr "" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1736,11 +1766,11 @@ msgid "" "%d bpp given" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1751,19 +1781,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "" @@ -1802,12 +1832,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1829,7 +1854,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1880,21 +1905,6 @@ msgstr "" msgid "Polygon needs at least 3 points" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1947,12 +1957,12 @@ msgstr "" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -1984,7 +1994,7 @@ msgstr "" msgid "Read-only object" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2000,7 +2010,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2038,7 +2048,7 @@ msgstr "" msgid "SPI Re-initialization error" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2081,7 +2091,6 @@ msgid "Size not supported" msgstr "" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2096,7 +2105,7 @@ msgstr "" msgid "Slices not supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2294,7 +2303,7 @@ msgstr "" msgid "Unable to allocate buffers for signed conversion" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2328,7 +2337,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2369,7 +2378,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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 "" @@ -2390,7 +2399,7 @@ msgstr "" msgid "Unsupported pull value." msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2404,7 +2413,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2529,7 +2538,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "" @@ -2574,6 +2583,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "" @@ -2644,7 +2657,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "" @@ -3093,6 +3106,10 @@ msgstr "" msgid "file must be a file opened in byte mode" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "" @@ -3254,7 +3271,7 @@ msgid "index is out of bounds" msgstr "" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "" @@ -3380,6 +3397,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "형ì‹ê°€ 유효하지 않습니다" @@ -3417,6 +3438,10 @@ msgstr "구문(syntax)ê°€ 정수가 유효하지 않습니다" msgid "invalid syntax for number" msgstr "숫ìžì— 대한 구문(syntax)ê°€ 유효하지 않습니다" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "" @@ -3477,7 +3502,7 @@ msgstr "" msgid "long int not supported in this build" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3613,10 +3638,6 @@ msgstr "" msgid "no active exception to reraise" msgstr "" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "" @@ -3634,7 +3655,7 @@ msgid "no module named '%q'" msgstr "" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "" @@ -3872,7 +3893,7 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "" @@ -3897,29 +3918,40 @@ msgstr "" msgid "pow() with 3 arguments requires integers" msgstr "" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4109,7 +4141,7 @@ msgstr "" msgid "stop not reachable from start" msgstr "" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "" @@ -4161,7 +4193,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4228,18 +4260,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "" @@ -4318,7 +4350,7 @@ msgid "unreadable attribute" msgstr "" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "" @@ -4354,11 +4386,15 @@ msgstr "" msgid "value must fit in %d byte(s)" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4375,7 +4411,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4411,7 +4447,7 @@ msgstr "" msgid "x value out of bounds" msgstr "" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" diff --git a/locale/nl.po b/locale/nl.po index 73d6276635..e66460bfe6 100644 --- a/locale/nl.po +++ b/locale/nl.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: 2020-12-23 20:14+0000\n" -"Last-Translator: _fonzlate \n" +"PO-Revision-Date: 2021-08-23 14:19+0000\n" +"Last-Translator: Jeff Epler \n" "Language-Team: none\n" "Language: nl\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.4.1-dev\n" +"X-Generator: Weblate 4.8.1-dev\n" #: main.c msgid "" @@ -69,6 +69,14 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "%q fout: %d" @@ -91,7 +99,11 @@ msgid "%q indices must be integers, not %s" msgstr "%q indexen moeten integers zijn, niet %s" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -106,14 +118,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -130,10 +134,6 @@ msgstr "%q moet >= 0 zijn" msgid "%q must be >= 1" msgstr "%q moet >= 1 zijn" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -142,7 +142,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "%q moet een tuple van lengte 2 zijn" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -171,7 +172,11 @@ msgstr "%q moet een int zijn" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() verwacht %d positionele argumenten maar kreeg %d" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -188,7 +193,7 @@ msgstr "'%q' object ondersteunt geen '%q'" msgid "'%q' object is not an iterator" msgstr "'%q' object is geen iterator" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "'%q' object is niet aanroepbaar" @@ -321,6 +326,10 @@ 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" @@ -346,7 +355,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "Een hardware interrupt kanaal is al in gebruik" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "ADC2 wordt gebruikt door WiFi" @@ -359,35 +368,38 @@ msgstr "Adres moet %d bytes lang zijn" msgid "Address type out of range" msgstr "Adres type buiten bereik" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "Alle CAN-peripherals zijn in gebruik" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Alle I2C peripherals zijn in gebruik" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "Alle PCNT-eenheden zijn in gebruik" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "Alle RX FIFO's zijn in gebruik" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Alle SPI peripherals zijn in gebruik" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "Alle UART peripherals zijn in gebruik" +#: 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 "" @@ -415,10 +427,10 @@ msgstr "Alle timers voor deze pin zijn in gebruik" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -439,7 +451,7 @@ msgstr "Heeft al een luisteraar voor 'all-matches'" msgid "Already running" msgstr "Wordt al uitgevoerd" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "Zoekt al naar WiFi netwerken" @@ -492,6 +504,10 @@ msgstr "Poging om %d blokken toe te wijzen" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -512,7 +528,7 @@ msgstr "" "Auto-herlaad staat aan. Sla bestanden simpelweg op over USB om uit te voeren " "of start REPL om uit te schakelen.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "Baudrate wordt niet ondersteund door randapparatuur" @@ -609,10 +625,10 @@ msgstr "Buffer moet op zijn minst lengte 1 zijn" msgid "Buffer too short by %d bytes" msgstr "Buffer is %d bytes te klein" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "Bus pin %d al in gebruik" @@ -629,7 +645,7 @@ msgstr "Bytes moeten tussen 0 en 255 liggen." msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC blocks moeten meervouden van 16 bytes zijn" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -637,15 +653,15 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "Roep super().__init__() aan voor toegang native object." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -688,7 +704,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "Output van beide kanalen kan niet op dezelfde pin" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -711,7 +727,7 @@ msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" "Kan niet resetten naar bootloader omdat er geen bootloader aanwezig is." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -719,7 +735,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "Kan de waarde niet toewijzen als de richting input is." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Kan RTS of CTS niet specificeren in RS485 modus" @@ -736,7 +752,7 @@ msgstr "Kan niet overdragen zonder MOSI en MISO pinnen." 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -774,7 +790,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "Column entry moet digitalio.DigitalInOut zijn" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -803,7 +819,7 @@ 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/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Kan UART niet initialiseren" @@ -819,7 +835,7 @@ msgstr "Kan timer niet her-initialiseren" msgid "Could not restart PWM" msgstr "Kan PWM niet herstarten" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Kon klok niet ophalen" @@ -869,12 +885,12 @@ msgstr "DAC Apparaat Init Fout" msgid "DAC already in use" msgstr "DAC al in gebruik" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "Data 0 pin moet byte uitgelijnd zijn" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -925,7 +941,8 @@ msgstr "Drive modus niet gebruikt als de richting input is." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB werkt alleen met 16 bytes tegelijkertijd" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF geheugen toewijzing mislukt" @@ -1004,7 +1021,7 @@ msgstr "FFT alleen voor ndarrays gedefineerd" msgid "FFT is implemented for linear arrays only" msgstr "FFT is alleen geïmplementeerd voor lineaire arrays" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "SSL handdruk mislukt" @@ -1025,7 +1042,7 @@ 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/esp32s2/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 @@ -1033,11 +1050,11 @@ msgstr "RX buffer alloceren mislukt" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Mislukt een RX buffer van %d bytes te alloceren" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Kon WiFi geheugen niet toewijzen" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "Kon WiFi scan geheugen niet toewijzen" @@ -1053,7 +1070,7 @@ msgstr "Verbinding mislukt: interne fout" msgid "Failed to connect: timeout" msgstr "Verbinding mislukt: timeout" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "Kon WiFi niet initialiseren" @@ -1079,12 +1096,12 @@ msgid "File exists" msgstr "Bestand bestaat" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filters zijn te complex" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "Firmware image is ongeldig" @@ -1107,7 +1124,7 @@ msgstr "" msgid "Function requires lock" msgstr "Functie vereist lock" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1180,7 +1197,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "De initialisatie is mislukt vanwege een gebrek aan geheugen" @@ -1193,15 +1210,10 @@ msgstr "" msgid "Input taking too long" msgstr "Invoer duurt te lang" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Input/Output fout" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1230,6 +1242,10 @@ msgstr "Onvoldoende authenticatie" msgid "Insufficient encryption" msgstr "Onvoldoende encryptie" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "Interne define fout" @@ -1239,7 +1255,7 @@ msgstr "Interne define fout" msgid "Internal error #%d" msgstr "Interne fout #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "Ongeldige %q" @@ -1260,7 +1276,7 @@ msgstr "Ongeldige %q pin selectie" msgid "Invalid ADC Unit value" msgstr "Ongeldige ADC Unit waarde" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1276,7 +1292,7 @@ msgstr "Ongeldig BMP bestand" msgid "Invalid BSSID" msgstr "Ongeldig BSSID" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Ongeldige DAC pin opgegeven" @@ -1287,18 +1303,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "Ongeldige Pin" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Ongeldig argument" @@ -1317,7 +1333,7 @@ msgid "Invalid byteorder string" msgstr "Ongeldige byteorder string" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/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" @@ -1347,7 +1363,7 @@ msgstr "Ongeldig bestand" msgid "Invalid format chunk size" msgstr "Ongeldig formaat stuk grootte" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "Onjuiste frequentie" @@ -1366,8 +1382,8 @@ msgstr "Ongeldige fase" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1387,13 +1403,16 @@ msgstr "Ongeldige pin voor rechter kanaal" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Ongeldige pinnen" @@ -1414,15 +1433,15 @@ msgstr "Ongeldige run modus." msgid "Invalid security_mode" msgstr "Ongeldige security_mode" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "" @@ -1459,7 +1478,7 @@ msgstr "Laag al in groep." msgid "Layer must be a Group or TileGrid subclass." msgstr "Laag moet een Groep of TileGrid subklasse zijn." -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1518,6 +1537,16 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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." @@ -1535,7 +1564,7 @@ msgstr "Een meervoud van 6 rgb pinnen moet worden gebruikt, niet %d" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "NVS-fout" @@ -1568,25 +1597,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "Geen I2C-apparaat op adres: %x" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "Geen MISO pin" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Geen MOSI pin" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Geen RX pin" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1650,7 +1679,8 @@ msgstr "Geen netwerk met dat SSID gevonden" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1714,11 +1744,11 @@ msgstr "Oneven pariteit is niet ondersteund" msgid "Only 8 or 16 bit mono with " msgstr "Alleen 8 of 16 bit mono met " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Alleen IPv4 adressen worden ondersteund" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "Alleen IPv4-sockets ondersteund" @@ -1751,11 +1781,11 @@ msgstr "" "Alleen monochrome en 4bpp of 8bpp, en 16bpp of grotere geïndiceerde BMP's " "zijn ondersteund: %d bpp is gegeven" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1766,19 +1796,19 @@ 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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "Geen sockets meer beschikbaar" @@ -1820,12 +1850,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "ParallelBus nog niet ondersteund" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1847,7 +1872,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1901,25 +1926,6 @@ msgstr "En iedere module in het bestandssysteem\n" msgid "Polygon needs at least 3 points" msgstr "Polygon heeft op zijn minst 3 punten nodig" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" -"Poort ondersteund geen PWM drager. Geef een pin, frequentie en inschakeltijd " -"op" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" -"Poort accepteert geen pin of frequentie. Stel een PWMOut Carrier samen en " -"geef die op" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Prefix buffer moet op de heap zijn" @@ -1974,12 +1980,12 @@ msgstr "RNG Init Fout" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: 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 inversie gespecificeerd terwijl niet in RS485 modus" -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2011,7 +2017,7 @@ msgstr "Alleen-lezen bestandssysteem" msgid "Read-only object" msgstr "Alleen-lezen object" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "" @@ -2027,7 +2033,7 @@ msgstr "RemoteTransmissionRequests is beperkt tot 8 bytes" msgid "Requested AES mode is unsupported" msgstr "Gevraagde AES modus is niet ondersteund" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "" @@ -2065,7 +2071,7 @@ msgstr "SPI Init Fout" msgid "SPI Re-initialization error" msgstr "SPI Herinitialisatie Fout" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2108,7 +2114,6 @@ msgid "Size not supported" msgstr "Afmeting niet ondersteund" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2123,7 +2128,7 @@ msgstr "Slice en waarde hebben verschillende lengtes." msgid "Slices not supported" msgstr "Slices niet ondersteund" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "SocketPool kan alleen met wifi.radio gebruikt worden" @@ -2320,7 +2325,7 @@ msgstr "UUID waarde is geen str, int, of byte buffer" msgid "Unable to allocate buffers for signed conversion" msgstr "Niet in staat buffers voor gesigneerde conversie te alloceren" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "Kan vergrendeling niet maken" @@ -2354,7 +2359,7 @@ msgstr "Kan niet naar sleep_memory schrijven." msgid "Unexpected nrfx uuid type" msgstr "Onverwacht mrfx uuid type" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "Niet behandelde ESP TLS fout %d %d %x %d" @@ -2397,7 +2402,7 @@ msgstr "" "apparaat geweigerd of genegeerd werd." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2418,7 +2423,7 @@ msgstr "Niet-ondersteunde operatie" msgid "Unsupported pull value." msgstr "Niet-ondersteunde pull-waarde." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Update Mislukt" @@ -2432,7 +2437,7 @@ msgstr "Waarde lengte != vereist vaste lengte" msgid "Value length > max_length" msgstr "Waarde length > max_length" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2511,7 +2516,7 @@ msgstr "Je hebt aangeven de veilige modus te starten door " #: py/objtype.c msgid "__init__() should return None" -msgstr "__init __ () zou None moeten retourneren" +msgstr "__init __() zou None moeten retourneren" #: py/objtype.c msgid "__init__() should return None, not '%q'" @@ -2566,7 +2571,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "argument num/typen komen niet overeen" @@ -2611,6 +2616,10 @@ msgstr "as moet None of een integer zijn" msgid "axis too long" msgstr "as te lang" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "verkeerde compileer modus" @@ -2681,7 +2690,7 @@ msgid "byteorder is not a string" msgstr "byteorder is geen string" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "butes > 8 niet ondersteund" @@ -3134,6 +3143,10 @@ msgstr "f-string: enkele '}' is niet toegestaan" msgid "file must be a file opened in byte mode" msgstr "bestand moet een bestand zijn geopend in byte modus" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "bestandssysteem moet een mount methode bieden" @@ -3296,7 +3309,7 @@ msgid "index is out of bounds" msgstr "index is buiten bereik" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index is buiten bereik" @@ -3422,6 +3435,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "ongeldig formaat" @@ -3459,6 +3476,10 @@ msgstr "ongeldige syntax voor integer met grondtal %d" msgid "invalid syntax for number" msgstr "ongeldige syntax voor nummer" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() argument 1 moet een klasse zijn" @@ -3522,7 +3543,7 @@ msgstr "verwijzing naar een (nog) niet toegewezen lokale variabele" msgid "long int not supported in this build" msgstr "long int wordt niet ondersteund in deze build" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + silent mode wordt niet ondersteund door randapparaat" @@ -3658,10 +3679,6 @@ msgstr "geen SD kaart" msgid "no active exception to reraise" msgstr "geen actieve uitzondering om opnieuw op te werpen (raise)" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "geen netwerkadapter (NIC) beschikbaar" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "geen binding voor nonlocal gevonden" @@ -3679,7 +3696,7 @@ msgid "no module named '%q'" msgstr "geen module met naam '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "geen reset pin beschikbaar" @@ -3918,7 +3935,7 @@ msgid "polygon can only be registered in one parent" msgstr "" "polygoon kan slechts bij één object van een hoger niveau worden geregistreerd" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop van een lege PulseIn" @@ -3943,29 +3960,40 @@ msgstr "derde argument van pow() mag geen 0 zijn" msgid "pow() with 3 arguments requires integers" msgstr "pow() met 3 argumenten vereist integers" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "druk bootknop in bij opstarten.\n" @@ -4157,7 +4185,7 @@ msgstr "stop moet 1 of 2 zijn" msgid "stop not reachable from start" msgstr "stop is niet bereikbaar vanaf start" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "stream operatie niet ondersteund" @@ -4209,7 +4237,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() accepteert een 9-rij" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4276,18 +4304,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "tuple of lijst heeft onjuiste lengte" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "twai_driver_install geeft esp-idf fout #%d" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "twai_start geeft esp-idf error #%d" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx en rx kunnen niet beiden None zijn" @@ -4366,7 +4394,7 @@ msgid "unreadable attribute" msgstr "onleesbaar attribuut" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "niet ondersteund %q type" @@ -4402,11 +4430,15 @@ msgstr "niet ondersteunde types voor %q: '%q', '%q'" msgid "value must fit in %d byte(s)" msgstr "waarde moet in %d byte(s) passen" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "value_count moet groter dan 0 zijn" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "watchdog niet geïnitialiseerd" @@ -4423,7 +4455,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "breedte moet groter dan nul zijn" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4459,7 +4491,7 @@ msgstr "onjuist uitvoer type" msgid "x value out of bounds" msgstr "x-waarde buiten bereik" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" @@ -4487,6 +4519,26 @@ 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 "ParallelBus not yet supported" +#~ msgstr "ParallelBus nog niet ondersteund" + +#~ msgid "no available NIC" +#~ msgstr "geen netwerkadapter (NIC) beschikbaar" + +#~ msgid "" +#~ "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +#~ "instead" +#~ msgstr "" +#~ "Poort ondersteund geen PWM drager. Geef een pin, frequentie en " +#~ "inschakeltijd op" + +#~ msgid "" +#~ "Port does not accept pins or frequency. Construct and pass a PWMOut " +#~ "Carrier instead" +#~ msgstr "" +#~ "Poort accepteert geen pin of frequentie. Stel een PWMOut Carrier samen en " +#~ "geef die op" + #~ msgid "Buffer too large and unable to allocate" #~ msgstr "Buffer is te groot en niet in staat te alloceren" diff --git a/locale/pl.po b/locale/pl.po index 262f8c5a89..2a78682165 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -71,6 +71,14 @@ msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "%q niepowodzenie: %d" @@ -93,7 +101,11 @@ msgid "%q indices must be integers, not %s" msgstr "%q indeks musi być liczbÄ… caÅ‚kowitÄ…, a nie %s" #: py/argcheck.c -msgid "%q length must be %q" +msgid "%q length must be %d-%d" +msgstr "" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" msgstr "" #: shared-bindings/vectorio/Polygon.c @@ -108,14 +120,6 @@ msgstr "" msgid "%q must be %d-%d" msgstr "" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "" @@ -132,10 +136,6 @@ msgstr "%q musi być >= 0" msgid "%q must be >= 1" msgstr "%q musi być >= 1" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "" - #: py/argcheck.c msgid "%q must be a string" msgstr "" @@ -144,7 +144,8 @@ msgstr "" msgid "%q must be a tuple of length 2" msgstr "%q musi być krotkÄ… o dÅ‚ugoÅ›ci 2" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c +#: shared-module/vectorio/VectorShape.c msgid "%q must be between %d and %d" msgstr "" @@ -173,7 +174,11 @@ msgstr "%q powinno być typu int" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() bierze %d argumentów pozycyjnych, lecz podano %d" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +msgid "%q, %q, and %q must all be the same length" +msgstr "" + +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #, c-format msgid "%s error 0x%x" msgstr "" @@ -190,7 +195,7 @@ msgstr "Obiekt '%q' nie wspiera '%q'" msgid "'%q' object is not an iterator" msgstr "Obiekt '%q' nie jest iteratorem" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "Obiekt '%q' nie jest wywoÅ‚ywalny" @@ -323,6 +328,10 @@ 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" @@ -348,7 +357,7 @@ msgstr "" msgid "A hardware interrupt channel is already in use" msgstr "KanaÅ‚ przerwaÅ„ sprzÄ™towych w użyciu" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "ADC2 jest używany przez WiFi" @@ -361,35 +370,38 @@ msgstr "Adres musi mieć %d bajtów" msgid "Address type out of range" msgstr "Typ adresu poza zakresem" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "Wszystkie peryferia I2C w użyciu" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Wszystkie peryferia SPI w użyciu" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "Wszystkie peryferia UART w użyciu" +#: 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 "" @@ -417,10 +429,10 @@ msgstr "Wszystkie timery tej nóżki w użyciu" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -441,7 +453,7 @@ msgstr "" msgid "Already running" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "" @@ -494,6 +506,10 @@ msgstr "Próba przydzielenia %d bloków" msgid "Attempted heap allocation when VM not running." msgstr "" +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "" @@ -514,7 +530,7 @@ msgstr "" "Samo-przeÅ‚adowywanie wÅ‚Ä…czone. Po prostu zapisz pliki przez USB aby je " "uruchomić, albo wejdź w konsolÄ™ aby wyÅ‚Ä…czyć.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "" @@ -611,10 +627,10 @@ msgstr "Bufor musi mieć dÅ‚ugość 1 lub wiÄ™cej" msgid "Buffer too short by %d bytes" msgstr "Bufor za krótki o %d bajtów" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "Nóżka magistrali %d jest w użyciu" @@ -631,7 +647,7 @@ msgstr "Bytes musi być miÄ™dzy 0 a 255." msgid "CBC blocks must be multiples of 16 bytes" msgstr "Bloki CBC muszÄ… być wielokrotnoÅ›ciami 16 bajtów" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "" @@ -639,15 +655,15 @@ msgstr "" msgid "Call super().__init__() before accessing native object." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" @@ -689,7 +705,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "Nie można mieć obu kanałów na tej samej nóżce" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot pull on input-only pin." msgstr "" @@ -711,7 +727,7 @@ msgstr "" msgid "Cannot reset into bootloader because no bootloader is present." msgstr "Nie można zrestartować -- nie ma bootloadera." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "" @@ -719,7 +735,7 @@ msgstr "" msgid "Cannot set value when direction is input." msgstr "Nie można ustawić wartoÅ›ci w trybie wejÅ›cia." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Nie można okreÅ›lić RTS ani CTS w trybie RS485" @@ -736,7 +752,7 @@ msgstr "Nie można przesyÅ‚ać bez nóżek MOSI i MISO." 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 "" @@ -774,7 +790,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "Kolumny muszÄ… być typu digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -803,7 +819,7 @@ 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/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Ustawienie UART nie powiodÅ‚o siÄ™" @@ -819,7 +835,7 @@ msgstr "Nie można ponownie zainicjować timera" msgid "Could not restart PWM" msgstr "Nie można ponownie uruchomić PWM" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "" @@ -869,12 +885,12 @@ msgstr "BÅ‚Ä…d inicjowania urzÄ…dzenia DAC" msgid "DAC already in use" msgstr "DAC w użyciu" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "Nóżka data 0 musi być wyrównana do bajtu" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "" @@ -925,7 +941,8 @@ msgstr "Tryb sterowania nieużywany w trybie wejÅ›cia." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB dziaÅ‚a tylko na 16 bajtach naraz" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "" @@ -1004,7 +1021,7 @@ msgstr "" msgid "FFT is implemented for linear arrays only" msgstr "" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "" @@ -1025,7 +1042,7 @@ 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/esp32s2/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 @@ -1033,11 +1050,11 @@ msgstr "Nie udaÅ‚a siÄ™ alokacja bufora RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Nie udaÅ‚a siÄ™ alokacja %d bajtów na bufor RX" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "" @@ -1053,7 +1070,7 @@ 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/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "" @@ -1079,12 +1096,12 @@ msgid "File exists" msgstr "Plik istnieje" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "" @@ -1106,7 +1123,7 @@ msgstr "" msgid "Function requires lock" msgstr "Funkcja wymaga blokady" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "" @@ -1179,7 +1196,7 @@ msgstr "" msgid "Initial set pin state conflicts with initial out pin state" msgstr "" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Inicjalizacja nie powiodÅ‚a siÄ™ z powodu braku pamiÄ™ci" @@ -1192,15 +1209,10 @@ msgstr "" msgid "Input taking too long" msgstr "" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "BÅ‚Ä…d I/O" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1229,6 +1241,10 @@ msgstr "NiewystarczajÄ…ce uwierzytelnienie" msgid "Insufficient encryption" msgstr "NiewystarczajÄ…ce szyfrowanie" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "" @@ -1238,7 +1254,7 @@ msgstr "" msgid "Internal error #%d" msgstr "BÅ‚Ä…d wewnÄ™trzny #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "NieprawidÅ‚owe %q" @@ -1259,7 +1275,7 @@ msgstr "" msgid "Invalid ADC Unit value" msgstr "" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "" @@ -1275,7 +1291,7 @@ msgstr "ZÅ‚y BMP" msgid "Invalid BSSID" msgstr "" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "" @@ -1286,18 +1302,18 @@ msgstr "" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "ZÅ‚y argument" @@ -1316,7 +1332,7 @@ msgid "Invalid byteorder string" msgstr "" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/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" @@ -1346,7 +1362,7 @@ msgstr "ZÅ‚y plik" msgid "Invalid format chunk size" msgstr "ZÅ‚a wielkość fragmentu formatu" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "NieprawidÅ‚owa czÄ™stotliwość" @@ -1365,8 +1381,8 @@ msgstr "ZÅ‚a faza" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1386,13 +1402,16 @@ msgstr "ZÅ‚a nóżka dla prawego kanaÅ‚u" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: 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" @@ -1413,15 +1432,15 @@ msgstr "ZÅ‚y tryb uruchomienia." msgid "Invalid security_mode" msgstr "NieprawidÅ‚owy security_mode" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "NieprawidÅ‚owy rozmiar" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "NieprawidÅ‚owy stan" @@ -1458,7 +1477,7 @@ msgstr "" msgid "Layer must be a Group or TileGrid subclass." msgstr "Layer musi dziedziczyć z Group albo TileGrid." -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "" @@ -1517,6 +1536,16 @@ msgstr "" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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 "" @@ -1534,7 +1563,7 @@ msgstr "" msgid "NLR jump failed. Likely memory corruption." msgstr "" -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "" @@ -1567,25 +1596,25 @@ msgstr "" msgid "No I2C device at address: %x" msgstr "" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "Brak pinu MISO" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Brak pinu MOSI" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Brak nóżki RX" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1649,7 +1678,8 @@ msgstr "" msgid "No out in program" msgstr "" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1711,11 +1741,11 @@ msgstr "Nieparzysta parzystość nie jest wspierana" msgid "Only 8 or 16 bit mono with " msgstr "Tylko 8 lub 16 bitów mono z " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "" @@ -1744,11 +1774,11 @@ msgid "" "%d bpp given" msgstr "" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "" -#: ports/esp32s2/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 @@ -1759,19 +1789,19 @@ msgstr "" msgid "Only one color can be transparent at a time" msgstr "W danym momencie przezroczysty może być tylko jeden kolor" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Brak pamiÄ™ci" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "" @@ -1810,12 +1840,7 @@ msgstr "" msgid "PWM slice channel A already in use" msgstr "" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "ParallelBus nie jest jeszcze obsÅ‚ugiwany" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "" @@ -1837,7 +1862,7 @@ msgstr "" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1888,21 +1913,6 @@ msgstr "Oraz moduÅ‚y w systemie plików\n" msgid "Polygon needs at least 3 points" msgstr "WielokÄ…t musi mieć co najmniej 3 punkty" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -1955,12 +1965,12 @@ msgstr "" msgid "RS485 Not yet supported on this device" msgstr "" -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "RS485 inversion specified when not in RS485 mode" msgstr "" -#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -1992,7 +2002,7 @@ msgstr "System plików tylko do odczytu" msgid "Read-only object" msgstr "Obiekt tylko do odczytu" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Otrzymana odpowiedź byÅ‚a nieprawidÅ‚owa" @@ -2008,7 +2018,7 @@ msgstr "" msgid "Requested AES mode is unsupported" msgstr "Żądany tryb AES nie jest obsÅ‚ugiwany" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Nie znaleziono żądanego zasobu" @@ -2046,7 +2056,7 @@ msgstr "BÅ‚Ä…d inicjowania SPI" msgid "SPI Re-initialization error" msgstr "BÅ‚Ä…d ponownej inicjalizacji SPI" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "" @@ -2089,7 +2099,6 @@ msgid "Size not supported" msgstr "" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "" @@ -2104,7 +2113,7 @@ msgstr "Fragment i wartość sÄ… różnych dÅ‚ugoÅ›ci." msgid "Slices not supported" msgstr "Fragmenty nieobsÅ‚ugiwane" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "" @@ -2301,7 +2310,7 @@ msgstr "UUID nie jest typu str, int lub bytes" msgid "Unable to allocate buffers for signed conversion" msgstr "Nie udaÅ‚a siÄ™ alokacja buforów do konwersji ze znakiem" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "" @@ -2335,7 +2344,7 @@ msgstr "" msgid "Unexpected nrfx uuid type" msgstr "Nieoczekiwany typ nrfx uuid" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "" @@ -2376,7 +2385,7 @@ msgid "" msgstr "" #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2397,7 +2406,7 @@ msgstr "ZÅ‚a operacja" msgid "Unsupported pull value." msgstr "ZÅ‚a wartość podciÄ…gniÄ™cia." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "" @@ -2411,7 +2420,7 @@ msgstr "" msgid "Value length > max_length" msgstr "" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "" @@ -2542,7 +2551,7 @@ msgid "argument name reused" msgstr "" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "zÅ‚a liczba lub typ argumentów" @@ -2587,6 +2596,10 @@ msgstr "" msgid "axis too long" msgstr "" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "" + #: py/builtinevex.c msgid "bad compile mode" msgstr "zÅ‚y tryb kompilacji" @@ -2657,7 +2670,7 @@ msgid "byteorder is not a string" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -3107,6 +3120,10 @@ msgstr "" msgid "file must be a file opened in byte mode" msgstr "file musi być otwarte w trybie bajtowym" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "system plików musi mieć metodÄ™ mount" @@ -3268,7 +3285,7 @@ msgid "index is out of bounds" msgstr "indeks jest poza zakresem" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "indeks poza zakresem" @@ -3394,6 +3411,10 @@ msgstr "" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "" + #: extmod/modframebuf.c msgid "invalid format" msgstr "zÅ‚y format" @@ -3431,6 +3452,10 @@ msgstr "zÅ‚a skÅ‚adnia dla liczby caÅ‚kowitej w bazie %d" msgid "invalid syntax for number" msgstr "zÅ‚a skÅ‚adnia dla liczby" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "argument 1 dla issubclass() musi być klasÄ…" @@ -3491,7 +3516,7 @@ msgstr "zmienna lokalna użyta przed przypisaniem" msgid "long int not supported in this build" msgstr "long int jest nieobsÅ‚ugiwany" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "" @@ -3627,10 +3652,6 @@ msgstr "" msgid "no active exception to reraise" msgstr "brak wyjÄ…tku do ponownego rzucenia" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "brak wolnego NIC" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "brak wiÄ…zania dla zmiennej nielokalnej" @@ -3648,7 +3669,7 @@ msgid "no module named '%q'" msgstr "brak moduÅ‚u o nazwie '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "" @@ -3887,7 +3908,7 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop z pustego PulseIn" @@ -3912,29 +3933,40 @@ msgstr "trzeci argument pow() nie może być 0" msgid "pow() with 3 arguments requires integers" msgstr "trzyargumentowe pow() wymaga liczb caÅ‚kowitych" -#: ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "" @@ -4125,7 +4157,7 @@ msgstr "stop musi być 1 lub 2" msgid "stop not reachable from start" msgstr "stop nie jest osiÄ…galne ze start" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "operacja na strumieniu nieobsÅ‚ugiwana" @@ -4177,7 +4209,7 @@ msgstr "" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() wymaga 9-elementowej sekwencji" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4244,18 +4276,18 @@ msgstr "" msgid "tuple/list has wrong length" msgstr "krotka/lista ma zÅ‚Ä… dÅ‚ugość" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx i rx nie mogÄ… być oba None" @@ -4334,7 +4366,7 @@ msgid "unreadable attribute" msgstr "nieczytelny atrybut" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "zÅ‚y typ %q" @@ -4370,11 +4402,15 @@ msgstr "" msgid "value must fit in %d byte(s)" msgstr "wartość musi mieÅ›cić siÄ™ w %d bajtach" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "value_count musi być > 0" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "" @@ -4391,7 +4427,7 @@ msgstr "" msgid "width must be greater than zero" msgstr "szerokość musi być wiÄ™ksza niż zero" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "" @@ -4427,7 +4463,7 @@ msgstr "nieprawidÅ‚owy typ wyjÅ›cia" msgid "x value out of bounds" msgstr "x poza zakresem" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "" @@ -4455,6 +4491,12 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "ParallelBus not yet supported" +#~ msgstr "ParallelBus nie jest jeszcze obsÅ‚ugiwany" + +#~ msgid "no available NIC" +#~ msgstr "brak wolnego NIC" + #~ msgid "Buffer too large and unable to allocate" #~ msgstr "Bufor jest zbyt duży i nie można go przydzielić" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 3d6fc34ed4..6c7b84e292 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: 2021-07-23 12:45+0000\n" +"PO-Revision-Date: 2021-08-28 01:34+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.7.2-dev\n" +"X-Generator: Weblate 4.8.1-dev\n" #: main.c msgid "" @@ -75,6 +75,14 @@ msgstr "" "%d pinos de endereço, %d pinos rgb e %d blocos indicam uma altura com %d, " "não %d" +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "%q e %q contêm pinos duplicados" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "%q contém pinos duplicados" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "%q falha: %d" @@ -97,8 +105,12 @@ msgid "%q indices must be integers, not %s" msgstr "Os índices %q devem ser inteiros, e não %s" #: py/argcheck.c -msgid "%q length must be %q" -msgstr "o comprimento %q deve ser %q" +msgid "%q length must be %d-%d" +msgstr "o comprimento %q deve ser %d-%d" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" +msgstr "o comprimento %q deve ser >=1" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -112,14 +124,6 @@ msgstr "o %q deve ser <= %d" msgid "%q must be %d-%d" msgstr "o %q deve ser %d-%d" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "%q deve ser entre 0-255" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "%q deve ser 1-255" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "o %q deve ser >= %d" @@ -136,10 +140,6 @@ msgstr "%q deve ser >= 0" msgid "%q must be >= 1" msgstr "%q deve ser >= 1" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "%q deve ser None ou entre 1 e len(report_descriptor)-1" - #: py/argcheck.c msgid "%q must be a string" msgstr "%q deve ser uma string" @@ -148,7 +148,8 @@ msgstr "%q deve ser uma string" msgid "%q must be a tuple of length 2" msgstr "%q deve ser uma tupla de comprimento 2" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: 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" @@ -177,7 +178,11 @@ msgstr "%q deve ser um int" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +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 #, c-format msgid "%s error 0x%x" msgstr "%s erro 0x%x" @@ -194,7 +199,7 @@ msgstr "O objeto '%q' não suporta '%q'" msgid "'%q' object is not an iterator" msgstr "O objeto '%q' não é um iterador" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "O objeto '%s' não é invocável" @@ -331,6 +336,10 @@ 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" @@ -356,7 +365,7 @@ msgstr "Tipos 64 bit" msgid "A hardware interrupt channel is already in use" msgstr "Um canal de interrupção de hardware já está em uso" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "O ADC2 está sendo usado pelo WiFi" @@ -369,35 +378,38 @@ msgstr "O endereço deve ter %d bytes de comprimento" msgid "Address type out of range" msgstr "O tipo do endereço está fora do alcance" -#: ports/esp32s2/common-hal/canio/CAN.c +#: 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/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.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" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "Todas as unidades PCNT estão em uso" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "Todos os FIFOs RX estão em uso" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "Todos os periféricos SPI estão em uso" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "Todos os periféricos UART estão em uso" +#: 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 "Todos os canais estão em uso" @@ -425,10 +437,10 @@ msgstr "Todos os temporizadores para este pino estão em uso" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -449,7 +461,7 @@ msgstr "Já há um ouvinte com todas as correspondências" msgid "Already running" msgstr "Já está em execução" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "Já está em busca das redes de wifi" @@ -503,6 +515,10 @@ msgid "Attempted heap allocation when VM not running." msgstr "" "Tentativa de alocação das pilhas quando o VM não estiver em funcionamento." +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "A conversão de áudio ainda não foi implementada" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "O AuthMode.OPEN não é usado com senha" @@ -523,7 +539,7 @@ msgstr "" "O recarregamento automático está ativo. Simplesmente salve os arquivos via " "USB para executá-los ou digite REPL para desativar.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "O Baudrate não é suportado pelo periférico" @@ -622,10 +638,10 @@ msgstr "O comprimento do buffer deve ter pelo menos 1" msgid "Buffer too short by %d bytes" msgstr "O buffer é muito curto em %d bytes" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "O pino bus %d já está em uso" @@ -642,7 +658,7 @@ msgstr "Os bytes devem estar entre 0 e 255." msgid "CBC blocks must be multiples of 16 bytes" msgstr "Os blocos CBC devem ter múltiplos de 16 bytes" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC ou checksum inválido" @@ -650,17 +666,17 @@ 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" "O alarme só pode acontecer em um pino com nível baixo enquanto os outros " "alarmes só com nível alto a partir do deep sleep." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "" "O alarme só é possível nos dois pinos com sinal baixo a partir do deep sleep." @@ -705,7 +721,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "Não é possível emitir os dois canais no mesmo pino" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." @@ -728,7 +744,7 @@ 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." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "Não foi possível definir as opções do socket" @@ -736,7 +752,7 @@ msgstr "Não foi possível definir as opções do socket" msgid "Cannot set value when direction is input." msgstr "Não é possível definir o valor quando a direção é inserida." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Não é possível definir o RTS ou CTS no modo RS485" @@ -753,7 +769,7 @@ msgstr "Não é possível transferir sem os pinos MOSI e MISO." 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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 (wake) no pino edge. Nível apenas." @@ -791,7 +807,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "A entrada da coluna deve ser digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -819,7 +835,7 @@ 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/esp32s2/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" @@ -835,7 +851,7 @@ msgstr "Não foi possível reiniciar o temporizador" msgid "Could not restart PWM" msgstr "Não foi possível reiniciar o PWM" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Não foi possível recuperar o clock" @@ -885,12 +901,12 @@ msgstr "Erro de Inicialização do Dispositivo DAC" msgid "DAC already in use" msgstr "DAC em uso" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "O pino de dados 0 deve ser alinhado por bytes" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "O pino de dados 0 deve ser alinhado por bytes." @@ -941,7 +957,8 @@ msgstr "O modo do controlador não é usado quando a direção for inserida." msgid "ECB only operates on 16 bytes at a time" msgstr "O BCE opera apenas com 16 bytes por vez" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "Houve uma falha na alocação da memória ESP-IDF" @@ -1020,7 +1037,7 @@ msgstr "O FFT é definido apenas para ndarrays" msgid "FFT is implemented for linear arrays only" msgstr "O FFT é implementado apenas para matrizes lineares" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "Houve uma falha no handshake do SSL" @@ -1041,7 +1058,7 @@ 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/esp32s2/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 @@ -1049,11 +1066,11 @@ msgstr "Falha ao alocar buffer RX" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Falha ao alocar buffer RX de %d bytes" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Houve uma falha na alocação da memória do Wifi" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "Houve uma falha na alocação da memória para a varredura do Wifi" @@ -1069,7 +1086,7 @@ msgstr "Falha ao conectar: erro interno" msgid "Failed to connect: timeout" msgstr "Falha ao conectar: tempo limite" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "Houve uma falha ao iniciar o wifi" @@ -1095,12 +1112,12 @@ msgid "File exists" msgstr "Arquivo já existe" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Os filtros são muito complexos" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "A imagem do firmware é invalida" @@ -1123,7 +1140,7 @@ msgstr "" msgid "Function requires lock" msgstr "A função requer bloqueio" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Falha Genérica" @@ -1200,7 +1217,7 @@ msgstr "" "A definição do estado inicial do pino está em conflito com estado do inicial " "do pino" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "A inicialização falhou devido à falta de memória" @@ -1215,15 +1232,10 @@ msgstr "" msgid "Input taking too long" msgstr "A entrada está demorando demais" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Erro de entrada/saída" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1252,6 +1264,10 @@ msgstr "Autenticação insuficiente" msgid "Insufficient encryption" msgstr "Criptografia insuficiente" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "O buffer interno de áudio é muito pequeno" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "Erro interno de definição" @@ -1261,7 +1277,7 @@ msgstr "Erro interno de definição" msgid "Internal error #%d" msgstr "Erro interno #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "%q Inválido" @@ -1282,7 +1298,7 @@ msgstr "Seleção inválida dos pinos %q" msgid "Invalid ADC Unit value" msgstr "Valor inválido da unidade ADC" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "AuthMode inválido" @@ -1298,7 +1314,7 @@ msgstr "Arquivo BMP inválido" msgid "Invalid BSSID" msgstr "BSSID Inválido" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: 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" @@ -1309,18 +1325,18 @@ msgstr "O arquivo MIDI é inválido" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "Pino inválido" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Argumento inválido" @@ -1339,7 +1355,7 @@ msgid "Invalid byteorder string" msgstr "A cadeia de bytes é inválida" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/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" @@ -1369,7 +1385,7 @@ msgstr "Arquivo inválido" msgid "Invalid format chunk size" msgstr "Tamanho do pedaço de formato inválido" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "Frequência inválida" @@ -1388,8 +1404,8 @@ msgstr "Fase Inválida" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1409,13 +1425,16 @@ msgstr "Pino inválido para canal direito" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Pinos inválidos" @@ -1436,15 +1455,15 @@ msgstr "O modo de execução é inválido." msgid "Invalid security_mode" msgstr "O Security_mode é inválido" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Tamanho inválido" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "Soquete inválido para o TLS" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Estado inválido" @@ -1481,7 +1500,7 @@ 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." -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "Endereço MAC inválido" @@ -1540,6 +1559,16 @@ msgstr "Faltando first_out_pin. A instrução %d escreve nos pinos(s)" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "Faltando first_set_pin. A instrução %d define os pinos(s)" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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." @@ -1557,7 +1586,7 @@ msgstr "Deve utilizar um múltiplo de 6 pinos rgb, não %d" msgid "NLR jump failed. Likely memory corruption." msgstr "O salto NLR falhou. Possível corrupção da memória." -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "Erro NVS" @@ -1590,25 +1619,25 @@ msgstr "Nenhum temporizador DMA foi encontrado" msgid "No I2C device at address: %x" msgstr "Nenhum dispositivo I2C no endereço: %x" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "Nenhum pino MISO" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Nenhum pino MOSI" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Nenhum pino RX" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1672,7 +1701,8 @@ msgstr "Não há rede com este ssid" msgid "No out in program" msgstr "Sem saída no programa" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1737,11 +1767,11 @@ msgstr "A paridade ímpar não é compatível" msgid "Only 8 or 16 bit mono with " msgstr "Apenas mono com 8 ou 16 bits com " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Somente os endereços IPv4 são suportados" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "Apenas soquetes IPv4 são suportados" @@ -1774,11 +1804,11 @@ msgstr "" "São compatíveis apenas os BMPs monocromáticos, indexados em 4bpp ou 8bpp e " "16bpp ou superior: determinado %d bpp" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "Apenas um TouchAlarm pode ser colocado em deep sleep." -#: ports/esp32s2/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 @@ -1789,19 +1819,19 @@ 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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "A operação expirou" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Sem memória" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "Sem soquetes" @@ -1844,12 +1874,7 @@ msgstr "A fatia do PWM já está em uso" msgid "PWM slice channel A already in use" msgstr "O canal A da fatia do PWM já está em uso" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "O ParallelBus ainda não é compatível" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "O periférico está em uso" @@ -1871,7 +1896,7 @@ msgstr "A contagem dos pinos é muito grande" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1925,25 +1950,6 @@ msgstr "Além de quaisquer módulos no sistema de arquivos\n" msgid "Polygon needs at least 3 points" msgstr "O Polígono precisa de pelo menos 3 pontos" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" -"A porta não aceita portadora PWM. Em vez disso informe um pino, frequência e " -"o ciclo de trabalho" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" -"A porta não aceita pinos ou frequência. Em vez disso, construa e passe um " -"PWMOut Carrier" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "" @@ -2001,12 +2007,12 @@ msgstr "Houve um erro na inicialização do RNG" msgid "RS485 Not yet supported on this device" msgstr "Ainda não há suporte para o RS485 neste dispositivo" -#: ports/esp32s2/common-hal/busio/UART.c +#: 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/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2038,7 +2044,7 @@ msgstr "Sistema de arquivos somente leitura" msgid "Read-only object" msgstr "Objeto de leitura apenas" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "A resposta recebida foi inválida" @@ -2054,7 +2060,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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "O recurso solicitado não foi encontrado" @@ -2092,7 +2098,7 @@ msgstr "Houve um erro na inicialização SPI" msgid "SPI Re-initialization error" msgstr "Houve um erro na reinicialização SPI" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "A configuração SPI falhou" @@ -2136,7 +2142,6 @@ msgid "Size not supported" msgstr "O tamanho não é suportado" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "Sleep memory não está disponível" @@ -2151,7 +2156,7 @@ msgstr "Fatie e avalie os diferentes comprimentos." msgid "Slices not supported" msgstr "Fatiamento não compatível" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "O SocketPool só pode ser usado com rádio wifi.radio" @@ -2360,7 +2365,7 @@ msgstr "O valor UUID não é um buffer str, int ou byte" msgid "Unable to allocate buffers for signed conversion" msgstr "Não é possível alocar buffers para conversão assinada" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "Não é possível criar um lock" @@ -2394,7 +2399,7 @@ msgstr "Não foi possível escrever no sleep_memory." msgid "Unexpected nrfx uuid type" msgstr "Tipo uuid nrfx inesperado" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "Erro não tratado do ESP TLS %d %d %x %d" @@ -2437,7 +2442,7 @@ msgstr "" "dispositivo tenha sido recusado ou ignorado." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2458,7 +2463,7 @@ msgstr "Operação não suportada" msgid "Unsupported pull value." msgstr "O valor pull não é compatível." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "A atualização falou" @@ -2472,7 +2477,7 @@ msgstr "Comprimento do valor != comprimento fixo necessário" msgid "Value length > max_length" msgstr "O comprimento do valor é > max_length" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "A versão era inválida" @@ -2609,7 +2614,7 @@ msgid "argument name reused" msgstr "nome do argumento reutilizado" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "o argumento num/tipos não combinam" @@ -2654,6 +2659,10 @@ msgstr "eixo deve ser Nenhum ou um número inteiro" msgid "axis too long" msgstr "o eixo é muito longo" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "valor de fundo fora do intervalo do alvo" + #: py/builtinevex.c msgid "bad compile mode" msgstr "modo de compilação ruim" @@ -2724,7 +2733,7 @@ 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/esp32s2/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" @@ -3182,6 +3191,10 @@ msgstr "f-string: um único '}' não é permitido" msgid "file must be a file opened in byte mode" msgstr "o arquivo deve ser um arquivo aberto no modo byte" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "a gravação de arquivos não está disponível" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "sistema de arquivos deve fornecer método de montagem" @@ -3343,7 +3356,7 @@ msgid "index is out of bounds" msgstr "o índice está fora dos limites" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "Ãndice fora do intervalo" @@ -3470,6 +3483,10 @@ msgstr "tamanho do elemento %d é inválido para bits_per_pixel %d\n" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "element_size %d é inválido, deve ser, 1, 2, ou 4" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "exceção inválida" + #: extmod/modframebuf.c msgid "invalid format" msgstr "formato inválido" @@ -3507,6 +3524,10 @@ msgstr "sintaxe inválida para o número inteiro com base %d" msgid "invalid syntax for number" msgstr "sintaxe inválida para o número" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "rastreamento inválido" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 deve ser uma classe" @@ -3570,7 +3591,7 @@ msgstr "a variável local referenciada antes da atribuição" msgid "long int not supported in this build" msgstr "o long int não é suportado nesta compilação" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "o loopback + o modo silencioso não é suportado pelo periférico" @@ -3708,10 +3729,6 @@ msgstr "nenhum cartão SD" msgid "no active exception to reraise" msgstr "nenhuma exceção ativa para reraise" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "não há uma Placa de Rede disponível" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "nenhuma ligação para nonlocal foi encontrada" @@ -3729,7 +3746,7 @@ msgid "no module named '%q'" msgstr "nenhum módulo chamado '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "nenhum pino de redefinição está disponível" @@ -3972,7 +3989,7 @@ msgstr "o pixel_shader deve ser displayio.Palette ou displayio.ColorConverter" msgid "polygon can only be registered in one parent" msgstr "o polígono só pode ser registrado em um pai" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop a partir de um PulseIn vazio" @@ -3997,29 +4014,40 @@ 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/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "pressionando o botão de boot na inicialização.\n" @@ -4211,7 +4239,7 @@ msgstr "o stop deve ser 1 ou 2" msgid "stop not reachable from start" msgstr "stop não está acessível a partir do início" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "a operação do fluxo não é compatível" @@ -4263,7 +4291,7 @@ msgstr "o bloco deve ser maior que zero" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() leva uma sequência com 9" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4330,18 +4358,18 @@ msgstr "o trapz é definido para iteráveis 1D" msgid "tuple/list has wrong length" msgstr "a tupla/lista está com tamanho incorreto" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "o twai_driver_install retornou um erro esp-idf #%d" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "o twai_start retornou um erro esp-idf #%d" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "TX e RX não podem ser ambos" @@ -4420,7 +4448,7 @@ msgid "unreadable attribute" msgstr "atributo ilegível" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "tipo %q não suportado" @@ -4456,11 +4484,15 @@ msgstr "tipo sem suporte para %q: '%q', '%q'" msgid "value must fit in %d byte(s)" msgstr "o valor deve caber em %d byte(s)" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "valor fora do alcance do alvo" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "o value_count deve ser > 0" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "o watchdog não foi inicializado" @@ -4477,7 +4509,7 @@ msgstr "a largura deve ser entre 2 a 8 (inclusive), não %d" msgid "width must be greater than zero" msgstr "a largura deve ser maior que zero" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "o wifi não está ativo" @@ -4513,7 +4545,7 @@ msgstr "tipo da saída incorreta" msgid "x value out of bounds" msgstr "o valor x está fora dos limites" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "o xTaskCreate falhou" @@ -4541,6 +4573,53 @@ 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 "" +#~ "\n" +#~ "paste mode; Ctrl-C to cancel, Ctrl-D to finish\n" +#~ "=== " +#~ msgstr "" +#~ "\n" +#~ "modo colar; Ctrl-C para cancelar, Ctrl-D para concluir\n" +#~ "=== " + +#~ msgid "ParallelBus not yet supported" +#~ msgstr "O ParallelBus ainda não é compatível" + +#~ msgid "raw REPL; CTRL-B to exit\n" +#~ msgstr "REPL bruto; CTRL-B para encerrar\n" + +#~ msgid "%q length must be %q" +#~ msgstr "o comprimento %q deve ser %q" + +#~ msgid "%q must be 0-255" +#~ msgstr "%q deve ser entre 0-255" + +#~ msgid "%q must be 1-255" +#~ msgstr "%q deve ser 1-255" + +#~ msgid "%q must be None or between 1 and len(report_descriptor)-1" +#~ msgstr "%q deve ser None ou entre 1 e len(report_descriptor)-1" + +#~ msgid "limit should be an int" +#~ msgstr "o limite deve ser um inteiro" + +#~ msgid "no available NIC" +#~ msgstr "não há uma Placa de Rede disponível" + +#~ msgid "" +#~ "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +#~ "instead" +#~ msgstr "" +#~ "A porta não aceita portadora PWM. Em vez disso informe um pino, " +#~ "frequência e o ciclo de trabalho" + +#~ msgid "" +#~ "Port does not accept pins or frequency. Construct and pass a PWMOut " +#~ "Carrier instead" +#~ msgstr "" +#~ "A porta não aceita pinos ou frequência. Em vez disso, construa e passe um " +#~ "PWMOut Carrier" + #~ msgid "Instruction %d jumps on pin" #~ msgstr "A instrução %d salta no pino" diff --git a/locale/sv.po b/locale/sv.po index e60a3152c5..ff8e6378e9 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: 2021-07-22 18:33+0000\n" +"PO-Revision-Date: 2021-08-26 21:34+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.7.2-dev\n" +"X-Generator: Weblate 4.8.1-dev\n" #: main.c msgid "" @@ -72,7 +72,15 @@ msgstr "%%c kräver int eller char" msgid "" "%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d" msgstr "" -"%d adresspinnar, %d rgb-stift och %d brickor anger en höjd pÃ¥ %d, inte %d" +"%d adresspinnar, %d rgb-pinnar och %d brickor anger en höjd pÃ¥ %d, inte %d" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q and %q contain duplicate pins" +msgstr "%q och %q innehÃ¥ller duplicerade pinnar" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "%q innehÃ¥ller dubblettstift" #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" @@ -96,8 +104,12 @@ msgid "%q indices must be integers, not %s" msgstr "Indexet %q mÃ¥ste vara ett heltal, inte %s" #: py/argcheck.c -msgid "%q length must be %q" -msgstr "längden pÃ¥ %q mÃ¥ste vara %q" +msgid "%q length must be %d-%d" +msgstr "längden pÃ¥ %q mÃ¥ste vara %d-%d" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" +msgstr "längden pÃ¥ %q mÃ¥ste vara >= 1" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -111,14 +123,6 @@ msgstr "%q mÃ¥ste vara <=%d" msgid "%q must be %d-%d" msgstr "%q mÃ¥ste vara %d-%d" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "%q mÃ¥ste vara 0-255" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "%q mÃ¥ste vara 1-255" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "%q mÃ¥ste vara >= %d" @@ -135,10 +139,6 @@ msgstr "%q mÃ¥ste vara >= 0" msgid "%q must be >= 1" msgstr "%q mÃ¥ste vara >= 1" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "%q mÃ¥ste vara None eller mellan 1 och len(report_descriptor)-1" - #: py/argcheck.c msgid "%q must be a string" msgstr "%q mÃ¥ste vara en sträng" @@ -147,7 +147,8 @@ msgstr "%q mÃ¥ste vara en sträng" msgid "%q must be a tuple of length 2" msgstr "%q mÃ¥ste vara en tuple av längd 2" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: 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" @@ -174,9 +175,13 @@ msgstr "%q ska vara en int" #: py/bc.c py/objnamedtuple.c msgid "%q() takes %d positional arguments but %d were given" -msgstr "% q () tar% d positionsargument men% d gavs" +msgstr "% q() tar %d positionsargument men %d gavs" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +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 #, c-format msgid "%s error 0x%x" msgstr "%s fel 0x%x" @@ -193,7 +198,7 @@ msgstr "Objektet '%q' stöder inte '%q'" msgid "'%q' object is not an iterator" msgstr "Objektet '%q' är inte en iterator" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "Objektet '%q' kan inte anropas" @@ -326,6 +331,10 @@ 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" @@ -351,7 +360,7 @@ msgstr "64-bitars typer" msgid "A hardware interrupt channel is already in use" msgstr "En kanal för hÃ¥rdvaruavbrott används redan" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "ADC2 används av WiFi" @@ -364,35 +373,38 @@ msgstr "Adressen mÃ¥ste vara %d byte lÃ¥ng" msgid "Address type out of range" msgstr "Adresstyp utanför intervallet" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "All I2C-kringutrustning används" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "All I2C-kringutrustning används" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "Alla PCNT-enheter används" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "Alla RX FIFO i bruk" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "All SPI-kringutrustning används" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "Alla UART-kringutrustning används" +#: 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 "Alla kanaler används" @@ -420,10 +432,10 @@ msgstr "Alla timers för denna pinne är i bruk" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -444,7 +456,7 @@ msgstr "Har redan lyssnare för all-matchningar" msgid "Already running" msgstr "Kör redan" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "Skannar redan efter wifi-nätverk" @@ -497,6 +509,10 @@ msgstr "Försök att tilldela %d block" msgid "Attempted heap allocation when VM not running." msgstr "Försök till heap-allokering när den virtuella maskinen inte är igÃ¥ng." +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "Ljudkonvertering inte implementerad" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN används inte med lösenord" @@ -517,7 +533,7 @@ msgstr "" "Autoladdning är pÃ¥. Spara filer via USB för att köra dem eller ange REPL för " "att inaktivera.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "Baudrate stöds inte av kringutrustning" @@ -614,10 +630,10 @@ msgstr "Bufferten mÃ¥ste ha minst längd 1" msgid "Buffer too short by %d bytes" msgstr "Buffert är %d bytes för kort" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "Busspinne %d används redan" @@ -634,7 +650,7 @@ msgstr "Bytes mÃ¥ste vara mellan 0 och 255." msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC-block mÃ¥ste vara multiplar om 16 byte" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC eller checksumma var ogiltig" @@ -642,16 +658,16 @@ 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on one low pin while others alarm high from deep sleep." msgstr "" "Kan bara larma frÃ¥n djup sömn pÃ¥ lÃ¥g för en pinne medan andra larmar pÃ¥ hög." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on two low pins from deep sleep." msgstr "Kan bara larma frÃ¥n djup sömn pÃ¥ tvÃ¥ lÃ¥ga pinnar." @@ -694,7 +710,7 @@ msgstr "" msgid "Cannot output both channels on the same pin" msgstr "Det gÃ¥r inte att mata ut bÃ¥da kanalerna pÃ¥ samma pinne" -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." @@ -717,7 +733,7 @@ msgid "Cannot reset into bootloader because no bootloader is present." msgstr "" "Det gÃ¥r inte att Ã¥terställa till bootloader eftersom bootloader saknas." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: ports/espressif/common-hal/socketpool/Socket.c msgid "Cannot set socket options" msgstr "Det gÃ¥r inte att ange socketalternativ" @@ -725,7 +741,7 @@ msgstr "Det gÃ¥r inte att ange socketalternativ" msgid "Cannot set value when direction is input." msgstr "Kan inte sätta värde när riktning är input." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "Det gÃ¥r inte att specificera RTS eller CTS i RS485-läget" @@ -742,7 +758,7 @@ msgstr "Kan inte överföra utan MOSI- och MISO-pinnar." 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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Ã¥ nivÃ¥skift, enbart nivÃ¥." @@ -780,7 +796,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "Kolumnposten mÃ¥ste vara digitalio. DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -809,7 +825,7 @@ 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/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "Det gick inte att initiera UART" @@ -825,7 +841,7 @@ msgstr "Det gick inte att Ã¥terinitiera timern" msgid "Could not restart PWM" msgstr "Det gick inte att starta om PWM" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "Kunde inte hämta klocka" @@ -875,12 +891,12 @@ msgstr "Initieringsfel för DAC-enhet" msgid "DAC already in use" msgstr "DAC används redan" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "Datapinne 0 mÃ¥ste vara bytejusterad" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "Datapinne 0 mÃ¥ste vara byte-justerad." @@ -931,7 +947,8 @@ msgstr "Drivläge används inte när riktning är input." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB arbetar endast pÃ¥ 16 byte Ã¥t gÃ¥ngen" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF-minnetilldelning misslyckades" @@ -1010,7 +1027,7 @@ msgstr "FFT är enbart definierade för ndarrays" msgid "FFT is implemented for linear arrays only" msgstr "FTT är enbart implementerad för linjära matriser" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "Misslyckad SSL-handskakning" @@ -1031,7 +1048,7 @@ 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/esp32s2/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 @@ -1039,11 +1056,11 @@ msgstr "Det gick inte att tilldela RX-buffert" msgid "Failed to allocate RX buffer of %d bytes" msgstr "Det gick inte att allokera RX-bufferten pÃ¥ %d byte" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "Det gick inte att allokera WiFi-minne" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "Det gick inte att allokera minne för WiFi-scanning" @@ -1059,7 +1076,7 @@ msgstr "Det gick inte att ansluta: internt fel" msgid "Failed to connect: timeout" msgstr "Det gick inte att ansluta: timeout" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "Kunde inte initiera WiFi" @@ -1085,12 +1102,12 @@ msgid "File exists" msgstr "Filen finns redan" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "Filter för komplexa" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "Firmware-avbilden är ogiltig" @@ -1112,7 +1129,7 @@ msgstr "Frekvensen mÃ¥ste matcha befintlig PWMOut med denna timer" msgid "Function requires lock" msgstr "Funktion kräver lÃ¥s" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "Generiskt fel" @@ -1187,7 +1204,7 @@ msgstr "" "Initial inställning av pinntillstÃ¥nd är i konflikt med initialt " "utpinntillstÃ¥nd" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "Initieringen misslyckades pÃ¥ grund av minnesbrist" @@ -1200,15 +1217,10 @@ msgstr "indatabuffertlängd (%d) mÃ¥ste vara en multipel av antal strand (%d)" msgid "Input taking too long" msgstr "Indata tar för lÃ¥ng tid" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "Indata-/utdatafel" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1237,6 +1249,10 @@ msgstr "Otillräcklig autentisering" msgid "Insufficient encryption" msgstr "Otillräcklig kryptering" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "Intern ljudbuffert för liten" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "Internt define-fel" @@ -1246,7 +1262,7 @@ msgstr "Internt define-fel" msgid "Internal error #%d" msgstr "Internt fel #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "Ogiltig %q" @@ -1267,7 +1283,7 @@ msgstr "Ogiltigt val av %q pinne" msgid "Invalid ADC Unit value" msgstr "Ogiltigt ADC-enhetsvärde" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "Ogiltig AuthMode" @@ -1283,7 +1299,7 @@ msgstr "Ogiltig BMP-fil" msgid "Invalid BSSID" msgstr "Ogiltig BSSID" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: ports/espressif/common-hal/analogio/AnalogOut.c #: ports/stm/common-hal/analogio/AnalogOut.c msgid "Invalid DAC pin supplied" msgstr "Ogiltig DAC-pinne angiven" @@ -1294,18 +1310,18 @@ msgstr "Ogiltig MIDI-fil" #: ports/atmel-samd/common-hal/pwmio/PWMOut.c #: ports/cxd56/common-hal/pwmio/PWMOut.c -#: ports/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "Ogiltig pinne" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Ogiltigt argument" @@ -1324,7 +1340,7 @@ msgid "Invalid byteorder string" msgstr "Ogiltig byteorder-sträng" #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/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" @@ -1354,7 +1370,7 @@ msgstr "Felaktig fil" msgid "Invalid format chunk size" msgstr "Ogiltig formatsegmentstorlek" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "Ogiltig frekvens" @@ -1373,8 +1389,8 @@ msgstr "Ogiltig fas" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1394,13 +1410,16 @@ msgstr "Ogiltig pinne för höger kanal" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: ports/raspberrypi/common-hal/busio/UART.c shared-bindings/busio/SPI.c +#: shared-bindings/busio/UART.c msgid "Invalid pins" msgstr "Ogiltiga pinnar" @@ -1421,15 +1440,15 @@ msgstr "Ogiltigt körläge." msgid "Invalid security_mode" msgstr "Ogiltigt säkerhetsläge" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "Ogiltig storlek" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "Ogiltig socket för TLS" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "Ogiltigt tillstÃ¥nd" @@ -1466,7 +1485,7 @@ 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." -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC-adressen var ogiltig" @@ -1526,6 +1545,16 @@ msgstr "Saknad first_out_pin. Instruktion %d skriver till pinnar" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "Saknad first_set_pin. Instruktion %d sätter pinnar" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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." @@ -1543,7 +1572,7 @@ msgstr "MÃ¥ste använda ett multipel av 6 rgb-pinnar, inte %d" msgid "NLR jump failed. Likely memory corruption." msgstr "NLR jump misslyckades. Troligen korrupt minne." -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "NVS-fel" @@ -1576,25 +1605,25 @@ msgstr "Ingen DMA pacing timer hittades" msgid "No I2C device at address: %x" msgstr "Ingen I2C-enhet pÃ¥ adress: %x" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "Ingen MISO-pinne" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "Ingen MOSI-pinne" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Ingen RX-pinne" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1658,7 +1687,8 @@ msgstr "Inget nätverk med sÃ¥dant ssid" msgid "No out in program" msgstr "Inget out i programmet" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1722,11 +1752,11 @@ msgstr "Udda paritet stöds inte" msgid "Only 8 or 16 bit mono with " msgstr "Endast 8 eller 16 bitars mono med " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "Endast IPv4-adresser stöds" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "Endast IPv4-socket stöds" @@ -1758,11 +1788,11 @@ msgstr "" "Endast monokrom, indexerad 4 bpp eller 8 bpp och 16 bpp eller högre BMP: er " "stöds: %d bpp angiven" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c msgid "Only one TouchAlarm can be set in deep sleep." msgstr "Endast ett TouchAlarm kan ställas in för djupsömn." -#: ports/esp32s2/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 @@ -1773,19 +1803,19 @@ 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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation or feature not supported" msgstr "Operation eller funktion stöds inte" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "Ã…tgärden orsakade timeout" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "Slut pÃ¥ minne" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "Slut pÃ¥ sockets" @@ -1826,12 +1856,7 @@ msgstr "PWM-segment används redan" msgid "PWM slice channel A already in use" msgstr "PWM-segmentkanal A används redan" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "ParallelBus stöds ännu inte" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "Periferi i bruk" @@ -1853,7 +1878,7 @@ msgstr "Antal pinnar för stort" #: ports/atmel-samd/common-hal/analogio/AnalogIn.c #: ports/cxd56/common-hal/analogio/AnalogIn.c -#: ports/esp32s2/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 @@ -1907,25 +1932,6 @@ msgstr "Plus eventuella moduler i filsystemet\n" msgid "Polygon needs at least 3 points" msgstr "Polygonen behöver minst 3 punkter" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "" -"Port accepterar inte PWM carrier. Ange pinne frekvens och arbetscykel " -"istället" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" -"Porten accepterar inte pinne eller frekvens. Skapa och skicka en PWMOut " -"Carrier istället" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Prefixbufferten mÃ¥ste finnas pÃ¥ heap" @@ -1980,12 +1986,12 @@ msgstr "RNG Init-fel" msgid "RS485 Not yet supported on this device" msgstr "RS485 stöds ännu inte pÃ¥ den här enheten" -#: ports/esp32s2/common-hal/busio/UART.c +#: 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/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2017,7 +2023,7 @@ msgstr "Skrivskyddat filsystem" msgid "Read-only object" msgstr "Skrivskyddat objekt" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Received response was invalid" msgstr "Mottaget svar var ogiltigt" @@ -2033,7 +2039,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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Requested resource not found" msgstr "Begärd resurs hittades inte" @@ -2071,7 +2077,7 @@ msgstr "SPI Init-fel" msgid "SPI Re-initialization error" msgstr "SPI reinitialiseringsfel" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "SPI-konfigurationen misslyckades" @@ -2114,7 +2120,6 @@ msgid "Size not supported" msgstr "Storleken stöds inte" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "Sömnminne inte tillgängligt" @@ -2129,7 +2134,7 @@ msgstr "Slice och värde har olika längd." msgid "Slices not supported" msgstr "Slice stöds inte" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "SocketPool kan endast användas med wifi.radio" @@ -2334,7 +2339,7 @@ msgstr "UUID-värdet är inte str, int eller byte-buffert" msgid "Unable to allocate buffers for signed conversion" msgstr "Det gÃ¥r inte att allokera buffert för signerad konvertering" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "Kan inte skapa lÃ¥s" @@ -2368,7 +2373,7 @@ msgstr "Det gick inte att skriva till sleep_memory." msgid "Unexpected nrfx uuid type" msgstr "Oväntad nrfx uuid-typ" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "Ej hanterat ESP TLS-fel %d %d %x %d" @@ -2411,7 +2416,7 @@ msgstr "" "eller ignorerades." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2432,7 +2437,7 @@ msgstr "Ã…tgärd som inte stöds" msgid "Unsupported pull value." msgstr "Ogiltigt Pull-värde." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "Uppdateringen misslyckades" @@ -2446,7 +2451,7 @@ msgstr "Värdets längde ! = krävd fast längd" msgid "Value length > max_length" msgstr "Värdets längd > max_length" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "Versionen var ogiltig" @@ -2524,7 +2529,7 @@ msgstr "Du begärt att starta i felsäkert läge genom att " #: py/objtype.c msgid "__init__() should return None" -msgstr "__init __ () ska returnera None" +msgstr "__init __() ska returnera None" #: py/objtype.c msgid "__init__() should return None, not '%q'" @@ -2579,7 +2584,7 @@ msgid "argument name reused" msgstr "argumentnamn Ã¥teranvänt" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "argument antal/typ matchar inte" @@ -2624,6 +2629,10 @@ msgstr "axis mÃ¥ste vara None eller ett heltal" msgid "axis too long" msgstr "axis för lÃ¥ng" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "värde för bakgrund utanför mÃ¥lintervall" + #: py/builtinevex.c msgid "bad compile mode" msgstr "Ogiltigt kompileringsläge" @@ -2694,7 +2703,7 @@ msgid "byteorder is not a string" msgstr "byteorder är inte en sträng" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -2846,7 +2855,7 @@ msgstr "" #: extmod/ulab/code/ndarray.c msgid "cannot assign new shape" -msgstr "" +msgstr "kan inte tilldela en ny form" #: extmod/ulab/code/ndarray_operators.c msgid "cannot cast output with casting rule" @@ -3148,6 +3157,10 @@ msgstr "f-string: singel '}' är inte tillÃ¥ten" msgid "file must be a file opened in byte mode" msgstr "filen mÃ¥ste vara en fil som öppnats i byte-läge" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "Filskrivning är inte tillgängligt" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "filsystemet mÃ¥ste tillhandahÃ¥lla mount-metod" @@ -3309,7 +3322,7 @@ msgid "index is out of bounds" msgstr "index är utanför gränserna" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "index utanför intervallet" @@ -3435,6 +3448,10 @@ msgstr "ogiltig elementstorlek %d för bits_per_pixel %d\n" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "ogiltig element_size %d, mÃ¥ste vara, 1, 2 eller 4" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "Ogiltig exception" + #: extmod/modframebuf.c msgid "invalid format" msgstr "ogiltigt format" @@ -3472,6 +3489,10 @@ msgstr "ogiltig syntax för heltal med bas %d" msgid "invalid syntax for number" msgstr "ogiltig syntax för tal" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "Ogilitig källspÃ¥rning" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() arg 1 mÃ¥ste vara en klass" @@ -3535,7 +3556,7 @@ msgstr "lokal variabel refererad före tilldelning" msgid "long int not supported in this build" msgstr "long int stöds inte i denna build" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "loopback + tyst läge stöds inte av kringutrustning" @@ -3600,7 +3621,7 @@ msgstr "memoryview: längden är inte en multipel av itemsize" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "mode must be complete, or reduced" -msgstr "" +msgstr "mode mÃ¥ste vara complete, eller reduced" #: py/builtinimport.c msgid "module not found" @@ -3671,10 +3692,6 @@ msgstr "inget SD-kort" msgid "no active exception to reraise" msgstr "ingen aktiv exception för reraise" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "ingen tillgänglig NIC" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "ingen bindning för ickelokal hittad" @@ -3692,7 +3709,7 @@ msgid "no module named '%q'" msgstr "ingen modul med namnet '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "ingen reset-pinne tillgänglig" @@ -3846,11 +3863,11 @@ msgstr "operander kan inte sändas tillsammans" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "operation is defined for 2D arrays only" -msgstr "" +msgstr "operation definierad endast för 2D-matriser" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "operation is defined for ndarrays only" -msgstr "" +msgstr "operation definierad endast för ndarrays" #: extmod/ulab/code/ndarray.c msgid "operation is implemented for 1D Boolean arrays only" @@ -3931,7 +3948,7 @@ msgstr "" msgid "polygon can only be registered in one parent" msgstr "polygon kan endast registreras i en förälder" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "pop frÃ¥n en tom PulseIn" @@ -3956,29 +3973,40 @@ 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/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "trycka pÃ¥ startknappen vid start.\n" @@ -4170,7 +4198,7 @@ msgstr "stop mÃ¥ste vara 1 eller 2" msgid "stop not reachable from start" msgstr "stop kan inte nÃ¥s frÃ¥n start" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "stream-Ã¥tgärd stöds inte" @@ -4222,7 +4250,7 @@ msgstr "tile mÃ¥ste vara större än noll" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() kräver en 9-sekvens" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4289,18 +4317,18 @@ msgstr "trapz är definierat för 1D-iterabla" msgid "tuple/list has wrong length" msgstr "tupel/lista har fel längd" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "twai_driver_install returnerade esp-idf-fel #%d" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "twai_start returnerade esp-idf-fel #%d" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx och rx kan inte bÃ¥da vara None" @@ -4379,7 +4407,7 @@ msgid "unreadable attribute" msgstr "attribut kan inte läsas" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "typ %q stöds inte" @@ -4415,11 +4443,15 @@ msgstr "typen %q stöder inte '%q', '%q'" msgid "value must fit in %d byte(s)" msgstr "värdet mÃ¥ste passa i %d byte(s)" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "värde utanför mÃ¥lintervall" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "value_count mÃ¥ste vara > 0" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "watchdog är inte initierad" @@ -4436,7 +4468,7 @@ msgstr "width mÃ¥ste vara mellan 2 och 8, inte %d" msgid "width must be greater than zero" msgstr "width mÃ¥ste vara större än noll" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "wifi är inte aktiverat" @@ -4472,7 +4504,7 @@ msgstr "fel utdatatyp" msgid "x value out of bounds" msgstr "x-värde utanför intervall" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "xTaskCreate misslyckades" @@ -4500,6 +4532,53 @@ 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 "" +#~ "\n" +#~ "paste mode; Ctrl-C to cancel, Ctrl-D to finish\n" +#~ "=== " +#~ msgstr "" +#~ "\n" +#~ "klistra in-läge; Ctrl-C för att avbryta, Ctrl-D för att avsluta\n" +#~ "=== " + +#~ msgid "ParallelBus not yet supported" +#~ msgstr "ParallelBus stöds ännu inte" + +#~ msgid "raw REPL; CTRL-B to exit\n" +#~ msgstr "rÃ¥ REPL. CTRL-B för att avsluta\n" + +#~ msgid "%q length must be %q" +#~ msgstr "längden pÃ¥ %q mÃ¥ste vara %q" + +#~ msgid "%q must be 0-255" +#~ msgstr "%q mÃ¥ste vara 0-255" + +#~ msgid "%q must be 1-255" +#~ msgstr "%q mÃ¥ste vara 1-255" + +#~ msgid "%q must be None or between 1 and len(report_descriptor)-1" +#~ msgstr "%q mÃ¥ste vara None eller mellan 1 och len(report_descriptor)-1" + +#~ msgid "limit should be an int" +#~ msgstr "limit mÃ¥ste vara en int" + +#~ msgid "no available NIC" +#~ msgstr "ingen tillgänglig NIC" + +#~ msgid "" +#~ "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +#~ "instead" +#~ msgstr "" +#~ "Port accepterar inte PWM carrier. Ange pinne frekvens och arbetscykel " +#~ "istället" + +#~ msgid "" +#~ "Port does not accept pins or frequency. Construct and pass a PWMOut " +#~ "Carrier instead" +#~ msgstr "" +#~ "Porten accepterar inte pinne eller frekvens. Skapa och skicka en PWMOut " +#~ "Carrier istället" + #~ msgid "Instruction %d jumps on pin" #~ msgstr "Instruktion %d hoppar pÃ¥ pinne" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 8f5e42127b..bf540d4bd6 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: 2021-07-06 16:32+0000\n" +"PO-Revision-Date: 2021-09-04 23:34+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.8-dev\n" +"X-Generator: Weblate 4.8.1-dev\n" #: main.c msgid "" @@ -76,6 +76,14 @@ 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" +#: 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" + +#: shared-bindings/microcontroller/Pin.c +msgid "%q contains duplicate pins" +msgstr "%q bÄo hán chóng fù de yÇn jiÇŽo" + #: ports/atmel-samd/common-hal/sdioio/SDCard.c msgid "%q failure: %d" msgstr "%q ShÄ«bài: %d" @@ -98,8 +106,12 @@ msgid "%q indices must be integers, not %s" msgstr "%q suÇ’yÇn bìxÅ« shì zhÄ›ngshù, ér bùshì %s" #: py/argcheck.c -msgid "%q length must be %q" -msgstr "%q cháng dù bì xÅ« wéi %q" +msgid "%q length must be %d-%d" +msgstr "%q cháng dù bì xÅ« wéi %d-%d" + +#: shared-bindings/usb_hid/Device.c +msgid "%q length must be >= 1" +msgstr "%q cháng dù bì xÅ« >= 1" #: shared-bindings/vectorio/Polygon.c msgid "%q list must be a list" @@ -113,14 +125,6 @@ msgstr "%q bì xÅ« <= %d" msgid "%q must be %d-%d" msgstr "%q bì xÅ« wéi %d-%d" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 0-255" -msgstr "%q bì xÅ« wéi 0-255" - -#: shared-bindings/usb_hid/Device.c -msgid "%q must be 1-255" -msgstr "%q bì xÅ« wéi 1-255" - #: py/argcheck.c msgid "%q must be >= %d" msgstr "%q bì xÅ« >= %d" @@ -137,10 +141,6 @@ msgstr "%q BìxÅ« > = 0" msgid "%q must be >= 1" msgstr "%q bìxÅ« dàyú huò dÄ›ngyú 1" -#: shared-bindings/usb_hid/Device.c -msgid "%q must be None or between 1 and len(report_descriptor)-1" -msgstr "%q bì xÅ« wéi wú huò zài 1 hé len(report_descriptor)-1 zhÄ« jiÄn" - #: py/argcheck.c msgid "%q must be a string" msgstr "%q bì xÅ« shì yí gè zì fú chuàn" @@ -149,13 +149,14 @@ msgstr "%q bì xÅ« shì yí gè zì fú chuàn" msgid "%q must be a tuple of length 2" msgstr "%q bìxÅ« shì chángdù wèi 2 de yuán zÇ”" -#: ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c +#: 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" #: ports/atmel-samd/common-hal/busio/UART.c msgid "%q must be power of 2" -msgstr "" +msgstr "%q bì xÅ« shì 2 de gÅng lÇœ" #: py/argcheck.c msgid "%q must of type %q" @@ -178,7 +179,11 @@ msgstr "%q yÄ«nggÄi shì yÄ«gè int" msgid "%q() takes %d positional arguments but %d were given" msgstr "%q() cÇŽiyòng %d wèizhì cÄnshù, dàn gÄ›i chÅ« %d" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: shared-bindings/usb_hid/Device.c +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 #, c-format msgid "%s error 0x%x" msgstr "%s cuò wù 0x%x" @@ -195,7 +200,7 @@ msgstr "'%q' duì xiàng bù zhÄ« chí '%q'" msgid "'%q' object is not an iterator" msgstr "%q' duì xiàng bù shì yí gè liú lÇŽn qì" -#: py/objtype.c py/runtime.c +#: py/objtype.c py/runtime.c shared-module/atexit/__init__.c msgid "'%q' object is not callable" msgstr "%q' duì xiàng bù kÄ› diào yòng" @@ -328,6 +333,10 @@ msgstr "Yì bù hán shù zhÅng de 'yield from'" msgid "'yield' outside function" msgstr "'yield' wàibù gÅngnéng" +#: shared-module/vectorio/VectorShape.c +msgid "(x,y) integers required" +msgstr "(x,y) suÇ’ xÅ« de zhÄ›ng shù" + #: py/compile.c msgid "*x must be assignment target" msgstr "*x bìxÅ« shì rènwù mùbiÄo" @@ -342,7 +351,7 @@ msgstr "0.0 dào fùzá diànyuán" #: py/modbuiltins.c 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" @@ -353,7 +362,7 @@ msgstr "64 wèi lèi xíng" msgid "A hardware interrupt channel is already in use" msgstr "Yìngjiàn zhÅngduàn tÅngdào yÇ zài shÇyòng zhÅng" -#: ports/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "ADC2 is being used by WiFi" msgstr "ADC2 zhèng yóu WiFi shÇ yòng" @@ -366,35 +375,38 @@ msgstr "DìzhÇ bìxÅ« shì %d zì jié zhÇŽng" msgid "Address type out of range" msgstr "DìzhÇ lèixíng chÄochÅ« fànwéi" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "All CAN peripherals are in use" msgstr "suÇ’ yÇ’u CAN wài shè dÅu zài shÇ yòng zhÅng" -#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c msgid "All I2C peripherals are in use" msgstr "SuÇ’yÇ’u I2C wàiwéi qì zhèngzài shÇyòng" -#: ports/esp32s2/common-hal/countio/Counter.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c +#: 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 "suÇ’ yÇ’u zhèng zài shÇ yòng zhÅng de PCNT dÄn yuán" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/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 "SuÇ’yÇ’u shÇyòng zhÅng de RX FIFO" -#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c msgid "All SPI peripherals are in use" msgstr "SuÇ’yÇ’u SPI wàiwéi qì zhèngzài shÇyòng" -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: 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 "SuÇ’yÇ’u UART wàiwéi zhèngzài shÇyòng" +#: 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 "suÇ’ yÇ’u shÇ yòng de tÅng dào" @@ -422,10 +434,10 @@ msgstr "CÇ yÇn jiÇŽo de suÇ’yÇ’u jìshí qì zhèngzài shÇyòng" #: ports/atmel-samd/common-hal/pulseio/PulseIn.c #: ports/atmel-samd/common-hal/pulseio/PulseOut.c #: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c -#: ports/esp32s2/common-hal/neopixel_write/__init__.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c -#: ports/esp32s2/common-hal/pulseio/PulseOut.c +#: ports/espressif/common-hal/frequencyio/FrequencyIn.c +#: ports/espressif/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseOut.c #: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c #: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c #: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -446,7 +458,7 @@ msgstr "yÇ jù yÇ’u quán pÇ pèi zhÄ“n tÄ«ng qì" msgid "Already running" msgstr "yÇ zài yùn xíng" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Already scanning for wifi networks" msgstr "yÇ jÄ«ng sÇŽo miáo WIFI wÇŽng luò" @@ -499,6 +511,10 @@ msgstr "cháng shì fÄ“n pèi %d kuài" msgid "Attempted heap allocation when VM not running." msgstr "dÄng VM bú yùn xíng shí, cháng shì duÄ« fÄ“n pèi." +#: ports/raspberrypi/audio_dma.c +msgid "Audio conversion not implemented" +msgstr "wèi shí xiàn yÄ«n pín zhuÇŽn huàn" + #: shared-bindings/wifi/Radio.c msgid "AuthMode.OPEN is not used with password" msgstr "AuthMode.OPEN wèi shÇ yòng mì mÇŽ" @@ -519,7 +535,7 @@ msgstr "" "Zìdòng chóngxÄ«n jiÄzài. ZhÇ xÅ« tÅngguò USB bÇŽocún wénjiàn lái yùnxíng tÄmen " "huò shÅ«rù REPL jìnyòng.\n" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "Baudrate not supported by peripheral" msgstr "wài shè bù zhÄ« chí de bÅ tè lÄ tè" @@ -616,10 +632,10 @@ msgstr "HuÇŽnchÅng qÅ« bìxÅ« zhìshÇŽo chángdù 1" msgid "Buffer too short by %d bytes" msgstr "HuÇŽn chÅng qÅ« tài duÇŽn , àn %d zì jié" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/esp32s2/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c -#: ports/raspberrypi/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c +#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c #, c-format msgid "Bus pin %d is already in use" msgstr "ZÇ’ngxiàn yÇn jiÇŽo %d yÇ zài shÇyòng zhÅng" @@ -636,7 +652,7 @@ msgstr "Zì jié bìxÅ« jiè yú 0 dào 255 zhÄ« jiÄn." msgid "CBC blocks must be multiples of 16 bytes" msgstr "CBC kuài bì xÅ« shì 16 zì jié de bèi shù" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "CRC or checksum was invalid" msgstr "CRC huò jiào yàn hé wú xiào" @@ -644,17 +660,17 @@ msgstr "CRC huò jiào yàn hé wú xiào" msgid "Call super().__init__() before accessing native object." msgstr "Zài fÇŽngwèn bÄ›n jÄ« wùjiàn zhÄ«qián diàoyòng super().__init__()." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Can only alarm on RTC IO from deep sleep." msgstr "zhÇ néng zài RTC Io shàng cóng shÄ“n dù shuì mián zhÅng bào jÇng." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c 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." -#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: ports/espressif/common-hal/alarm/pin/PinAlarm.c 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." @@ -696,7 +712,7 @@ msgstr "Nín wúfÇŽ sÇŽomiáo kuòzhÇŽn de, kÄ› liánjiÄ“ de guÇŽnggào." 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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." @@ -718,7 +734,7 @@ msgstr "tÅng guò USB kÄ› jiàn shí wú fÇŽ chóng xÄ«n Än zhuÄng '/'." 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." -#: ports/esp32s2/common-hal/socketpool/Socket.c +#: 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" @@ -726,7 +742,7 @@ msgstr "wú fÇŽ shè zhì tào jiÄ“ zì xuÇŽn xiàng" 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í." -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Cannot specify RTS or CTS in RS485 mode" msgstr "wú fÇŽ zài RS485 mó shì xià zhÇ dìng RTS huò CTS" @@ -743,7 +759,7 @@ msgstr "MéiyÇ’u MOSI/MISO jiù wúfÇŽ zhuÇŽnyí." 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/esp32s2/common-hal/alarm/pin/PinAlarm.c +#: 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Än yuán huàn xÇng. jÇn jí bié." @@ -781,7 +797,7 @@ msgid "Column entry must be digitalio.DigitalInOut" msgstr "Liè tiáomù bìxÅ« shì digitalio.DigitalInOut" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.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" @@ -808,7 +824,7 @@ 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/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "Could not initialize UART" msgstr "WúfÇŽ chÅ«shÇhuà UART" @@ -824,7 +840,7 @@ msgstr "WúfÇŽ chóngxÄ«n qÇdòng jìshí qì" msgid "Could not restart PWM" msgstr "WúfÇŽ chóngqÇ PWM" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c +#: ports/espressif/common-hal/neopixel_write/__init__.c msgid "Could not retrieve clock" msgstr "WúfÇŽ huòqÇ” shízhÅng" @@ -874,12 +890,12 @@ msgstr "DAC shèbèi chÅ«shÇhuà cuòwù" msgid "DAC already in use" msgstr "FÄ yuán huì yÇjÄ«ng shÇyòng" -#: ports/atmel-samd/common-hal/displayio/ParallelBus.c -#: ports/nrf/common-hal/displayio/ParallelBus.c +#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c +#: ports/nrf/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned" msgstr "Shùjù 0 de yÇn jiÇŽo bìxÅ« shì zì jié duìqí" -#: ports/esp32s2/common-hal/displayio/ParallelBus.c +#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c msgid "Data 0 pin must be byte aligned." msgstr "shù jù 0 yÇn jiÇŽo bì xÅ« àn zì jié duì qí." @@ -931,7 +947,8 @@ msgstr "FÄngxiàng shÅ«rù shí qÅ«dòng móshì méiyÇ’u shÇyòng." msgid "ECB only operates on 16 bytes at a time" msgstr "ECB yí cì zhÇ shÇ yòng 16 gè zì jié" -#: ports/esp32s2/common-hal/busio/SPI.c ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/espressif/common-hal/canio/CAN.c msgid "ESP-IDF memory allocation failed" msgstr "ESP-IDF nèicún fÄ“npèi shÄ«bài" @@ -1010,7 +1027,7 @@ msgstr "FFT jÇn wéi ndarrays dìng yì" msgid "FFT is implemented for linear arrays only" msgstr "FFT jÇn shì yòng yú xiàn xìng zhèn liè" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c msgid "Failed SSL handshake" msgstr "SSL wòshÇ’u shÄ«bài" @@ -1031,7 +1048,7 @@ 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/esp32s2/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 @@ -1039,11 +1056,11 @@ msgstr "FÄ“npèi RX huÇŽnchÅng shÄ«bài" msgid "Failed to allocate RX buffer of %d bytes" msgstr "FÄ“npèi RX huÇŽnchÅng qÅ«%d zì jié shÄ«bài" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to allocate Wifi memory" msgstr "WúfÇŽ fÄ“npèi Wifi nèicún" -#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c +#: ports/espressif/common-hal/wifi/ScannedNetworks.c msgid "Failed to allocate wifi scan memory" msgstr "WúfÇŽ fÄ“npèi wifi sÇŽomiáo nèicún" @@ -1059,7 +1076,7 @@ msgstr "LiánjiÄ“ shÄ«bài: Nèibù cuòwù" msgid "Failed to connect: timeout" msgstr "LiánjiÄ“ shÄ«bài: ChÄoshí" -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Failed to init wifi" msgstr "WúfÇŽ chÅ«shÇhuà wifi" @@ -1085,12 +1102,12 @@ msgid "File exists" msgstr "Wénjiàn cúnzài" #: ports/atmel-samd/common-hal/canio/Listener.c -#: ports/esp32s2/common-hal/canio/Listener.c +#: ports/espressif/common-hal/canio/Listener.c #: ports/stm/common-hal/canio/Listener.c msgid "Filters too complex" msgstr "guò lÇœ qì tài fù zá" -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Firmware image is invalid" msgstr "gù jiàn yìng xiàng wú xiào" @@ -1112,7 +1129,7 @@ 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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Generic Failure" msgstr "tÅng yòng gù zhàng" @@ -1189,7 +1206,7 @@ msgstr "" "chÅ« shÇ shè zhì yÇn jiÇŽo zhuàng tài yÇ” chÅ« shÇ chÅ« yÇn jiÇŽo zhuàng tài chÅng " "tÅ«" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "Initialization failed due to lack of memory" msgstr "yóu yú nèi cún bù zú, chÅ« shÇ huà shÄ« bài" @@ -1203,15 +1220,10 @@ msgstr "" msgid "Input taking too long" msgstr "ShÅ«rù shíjiÄnguò zhÇŽng" -#: ports/esp32s2/common-hal/neopixel_write/__init__.c py/moduerrno.c +#: ports/espressif/common-hal/neopixel_write/__init__.c py/moduerrno.c msgid "Input/output error" msgstr "ShÅ«rù/shÅ«chÅ« cuòwù" -#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c -#, c-format -msgid "Missing jmp_pin. Instruction %d jumps on pin" -msgstr "" - #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c #, c-format msgid "Instruction %d shifts in more bits than pin count" @@ -1240,6 +1252,10 @@ msgstr "Rènzhèng bùzú" msgid "Insufficient encryption" msgstr "JiÄmì bùzú" +#: ports/atmel-samd/audio_dma.c ports/raspberrypi/audio_dma.c +msgid "Internal audio buffer too small" +msgstr "nèi bù yÄ«n pín huÇŽn chÅng qì tài xiÇŽo" + #: ports/stm/common-hal/busio/UART.c msgid "Internal define error" msgstr "Nèibù dìngyì cuòwù" @@ -1249,7 +1265,7 @@ msgstr "Nèibù dìngyì cuòwù" msgid "Internal error #%d" msgstr "nèi bù cuò wù #%d" -#: shared-bindings/sdioio/SDCard.c +#: shared-bindings/sdioio/SDCard.c shared-module/usb_hid/Device.c msgid "Invalid %q" msgstr "wú xiào %q" @@ -1270,7 +1286,7 @@ msgstr "wú xiào %q yÇn jiÇŽo xuÇŽn zé" msgid "Invalid ADC Unit value" msgstr "Wúxiào de ADC dÄnwèi zhí" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "Invalid AuthMode" msgstr "wú xiào AuthMode" @@ -1286,7 +1302,7 @@ msgstr "Wúxiào de BMP wénjiàn" msgid "Invalid BSSID" msgstr "Wúxiào de BSSID" -#: ports/esp32s2/common-hal/analogio/AnalogOut.c +#: 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" @@ -1297,18 +1313,18 @@ 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/esp32s2/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/esp32s2/common-hal/analogio/AnalogIn.c +#: ports/espressif/common-hal/analogio/AnalogIn.c msgid "Invalid Pin" msgstr "wú xiào yÇn jiÇŽo" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c #: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c msgid "Invalid argument" msgstr "Wúxiào de cÄnshù" @@ -1327,7 +1343,7 @@ 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/esp32s2/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" @@ -1357,7 +1373,7 @@ msgstr "Wúxiào de wénjiàn" msgid "Invalid format chunk size" msgstr "Géshì kuài dàxiÇŽo wúxiào" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Invalid frequency" msgstr "Wúxiào de pínlÇœ" @@ -1376,8 +1392,8 @@ msgstr "JiÄ“duàn wúxiào" #: ports/atmel-samd/common-hal/audioio/AudioOut.c #: ports/atmel-samd/common-hal/touchio/TouchIn.c -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c -#: ports/esp32s2/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" @@ -1397,13 +1413,16 @@ msgstr "Yòuxián tÅngdào yÇn jiÇŽo wúxiào" #: 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/esp32s2/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/SPI.c -#: ports/esp32s2/common-hal/busio/UART.c ports/esp32s2/common-hal/canio/CAN.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/mimxrt10xx/common-hal/busio/I2C.c #: ports/mimxrt10xx/common-hal/busio/SPI.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 +#: 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" @@ -1424,15 +1443,15 @@ msgstr "Wúxiào de yùnxíng móshì." msgid "Invalid security_mode" msgstr "Ä€nquán móshì wúxiào" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid size" msgstr "dà xiÇŽo wú xiào" -#: ports/esp32s2/common-hal/ssl/SSLContext.c +#: ports/espressif/common-hal/ssl/SSLContext.c msgid "Invalid socket for TLS" msgstr "TLS de chÄ zuò wú xiào" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Invalid state" msgstr "wú xiào zhuàng tài" @@ -1469,7 +1488,7 @@ 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." -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "MAC address was invalid" msgstr "MAC dì zhÇ wú xiào" @@ -1529,6 +1548,16 @@ msgstr "xiÄn lòu chÅ« yÇn jiÇŽo. zhÇ lìng %d xiÄ› rù yÇn jiÇŽo" msgid "Missing first_set_pin. Instruction %d sets pin(s)" msgstr "quÄ“ shÇŽo dì yÄ« zÇ” yÇn jiÇŽo. zhÇ lìng %d shè zhì yÇn jiÇŽo" +#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c +#, c-format +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." @@ -1546,7 +1575,7 @@ msgstr "bì xÅ« shÇ yòng 6 RGB yÇn jiÇŽo de bèi shù, ér bù shì %d" msgid "NLR jump failed. Likely memory corruption." msgstr "NLR tiào zhuÇŽn shÄ« bài. kÄ› néng shì nèi cún sÇ”n huài." -#: ports/esp32s2/common-hal/nvm/ByteArray.c +#: ports/espressif/common-hal/nvm/ByteArray.c msgid "NVS Error" msgstr "NVS cuò wù" @@ -1579,25 +1608,25 @@ msgstr "wèi zhÇŽo dào DMA qÇ bó qì" msgid "No I2C device at address: %x" msgstr "dì zhÇ wú I2C shè bèi: %x" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: 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" msgstr "MéiyÇ’u MISO yÇn jiÇŽo" -#: ports/esp32s2/common-hal/busio/SPI.c ports/mimxrt10xx/common-hal/busio/SPI.c -#: ports/stm/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c +#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/stm/common-hal/busio/SPI.c msgid "No MOSI Pin" msgstr "MéiyÇ’u MOSI yÇn jiÇŽo" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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 "Wèi zhÇŽodào RX yÇn jiÇŽo" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/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" @@ -1661,7 +1690,8 @@ msgstr "MéiyÇ’u wÇŽngluò yÇ” gÄi ssid" msgid "No out in program" msgstr "chéng xù zhÅng wèi tuì chÅ«" -#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c +#: ports/atmel-samd/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c #: 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" @@ -1724,11 +1754,11 @@ msgstr "Bù zhÄ«chí jÄ«shù" msgid "Only 8 or 16 bit mono with " msgstr "ZhÇyÇ’u 8 huò 16 wèi dÄnwèi " -#: ports/esp32s2/common-hal/wifi/__init__.c +#: ports/espressif/common-hal/wifi/__init__.c msgid "Only IPv4 addresses supported" msgstr "JÇn zhÄ«chí IPv4 dìzhÇ" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Only IPv4 sockets supported" msgstr "jÇn zhÄ« chí IPv4 tào jiÄ“ zì" @@ -1761,11 +1791,11 @@ msgstr "" "JÇn zhÄ«chí dÄn sè, suÇ’yÇn wéi 4bpp huò 8bpp yÇjí 16bpp huò gèng gÄo de BMP: " "GÄ›i chÅ« %d bpp" -#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c +#: ports/espressif/common-hal/alarm/touch/TouchAlarm.c 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/esp32s2/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 @@ -1776,19 +1806,19 @@ 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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Operation timed out" msgstr "cÄo zuò yÇ fÄ“n shí" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Out of memory" msgstr "nèi cún bù zú" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "Out of sockets" msgstr "tào jiÄ“ zì wài" @@ -1828,12 +1858,7 @@ msgstr "yÇ jÄ«ng zài shÇ yòng de PWM qiÄ“ piàn" msgid "PWM slice channel A already in use" msgstr "PWM qiÄ“ piàn tÅng dào A yÇ zài shÇ yòng zhÅng" -#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c -#: ports/stm/common-hal/displayio/ParallelBus.c -msgid "ParallelBus not yet supported" -msgstr "Shàng bù zhÄ«chí ParallelBus" - -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "Peripheral in use" msgstr "shÇ yòng zhÅng de wài shè" @@ -1855,7 +1880,7 @@ 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/esp32s2/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 @@ -1909,22 +1934,6 @@ msgstr "Zài wénjiàn xìtÇ’ng shàng tiÄnjiÄ rènhé mókuài\n" msgid "Polygon needs at least 3 points" msgstr "DuÅbiÄnxíng zhìshÇŽo xÅ«yào 3 diÇŽn" -#: ports/esp32s2/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " -"instead" -msgstr "DuÄnkÇ’u bù jiÄ“shòu PWM zàibÅ. TÅngguò yÇn jiÇŽo, pínlÇœ hé zhàn kÅng bÇ" - -#: ports/atmel-samd/common-hal/pulseio/PulseOut.c -#: ports/cxd56/common-hal/pulseio/PulseOut.c -#: ports/nrf/common-hal/pulseio/PulseOut.c -#: ports/stm/common-hal/pulseio/PulseOut.c -msgid "" -"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier " -"instead" -msgstr "" -"DuÄnkÇ’u bù jiÄ“shòu yÇn jiÇŽo huò pínlÇœ. Gòuzào bìng chuándì PWMOut zàibÅ" - #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" msgstr "Qiánzhuì huÇŽnchÅng qÅ« bìxÅ« zài duÄ« shàng" @@ -1979,12 +1988,12 @@ msgstr "RNG chÅ«shÇhuà cuòwù" msgid "RS485 Not yet supported on this device" msgstr "RS485 cÇ shè bèi shàng bù zhÄ« chí" -#: ports/esp32s2/common-hal/busio/UART.c +#: 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/esp32s2/common-hal/rtc/RTC.c +#: 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" @@ -2016,7 +2025,7 @@ msgstr "ZhÇ dú wénjiàn xìtÇ’ng" msgid "Read-only object" msgstr "ZhÇ dú duìxiàng" -#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/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" @@ -2032,7 +2041,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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/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" @@ -2070,7 +2079,7 @@ msgstr "SPI chÅ«shÇhuà cuòwù" msgid "SPI Re-initialization error" msgstr "SPI chóngxÄ«n chÅ«shÇhuà cuòwù" -#: ports/esp32s2/common-hal/busio/SPI.c +#: ports/espressif/common-hal/busio/SPI.c msgid "SPI configuration failed" msgstr "SPI pèi zhì shÄ« bài" @@ -2113,7 +2122,6 @@ msgid "Size not supported" msgstr "bù zhÄ« chí dà xiÇŽo" #: ports/raspberrypi/common-hal/alarm/SleepMemory.c -#: ports/stm/common-hal/alarm/SleepMemory.c msgid "Sleep Memory not available" msgstr "shuì mián jì yì bù kÄ› yòng" @@ -2128,7 +2136,7 @@ msgstr "QiÄ“piàn hé zhí bùtóng chángdù." msgid "Slices not supported" msgstr "QiÄ“piàn bù shòu zhÄ«chí" -#: ports/esp32s2/common-hal/socketpool/SocketPool.c +#: ports/espressif/common-hal/socketpool/SocketPool.c msgid "SocketPool can only be used with wifi.radio" msgstr "SocketPool zhÇ néng yÇ” wifi.Radio yÄ«qÇ shÇyòng" @@ -2332,7 +2340,7 @@ msgstr "UUID zhí bùshì str,int huò zì jié huÇŽnchÅng qÅ«" msgid "Unable to allocate buffers for signed conversion" msgstr "WúfÇŽ fÄ“npèi huÇŽnchÅng qÅ« yòng yú qiÄnmíng zhuÇŽnhuàn" -#: ports/esp32s2/common-hal/busio/I2C.c +#: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" msgstr "WúfÇŽ chuàngjiàn suÇ’" @@ -2366,7 +2374,7 @@ msgstr "wú fÇŽ xiÄ› rù sleep_memory." msgid "Unexpected nrfx uuid type" msgstr "Yìwài de nrfx uuid lèixíng" -#: ports/esp32s2/common-hal/ssl/SSLSocket.c +#: ports/espressif/common-hal/ssl/SSLSocket.c #, c-format msgid "Unhandled ESP TLS error %d %d %x %d" msgstr "Wèi chÇ”lÇ de ESP TLS cuòwù %d %d %x %d" @@ -2409,7 +2417,7 @@ msgstr "" "huò hÅ«lüè." #: ports/atmel-samd/common-hal/busio/I2C.c ports/cxd56/common-hal/busio/I2C.c -#: ports/esp32s2/common-hal/busio/UART.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" @@ -2430,7 +2438,7 @@ msgstr "Bù zhÄ«chí de cÄozuò" msgid "Unsupported pull value." msgstr "Bù zhÄ«chí de lÄdòng zhí." -#: ports/esp32s2/common-hal/dualbank/__init__.c +#: ports/espressif/common-hal/dualbank/__init__.c msgid "Update Failed" msgstr "gÄ“ng xÄ«n shÄ« bài" @@ -2444,7 +2452,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/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c +#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c msgid "Version was invalid" msgstr "bÇŽn bÄ›n wú xiào" @@ -2539,7 +2547,7 @@ msgstr "xÅ«yào yÄ«gè zì jié lèi duìxiàng" #: lib/embed/abort_.c msgid "abort() called" -msgstr "zhÅngzhÇ () diàoyòng" +msgstr "abort() diàoyòng" #: shared-bindings/i2cperipheral/I2CPeripheral.c msgid "address out of bounds" @@ -2578,7 +2586,7 @@ msgid "argument name reused" msgstr "chóng fù shÇ yòng de cÄn shù míng chÄ“ng" #: py/argcheck.c shared-bindings/_stage/__init__.c -#: shared-bindings/digitalio/DigitalInOut.c shared-bindings/gamepad/GamePad.c +#: shared-bindings/digitalio/DigitalInOut.c msgid "argument num/types mismatch" msgstr "cÄnshù biÄnhào/lèixíng bù pÇpèi" @@ -2623,6 +2631,10 @@ msgstr "zhóu bì xÅ« wéi \" wú \" huò zhÄ›ng shù" msgid "axis too long" msgstr "zhóu tài cháng" +#: shared-bindings/bitmaptools/__init__.c +msgid "background value out of range of target" +msgstr "bèi jÇng zhí tuÅ lí mù biÄo fàn wéi" + #: py/builtinevex.c msgid "bad compile mode" msgstr "biÄnyì móshì cuòwù" @@ -2693,7 +2705,7 @@ msgid "byteorder is not a string" msgstr "byteorder bùshì zìfú chuàn" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c msgid "bytes > 8 bits not supported" msgstr "zì jié > 8 wèi" @@ -2843,7 +2855,7 @@ msgstr "wúfÇŽ cóng shÇ’udòng zìduàn guÄ«gé qiÄ“huàn dào zìdòng zìduà #: extmod/ulab/code/ndarray.c msgid "cannot assign new shape" -msgstr "" +msgstr "wú fÇŽ fÄ“n pèi xÄ«n xíng zhuàng" #: extmod/ulab/code/ndarray_operators.c msgid "cannot cast output with casting rule" @@ -3148,6 +3160,10 @@ msgstr "f-string: bù yÇ”nxÇ” shÇyòng dÄngè '}'" msgid "file must be a file opened in byte mode" msgstr "wénjiàn bìxÅ« shì zài zì jié móshì xià dÇŽkÄi de wénjiàn" +#: shared-bindings/traceback/__init__.c +msgid "file write is not available" +msgstr "wén jiàn biÄn xiÄ› bù kÄ› yòng" + #: shared-bindings/storage/__init__.c msgid "filesystem must provide mount method" msgstr "wénjiàn xìtÇ’ng bìxÅ« tígÅng guà zài fÄngfÇŽ" @@ -3170,7 +3186,7 @@ msgstr "dì yÄ« gè cÄnshù bìxÅ« shì ndarray" #: py/objtype.c msgid "first argument to super() must be type" -msgstr "chÄojí () de dì yÄ« gè cÄnshù bìxÅ« shì lèixíng" +msgstr "super() de dì yÄ« gè cÄnshù bìxÅ« shì lèixíng" #: extmod/ulab/code/scipy/linalg/linalg.c msgid "first two arguments must be ndarrays" @@ -3309,7 +3325,7 @@ msgid "index is out of bounds" msgstr "suÇ’yÇn chÄochÅ« fànwéi" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c -#: ports/esp32s2/common-hal/pulseio/PulseIn.c py/obj.c +#: ports/espressif/common-hal/pulseio/PulseIn.c py/obj.c #: shared-bindings/bitmaptools/__init__.c msgid "index out of range" msgstr "suÇ’yÇn chÄochÅ« fànwéi" @@ -3435,6 +3451,10 @@ msgstr "wú xiào yuán jiàn dà xiÇŽo %d wéi bits_per_pixel %d\n" msgid "invalid element_size %d, must be, 1, 2, or 4" msgstr "wú xiào element_size %d, bì xÅ« shì, 1, 2, huò 4" +#: shared-bindings/traceback/__init__.c +msgid "invalid exception" +msgstr "wú xiào lì wài" + #: extmod/modframebuf.c msgid "invalid format" msgstr "wúxiào géshì" @@ -3472,6 +3492,10 @@ msgstr "jÄ«shù wèi %d de zhÄ›ng shÇ” de yÇ”fÇŽ wúxiào" msgid "invalid syntax for number" msgstr "wúxiào de hàomÇŽ yÇ”fÇŽ" +#: py/objexcept.c shared-bindings/traceback/__init__.c +msgid "invalid traceback" +msgstr "wú xiào zhuÄ« sù" + #: py/objtype.c msgid "issubclass() arg 1 must be a class" msgstr "issubclass() cÄnshù 1 bìxÅ« shì yÄ«gè lèi" @@ -3533,7 +3557,7 @@ msgstr "fùzhí qián yÇnyòng de júbù biànliàng" msgid "long int not supported in this build" msgstr "cÇ bÇŽnbÄ›n bù zhÄ«chí zhÇŽng zhÄ›ngshù" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c msgid "loopback + silent mode not supported by peripheral" msgstr "Wài shè bù zhÄ« chí huán huí + jìng yÄ«n mó shì" @@ -3598,7 +3622,7 @@ msgstr "nèi cún shì tú: cháng dù bú shì xiàng mù huà de bèi shù" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "mode must be complete, or reduced" -msgstr "" +msgstr "mó shì bì xÅ« wán chéng huò jiÇŽn shÇŽo" #: py/builtinimport.c msgid "module not found" @@ -3669,10 +3693,6 @@ msgstr "méiyÇ’u SD kÇŽ" msgid "no active exception to reraise" msgstr "méiyÇ’u jÄ«huó de yìcháng lái chóngxÄ«n píngjià" -#: shared-bindings/socket/__init__.c shared-module/network/__init__.c -msgid "no available NIC" -msgstr "méiyÇ’u kÄ›yòng de NIC" - #: py/compile.c msgid "no binding for nonlocal found" msgstr "zhÇŽo bù dào fÄ“i bÄ›ndì de bÇŽng dìng" @@ -3690,7 +3710,7 @@ msgid "no module named '%q'" msgstr "méiyÇ’u mókuài '%q'" #: shared-bindings/displayio/FourWire.c shared-bindings/displayio/I2CDisplay.c -#: shared-bindings/displayio/ParallelBus.c +#: shared-bindings/paralleldisplay/ParallelBus.c msgid "no reset pin available" msgstr "MéiyÇ’u kÄ›yòng de fùwèi yÇn jiÇŽo" @@ -3844,11 +3864,11 @@ msgstr "cÄozuò shÇ” bùnéng yÄ«qÇ guÇŽngbò" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "operation is defined for 2D arrays only" -msgstr "" +msgstr "jÇn zhÄ“n duì 2D zhèn liè dìng yì cÄo zuò" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "operation is defined for ndarrays only" -msgstr "" +msgstr "cÄo zuò jÇn dìng yì wéi ndarrays" #: extmod/ulab/code/ndarray.c msgid "operation is implemented for 1D Boolean arrays only" @@ -3928,7 +3948,7 @@ msgstr "pixel_shader bìxÅ« shì displayio.Palette huò displayio.ColorConverter 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è" -#: ports/esp32s2/common-hal/pulseio/PulseIn.c +#: ports/espressif/common-hal/pulseio/PulseIn.c msgid "pop from an empty PulseIn" msgstr "cóng kÅng mài chÅng tán chÅ«" @@ -3953,29 +3973,40 @@ 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/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h -#: ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/artisense_rd00/mpconfigboard.h -#: ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h -#: ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h -#: ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h -#: ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h -#: ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h -#: ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h -#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h -#: ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h -#: ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h -#: ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h +#: ports/espressif/boards/adafruit_feather_esp32s2_nopsram/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/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_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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h +#: ports/espressif/boards/lolin_s2_mini/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_tinys2/mpconfigboard.h msgid "pressing boot button at start up.\n" msgstr "Zài qÇdòng shí àn qÇdòng ànniÇ”.\n" @@ -4167,7 +4198,7 @@ msgstr "tíngzhÇ bìxÅ« wèi 1 huò 2" msgid "stop not reachable from start" msgstr "tíngzhÇ wúfÇŽ cóng kÄishÇ zhÅng zhÇŽodào" -#: py/stream.c +#: py/stream.c shared-bindings/getpass/__init__.c msgid "stream operation not supported" msgstr "bù zhÄ«chí liú cÄozuò" @@ -4219,7 +4250,7 @@ msgstr "cí tiÄ“ bì xÅ« dà yú líng" msgid "time.struct_time() takes a 9-sequence" msgstr "time.struct_time() xÅ«yào 9 xùliè" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c #: ports/nrf/common-hal/watchdog/WatchDogTimer.c #: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c msgid "timeout duration exceeded the maximum supported value" @@ -4286,18 +4317,18 @@ msgstr "tÄ« xíng dìng yì wéi yì wéi kÄ› dié dài duì xiàng" msgid "tuple/list has wrong length" msgstr "yuán zÇ”/lièbiÇŽo chángdù cuòwù" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_driver_install returned esp-idf error #%d" msgstr "twai_driver_install fÇŽn huí esp-idf cuò wù #%d" -#: ports/esp32s2/common-hal/canio/CAN.c +#: ports/espressif/common-hal/canio/CAN.c #, c-format msgid "twai_start returned esp-idf error #%d" msgstr "twai_start fÇŽn huí esp -idf cuò wù #%d" #: ports/atmel-samd/common-hal/busio/UART.c -#: ports/esp32s2/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c +#: ports/espressif/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c #: shared-bindings/busio/UART.c shared-bindings/canio/CAN.c msgid "tx and rx cannot both be None" msgstr "tx hé rx bùnéng dÅu shì wú" @@ -4376,7 +4407,7 @@ msgid "unreadable attribute" msgstr "bùkÄ› dú shÇ”xìng" #: shared-bindings/displayio/TileGrid.c shared-bindings/vectorio/VectorShape.c -#: shared-module/vectorio/Polygon.c +#: shared-module/vectorio/Polygon.c shared-module/vectorio/VectorShape.c msgid "unsupported %q type" msgstr "bù zhÄ«chí %q lèixíng" @@ -4412,11 +4443,15 @@ msgstr "%q bù zhÄ«chí de lèixíng: '%q', '%q'" msgid "value must fit in %d byte(s)" msgstr "Zhí bìxÅ« fúhé %d zì jié" +#: shared-bindings/bitmaptools/__init__.c +msgid "value out of range of target" +msgstr "zhí fàn wéi wài de mù biÄo" + #: shared-bindings/displayio/Bitmap.c msgid "value_count must be > 0" msgstr "zhí jìshù bìxÅ« wèi > 0" -#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c +#: ports/espressif/common-hal/watchdog/WatchDogTimer.c msgid "watchdog not initialized" msgstr "wèi chÅ« shÇ huà jiÄn shì qì" @@ -4433,7 +4468,7 @@ msgstr "kuÄn dù bì xÅ« cóng 2 dào 8 ( hán ), ér bù shì %d" msgid "width must be greater than zero" msgstr "kuÄndù bìxÅ« dàyú líng" -#: ports/esp32s2/common-hal/wifi/Radio.c +#: ports/espressif/common-hal/wifi/Radio.c msgid "wifi is not enabled" msgstr "wèi qÇ yòng WIFI" @@ -4469,7 +4504,7 @@ msgstr "cuòwù de shÅ«chÅ« lèixíng" msgid "x value out of bounds" msgstr "x zhí chÄochÅ« biÄnjiè" -#: ports/esp32s2/common-hal/audiobusio/__init__.c +#: ports/espressif/common-hal/audiobusio/__init__.c msgid "xTaskCreate failed" msgstr "xTaskCreate shÄ« bài" @@ -4497,6 +4532,48 @@ 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 "" +#~ "\n" +#~ "paste mode; Ctrl-C to cancel, Ctrl-D to finish\n" +#~ "=== " +#~ msgstr "" +#~ "\n" +#~ "zhÄn tiÄ“ mó shì; Ctrl-C qÇ” xiÄo, Ctrl-D wán chéngh\n" +#~ "=== " + +#~ msgid "ParallelBus not yet supported" +#~ msgstr "Shàng bù zhÄ«chí ParallelBus" + +#~ msgid "raw REPL; CTRL-B to exit\n" +#~ msgstr "yuán shÇ REPL; CTRL-B tuì chÅ«\n" + +#~ msgid "%q length must be %q" +#~ msgstr "%q cháng dù bì xÅ« wéi %q" + +#~ msgid "%q must be 0-255" +#~ msgstr "%q bì xÅ« wéi 0-255" + +#~ msgid "%q must be 1-255" +#~ msgstr "%q bì xÅ« wéi 1-255" + +#~ msgid "%q must be None or between 1 and len(report_descriptor)-1" +#~ msgstr "%q bì xÅ« wéi wú huò zài 1 hé len(report_descriptor)-1 zhÄ« jiÄn" + +#~ msgid "no available NIC" +#~ msgstr "méiyÇ’u kÄ›yòng de NIC" + +#~ msgid "" +#~ "Port does not accept PWM carrier. Pass a pin, frequency and duty cycle " +#~ "instead" +#~ msgstr "" +#~ "DuÄnkÇ’u bù jiÄ“shòu PWM zàibÅ. TÅngguò yÇn jiÇŽo, pínlÇœ hé zhàn kÅng bÇ" + +#~ msgid "" +#~ "Port does not accept pins or frequency. Construct and pass a PWMOut " +#~ "Carrier instead" +#~ msgstr "" +#~ "DuÄnkÇ’u bù jiÄ“shòu yÇn jiÇŽo huò pínlÇœ. Gòuzào bìng chuándì PWMOut zàibÅ" + #~ msgid "Instruction %d jumps on pin" #~ msgstr "zhÇ lìng %d zài yÇn jiÇŽo shàng tiào zhuÇŽn" diff --git a/main.c b/main.c index c6801dca7d..d6ed269809 100755 --- a/main.c +++ b/main.c @@ -70,6 +70,10 @@ #include "shared-bindings/alarm/__init__.h" #endif +#if CIRCUITPY_ATEXIT +#include "shared-module/atexit/__init__.h" +#endif + #if CIRCUITPY_BLEIO #include "shared-bindings/_bleio/__init__.h" #include "supervisor/shared/bluetooth/bluetooth.h" @@ -208,11 +212,11 @@ STATIC bool maybe_run_list(const char * const * filenames, pyexec_result_t* exec return false; } mp_hal_stdout_tx_str(filename); - const compressed_string_t* compressed = translate(" output:\n"); - char decompressed[decompress_length(compressed)]; - decompress(compressed, decompressed); - mp_hal_stdout_tx_str(decompressed); + serial_write_compressed(translate(" output:\n")); pyexec_file(filename, exec_result); + #if CIRCUITPY_ATEXIT + shared_module_atexit_execute(exec_result); + #endif return true; } @@ -253,6 +257,11 @@ STATIC void cleanup_after_vm(supervisor_allocation* heap, mp_obj_t exception) { // Reset port-independent devices, like CIRCUITPY_BLEIO_HCI. reset_devices(); + + #if CIRCUITPY_ATEXIT + atexit_reset(); + #endif + // Turn off the display and flush the filesystem before the heap disappears. #if CIRCUITPY_DISPLAYIO reset_displays(); @@ -631,13 +640,15 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { && safe_mode == NO_SAFE_MODE && MP_STATE_VM(vfs_mount_table) != NULL; - static const char * const boot_py_filenames[] = STRING_LIST("settings.txt", "settings.py", "boot.py", "boot.txt"); + static const char * const boot_py_filenames[] = STRING_LIST("boot.py", "boot.txt"); bool skip_boot_output = false; + #ifdef CIRCUITPY_BOOT_OUTPUT_FILE + FIL file_pointer; + #endif if (ok_to_run) { #ifdef CIRCUITPY_BOOT_OUTPUT_FILE - FIL file_pointer; boot_output_file = &file_pointer; // Get the base filesystem. @@ -680,6 +691,9 @@ STATIC void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) { // Write version info to boot_out.txt. mp_hal_stdout_tx_str(MICROPY_FULL_VERSION_INFO); + // Write the board ID (board directory and ID on circuitpython.org) + mp_hal_stdout_tx_str("\r\n" "Board ID:"); + mp_hal_stdout_tx_str(CIRCUITPY_BOARD_ID); mp_hal_stdout_tx_str("\r\n"); } #endif @@ -741,7 +755,7 @@ STATIC int run_repl(void) { usb_setup_with_vm(); #endif - autoreload_suspend(); + autoreload_suspend(AUTORELOAD_LOCK_REPL); // Set the status LED to the REPL color before running the REPL. For // NeoPixels and DotStars this will be sticky but for PWM or single LED it @@ -757,6 +771,13 @@ STATIC int run_repl(void) { } else { exit_code = pyexec_friendly_repl(); } + #if CIRCUITPY_ATEXIT + pyexec_result_t result; + shared_module_atexit_execute(&result); + if (result.return_code == PYEXEC_DEEP_SLEEP) { + exit_code = PYEXEC_DEEP_SLEEP; + } + #endif cleanup_after_vm(heap, MP_OBJ_SENTINEL); #if CIRCUITPY_STATUS_LED status_led_init(); @@ -764,7 +785,7 @@ STATIC int run_repl(void) { status_led_deinit(); #endif - autoreload_resume(); + autoreload_resume(AUTORELOAD_LOCK_REPL); return exit_code; } @@ -830,6 +851,7 @@ int __attribute__((used)) main(void) { serial_init(); #if CIRCUITPY_BLEIO + supervisor_bluetooth_enable_workflow(); supervisor_start_bluetooth(); #endif @@ -872,6 +894,10 @@ void gc_collect(void) { common_hal_alarm_gc_collect(); #endif + #if CIRCUITPY_ATEXIT + atexit_gc_collect(); + #endif + #if CIRCUITPY_DISPLAYIO displayio_gc_collect(); #endif diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 291b515e80..810d86581b 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -322,6 +322,12 @@ SRC_C += \ reset.c \ timer_handler.c \ +# This is an OR because it filters to any 1s and then checks to see if it is not +# empty. +ifneq (,$(filter 1,$(CIRCUITPY_PWMIO) $(CIRCUITPY_AUDIOIO) $(CIRCUITPY_RGBMATRIX))) +SRC_C += shared_timers.c +endif + ifeq ($(CIRCUITPY_SDIOIO),1) SRC_C += ports/atmel-samd/sd_mmc/sd_mmc.c endif @@ -340,7 +346,7 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) # There may be duplicates between SRC_COMMON_HAL_EXPANDED and SRC_SHARED_MODULE_EXPANDED, -# because a few modules have files both in common-hal/ and shared-modules/. +# because a few modules have files both in common-hal/ and shared-module/. # Doing a $(sort ...) removes duplicates as part of sorting. SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) diff --git a/ports/atmel-samd/audio_dma.c b/ports/atmel-samd/audio_dma.c index 7f1260973d..d7ec9dcd07 100644 --- a/ports/atmel-samd/audio_dma.c +++ b/ports/atmel-samd/audio_dma.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#include + #include "audio_dma.h" #include "samd/clocks.h" #include "samd/events.h" @@ -31,6 +33,7 @@ #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/audiocore/WaveFile.h" +#include "shared-bindings/microcontroller/__init__.h" #include "supervisor/background_callback.h" #include "py/mpstate.h" @@ -38,6 +41,10 @@ #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO +// Flag value for dma->buffer_to_load, indicating there is nothing to do. +// Otherwise dma->buffer_to_load is 0 or 1. +#define NO_BUFFER_TO_LOAD 0xff + static audio_dma_t *audio_dma_state[AUDIO_DMA_CHANNEL_COUNT]; // This cannot be in audio_dma_state because it's volatile. @@ -85,70 +92,79 @@ void audio_dma_enable_channel(uint8_t channel) { dma_enable_channel(channel); } -void audio_dma_convert_signed(audio_dma_t *dma, uint8_t *buffer, uint32_t buffer_length, - uint8_t **output_buffer, uint32_t *output_buffer_length, +static void audio_dma_convert_samples( + audio_dma_t *dma, + uint8_t *input, uint32_t input_length, + uint8_t *available_output_buffer, uint32_t available_output_buffer_length, + uint8_t **output, uint32_t *output_length, uint8_t *output_spacing) { - if (dma->first_buffer_free) { - *output_buffer = dma->first_buffer; - } else { - *output_buffer = dma->second_buffer; - } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" if (dma->signed_to_unsigned || dma->unsigned_to_signed) { - *output_buffer_length = buffer_length / dma->spacing; + + // Must convert. + // Write the conversion into the passed-in output buffer + *output = available_output_buffer; + *output_length = input_length / dma->spacing; *output_spacing = 1; + + if (*output_length > available_output_buffer_length) { + mp_raise_RuntimeError(translate("Internal audio buffer too small")); + } + uint32_t out_i = 0; if (dma->bytes_per_sample == 1) { - for (uint32_t i = 0; i < buffer_length; i += dma->spacing) { + for (uint32_t i = 0; i < input_length; i += dma->spacing) { if (dma->signed_to_unsigned) { - ((uint8_t *)*output_buffer)[out_i] = ((int8_t *)buffer)[i] + 0x80; + ((uint8_t *)*output)[out_i] = ((int8_t *)input)[i] + 0x80; } else { - ((int8_t *)*output_buffer)[out_i] = ((uint8_t *)buffer)[i] - 0x80; + ((int8_t *)*output)[out_i] = ((uint8_t *)input)[i] - 0x80; } out_i += 1; } } else if (dma->bytes_per_sample == 2) { - for (uint32_t i = 0; i < buffer_length / 2; i += dma->spacing) { + for (uint32_t i = 0; i < input_length / 2; i += dma->spacing) { if (dma->signed_to_unsigned) { - ((uint16_t *)*output_buffer)[out_i] = ((int16_t *)buffer)[i] + 0x8000; + ((uint16_t *)*output)[out_i] = ((int16_t *)input)[i] + 0x8000; } else { - ((int16_t *)*output_buffer)[out_i] = ((uint16_t *)buffer)[i] - 0x8000; + ((int16_t *)*output)[out_i] = ((uint16_t *)input)[i] - 0x8000; } out_i += 1; } } } else { - *output_buffer = buffer; - *output_buffer_length = buffer_length; + *output = input; + *output_length = input_length; *output_spacing = dma->spacing; } #pragma GCC diagnostic pop - dma->first_buffer_free = !dma->first_buffer_free; } -void audio_dma_load_next_block(audio_dma_t *dma) { - uint8_t *buffer; - uint32_t buffer_length; +static void audio_dma_load_next_block(audio_dma_t *dma, size_t buffer_idx) { + uint8_t *sample_buffer; + uint32_t sample_buffer_length; audioio_get_buffer_result_t get_buffer_result = audiosample_get_buffer(dma->sample, dma->single_channel_output, dma->audio_channel, - &buffer, &buffer_length); + &sample_buffer, &sample_buffer_length); - DmacDescriptor *descriptor = dma->second_descriptor; - if (dma->first_descriptor_free) { - descriptor = dma_descriptor(dma->dma_channel); - } - dma->first_descriptor_free = !dma->first_descriptor_free; + DmacDescriptor *descriptor = dma->descriptor[buffer_idx]; if (get_buffer_result == GET_BUFFER_ERROR) { audio_dma_stop(dma); return; } + // Use one of the allocated buffers for conversion. But if there's no conversion, + // this will be set to buffer in audio_dma_convert_samples() to avoid any copying. uint8_t *output_buffer; uint32_t output_buffer_length; uint8_t output_spacing; - audio_dma_convert_signed(dma, buffer, buffer_length, &output_buffer, &output_buffer_length, + + audio_dma_convert_samples(dma, sample_buffer, sample_buffer_length, + // Available output buffer: may be used or not. + dma->buffer[buffer_idx], dma->buffer_length[buffer_idx], + // Buffer where output was placed. + &output_buffer, &output_buffer_length, &output_spacing); descriptor->BTCNT.reg = output_buffer_length / dma->beat_size / output_spacing; @@ -157,7 +173,14 @@ void audio_dma_load_next_block(audio_dma_t *dma) { if (dma->loop) { audiosample_reset_buffer(dma->sample, dma->single_channel_output, dma->audio_channel); } else { - descriptor->DESCADDR.reg = 0; + if (output_buffer_length == 0) { + // Nothing further to read and previous buffer is finished. + audio_dma_stop(dma); + return; + } else { + // Break descriptor chain. + descriptor->DESCADDR.reg = 0; + } } } descriptor->BTCTRL.bit.VALID = true; @@ -200,42 +223,42 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma, dma->dma_channel = dma_channel; dma->signed_to_unsigned = false; dma->unsigned_to_signed = false; - dma->second_descriptor = NULL; dma->spacing = 1; - dma->first_descriptor_free = true; audiosample_reset_buffer(sample, single_channel_output, audio_channel); + dma->buffer_to_load = NO_BUFFER_TO_LOAD; + dma->descriptor[0] = dma_descriptor(dma_channel); + dma->descriptor[1] = &dma->second_descriptor; - bool single_buffer; bool samples_signed; uint32_t max_buffer_length; - audiosample_get_buffer_structure(sample, single_channel_output, &single_buffer, &samples_signed, + audiosample_get_buffer_structure(sample, single_channel_output, &dma->single_buffer, &samples_signed, &max_buffer_length, &dma->spacing); uint8_t output_spacing = dma->spacing; if (output_signed != samples_signed) { output_spacing = 1; max_buffer_length /= dma->spacing; - dma->first_buffer = (uint8_t *)m_realloc(dma->first_buffer, max_buffer_length); - if (dma->first_buffer == NULL) { - return AUDIO_DMA_MEMORY_ERROR; - } - dma->first_buffer_free = true; - if (!single_buffer) { - dma->second_buffer = (uint8_t *)m_realloc(dma->second_buffer, max_buffer_length); - if (dma->second_buffer == NULL) { - return AUDIO_DMA_MEMORY_ERROR; - } - } - dma->signed_to_unsigned = !output_signed && samples_signed; - dma->unsigned_to_signed = output_signed && !samples_signed; } - dma->event_channel = 0xff; - if (!single_buffer) { - dma->second_descriptor = (DmacDescriptor *)m_malloc(sizeof(DmacDescriptor), false); - if (dma->second_descriptor == NULL) { + + dma->buffer[0] = (uint8_t *)m_realloc(dma->buffer[0], max_buffer_length); + dma->buffer_length[0] = max_buffer_length; + if (dma->buffer[0] == NULL) { + return AUDIO_DMA_MEMORY_ERROR; + } + + if (!dma->single_buffer) { + dma->buffer[1] = (uint8_t *)m_realloc(dma->buffer[1], max_buffer_length); + dma->buffer_length[1] = max_buffer_length; + if (dma->buffer[1] == NULL) { return AUDIO_DMA_MEMORY_ERROR; } + } + dma->signed_to_unsigned = !output_signed && samples_signed; + dma->unsigned_to_signed = output_signed && !samples_signed; + + dma->event_channel = 0xff; + if (!dma->single_buffer) { // We're likely double buffering so set up the block interrupts. turn_on_event_system(); dma->event_channel = find_sync_event_channel_raise(); @@ -265,32 +288,34 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma, #ifdef SAM_D5X_E5X int irq = dma->event_channel < 4 ? EVSYS_0_IRQn + dma->event_channel : EVSYS_4_IRQn; + // Only disable and clear on SAMD51 because the SAMD21 shares EVSYS with ticks. + NVIC_DisableIRQ(irq); + NVIC_ClearPendingIRQ(irq); #else int irq = EVSYS_IRQn; #endif - NVIC_DisableIRQ(irq); - NVIC_ClearPendingIRQ(irq); - - DmacDescriptor *first_descriptor = dma_descriptor(dma_channel); - setup_audio_descriptor(first_descriptor, dma->beat_size, output_spacing, output_register_address); - if (single_buffer) { - first_descriptor->DESCADDR.reg = 0; + setup_audio_descriptor(dma->descriptor[0], dma->beat_size, output_spacing, output_register_address); + if (dma->single_buffer) { + dma->descriptor[0]->DESCADDR.reg = 0; if (dma->loop) { - first_descriptor->DESCADDR.reg = (uint32_t)first_descriptor; + // The descriptor chains to itself. + dma->descriptor[0]->DESCADDR.reg = (uint32_t)dma->descriptor[0]; } } else { - first_descriptor->DESCADDR.reg = (uint32_t)dma->second_descriptor; - setup_audio_descriptor(dma->second_descriptor, dma->beat_size, output_spacing, output_register_address); - dma->second_descriptor->DESCADDR.reg = (uint32_t)first_descriptor; + // Set up the two descriptors to chain to each other. + dma->descriptor[0]->DESCADDR.reg = (uint32_t)dma->descriptor[1]; + setup_audio_descriptor(dma->descriptor[1], dma->beat_size, output_spacing, output_register_address); + dma->descriptor[1]->DESCADDR.reg = (uint32_t)dma->descriptor[0]; } // Load the first two blocks up front. - audio_dma_load_next_block(dma); - if (!single_buffer) { - audio_dma_load_next_block(dma); + audio_dma_load_next_block(dma, 0); + if (!dma->single_buffer) { + audio_dma_load_next_block(dma, 1); } + dma->playing_in_progress = true; dma_configure(dma_channel, dma_trigger_source, true); audio_dma_enable_channel(dma_channel); @@ -309,6 +334,7 @@ void audio_dma_stop(audio_dma_t *dma) { dma_free_channel(dma->dma_channel); } dma->dma_channel = AUDIO_DMA_CHANNEL_COUNT; + dma->playing_in_progress = false; } void audio_dma_pause(audio_dma_t *dma) { @@ -347,12 +373,7 @@ bool audio_dma_get_playing(audio_dma_t *dma) { if (dma->dma_channel >= AUDIO_DMA_CHANNEL_COUNT) { return false; } - uint32_t status = dma_transfer_status(dma->dma_channel); - if ((status & DMAC_CHINTFLAG_TCMPL) != 0 || (status & DMAC_CHINTFLAG_TERR) != 0) { - audio_dma_stop(dma); - } - - return (status & DMAC_CHINTFLAG_TERR) == 0; + return dma->playing_in_progress; } // WARN(tannewt): DO NOT print from here, or anything it calls. Printing calls @@ -363,10 +384,19 @@ STATIC void dma_callback_fun(void *arg) { return; } - audio_dma_load_next_block(dma); + common_hal_mcu_disable_interrupts(); + uint8_t buffer_to_load = dma->buffer_to_load; + dma->buffer_to_load = NO_BUFFER_TO_LOAD; + common_hal_mcu_enable_interrupts(); + + if (buffer_to_load == NO_BUFFER_TO_LOAD) { + audio_dma_stop(dma); + } else { + audio_dma_load_next_block(dma, buffer_to_load); + } } -void evsyshandler_common(void) { +void audio_evsys_handler(void) { for (uint8_t i = 0; i < AUDIO_DMA_CHANNEL_COUNT; i++) { audio_dma_t *dma = audio_dma_state[i]; if (dma == NULL) { @@ -376,30 +406,30 @@ void evsyshandler_common(void) { if (!block_done) { continue; } + + // By the time we get here, the write-back descriptor has been set to the + // current running descriptor. Fill the buffer that the next chained descriptor + // will play. + // + // The state of the write-back descriptor was determined empirically, + // The datasheet appears to imply that the descriptor that just finished would + // be in the write-back descriptor. But the VALID bit is set in the write-back descriptor, + // and reversing which buffer to fill produces crackly output. So the choice + // of which buffer to fill here appears correct. + DmacDescriptor *next_descriptor = + (DmacDescriptor *)dma_write_back_descriptor(dma->dma_channel)->DESCADDR.reg; + if (next_descriptor == dma->descriptor[0]) { + dma->buffer_to_load = 0; + } else if (next_descriptor == dma->descriptor[1]) { + dma->buffer_to_load = 1; + } else if (next_descriptor == NULL) { + dma->buffer_to_load = NO_BUFFER_TO_LOAD; + } else { + continue; + } + background_callback_add(&dma->callback, dma_callback_fun, (void *)dma); } } -#ifdef SAM_D5X_E5X -void EVSYS_0_Handler(void) { - evsyshandler_common(); -} -void EVSYS_1_Handler(void) { - evsyshandler_common(); -} -void EVSYS_2_Handler(void) { - evsyshandler_common(); -} -void EVSYS_3_Handler(void) { - evsyshandler_common(); -} -void EVSYS_4_Handler(void) { - evsyshandler_common(); -} -#else -void EVSYS_Handler(void) { - evsyshandler_common(); -} -#endif - #endif diff --git a/ports/atmel-samd/audio_dma.h b/ports/atmel-samd/audio_dma.h index bc5beb3bf5..0b5f35c71b 100644 --- a/ports/atmel-samd/audio_dma.h +++ b/ports/atmel-samd/audio_dma.h @@ -35,22 +35,24 @@ typedef struct { mp_obj_t sample; + uint8_t *buffer[2]; + size_t buffer_length[2]; + DmacDescriptor *descriptor[2]; + DmacDescriptor second_descriptor; + background_callback_t callback; uint8_t dma_channel; uint8_t event_channel; uint8_t audio_channel; uint8_t bytes_per_sample; uint8_t beat_size; uint8_t spacing; + uint8_t buffer_to_load; // Index bool loop; + bool single_buffer; bool single_channel_output; bool signed_to_unsigned; bool unsigned_to_signed; - bool first_buffer_free; - uint8_t *first_buffer; - uint8_t *second_buffer; - bool first_descriptor_free; - DmacDescriptor *second_descriptor; - background_callback_t callback; + bool playing_in_progress; } audio_dma_t; typedef enum { @@ -99,4 +101,6 @@ void audio_dma_background(void); uint8_t find_sync_event_channel_raise(void); +void audio_evsys_handler(void); + #endif // MICROPY_INCLUDED_ATMEL_SAMD_AUDIO_DMA_H diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk index 200eea0630..cac4b8e0bb 100644 --- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk +++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk @@ -12,8 +12,8 @@ EXTERNAL_FLASH_DEVICES = "W25Q128JVxQ" LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 -CIRCUITPY_GAMEPAD = 1 CIRCUITPY_BUSDEVICE = 1 +CIRCUITPY_KEYPAD = 1 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID diff --git a/ports/atmel-samd/boards/8086_commander/pins.c b/ports/atmel-samd/boards/8086_commander/pins.c index 728da3f6b2..d9c68cc0bc 100644 --- a/ports/atmel-samd/boards/8086_commander/pins.c +++ b/ports/atmel-samd/boards/8086_commander/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Serial { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, // RX @@ -60,4 +62,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/adafruit_neokey_trinkey_m0/pins.c b/ports/atmel-samd/boards/adafruit_neokey_trinkey_m0/pins.c index df8dfb0bfa..7b0f72e283 100644 --- a/ports/atmel-samd/boards/adafruit_neokey_trinkey_m0/pins.c +++ b/ports/atmel-samd/boards/adafruit_neokey_trinkey_m0/pins.c @@ -1,8 +1,10 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_PA28) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/mpconfigboard.h b/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/mpconfigboard.h index c792b01272..878b25f2f8 100644 --- a/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/mpconfigboard.h @@ -2,6 +2,7 @@ #define MICROPY_HW_MCU_NAME "samd21e18" #define MICROPY_HW_NEOPIXEL (&pin_PA15) +#define MICROPY_HW_NEOPIXEL_COUNT (2) #define IGNORE_PIN_PA01 1 #define IGNORE_PIN_PA02 1 diff --git a/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/mpconfigboard.mk index cee8049231..688d3c0db4 100644 --- a/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/mpconfigboard.mk @@ -14,14 +14,18 @@ CIRCUITPY_FULL_BUILD = 0 CIRCUITPY_ANALOGIO = 0 CIRCUITPY_AUDIOCORE = 0 CIRCUITPY_BUSIO_SPI = 0 +CIRCUITPY_BUSIO_UART = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_PWMIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 -CIRCUITPY_USB_MIDI = 0 + +CIRCUITPY_GETPASS = 0 +CIRCUITPY_TRACEBACK = 0 CIRCUITPY_PIXELBUF = 1 +CIRCUITPY_BUSDEVICE = 1 # Include these Python libraries in firmware. -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_APDS9960 FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/pins.c b/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/pins.c index 21410f8ad1..55e7d8466f 100644 --- a/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/pins.c +++ b/ports/atmel-samd/boards/adafruit_proxlight_trinkey_m0/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_INTERRUPT), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_TOUCH2), MP_ROM_PTR(&pin_PA03) }, @@ -12,4 +14,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/pins.c b/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/pins.c index 95e3fef822..49e9853a57 100644 --- a/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/pins.c +++ b/ports/atmel-samd/boards/adafruit_rotary_trinkey_m0/pins.c @@ -1,10 +1,12 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_ROTA), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_ROTB), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA06) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/adafruit_slide_trinkey_m0/pins.c b/ports/atmel-samd/boards/adafruit_slide_trinkey_m0/pins.c index e23b80d4c7..eaf80401d5 100644 --- a/ports/atmel-samd/boards/adafruit_slide_trinkey_m0/pins.c +++ b/ports/atmel-samd/boards/adafruit_slide_trinkey_m0/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_POTENTIOMETER), MP_ROM_PTR(&pin_PA02) }, @@ -8,4 +10,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_TOUCH), MP_ROM_PTR(&pin_PA07) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/aloriumtech_evo_m51/pins.c b/ports/atmel-samd/boards/aloriumtech_evo_m51/pins.c index 129a3eed9c..35cc41b557 100644 --- a/ports/atmel-samd/boards/aloriumtech_evo_m51/pins.c +++ b/ports/atmel-samd/boards/aloriumtech_evo_m51/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_D14), MP_ROM_PTR(&pin_PA02) }, @@ -57,4 +59,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SDA_1), MP_ROM_PTR(&pin_PD09) }, { MP_ROM_QSTR(MP_QSTR_SCL_1), MP_ROM_PTR(&pin_PD08) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h index f0748f35de..6a3f7a9687 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h @@ -16,3 +16,16 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 +// USD ID +#define IGNORE_PIN_PA18 1 + +// Hooked to the external crystal +#define IGNORE_PIN_PA00 1 +#define IGNORE_PIN_PA01 1 + +// SWD only +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 + +// Not connected +#define IGNORE_PIN_PA28 1 diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index c3d75202bf..abbdbe87ef 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -9,3 +9,5 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + +CIRCUITPY_RAINBOWIO = 0 diff --git a/ports/atmel-samd/boards/arduino_mkr1300/pins.c b/ports/atmel-samd/boards/arduino_mkr1300/pins.c index 7a73e89bf9..21476a3561 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/pins.c +++ b/ports/atmel-samd/boards/arduino_mkr1300/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PB02) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB03) }, @@ -16,7 +18,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB10) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_LED), 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_PA16) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA17) }, @@ -35,8 +40,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_RFM9X_CS), MP_ROM_PTR(&pin_PA14) }, { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB08) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/arduino_mkrzero/pins.c b/ports/atmel-samd/boards/arduino_mkrzero/pins.c index 2494076ab1..7c0e2f42af 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/pins.c +++ b/ports/atmel-samd/boards/arduino_mkrzero/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PB02) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB03) }, @@ -35,11 +37,15 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SD_MISO), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA14) }, { MP_ROM_QSTR(MP_QSTR_SD_CD), MP_ROM_PTR(&pin_PA27) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PB09) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.h b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.h index 62883ad4a5..6be4f5606a 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.h @@ -16,3 +16,11 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 + +// Not connected +#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/arduino_nano_33_iot/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk index 895c027ee5..a61e321b29 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk @@ -9,3 +9,5 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + +CIRCUITPY_RAINBOWIO = 0 diff --git a/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c b/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c index 6b23cbf091..f85145fd3a 100644 --- a/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c +++ b/ports/atmel-samd/boards/arduino_nano_33_iot/pins.c @@ -1,20 +1,27 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PB02) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB23) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB23) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB22) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB22) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PB10) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB11) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA07) }, @@ -24,12 +31,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, @@ -46,4 +57,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_GPIO0), MP_ROM_PTR(&pin_PA27) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_BUSY), MP_ROM_PTR(&pin_PA28) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h index 3cddc38546..7ee912e49a 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h @@ -19,3 +19,11 @@ // 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/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index 5ee22c59ad..58fd9ca6e4 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -9,3 +9,5 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + +CIRCUITPY_RAINBOWIO = 0 diff --git a/ports/atmel-samd/boards/arduino_zero/pins.c b/ports/atmel-samd/boards/arduino_zero/pins.c index 7ebcc9a6e3..02f51aa1e8 100644 --- a/ports/atmel-samd/boards/arduino_zero/pins.c +++ b/ports/atmel-samd/boards/arduino_zero/pins.c @@ -1,16 +1,21 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -22,14 +27,18 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_SDA), MP_ROM_PTR(&pin_PA22) }, { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/pins.c b/ports/atmel-samd/boards/bast_pro_mini_m0/pins.c index 3ed940e362..6360150e70 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/pins.c +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA04) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA05) }, @@ -33,4 +35,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/bdmicro_vina_d21/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d21/pins.c index 323f71dec2..d84e46d726 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d21/pins.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d21/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -35,4 +37,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h index 6b1c9113be..41b88632d8 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.h @@ -1,5 +1,5 @@ // More than one revision of this board is available. -// This board specifies PCB Revision 10 +// This board specifies the most up to date PCB Revision #define MICROPY_HW_BOARD_NAME "BDMICRO VINA-D51" #define MICROPY_HW_MCU_NAME "samd51n20" diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk index 13487413f4..9152cb6052 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/mpconfigboard.mk @@ -1,5 +1,5 @@ # More than one revision of this board is available. -# This board specifies PCB Revision 10 +# This board specifies the most up to date PCB Revision USB_VID = 0x31e2 USB_PID = 0x2021 @@ -10,5 +10,5 @@ CHIP_VARIANT = SAMD51N20A CHIP_FAMILY = samd51 QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICES = "MX25L51245G","GD25S512MD" +EXTERNAL_FLASH_DEVICES = "MX25L12833F","MX25L51245G","GD25S512MD" LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c index e7595d9789..3a9dbc929c 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d51/pins.c @@ -1,9 +1,11 @@ // More than one revision of this board is available. -// This board specifies PCB Revision 10 +// This board specifies the most up to date PCB Revision #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA04) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PB07) }, @@ -59,6 +61,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SDO), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SDI), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_I2S_FS_0), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PB16) }, + { MP_ROM_QSTR(MP_QSTR_I2S_SCK_0), MP_ROM_PTR(&pin_PB16) }, + { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PB17) }, + { MP_ROM_QSTR(MP_QSTR_I2S_MCK_0), MP_ROM_PTR(&pin_PB17) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PC17) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PC18) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PC19) }, @@ -73,14 +85,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_I2C1_SDA), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_I2S_FS_0), MP_ROM_PTR(&pin_PA20) }, - { MP_ROM_QSTR(MP_QSTR_I2S_MCK_0), MP_ROM_PTR(&pin_PB17) }, - { MP_ROM_QSTR(MP_QSTR_I2S_SCK_0), MP_ROM_PTR(&pin_PB16) }, - { MP_ROM_QSTR(MP_QSTR_I2S_SDI), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_I2S_SDO), MP_ROM_PTR(&pin_PA21) }, { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_LED_STATUS), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_PB15) }, + { MP_ROM_QSTR(MP_QSTR_LED_QSPI), MP_ROM_PTR(&pin_PC07) }, { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_LED_RX), MP_ROM_PTR(&pin_PC05) }, { MP_ROM_QSTR(MP_QSTR_LED_TX), MP_ROM_PTR(&pin_PC06) }, @@ -110,4 +118,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/bdmicro_vina_d51_pcb7/pins.c b/ports/atmel-samd/boards/bdmicro_vina_d51_pcb7/pins.c index 8eeab8a9a5..6f57a0d7be 100644 --- a/ports/atmel-samd/boards/bdmicro_vina_d51_pcb7/pins.c +++ b/ports/atmel-samd/boards/bdmicro_vina_d51_pcb7/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA04) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PB07) }, @@ -87,4 +89,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/blm_badge/mpconfigboard.mk b/ports/atmel-samd/boards/blm_badge/mpconfigboard.mk index 8ba3ae94c3..a85a17890c 100644 --- a/ports/atmel-samd/boards/blm_badge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/blm_badge/mpconfigboard.mk @@ -14,6 +14,7 @@ CIRCUITPY_AUDIOIO = 1 CIRCUITPY_AUDIOBUSIO = 1 # Pins for I2SOut are not available. CIRCUITPY_AUDIOBUSIO_I2SOUT = 0 +CIRCUITPY_BUSIO_SPI = 0 CIRCUITPY_PWMIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 diff --git a/ports/atmel-samd/boards/blm_badge/pins.c b/ports/atmel-samd/boards/blm_badge/pins.c index 805a713893..6da6f0e9db 100644 --- a/ports/atmel-samd/boards/blm_badge/pins.c +++ b/ports/atmel-samd/boards/blm_badge/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA01) }, // pad 1 { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA01) }, @@ -43,4 +45,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/pins.c b/ports/atmel-samd/boards/capablerobot_usbhub/pins.c index f7ad82c579..02bb347fe0 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/pins.c +++ b/ports/atmel-samd/boards/capablerobot_usbhub/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_ANMB), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ANVLIM), MP_ROM_PTR(&pin_PA04) }, { MP_OBJ_NEW_QSTR(MP_QSTR_AN5V), MP_ROM_PTR(&pin_PA05) }, @@ -34,4 +36,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/catwan_usbstick/pins.c b/ports/atmel-samd/boards/catwan_usbstick/pins.c index 346bd9c10c..a0f44fc6f4 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/pins.c +++ b/ports/atmel-samd/boards/catwan_usbstick/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA30) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA31) }, { MP_ROM_QSTR(MP_QSTR_RFM9X_D0), MP_ROM_PTR(&pin_PA04) }, @@ -9,9 +11,12 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_RFM9X_D5), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_RFM9X_RST), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_RFM9X_CS), MP_ROM_PTR(&pin_PA17) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/circuitbrains_basic_m0/pins.c b/ports/atmel-samd/boards/circuitbrains_basic_m0/pins.c index 5acad5e988..ee2b947077 100644 --- a/ports/atmel-samd/boards/circuitbrains_basic_m0/pins.c +++ b/ports/atmel-samd/boards/circuitbrains_basic_m0/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA06) }, @@ -18,7 +20,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA15) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_STATUS_LED),MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PA04) }, @@ -32,4 +36,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/circuitbrains_deluxe_m4/pins.c b/ports/atmel-samd/boards/circuitbrains_deluxe_m4/pins.c index 45fcd04640..55001af5f7 100755 --- a/ports/atmel-samd/boards/circuitbrains_deluxe_m4/pins.c +++ b/ports/atmel-samd/boards/circuitbrains_deluxe_m4/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB04) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB05) }, @@ -20,8 +22,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA21) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA20) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB17) }, @@ -33,8 +37,11 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PB15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PB14) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_STATUS_LED),MP_ROM_PTR(&pin_PB13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PB13) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB31) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA27) }, @@ -52,4 +59,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index 105205f191..9020c243b1 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -3,6 +3,9 @@ #define MICROPY_HW_LED_STATUS (&pin_PA17) +#define MICROPY_HW_NEOPIXEL (&pin_PB23) +#define MICROPY_HW_NEOPIXEL_COUNT (10) + // Don't allow touch on A0 (PA02), because it's connected to the speaker. #define PA02_NO_TOUCH (true) diff --git a/ports/atmel-samd/boards/circuitplayground_express/pins.c b/ports/atmel-samd/boards/circuitplayground_express/pins.c index 1c14ee2322..ea00f85c70 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/pins.c +++ b/ports/atmel-samd/boards/circuitplayground_express/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_D12), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_PA02) }, @@ -61,4 +63,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h index 852e9651b1..5073c5e403 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -3,6 +3,9 @@ #define MICROPY_HW_LED_STATUS (&pin_PA17) +#define MICROPY_HW_NEOPIXEL (&pin_PB23) +#define MICROPY_HW_NEOPIXEL_COUNT (10) + // Don't allow touch on A0 (PA02), because it's connected to the speaker. #define PA02_NO_TOUCH (true) diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/pins.c b/ports/atmel-samd/boards/circuitplayground_express_crickit/pins.c index 1c14ee2322..ea00f85c70 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/pins.c +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_D12), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_PA02) }, @@ -61,4 +63,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h index a0bb560752..20cfc617a2 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -3,6 +3,9 @@ #define MICROPY_HW_LED_STATUS (&pin_PA17) +#define MICROPY_HW_NEOPIXEL (&pin_PB23) +#define MICROPY_HW_NEOPIXEL_COUNT (10) + // Don't allow touch on A0 (PA02), because it's connected to the speaker. #define PA02_NO_TOUCH (true) diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index 3a97c39830..fd9e6cc2e6 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -20,6 +20,7 @@ CIRCUITPY_USB_MIDI = 0 # So not all of displayio, sorry! CIRCUITPY_VECTORIO = 0 CIRCUITPY_BITMAPTOOLS = 0 +CIRCUITPY_PARALLELDISPLAY = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/pins.c b/ports/atmel-samd/boards/circuitplayground_express_displayio/pins.c index 1c14ee2322..ea00f85c70 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/pins.c +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_D12), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_PA02) }, @@ -61,4 +63,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index 53c4cf5eec..05c0de4210 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -27,8 +27,12 @@ SECTIONS . = ALIGN(4); _sfixed = .; KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ + + /* 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) */ + + /* Don't sort rodata because it impacts codegen size. */ *(.rodata) /* .rodata sections (constants, strings, etc.) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ @@ -62,8 +66,8 @@ SECTIONS _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ *(.ramfunc) *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.data))) /* .data sections */ + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.data*))) /* .data* sections */ . = ALIGN(4); _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */ @@ -75,8 +79,8 @@ SECTIONS . = ALIGN(4); _sbss = .; _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss))) + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss*))) *(COMMON) . = ALIGN(4); diff --git a/ports/atmel-samd/boards/cp32-m4/pins.c b/ports/atmel-samd/boards/cp32-m4/pins.c index 1946c9d3ab..2f8e7ad1c5 100644 --- a/ports/atmel-samd/boards/cp32-m4/pins.c +++ b/ports/atmel-samd/boards/cp32-m4/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER_P), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER_N), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PA04) }, @@ -48,4 +50,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/cp_sapling_m0/pins.c b/ports/atmel-samd/boards/cp_sapling_m0/pins.c index d527aaddcb..c830f86aa8 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0/pins.c +++ b/ports/atmel-samd/boards/cp_sapling_m0/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, @@ -35,4 +37,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/cp_sapling_m0_revb/pins.c b/ports/atmel-samd/boards/cp_sapling_m0_revb/pins.c index b88b6869ef..93eefbdf8f 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0_revb/pins.c +++ b/ports/atmel-samd/boards/cp_sapling_m0_revb/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA19) }, @@ -49,6 +51,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_UART), MP_ROM_PTR(&board_uart_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/pins.c b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/pins.c index d527aaddcb..c830f86aa8 100644 --- a/ports/atmel-samd/boards/cp_sapling_m0_spiflash/pins.c +++ b/ports/atmel-samd/boards/cp_sapling_m0_spiflash/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, @@ -35,4 +37,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/datalore_ip_m4/pins.c b/ports/atmel-samd/boards/datalore_ip_m4/pins.c index 4eb26dd21b..8e52b20769 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/pins.c +++ b/ports/atmel-samd/boards/datalore_ip_m4/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, @@ -43,4 +45,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.h b/ports/atmel-samd/boards/datum_distance/mpconfigboard.h index cd9be70fe3..789a47c5e1 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.h @@ -19,3 +19,24 @@ // 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 + +// Unconnected +// Schematic at: https://jandjstudios.io/assets/pdfs/datum-Distance.pdf +#define IGNORE_PIN_PA03 1 +#define IGNORE_PIN_PA02 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PA04 1 +#define IGNORE_PIN_PA05 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA15 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PA13 1 diff --git a/ports/atmel-samd/boards/datum_distance/pins.c b/ports/atmel-samd/boards/datum_distance/pins.c index 8e4f1101e8..e09bf14c7e 100644 --- a/ports/atmel-samd/boards/datum_distance/pins.c +++ b/ports/atmel-samd/boards/datum_distance/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { 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) }, @@ -19,9 +21,14 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_TX_LED), MP_ROM_PTR(&pin_PA27) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.h b/ports/atmel-samd/boards/datum_imu/mpconfigboard.h index 07a71e2e15..421ffaa5d4 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.h @@ -19,3 +19,22 @@ // 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 + +// Unconnected +// Schematic at: https://jandjstudios.io/assets/pdfs/datum-IMU.pdf +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PA04 1 +#define IGNORE_PIN_PA05 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA15 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PA13 1 diff --git a/ports/atmel-samd/boards/datum_imu/pins.c b/ports/atmel-samd/boards/datum_imu/pins.c index eabd2567ef..7b62245070 100644 --- a/ports/atmel-samd/boards/datum_imu/pins.c +++ b/ports/atmel-samd/boards/datum_imu/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA03) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, @@ -21,9 +23,14 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_TX_LED), MP_ROM_PTR(&pin_PA27) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.h b/ports/atmel-samd/boards/datum_light/mpconfigboard.h index 6e531b6c74..7fd5f2efc9 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.h @@ -19,3 +19,24 @@ // 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 + +// Unconnected +// Schematic at: https://jandjstudios.io/assets/pdfs/datum-Light.pdf +#define IGNORE_PIN_PA03 1 +#define IGNORE_PIN_PA02 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PA04 1 +#define IGNORE_PIN_PA05 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA15 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PA13 1 diff --git a/ports/atmel-samd/boards/datum_light/pins.c b/ports/atmel-samd/boards/datum_light/pins.c index 8e4f1101e8..e09bf14c7e 100644 --- a/ports/atmel-samd/boards/datum_light/pins.c +++ b/ports/atmel-samd/boards/datum_light/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { 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) }, @@ -19,9 +21,14 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_TX_LED), MP_ROM_PTR(&pin_PA27) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.h b/ports/atmel-samd/boards/datum_weather/mpconfigboard.h index 5b06a14c8c..f12a5796b5 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.h @@ -19,3 +19,24 @@ // 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 + +// Unconnected +// Schematic at: https://jandjstudios.io/assets/pdfs/datum-Weather.pdf +#define IGNORE_PIN_PA03 1 +#define IGNORE_PIN_PA02 1 +#define IGNORE_PIN_PB08 1 +#define IGNORE_PIN_PB09 1 +#define IGNORE_PIN_PA04 1 +#define IGNORE_PIN_PA05 1 +#define IGNORE_PIN_PB02 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA15 1 +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PA28 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PA13 1 diff --git a/ports/atmel-samd/boards/datum_weather/pins.c b/ports/atmel-samd/boards/datum_weather/pins.c index 8e4f1101e8..19934f84c9 100644 --- a/ports/atmel-samd/boards/datum_weather/pins.c +++ b/ports/atmel-samd/boards/datum_weather/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { 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) }, @@ -20,8 +22,12 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_TX_LED), MP_ROM_PTR(&pin_PA27) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/dynalora_usb/pins.c b/ports/atmel-samd/boards/dynalora_usb/pins.c index 25f4985432..d9965d665b 100644 --- a/ports/atmel-samd/boards/dynalora_usb/pins.c +++ b/ports/atmel-samd/boards/dynalora_usb/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA00) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA02) }, @@ -38,4 +40,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/dynossat_edu_eps/pins.c b/ports/atmel-samd/boards/dynossat_edu_eps/pins.c index f960e6bb0e..68ee80b307 100644 --- a/ports/atmel-samd/boards/dynossat_edu_eps/pins.c +++ b/ports/atmel-samd/boards/dynossat_edu_eps/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB10) }, @@ -19,21 +21,26 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_INT_IMU_OBC), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_PWRMON_SDA), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_PWRMON_SCL), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_PWRMON_ALERT), MP_ROM_PTR(&pin_PB03) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_V_3V3_MEAS), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_V_5V_MEAS), MP_ROM_PTR(&pin_PB02) }, + { MP_ROM_QSTR(MP_QSTR_FLASH_SCK), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_FLASH_MOSI), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_FLASH_MISO), MP_ROM_PTR(&pin_PA21) }, { MP_ROM_QSTR(MP_QSTR_FLASH_CS), MP_ROM_PTR(&pin_PA20) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA06) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.h b/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.h index f97569435d..afe96a9cd6 100644 --- a/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.h +++ b/ports/atmel-samd/boards/dynossat_edu_obc/mpconfigboard.h @@ -23,16 +23,11 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 -#define IGNORE_PIN_PA02 1 #define IGNORE_PIN_PA13 1 #define IGNORE_PIN_PA14 1 -#define IGNORE_PIN_PA20 1 -#define IGNORE_PIN_PA21 1 #define IGNORE_PIN_PA27 1 -#define IGNORE_PIN_PB00 1 #define IGNORE_PIN_PB04 1 #define IGNORE_PIN_PB05 1 -#define IGNORE_PIN_PB16 1 #define IGNORE_PIN_PB17 1 #define IGNORE_PIN_PB23 1 #define IGNORE_PIN_PB31 1 diff --git a/ports/atmel-samd/boards/dynossat_edu_obc/pins.c b/ports/atmel-samd/boards/dynossat_edu_obc/pins.c index 8cc58d92c0..7978e6e738 100644 --- a/ports/atmel-samd/boards/dynossat_edu_obc/pins.c +++ b/ports/atmel-samd/boards/dynossat_edu_obc/pins.c @@ -1,23 +1,29 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA07) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB02) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB01) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB15) }, { MP_ROM_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB13) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PB11) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB10) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA11) }, @@ -32,13 +38,16 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_PA30) }, { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PB22) }, + { MP_ROM_QSTR(MP_QSTR_INT_IMU), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_SAT_POWER), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_OVTEMP), MP_ROM_PTR(&pin_PB00) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA08) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/escornabot_makech/pins.c b/ports/atmel-samd/boards/escornabot_makech/pins.c index 86a70cb041..ad771dcb8e 100644 --- a/ports/atmel-samd/boards/escornabot_makech/pins.c +++ b/ports/atmel-samd/boards/escornabot_makech/pins.c @@ -1,8 +1,12 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // LEDs { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA10) }, @@ -55,4 +59,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h index 9be08fcf34..3dfefac545 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h @@ -17,3 +17,21 @@ // 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 + +// Unconnected +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PA09 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 + +// SWD-only +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/pins.c b/ports/atmel-samd/boards/feather_m0_adalogger/pins.c index 63d134952b..29b060e597 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/pins.c +++ b/ports/atmel-samd/boards/feather_m0_adalogger/pins.c @@ -1,39 +1,54 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_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_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_SDA), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SD_CS), 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_SD_CD), MP_ROM_PTR(&pin_PA21) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_GREEN_LED), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_BATTERY), 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_RED_LED), MP_ROM_PTR(&pin_PA17) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h index e80dbafa08..b8d81992f6 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h @@ -17,3 +17,24 @@ // 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 + +// Unconnected +#define IGNORE_PIN_PB03 1 +#define IGNORE_PIN_PB22 1 +#define IGNORE_PIN_PB23 1 +#define IGNORE_PIN_PA06 1 +#define IGNORE_PIN_PA08 1 +#define IGNORE_PIN_PA09 1 +#define IGNORE_PIN_PA13 1 +#define IGNORE_PIN_PA14 1 +#define IGNORE_PIN_PA21 1 +#define IGNORE_PIN_PA27 1 +#define IGNORE_PIN_PA28 1 + +// SWD-only +#define IGNORE_PIN_PA30 1 +#define IGNORE_PIN_PA31 1 diff --git a/ports/atmel-samd/boards/feather_m0_basic/pins.c b/ports/atmel-samd/boards/feather_m0_basic/pins.c index 3c967753c3..bc10b1ca12 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/pins.c +++ b/ports/atmel-samd/boards/feather_m0_basic/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -30,4 +32,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/feather_m0_express/pins.c b/ports/atmel-samd/boards/feather_m0_express/pins.c index 19320ca794..af33c3e0a0 100644 --- a/ports/atmel-samd/boards/feather_m0_express/pins.c +++ b/ports/atmel-samd/boards/feather_m0_express/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -31,4 +33,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/pins.c b/ports/atmel-samd/boards/feather_m0_express_crickit/pins.c index 19320ca794..af33c3e0a0 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/pins.c +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -31,4 +33,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/pins.c b/ports/atmel-samd/boards/feather_m0_rfm69/pins.c index ea1b4366c3..d2e1ade1a0 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/pins.c +++ b/ports/atmel-samd/boards/feather_m0_rfm69/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -33,4 +35,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/pins.c b/ports/atmel-samd/boards/feather_m0_rfm9x/pins.c index 3a7386c2d5..ef678fa399 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/pins.c +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -33,4 +35,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/feather_m0_supersized/pins.c b/ports/atmel-samd/boards/feather_m0_supersized/pins.c index 19320ca794..af33c3e0a0 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/pins.c +++ b/ports/atmel-samd/boards/feather_m0_supersized/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -31,4 +33,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/feather_m4_can/pins.c b/ports/atmel-samd/boards/feather_m4_can/pins.c index b6a568f421..8389b7e2ef 100644 --- a/ports/atmel-samd/boards/feather_m4_can/pins.c +++ b/ports/atmel-samd/boards/feather_m4_can/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_D14), MP_ROM_PTR(&pin_PA02) }, @@ -64,4 +66,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/feather_m4_express/pins.c b/ports/atmel-samd/boards/feather_m4_express/pins.c index a30f4179c7..7484c2ef8e 100644 --- a/ports/atmel-samd/boards/feather_m4_express/pins.c +++ b/ports/atmel-samd/boards/feather_m4_express/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_D14), MP_ROM_PTR(&pin_PA02) }, @@ -56,4 +58,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/fluff_m0/pins.c b/ports/atmel-samd/boards/fluff_m0/pins.c index 6b56297afe..7f11505281 100644 --- a/ports/atmel-samd/boards/fluff_m0/pins.c +++ b/ports/atmel-samd/boards/fluff_m0/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, @@ -40,4 +42,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/gemma_m0/pins.c b/ports/atmel-samd/boards/gemma_m0/pins.c index bb6e9bda53..d89704c7d0 100644 --- a/ports/atmel-samd/boards/gemma_m0/pins.c +++ b/ports/atmel-samd/boards/gemma_m0/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, // pad 1 { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA05) }, @@ -27,4 +29,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/pins.c b/ports/atmel-samd/boards/grandcentral_m4_express/pins.c index b125aca086..b6ce037649 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/pins.c +++ b/ports/atmel-samd/boards/grandcentral_m4_express/pins.c @@ -16,7 +16,9 @@ STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_AREF), MP_ROM_PTR(&pin_PA03) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, @@ -52,6 +54,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PB22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PB23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PB00) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PB01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_PB16) }, @@ -147,4 +151,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/hallowing_m0_express/board.c b/ports/atmel-samd/boards/hallowing_m0_express/board.c index 76551426e3..e22a4bbe17 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/board.c @@ -100,7 +100,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PA00, diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index d7230df4bb..6017b551f1 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -12,6 +12,7 @@ LONGINT_IMPL = NONE # To keep the build small CIRCUITPY_AUDIOBUSIO = 0 +CIRCUITPY_KEYPAD = 0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH diff --git a/ports/atmel-samd/boards/hallowing_m0_express/pins.c b/ports/atmel-samd/boards/hallowing_m0_express/pins.c index b00875ea4a..842832c392 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/pins.c +++ b/ports/atmel-samd/boards/hallowing_m0_express/pins.c @@ -3,7 +3,9 @@ #include "supervisor/board.h" #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_SPEAKER), MP_ROM_PTR(&pin_PA02) }, @@ -66,4 +68,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/hallowing_m4_express/board.c b/ports/atmel-samd/boards/hallowing_m4_express/board.c index f9cdbdbafb..d98bc57676 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/board.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/board.c @@ -80,7 +80,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PB14, // backlight pin diff --git a/ports/atmel-samd/boards/hallowing_m4_express/pins.c b/ports/atmel-samd/boards/hallowing_m4_express/pins.c index 935f1a0b47..9c5a007be0 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/pins.c +++ b/ports/atmel-samd/boards/hallowing_m4_express/pins.c @@ -2,7 +2,9 @@ #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_SPEAKER), MP_ROM_PTR(&pin_PA02) }, @@ -70,4 +72,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/huntercat_nfc/pins.c b/ports/atmel-samd/boards/huntercat_nfc/pins.c index 12b0d93480..ce0b112ede 100644 --- a/ports/atmel-samd/boards/huntercat_nfc/pins.c +++ b/ports/atmel-samd/boards/huntercat_nfc/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA03) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA00) }, @@ -27,4 +29,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/pins.c b/ports/atmel-samd/boards/itsybitsy_m0_express/pins.c index c2d5882ecc..848e8a9732 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/pins.c +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA11) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, @@ -46,4 +48,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/pins.c b/ports/atmel-samd/boards/itsybitsy_m4_express/pins.c index 88c3fbe495..89cf966b11 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/pins.c +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) }, @@ -44,4 +46,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h index 7b73e4d6cf..eb7f1c62e3 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h @@ -19,3 +19,5 @@ #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 + +#define MICROPY_FATFS_EXFAT 0 diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index c2c583022c..b9622c2faf 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -10,11 +10,13 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ # Not needed. +CIRCUITPY_AESIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_AUDIOMP3 = 0 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_GETPASS = 0 CIRCUITPY_KEYPAD = 0 CIRCUITPY_MSGPACK = 0 CIRCUITPY_PS2IO = 0 diff --git a/ports/atmel-samd/boards/kicksat-sprite/pins.c b/ports/atmel-samd/boards/kicksat-sprite/pins.c index 711406189d..aaf48fd43c 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/pins.c +++ b/ports/atmel-samd/boards/kicksat-sprite/pins.c @@ -1,7 +1,9 @@ #include "shared-bindings/board/__init__.h" #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA04) }, @@ -35,4 +37,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c b/ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c index 6d0f34c7da..b9c1034a73 100644 --- a/ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c +++ b/ports/atmel-samd/boards/loc_ber_m4_base_board/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) }, @@ -13,8 +15,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA16) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA17) }, { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA17) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA07) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA14) }, @@ -35,15 +39,15 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_PB02) }, - { 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_OBJ_NEW_QSTR(MP_QSTR_SCK_2), MP_ROM_PTR(&pin_PB10) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI_2), MP_ROM_PTR(&pin_PA08) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MISO_2), MP_ROM_PTR(&pin_PA09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_CS_2), MP_ROM_PTR(&pin_PB11) }, { MP_OBJ_NEW_QSTR(MP_QSTR_WP_2), MP_ROM_PTR(&pin_PA10) }, { MP_OBJ_NEW_QSTR(MP_QSTR_HOLD_2), MP_ROM_PTR(&pin_PA11) }, + + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/matrixportal_m4/pins.c b/ports/atmel-samd/boards/matrixportal_m4/pins.c index 4bd0a0df7e..09957ba682 100644 --- a/ports/atmel-samd/boards/matrixportal_m4/pins.c +++ b/ports/atmel-samd/boards/matrixportal_m4/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, @@ -59,4 +61,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/meowmeow/pins.c b/ports/atmel-samd/boards/meowmeow/pins.c index 41d122d874..1c86b3149c 100644 --- a/ports/atmel-samd/boards/meowmeow/pins.c +++ b/ports/atmel-samd/boards/meowmeow/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA03) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, @@ -13,10 +15,13 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_PA09) }, + { 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_PB02) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA14) }, @@ -28,14 +33,19 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA30) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA31) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA02) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB23) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PB23) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA01) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA15) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA14) }, { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/metro_m0_express/pins.c b/ports/atmel-samd/boards/metro_m0_express/pins.c index eba885cb78..d8f970ac35 100644 --- a/ports/atmel-samd/boards/metro_m0_express/pins.c +++ b/ports/atmel-samd/boards/metro_m0_express/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -34,4 +36,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); 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 4e90870c49..4af8871ff0 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/pins.c +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, @@ -52,4 +54,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/metro_m4_express/pins.c b/ports/atmel-samd/boards/metro_m4_express/pins.c index 8b04072917..1f96885cc1 100644 --- a/ports/atmel-samd/boards/metro_m4_express/pins.c +++ b/ports/atmel-samd/boards/metro_m4_express/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, @@ -45,4 +47,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/mini_sam_m4/pins.c b/ports/atmel-samd/boards/mini_sam_m4/pins.c index b1d8d5325c..0f7a3adb24 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/pins.c +++ b/ports/atmel-samd/boards/mini_sam_m4/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, @@ -39,4 +41,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/monster_m4sk/board.c b/ports/atmel-samd/boards/monster_m4sk/board.c index 8ef0c6ff95..eec24e1677 100644 --- a/ports/atmel-samd/boards/monster_m4sk/board.c +++ b/ports/atmel-samd/boards/monster_m4sk/board.c @@ -81,7 +81,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PA23, // backlight pin diff --git a/ports/atmel-samd/boards/monster_m4sk/pins.c b/ports/atmel-samd/boards/monster_m4sk/pins.c index eb5cfd3965..8de94e2d70 100644 --- a/ports/atmel-samd/boards/monster_m4sk/pins.c +++ b/ports/atmel-samd/boards/monster_m4sk/pins.c @@ -3,7 +3,9 @@ #include "supervisor/board.h" #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_HEADPHONE_LEFT), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, @@ -50,4 +52,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}, { MP_ROM_QSTR(MP_QSTR_RIGHT_DISPLAY), MP_ROM_PTR(&displays[0].display)} }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c index 2ea5630079..ed573fde1b 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c +++ b/ports/atmel-samd/boards/ndgarage_ndbit6/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA11) }, @@ -31,9 +33,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA23) }, { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c index f0615df5aa..e75e6e9208 100644 --- a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c +++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA07) }, @@ -29,8 +31,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA16) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA23) }, { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.h b/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.h index 7a923ead11..1eb6fbf3e6 100644 --- a/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.h @@ -2,6 +2,7 @@ #define MICROPY_HW_MCU_NAME "samd21e18" #define MICROPY_HW_NEOPIXEL (&pin_PA05) +#define MICROPY_HW_NEOPIXEL_COUNT (4) #define IGNORE_PIN_PA00 1 #define IGNORE_PIN_PA01 1 diff --git a/ports/atmel-samd/boards/neopixel_trinkey_m0/pins.c b/ports/atmel-samd/boards/neopixel_trinkey_m0/pins.c index 3673fcbeca..b48764518e 100644 --- a/ports/atmel-samd/boards/neopixel_trinkey_m0/pins.c +++ b/ports/atmel-samd/boards/neopixel_trinkey_m0/pins.c @@ -1,9 +1,11 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_TOUCH1), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_TOUCH2), MP_ROM_PTR(&pin_PA07) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/nfc_copy_cat/pins.c b/ports/atmel-samd/boards/nfc_copy_cat/pins.c index ebe6e89e47..cbf25ce4e9 100644 --- a/ports/atmel-samd/boards/nfc_copy_cat/pins.c +++ b/ports/atmel-samd/boards/nfc_copy_cat/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA02) }, // IRQ { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) }, // IN_A { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) }, // IN_B @@ -17,4 +19,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA18) }, // CS { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/openbook_m4/pins.c b/ports/atmel-samd/boards/openbook_m4/pins.c index 45a7bc1dd0..750c687bb2 100644 --- a/ports/atmel-samd/boards/openbook_m4/pins.c +++ b/ports/atmel-samd/boards/openbook_m4/pins.c @@ -3,7 +3,9 @@ #include "supervisor/board.h" #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, // A0 = audio right channel { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, // A1 = audio left channel { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) }, @@ -28,7 +30,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA20) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA21) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA22) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA23) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_D48), MP_ROM_PTR(&pin_PB31) }, // UART @@ -72,4 +77,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].epaper_display)} }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/pewpew10/pins.c b/ports/atmel-samd/boards/pewpew10/pins.c index 9e5b9d98ec..fd36aba00f 100644 --- a/ports/atmel-samd/boards/pewpew10/pins.c +++ b/ports/atmel-samd/boards/pewpew10/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Pins for internal use. { MP_ROM_QSTR(MP_QSTR__R1), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR__R2), MP_ROM_PTR(&pin_PA11) }, @@ -48,4 +50,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/pewpew_m4/board.c b/ports/atmel-samd/boards/pewpew_m4/board.c index 88c5bd9698..6ce97f7b3f 100644 --- a/ports/atmel-samd/boards/pewpew_m4/board.c +++ b/ports/atmel-samd/boards/pewpew_m4/board.c @@ -133,7 +133,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), NULL, // backlight pin diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 7990f91ccc..7c3e7eb3ed 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -10,37 +10,37 @@ INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + +CIRCUIPTY_USB_CDC = 0 CIRCUITPY_AUDIOBUSIO = 0 -CIRCUITPY_AUDIOPWMIO = 0 CIRCUITPY_AUDIOMP3 = 0 +CIRCUITPY_AUDIOPWMIO = 0 CIRCUITPY_BITBANGIO = 0 CIRCUITPY_BITBANG_APA102 = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_GAMEPADSHIFT = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_PS2IO = 0 CIRCUITPY_PULSEIO = 0 +CIRCUITPY_PWMIO = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 0 CIRCUITPY_SAMD = 0 CIRCUITPY_TOUCHIO = 0 -CIRCUIPTY_USB_CDC = 0 CIRCUITPY_USB_HID = 0 CIRCUITPY_USB_MIDI = 0 CIRCUITPY_VECTORIO = 0 -CIRCUITPY_GAMEPAD = 0 -CIRCUITPY_PWMIO = 0 CIRCUITPY_ANALOGIO = 1 -CIRCUITPY_AUDIOMIXER = 1 CIRCUITPY_AUDIOIO = 1 -CIRCUITPY_SYNTHIO = 1 +CIRCUITPY_AUDIOMIXER = 1 CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_KEYPAD = 1 CIRCUITPY_MATH = 1 CIRCUITPY_STAGE = 1 -CIRCUITPY_KEYPAD = 1 +CIRCUITPY_SYNTHIO = 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/pewpew_m4/pins.c b/ports/atmel-samd/boards/pewpew_m4/pins.c index 7654432f57..ad0685e896 100644 --- a/ports/atmel-samd/boards/pewpew_m4/pins.c +++ b/ports/atmel-samd/boards/pewpew_m4/pins.c @@ -1,7 +1,9 @@ #include "shared-bindings/board/__init__.h" #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_LEFT), MP_ROM_PTR(&pin_PB23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_RIGHT), MP_ROM_PTR(&pin_PB22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_UP), MP_ROM_PTR(&pin_PA23) }, @@ -42,4 +44,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/picoplanet/pins.c b/ports/atmel-samd/boards/picoplanet/pins.c index 4c9b11e3d5..5a6abec10a 100644 --- a/ports/atmel-samd/boards/picoplanet/pins.c +++ b/ports/atmel-samd/boards/picoplanet/pins.c @@ -1,13 +1,21 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_D5),MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_GREEN_LED),MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_D6),MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_RED_LED),MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_D7),MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_BLUE_LED),MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA08) }, @@ -29,4 +37,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/pybadge/board.c b/ports/atmel-samd/boards/pybadge/board.c index 4adf10710e..5d0642e5c2 100644 --- a/ports/atmel-samd/boards/pybadge/board.c +++ b/ports/atmel-samd/boards/pybadge/board.c @@ -103,7 +103,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PA01, // backlight pin diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index 54f00b7448..b5fda72f90 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -10,7 +10,7 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = GD25Q16C LONGINT_IMPL = MPZ -CIRCUITPY_GAMEPAD = 1 +CIRCUITPY_AESIO = 0 CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_STAGE = 1 diff --git a/ports/atmel-samd/boards/pybadge/pins.c b/ports/atmel-samd/boards/pybadge/pins.c index 8757adb8e1..eb8aa81241 100644 --- a/ports/atmel-samd/boards/pybadge/pins.c +++ b/ports/atmel-samd/boards/pybadge/pins.c @@ -3,7 +3,9 @@ #include "supervisor/board.h" #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) }, @@ -69,4 +71,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk index bbed46dbed..3eda028754 100644 --- a/ports/atmel-samd/boards/pycubed/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pycubed/mpconfigboard.mk @@ -16,8 +16,8 @@ CIRCUITPY_DRIVE_LABEL = "PYCUBED" CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_KEYPAD = 0 CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_KEYPAD = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_PS2IO = 0 diff --git a/ports/atmel-samd/boards/pycubed/pins.c b/ports/atmel-samd/boards/pycubed/pins.c index 93f349ffa4..8beb8d0cd6 100644 --- a/ports/atmel-samd/boards/pycubed/pins.c +++ b/ports/atmel-samd/boards/pycubed/pins.c @@ -1,7 +1,9 @@ #include "shared-bindings/board/__init__.h" #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) }, @@ -52,4 +54,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/pycubed_mram/pins.c b/ports/atmel-samd/boards/pycubed_mram/pins.c index 93f349ffa4..8beb8d0cd6 100644 --- a/ports/atmel-samd/boards/pycubed_mram/pins.c +++ b/ports/atmel-samd/boards/pycubed_mram/pins.c @@ -1,7 +1,9 @@ #include "shared-bindings/board/__init__.h" #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) }, @@ -52,4 +54,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/pygamer/board.c b/ports/atmel-samd/boards/pygamer/board.c index 11e18f1271..d9d9f11eda 100644 --- a/ports/atmel-samd/boards/pygamer/board.c +++ b/ports/atmel-samd/boards/pygamer/board.c @@ -103,7 +103,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PA01, // backlight pin diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk index 5cef7b44cf..5b5a84bb78 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk @@ -10,7 +10,7 @@ QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICES = GD25Q64C LONGINT_IMPL = MPZ -CIRCUITPY_GAMEPAD = 1 +CIRCUITPY_AESIO = 0 CIRCUITPY_GAMEPADSHIFT = 1 CIRCUITPY_STAGE = 1 diff --git a/ports/atmel-samd/boards/pygamer/pins.c b/ports/atmel-samd/boards/pygamer/pins.c index 9fa68dd81d..f81b306a48 100644 --- a/ports/atmel-samd/boards/pygamer/pins.c +++ b/ports/atmel-samd/boards/pygamer/pins.c @@ -3,7 +3,9 @@ #include "supervisor/board.h" #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) }, @@ -74,4 +76,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/pyportal/board.c b/ports/atmel-samd/boards/pyportal/board.c index abeeab8e79..b46b176afc 100644 --- a/ports/atmel-samd/boards/pyportal/board.c +++ b/ports/atmel-samd/boards/pyportal/board.c @@ -61,9 +61,9 @@ uint8_t display_init_sequence[] = { }; void board_init(void) { - displayio_parallelbus_obj_t *bus = &displays[0].parallel_bus; - bus->base.type = &displayio_parallelbus_type; - common_hal_displayio_parallelbus_construct(bus, + paralleldisplay_parallelbus_obj_t *bus = &displays[0].parallel_bus; + bus->base.type = ¶lleldisplay_parallelbus_type; + common_hal_paralleldisplay_parallelbus_construct(bus, &pin_PA16, // Data0 &pin_PB05, // Command or data &pin_PB06, // Chip select @@ -90,7 +90,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // Set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PB31, // Backlight pin diff --git a/ports/atmel-samd/boards/pyportal/pins.c b/ports/atmel-samd/boards/pyportal/pins.c index d7cde230a1..d2c7589ee1 100644 --- a/ports/atmel-samd/boards/pyportal/pins.c +++ b/ports/atmel-samd/boards/pyportal/pins.c @@ -6,7 +6,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_AUDIO_OUT), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, // analog out/in @@ -80,4 +82,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/pyportal_titano/board.c b/ports/atmel-samd/boards/pyportal_titano/board.c index e2b231980b..138f94ebc8 100644 --- a/ports/atmel-samd/boards/pyportal_titano/board.c +++ b/ports/atmel-samd/boards/pyportal_titano/board.c @@ -78,9 +78,9 @@ uint8_t display_init_sequence[] = { }; void board_init(void) { - displayio_parallelbus_obj_t *bus = &displays[0].parallel_bus; - bus->base.type = &displayio_parallelbus_type; - common_hal_displayio_parallelbus_construct(bus, + paralleldisplay_parallelbus_obj_t *bus = &displays[0].parallel_bus; + bus->base.type = ¶lleldisplay_parallelbus_type; + common_hal_paralleldisplay_parallelbus_construct(bus, &pin_PA16, // Data0 &pin_PB05, // Command or data &pin_PB06, // Chip select @@ -107,7 +107,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // Set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PB31, // Backlight pin diff --git a/ports/atmel-samd/boards/pyportal_titano/pins.c b/ports/atmel-samd/boards/pyportal_titano/pins.c index d7cde230a1..d2c7589ee1 100644 --- a/ports/atmel-samd/boards/pyportal_titano/pins.c +++ b/ports/atmel-samd/boards/pyportal_titano/pins.c @@ -6,7 +6,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_AUDIO_OUT), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, // analog out/in @@ -80,4 +82,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/pyruler/pins.c b/ports/atmel-samd/boards/pyruler/pins.c index 37538cae5f..e8f8d64b3d 100644 --- a/ports/atmel-samd/boards/pyruler/pins.c +++ b/ports/atmel-samd/boards/pyruler/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA08) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, @@ -50,4 +52,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/qtpy_m0/pins.c b/ports/atmel-samd/boards/qtpy_m0/pins.c index 636c48bffc..0796838437 100644 --- a/ports/atmel-samd/boards/qtpy_m0/pins.c +++ b/ports/atmel-samd/boards/qtpy_m0/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA02) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, @@ -46,4 +48,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c b/ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c index 636c48bffc..0796838437 100644 --- a/ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c +++ b/ports/atmel-samd/boards/qtpy_m0_haxpress/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA02) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, @@ -46,4 +48,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/robohatmm1_m4/pins.c b/ports/atmel-samd/boards/robohatmm1_m4/pins.c index 32959ef3f2..f56c0ed8a8 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/pins.c +++ b/ports/atmel-samd/boards/robohatmm1_m4/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" // Version 2.4 -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // SERVO Pins { MP_ROM_QSTR(MP_QSTR_SERVO1), MP_ROM_PTR(&pin_PA18) }, { MP_ROM_QSTR(MP_QSTR_SERVO2), MP_ROM_PTR(&pin_PA19) }, @@ -88,4 +90,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/sam32/pins.c b/ports/atmel-samd/boards/sam32/pins.c index 463615960f..68e4a13e95 100644 --- a/ports/atmel-samd/boards/sam32/pins.c +++ b/ports/atmel-samd/boards/sam32/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PB04) }, @@ -63,4 +65,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_PA06) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/same54_xplained/pins.c b/ports/atmel-samd/boards/same54_xplained/pins.c index 1ed431fbad..8df2ec5371 100644 --- a/ports/atmel-samd/boards/same54_xplained/pins.c +++ b/ports/atmel-samd/boards/same54_xplained/pins.c @@ -16,7 +16,9 @@ STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PD08) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PD09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_VSYNC), MP_ROM_PTR(&pin_PA12) }, @@ -114,4 +116,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c index fe2393a572..0476932e67 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/board.c @@ -98,7 +98,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PC05, // backlight pin diff --git a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c index fb043349f3..0ff0f7b1ba 100644 --- a/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c +++ b/ports/atmel-samd/boards/seeeduino_wio_terminal/pins.c @@ -1,7 +1,9 @@ #include "shared-bindings/board/__init__.h" #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Analog pins { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PB08) }, @@ -111,4 +113,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/seeeduino_xiao/pins.c b/ports/atmel-samd/boards/seeeduino_xiao/pins.c index 8b96902531..9dd92c8c40 100644 --- a/ports/atmel-samd/boards/seeeduino_xiao/pins.c +++ b/ports/atmel-samd/boards/seeeduino_xiao/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Analog pins { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, @@ -51,4 +53,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.h b/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.h index 9e3fa10df8..32a7134b09 100644 --- a/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.h +++ b/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.h @@ -18,3 +18,7 @@ // 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 diff --git a/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk b/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk index 196d36816f..f59483a608 100644 --- a/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sensebox_mcu/mpconfigboard.mk @@ -9,3 +9,8 @@ CHIP_FAMILY = samd21 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = NONE CIRCUITPY_FULL_BUILD = 0 + +# There are many pin definitions on this board; it doesn't quite fit on very large translations. +# Remove a couple of modules. +CIRCUITPY_ONEWIREIO = 0 +CIRCUITPY_RAINBOWIO = 0 diff --git a/ports/atmel-samd/boards/sensebox_mcu/pins.c b/ports/atmel-samd/boards/sensebox_mcu/pins.c index 55afcc989e..1f8633b177 100644 --- a/ports/atmel-samd/boards/sensebox_mcu/pins.c +++ b/ports/atmel-samd/boards/sensebox_mcu/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Analog pins { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA04) }, @@ -68,4 +70,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/serpente/pins.c b/ports/atmel-samd/boards/serpente/pins.c index 7b7b14799e..96d566e7a3 100644 --- a/ports/atmel-samd/boards/serpente/pins.c +++ b/ports/atmel-samd/boards/serpente/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA04) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA06) }, @@ -36,4 +38,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/shirtty/pins.c b/ports/atmel-samd/boards/shirtty/pins.c index 40e8192341..4ed0d37c67 100644 --- a/ports/atmel-samd/boards/shirtty/pins.c +++ b/ports/atmel-samd/boards/shirtty/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, @@ -33,4 +35,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/silicognition-m4-shim/pins.c b/ports/atmel-samd/boards/silicognition-m4-shim/pins.c index b7afd044e9..4753b42a81 100644 --- a/ports/atmel-samd/boards/silicognition-m4-shim/pins.c +++ b/ports/atmel-samd/boards/silicognition-m4-shim/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_D14), MP_ROM_PTR(&pin_PA02) }, @@ -43,7 +45,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA20) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA21) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB03) }, @@ -51,4 +55,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/snekboard/pins.c b/ports/atmel-samd/boards/snekboard/pins.c index 48bdc672e0..46269bf7d3 100644 --- a/ports/atmel-samd/boards/snekboard/pins.c +++ b/ports/atmel-samd/boards/snekboard/pins.c @@ -1,16 +1,23 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB09) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA08) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PA09) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_POWER1), MP_ROM_PTR(&pin_PA12) }, @@ -22,7 +29,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_POWER4), MP_ROM_PTR(&pin_PA19) }, { MP_ROM_QSTR(MP_QSTR_DIR4), MP_ROM_PTR(&pin_PA21) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB11) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/pins.c b/ports/atmel-samd/boards/sparkfun_lumidrive/pins.c index 52c0753d41..9557abac93 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/pins.c +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/pins.c @@ -1,15 +1,20 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { 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_SCK), MP_ROM_PTR(&pin_PA19) }, // - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA18) }, // - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, // - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, // + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, + { 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_D13), MP_ROM_PTR(&pin_PA17) }, // + + { 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_UART), MP_ROM_PTR(&board_uart_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c index 9562dc3b80..dee32d5f1a 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA06) }, @@ -18,7 +20,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA23) }, @@ -39,4 +44,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) } }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c index 9562dc3b80..dee32d5f1a 100644 --- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c +++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_with_flash/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA06) }, @@ -18,7 +20,10 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PA23) }, @@ -39,4 +44,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) } }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/pins.c b/ports/atmel-samd/boards/sparkfun_redboard_turbo/pins.c index 485589fcaf..de81d035d8 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/pins.c +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/pins.c @@ -1,16 +1,21 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -22,15 +27,24 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_SDA), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + + { MP_ROM_QSTR(MP_QSTR_RX_LED), MP_ROM_PTR(&pin_PA31) }, + { MP_ROM_QSTR(MP_QSTR_TX_LED), MP_ROM_PTR(&pin_PA27) }, + { MP_ROM_QSTR(MP_QSTR_RGB_LED), MP_ROM_PTR(&pin_PA30) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/pins.c b/ports/atmel-samd/boards/sparkfun_samd21_dev/pins.c index 039100956e..d4c3ca6bb5 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/pins.c +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Analog pins { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, @@ -55,4 +57,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/pins.c b/ports/atmel-samd/boards/sparkfun_samd21_mini/pins.c index a90b0b5a30..5808af6e07 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/pins.c +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Analog pins { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, @@ -48,4 +50,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h index 1842629266..5344e3c1ca 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.h @@ -1,8 +1,11 @@ -#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod SAMD51" +#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod SAMD51 Processor" #define MICROPY_HW_MCU_NAME "samd51j20" #define CIRCUITPY_MCU_FAMILY samd51 +// Status LED +#define MICROPY_HW_LED_STATUS (&pin_PA23) + // On-board flash #define SPI_FLASH_MOSI_PIN &pin_PA09 #define SPI_FLASH_MISO_PIN &pin_PA10 diff --git a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk index 63d52382a2..3ae3d8f5a9 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd51_micromod/mpconfigboard.mk @@ -1,7 +1,7 @@ LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x1b4f USB_PID = 0x0020 # Used by uf2 bootloader -USB_PRODUCT = "SparkFun MicroMod SAMD51" +USB_PRODUCT = "SparkFun MicroMod SAMD51 Processor" USB_MANUFACTURER = "SparkFun Electronics" CHIP_VARIANT = SAMD51J20A diff --git a/ports/atmel-samd/boards/sparkfun_samd51_micromod/pins.c b/ports/atmel-samd/boards/sparkfun_samd51_micromod/pins.c index 49411217d7..5a35a60e82 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_micromod/pins.c +++ b/ports/atmel-samd/boards/sparkfun_samd51_micromod/pins.c @@ -1,97 +1,225 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2021 Chris Wilson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - // D (digital only) pins (D0,D1) - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB04) }, - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB05) }, +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // The SparkFun MicroMod spec uses a zero-based peripheral numbering scheme. + // The 0th peripheral is the default and the "0" is omitted from the + // peripheral name (e.g. "I2C" instead of "I2C0"). + // + // For more details, see https://www.sparkfun.com/micromod#tech-specs - // A (ADC) pins (A0-A4) - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB00) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB02) }, - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PB03) }, + // MicroMod built-in status LED pin + // Requirement from the "Designing with MicroMod" SparkFun article: + // "... every Processor Board shall include one status LED connected to a + // pin that is not connected to the board edge." + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA23) }, // MicroMod LED (PA23) - // DAC - { MP_ROM_QSTR(MP_QSTR_DAC), MP_ROM_PTR(&pin_PA02) }, + // MicroMod USB bus input voltage (+5V) pin + // { MP_ROM_QSTR(MP_QSTR_USB_VIN), MP_ROM_PTR() }, // MicroMod USB_VIN (not connected) - // G (General/BUS) pins (G0-G9) - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_G2), MP_ROM_PTR(&pin_PB08) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_G3), MP_ROM_PTR(&pin_PB09) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_G4), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB11) }, - { MP_ROM_QSTR(MP_QSTR_G5), MP_ROM_PTR(&pin_PB11) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_G6), MP_ROM_PTR(&pin_PB12) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_G7), MP_ROM_PTR(&pin_PB13) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_G8), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_PA15) }, - { MP_ROM_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_PB31) }, - { MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_PB30) }, - { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_PB14) }, - { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_PB15) }, - { MP_ROM_QSTR(MP_QSTR_G11), MP_ROM_PTR(&pin_PB15) }, + // MicroMod +3.3V enable pin + { MP_ROM_QSTR(MP_QSTR_P3V3_EN), MP_ROM_PTR(&pin_PA19) }, // MicroMod 3.3V_EN (PA19) - // PWM pins (PWM0, PWM1) - { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_PB01) }, - { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_PB02) }, + // MicroMod battery voltage sense pin + { MP_ROM_QSTR(MP_QSTR_BATT_VIN3), MP_ROM_PTR(&pin_PB03) }, // MicroMod BATT_VIN/3 (PB03) - // AUD (audio) - { MP_ROM_QSTR(MP_QSTR_AUD_MCLK), MP_ROM_PTR(&pin_PB17) }, - { MP_ROM_QSTR(MP_QSTR_AUD_OUT), MP_ROM_PTR(&pin_PA21) }, - { MP_ROM_QSTR(MP_QSTR_AUD_IN), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_AUD_LRCLK), MP_ROM_PTR(&pin_PA20) }, - { MP_ROM_QSTR(MP_QSTR_AUD_BCLK), MP_ROM_PTR(&pin_PB16) }, + // MicroMod reset pin + // { MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR() }, // MicroMod RESET# (SAMD51 has a dedicated HW RESETN pin) - // I2C - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA16) }, - { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_PA16) }, + // MicroMod boot pin + // { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR() }, // MicroMod BOOT (not connected) - { MP_ROM_QSTR(MP_QSTR_I2C_INT), MP_ROM_PTR(&pin_PA18) }, + // MicroMod USB device pins + // USB device is always used internally by CircuitPython, so skip creating + // the pin objects for it. See explicit ignores in mpconfigboard.h. + // { MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR(&pin_PA24) }, // MicroMod USB_D- (PA24) + // { MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR(&pin_PA25) }, // MicroMod USB_D+ (PA25) - // I2C2 - { MP_ROM_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_PA12) }, + // MicroMod USB host pins + // { MP_ROM_QSTR(MP_QSTR_USBHOST_DM), MP_ROM_PTR() }, // MicroMod USBHOST_D- (not connected) + // { MP_ROM_QSTR(MP_QSTR_USBHOST_DP), MP_ROM_PTR() }, // MicroMod USBHOST_D+ (not connected) - // SPI - { MP_ROM_QSTR(MP_QSTR_CIPO), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_COPI), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA04) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PA07) }, + // MicroMod CAN pins + { MP_ROM_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB15) }, // MicroMod CAN_RX (PB15) + { MP_ROM_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB14) }, // MicroMod CAN_TX (PB14) - // Status LED - { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA23) }, + // Note: MicroMod UART (UART0) is not present in the edge connector pinout + // because the primary debug serial port is exposed as a virtual serial port + // over USB. - // UART - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB30) }, - { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PB30) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB31) }, - { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_PB31) }, + // MicroMod UART1 pins + { MP_ROM_QSTR(MP_QSTR_UART_TX1), MP_ROM_PTR(&pin_PB31) }, // MicroMod UART_TX1 | CircuitPython TX (PB31) + { MP_ROM_QSTR(MP_QSTR_UART_RX1), MP_ROM_PTR(&pin_PB30) }, // MicroMod UART_RX1 | CircuitPython RX (PB30) + // { MP_ROM_QSTR(MP_QSTR_UART_RTS1), MP_ROM_PTR() }, // MicroMod RTS1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_UART_CTS1), MP_ROM_PTR() }, // MicroMod CTS1 (not connected) - // UART2 - { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_PA13) }, - { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_PA12) }, + // CircuitPython default UART pins + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB31) }, // CircuitPython TX | MicroMod UART_TX1 (PB31) + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB30) }, // CircuitPython RX | MicroMod UART_RX1 (PB30) + // MicroMod UART2 pins + { MP_ROM_QSTR(MP_QSTR_UART_TX2), MP_ROM_PTR(&pin_PA12) }, // MicroMod UART_TX2 (PA12) + { MP_ROM_QSTR(MP_QSTR_UART_RX2), MP_ROM_PTR(&pin_PA13) }, // MicroMod UART_RX2 (PA13) - // Board objects - { 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 I2C pins + { MP_ROM_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_PA17) }, // MicroMod I2C_SDA | CircuitPython SDA (PA17) + { MP_ROM_QSTR(MP_QSTR_I2C_SCL), MP_ROM_PTR(&pin_PA16) }, // MicroMod I2C_SCL | CircuitPython SCL (PA16) + // CircuitPython default I2C pins + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA17) }, // CircuitPython SDA | MicroMod I2C_SDA (PA17) + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA16) }, // CircuitPython SCL | MicroMod I2C_SCL (PA16) + + // MicroMod I2C interrupt pin + { MP_ROM_QSTR(MP_QSTR_I2C_INT), MP_ROM_PTR(&pin_PA18) }, // MicroMod I2C_INT (PA18) + + // MicroMod I2C1 pins + { MP_ROM_QSTR(MP_QSTR_I2C_SDA1), MP_ROM_PTR(&pin_PA13) }, // MicroMod I2C_SDA1 (PA13) + { MP_ROM_QSTR(MP_QSTR_I2C_SCL1), MP_ROM_PTR(&pin_PA12) }, // MicroMod I2C_SCL1 (PA12) + + // MicroMod SPI pins + { MP_ROM_QSTR(MP_QSTR_SPI_CIPO), MP_ROM_PTR(&pin_PA06) }, // MicroMod SPI_CIPO | CircuitPython CIPO (PA06) + { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_PA06) }, // MicroMod SPI_MISO | CircuitPython MISO (PA06) + { MP_ROM_QSTR(MP_QSTR_SPI_COPI), MP_ROM_PTR(&pin_PA04) }, // MicroMod SPI_COPI | CircuitPython COPI | LED_DAT (PA04) + { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_PA04) }, // MicroMod SPI_MOSI | CircuitPython MOSI (PA04) + { MP_ROM_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_PA05) }, // MicroMod SPI_SCK | CircuitPython SCK | LED_CLK (PA05) + { MP_ROM_QSTR(MP_QSTR_SPI_CS), MP_ROM_PTR(&pin_PA07) }, // MicroMod SPI_CS | CircuitPython CS (PA07) + + // CircuitPython default SPI pins + { MP_ROM_QSTR(MP_QSTR_CIPO), MP_ROM_PTR(&pin_PA06) }, // CircuitPython CIPO | MicroMod SPI_CIPO (PA06) + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA06) }, // CircuitPython MISO | MicroMod SPI_MISO (PA06) + { MP_ROM_QSTR(MP_QSTR_COPI), MP_ROM_PTR(&pin_PA04) }, // CircuitPython COPI | MicroMod SPI_COPI | LED_DAT (PA04) + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA04) }, // CircuitPython MOSI | MicroMod SPI_MOSI (PA04) + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA05) }, // CircuitPython SCK | MicroMod SPI_SCK | LED_CLK (PA05) + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PA07) }, // CircuitPython CS | MicroMod SPI_CS (PA07) + + // MicroMod 2-wire serial LED pins + { MP_ROM_QSTR(MP_QSTR_LED_DAT), MP_ROM_PTR(&pin_PA04) }, // MicroMod LED_DAT | SPI_COPI (PA04) + { MP_ROM_QSTR(MP_QSTR_LED_CLK), MP_ROM_PTR(&pin_PA05) }, // MicroMod LED_CLK | SPI_SCK (PA05) + + // MicroMod SDIO pins + // { MP_ROM_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR() }, // MicroMod SDIO_SCK | SPI_SCK1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SDIO_CMD), MP_ROM_PTR() }, // MicroMod SDIO_CMD | SPI_COPI1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SDIO_DATA0), MP_ROM_PTR() }, // MicroMod SDIO_DATA0 | SPI_CIPO1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SDIO_DATA1), MP_ROM_PTR() }, // MicroMod SDIO_DATA1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SDIO_DATA2), MP_ROM_PTR() }, // MicroMod SDIO_DATA2 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SDIO_DATA3), MP_ROM_PTR() }, // MicroMod SDIO_DATA3 | SPI_CS1 (not connected) + + // MicroMod SPI1 pins + // { MP_ROM_QSTR(MP_QSTR_SPI_CIPO1), MP_ROM_PTR() }, // MicroMod SPI_CIPO1 | SDIO_DATA0 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SPI_MISO1), MP_ROM_PTR() }, // MicroMod SPI_MISO1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SPI_COPI1), MP_ROM_PTR() }, // MicroMod SPI_COPI1 | SDIO_CMD (not connected) + // { MP_ROM_QSTR(MP_QSTR_SPI_MOSI1), MP_ROM_PTR() }, // MicroMod SPI_MOSI1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SPI_SCK1), MP_ROM_PTR() }, // MicroMod SPI_SCK1 | SDIO_SCK (not connected) + // { MP_ROM_QSTR(MP_QSTR_SPI_CS1), MP_ROM_PTR() }, // MicroMod SPI_CS1 | SDIO_DATA3 (not connected) + + // MicroMod audio pins + { MP_ROM_QSTR(MP_QSTR_AUD_MCLK), MP_ROM_PTR(&pin_PB17) }, // MicroMod AUD_MCLK (PB17) + { MP_ROM_QSTR(MP_QSTR_AUD_OUT), MP_ROM_PTR(&pin_PA21) }, // MicroMod AUD_OUT | I2S_OUT | PCM_OUT | CAM_MCLK (PA21) + { MP_ROM_QSTR(MP_QSTR_AUD_IN), MP_ROM_PTR(&pin_PA22) }, // MicroMod AUD_IN | I2S_IN | PCM_IN | CAM_PCLK (PA22) + { MP_ROM_QSTR(MP_QSTR_AUD_LRCLK), MP_ROM_PTR(&pin_PA20) }, // MicroMod AUD_LRCLK | I2S_WS | PCM_SYNC | PDM_DATA (PA20) + { MP_ROM_QSTR(MP_QSTR_AUD_BCLK), MP_ROM_PTR(&pin_PB16) }, // MicroMod AUD_BCLK | I2S_SCK | PCM_CLK | PDM_CLK (PB16) + + // MicroMod I2S pins + { MP_ROM_QSTR(MP_QSTR_I2S_OUT), MP_ROM_PTR(&pin_PA21) }, // MicroMod I2S_OUT | AUD_OUT | PCM_OUT | CAM_MCLK (PA21) + { MP_ROM_QSTR(MP_QSTR_I2S_IN), MP_ROM_PTR(&pin_PA22) }, // MicroMod I2S_IN | AUD_IN | PCM_IN | CAM_PCLK (PA22) + { MP_ROM_QSTR(MP_QSTR_I2S_WS), MP_ROM_PTR(&pin_PA20) }, // MicroMod I2S_WS | AUD_LRCLK | PCM_SYNC | PDM_DATA (PA20) + { MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_PB16) }, // MicroMod I2S_SCK | AUD_BCLK | PCM_CLK | PDM_CLK (PB16) + + // MicroMod PCM pins + { MP_ROM_QSTR(MP_QSTR_PCM_OUT), MP_ROM_PTR(&pin_PA21) }, // MicroMod PCM_OUT | AUD_OUT | I2S_OUT | CAM_MCLK (PA21) + { MP_ROM_QSTR(MP_QSTR_PCM_IN), MP_ROM_PTR(&pin_PA22) }, // MicroMod PCM_IN | AUD_IN | I2S_IN | CAM_PCLK (PA22) + { MP_ROM_QSTR(MP_QSTR_PCM_SYNC), MP_ROM_PTR(&pin_PA20) }, // MicroMod PCM_SYNC | AUD_LRCLK | I2S_WS | PDM_DATA (PA20) + { MP_ROM_QSTR(MP_QSTR_PCM_CLK), MP_ROM_PTR(&pin_PB16) }, // MicroMod PCM_CLK | AUD_BCLK | I2S_SCK | PDM_CLK (PB16) + + // MicroMod PDM pins + { MP_ROM_QSTR(MP_QSTR_PDM_DATA), MP_ROM_PTR(&pin_PA20) }, // MicroMod PDM_DATA | AUD_LRCLK | I2S_WS | PCM_SYNC (PA20) + { MP_ROM_QSTR(MP_QSTR_PDM_CLK), MP_ROM_PTR(&pin_PB16) }, // MicroMod PDM_CLK | AUD_BCLK | I2S_SCK | PCM_CLK (PB16) + + // MicroMod SWD pins + { MP_ROM_QSTR(MP_QSTR_SWDIO), MP_ROM_PTR(&pin_PA31) }, // MicroMod SWDIO (PA31) + { MP_ROM_QSTR(MP_QSTR_SWCLK), MP_ROM_PTR(&pin_PA30) }, // MicroMod SWDCK (PA30) + // { MP_ROM_QSTR(MP_QSTR_SWO), MP_ROM_PTR() }, // MicroMod SWO | G11 (not connected) + + // MicroMod ADC pins + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, // MicroMod A0 (PA02) + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB00) }, // MicroMod A1 (PB00) + + // MicroMod PWM pins + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_PB01) }, // MicroMod PWM0 (PB01) + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_PB02) }, // MicroMod PWM1 (PB02) + + // MicroMod digital pins + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB04) }, // MicroMod D0 (PB04) + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB05) }, // MicroMod D1 | CAM_TRIG (PB05) + + // MicroMod general purpose pins + { MP_ROM_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_PB06) }, // MicroMod G0 | BUS0 (PB06) + { MP_ROM_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_PB07) }, // MicroMod G1 | BUS1 (PB07) + { MP_ROM_QSTR(MP_QSTR_G2), MP_ROM_PTR(&pin_PB08) }, // MicroMod G2 | BUS2 (PB08) + { MP_ROM_QSTR(MP_QSTR_G3), MP_ROM_PTR(&pin_PB09) }, // MicroMod G3 | BUS3 (PB09) + { MP_ROM_QSTR(MP_QSTR_G4), MP_ROM_PTR(&pin_PB10) }, // MicroMod G4 | BUS4 (PB10) + { MP_ROM_QSTR(MP_QSTR_G5), MP_ROM_PTR(&pin_PB11) }, // MicroMod G5 | BUS5 (PB11) + { MP_ROM_QSTR(MP_QSTR_G6), MP_ROM_PTR(&pin_PB12) }, // MicroMod G6 | BUS6 (PB12) + { MP_ROM_QSTR(MP_QSTR_G7), MP_ROM_PTR(&pin_PB13) }, // MicroMod G7 | BUS7 (PB13) + { MP_ROM_QSTR(MP_QSTR_G8), MP_ROM_PTR(&pin_PA14) }, // MicroMod G8 (PA14) + { MP_ROM_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_PA15) }, // MicroMod G9 | ADC_D- | CAM_HSYNC (PA15) + // { MP_ROM_QSTR(MP_QSTR_G10), MP_ROM_PTR() }, // MicroMod G10 | ADC_D+ | CAM_VSYNC (not connected) + { MP_ROM_QSTR(MP_QSTR_G11), MP_ROM_PTR(&pin_PA27) }, // MicroMod G11 | SWO (PA27) + + // MicroMod 8-bit bus pins + { MP_ROM_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_PB06) }, // MicroMod BUS0 | G0 (PB06) + { MP_ROM_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_PB07) }, // MicroMod BUS1 | G1 (PB07) + { MP_ROM_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_PB08) }, // MicroMod BUS2 | G2 (PB08) + { MP_ROM_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_PB09) }, // MicroMod BUS3 | G3 (PB09) + { MP_ROM_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_PB10) }, // MicroMod BUS4 | G4 (PB10) + { MP_ROM_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_PB11) }, // MicroMod BUS5 | G5 (PB11) + { MP_ROM_QSTR(MP_QSTR_BUS6), MP_ROM_PTR(&pin_PB12) }, // MicroMod BUS6 | G6 (PB12) + { MP_ROM_QSTR(MP_QSTR_BUS7), MP_ROM_PTR(&pin_PB13) }, // MicroMod BUS7 | G7 (PB13) + + // MicroMod differential ADC input pins + // { MP_ROM_QSTR(MP_QSTR_ADC_DM), MP_ROM_PTR(&pin_PA15) }, // MicroMod ADC_D- | G9 | CAM_HSYNC (PA15) + // { MP_ROM_QSTR(MP_QSTR_ADC_DP), MP_ROM_PTR() }, // MicroMod ADC_D+ | G10 | CAM_VSYNC (not connected) + + // MicroMod camera pins + // { MP_ROM_QSTR(MP_QSTR_CAM_MCLK), MP_ROM_PTR(&pin_PA21) }, // MicroMod CAM_MCLK | AUD_OUT | I2S_OUT | PCM_OUT (PA21) + // { MP_ROM_QSTR(MP_QSTR_CAM_PCLK), MP_ROM_PTR(&pin_PA22) }, // MicroMod CAM_PCLK | AUD_IN | I2S_IN | PCM_IN (PA22) + // { MP_ROM_QSTR(MP_QSTR_CAM_TRIG), MP_ROM_PTR(&pin_PB05) }, // MicroMod CAM_TRIG | D1 (PB05) + // { MP_ROM_QSTR(MP_QSTR_CAM_HSYNC), MP_ROM_PTR(&pin_PA15 }, // MicroMod CAM_HSYNC | ADC_D- | G9 (PA15) + // { MP_ROM_QSTR(MP_QSTR_CAM_VSYNC), MP_ROM_PTR() }, // MicroMod CAM_VSYNC | ADC_D+ | G10 (not connected) + + // Module-specific aliases (not part of the MicroMod spec) + { MP_ROM_QSTR(MP_QSTR_HOST_ENABLE), MP_ROM_PTR(&pin_PA27) }, // HOST_ENABLE | G11 | SWO (PA27) + + // CircuitPython board objects + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, // CircuitPython I2C + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, // CircuitPython SPI + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, // CircuitPython UART }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/pins.c b/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/pins.c index a9ac6d98a9..be2b09848c 100644 --- a/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/pins.c +++ b/ports/atmel-samd/boards/sparkfun_samd51_thing_plus/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -34,4 +36,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/stackrduino_m0_pro/pins.c b/ports/atmel-samd/boards/stackrduino_m0_pro/pins.c index e0278aca0d..b854982500 100644 --- a/ports/atmel-samd/boards/stackrduino_m0_pro/pins.c +++ b/ports/atmel-samd/boards/stackrduino_m0_pro/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -10,10 +12,13 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_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_SDA), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA08) }, @@ -28,13 +33,17 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_D14), MP_ROM_PTR(&pin_PA28) }, { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PA28) }, { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_CHRG_EN), MP_ROM_PTR(&pin_PA13) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/stringcar_m0_express/pins.c b/ports/atmel-samd/boards/stringcar_m0_express/pins.c index 8bdfae9541..3e2a74786f 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/pins.c +++ b/ports/atmel-samd/boards/stringcar_m0_express/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_PIEZO), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA02) }, @@ -20,4 +22,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/trellis_m4_express/pins.c b/ports/atmel-samd/boards/trellis_m4_express/pins.c index 6573b5fab3..9668d3b0dc 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/pins.c +++ b/ports/atmel-samd/boards/trellis_m4_express/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, // INT pin @@ -44,4 +46,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/trinket_m0/pins.c b/ports/atmel-samd/boards/trinket_m0/pins.c index b793190650..f9db8ff994 100644 --- a/ports/atmel-samd/boards/trinket_m0/pins.c +++ b/ports/atmel-samd/boards/trinket_m0/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA08) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, @@ -35,4 +37,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/pins.c b/ports/atmel-samd/boards/trinket_m0_haxpress/pins.c index b793190650..f9db8ff994 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/pins.c +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA08) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA08) }, @@ -35,4 +37,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/uartlogger2/pins.c b/ports/atmel-samd/boards/uartlogger2/pins.c index 4e90870c49..4af8871ff0 100644 --- a/ports/atmel-samd/boards/uartlogger2/pins.c +++ b/ports/atmel-samd/boards/uartlogger2/pins.c @@ -3,7 +3,9 @@ // This mapping only includes functional names because pins broken // out on connectors are labeled with their MCU name available from // microcontroller.pin. -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, @@ -52,4 +54,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/uchip/pins.c b/ports/atmel-samd/boards/uchip/pins.c index de5508110d..7e5c9ceb27 100644 --- a/ports/atmel-samd/boards/uchip/pins.c +++ b/ports/atmel-samd/boards/uchip/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_BOOST_EN), MP_ROM_PTR(&pin_PA14) }, { MP_ROM_QSTR(MP_QSTR_VEXT_SELECT), MP_ROM_PTR(&pin_PA15) }, @@ -38,4 +40,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/ugame10/board.c b/ports/atmel-samd/boards/ugame10/board.c index f17b60ff60..7799e83e6f 100644 --- a/ports/atmel-samd/boards/ugame10/board.c +++ b/ports/atmel-samd/boards/ugame10/board.c @@ -100,7 +100,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), NULL, diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index 2f1062e419..f942490f29 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -14,8 +14,8 @@ CIRCUITPY_STAGE = 1 CIRCUITPY_MATH = 1 CIRCUITPY_AUDIOIO = 1 CIRCUITPY_ANALOGIO = 1 -CIRCUITPY_GAMEPAD = 1 CIRCUITPY_DISPLAYIO = 1 +CIRCUITPY_KEYPPAD = 1 CIRCUITPY_PULSEIO = 0 CIRCUITPY_AUDIOBUSIO = 0 @@ -24,6 +24,7 @@ CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 +CIRCUITPY_PARALLELDISPLAY = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_RTC = 0 CIRCUITPY_TOUCHIO = 0 diff --git a/ports/atmel-samd/boards/ugame10/pins.c b/ports/atmel-samd/boards/ugame10/pins.c index 4a03f8bb5c..0a221644f3 100644 --- a/ports/atmel-samd/boards/ugame10/pins.c +++ b/ports/atmel-samd/boards/ugame10/pins.c @@ -1,7 +1,9 @@ #include "shared-bindings/board/__init__.h" #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_X), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_O), MP_ROM_PTR(&pin_PA01) }, @@ -28,4 +30,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); 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 7364de0cfe..5bf70a9668 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/mpconfigboard.mk @@ -22,6 +22,7 @@ CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BLEIO = 0 CIRCUITPY_DISPLAYIO = 0 +CIRCUITPY_KEYPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 diff --git a/ports/atmel-samd/boards/winterbloom_big_honking_button/pins.c b/ports/atmel-samd/boards/winterbloom_big_honking_button/pins.c index a079929447..03b78aab7b 100644 --- a/ports/atmel-samd/boards/winterbloom_big_honking_button/pins.c +++ b/ports/atmel-samd/boards/winterbloom_big_honking_button/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_PA07) }, { MP_ROM_QSTR(MP_QSTR_HONK_OUT), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_GATE_OUT), MP_ROM_PTR(&pin_PA11) }, @@ -9,4 +11,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { /* Board revisions starting from v5 have PB10 tied to ground. */ { MP_ROM_QSTR(MP_QSTR_V5), MP_ROM_PTR(&pin_PB10) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk index bc4fff5018..653d2e6ed5 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk +++ b/ports/atmel-samd/boards/winterbloom_sol/mpconfigboard.mk @@ -21,6 +21,7 @@ CIRCUITPY_BITMAPTOOLS = 0 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FRAMEBUFFERIO = 0 +CIRCUITPY_KEYPAD = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_TOUCHIO = 0 CIRCUITPY_RGBMATRIX = 0 diff --git a/ports/atmel-samd/boards/winterbloom_sol/pins.c b/ports/atmel-samd/boards/winterbloom_sol/pins.c index 013542d3ca..c00390f95f 100644 --- a/ports/atmel-samd/boards/winterbloom_sol/pins.c +++ b/ports/atmel-samd/boards/winterbloom_sol/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB23) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB22) }, @@ -12,4 +14,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB03) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/xinabox_cc03/pins.c b/ports/atmel-samd/boards/xinabox_cc03/pins.c index f7c035d0b2..61a2b0b139 100644 --- a/ports/atmel-samd/boards/xinabox_cc03/pins.c +++ b/ports/atmel-samd/boards/xinabox_cc03/pins.c @@ -1,15 +1,22 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_RED), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_GREEN), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_BLUE), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/boards/xinabox_cs11/pins.c b/ports/atmel-samd/boards/xinabox_cs11/pins.c index f0ef0da674..a3d804397f 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/pins.c +++ b/ports/atmel-samd/boards/xinabox_cs11/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PA09) }, @@ -17,4 +19,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c index 2488b7b922..a434e2541b 100644 --- a/ports/atmel-samd/common-hal/audiobusio/I2SOut.c +++ b/ports/atmel-samd/common-hal/audiobusio/I2SOut.c @@ -71,7 +71,7 @@ void i2sout_reset(void) { // Make sure the I2S peripheral is running so we can see if the resources we need are free. #ifdef SAM_D5X_E5X - // Connect the clock units to the 2mhz clock. It can't disable without it. + // Connect the clock units to the 2MHz clock. It can't disable without it. connect_gclk_to_peripheral(5, I2S_GCLK_ID_0); connect_gclk_to_peripheral(5, I2S_GCLK_ID_1); #endif @@ -83,7 +83,7 @@ void i2sout_reset(void) { // Make sure the I2S peripheral is running so we can see if the resources we need are free. #ifdef SAM_D5X_E5X - // Connect the clock units to the 2mhz clock by default. They can't reset without it. + // Connect the clock units to the 2MHz clock by default. They can't reset without it. disconnect_gclk_from_peripheral(5, I2S_GCLK_ID_0); disconnect_gclk_from_peripheral(5, I2S_GCLK_ID_1); @@ -222,7 +222,6 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t *self) { reset_pin_number(self->word_select->number); self->word_select = NULL; reset_pin_number(self->data->number); - self->data = NULL; } void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self, @@ -288,7 +287,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self, I2S->TXCTRL.reg = serctrl; #endif - // The DFLL is always a 48mhz clock + // The DFLL is always a 48MHz clock enable_clock_generator(self->gclk, CLOCK_48MHZ, divisor); connect_gclk_to_peripheral(self->gclk, I2S_GCLK_ID_0 + self->clock_unit); diff --git a/ports/atmel-samd/common-hal/audioio/AudioOut.c b/ports/atmel-samd/common-hal/audioio/AudioOut.c index 5c1a02634b..7be7cf7c4c 100644 --- a/ports/atmel-samd/common-hal/audioio/AudioOut.c +++ b/ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -248,7 +248,7 @@ void common_hal_audioio_audioout_construct(audioio_audioout_obj_t *self, } self->tc_index = tc_index; - // Use the 48mhz clocks on both the SAMD21 and 51 because we will be going much slower. + // Use the 48MHz clocks on both the SAMD21 and 51 because we will be going much slower. uint8_t tc_gclk = 0; #ifdef SAM_D5X_E5X tc_gclk = 1; @@ -469,8 +469,8 @@ bool common_hal_audioio_audioout_get_paused(audioio_audioout_obj_t *self) { } void common_hal_audioio_audioout_stop(audioio_audioout_obj_t *self) { - Tc *timer = tc_insts[self->tc_index]; - timer->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_STOP; + // Do not stop the timer here. There are occasional audible artifacts if the DMA-triggering timer + // is stopped between audio plays. (Heard this only on PyPortal with one particular 32kHz sample.) audio_dma_stop(&self->left_dma); #ifdef SAM_D5X_E5X audio_dma_stop(&self->right_dma); diff --git a/ports/atmel-samd/common-hal/busio/I2C.c b/ports/atmel-samd/common-hal/busio/I2C.c index d5a8f36f6a..39aa6c9e97 100644 --- a/ports/atmel-samd/common-hal/busio/I2C.c +++ b/ports/atmel-samd/common-hal/busio/I2C.c @@ -119,6 +119,13 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, // clkrate is always 0. baud_rate is in kHz. // Frequency must be set before the I2C device is enabled. + // 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) { reset_pin_number(sda->number); reset_pin_number(scl->number); diff --git a/ports/atmel-samd/common-hal/busio/OneWire.h b/ports/atmel-samd/common-hal/busio/OneWire.h deleted file mode 100644 index a09a44c262..0000000000 --- a/ports/atmel-samd/common-hal/busio/OneWire.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * - * 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_ATMEL_SAMD_COMMON_HAL_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_ONEWIRE_H - -// Use bitbangio. -#include "shared-module/busio/OneWire.h" - -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_BUSIO_ONEWIRE_H diff --git a/ports/atmel-samd/common-hal/canio/Listener.c b/ports/atmel-samd/common-hal/canio/Listener.c index adb3048496..ce09764757 100644 --- a/ports/atmel-samd/common-hal/canio/Listener.c +++ b/ports/atmel-samd/common-hal/canio/Listener.c @@ -30,6 +30,8 @@ #include "py/obj.h" #include "py/runtime.h" +#include "lib/utils/interrupt_char.h" + #include "common-hal/canio/__init__.h" #include "common-hal/canio/Listener.h" #include "shared-bindings/canio/Listener.h" @@ -356,6 +358,11 @@ mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) { if (supervisor_ticks_ms64() > deadline) { return NULL; } + RUN_BACKGROUND_TASKS; + // Allow user to break out of a timeout with a KeyboardInterrupt. + if (mp_hal_is_interrupted()) { + return NULL; + } } while (!common_hal_canio_listener_in_waiting(self)); } int index = self->hw->RXFS.bit.F0GI; diff --git a/ports/atmel-samd/common-hal/displayio/ParallelBus.c b/ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c similarity index 85% rename from ports/atmel-samd/common-hal/displayio/ParallelBus.c rename to ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c index e5575f8dc2..490c595e74 100644 --- a/ports/atmel-samd/common-hal/displayio/ParallelBus.c +++ b/ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/displayio/ParallelBus.h" +#include "shared-bindings/paralleldisplay/ParallelBus.h" #include @@ -33,7 +33,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *self, +void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbus_obj_t *self, const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select, const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) { @@ -83,7 +83,7 @@ void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *sel common_hal_digitalio_digitalinout_construct(&self->reset, reset); common_hal_digitalio_digitalinout_switch_to_output(&self->reset, true, DRIVE_MODE_PUSH_PULL); never_reset_pin_number(reset->number); - common_hal_displayio_parallelbus_reset(self); + common_hal_paralleldisplay_parallelbus_reset(self); } never_reset_pin_number(command->number); @@ -95,7 +95,7 @@ void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *sel } } -void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self) { +void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_obj_t *self) { for (uint8_t i = 0; i < 8; i++) { reset_pin_number(self->data0_pin + i); } @@ -107,8 +107,8 @@ void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self) reset_pin_number(self->reset.pin->number); } -bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); +bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) { + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); if (self->reset.base.type == &mp_type_NoneType) { return false; } @@ -119,19 +119,19 @@ bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { return true; } -bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { +bool common_hal_paralleldisplay_parallelbus_bus_free(mp_obj_t obj) { return true; } -bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); +bool common_hal_paralleldisplay_parallelbus_begin_transaction(mp_obj_t obj) { + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->chip_select, false); return true; } -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, +void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->command, byte_type == DISPLAY_DATA); uint32_t *clear_write = (uint32_t *)&self->write_group->OUTCLR.reg; uint32_t *set_write = (uint32_t *)&self->write_group->OUTSET.reg; @@ -143,7 +143,7 @@ void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byt } } -void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); +void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t obj) { + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->chip_select, true); } diff --git a/ports/atmel-samd/common-hal/displayio/ParallelBus.h b/ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.h similarity index 85% rename from ports/atmel-samd/common-hal/displayio/ParallelBus.h rename to ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.h index ee19caddf6..5ef7bcf195 100644 --- a/ports/atmel-samd/common-hal/displayio/ParallelBus.h +++ b/ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_DISPLAYIO_PARALLELBUS_H -#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H +#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H #include "common-hal/digitalio/DigitalInOut.h" @@ -40,6 +40,6 @@ typedef struct { uint8_t data0_pin; PortGroup *write_group; uint32_t write_mask; -} displayio_parallelbus_obj_t; +} paralleldisplay_parallelbus_obj_t; -#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H diff --git a/ports/atmel-samd/common-hal/pulseio/PulseIn.c b/ports/atmel-samd/common-hal/pulseio/PulseIn.c index 49cef92478..507db7e437 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseIn.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseIn.c @@ -272,6 +272,9 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) { void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t *self) { uint32_t mask = 1 << self->channel; EIC->INTENCLR.reg = mask << EIC_INTENSET_EXTINT_Pos; + #ifdef SAMD21 + rtc_end_pulse(); + #endif } void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, @@ -299,6 +302,9 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, EIC->INTFLAG.reg = mask << EIC_INTFLAG_EXTINT_Pos; EIC->INTENSET.reg = mask << EIC_INTENSET_EXTINT_Pos; + #ifdef SAMD21 + rtc_start_pulse(); + #endif pulsein_set_config(self, true); } diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.c b/ports/atmel-samd/common-hal/pulseio/PulseOut.c index 56b5f036ed..b72e0d1f43 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.c +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.c @@ -103,13 +103,15 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, - const pwmio_pwmout_obj_t *carrier, const mcu_pin_obj_t *pin, uint32_t frequency, uint16_t duty_cycle) { - if (!carrier || pin || frequency) { - mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead")); - } + + pwmout_result_t result = common_hal_pwmio_pwmout_construct( + &self->pwmout, pin, duty_cycle, frequency, false); + + // This will raise an exception and not return if needed. + common_hal_pwmio_pwmout_raise_error(result); if (refcount == 0) { // Find a spare timer. @@ -155,7 +157,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, } refcount++; - self->pin = carrier->pin->number; + self->pin = pin->number; PortGroup *const port_base = &PORT->Group[GPIO_PORT(self->pin)]; self->pincfg = &port_base->PINCFG[self->pin % 32]; @@ -173,7 +175,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, } bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t *self) { - return self->pin == NO_PIN; + return common_hal_pwmio_pwmout_deinited(&self->pwmout); } void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { @@ -191,6 +193,7 @@ void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { pulseout_tc_index = 0xff; } self->pin = NO_PIN; + common_hal_pwmio_pwmout_deinit(&self->pwmout); #ifdef SAMD21 rtc_end_pulse(); #endif diff --git a/ports/atmel-samd/common-hal/pulseio/PulseOut.h b/ports/atmel-samd/common-hal/pulseio/PulseOut.h index 8f8e504fab..d4a767065e 100644 --- a/ports/atmel-samd/common-hal/pulseio/PulseOut.h +++ b/ports/atmel-samd/common-hal/pulseio/PulseOut.h @@ -30,10 +30,12 @@ #include "common-hal/microcontroller/Pin.h" #include "py/obj.h" +#include "shared-bindings/pwmio/PWMOut.h" typedef struct { mp_obj_base_t base; __IO PORT_PINCFG_Type *pincfg; + pwmio_pwmout_obj_t pwmout; uint8_t pin; } pulseio_pulseout_obj_t; diff --git a/ports/atmel-samd/common-hal/pwmio/PWMOut.c b/ports/atmel-samd/common-hal/pwmio/PWMOut.c index 815f1a7fe0..fa6a2d3f47 100644 --- a/ports/atmel-samd/common-hal/pwmio/PWMOut.c +++ b/ports/atmel-samd/common-hal/pwmio/PWMOut.c @@ -31,15 +31,15 @@ #include "common-hal/pwmio/PWMOut.h" #include "shared-bindings/pwmio/PWMOut.h" #include "shared-bindings/microcontroller/Processor.h" +#include "shared_timers.h" #include "timer_handler.h" #include "atmel_start_pins.h" #include "hal/utils/include/utils_repeat_macro.h" +#include "samd/pins.h" #include "samd/timers.h" #include "supervisor/shared/translate.h" -#include "samd/pins.h" - #undef ENABLE #define _TCC_SIZE(unused, n) TCC##n##_SIZE, @@ -60,24 +60,6 @@ uint8_t tcc_channels[3]; // Set by pwmout_reset() to {0xf0, 0xfc, 0xfc} initia uint8_t tcc_channels[5]; // Set by pwmout_reset() to {0xc0, 0xf0, 0xf8, 0xfc, 0xfc} initially. #endif -static uint8_t never_reset_tc_or_tcc[TC_INST_NUM + TCC_INST_NUM]; - -STATIC void timer_refcount(int index, bool is_tc, int increment) { - if (is_tc) { - never_reset_tc_or_tcc[index] += increment; - } else { - never_reset_tc_or_tcc[TC_INST_NUM + index] += increment; - } -} - -void timer_never_reset(int index, bool is_tc) { - timer_refcount(index, is_tc, 1); -} - -void timer_reset_ok(int index, bool is_tc) { - timer_refcount(index, is_tc, -1); -} - void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { timer_never_reset(self->timer->index, self->timer->is_tc); @@ -95,34 +77,11 @@ void pwmout_reset(void) { target_tcc_frequencies[i] = 0; tcc_refcount[i] = 0; } - Tcc *tccs[TCC_INST_NUM] = TCC_INSTS; for (int i = 0; i < TCC_INST_NUM; i++) { - if (never_reset_tc_or_tcc[TC_INST_NUM + i] > 0) { + if (!timer_ok_to_reset(i, false)) { continue; } - // Disable the module before resetting it. - if (tccs[i]->CTRLA.bit.ENABLE == 1) { - tccs[i]->CTRLA.bit.ENABLE = 0; - while (tccs[i]->SYNCBUSY.bit.ENABLE == 1) { - } - } - uint8_t mask = 0xff; - for (uint8_t j = 0; j < tcc_cc_num[i]; j++) { - mask <<= 1; - } - tcc_channels[i] = mask; - tccs[i]->CTRLA.bit.SWRST = 1; - while (tccs[i]->CTRLA.bit.SWRST == 1) { - } - } - Tc *tcs[TC_INST_NUM] = TC_INSTS; - for (int i = 0; i < TC_INST_NUM; i++) { - if (never_reset_tc_or_tcc[i] > 0) { - continue; - } - tcs[i]->COUNT16.CTRLA.bit.SWRST = 1; - while (tcs[i]->COUNT16.CTRLA.bit.SWRST == 1) { - } + tcc_channels[i] = 0xff << tcc_cc_num[i]; } } @@ -493,3 +452,7 @@ uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t *self) { bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t *self) { return self->variable_frequency; } + +const mcu_pin_obj_t *common_hal_pwmio_pwmout_get_pin(pwmio_pwmout_obj_t *self) { + return self->pin; +} diff --git a/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c b/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c index aa0bd78275..eca3757f20 100644 --- a/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c +++ b/ports/atmel-samd/common-hal/rgbmatrix/RGBMatrix.c @@ -29,6 +29,7 @@ #include "common-hal/rgbmatrix/RGBMatrix.h" #include "samd/timers.h" +#include "shared_timers.h" #include "timer_handler.h" void *common_hal_rgbmatrix_timer_allocate(rgbmatrix_rgbmatrix_obj_t *self) { diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 686bdcd294..e200ce67db 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -59,6 +59,11 @@ X(EISDIR) \ X(EINVAL) \ +#define MICROPY_FATFS_EXFAT 0 + +// Only support simpler HID descriptors on SAMD21. +#define CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR (1) + #endif // SAMD21 //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -238,8 +243,13 @@ #include "peripherals/samd/dma.h" +#if CIRCUITPY_AUDIOCORE #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS \ mp_obj_t playing_audio[AUDIO_DMA_CHANNEL_COUNT]; +#else +#define MICROPY_PORT_ROOT_POINTERS \ + CIRCUITPY_COMMON_ROOT_POINTERS +#endif #endif // __INCLUDED_MPCONFIGPORT_H diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index d55f798a85..8994f0f52a 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -35,6 +35,7 @@ ifeq ($(CHIP_FAMILY),samd21) # Some of these are on by default with CIRCUITPY_FULL_BUILD, but don't # fit in 256kB of flash +CIRCUITPY_AESIO ?= 0 CIRCUITPY_AUDIOMIXER ?= 0 CIRCUITPY_BINASCII ?= 0 CIRCUITPY_BITBANGIO ?= 0 diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index a7e39c4d01..d3b20192cf 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit a7e39c4d01aa5916015beecb021777617e77b0ad +Subproject commit d3b20192cf94fdea68a412596e082108ba5ebbf0 diff --git a/ports/atmel-samd/shared_timers.c b/ports/atmel-samd/shared_timers.c new file mode 100644 index 0000000000..f07bd372da --- /dev/null +++ b/ports/atmel-samd/shared_timers.c @@ -0,0 +1,84 @@ +/* + * 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 + +#include "samd/timers.h" + +#include "shared_timers.h" + +static uint8_t never_reset_tc_or_tcc[TC_INST_NUM + TCC_INST_NUM]; + +static void timer_refcount(int index, bool is_tc, int increment) { + if (is_tc) { + never_reset_tc_or_tcc[index] += increment; + } else { + never_reset_tc_or_tcc[TC_INST_NUM + index] += increment; + } +} + +void timer_never_reset(int index, bool is_tc) { + timer_refcount(index, is_tc, 1); +} + +void timer_reset_ok(int index, bool is_tc) { + timer_refcount(index, is_tc, -1); +} + +bool timer_ok_to_reset(int index, bool is_tc) { + if (is_tc) { + return never_reset_tc_or_tcc[index] == 0; + } + return never_reset_tc_or_tcc[TC_INST_NUM + index] == 0; +} + +void reset_timers(void) { + // Reset all timers + Tcc *tccs[TCC_INST_NUM] = TCC_INSTS; + for (int i = 0; i < TCC_INST_NUM; i++) { + if (!timer_ok_to_reset(i, false)) { + continue; + } + // Disable the module before resetting it. + if (tccs[i]->CTRLA.bit.ENABLE == 1) { + tccs[i]->CTRLA.bit.ENABLE = 0; + while (tccs[i]->SYNCBUSY.bit.ENABLE == 1) { + } + } + tccs[i]->CTRLA.bit.SWRST = 1; + while (tccs[i]->CTRLA.bit.SWRST == 1) { + } + } + Tc *tcs[TC_INST_NUM] = TC_INSTS; + for (int i = 0; i < TC_INST_NUM; i++) { + if (!timer_ok_to_reset(i, true)) { + continue; + } + tcs[i]->COUNT16.CTRLA.bit.SWRST = 1; + while (tcs[i]->COUNT16.CTRLA.bit.SWRST == 1) { + } + } +} diff --git a/ports/cxd56/common-hal/busio/OneWire.h b/ports/atmel-samd/shared_timers.h similarity index 74% rename from ports/cxd56/common-hal/busio/OneWire.h rename to ports/atmel-samd/shared_timers.h index 17c1b22375..88edd3aa12 100644 --- a/ports/cxd56/common-hal/busio/OneWire.h +++ b/ports/atmel-samd/shared_timers.h @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright 2019 Sony Semiconductor Solutions Corporation + * 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 @@ -23,11 +23,14 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +#ifndef MICROPY_INCLUDED_ATMEL_SAMD_SHARED_TIMERS_H +#define MICROPY_INCLUDED_ATMEL_SAMD_SHARED_TIMERS_H -#ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_CXD56_COMMON_HAL_BUSIO_ONEWIRE_H +#include -// Use bitbangio. -#include "shared-module/busio/OneWire.h" +void timer_never_reset(int index, bool is_tc); +void timer_reset_ok(int index, bool is_tc); +bool timer_ok_to_reset(int index, bool is_tc); +void reset_timers(void); -#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_BUSIO_ONEWIRE_H +#endif // MICROPY_INCLUDED_ATMEL_SAMD_SHARED_TIMERS_H diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index 0ba6019e07..4b0775ea91 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -77,43 +77,35 @@ #include "samd/dma.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/rtc/__init__.h" +#include "shared_timers.h" #include "reset.h" +#include "supervisor/background_callback.h" #include "supervisor/shared/safe_mode.h" #include "supervisor/shared/stack.h" #include "supervisor/shared/tick.h" #include "tusb.h" -#if CIRCUITPY_GAMEPAD -#include "shared-module/gamepad/__init__.h" -#endif #if CIRCUITPY_GAMEPADSHIFT #include "shared-module/gamepadshift/__init__.h" #endif #if CIRCUITPY_PEW #include "common-hal/_pew/PewPew.h" #endif -volatile bool hold_interrupt = false; +static volatile bool sleep_ok = true; #ifdef SAMD21 -static void rtc_set_continuous(bool continuous) { - while (RTC->MODE0.STATUS.bit.SYNCBUSY) { - ; - } - RTC->MODE0.READREQ.reg = (continuous ? RTC_READREQ_RCONT : 0) | 0x0010; - while (RTC->MODE0.STATUS.bit.SYNCBUSY) { - ; - } -} +static uint8_t _tick_event_channel = 0; +// Sleeping requires a register write that can stall interrupt handling. Turning +// off sleeps allows for more accurate interrupt timing. (Python still thinks +// it is sleeping though.) void rtc_start_pulse(void) { - rtc_set_continuous(true); - hold_interrupt = true; + sleep_ok = false; } void rtc_end_pulse(void) { - hold_interrupt = false; - rtc_set_continuous(false); + sleep_ok = true; } #endif @@ -164,6 +156,20 @@ static void save_usb_clock_calibration(void) { } #endif +static void rtc_continuous_mode(void) { + #ifdef SAMD21 + while (RTC->MODE0.STATUS.bit.SYNCBUSY) { + } + RTC->MODE0.READREQ.reg = RTC_READREQ_RCONT | 0x0010; + while (RTC->MODE0.STATUS.bit.SYNCBUSY) { + } + // Do the first request and wait for it. + RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | RTC_READREQ_RCONT | 0x0010; + while (RTC->MODE0.STATUS.bit.SYNCBUSY) { + } + #endif +} + static void rtc_init(void) { #ifdef SAMD21 _gclk_enable_channel(RTC_GCLK_ID, GCLK_CLKCTRL_GEN_GCLK2_Val); @@ -171,9 +177,17 @@ static void rtc_init(void) { while (RTC->MODE0.CTRL.bit.SWRST != 0) { } + // Turn on periodic events to use as tick. We control whether it interrupts + // us with the EVSYS INTEN register. + RTC->MODE0.EVCTRL.reg = RTC_MODE0_EVCTRL_PEREO2; + RTC->MODE0.CTRL.reg = RTC_MODE0_CTRL_ENABLE | RTC_MODE0_CTRL_MODE_COUNT32 | RTC_MODE0_CTRL_PRESCALER_DIV2; + + // Turn on continuous sync of the count register. This will speed up all + // tick reads. + rtc_continuous_mode(); #endif #ifdef SAM_D5X_E5X hri_mclk_set_APBAMASK_RTC_bit(MCLK); @@ -350,6 +364,9 @@ void reset_port(void) { #if CIRCUITPY_PWMIO pwmout_reset(); #endif + #if CIRCUITPY_PWMIO || CIRCUITPY_AUDIOIO + reset_timers(); + #endif #if CIRCUITPY_ANALOGIO analogin_reset(); @@ -358,9 +375,6 @@ void reset_port(void) { reset_gclks(); - #if CIRCUITPY_GAMEPAD - gamepad_reset(); - #endif #if CIRCUITPY_GAMEPADSHIFT gamepadshift_reset(); #endif @@ -369,6 +383,9 @@ void reset_port(void) { #endif reset_event_system(); + #ifdef SAMD21 + _tick_event_channel = EVSYS_SYNCH_NUM; + #endif reset_all_pins(); @@ -436,21 +453,14 @@ uint32_t port_get_saved_word(void) { // TODO: Move this to an RTC backup register so we can preserve it when only the BACKUP power domain // is enabled. static volatile uint64_t overflowed_ticks = 0; -#ifdef SAMD21 -static volatile bool _ticks_enabled = false; -#endif static uint32_t _get_count(uint64_t *overflow_count) { #ifdef SAM_D5X_E5X while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COUNTSYNC | RTC_MODE0_SYNCBUSY_COUNT)) != 0) { } #endif - #ifdef SAMD21 - // Request a read so we don't stall the bus later. See section 14.3.1.5 Read Request - RTC->MODE0.READREQ.reg = RTC_READREQ_RREQ | 0x0010; - while (RTC->MODE0.STATUS.bit.SYNCBUSY != 0) { - } - #endif + // SAMD21 does continuous sync so we don't need to wait here. + // Disable interrupts so we can grab the count and the overflow. common_hal_mcu_disable_interrupts(); uint32_t count = RTC->MODE0.COUNT.reg; @@ -464,29 +474,6 @@ static uint32_t _get_count(uint64_t *overflow_count) { volatile bool _woken_up; -static void _port_interrupt_after_ticks(uint32_t ticks) { - uint32_t current_ticks = _get_count(NULL); - if (ticks > 1 << 28) { - // We'll interrupt sooner with an overflow. - return; - } - #ifdef SAMD21 - if (hold_interrupt) { - return; - } - #endif - uint32_t target = current_ticks + (ticks << 4); - RTC->MODE0.COMP[0].reg = target; - #ifdef SAM_D5X_E5X - while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COMP0)) != 0) { - } - #endif - RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; - RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; - current_ticks = _get_count(NULL); - _woken_up = current_ticks >= target; -} - void RTC_Handler(void) { uint32_t intflag = RTC->MODE0.INTFLAG.reg; if (intflag & RTC_MODE0_INTFLAG_OVF) { @@ -503,19 +490,10 @@ void RTC_Handler(void) { } #endif if (intflag & RTC_MODE0_INTFLAG_CMP0) { - // Clear the interrupt because we may have hit a sleep and _ticks_enabled + // Clear the interrupt because we may have hit a sleep RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; _woken_up = true; - #ifdef SAMD21 - if (_ticks_enabled) { - // Do things common to all ports when the tick occurs. - supervisor_tick(); - // Check _ticks_enabled again because a tick handler may have turned it off. - if (_ticks_enabled) { - _port_interrupt_after_ticks(1); - } - } - #endif + // SAMD21 ticks are handled by EVSYS #ifdef SAM_D5X_E5X RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; #endif @@ -532,6 +510,39 @@ uint64_t port_get_raw_ticks(uint8_t *subticks) { return overflow_count + current_ticks / 16; } +void evsyshandler_common(void) { + #ifdef SAMD21 + if (_tick_event_channel < EVSYS_SYNCH_NUM && event_interrupt_active(_tick_event_channel)) { + supervisor_tick(); + } + #endif + #if CIRCUITPY_AUDIOIO || CIRCUITPY_AUDIOBUSIO + audio_evsys_handler(); + #endif +} + +#ifdef SAM_D5X_E5X +void EVSYS_0_Handler(void) { + evsyshandler_common(); +} +void EVSYS_1_Handler(void) { + evsyshandler_common(); +} +void EVSYS_2_Handler(void) { + evsyshandler_common(); +} +void EVSYS_3_Handler(void) { + evsyshandler_common(); +} +void EVSYS_4_Handler(void) { + evsyshandler_common(); +} +#else +void EVSYS_Handler(void) { + evsyshandler_common(); +} +#endif + // Enable 1/1024 second tick. void port_enable_tick(void) { #ifdef SAM_D5X_E5X @@ -539,9 +550,23 @@ void port_enable_tick(void) { RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_PER2; #endif #ifdef SAMD21 - // TODO: Switch to using the PER *event* from the RTC to generate an interrupt via EVSYS. - _ticks_enabled = true; - _port_interrupt_after_ticks(1); + // SAMD21 ticks won't survive port_reset(). This *should* be ok since it'll + // be triggered by ticks and no Python will be running. + if (_tick_event_channel >= EVSYS_SYNCH_NUM) { + turn_on_event_system(); + _tick_event_channel = find_sync_event_channel(); + } + // This turns on both the event detected interrupt (EVD) and overflow (OVR). + init_event_channel_interrupt(_tick_event_channel, CORE_GCLK, EVSYS_ID_GEN_RTC_PER_2); + // Disable overflow interrupt because we ignore it. + if (_tick_event_channel >= 8) { + uint8_t value = 1 << (_tick_event_channel - 8); + EVSYS->INTENCLR.reg = EVSYS_INTENSET_OVRp8(value); + } else { + uint8_t value = 1 << _tick_event_channel; + EVSYS->INTENCLR.reg = EVSYS_INTENSET_OVR(value); + } + NVIC_EnableIRQ(EVSYS_IRQn); #endif } @@ -551,21 +576,48 @@ void port_disable_tick(void) { RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_PER2; #endif #ifdef SAMD21 - _ticks_enabled = false; - RTC->MODE0.INTENCLR.reg = RTC_MODE0_INTENCLR_CMP0; + if (_tick_event_channel >= 8) { + uint8_t value = 1 << (_tick_event_channel - 8); + EVSYS->INTENCLR.reg = EVSYS_INTENSET_EVDp8(value); + } else { + uint8_t value = 1 << _tick_event_channel; + EVSYS->INTENCLR.reg = EVSYS_INTENSET_EVD(value); + } #endif } -// This is called by sleep, we ignore it when our ticks are enabled because -// they'll wake us up earlier. If we don't, we'll mess up ticks by overwriting -// the next RTC wake up time. void port_interrupt_after_ticks(uint32_t ticks) { + uint32_t current_ticks = _get_count(NULL); + if (ticks > 1 << 28) { + // We'll interrupt sooner with an overflow. + return; + } #ifdef SAMD21 - if (_ticks_enabled) { + if (!sleep_ok) { return; } #endif - _port_interrupt_after_ticks(ticks); + + uint32_t target = current_ticks + (ticks << 4); + #ifdef SAMD21 + // Try and avoid a bus stall when writing COMP by checking for an obvious + // existing sync. + while (RTC->MODE0.STATUS.bit.SYNCBUSY == 1) { + } + #endif + // Writing the COMP register can take up to 180us to synchronize. During + // this time, the bus will stall and no interrupts will be serviced. + RTC->MODE0.COMP[0].reg = target; + #ifdef SAM_D5X_E5X + while ((RTC->MODE0.SYNCBUSY.reg & (RTC_MODE0_SYNCBUSY_COMP0)) != 0) { + } + #endif + RTC->MODE0.INTFLAG.reg = RTC_MODE0_INTFLAG_CMP0; + RTC->MODE0.INTENSET.reg = RTC_MODE0_INTENSET_CMP0; + // Set continuous mode again because setting COMP may disable it. + rtc_continuous_mode(); + current_ticks = _get_count(NULL); + _woken_up = current_ticks >= target; } void port_idle_until_interrupt(void) { @@ -577,7 +629,7 @@ void port_idle_until_interrupt(void) { } #endif common_hal_mcu_disable_interrupts(); - if (!tud_task_event_ready() && !hold_interrupt && !_woken_up) { + if (!background_callback_pending() && sleep_ok && !_woken_up) { __DSB(); __WFI(); } diff --git a/ports/atmel-samd/timer_handler.h b/ports/atmel-samd/timer_handler.h index 34efda4d9e..517ad768ba 100644 --- a/ports/atmel-samd/timer_handler.h +++ b/ports/atmel-samd/timer_handler.h @@ -36,8 +36,4 @@ void set_timer_handler(bool is_tc, uint8_t index, uint8_t timer_handler); void shared_timer_handler(bool is_tc, uint8_t index); -// implementation of these functions is in PWMOut.c -void timer_never_reset(int index, bool is_tc); -void timer_reset_ok(int index, bool is_tc); - #endif // MICROPY_INCLUDED_ATMEL_SAMD_TIMER_HANDLER_H diff --git a/ports/cxd56/Makefile b/ports/cxd56/Makefile index 1fea295194..73c9fe5822 100644 --- a/ports/cxd56/Makefile +++ b/ports/cxd56/Makefile @@ -106,6 +106,7 @@ CFLAGS += \ -DCONFIG_HAVE_DOUBLE \ -Dmain=spresense_main \ -D_estack=__stack \ + -DCIRCUITPY_BOARD_ID="\"$(BOARD)\"" \ -c \ -pipe \ -std=gnu11 \ @@ -127,7 +128,6 @@ OPTIMIZATION_FLAGS ?= -O2 -fno-inline-functions # option to override compiler optimization level, set in boards/$(BOARD)/mpconfigboard.mk CFLAGS += $(OPTIMIZATION_FLAGS) - LIBM = "${shell "$(CC)" $(CFLAGS) -print-file-name=libm.a}" LIBGCC = "${shell "$(CC)" $(CFLAGS) -print-libgcc-file-name}" @@ -145,7 +145,15 @@ LDFLAGS = \ -u board_timerhook \ $(BUILD)/libmpy.a \ $(SPRESENSE_SDK)/nuttx/libs/libapps.a \ - $(SPRESENSE_SDK)/nuttx/libs/libnuttx.a \ + $(SPRESENSE_SDK)/nuttx/libs/libarch.a \ + $(SPRESENSE_SDK)/nuttx/libs/libbinfmt.a \ + $(SPRESENSE_SDK)/nuttx/libs/libboard.a \ + $(SPRESENSE_SDK)/nuttx/libs/libboards.a \ + $(SPRESENSE_SDK)/nuttx/libs/libc.a \ + $(SPRESENSE_SDK)/nuttx/libs/libdrivers.a \ + $(SPRESENSE_SDK)/nuttx/libs/libfs.a \ + $(SPRESENSE_SDK)/nuttx/libs/libmm.a \ + $(SPRESENSE_SDK)/nuttx/libs/libsched.a \ $(LIBM) \ $(LIBGCC) \ --end-group \ diff --git a/ports/cxd56/README.md b/ports/cxd56/README.md index c399b8a4d7..0656ad1f1a 100644 --- a/ports/cxd56/README.md +++ b/ports/cxd56/README.md @@ -75,7 +75,7 @@ Bootloader information: * You have to accept the End User License Agreement to be able to download and use the Spresense bootloader binary. -Download the spresense binaries zip archive from: [Spresense firmware v2-0-002](https://developer.sony.com/file/download/download-spresense-firmware-v2-0-002) +Download the spresense binaries zip archive from: [Spresense firmware v2-3-000](https://developer.sony.com/file/download/download-spresense-firmware-v2-3-000) Extract spresense binaries in your PC to ports/spresense/spresense-exported-sdk/firmware/ diff --git a/ports/cxd56/boards/spresense/pins.c b/ports/cxd56/boards/spresense/pins.c index 5028d91556..f3b6571a1e 100644 --- a/ports/cxd56/boards/spresense/pins.c +++ b/ports/cxd56/boards/spresense/pins.c @@ -40,6 +40,8 @@ STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { }; 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_UART2_RXD) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_UART2_TXD) }, { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_HIF_IRQ_OUT) }, diff --git a/ports/cxd56/common-hal/busio/SPI.c b/ports/cxd56/common-hal/busio/SPI.c index ff834f7f38..922a30f1c2 100644 --- a/ports/cxd56/common-hal/busio/SPI.c +++ b/ports/cxd56/common-hal/busio/SPI.c @@ -24,6 +24,8 @@ * THE SOFTWARE. */ +#include + #include #include #include @@ -132,7 +134,8 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self, const uint8_t *data, size } bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_value) { - SPI_EXCHANGE(self->spi_dev, NULL, data, len); + memset(data, write_value, len); + SPI_EXCHANGE(self->spi_dev, data, data, len); return true; } diff --git a/ports/cxd56/common-hal/pulseio/PulseOut.c b/ports/cxd56/common-hal/pulseio/PulseOut.c index be0d51f575..11bd5443bb 100644 --- a/ports/cxd56/common-hal/pulseio/PulseOut.c +++ b/ports/cxd56/common-hal/pulseio/PulseOut.c @@ -38,7 +38,7 @@ static uint16_t pulse_index = 0; static uint16_t pulse_length; static int pulse_fd = -1; -static bool pulseout_timer_handler(unsigned int *next_interval_us, void *arg) { +static bool pulseout_timer_handler(uint32_t *next_interval_us, void *arg) { uint8_t pwm_num = (uint8_t)(int)arg; pulse_index++; @@ -46,7 +46,7 @@ static bool pulseout_timer_handler(unsigned int *next_interval_us, void *arg) { return false; } - *next_interval_us = pulse_buffer[pulse_index] * 1000; + *next_interval_us = pulse_buffer[pulse_index]; if (pulse_index % 2 == 0) { pwmout_start(pwm_num); @@ -58,13 +58,15 @@ static bool pulseout_timer_handler(unsigned int *next_interval_us, void *arg) { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, - const pwmio_pwmout_obj_t *carrier, const mcu_pin_obj_t *pin, uint32_t frequency, uint16_t duty_cycle) { - if (!carrier || pin || frequency) { - mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead")); - } + + pwmout_result_t result = common_hal_pwmio_pwmout_construct( + &self->pwmout, pin, duty_cycle, frequency, false); + + // This will raise an exception and not return if needed. + common_hal_pwmio_pwmout_raise_error(result); if (pulse_fd < 0) { pulse_fd = open("/dev/timer0", O_RDONLY); @@ -74,7 +76,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, mp_raise_RuntimeError(translate("All timers in use")); } - self->pwm_num = carrier->number; + self->pwm_num = self->pwmout.number; } void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { @@ -86,6 +88,8 @@ void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { close(pulse_fd); pulse_fd = -1; + common_hal_pwmio_pwmout_deinit(&self->pwmout); + pulse_buffer = NULL; } @@ -104,7 +108,7 @@ void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t *self, uint16_t *pu pulse_index = 0; pulse_length = len; - unsigned long timeout = pulse_buffer[0] * 1000; + unsigned long timeout = pulse_buffer[0]; ioctl(pulse_fd, TCIOC_SETTIMEOUT, timeout); diff --git a/ports/cxd56/common-hal/pulseio/PulseOut.h b/ports/cxd56/common-hal/pulseio/PulseOut.h index 61bc175276..18106636c1 100644 --- a/ports/cxd56/common-hal/pulseio/PulseOut.h +++ b/ports/cxd56/common-hal/pulseio/PulseOut.h @@ -29,9 +29,12 @@ #include "py/obj.h" +#include "shared-bindings/pwmio/PWMOut.h" + typedef struct { mp_obj_base_t base; uint8_t pwm_num; + pwmio_pwmout_obj_t pwmout; } pulseio_pulseout_obj_t; void pulseout_reset(void); diff --git a/ports/cxd56/common-hal/pwmio/PWMOut.c b/ports/cxd56/common-hal/pwmio/PWMOut.c index 61806540b1..e9bffd21e9 100644 --- a/ports/cxd56/common-hal/pwmio/PWMOut.c +++ b/ports/cxd56/common-hal/pwmio/PWMOut.c @@ -157,3 +157,7 @@ void pwmout_start(uint8_t pwm_num) { void pwmout_stop(uint8_t pwm_num) { ioctl(pwmout_dev[pwm_num].fd, PWMIOC_STOP, 0); } + +const mcu_pin_obj_t *common_hal_pwmio_pwmout_get_pin(pwmio_pwmout_obj_t *self) { + return self->pin; +} diff --git a/ports/cxd56/common-hal/sdioio/SDCard.c b/ports/cxd56/common-hal/sdioio/SDCard.c index cf8986a4f8..58d786517b 100644 --- a/ports/cxd56/common-hal/sdioio/SDCard.c +++ b/ports/cxd56/common-hal/sdioio/SDCard.c @@ -130,7 +130,6 @@ int common_hal_sdioio_sdcard_writeblocks(sdioio_sdcard_obj_t *self, uint32_t sta check_whole_block(bufinfo); return self->inode->u.i_bops->write(self->inode, bufinfo->buf, start_block, bufinfo->len / 512); - ; } void common_hal_sdioio_sdcard_never_reset(sdioio_sdcard_obj_t *self) { diff --git a/ports/cxd56/configs/circuitpython/defconfig b/ports/cxd56/configs/circuitpython/defconfig index 096b53b800..6a7c39cba8 100644 --- a/ports/cxd56/configs/circuitpython/defconfig +++ b/ports/cxd56/configs/circuitpython/defconfig @@ -12,8 +12,8 @@ # CONFIG_MMCSD_MMCSUPPORT is not set # CONFIG_MMCSD_SPI is not set # CONFIG_MTD_SMART_WEAR_LEVEL is not set -# CONFIG_NET_IPv4 is not set # CONFIG_NXFONTS_PACKEDMSFIRST is not set +# CONFIG_READLINE_ECHO is not set # CONFIG_STANDARD_SERIAL is not set CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="spresense" @@ -21,16 +21,8 @@ CONFIG_ARCH_BOARD_SPRESENSE=y CONFIG_ARCH_CHIP="cxd56xx" CONFIG_ARCH_CHIP_CXD56XX=y CONFIG_ARCH_INTERRUPTSTACK=2048 -CONFIG_ARCH_MATH_H=y CONFIG_ARCH_STACKDUMP=y CONFIG_ARMV7M_USEBASEPRI=y -CONFIG_ASMP=y -CONFIG_AUDIO=y -CONFIG_AUDIOUTILS_DSP_MOUNTPT="/mnt/sd0/BIN" -CONFIG_AUDIOUTILS_MANAGER=y -CONFIG_AUDIOUTILS_PLAYER=y -CONFIG_AUDIOUTILS_PLAYLIST=y -CONFIG_AUDIOUTILS_RECORDER=y CONFIG_BOARDCTL_IOCTL=y CONFIG_BOARDCTL_POWEROFF=y CONFIG_BOARDCTL_RESET=y @@ -41,13 +33,13 @@ CONFIG_BOARD_CRASHDUMP=y CONFIG_BOARD_LATE_INITIALIZE=y CONFIG_BOARD_LOOPSPERMSEC=5434 CONFIG_BOOT_RUNFROMISRAM=y -CONFIG_BUILTIN=y CONFIG_CLOCK_MONOTONIC=y CONFIG_CXD56_ADC=y -CONFIG_CXD56_AUDIO=y CONFIG_CXD56_BINARY=y CONFIG_CXD56_CHARGER=y CONFIG_CXD56_CISIF=y +CONFIG_CXD56_DMAC_SPI4_RX=y +CONFIG_CXD56_DMAC_SPI4_TX=y CONFIG_CXD56_GAUGE=y CONFIG_CXD56_GNSS=y CONFIG_CXD56_HPADC0=y @@ -65,33 +57,13 @@ CONFIG_CXD56_PWM3=y CONFIG_CXD56_PWM=y CONFIG_CXD56_SDIO=y CONFIG_CXD56_SPI3=y +CONFIG_CXD56_SPI4=y CONFIG_CXD56_SPI5=y CONFIG_CXD56_SPI=y CONFIG_CXD56_UART2=y -CONFIG_DEBUG_FULLOPT=y -CONFIG_DEBUG_SYMBOLS=y -CONFIG_DNN_RT=y -CONFIG_DNN_RT_MP=y CONFIG_DRIVERS_VIDEO=y -CONFIG_EXTERNALS_CMSIS=y -CONFIG_FAT_LCNAMES=y -CONFIG_FAT_LFN=y -CONFIG_FAT_MAXFNAME=64 CONFIG_FS_FAT=y -CONFIG_FS_PROCFS=y -CONFIG_FS_PROCFS_REGISTER=y -CONFIG_FS_ROMFS=y -CONFIG_FS_SMARTFS=y -CONFIG_HAVE_CXX=y -CONFIG_HAVE_CXXINITIALIZE=y -CONFIG_LCD=y -CONFIG_LCD_NOGETRUN=y CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_IPv4_ADDRCONV=y -CONFIG_LIBC_IPv6_ADDRCONV=y -CONFIG_LIB_KBDCODEC=y -CONFIG_MAX_WDOGPARMS=2 -CONFIG_MEMUTILS=y CONFIG_MMCSD=y CONFIG_MMCSD_SDIO=y CONFIG_MTD=y @@ -101,32 +73,12 @@ CONFIG_MTD_SMART_ENABLE_CRC=y CONFIG_MTD_SMART_FSCK=y CONFIG_MTD_SMART_SECTOR_SIZE=4096 CONFIG_NAME_MAX=64 -CONFIG_NET=y -CONFIG_NETDEVICES=y -CONFIG_NETDEV_LATEINIT=y -CONFIG_NET_SOCKOPTS=y -CONFIG_NET_TCP_NO_STACK=y -CONFIG_NET_UDP_NO_STACK=y -CONFIG_NET_USRSOCK=y -CONFIG_NET_USRSOCK_TCP=y -CONFIG_NET_USRSOCK_UDP=y -CONFIG_NFILE_STREAMS=8 -CONFIG_NSH_ARCHINIT=y -CONFIG_NSH_BUILTIN_APPS=y -CONFIG_NSH_DISABLE_LOSMART=y -CONFIG_NSH_LINELEN=160 -CONFIG_NSH_MAXARGUMENTS=14 CONFIG_NSH_READLINE=y CONFIG_PIPES=y -CONFIG_PREALLOC_MQ_MSGS=4 CONFIG_PREALLOC_TIMERS=4 -CONFIG_PREALLOC_WDOGS=16 CONFIG_PWM=y CONFIG_RAM_SIZE=1572864 CONFIG_RAM_START=0x0d000000 -CONFIG_READLINE_CMD_HISTORY=y -CONFIG_READLINE_CMD_HISTORY_LINELEN=160 -CONFIG_READLINE_TABCOMPLETION=y CONFIG_RR_INTERVAL=200 CONFIG_RTC=y CONFIG_RTC_ALARM=y @@ -141,21 +93,14 @@ CONFIG_SCHED_LPWORK=y CONFIG_SCHED_WAITPID=y CONFIG_SDCLONE_DISABLE=y CONFIG_SDIO_MUXBUS=y -CONFIG_SDK_AUDIO=y CONFIG_SERIAL_TERMIOS=y -CONFIG_SMARTFS_ALIGNED_ACCESS=y -CONFIG_SMARTFS_MAXNAMLEN=30 -CONFIG_SMARTFS_MULTI_ROOT_DIRS=y -CONFIG_SPECIFIC_DRIVERS=y CONFIG_SPI=y CONFIG_SPRESENSE_EXTENSION=y CONFIG_START_DAY=6 CONFIG_START_MONTH=12 CONFIG_START_YEAR=2011 CONFIG_SYSTEMTICK_HOOK=y -CONFIG_SYSTEM_CLE=y CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_NSH_CXXINITIALIZE=y CONFIG_UART1_RXBUFSIZE=1024 CONFIG_UART1_SERIAL_CONSOLE=y CONFIG_UART1_TXBUFSIZE=1024 diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk index edc8e6ddf5..865c170aaa 100644 --- a/ports/cxd56/mpconfigport.mk +++ b/ports/cxd56/mpconfigport.mk @@ -17,9 +17,9 @@ CIRCUITPY_CAMERA = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_DISPLAYIO = 0 CIRCUITPY_FREQUENCYIO = 0 -CIRCUITPY_GAMEPAD = 0 CIRCUITPY_GNSS = 1 CIRCUITPY_I2CPERIPHERAL = 0 +CIRCUITPY_KEYPAD = 0 CIRCUITPY_NEOPIXEL_WRITE = 0 CIRCUITPY_NVM = 0 CIRCUITPY_ROTARYIO = 0 diff --git a/ports/cxd56/spresense-exported-sdk b/ports/cxd56/spresense-exported-sdk index 2ec2a15383..6a148be849 160000 --- a/ports/cxd56/spresense-exported-sdk +++ b/ports/cxd56/spresense-exported-sdk @@ -1 +1 @@ -Subproject commit 2ec2a1538362696118dc3fdf56f33dacaf8f4067 +Subproject commit 6a148be8497704d4afb5d14c175a12a592813fac diff --git a/ports/cxd56/tools/flash_writer.py b/ports/cxd56/tools/flash_writer.py index a61342e3ea..fc15cf8c28 100755 --- a/ports/cxd56/tools/flash_writer.py +++ b/ports/cxd56/tools/flash_writer.py @@ -30,23 +30,20 @@ # POSSIBILITY OF SUCH DAMAGE. # -import time -import sys -import os -import struct -import glob -import fnmatch -import errno -import telnetlib import argparse -import shutil -import subprocess +import errno +import os import re +import subprocess +import sys +import telnetlib +import time + import xmodem import_serial_module = True -# When SDK release, plase set SDK_RELEASE as True. +# When SDK release, please set SDK_RELEASE as True. SDK_RELEASE = False if SDK_RELEASE: @@ -58,7 +55,7 @@ else: try: import serial -except: +except ImportError: import_serial_module = False # supported environment various @@ -71,6 +68,7 @@ PROTOCOL_TELNET = 1 MAX_DOT_COUNT = 70 + # configure parameters and default value class ConfigArgs: PROTOCOL_TYPE = None @@ -173,7 +171,10 @@ class ConfigArgsLoader: group = self.parser.add_argument_group() group.add_argument("-c", "--serial-port", dest="serial_port", help="the serial port") group.add_argument( - "-b", "--xmodem-baudrate", dest="xmodem_baud", help="Use the faster baudrate in xmodem" + "-b", + "--xmodem-baudrate", + dest="xmodem_baud", + help="Use the faster baudrate in xmodem", ) mutually_group = self.parser.add_mutually_exclusive_group() @@ -223,12 +224,12 @@ class ConfigArgsLoader: ConfigArgs.PKGUPD_NAME = args.pkgupd_name # Get serial port or telnet server ip etc - if args.serial_protocol == True: + if args.serial_protocol is True: ConfigArgs.PROTOCOL_TYPE = PROTOCOL_SERIAL - elif args.telnet_protocol == True: + elif args.telnet_protocol is True: ConfigArgs.PROTOCOL_TYPE = PROTOCOL_TELNET - if ConfigArgs.PROTOCOL_TYPE == None: + if ConfigArgs.PROTOCOL_TYPE is None: proto = os.environ.get("CXD56_PROTOCOL") if proto is not None: if "s" in proto: @@ -236,7 +237,7 @@ class ConfigArgsLoader: elif "t" in proto: ConfigArgs.PROTOCOL_TYPE = PROTOCOL_TELNET - if ConfigArgs.PROTOCOL_TYPE == None: + if ConfigArgs.PROTOCOL_TYPE is None: ConfigArgs.PROTOCOL_TYPE = PROTOCOL_SERIAL if ConfigArgs.PROTOCOL_TYPE == PROTOCOL_SERIAL: @@ -358,8 +359,7 @@ class TelnetDev: if MAX_DOT_COUNT < cur_count: cur_count = MAX_DOT_COUNT for idx in range(cur_count - self.count): - print("#", end="") - sys.stdout.flush() + print("#", end="", flush=True) self.count = cur_count if self.count == MAX_DOT_COUNT: print("\n") @@ -584,7 +584,7 @@ def main(): try: config_loader = ConfigArgsLoader() config_loader.update_config() - except: + except Exception: return errno.EINVAL # Wait to reset the board @@ -593,7 +593,7 @@ def main(): do_wait_reset = True if ConfigArgs.AUTO_RESET: if subprocess.call("cd " + sys.path[0] + "; ./reset_board.sh", shell=True) == 0: - print("auto reset board sucess!!") + print("auto reset board success!!") do_wait_reset = False bootrom_msg = writer.cancel_autoboot() @@ -601,7 +601,7 @@ def main(): do_wait_reset = False bootrom_msg = writer.cancel_autoboot() - if ConfigArgs.WAIT_RESET == False and do_wait_reset == True: + if ConfigArgs.WAIT_RESET is False and do_wait_reset is True: rx = writer.recv() time.sleep(1) for i in range(3): @@ -621,7 +621,7 @@ def main(): # Remove files if ConfigArgs.ERASE_NAME: - print(">>> Remove exisiting files ...") + print(">>> Remove existing files ...") writer.delete_files(ConfigArgs.ERASE_NAME) # Install files diff --git a/ports/cxd56/tools/requirements.txt b/ports/cxd56/tools/requirements.txt new file mode 100644 index 0000000000..b45f4ae0bd --- /dev/null +++ b/ports/cxd56/tools/requirements.txt @@ -0,0 +1,2 @@ +pyserial>=2.7 +xmodem>=0.3.2 diff --git a/ports/cxd56/tools/xmodem.py b/ports/cxd56/tools/xmodem.py deleted file mode 100644 index cf78338645..0000000000 --- a/ports/cxd56/tools/xmodem.py +++ /dev/null @@ -1,808 +0,0 @@ -""" -=============================== - XMODEM file transfer protocol -=============================== - -.. $Id$ - -This is a literal implementation of XMODEM.TXT_, XMODEM1K.TXT_ and -XMODMCRC.TXT_, support for YMODEM and ZMODEM is pending. YMODEM should -be fairly easy to implement as it is a hack on top of the XMODEM -protocol using sequence bytes ``0x00`` for sending file names (and some -meta data). - -.. _XMODEM.TXT: doc/XMODEM.TXT -.. _XMODEM1K.TXT: doc/XMODEM1K.TXT -.. _XMODMCRC.TXT: doc/XMODMCRC.TXT - -Data flow example including error recovery -========================================== - -Here is a sample of the data flow, sending a 3-block message. -It includes the two most common line hits - a garbaged block, -and an ``ACK`` reply getting garbaged. ``CRC`` or ``CSUM`` represents -the checksum bytes. - -XMODEM 128 byte blocks ----------------------- - -:: - - SENDER RECEIVER - - <-- NAK - SOH 01 FE Data[128] CSUM --> - <-- ACK - SOH 02 FD Data[128] CSUM --> - <-- ACK - SOH 03 FC Data[128] CSUM --> - <-- ACK - SOH 04 FB Data[128] CSUM --> - <-- ACK - SOH 05 FA Data[100] CPMEOF[28] CSUM --> - <-- ACK - EOT --> - <-- ACK - -XMODEM-1k blocks, CRC mode --------------------------- - -:: - - SENDER RECEIVER - - <-- C - STX 01 FE Data[1024] CRC CRC --> - <-- ACK - STX 02 FD Data[1024] CRC CRC --> - <-- ACK - STX 03 FC Data[1000] CPMEOF[24] CRC CRC --> - <-- ACK - EOT --> - <-- ACK - -Mixed 1024 and 128 byte Blocks ------------------------------- - -:: - - SENDER RECEIVER - - <-- C - STX 01 FE Data[1024] CRC CRC --> - <-- ACK - STX 02 FD Data[1024] CRC CRC --> - <-- ACK - SOH 03 FC Data[128] CRC CRC --> - <-- ACK - SOH 04 FB Data[100] CPMEOF[28] CRC CRC --> - <-- ACK - EOT --> - <-- ACK - -YMODEM Batch Transmission Session (1 file) ------------------------------------------- - -:: - - SENDER RECEIVER - <-- C (command:rb) - SOH 00 FF foo.c NUL[123] CRC CRC --> - <-- ACK - <-- C - SOH 01 FE Data[128] CRC CRC --> - <-- ACK - SOH 02 FC Data[128] CRC CRC --> - <-- ACK - SOH 03 FB Data[100] CPMEOF[28] CRC CRC --> - <-- ACK - EOT --> - <-- NAK - EOT --> - <-- ACK - <-- C - SOH 00 FF NUL[128] CRC CRC --> - <-- ACK - - -""" - -__author__ = "Wijnand Modderman " -__copyright__ = ["Copyright (c) 2010 Wijnand Modderman", "Copyright (c) 1981 Chuck Forsberg"] -__license__ = "MIT" -__version__ = "0.3.2" - -import logging -import time -import sys -from functools import partial -import collections - -# Loggerr -log = logging.getLogger("xmodem") - -# Protocol bytes -SOH = bytes([0x01]) -STX = bytes([0x02]) -EOT = bytes([0x04]) -ACK = bytes([0x06]) -DLE = bytes([0x10]) -NAK = bytes([0x15]) -CAN = bytes([0x18]) -CRC = bytes([0x43]) # C - - -class XMODEM(object): - """ - XMODEM Protocol handler, expects an object to read from and an object to - write to. - - >>> def getc(size, timeout=1): - ... return data or None - ... - >>> def putc(data, timeout=1): - ... return size or None - ... - >>> modem = XMODEM(getc, putc) - - - :param getc: Function to retreive bytes from a stream - :type getc: callable - :param putc: Function to transmit bytes to a stream - :type putc: callable - :param mode: XMODEM protocol mode - :type mode: string - :param pad: Padding character to make the packets match the packet size - :type pad: char - - """ - - # crctab calculated by Mark G. Mendel, Network Systems Corporation - crctable = [ - 0x0000, - 0x1021, - 0x2042, - 0x3063, - 0x4084, - 0x50A5, - 0x60C6, - 0x70E7, - 0x8108, - 0x9129, - 0xA14A, - 0xB16B, - 0xC18C, - 0xD1AD, - 0xE1CE, - 0xF1EF, - 0x1231, - 0x0210, - 0x3273, - 0x2252, - 0x52B5, - 0x4294, - 0x72F7, - 0x62D6, - 0x9339, - 0x8318, - 0xB37B, - 0xA35A, - 0xD3BD, - 0xC39C, - 0xF3FF, - 0xE3DE, - 0x2462, - 0x3443, - 0x0420, - 0x1401, - 0x64E6, - 0x74C7, - 0x44A4, - 0x5485, - 0xA56A, - 0xB54B, - 0x8528, - 0x9509, - 0xE5EE, - 0xF5CF, - 0xC5AC, - 0xD58D, - 0x3653, - 0x2672, - 0x1611, - 0x0630, - 0x76D7, - 0x66F6, - 0x5695, - 0x46B4, - 0xB75B, - 0xA77A, - 0x9719, - 0x8738, - 0xF7DF, - 0xE7FE, - 0xD79D, - 0xC7BC, - 0x48C4, - 0x58E5, - 0x6886, - 0x78A7, - 0x0840, - 0x1861, - 0x2802, - 0x3823, - 0xC9CC, - 0xD9ED, - 0xE98E, - 0xF9AF, - 0x8948, - 0x9969, - 0xA90A, - 0xB92B, - 0x5AF5, - 0x4AD4, - 0x7AB7, - 0x6A96, - 0x1A71, - 0x0A50, - 0x3A33, - 0x2A12, - 0xDBFD, - 0xCBDC, - 0xFBBF, - 0xEB9E, - 0x9B79, - 0x8B58, - 0xBB3B, - 0xAB1A, - 0x6CA6, - 0x7C87, - 0x4CE4, - 0x5CC5, - 0x2C22, - 0x3C03, - 0x0C60, - 0x1C41, - 0xEDAE, - 0xFD8F, - 0xCDEC, - 0xDDCD, - 0xAD2A, - 0xBD0B, - 0x8D68, - 0x9D49, - 0x7E97, - 0x6EB6, - 0x5ED5, - 0x4EF4, - 0x3E13, - 0x2E32, - 0x1E51, - 0x0E70, - 0xFF9F, - 0xEFBE, - 0xDFDD, - 0xCFFC, - 0xBF1B, - 0xAF3A, - 0x9F59, - 0x8F78, - 0x9188, - 0x81A9, - 0xB1CA, - 0xA1EB, - 0xD10C, - 0xC12D, - 0xF14E, - 0xE16F, - 0x1080, - 0x00A1, - 0x30C2, - 0x20E3, - 0x5004, - 0x4025, - 0x7046, - 0x6067, - 0x83B9, - 0x9398, - 0xA3FB, - 0xB3DA, - 0xC33D, - 0xD31C, - 0xE37F, - 0xF35E, - 0x02B1, - 0x1290, - 0x22F3, - 0x32D2, - 0x4235, - 0x5214, - 0x6277, - 0x7256, - 0xB5EA, - 0xA5CB, - 0x95A8, - 0x8589, - 0xF56E, - 0xE54F, - 0xD52C, - 0xC50D, - 0x34E2, - 0x24C3, - 0x14A0, - 0x0481, - 0x7466, - 0x6447, - 0x5424, - 0x4405, - 0xA7DB, - 0xB7FA, - 0x8799, - 0x97B8, - 0xE75F, - 0xF77E, - 0xC71D, - 0xD73C, - 0x26D3, - 0x36F2, - 0x0691, - 0x16B0, - 0x6657, - 0x7676, - 0x4615, - 0x5634, - 0xD94C, - 0xC96D, - 0xF90E, - 0xE92F, - 0x99C8, - 0x89E9, - 0xB98A, - 0xA9AB, - 0x5844, - 0x4865, - 0x7806, - 0x6827, - 0x18C0, - 0x08E1, - 0x3882, - 0x28A3, - 0xCB7D, - 0xDB5C, - 0xEB3F, - 0xFB1E, - 0x8BF9, - 0x9BD8, - 0xABBB, - 0xBB9A, - 0x4A75, - 0x5A54, - 0x6A37, - 0x7A16, - 0x0AF1, - 0x1AD0, - 0x2AB3, - 0x3A92, - 0xFD2E, - 0xED0F, - 0xDD6C, - 0xCD4D, - 0xBDAA, - 0xAD8B, - 0x9DE8, - 0x8DC9, - 0x7C26, - 0x6C07, - 0x5C64, - 0x4C45, - 0x3CA2, - 0x2C83, - 0x1CE0, - 0x0CC1, - 0xEF1F, - 0xFF3E, - 0xCF5D, - 0xDF7C, - 0xAF9B, - 0xBFBA, - 0x8FD9, - 0x9FF8, - 0x6E17, - 0x7E36, - 0x4E55, - 0x5E74, - 0x2E93, - 0x3EB2, - 0x0ED1, - 0x1EF0, - ] - - def __init__(self, getc, putc, mode="xmodem", pad=b"\x1a"): - self.getc = getc - self.putc = putc - self.mode = mode - self.pad = pad - - def abort(self, count=2, timeout=60): - """ - Send an abort sequence using CAN bytes. - """ - for counter in range(0, count): - self.putc(CAN, timeout) - - def send(self, stream, retry=32, timeout=360, quiet=0, callback=None): - """ - Send a stream via the XMODEM protocol. - - >>> stream = file('/etc/issue', 'rb') - >>> print modem.send(stream) - True - - Returns ``True`` upon succesful transmission or ``False`` in case of - failure. - - :param stream: The stream object to send data from. - :type stream: stream (file, etc.) - :param retry: The maximum number of times to try to resend a failed - packet before failing. - :type retry: int - :param timeout: The number of seconds to wait for a response before - timing out. - :type timeout: int - :param quiet: If 0, it prints info to stderr. If 1, it does not print any info. - :type quiet: int - :param callback: Reference to a callback function that has the - following signature. This is useful for - getting status updates while a xmodem - transfer is underway. - Expected callback signature: - def callback(total_packets, success_count, error_count) - :type callback: callable - """ - - # initialize protocol - try: - packet_size = dict(xmodem=128, xmodem1k=1024)[self.mode] - except AttributeError: - raise ValueError("An invalid mode was supplied") - - error_count = 0 - crc_mode = 0 - cancel = 0 - while True: - char = self.getc(1) - if char: - if char == NAK: - crc_mode = 0 - break - elif char == CRC: - crc_mode = 1 - break - elif char == CAN: - if not quiet: - print("received CAN", file=sys.stderr) - if cancel: - return False - else: - cancel = 1 - else: - log.error("send ERROR expected NAK/CRC, got %s" % (ord(char),)) - - error_count += 1 - if error_count >= retry: - self.abort(timeout=timeout) - return False - - # send data - error_count = 0 - success_count = 0 - total_packets = 0 - sequence = 1 - while True: - data = stream.read(packet_size) - if not data: - log.info("sending EOT") - # end of stream - break - total_packets += 1 - data = data.ljust(packet_size, self.pad) - if crc_mode: - crc = self.calc_crc(data) - else: - crc = self.calc_checksum(data) - - # emit packet - while True: - if packet_size == 128: - self.putc(SOH) - else: # packet_size == 1024 - self.putc(STX) - self.putc(bytes([sequence])) - self.putc(bytes([0xFF - sequence])) - self.putc(data) - if crc_mode: - self.putc(bytes([crc >> 8])) - self.putc(bytes([crc & 0xFF])) - else: - self.putc(bytes([crc])) - - char = self.getc(1, timeout) - if char == ACK: - success_count += 1 - if isinstance(callback, collections.Callable): - callback(total_packets, success_count, error_count) - break - if char == NAK: - error_count += 1 - if isinstance(callback, collections.Callable): - callback(total_packets, success_count, error_count) - if error_count >= retry: - # excessive amounts of retransmissions requested, - # abort transfer - self.abort(timeout=timeout) - log.warning("excessive NAKs, transfer aborted") - return False - - # return to loop and resend - continue - else: - log.error("Not ACK, Not NAK") - error_count += 1 - if isinstance(callback, collections.Callable): - callback(total_packets, success_count, error_count) - if error_count >= retry: - # excessive amounts of retransmissions requested, - # abort transfer - self.abort(timeout=timeout) - log.warning("excessive protocol errors, transfer aborted") - return False - - # return to loop and resend - continue - - # protocol error - self.abort(timeout=timeout) - log.error("protocol error") - return False - - # keep track of sequence - sequence = (sequence + 1) % 0x100 - - while True: - # end of transmission - self.putc(EOT) - - # An ACK should be returned - char = self.getc(1, timeout) - if char == ACK: - break - else: - error_count += 1 - if error_count >= retry: - self.abort(timeout=timeout) - log.warning("EOT was not ACKd, transfer aborted") - return False - - return True - - def recv(self, stream, crc_mode=1, retry=16, timeout=60, delay=1, quiet=0): - """ - Receive a stream via the XMODEM protocol. - - >>> stream = file('/etc/issue', 'wb') - >>> print modem.recv(stream) - 2342 - - Returns the number of bytes received on success or ``None`` in case of - failure. - """ - - # initiate protocol - error_count = 0 - char = 0 - cancel = 0 - while True: - # first try CRC mode, if this fails, - # fall back to checksum mode - if error_count >= retry: - self.abort(timeout=timeout) - return None - elif crc_mode and error_count < (retry / 2): - if not self.putc(CRC): - time.sleep(delay) - error_count += 1 - else: - crc_mode = 0 - if not self.putc(NAK): - time.sleep(delay) - error_count += 1 - - char = self.getc(1, timeout) - if not char: - error_count += 1 - continue - elif char == SOH: - # crc_mode = 0 - break - elif char == STX: - break - elif char == CAN: - if cancel: - return None - else: - cancel = 1 - else: - error_count += 1 - - # read data - error_count = 0 - income_size = 0 - packet_size = 128 - sequence = 1 - cancel = 0 - while True: - while True: - if char == SOH: - packet_size = 128 - break - elif char == STX: - packet_size = 1024 - break - elif char == EOT: - # We received an EOT, so send an ACK and return the received - # data length - self.putc(ACK) - return income_size - elif char == CAN: - # cancel at two consecutive cancels - if cancel: - return None - else: - cancel = 1 - else: - if not quiet: - print("recv ERROR expected SOH/EOT, got", ord(char), file=sys.stderr) - error_count += 1 - if error_count >= retry: - self.abort() - return None - # read sequence - error_count = 0 - cancel = 0 - seq1 = ord(self.getc(1)) - seq2 = 0xFF - ord(self.getc(1)) - if seq1 == sequence and seq2 == sequence: - # sequence is ok, read packet - # packet_size + checksum - data = self.getc(packet_size + 1 + crc_mode, timeout) - if crc_mode: - csum = (ord(data[-2]) << 8) + ord(data[-1]) - data = data[:-2] - log.debug("CRC (%04x <> %04x)" % (csum, self.calc_crc(data))) - valid = csum == self.calc_crc(data) - else: - csum = data[-1] - data = data[:-1] - log.debug( - "checksum (checksum(%02x <> %02x)" % (ord(csum), self.calc_checksum(data)) - ) - valid = ord(csum) == self.calc_checksum(data) - - # valid data, append chunk - if valid: - income_size += len(data) - stream.write(data) - self.putc(ACK) - sequence = (sequence + 1) % 0x100 - char = self.getc(1, timeout) - continue - else: - # consume data - self.getc(packet_size + 1 + crc_mode) - self.debug("expecting sequence %d, got %d/%d" % (sequence, seq1, seq2)) - - # something went wrong, request retransmission - self.putc(NAK) - - def calc_checksum(self, data, checksum=0): - """ - Calculate the checksum for a given block of data, can also be used to - update a checksum. - - >>> csum = modem.calc_checksum('hello') - >>> csum = modem.calc_checksum('world', csum) - >>> hex(csum) - '0x3c' - - """ - return (sum(map(ord, data)) + checksum) % 256 - - def calc_crc(self, data, crc=0): - """ - Calculate the Cyclic Redundancy Check for a given block of data, can - also be used to update a CRC. - - >>> crc = modem.calc_crc('hello') - >>> crc = modem.calc_crc('world', crc) - >>> hex(crc) - '0xd5e3' - - """ - for char in data: - crc = (crc << 8) ^ self.crctable[((crc >> 8) ^ int(char)) & 0xFF] - return crc & 0xFFFF - - -XMODEM1k = partial(XMODEM, mode="xmodem1k") - - -def run(): - import optparse - import subprocess - - parser = optparse.OptionParser(usage="%prog [] filename filename") - parser.add_option("-m", "--mode", default="xmodem", help="XMODEM mode (xmodem, xmodem1k)") - - options, args = parser.parse_args() - if len(args) != 3: - parser.error("invalid arguments") - return 1 - - elif args[0] not in ("send", "recv"): - parser.error("invalid mode") - return 1 - - def _func(so, si): - import select - import subprocess - - print("si", si) - print("so", so) - - def getc(size, timeout=3): - w, t, f = select.select([so], [], [], timeout) - if w: - data = so.read(size) - else: - data = None - - print("getc(", repr(data), ")") - return data - - def putc(data, timeout=3): - w, t, f = select.select([], [si], [], timeout) - if t: - si.write(data) - si.flush() - size = len(data) - else: - size = None - - print("putc(", repr(data), repr(size), ")") - return size - - return getc, putc - - def _pipe(*command): - pipe = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE) - return pipe.stdout, pipe.stdin - - if args[0] == "recv": - import io - - getc, putc = _func(*_pipe("sz", "--xmodem", args[2])) - stream = open(args[1], "wb") - xmodem = XMODEM(getc, putc, mode=options.mode) - status = xmodem.recv(stream, retry=8) - stream.close() - - elif args[0] == "send": - getc, putc = _func(*_pipe("rz", "--xmodem", args[2])) - stream = open(args[1], "rb") - xmodem = XMODEM(getc, putc, mode=options.mode) - status = xmodem.send(stream, retry=8) - stream.close() - - -if __name__ == "__main__": - sys.exit(run()) diff --git a/ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.mk b/ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.mk deleted file mode 100644 index 52c63cb9c7..0000000000 --- a/ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.mk +++ /dev/null @@ -1,23 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x80C8 -USB_PRODUCT = "Kaluga 1" -USB_MANUFACTURER = "Espressif" - -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 - -# We only have enough endpoints available in hardware to -# enable ONE of these at a time. -CIRCUITPY_USB_MIDI = 1 -CIRCUITPY_USB_HID = 0 -CIRCUITPY_USB_VENDOR = 0 - -CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk deleted file mode 100644 index 52c63cb9c7..0000000000 --- a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk +++ /dev/null @@ -1,23 +0,0 @@ -USB_VID = 0x239A -USB_PID = 0x80C8 -USB_PRODUCT = "Kaluga 1" -USB_MANUFACTURER = "Espressif" - -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 - -# We only have enough endpoints available in hardware to -# enable ONE of these at a time. -CIRCUITPY_USB_MIDI = 1 -CIRCUITPY_USB_HID = 0 -CIRCUITPY_USB_VENDOR = 0 - -CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/pins.c b/ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/pins.c deleted file mode 100644 index 0562d9331f..0000000000 --- a/ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/pins.c +++ /dev/null @@ -1,48 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { 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_GPIO18) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/pins.c b/ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/pins.c deleted file mode 100644 index 0562d9331f..0000000000 --- a/ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/pins.c +++ /dev/null @@ -1,48 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - { 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_GPIO18) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/esp32s2/common-hal/busio/OneWire.h b/ports/esp32s2/common-hal/busio/OneWire.h deleted file mode 100644 index bb6a014190..0000000000 --- a/ports/esp32s2/common-hal/busio/OneWire.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 Scott Shawcroft - * - * 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_ESP32S2_COMMON_HAL_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_ONEWIRE_H - -// Use bitbangio. -#include "shared-module/busio/OneWire.h" - -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_BUSIO_ONEWIRE_H diff --git a/ports/esp32s2/esp-idf b/ports/esp32s2/esp-idf deleted file mode 160000 index d97b6863ba..0000000000 --- a/ports/esp32s2/esp-idf +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d97b6863badec4643bf8d1d1058a65d723572882 diff --git a/ports/esp32s2/.gitignore b/ports/espressif/.gitignore similarity index 100% rename from ports/esp32s2/.gitignore rename to ports/espressif/.gitignore diff --git a/ports/esp32s2/CMakeLists.txt b/ports/espressif/CMakeLists.txt similarity index 100% rename from ports/esp32s2/CMakeLists.txt rename to ports/espressif/CMakeLists.txt diff --git a/ports/esp32s2/Makefile b/ports/espressif/Makefile similarity index 100% rename from ports/esp32s2/Makefile rename to ports/espressif/Makefile diff --git a/ports/esp32s2/README.rst b/ports/espressif/README.rst similarity index 100% rename from ports/esp32s2/README.rst rename to ports/espressif/README.rst diff --git a/ports/esp32s2/background.c b/ports/espressif/background.c similarity index 100% rename from ports/esp32s2/background.c rename to ports/espressif/background.c diff --git a/ports/esp32s2/background.h b/ports/espressif/background.h similarity index 100% rename from ports/esp32s2/background.h rename to ports/espressif/background.h diff --git a/ports/esp32s2/bindings/espidf/__init__.c b/ports/espressif/bindings/espidf/__init__.c similarity index 90% rename from ports/esp32s2/bindings/espidf/__init__.c rename to ports/espressif/bindings/espidf/__init__.c index 97e1136f87..9d79dd5195 100644 --- a/ports/esp32s2/bindings/espidf/__init__.c +++ b/ports/espressif/bindings/espidf/__init__.c @@ -26,9 +26,12 @@ #include "py/obj.h" #include "py/runtime.h" +#include "py/mphal.h" + #include "bindings/espidf/__init__.h" +#include "nvs_flash.h" #include "components/heap/include/esp_heap_caps.h" //| """Direct access to a few ESP-IDF details. This module *should not* include any functionality @@ -65,6 +68,20 @@ STATIC mp_obj_t espidf_heap_caps_get_largest_free_block(void) { } MP_DEFINE_CONST_FUN_OBJ_0(espidf_heap_caps_get_largest_free_block_obj, espidf_heap_caps_get_largest_free_block); +//| def erase_nvs() -> None: +//| """Erase all data in the non-volatile storage (nvs), including data stored by with `microcontroller.nvm` +//| +//| This is necessary when upgrading from CircuitPython 6.3.0 or earlier to CircuitPython 7.0.0, because the +//| layout of data in nvs has changed. The old data will be lost when you perform this operation.""" +STATIC mp_obj_t espidf_erase_nvs(void) { + ESP_ERROR_CHECK(nvs_flash_deinit()); + ESP_ERROR_CHECK(nvs_flash_erase()); + ESP_ERROR_CHECK(nvs_flash_init()); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_0(espidf_erase_nvs_obj, espidf_erase_nvs); + + //| class IDFError(OSError): //| """Raised for certain generic ESP IDF errors.""" //| ... @@ -117,6 +134,8 @@ STATIC const mp_rom_map_elem_t espidf_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_heap_caps_get_free_size), MP_ROM_PTR(&espidf_heap_caps_get_free_size_obj)}, { MP_ROM_QSTR(MP_QSTR_heap_caps_get_largest_free_block), MP_ROM_PTR(&espidf_heap_caps_get_largest_free_block_obj)}, + { MP_ROM_QSTR(MP_QSTR_erase_nvs), MP_ROM_PTR(&espidf_erase_nvs_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) }, }; diff --git a/ports/esp32s2/bindings/espidf/__init__.h b/ports/espressif/bindings/espidf/__init__.h similarity index 100% rename from ports/esp32s2/bindings/espidf/__init__.h rename to ports/espressif/bindings/espidf/__init__.h diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/board.c b/ports/espressif/boards/adafruit_feather_esp32s2_nopsram/board.c similarity index 100% rename from ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/board.c rename to ports/espressif/boards/adafruit_feather_esp32s2_nopsram/board.c diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h rename to ports/espressif/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.h diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.mk rename to ports/espressif/boards/adafruit_feather_esp32s2_nopsram/mpconfigboard.mk diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/pins.c b/ports/espressif/boards/adafruit_feather_esp32s2_nopsram/pins.c similarity index 93% rename from ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/pins.c rename to ports/espressif/boards/adafruit_feather_esp32s2_nopsram/pins.c index 848c2c44ff..6d0167f5c2 100644 --- a/ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/pins.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2_nopsram/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, @@ -61,4 +63,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32s2_nopsram/sdkconfig similarity index 100% rename from ports/esp32s2/boards/adafruit_feather_esp32s2_nopsram/sdkconfig rename to ports/espressif/boards/adafruit_feather_esp32s2_nopsram/sdkconfig diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c similarity index 98% rename from ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c rename to ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c index 799494006d..943d91feda 100644 --- a/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/board.c @@ -94,7 +94,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_GPIO7, // backlight pin diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h rename to ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.h diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk rename to ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/mpconfigboard.mk diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/pins.c b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/pins.c similarity index 93% rename from ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/pins.c rename to ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/pins.c index ba0bd29784..54b9051d73 100644 --- a/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/pins.c +++ b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/pins.c @@ -2,7 +2,9 @@ #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, @@ -70,4 +72,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { // { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/sdkconfig b/ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/sdkconfig similarity index 100% rename from ports/esp32s2/boards/adafruit_feather_esp32s2_tftback_nopsram/sdkconfig rename to ports/espressif/boards/adafruit_feather_esp32s2_tftback_nopsram/sdkconfig diff --git a/ports/esp32s2/boards/adafruit_funhouse/board.c b/ports/espressif/boards/adafruit_funhouse/board.c similarity index 98% rename from ports/esp32s2/boards/adafruit_funhouse/board.c rename to ports/espressif/boards/adafruit_funhouse/board.c index 8451edef95..a4a1d07947 100644 --- a/ports/esp32s2/boards/adafruit_funhouse/board.c +++ b/ports/espressif/boards/adafruit_funhouse/board.c @@ -97,7 +97,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_GPIO21, // backlight pin diff --git a/ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.h similarity index 92% rename from ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h rename to ports/espressif/boards/adafruit_funhouse/mpconfigboard.h index 40a7add36b..6379147c30 100644 --- a/ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.h @@ -29,8 +29,9 @@ #define MICROPY_HW_BOARD_NAME "Adafruit FunHouse" #define MICROPY_HW_MCU_NAME "ESP32S2" -#define MICROPY_HW_APA_MOSI (&pin_GPIO14) -#define MICROPY_HW_APA_SCK (&pin_GPIO15) +#define MICROPY_HW_APA102_MOSI (&pin_GPIO14) +#define MICROPY_HW_APA102_SCK (&pin_GPIO15) +#define MICROPY_HW_APA102_COUNT (5) #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) diff --git a/ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.mk b/ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/adafruit_funhouse/mpconfigboard.mk rename to ports/espressif/boards/adafruit_funhouse/mpconfigboard.mk diff --git a/ports/esp32s2/boards/adafruit_funhouse/pins.c b/ports/espressif/boards/adafruit_funhouse/pins.c similarity index 92% rename from ports/esp32s2/boards/adafruit_funhouse/pins.c rename to ports/espressif/boards/adafruit_funhouse/pins.c index 9728512c0e..1904150f35 100644 --- a/ports/esp32s2/boards/adafruit_funhouse/pins.c +++ b/ports/espressif/boards/adafruit_funhouse/pins.c @@ -2,7 +2,9 @@ #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_GPIO21) }, { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO40) }, @@ -48,4 +50,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/adafruit_funhouse/sdkconfig b/ports/espressif/boards/adafruit_funhouse/sdkconfig similarity index 100% rename from ports/esp32s2/boards/adafruit_funhouse/sdkconfig rename to ports/espressif/boards/adafruit_funhouse/sdkconfig diff --git a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/board.c rename to ports/espressif/boards/adafruit_magtag_2.9_grayscale/board.c diff --git a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h similarity index 97% rename from ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h rename to ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h index d0d1864993..343bb525f1 100644 --- a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h @@ -32,6 +32,7 @@ #define MICROPY_HW_NEOPIXEL (&pin_GPIO1) #define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO21) #define CIRCUITPY_STATUS_LED_POWER_INVERTED (1) +#define MICROPY_HW_NEOPIXEL_COUNT (4) #define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) diff --git a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk rename to ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.mk diff --git a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/pins.c similarity index 92% rename from ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c rename to ports/espressif/boards/adafruit_magtag_2.9_grayscale/pins.c index 990cfd9957..79b1feb40c 100644 --- a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/pins.c +++ b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/pins.c @@ -2,7 +2,9 @@ #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, @@ -56,4 +58,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_GPIO9) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/sdkconfig b/ports/espressif/boards/adafruit_magtag_2.9_grayscale/sdkconfig similarity index 100% rename from ports/esp32s2/boards/adafruit_magtag_2.9_grayscale/sdkconfig rename to ports/espressif/boards/adafruit_magtag_2.9_grayscale/sdkconfig diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/board.c b/ports/espressif/boards/adafruit_metro_esp32s2/board.c similarity index 100% rename from ports/esp32s2/boards/adafruit_metro_esp32s2/board.c rename to ports/espressif/boards/adafruit_metro_esp32s2/board.c diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.h rename to ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.mk b/ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/adafruit_metro_esp32s2/mpconfigboard.mk rename to ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.mk diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c b/ports/espressif/boards/adafruit_metro_esp32s2/pins.c similarity index 94% rename from ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c rename to ports/espressif/boards/adafruit_metro_esp32s2/pins.c index dbd6cfef8d..4c393b4f85 100644 --- a/ports/esp32s2/boards/adafruit_metro_esp32s2/pins.c +++ b/ports/espressif/boards/adafruit_metro_esp32s2/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, @@ -65,4 +67,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig b/ports/espressif/boards/adafruit_metro_esp32s2/sdkconfig similarity index 100% rename from ports/esp32s2/boards/adafruit_metro_esp32s2/sdkconfig rename to ports/espressif/boards/adafruit_metro_esp32s2/sdkconfig diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/board.c b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/board.c similarity index 100% rename from ports/esp32s2/boards/electroniccats_bastwifi/board.c rename to ports/espressif/boards/ai_thinker_esp_12k_nodemcu/board.c diff --git a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h new file mode 100644 index 0000000000..1af2d2420c --- /dev/null +++ b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/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 + +// Same setup as the Saola board but with no Neopixel on board + +#define MICROPY_HW_BOARD_NAME "ESP 12k NodeMCU" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +// #define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 diff --git a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk new file mode 100644 index 0000000000..08baf474ee --- /dev/null +++ b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x612B +USB_PID = 0x80A7 +USB_PRODUCT = "ESP 12k NodeMCU" +USB_MANUFACTURER = "Ai-Thinker" + +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_MODULE=wrover diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/pins.c b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/pins.c similarity index 93% rename from ports/esp32s2/boards/targett_module_clip_wroom/pins.c rename to ports/espressif/boards/ai_thinker_esp_12k_nodemcu/pins.c index a8ca8ba3ed..ee43af23df 100644 --- a/ports/esp32s2/boards/targett_module_clip_wroom/pins.c +++ b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -45,4 +47,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { // { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/sdkconfig b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/sdkconfig new file mode 100644 index 0000000000..1a86435efc --- /dev/null +++ b/ports/espressif/boards/ai_thinker_esp_12k_nodemcu/sdkconfig @@ -0,0 +1,33 @@ +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=4194304 + +# +# 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 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config diff --git a/ports/esp32s2/boards/artisense_rd00/board.c b/ports/espressif/boards/artisense_rd00/board.c similarity index 100% rename from ports/esp32s2/boards/artisense_rd00/board.c rename to ports/espressif/boards/artisense_rd00/board.c diff --git a/ports/esp32s2/boards/artisense_rd00/mpconfigboard.h b/ports/espressif/boards/artisense_rd00/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/artisense_rd00/mpconfigboard.h rename to ports/espressif/boards/artisense_rd00/mpconfigboard.h diff --git a/ports/esp32s2/boards/artisense_rd00/mpconfigboard.mk b/ports/espressif/boards/artisense_rd00/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/artisense_rd00/mpconfigboard.mk rename to ports/espressif/boards/artisense_rd00/mpconfigboard.mk diff --git a/ports/esp32s2/boards/artisense_rd00/pins.c b/ports/espressif/boards/artisense_rd00/pins.c similarity index 93% rename from ports/esp32s2/boards/artisense_rd00/pins.c rename to ports/espressif/boards/artisense_rd00/pins.c index 3cd05f5b3c..5833513d35 100644 --- a/ports/esp32s2/boards/artisense_rd00/pins.c +++ b/ports/espressif/boards/artisense_rd00/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO6) }, @@ -45,4 +47,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/artisense_rd00/sdkconfig b/ports/espressif/boards/artisense_rd00/sdkconfig similarity index 100% rename from ports/esp32s2/boards/artisense_rd00/sdkconfig rename to ports/espressif/boards/artisense_rd00/sdkconfig diff --git a/ports/esp32s2/boards/atmegazero_esp32s2/board.c b/ports/espressif/boards/atmegazero_esp32s2/board.c similarity index 100% rename from ports/esp32s2/boards/atmegazero_esp32s2/board.c rename to ports/espressif/boards/atmegazero_esp32s2/board.c diff --git a/ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h b/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.h rename to ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h diff --git a/ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.mk b/ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/atmegazero_esp32s2/mpconfigboard.mk rename to ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.mk diff --git a/ports/esp32s2/boards/atmegazero_esp32s2/pins.c b/ports/espressif/boards/atmegazero_esp32s2/pins.c similarity index 92% rename from ports/esp32s2/boards/atmegazero_esp32s2/pins.c rename to ports/espressif/boards/atmegazero_esp32s2/pins.c index cfc4ef6223..76dde3b583 100644 --- a/ports/esp32s2/boards/atmegazero_esp32s2/pins.c +++ b/ports/espressif/boards/atmegazero_esp32s2/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -64,9 +66,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO18) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO40) }, @@ -77,4 +79,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/atmegazero_esp32s2/sdkconfig b/ports/espressif/boards/atmegazero_esp32s2/sdkconfig similarity index 100% rename from ports/esp32s2/boards/atmegazero_esp32s2/sdkconfig rename to ports/espressif/boards/atmegazero_esp32s2/sdkconfig diff --git a/ports/esp32s2/boards/espressif_kaluga_1.3/board.c b/ports/espressif/boards/crumpspace_crumps2/board.c similarity index 100% rename from ports/esp32s2/boards/espressif_kaluga_1.3/board.c rename to ports/espressif/boards/crumpspace_crumps2/board.c diff --git a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h new file mode 100644 index 0000000000..cda4e0e534 --- /dev/null +++ b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.h @@ -0,0 +1,35 @@ +/* + * 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 "CrumpS2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 diff --git a/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk new file mode 100644 index 0000000000..8eea211d6a --- /dev/null +++ b/ports/espressif/boards/crumpspace_crumps2/mpconfigboard.mk @@ -0,0 +1,22 @@ +USB_VID = 0x1209 +USB_PID = 0x3141 +USB_PRODUCT = "CrumpS2" +USB_MANUFACTURER = "CrumpSpace" + +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_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/crumpspace_crumps2/pins.c b/ports/espressif/boards/crumpspace_crumps2/pins.c new file mode 100644 index 0000000000..157ff2b8fc --- /dev/null +++ b/ports/espressif/boards/crumpspace_crumps2/pins.c @@ -0,0 +1,55 @@ +#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_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_APA102_MOSI), MP_ROM_PTR(&pin_GPIO40) }, // APA102 + + { 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_TX), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_APA102_SCK), MP_ROM_PTR(&pin_GPIO45) }, // APA102 + + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/crumpspace_crumps2/sdkconfig b/ports/espressif/boards/crumpspace_crumps2/sdkconfig new file mode 100644 index 0000000000..04b487625d --- /dev/null +++ b/ports/espressif/boards/crumpspace_crumps2/sdkconfig @@ -0,0 +1,39 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# 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 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="CrumpS2" +# end of LWIP diff --git a/ports/esp32s2/boards/espressif_kaluga_1/board.c b/ports/espressif/boards/electroniccats_bastwifi/board.c similarity index 100% rename from ports/esp32s2/boards/espressif_kaluga_1/board.c rename to ports/espressif/boards/electroniccats_bastwifi/board.c diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.h rename to ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.h diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk b/ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/electroniccats_bastwifi/mpconfigboard.mk rename to ports/espressif/boards/electroniccats_bastwifi/mpconfigboard.mk diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/pins.c b/ports/espressif/boards/electroniccats_bastwifi/pins.c similarity index 94% rename from ports/esp32s2/boards/electroniccats_bastwifi/pins.c rename to ports/espressif/boards/electroniccats_bastwifi/pins.c index 2f9987b0ed..fdd4cd83c4 100644 --- a/ports/esp32s2/boards/electroniccats_bastwifi/pins.c +++ b/ports/espressif/boards/electroniccats_bastwifi/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, @@ -61,4 +63,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/electroniccats_bastwifi/sdkconfig b/ports/espressif/boards/electroniccats_bastwifi/sdkconfig similarity index 100% rename from ports/esp32s2/boards/electroniccats_bastwifi/sdkconfig rename to ports/espressif/boards/electroniccats_bastwifi/sdkconfig diff --git a/ports/espressif/boards/espressif_hmi_devkit_1/board.c b/ports/espressif/boards/espressif_hmi_devkit_1/board.c new file mode 100644 index 0000000000..ff5d9cfb6c --- /dev/null +++ b/ports/espressif/boards/espressif_hmi_devkit_1/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" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.h new file mode 100644 index 0000000000..9379c015b2 --- /dev/null +++ b/ports/espressif/boards/espressif_hmi_devkit_1/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 "HMI-DevKit-1.1" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO21) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO39) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO40) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) + +#define CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP (1) diff --git a/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk new file mode 100644 index 0000000000..f9dbcfeee3 --- /dev/null +++ b/ports/espressif/boards/espressif_hmi_devkit_1/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x303A +USB_PID = 0x7001 +USB_PRODUCT = "ESP32-S2-HMI-DevKit-1" +USB_MANUFACTURER = "Espressif" + +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 + +CIRCUITPY_MODULE=wrover diff --git a/ports/espressif/boards/espressif_hmi_devkit_1/pins.c b/ports/espressif/boards/espressif_hmi_devkit_1/pins.c new file mode 100644 index 0000000000..7e201e163f --- /dev/null +++ b/ports/espressif/boards/espressif_hmi_devkit_1/pins.c @@ -0,0 +1,122 @@ +#include "py/objtuple.h" +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_obj_tuple_t lcd_data_tuple = { + {&mp_type_tuple}, + 8, + { + MP_ROM_PTR(&pin_GPIO1), + MP_ROM_PTR(&pin_GPIO10), + MP_ROM_PTR(&pin_GPIO2), + MP_ROM_PTR(&pin_GPIO11), + MP_ROM_PTR(&pin_GPIO3), + MP_ROM_PTR(&pin_GPIO12), + MP_ROM_PTR(&pin_GPIO4), + MP_ROM_PTR(&pin_GPIO13), + MP_ROM_PTR(&pin_GPIO5), + MP_ROM_PTR(&pin_GPIO14), + MP_ROM_PTR(&pin_GPIO6), + MP_ROM_PTR(&pin_GPIO15), + MP_ROM_PTR(&pin_GPIO7), + MP_ROM_PTR(&pin_GPIO16), + MP_ROM_PTR(&pin_GPIO8), + MP_ROM_PTR(&pin_GPIO17), + } +}; + +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) }, + +// Neopixel power is controlled by onboard TCA9554 + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_LCD_RS), MP_ROM_PTR(&pin_GPIO38) }, + + // LCD + { MP_ROM_QSTR(MP_QSTR_LCD_DATA), MP_ROM_PTR(&lcd_data_tuple) }, + { MP_ROM_QSTR(MP_QSTR_LCD_WR), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_LCD_RS), MP_ROM_PTR(&pin_GPIO38) }, + + // SPI and SD + { MP_ROM_QSTR(MP_QSTR_CS_SD), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_CS_CNN), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(DEFAULT_SPI_BUS_MISO) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(DEFAULT_SPI_BUS_MOSI) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(DEFAULT_SPI_BUS_SCK) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + + // I2C + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(DEFAULT_I2C_BUS_SCL) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(DEFAULT_I2C_BUS_SDA) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + + // canbus (TWAI) + { MP_ROM_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_GPIO42) }, + + // Audio + { MP_ROM_QSTR(MP_QSTR_MIC_ADC_M), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_DAC_OUT), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_MISO), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_MOSI), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_SCK), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_CS), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_BT_ADC), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SCL), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_MCLK), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_BCLK), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_LRCK), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_SDI), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_SDO), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_RST), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_WAKE_INT), MP_ROM_PTR(&pin_GPIO46) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_MCLK), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_PA_CTRL), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_SDI), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_SDO), MP_ROM_PTR(&pin_GPIO12) }, + { 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_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/espressif_kaluga_1.3/sdkconfig b/ports/espressif/boards/espressif_hmi_devkit_1/sdkconfig similarity index 100% rename from ports/esp32s2/boards/espressif_kaluga_1.3/sdkconfig rename to ports/espressif/boards/espressif_hmi_devkit_1/sdkconfig diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/board.c b/ports/espressif/boards/espressif_kaluga_1.3/board.c similarity index 100% rename from ports/esp32s2/boards/espressif_saola_1_wroom/board.c rename to ports/espressif/boards/espressif_kaluga_1.3/board.c diff --git a/ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/espressif_kaluga_1.3/mpconfigboard.h rename to ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.h diff --git a/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk new file mode 100644 index 0000000000..2dce038819 --- /dev/null +++ b/ports/espressif/boards/espressif_kaluga_1.3/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x80C8 +USB_PRODUCT = "Kaluga 1" +USB_MANUFACTURER = "Espressif" + +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 + +CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/boards/espressif_kaluga_1.3/pins.c b/ports/espressif/boards/espressif_kaluga_1.3/pins.c similarity index 97% rename from ports/esp32s2/boards/espressif_kaluga_1.3/pins.c rename to ports/espressif/boards/espressif_kaluga_1.3/pins.c index 557a0977c1..dff98ceeb9 100644 --- a/ports/esp32s2/boards/espressif_kaluga_1.3/pins.c +++ b/ports/espressif/boards/espressif_kaluga_1.3/pins.c @@ -16,7 +16,9 @@ STATIC const mp_rom_obj_tuple_t camera_data_tuple = { } }; -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -139,4 +141,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_BCLK_DAC2), MP_ROM_PTR(&pin_GPIO18) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/espressif_kaluga_1/sdkconfig b/ports/espressif/boards/espressif_kaluga_1.3/sdkconfig similarity index 100% rename from ports/esp32s2/boards/espressif_kaluga_1/sdkconfig rename to ports/espressif/boards/espressif_kaluga_1.3/sdkconfig diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/board.c b/ports/espressif/boards/espressif_kaluga_1/board.c similarity index 100% rename from ports/esp32s2/boards/espressif_saola_1_wrover/board.c rename to ports/espressif/boards/espressif_kaluga_1/board.c diff --git a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.h rename to ports/espressif/boards/espressif_kaluga_1/mpconfigboard.h diff --git a/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk new file mode 100644 index 0000000000..2dce038819 --- /dev/null +++ b/ports/espressif/boards/espressif_kaluga_1/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x239A +USB_PID = 0x80C8 +USB_PRODUCT = "Kaluga 1" +USB_MANUFACTURER = "Espressif" + +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 + +CIRCUITPY_MODULE=wrover diff --git a/ports/esp32s2/boards/espressif_kaluga_1/pins.c b/ports/espressif/boards/espressif_kaluga_1/pins.c similarity index 97% rename from ports/esp32s2/boards/espressif_kaluga_1/pins.c rename to ports/espressif/boards/espressif_kaluga_1/pins.c index f28062a164..c31a9fe42e 100644 --- a/ports/esp32s2/boards/espressif_kaluga_1/pins.c +++ b/ports/espressif/boards/espressif_kaluga_1/pins.c @@ -16,7 +16,9 @@ STATIC const mp_rom_obj_tuple_t camera_data_tuple = { } }; -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -139,4 +141,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_BCLK_DAC2), MP_ROM_PTR(&pin_GPIO18) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/sdkconfig b/ports/espressif/boards/espressif_kaluga_1/sdkconfig similarity index 100% rename from ports/esp32s2/boards/espressif_saola_1_wrover/sdkconfig rename to ports/espressif/boards/espressif_kaluga_1/sdkconfig diff --git a/ports/esp32s2/boards/franzininho_wifi_wroom/board.c b/ports/espressif/boards/espressif_saola_1_wroom/board.c similarity index 100% rename from ports/esp32s2/boards/franzininho_wifi_wroom/board.c rename to ports/espressif/boards/espressif_saola_1_wroom/board.c diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.h rename to ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.h diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/espressif_saola_1_wroom/mpconfigboard.mk rename to ports/espressif/boards/espressif_saola_1_wroom/mpconfigboard.mk diff --git a/ports/esp32s2/boards/franzininho_wifi_wrover/pins.c b/ports/espressif/boards/espressif_saola_1_wroom/pins.c similarity index 93% rename from ports/esp32s2/boards/franzininho_wifi_wrover/pins.c rename to ports/espressif/boards/espressif_saola_1_wroom/pins.c index 0562d9331f..08a9e08f32 100644 --- a/ports/esp32s2/boards/franzininho_wifi_wrover/pins.c +++ b/ports/espressif/boards/espressif_saola_1_wroom/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -45,4 +47,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/sdkconfig b/ports/espressif/boards/espressif_saola_1_wroom/sdkconfig similarity index 100% rename from ports/esp32s2/boards/espressif_saola_1_wroom/sdkconfig rename to ports/espressif/boards/espressif_saola_1_wroom/sdkconfig diff --git a/ports/esp32s2/boards/franzininho_wifi_wrover/board.c b/ports/espressif/boards/espressif_saola_1_wrover/board.c similarity index 100% rename from ports/esp32s2/boards/franzininho_wifi_wrover/board.c rename to ports/espressif/boards/espressif_saola_1_wrover/board.c diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.h rename to ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.h diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk b/ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/espressif_saola_1_wrover/mpconfigboard.mk rename to ports/espressif/boards/espressif_saola_1_wrover/mpconfigboard.mk diff --git a/ports/esp32s2/boards/franzininho_wifi_wroom/pins.c b/ports/espressif/boards/espressif_saola_1_wrover/pins.c similarity index 93% rename from ports/esp32s2/boards/franzininho_wifi_wroom/pins.c rename to ports/espressif/boards/espressif_saola_1_wrover/pins.c index 0562d9331f..08a9e08f32 100644 --- a/ports/esp32s2/boards/franzininho_wifi_wroom/pins.c +++ b/ports/espressif/boards/espressif_saola_1_wrover/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -45,4 +47,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/franzininho_wifi_wrover/sdkconfig b/ports/espressif/boards/espressif_saola_1_wrover/sdkconfig similarity index 100% rename from ports/esp32s2/boards/franzininho_wifi_wrover/sdkconfig rename to ports/espressif/boards/espressif_saola_1_wrover/sdkconfig diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/board.c b/ports/espressif/boards/franzininho_wifi_wroom/board.c similarity index 100% rename from ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/board.c rename to ports/espressif/boards/franzininho_wifi_wroom/board.c diff --git a/ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.h rename to ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.h diff --git a/ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/franzininho_wifi_wroom/mpconfigboard.mk rename to ports/espressif/boards/franzininho_wifi_wroom/mpconfigboard.mk diff --git a/ports/esp32s2/boards/espressif_saola_1_wroom/pins.c b/ports/espressif/boards/franzininho_wifi_wroom/pins.c similarity index 93% rename from ports/esp32s2/boards/espressif_saola_1_wroom/pins.c rename to ports/espressif/boards/franzininho_wifi_wroom/pins.c index 0562d9331f..08a9e08f32 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wroom/pins.c +++ b/ports/espressif/boards/franzininho_wifi_wroom/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -45,4 +47,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/franzininho_wifi_wroom/sdkconfig b/ports/espressif/boards/franzininho_wifi_wroom/sdkconfig similarity index 100% rename from ports/esp32s2/boards/franzininho_wifi_wroom/sdkconfig rename to ports/espressif/boards/franzininho_wifi_wroom/sdkconfig diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/board.c b/ports/espressif/boards/franzininho_wifi_wrover/board.c similarity index 100% rename from ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/board.c rename to ports/espressif/boards/franzininho_wifi_wrover/board.c diff --git a/ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.h rename to ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.h diff --git a/ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.mk b/ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/franzininho_wifi_wrover/mpconfigboard.mk rename to ports/espressif/boards/franzininho_wifi_wrover/mpconfigboard.mk diff --git a/ports/esp32s2/boards/espressif_saola_1_wrover/pins.c b/ports/espressif/boards/franzininho_wifi_wrover/pins.c similarity index 93% rename from ports/esp32s2/boards/espressif_saola_1_wrover/pins.c rename to ports/espressif/boards/franzininho_wifi_wrover/pins.c index 0562d9331f..08a9e08f32 100644 --- a/ports/esp32s2/boards/espressif_saola_1_wrover/pins.c +++ b/ports/espressif/boards/franzininho_wifi_wrover/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -45,4 +47,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/sdkconfig b/ports/espressif/boards/franzininho_wifi_wrover/sdkconfig similarity index 100% rename from ports/esp32s2/boards/targett_module_clip_wrover/sdkconfig rename to ports/espressif/boards/franzininho_wifi_wrover/sdkconfig diff --git a/ports/espressif/boards/gravitech_cucumber_m/board.c b/ports/espressif/boards/gravitech_cucumber_m/board.c new file mode 100644 index 0000000000..ec84d3209c --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_m/board.c @@ -0,0 +1,51 @@ +/* + * 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) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + 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/gravitech_cucumber_m/mpconfigboard.h b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.h new file mode 100644 index 0000000000..5406f88f01 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_m/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 "Gravitech Cucumber M" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#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 new file mode 100644 index 0000000000..3e1fa2526a --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_m/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x303A +USB_PID = 0x80A4 +USB_PRODUCT = "Cucumber M" +USB_MANUFACTURER = "Gravitech" + +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_MODULE=wroom diff --git a/ports/espressif/boards/gravitech_cucumber_m/pins.c b/ports/espressif/boards/gravitech_cucumber_m/pins.c new file mode 100644 index 0000000000..a5dd609287 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_m/pins.c @@ -0,0 +1,51 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_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_LED), 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_NEOPIXEL), 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_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/gravitech_cucumber_m/sdkconfig b/ports/espressif/boards/gravitech_cucumber_m/sdkconfig new file mode 100644 index 0000000000..af73f6d885 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_m/sdkconfig @@ -0,0 +1,5 @@ +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="cucumber_m" +# end of LWIP diff --git a/ports/espressif/boards/gravitech_cucumber_ms/board.c b/ports/espressif/boards/gravitech_cucumber_ms/board.c new file mode 100644 index 0000000000..ec84d3209c --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_ms/board.c @@ -0,0 +1,51 @@ +/* + * 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) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + 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/gravitech_cucumber_ms/mpconfigboard.h b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h new file mode 100644 index 0000000000..c0b6fee029 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.h @@ -0,0 +1,44 @@ +/* + * 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 "Gravitech Cucumber MS" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO40) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO41) + +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) +#define DEFAULT_UART_BUS_RX (&pin_GPIO44) diff --git a/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk new file mode 100644 index 0000000000..7a0d84a311 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_ms/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x303A +USB_PID = 0x80A7 +USB_PRODUCT = "Cucumber MS" +USB_MANUFACTURER = "Gravitech" + +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_MODULE=wroom diff --git a/ports/espressif/boards/gravitech_cucumber_ms/pins.c b/ports/espressif/boards/gravitech_cucumber_ms/pins.c new file mode 100644 index 0000000000..a1bb25cf14 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_ms/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_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_LED), 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_NEOPIXEL), 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_SDA), 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_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_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/gravitech_cucumber_ms/sdkconfig b/ports/espressif/boards/gravitech_cucumber_ms/sdkconfig new file mode 100644 index 0000000000..cbdd787aa7 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_ms/sdkconfig @@ -0,0 +1,5 @@ +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="cucumber_ms" +# end of LWIP diff --git a/ports/espressif/boards/gravitech_cucumber_r/board.c b/ports/espressif/boards/gravitech_cucumber_r/board.c new file mode 100644 index 0000000000..ec84d3209c --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_r/board.c @@ -0,0 +1,51 @@ +/* + * 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) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + 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/gravitech_cucumber_r/mpconfigboard.h b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.h new file mode 100644 index 0000000000..5d51ff002f --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_r/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 "Gravitech Cucumber R" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#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 new file mode 100644 index 0000000000..018742b469 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_r/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x303A +USB_PID = 0x80A1 +USB_PRODUCT = "Cucumber R" +USB_MANUFACTURER = "Gravitech" + +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_MODULE=wrover diff --git a/ports/espressif/boards/gravitech_cucumber_r/pins.c b/ports/espressif/boards/gravitech_cucumber_r/pins.c new file mode 100644 index 0000000000..a5dd609287 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_r/pins.c @@ -0,0 +1,51 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_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_LED), 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_NEOPIXEL), 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_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/gravitech_cucumber_r/sdkconfig b/ports/espressif/boards/gravitech_cucumber_r/sdkconfig new file mode 100644 index 0000000000..3862b27003 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_r/sdkconfig @@ -0,0 +1,39 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# 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 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="cucumber_r" +# end of LWIP diff --git a/ports/espressif/boards/gravitech_cucumber_rs/board.c b/ports/espressif/boards/gravitech_cucumber_rs/board.c new file mode 100644 index 0000000000..ec84d3209c --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_rs/board.c @@ -0,0 +1,51 @@ +/* + * 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) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + 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/gravitech_cucumber_rs/mpconfigboard.h b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h new file mode 100644 index 0000000000..14bc06f0e3 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h @@ -0,0 +1,44 @@ +/* + * 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 "Gravitech Cucumber RS" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO18) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO40) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO41) + +#define DEFAULT_UART_BUS_TX (&pin_GPIO43) +#define DEFAULT_UART_BUS_RX (&pin_GPIO44) diff --git a/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk new file mode 100644 index 0000000000..807dcaabbf --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x303A +USB_PID = 0x800D +USB_PRODUCT = "Cucumber RS" +USB_MANUFACTURER = "Gravitech" + +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_MODULE=wrover diff --git a/ports/espressif/boards/gravitech_cucumber_rs/pins.c b/ports/espressif/boards/gravitech_cucumber_rs/pins.c new file mode 100644 index 0000000000..a1bb25cf14 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_rs/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_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_LED), 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_NEOPIXEL), 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_SDA), 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_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_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/gravitech_cucumber_rs/sdkconfig b/ports/espressif/boards/gravitech_cucumber_rs/sdkconfig new file mode 100644 index 0000000000..bc8328d1f1 --- /dev/null +++ b/ports/espressif/boards/gravitech_cucumber_rs/sdkconfig @@ -0,0 +1,39 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# 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 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="cucumber_rs" +# end of LWIP diff --git a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c similarity index 98% rename from ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c rename to ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c index 1002fa6b76..b00a1ed8ed 100644 --- a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/board.c @@ -113,7 +113,6 @@ static void display_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // set row command MIPI_COMMAND_WRITE_MEMORY_START, // write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_GPIO33, // backlight pin diff --git a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h rename to ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h diff --git a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk rename to ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk diff --git a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/pins.c b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/pins.c similarity index 89% rename from ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/pins.c rename to ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/pins.c index a30c6797a5..08e0fe0174 100644 --- a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/pins.c +++ b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/pins.c @@ -1,7 +1,9 @@ #include "shared-bindings/board/__init__.h" #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -11,6 +13,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_IO11), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, @@ -52,5 +55,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { // Peripheral Power control { MP_ROM_QSTR(MP_QSTR_PE_POWER), MP_ROM_PTR(&pin_GPIO14) }, + + // Battery Sense + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO9) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/sdkconfig b/ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/sdkconfig similarity index 100% rename from ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/sdkconfig rename to ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/sdkconfig diff --git a/ports/esp32s2/boards/microdev_micro_s2/board.c b/ports/espressif/boards/lolin_s2_mini/board.c similarity index 100% rename from ports/esp32s2/boards/microdev_micro_s2/board.c rename to ports/espressif/boards/lolin_s2_mini/board.c diff --git a/ports/espressif/boards/lolin_s2_mini/mpconfigboard.h b/ports/espressif/boards/lolin_s2_mini/mpconfigboard.h new file mode 100644 index 0000000000..18d8234c72 --- /dev/null +++ b/ports/espressif/boards/lolin_s2_mini/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 "S2Mini" +#define MICROPY_HW_MCU_NAME "ESP32S2-S2FN4R2" // from Wemos MP + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#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 + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO7) // no SPI labels on S2 Mini, def from Wemos MP +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO11) // no SPI labels on S2 Mini, def from Wemos MP +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO9) // no SPI 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 new file mode 100644 index 0000000000..e4c7aacadd --- /dev/null +++ b/ports/espressif/boards/lolin_s2_mini/mpconfigboard.mk @@ -0,0 +1,19 @@ +USB_VID = 0x303A +USB_PID = 0x80C3 +USB_PRODUCT = "S2 Mini" +USB_MANUFACTURER = "Lolin" + +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=4MB + + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/lolin_s2_mini/pins.c b/ports/espressif/boards/lolin_s2_mini/pins.c new file mode 100644 index 0000000000..c73149597d --- /dev/null +++ b/ports/espressif/boards/lolin_s2_mini/pins.c @@ -0,0 +1,90 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // S2 Mini Board bottom, right, top-bottom + // GPIO0-GPIO14: broken out as a bloc on ESP32-S2FN4R2 SoC + // mpconfigboard.h: GPIO0: CIRCUITPY_BOOT_BUTTON + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, // RTC_GPIO0,GPIO0 + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, // RTC_GPIO1,GPIO1,TOUCH1,ADC1_CH0 + + { MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) }, // RTC_GPIO2,GPIO2,TOUCH2,ADC1_CH1 + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, // RTC_GPIO3,GPIO3,TOUCH3,ADC1_CH2 + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO3) }, // D1 mini pin A0 + + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, // RTC_GPIO4,GPIO4,TOUCH4,ADC1_CH3 + { MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) }, // RTC_GPIO5,GPIO5,TOUCH5,ADC1_CH4 + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO5) }, // D1 mini pin D0 GPIO16 + + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, // RTC_GPIO6,GPIO6,TOUCH6,ADC1_CH5 + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, // RTC_GPIO7,GPIO7,TOUCH7,ADC1_CH6 + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO7) }, // def from Wemos MP + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO7) }, // D1 mini pin D5 GPIO14 + + // mpconfigboard.h: GPIO8/GPIO9: SCL/SDA I2C0 + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, // RTC_GPIO8,GPIO8,TOUCH8,ADC1_CH7 + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, // RTC_GPIO9,GPIO9,TOUCH9,ADC1_CH8,FSPIHD + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO9) }, // def from Wemos MP + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO9) }, // D1 mini pin D6 GPIO12 + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },// RTC_GPIO10,GPIO10,TOUCH10,ADC1_CH9,FSPICS0,FSPIIO4 + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },// RTC_GPIO11,GPIO11,TOUCH11,ADC2_CH0,FSPID,FSPIIO5 + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO11) },// def from Wemos MP + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO11) },// D1 mini pin D7 GPIO13 + + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },// RTC_GPIO12,GPIO12,TOUCH12,ADC2_CH1,FSPICLK,FSPIIO6 + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },// RTC_GPIO13,GPIO13,TOUCH13,ADC2_CH2,FSPIQ,FSPIIO7 + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO13) },// D1 mini pin D8 GPIO15 + + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },// RTC_GPIO14,GPIO14,TOUCH14,ADC2_CH3,FSPIWP,FSPIDQS + + // S2 Mini Board bottom, left, bottom-top + // mpconfigboard.h: GPIO15: CIRCUITPY_STATUS_LED_POWER + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },// XTAL_32K_P: RTC_GPIO15,GPIO15,U0RTS,ADC2_CH4,XTAL_32K_P + + { MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },// XTAL_32K_N: RTC_GPIO16,GPIO16,U0CTS,ADC2_CH5,XTAL_32K_N + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO16) },// D1 mini pin D4 GPIO2 LED + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },// DAC_1: RTC_GPIO17,GPIO17,U1TXD,ADC2_CH6,DAC_1 + + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },// DAC_2: RTC_GPIO18,GPIO18,U1RXD,ADC2_CH7,DAC_2,CLK_OUT3 + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO18) },// D1 mini pin D3 GPIO0 + // skip GPIO19-GPIO20: USB_D-/USB_D+ + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },// RTC_GPIO21,GPIO21 + + // skip GPIO22-GPIO25: not broken out on ESP32-S2FN4R2 SoC + // skip GPIO26-GPIO32: SPI Flash & RAM, not broken out on S2 Mini (internal to ESP32-S2FN4R2 SoC?) + + // GPIO33-GPIO40: broken out as a bloc on ESP32-S2FN4R2 SoC, last 2 half of JTAG + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },// SPIIO4,GPIO33,FSPIHD + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },// def from Wemos MP + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO33) },// D1 mini pin D2 GPIO4 + { MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) },// SPIIO5,GPIO34,FSPICS0 + + // mpconfigboard.h: GPIO35/GPIO36/GPIO37: MOSI/MESO/SCK SPI + { MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },// SPIIO6,GPIO35,FSPID + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO35) },// def from Wemos MP + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO35) },// D1 mini pin D1 GPIO5 + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },// SPIIO7,GPIO36,FSPICLK + + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) },// SPIDQS,GPIO37,FSPIQ + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },// GPIO38,FSPIWP + + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) },// MTCK,GPIO39,CLK_OUT3 + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) },// MTDO,GPIO40,CLK_OUT2 + + // S2 Mini - not broken out on board + /* + { MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) },// MTDI,GPIO41,CLK_OUT1 + { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) },// MTMS,GPIO42 + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, // U0TXD,GPIO43,CLK_OUT1 + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) },// + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, // U0RXD,GPIO44,CLK_OUT2 + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) },// GPIO45 + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) },// GPIO46 + */ +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/lolin_s2_mini/sdkconfig b/ports/espressif/boards/lolin_s2_mini/sdkconfig new file mode 100644 index 0000000000..126ae31312 --- /dev/null +++ b/ports/espressif/boards/lolin_s2_mini/sdkconfig @@ -0,0 +1,39 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO=y +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=2097152 + +# +# 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 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M=y +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="LS2Mini" +# end of LWIP diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/board.c b/ports/espressif/boards/microdev_micro_s2/board.c similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_feathers2/board.c rename to ports/espressif/boards/microdev_micro_s2/board.c diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.h similarity index 96% rename from ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h rename to ports/espressif/boards/microdev_micro_s2/mpconfigboard.h index 47bcde7e93..b8d6707b7c 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h +++ b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.h @@ -28,8 +28,6 @@ #define MICROPY_HW_BOARD_NAME "microS2" #define MICROPY_HW_MCU_NAME "ESP32S2" -#define MICROPY_HW_LED (&pin_GPIO21) -#define MICROPY_HW_BUTTON (&pin_GPIO0) #define MICROPY_HW_NEOPIXEL (&pin_GPIO33) // Default bus pins diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk b/ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk rename to ports/espressif/boards/microdev_micro_s2/mpconfigboard.mk diff --git a/ports/esp32s2/boards/microdev_micro_s2/pins.c b/ports/espressif/boards/microdev_micro_s2/pins.c similarity index 94% rename from ports/esp32s2/boards/microdev_micro_s2/pins.c rename to ports/espressif/boards/microdev_micro_s2/pins.c index bd230ed38f..2f0bacc491 100644 --- a/ports/esp32s2/boards/microdev_micro_s2/pins.c +++ b/ports/espressif/boards/microdev_micro_s2/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -65,4 +67,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/microdev_micro_s2/sdkconfig b/ports/espressif/boards/microdev_micro_s2/sdkconfig similarity index 100% rename from ports/esp32s2/boards/microdev_micro_s2/sdkconfig rename to ports/espressif/boards/microdev_micro_s2/sdkconfig diff --git a/ports/espressif/boards/morpheans_morphesp-240/board.c b/ports/espressif/boards/morpheans_morphesp-240/board.c new file mode 100644 index 0000000000..aad2f0257a --- /dev/null +++ b/ports/espressif/boards/morpheans_morphesp-240/board.c @@ -0,0 +1,226 @@ +/* + * 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 + +// From Arduino-ST7789 library https://github.com/ananevilya/Arduino-ST7789-Library/blob/master/Arduino_ST7789.cpp +#define ST7789_TFTWIDTH 240 +#define ST7789_TFTHEIGHT 240 + +#define ST7789_240x240_XSTART 0 +#define ST7789_240x240_YSTART 0 + +#define ST7789_NOP 0x00 +#define ST7789_SWRESET 0x01 +#define ST7789_RDDID 0x04 +#define ST7789_RDDST 0x09 + +#define ST7789_SLPIN 0x10 +#define ST7789_SLPOUT 0x11 +#define ST7789_PTLON 0x12 +#define ST7789_NORON 0x13 + +#define ST7789_INVOFF 0x20 +#define ST7789_INVON 0x21 +#define ST7789_DISPOFF 0x28 +#define ST7789_DISPON 0x29 +#define ST7789_CASET 0x2A +#define ST7789_RASET 0x2B +#define ST7789_RAMWR 0x2C +#define ST7789_RAMRD 0x2E + +#define ST7789_PTLAR 0x30 +#define ST7789_COLMOD 0x3A +#define ST7789_MADCTL 0x36 +#define ST7789_VSCSAD 0x37 +#define ST7789_PORCTRL 0xB2 +#define ST7789_GCTRL 0xB7 +#define ST7789_VCOMS 0xBB +#define ST7789_LCMCTRL 0xC0 +#define ST7789_IDSET 0xC1 +#define ST7789_VDVVRHEN 0xC2 +#define ST7789_VRHS 0xC3 +#define ST7789_VDVS 0xC4 +#define ST7789_VCMOFSET 0xC5 +#define ST7789_FRCTRL2 0xC6 +#define ST7789_CABCCTRL 0xC7 +#define ST7789_REGSEL1 0xC8 +#define ST7789_REGSEL2 0xCA +#define ST7789_PWMFRSEL 0xCC +#define ST7789_PWCTRL1 0xD0 +#define ST7789_VAPVANEN 0xD2 +#define ST7789_PVGAMCTRL 0xE0 +#define ST7789_NVGAMCTRL 0xE1 + +#define ST7789_MADCTL_MY 0x80 +#define ST7789_MADCTL_MX 0x40 +#define ST7789_MADCTL_MV 0x20 +#define ST7789_MADCTL_ML 0x10 +#define ST7789_MADCTL_RGB 0x00 + +#define ST7789_RDID1 0xDA +#define ST7789_RDID2 0xDB +#define ST7789_RDID3 0xDC +#define ST7789_RDID4 0xDD + +#define DISPLAY_MADCTL (ST7789_MADCTL_RGB) +#define DISPLAY_VSCSAD 0 + +// The init_sequence is bitpacked to minimize the ram impact. Every command begins with a +// command byte followed by a byte to determine the parameter count and delay. When the top bit +// of the second byte is 1 (0x80), a delay will occur after the command parameters are sent. +// The remaining 7 bits are the parameter count excluding any delay byte. The bytes following +// are the parameters. When the delay bit is set, a single byte after the parameters specifies +// the delay duration in milliseconds. The value 0xff will lead to an extra long 500 ms delay +// instead of 255 ms.uint8_t display_init_sequence[] = { +// display init sequence according to LilyGO example app + +uint8_t display_init_sequence[] = { + // From Lilygo example + // sw reset + 0x01, 0 | DELAY, 150, + // sleep out + 0x11, 0 | DELAY, 120, + // normal display mode on + 0x13, 0, + // display and color format settings + 0x36, 1, DISPLAY_MADCTL, + 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 + 0x21, 0 | DELAY, 10, // _INVON + 0x29, 0 | DELAY, 120 +}; + + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO6); + common_hal_never_reset_pin(&pin_GPIO7); + #endif /* DEBUG */ + + // Display + + busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus; + + common_hal_busio_spi_construct( + spi, + &pin_GPIO12, // CLK + &pin_GPIO11, // MOSI + NULL // MISO not connected + ); + + 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_GPIO14, // DC + &pin_GPIO10, // CS + &pin_GPIO9, // RST + 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( + display, + bus, + 240, // width (after rotation) + 240, // height (after rotation) + 0, // column start + 80, // 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), + NULL, // There is no backlight pin, defined for now. + NO_BRIGHTNESS_COMMAND, + 1.0f, // brightness (ignored) + true, // auto_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) { + common_hal_displayio_release_displays(); +} diff --git a/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h new file mode 100644 index 0000000000..6a18f996bb --- /dev/null +++ b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h @@ -0,0 +1,44 @@ +/* + * 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 "MORPHEANS MorphESP-240" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO16) +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO7) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO6) + +#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/morpheans_morphesp-240/mpconfigboard.mk b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk new file mode 100644 index 0000000000..aee744ca1a --- /dev/null +++ b/ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x303a +USB_PID = 0x80B7 +USB_PRODUCT = "MORPHESP-240" +USB_MANUFACTURER = "MORPHEANS" + +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_MODULE = wroom diff --git a/ports/espressif/boards/morpheans_morphesp-240/pins.c b/ports/espressif/boards/morpheans_morphesp-240/pins.c new file mode 100644 index 0000000000..427950b09e --- /dev/null +++ b/ports/espressif/boards/morpheans_morphesp-240/pins.c @@ -0,0 +1,60 @@ +#include "shared-bindings/board/__init__.h" +#include "shared-module/displayio/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_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_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_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_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_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) }, + + // Serial UART on breakout board + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO18) }, + + // I2C on breakout board. + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO7) }, + + // WS2812B RGB LED + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO16) }, + + // SPI on breakout board + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO13) }, + + // 1.3" 240x240 LCD ST7789 + { MP_ROM_QSTR(MP_QSTR_LCD_MOSI), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CLK), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_LCD_RST), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_LCD_D_C), MP_ROM_PTR(&pin_GPIO14) }, + { 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/morpheans_morphesp-240/sdkconfig b/ports/espressif/boards/morpheans_morphesp-240/sdkconfig new file mode 100644 index 0000000000..36ada0b0c7 --- /dev/null +++ b/ports/espressif/boards/morpheans_morphesp-240/sdkconfig @@ -0,0 +1,6 @@ +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="MORPHESP-240" +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# end of LWIP \ No newline at end of file diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/board.c b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/board.c new file mode 100644 index 0000000000..e40b6335bc --- /dev/null +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/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" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + 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/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h rename to ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk rename to ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.mk diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wroom/pins.c b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/pins.c new file mode 100644 index 0000000000..08a9e08f32 --- /dev/null +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/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_GPIO18) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/sdkconfig b/ports/espressif/boards/muselab_nanoesp32_s2_wroom/sdkconfig similarity index 100% rename from ports/esp32s2/boards/muselab_nanoesp32_s2_wroom/sdkconfig rename to ports/espressif/boards/muselab_nanoesp32_s2_wroom/sdkconfig diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/board.c b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/board.c new file mode 100644 index 0000000000..e40b6335bc --- /dev/null +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/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" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + 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/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h rename to ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.h diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk rename to ports/espressif/boards/muselab_nanoesp32_s2_wrover/mpconfigboard.mk diff --git a/ports/espressif/boards/muselab_nanoesp32_s2_wrover/pins.c b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/pins.c new file mode 100644 index 0000000000..08a9e08f32 --- /dev/null +++ b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/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_GPIO18) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/sdkconfig b/ports/espressif/boards/muselab_nanoesp32_s2_wrover/sdkconfig similarity index 100% rename from ports/esp32s2/boards/muselab_nanoesp32_s2_wrover/sdkconfig rename to ports/espressif/boards/muselab_nanoesp32_s2_wrover/sdkconfig diff --git a/ports/espressif/boards/odt_pixelwing_esp32_s2/board.c b/ports/espressif/boards/odt_pixelwing_esp32_s2/board.c new file mode 100644 index 0000000000..5abd1ce1b3 --- /dev/null +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/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" + +void board_init(void) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} diff --git a/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.h new file mode 100644 index 0000000000..46d1084d19 --- /dev/null +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/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 "Oak Dev Tech PixelWing ESP32S2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO45) + +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) + +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#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 new file mode 100644 index 0000000000..c3880b6ae9 --- /dev/null +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/mpconfigboard.mk @@ -0,0 +1,17 @@ +USB_VID = 0x1209 +USB_PID = 0x4DF0 +USB_PRODUCT = "Pixelwing ESP32S2" +USB_MANUFACTURER = "Oak Dev Tech" + +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_MODULE=wrover diff --git a/ports/espressif/boards/odt_pixelwing_esp32_s2/pins.c b/ports/espressif/boards/odt_pixelwing_esp32_s2/pins.c new file mode 100644 index 0000000000..f547c28def --- /dev/null +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/pins.c @@ -0,0 +1,16 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_GPIO33) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_GPIO34) }, + + { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, + + { 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/odt_pixelwing_esp32_s2/sdkconfig b/ports/espressif/boards/odt_pixelwing_esp32_s2/sdkconfig new file mode 100644 index 0000000000..f67a257854 --- /dev/null +++ b/ports/espressif/boards/odt_pixelwing_esp32_s2/sdkconfig @@ -0,0 +1,39 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# 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 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="PixelWing-ESP32S2" +# end of LWIP diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/board.c b/ports/espressif/boards/targett_module_clip_wroom/board.c similarity index 100% rename from ports/esp32s2/boards/targett_module_clip_wroom/board.c rename to ports/espressif/boards/targett_module_clip_wroom/board.c diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h rename to ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.h diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.mk rename to ports/espressif/boards/targett_module_clip_wroom/mpconfigboard.mk diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/pins.c b/ports/espressif/boards/targett_module_clip_wroom/pins.c similarity index 93% rename from ports/esp32s2/boards/targett_module_clip_wrover/pins.c rename to ports/espressif/boards/targett_module_clip_wroom/pins.c index a8ca8ba3ed..ee43af23df 100644 --- a/ports/esp32s2/boards/targett_module_clip_wrover/pins.c +++ b/ports/espressif/boards/targett_module_clip_wroom/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -45,4 +47,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { // { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO18) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/targett_module_clip_wroom/sdkconfig b/ports/espressif/boards/targett_module_clip_wroom/sdkconfig similarity index 100% rename from ports/esp32s2/boards/targett_module_clip_wroom/sdkconfig rename to ports/espressif/boards/targett_module_clip_wroom/sdkconfig diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/board.c b/ports/espressif/boards/targett_module_clip_wrover/board.c similarity index 100% rename from ports/esp32s2/boards/targett_module_clip_wrover/board.c rename to ports/espressif/boards/targett_module_clip_wrover/board.c diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.h rename to ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.h diff --git a/ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk b/ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/targett_module_clip_wrover/mpconfigboard.mk rename to ports/espressif/boards/targett_module_clip_wrover/mpconfigboard.mk diff --git a/ports/espressif/boards/targett_module_clip_wrover/pins.c b/ports/espressif/boards/targett_module_clip_wrover/pins.c new file mode 100644 index 0000000000..ee43af23df --- /dev/null +++ b/ports/espressif/boards/targett_module_clip_wrover/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_GPIO18) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/targett_module_clip_wrover/sdkconfig b/ports/espressif/boards/targett_module_clip_wrover/sdkconfig new file mode 100644 index 0000000000..9d8bbde967 --- /dev/null +++ b/ports/espressif/boards/targett_module_clip_wrover/sdkconfig @@ -0,0 +1,33 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 + +# +# 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 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/board.c b/ports/espressif/boards/unexpectedmaker_feathers2/board.c similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/board.c rename to ports/espressif/boards/unexpectedmaker_feathers2/board.c diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.h rename to ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.h diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk rename to ports/espressif/boards/unexpectedmaker_feathers2/mpconfigboard.mk diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c b/ports/espressif/boards/unexpectedmaker_feathers2/pins.c similarity index 96% rename from ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c rename to ports/espressif/boards/unexpectedmaker_feathers2/pins.c index a4967992a8..66657b2f4f 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2/pins.c +++ b/ports/espressif/boards/unexpectedmaker_feathers2/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, @@ -99,4 +101,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig b/ports/espressif/boards/unexpectedmaker_feathers2/sdkconfig similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig rename to ports/espressif/boards/unexpectedmaker_feathers2/sdkconfig diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/board.c b/ports/espressif/boards/unexpectedmaker_feathers2_neo/board.c similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_tinys2/board.c rename to ports/espressif/boards/unexpectedmaker_feathers2_neo/board.c diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.h new file mode 100644 index 0000000000..e6abbf2339 --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_feathers2_neo/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 "FeatherS2 Neo" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO40) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO39) +#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO0) +#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n") + +#define AUTORESET_DELAY_MS 500 + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) + +#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/unexpectedmaker_feathers2_neo/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk new file mode 100644 index 0000000000..a3ec63eaf3 --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_feathers2_neo/mpconfigboard.mk @@ -0,0 +1,20 @@ +USB_VID = 0x303A +USB_PID = 0x80B5 +USB_PRODUCT = "FeatherS2 Neo" +USB_MANUFACTURER = "UnexpectedMaker" + +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=4MB + +CIRCUITPY_BITBANG_NEOPIXEL = 1 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_neo/pins.c b/ports/espressif/boards/unexpectedmaker_feathers2_neo/pins.c new file mode 100644 index 0000000000..61bf1397a9 --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_feathers2_neo/pins.c @@ -0,0 +1,121 @@ +#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_D2), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6) }, + + { 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_D19), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36) }, + + { 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_SDO), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SDI), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO45) }, + + { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO38) }, + + + { MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, // Blue LED + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, // Blue LED + + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_VBAT), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_VBAT_SENSE), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2) }, + + // 5V present sense pin + { MP_ROM_QSTR(MP_QSTR_VBUS), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_MATRIX_POWER), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_MATRIX), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_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_feathers2_neo/sdkconfig b/ports/espressif/boards/unexpectedmaker_feathers2_neo/sdkconfig new file mode 100644 index 0000000000..453aeb1d2d --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_feathers2_neo/sdkconfig @@ -0,0 +1,39 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO=y +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=2097152 + +# +# 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 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="UMFeatherS2Neo" +# end of LWIP diff --git a/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/board.c b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/board.c new file mode 100644 index 0000000000..a0e399b1ef --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/board.c @@ -0,0 +1,61 @@ +/* + * 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) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ + + // 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); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h rename to ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.h diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk rename to ports/espressif/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/pins.c similarity index 95% rename from ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c rename to ports/espressif/boards/unexpectedmaker_feathers2_prerelease/pins.c index 57ac27aeb9..29ceffcdd5 100644 --- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/pins.c +++ b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17) }, @@ -97,4 +99,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/sdkconfig b/ports/espressif/boards/unexpectedmaker_feathers2_prerelease/sdkconfig similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/sdkconfig rename to ports/espressif/boards/unexpectedmaker_feathers2_prerelease/sdkconfig diff --git a/ports/espressif/boards/unexpectedmaker_tinys2/board.c b/ports/espressif/boards/unexpectedmaker_tinys2/board.c new file mode 100644 index 0000000000..a0e399b1ef --- /dev/null +++ b/ports/espressif/boards/unexpectedmaker_tinys2/board.c @@ -0,0 +1,61 @@ +/* + * 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) { + // USB + common_hal_never_reset_pin(&pin_GPIO19); + common_hal_never_reset_pin(&pin_GPIO20); + + // Debug UART + #ifdef DEBUG + common_hal_never_reset_pin(&pin_GPIO43); + common_hal_never_reset_pin(&pin_GPIO44); + #endif /* DEBUG */ + + // 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); +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} + +void board_deinit(void) { +} diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h b/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h rename to ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.h diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk b/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk similarity index 95% rename from ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk rename to ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk index 0d054c0cb0..91fa9dcbe3 100644 --- a/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk +++ b/ports/espressif/boards/unexpectedmaker_tinys2/mpconfigboard.mk @@ -16,5 +16,7 @@ CIRCUITPY_ESP_FLASH_SIZE=4MB CIRCUITPY_BITBANG_NEOPIXEL = 1 +CIRCUITPY_STAGE = 1 + # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c b/ports/espressif/boards/unexpectedmaker_tinys2/pins.c similarity index 95% rename from ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c rename to ports/espressif/boards/unexpectedmaker_tinys2/pins.c index 9815cf288d..d428e7c3c5 100644 --- a/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c +++ b/ports/espressif/boards/unexpectedmaker_tinys2/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_D4), MP_ROM_PTR(&pin_GPIO0) }, @@ -89,4 +91,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/sdkconfig b/ports/espressif/boards/unexpectedmaker_tinys2/sdkconfig similarity index 100% rename from ports/esp32s2/boards/unexpectedmaker_tinys2/sdkconfig rename to ports/espressif/boards/unexpectedmaker_tinys2/sdkconfig diff --git a/ports/esp32s2/cam.c b/ports/espressif/cam.c similarity index 100% rename from ports/esp32s2/cam.c rename to ports/espressif/cam.c diff --git a/ports/esp32s2/cam.h b/ports/espressif/cam.h similarity index 100% rename from ports/esp32s2/cam.h rename to ports/espressif/cam.h diff --git a/ports/esp32s2/certificates/README.md b/ports/espressif/certificates/README.md similarity index 100% rename from ports/esp32s2/certificates/README.md rename to ports/espressif/certificates/README.md diff --git a/ports/esp32s2/certificates/nina-fw b/ports/espressif/certificates/nina-fw similarity index 100% rename from ports/esp32s2/certificates/nina-fw rename to ports/espressif/certificates/nina-fw diff --git a/ports/esp32s2/common-hal/alarm/SleepMemory.c b/ports/espressif/common-hal/alarm/SleepMemory.c similarity index 100% rename from ports/esp32s2/common-hal/alarm/SleepMemory.c rename to ports/espressif/common-hal/alarm/SleepMemory.c diff --git a/ports/esp32s2/common-hal/alarm/SleepMemory.h b/ports/espressif/common-hal/alarm/SleepMemory.h similarity index 100% rename from ports/esp32s2/common-hal/alarm/SleepMemory.h rename to ports/espressif/common-hal/alarm/SleepMemory.h diff --git a/ports/esp32s2/common-hal/alarm/__init__.c b/ports/espressif/common-hal/alarm/__init__.c similarity index 94% rename from ports/esp32s2/common-hal/alarm/__init__.c rename to ports/espressif/common-hal/alarm/__init__.c index 7a977b093c..77dc2ff3f2 100644 --- a/ports/esp32s2/common-hal/alarm/__init__.c +++ b/ports/espressif/common-hal/alarm/__init__.c @@ -62,6 +62,11 @@ void alarm_reset(void) { esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_ALL); } +// This will be reset to false by full resets when bss is cleared. Otherwise, the +// reload is due to CircuitPython and the ESP wakeup cause will be stale. This +// can happen if USB is connected after a deep sleep. +STATIC bool soft_wakeup = false; + STATIC esp_sleep_wakeup_cause_t _get_wakeup_cause(void) { // First check if the modules remember what last woke up if (alarm_pin_pinalarm_woke_this_cycle()) { @@ -75,7 +80,11 @@ STATIC esp_sleep_wakeup_cause_t _get_wakeup_cause(void) { } // If waking from true deep sleep, modules will have lost their state, // so check the deep wakeup cause manually - return esp_sleep_get_wakeup_cause(); + if (!soft_wakeup) { + soft_wakeup = true; + return esp_sleep_get_wakeup_cause(); + } + return ESP_SLEEP_WAKEUP_UNDEFINED; } bool common_hal_alarm_woken_from_sleep(void) { diff --git a/ports/esp32s2/common-hal/alarm/__init__.h b/ports/espressif/common-hal/alarm/__init__.h similarity index 100% rename from ports/esp32s2/common-hal/alarm/__init__.h rename to ports/espressif/common-hal/alarm/__init__.h diff --git a/ports/esp32s2/common-hal/alarm/pin/PinAlarm.c b/ports/espressif/common-hal/alarm/pin/PinAlarm.c similarity index 100% rename from ports/esp32s2/common-hal/alarm/pin/PinAlarm.c rename to ports/espressif/common-hal/alarm/pin/PinAlarm.c diff --git a/ports/esp32s2/common-hal/alarm/pin/PinAlarm.h b/ports/espressif/common-hal/alarm/pin/PinAlarm.h similarity index 100% rename from ports/esp32s2/common-hal/alarm/pin/PinAlarm.h rename to ports/espressif/common-hal/alarm/pin/PinAlarm.h diff --git a/ports/esp32s2/common-hal/alarm/time/TimeAlarm.c b/ports/espressif/common-hal/alarm/time/TimeAlarm.c similarity index 100% rename from ports/esp32s2/common-hal/alarm/time/TimeAlarm.c rename to ports/espressif/common-hal/alarm/time/TimeAlarm.c diff --git a/ports/esp32s2/common-hal/alarm/time/TimeAlarm.h b/ports/espressif/common-hal/alarm/time/TimeAlarm.h similarity index 100% rename from ports/esp32s2/common-hal/alarm/time/TimeAlarm.h rename to ports/espressif/common-hal/alarm/time/TimeAlarm.h diff --git a/ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c b/ports/espressif/common-hal/alarm/touch/TouchAlarm.c similarity index 100% rename from ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c rename to ports/espressif/common-hal/alarm/touch/TouchAlarm.c diff --git a/ports/esp32s2/common-hal/alarm/touch/TouchAlarm.h b/ports/espressif/common-hal/alarm/touch/TouchAlarm.h similarity index 100% rename from ports/esp32s2/common-hal/alarm/touch/TouchAlarm.h rename to ports/espressif/common-hal/alarm/touch/TouchAlarm.h diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.c b/ports/espressif/common-hal/analogio/AnalogIn.c similarity index 100% rename from ports/esp32s2/common-hal/analogio/AnalogIn.c rename to ports/espressif/common-hal/analogio/AnalogIn.c diff --git a/ports/esp32s2/common-hal/analogio/AnalogIn.h b/ports/espressif/common-hal/analogio/AnalogIn.h similarity index 100% rename from ports/esp32s2/common-hal/analogio/AnalogIn.h rename to ports/espressif/common-hal/analogio/AnalogIn.h diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.c b/ports/espressif/common-hal/analogio/AnalogOut.c similarity index 100% rename from ports/esp32s2/common-hal/analogio/AnalogOut.c rename to ports/espressif/common-hal/analogio/AnalogOut.c diff --git a/ports/esp32s2/common-hal/analogio/AnalogOut.h b/ports/espressif/common-hal/analogio/AnalogOut.h similarity index 100% rename from ports/esp32s2/common-hal/analogio/AnalogOut.h rename to ports/espressif/common-hal/analogio/AnalogOut.h diff --git a/ports/esp32s2/common-hal/analogio/__init__.c b/ports/espressif/common-hal/analogio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/analogio/__init__.c rename to ports/espressif/common-hal/analogio/__init__.c diff --git a/ports/esp32s2/common-hal/audiobusio/I2SOut.c b/ports/espressif/common-hal/audiobusio/I2SOut.c similarity index 100% rename from ports/esp32s2/common-hal/audiobusio/I2SOut.c rename to ports/espressif/common-hal/audiobusio/I2SOut.c diff --git a/ports/esp32s2/common-hal/audiobusio/I2SOut.h b/ports/espressif/common-hal/audiobusio/I2SOut.h similarity index 100% rename from ports/esp32s2/common-hal/audiobusio/I2SOut.h rename to ports/espressif/common-hal/audiobusio/I2SOut.h diff --git a/ports/esp32s2/common-hal/audiobusio/PDMIn.c b/ports/espressif/common-hal/audiobusio/PDMIn.c similarity index 100% rename from ports/esp32s2/common-hal/audiobusio/PDMIn.c rename to ports/espressif/common-hal/audiobusio/PDMIn.c diff --git a/ports/esp32s2/common-hal/audiobusio/PDMIn.h b/ports/espressif/common-hal/audiobusio/PDMIn.h similarity index 100% rename from ports/esp32s2/common-hal/audiobusio/PDMIn.h rename to ports/espressif/common-hal/audiobusio/PDMIn.h diff --git a/ports/esp32s2/common-hal/audiobusio/__init__.c b/ports/espressif/common-hal/audiobusio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/audiobusio/__init__.c rename to ports/espressif/common-hal/audiobusio/__init__.c diff --git a/ports/esp32s2/common-hal/audiobusio/__init__.h b/ports/espressif/common-hal/audiobusio/__init__.h similarity index 100% rename from ports/esp32s2/common-hal/audiobusio/__init__.h rename to ports/espressif/common-hal/audiobusio/__init__.h diff --git a/ports/esp32s2/common-hal/board/__init__.c b/ports/espressif/common-hal/board/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/board/__init__.c rename to ports/espressif/common-hal/board/__init__.c diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/espressif/common-hal/busio/I2C.c similarity index 93% rename from ports/esp32s2/common-hal/busio/I2C.c rename to ports/espressif/common-hal/busio/I2C.c index 8052715ae9..be80538582 100644 --- a/ports/esp32s2/common-hal/busio/I2C.c +++ b/ports/espressif/common-hal/busio/I2C.c @@ -78,8 +78,13 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, gpio_pulldown_dis(sda->number); gpio_pulldown_dis(scl->number); + #if CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP + gpio_pullup_en(sda->number); + gpio_pullup_en(scl->number); + #endif + // We must pull up within 3us to achieve 400khz. - common_hal_mcu_delay_us(3); + common_hal_mcu_delay_us((1200000 + frequency - 1) / frequency); if (gpio_get_level(sda->number) == 0 || gpio_get_level(scl->number) == 0) { reset_pin_number(sda->number); @@ -88,7 +93,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, } #endif - self->xSemaphore = xSemaphoreCreateMutexStatic(&self->xSemaphoreBuffer); + self->xSemaphore = xSemaphoreCreateMutex(); if (self->xSemaphore == NULL) { mp_raise_RuntimeError(translate("Unable to create lock")); } @@ -112,8 +117,13 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, .mode = I2C_MODE_MASTER, .sda_io_num = self->sda_pin->number, .scl_io_num = self->scl_pin->number, + #if CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP + .sda_pullup_en = GPIO_PULLUP_ENABLE, /*!< Internal GPIO pull mode for I2C sda signal*/ + .scl_pullup_en = GPIO_PULLUP_ENABLE, /*!< Internal GPIO pull mode for I2C scl signal*/ + #else .sda_pullup_en = GPIO_PULLUP_DISABLE, /*!< Internal GPIO pull mode for I2C sda signal*/ .scl_pullup_en = GPIO_PULLUP_DISABLE, /*!< Internal GPIO pull mode for I2C scl signal*/ + #endif .master = { .clk_speed = frequency, diff --git a/ports/esp32s2/common-hal/busio/I2C.h b/ports/espressif/common-hal/busio/I2C.h similarity index 97% rename from ports/esp32s2/common-hal/busio/I2C.h rename to ports/espressif/common-hal/busio/I2C.h index d699b84ef1..0844be6b22 100644 --- a/ports/esp32s2/common-hal/busio/I2C.h +++ b/ports/espressif/common-hal/busio/I2C.h @@ -40,7 +40,6 @@ typedef struct { const mcu_pin_obj_t *sda_pin; i2c_port_t i2c_num; SemaphoreHandle_t xSemaphore; - StaticSemaphore_t xSemaphoreBuffer; bool has_lock; } busio_i2c_obj_t; diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/espressif/common-hal/busio/SPI.c similarity index 100% rename from ports/esp32s2/common-hal/busio/SPI.c rename to ports/espressif/common-hal/busio/SPI.c diff --git a/ports/esp32s2/common-hal/busio/SPI.h b/ports/espressif/common-hal/busio/SPI.h similarity index 100% rename from ports/esp32s2/common-hal/busio/SPI.h rename to ports/espressif/common-hal/busio/SPI.h diff --git a/ports/esp32s2/common-hal/busio/UART.c b/ports/espressif/common-hal/busio/UART.c similarity index 100% rename from ports/esp32s2/common-hal/busio/UART.c rename to ports/espressif/common-hal/busio/UART.c diff --git a/ports/esp32s2/common-hal/busio/UART.h b/ports/espressif/common-hal/busio/UART.h similarity index 100% rename from ports/esp32s2/common-hal/busio/UART.h rename to ports/espressif/common-hal/busio/UART.h diff --git a/ports/esp32s2/common-hal/busio/__init__.c b/ports/espressif/common-hal/busio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/busio/__init__.c rename to ports/espressif/common-hal/busio/__init__.c diff --git a/ports/esp32s2/common-hal/canio/CAN.c b/ports/espressif/common-hal/canio/CAN.c similarity index 100% rename from ports/esp32s2/common-hal/canio/CAN.c rename to ports/espressif/common-hal/canio/CAN.c diff --git a/ports/esp32s2/common-hal/canio/CAN.h b/ports/espressif/common-hal/canio/CAN.h similarity index 100% rename from ports/esp32s2/common-hal/canio/CAN.h rename to ports/espressif/common-hal/canio/CAN.h diff --git a/ports/esp32s2/common-hal/canio/Listener.c b/ports/espressif/common-hal/canio/Listener.c similarity index 96% rename from ports/esp32s2/common-hal/canio/Listener.c rename to ports/espressif/common-hal/canio/Listener.c index 5e968f2393..8100261743 100644 --- a/ports/esp32s2/common-hal/canio/Listener.c +++ b/ports/espressif/common-hal/canio/Listener.c @@ -151,6 +151,11 @@ mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) { if (supervisor_ticks_ms64() > deadline) { return NULL; } + RUN_BACKGROUND_TASKS; + // Allow user to break out of a timeout with a KeyboardInterrupt. + if (mp_hal_is_interrupted()) { + return NULL; + } } while (!common_hal_canio_listener_in_waiting(self)); } diff --git a/ports/esp32s2/common-hal/canio/Listener.h b/ports/espressif/common-hal/canio/Listener.h similarity index 100% rename from ports/esp32s2/common-hal/canio/Listener.h rename to ports/espressif/common-hal/canio/Listener.h diff --git a/ports/esp32s2/common-hal/canio/__init__.c b/ports/espressif/common-hal/canio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/canio/__init__.c rename to ports/espressif/common-hal/canio/__init__.c diff --git a/ports/esp32s2/common-hal/canio/__init__.h b/ports/espressif/common-hal/canio/__init__.h similarity index 100% rename from ports/esp32s2/common-hal/canio/__init__.h rename to ports/espressif/common-hal/canio/__init__.h diff --git a/ports/esp32s2/common-hal/countio/Counter.c b/ports/espressif/common-hal/countio/Counter.c similarity index 100% rename from ports/esp32s2/common-hal/countio/Counter.c rename to ports/espressif/common-hal/countio/Counter.c diff --git a/ports/esp32s2/common-hal/countio/Counter.h b/ports/espressif/common-hal/countio/Counter.h similarity index 100% rename from ports/esp32s2/common-hal/countio/Counter.h rename to ports/espressif/common-hal/countio/Counter.h diff --git a/ports/esp32s2/common-hal/countio/__init__.c b/ports/espressif/common-hal/countio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/countio/__init__.c rename to ports/espressif/common-hal/countio/__init__.c diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.c b/ports/espressif/common-hal/digitalio/DigitalInOut.c similarity index 100% rename from ports/esp32s2/common-hal/digitalio/DigitalInOut.c rename to ports/espressif/common-hal/digitalio/DigitalInOut.c diff --git a/ports/esp32s2/common-hal/digitalio/DigitalInOut.h b/ports/espressif/common-hal/digitalio/DigitalInOut.h similarity index 100% rename from ports/esp32s2/common-hal/digitalio/DigitalInOut.h rename to ports/espressif/common-hal/digitalio/DigitalInOut.h diff --git a/ports/esp32s2/common-hal/digitalio/__init__.c b/ports/espressif/common-hal/digitalio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/digitalio/__init__.c rename to ports/espressif/common-hal/digitalio/__init__.c diff --git a/ports/esp32s2/common-hal/dualbank/__init__.c b/ports/espressif/common-hal/dualbank/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/dualbank/__init__.c rename to ports/espressif/common-hal/dualbank/__init__.c diff --git a/ports/esp32s2/common-hal/dualbank/__init__.h b/ports/espressif/common-hal/dualbank/__init__.h similarity index 100% rename from ports/esp32s2/common-hal/dualbank/__init__.h rename to ports/espressif/common-hal/dualbank/__init__.h diff --git a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.c b/ports/espressif/common-hal/frequencyio/FrequencyIn.c similarity index 100% rename from ports/esp32s2/common-hal/frequencyio/FrequencyIn.c rename to ports/espressif/common-hal/frequencyio/FrequencyIn.c diff --git a/ports/esp32s2/common-hal/frequencyio/FrequencyIn.h b/ports/espressif/common-hal/frequencyio/FrequencyIn.h similarity index 100% rename from ports/esp32s2/common-hal/frequencyio/FrequencyIn.h rename to ports/espressif/common-hal/frequencyio/FrequencyIn.h diff --git a/ports/esp32s2/common-hal/frequencyio/__init__.c b/ports/espressif/common-hal/frequencyio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/frequencyio/__init__.c rename to ports/espressif/common-hal/frequencyio/__init__.c diff --git a/ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c b/ports/espressif/common-hal/imagecapture/ParallelImageCapture.c similarity index 100% rename from ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.c rename to ports/espressif/common-hal/imagecapture/ParallelImageCapture.c diff --git a/ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.h b/ports/espressif/common-hal/imagecapture/ParallelImageCapture.h similarity index 100% rename from ports/esp32s2/common-hal/imagecapture/ParallelImageCapture.h rename to ports/espressif/common-hal/imagecapture/ParallelImageCapture.h diff --git a/ports/esp32s2/common-hal/imagecapture/__init__.c b/ports/espressif/common-hal/imagecapture/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/imagecapture/__init__.c rename to ports/espressif/common-hal/imagecapture/__init__.c diff --git a/ports/esp32s2/common-hal/imagecapture/__init__.h b/ports/espressif/common-hal/imagecapture/__init__.h similarity index 100% rename from ports/esp32s2/common-hal/imagecapture/__init__.h rename to ports/espressif/common-hal/imagecapture/__init__.h diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/espressif/common-hal/microcontroller/Pin.c similarity index 100% rename from ports/esp32s2/common-hal/microcontroller/Pin.c rename to ports/espressif/common-hal/microcontroller/Pin.c diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.h b/ports/espressif/common-hal/microcontroller/Pin.h similarity index 100% rename from ports/esp32s2/common-hal/microcontroller/Pin.h rename to ports/espressif/common-hal/microcontroller/Pin.h diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.c b/ports/espressif/common-hal/microcontroller/Processor.c similarity index 100% rename from ports/esp32s2/common-hal/microcontroller/Processor.c rename to ports/espressif/common-hal/microcontroller/Processor.c diff --git a/ports/esp32s2/common-hal/microcontroller/Processor.h b/ports/espressif/common-hal/microcontroller/Processor.h similarity index 100% rename from ports/esp32s2/common-hal/microcontroller/Processor.h rename to ports/espressif/common-hal/microcontroller/Processor.h diff --git a/ports/esp32s2/common-hal/microcontroller/__init__.c b/ports/espressif/common-hal/microcontroller/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/microcontroller/__init__.c rename to ports/espressif/common-hal/microcontroller/__init__.c diff --git a/ports/esp32s2/common-hal/neopixel_write/__init__.c b/ports/espressif/common-hal/neopixel_write/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/neopixel_write/__init__.c rename to ports/espressif/common-hal/neopixel_write/__init__.c diff --git a/ports/esp32s2/common-hal/nvm/ByteArray.c b/ports/espressif/common-hal/nvm/ByteArray.c similarity index 57% rename from ports/esp32s2/common-hal/nvm/ByteArray.c rename to ports/espressif/common-hal/nvm/ByteArray.c index 3130873792..6eeed72e2e 100644 --- a/ports/esp32s2/common-hal/nvm/ByteArray.c +++ b/ports/espressif/common-hal/nvm/ByteArray.c @@ -24,9 +24,13 @@ * THE SOFTWARE. */ +#include + #include "common-hal/nvm/ByteArray.h" +#include "bindings/espidf/__init__.h" #include "py/runtime.h" +#include "py/gc.h" #include "nvs_flash.h" uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { @@ -50,48 +54,94 @@ static void get_nvs_handle(nvs_handle_t *nvs_handle) { } } -bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, - uint32_t start_index, uint8_t *values, uint32_t len) { - char index[9]; - - // start nvs - nvs_handle_t handle; - get_nvs_handle(&handle); - - // stage flash changes - for (uint32_t i = 0; i < len; i++) { - sprintf(index, "%i", start_index + i); - if (nvs_set_u8(handle, (const char *)index, values[i]) != ESP_OK) { - return false; - } +// Get a copy of the nvm data, or an array initialized to all 0 bytes if it is not present +static esp_err_t get_bytes(nvs_handle_t handle, uint8_t **buf_out) { + size_t size; + void *buf; + esp_err_t result = nvs_get_blob(handle, "data", NULL, &size); + if (result == ESP_ERR_NVS_NOT_FOUND) { + size = CIRCUITPY_INTERNAL_NVM_SIZE; + } else if (result != ESP_OK) { + *buf_out = NULL; + return result; } - - // commit flash changes - if (nvs_commit(handle) != ESP_OK) { - return false; + buf = gc_alloc(size, 0, false); // this SHOULD be the same as + if (result == ESP_OK) { + result = nvs_get_blob(handle, "data", buf, &size); + } else { + result = ESP_OK; } - - // close nvs - nvs_close(handle); - return true; + *buf_out = buf; + return result; } -void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, - uint32_t start_index, uint32_t len, uint8_t *values) { - char index[9]; +bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, + uint32_t start_index, uint8_t *values, uint32_t len) { // start nvs nvs_handle_t handle; get_nvs_handle(&handle); // get from flash - for (uint32_t i = 0; i < len; i++) { - sprintf(index, "%i", start_index + i); - if (nvs_get_u8(handle, (const char *)index, &values[i]) != ESP_OK) { - mp_raise_RuntimeError(translate("NVS Error")); - } + uint8_t *buf = NULL; + esp_err_t result = get_bytes(handle, &buf); + if (result != ESP_OK) { + gc_free(buf); + nvs_close(handle); + raise_esp_error(result); + } + + // erase old data, including 6.3.x incompatible data + result = nvs_erase_all(handle); + if (result != ESP_OK) { + gc_free(buf); + nvs_close(handle); + raise_esp_error(result); + } + + // make our modification + memcpy(buf + start_index, values, len); + + result = nvs_set_blob(handle, "data", buf, CIRCUITPY_INTERNAL_NVM_SIZE); + if (result != ESP_OK) { + gc_free(buf); + nvs_close(handle); + raise_esp_error(result); + } + + result = nvs_commit(handle); + if (result != ESP_OK) { + gc_free(buf); + nvs_close(handle); + raise_esp_error(result); } // close nvs + gc_free(buf); + nvs_close(handle); + return true; +} + +void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, + uint32_t start_index, uint32_t len, uint8_t *values) { + + // start nvs + nvs_handle_t handle; + get_nvs_handle(&handle); + + // get from flash + uint8_t *buf; + esp_err_t result = get_bytes(handle, &buf); + if (result != ESP_OK) { + gc_free(buf); + nvs_close(handle); + raise_esp_error(result); + } + + // copy the subset of data requested + memcpy(values, buf + start_index, len); + + // close nvs + gc_free(buf); nvs_close(handle); } diff --git a/ports/esp32s2/common-hal/nvm/ByteArray.h b/ports/espressif/common-hal/nvm/ByteArray.h similarity index 100% rename from ports/esp32s2/common-hal/nvm/ByteArray.h rename to ports/espressif/common-hal/nvm/ByteArray.h diff --git a/ports/esp32s2/common-hal/nvm/__init__.c b/ports/espressif/common-hal/nvm/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/nvm/__init__.c rename to ports/espressif/common-hal/nvm/__init__.c diff --git a/ports/esp32s2/common-hal/os/__init__.c b/ports/espressif/common-hal/os/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/os/__init__.c rename to ports/espressif/common-hal/os/__init__.c diff --git a/ports/esp32s2/common-hal/displayio/ParallelBus.c b/ports/espressif/common-hal/paralleldisplay/ParallelBus.c similarity index 90% rename from ports/esp32s2/common-hal/displayio/ParallelBus.c rename to ports/espressif/common-hal/paralleldisplay/ParallelBus.c index cbe093164f..befd836247 100644 --- a/ports/esp32s2/common-hal/displayio/ParallelBus.c +++ b/ports/espressif/common-hal/paralleldisplay/ParallelBus.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/displayio/ParallelBus.h" +#include "shared-bindings/paralleldisplay/ParallelBus.h" #include @@ -38,7 +38,7 @@ * - data0 pin must be byte aligned */ -void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *self, +void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbus_obj_t *self, const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select, const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) { @@ -120,7 +120,7 @@ void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *sel common_hal_digitalio_digitalinout_construct(&self->reset, reset); common_hal_digitalio_digitalinout_switch_to_output(&self->reset, true, DRIVE_MODE_PUSH_PULL); never_reset_pin_number(reset->number); - common_hal_displayio_parallelbus_reset(self); + common_hal_paralleldisplay_parallelbus_reset(self); } never_reset_pin_number(command->number); @@ -133,7 +133,7 @@ void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *sel } -void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self) { +void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_obj_t *self) { /* SNIP - same as from SAMD and NRF ports */ for (uint8_t i = 0; i < 8; i++) { reset_pin_number(self->data0_pin + i); @@ -146,9 +146,9 @@ void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self) reset_pin_number(self->reset.pin->number); } -bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { +bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) { /* SNIP - same as from SAMD and NRF ports */ - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); if (self->reset.base.type == &mp_type_NoneType) { return false; } @@ -160,21 +160,21 @@ bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { } -bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { +bool common_hal_paralleldisplay_parallelbus_bus_free(mp_obj_t obj) { /* SNIP - same as from SAMD and NRF ports */ return true; } -bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { +bool common_hal_paralleldisplay_parallelbus_begin_transaction(mp_obj_t obj) { /* SNIP - same as from SAMD and NRF ports */ - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->chip_select, false); return true; } -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, +void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->command, byte_type == DISPLAY_DATA); uint32_t *clear_write = self->write_clear_register; @@ -220,8 +220,8 @@ void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byt } -void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { +void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t obj) { /* SNIP - same as from SAMD and NRF ports */ - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->chip_select, true); } diff --git a/ports/esp32s2/common-hal/displayio/ParallelBus.h b/ports/espressif/common-hal/paralleldisplay/ParallelBus.h similarity index 89% rename from ports/esp32s2/common-hal/displayio/ParallelBus.h rename to ports/espressif/common-hal/paralleldisplay/ParallelBus.h index 59eb64f34d..8758b8fcca 100644 --- a/ports/esp32s2/common-hal/displayio/ParallelBus.h +++ b/ports/espressif/common-hal/paralleldisplay/ParallelBus.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DISPLAYIO_PARALLELBUS_H -#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H +#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H #include "common-hal/digitalio/DigitalInOut.h" @@ -42,6 +42,6 @@ typedef struct { uint32_t *write_set_register; // pointer to the write group for setting the write bit to latch the data on the LCD uint32_t *write_clear_register; // pointer to the write group for clearing the write bit to latch the data on the LCD uint32_t write_mask; // bit mask for the single bit for the write pin register -} displayio_parallelbus_obj_t; +} paralleldisplay_parallelbus_obj_t; -#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H diff --git a/ports/esp32s2/common-hal/ps2io/Ps2.c b/ports/espressif/common-hal/ps2io/Ps2.c similarity index 100% rename from ports/esp32s2/common-hal/ps2io/Ps2.c rename to ports/espressif/common-hal/ps2io/Ps2.c diff --git a/ports/esp32s2/common-hal/ps2io/Ps2.h b/ports/espressif/common-hal/ps2io/Ps2.h similarity index 100% rename from ports/esp32s2/common-hal/ps2io/Ps2.h rename to ports/espressif/common-hal/ps2io/Ps2.h diff --git a/ports/esp32s2/common-hal/ps2io/__init__.c b/ports/espressif/common-hal/ps2io/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/ps2io/__init__.c rename to ports/espressif/common-hal/ps2io/__init__.c diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.c b/ports/espressif/common-hal/pulseio/PulseIn.c similarity index 100% rename from ports/esp32s2/common-hal/pulseio/PulseIn.c rename to ports/espressif/common-hal/pulseio/PulseIn.c diff --git a/ports/esp32s2/common-hal/pulseio/PulseIn.h b/ports/espressif/common-hal/pulseio/PulseIn.h similarity index 100% rename from ports/esp32s2/common-hal/pulseio/PulseIn.h rename to ports/espressif/common-hal/pulseio/PulseIn.h diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.c b/ports/espressif/common-hal/pulseio/PulseOut.c similarity index 93% rename from ports/esp32s2/common-hal/pulseio/PulseOut.c rename to ports/espressif/common-hal/pulseio/PulseOut.c index d3490d1810..b762cefb84 100644 --- a/ports/esp32s2/common-hal/pulseio/PulseOut.c +++ b/ports/espressif/common-hal/pulseio/PulseOut.c @@ -32,13 +32,9 @@ // Requires rmt.c void esp32s2_peripherals_reset_all(void) to reset void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, - const pwmio_pwmout_obj_t *carrier, const mcu_pin_obj_t *pin, uint32_t frequency, uint16_t duty_cycle) { - if (carrier || !pin || !frequency) { - mp_raise_NotImplementedError(translate("Port does not accept PWM carrier. Pass a pin, frequency and duty cycle instead")); - } rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt(); if (channel == RMT_CHANNEL_MAX) { diff --git a/ports/esp32s2/common-hal/pulseio/PulseOut.h b/ports/espressif/common-hal/pulseio/PulseOut.h similarity index 100% rename from ports/esp32s2/common-hal/pulseio/PulseOut.h rename to ports/espressif/common-hal/pulseio/PulseOut.h diff --git a/ports/esp32s2/common-hal/pulseio/__init__.c b/ports/espressif/common-hal/pulseio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/pulseio/__init__.c rename to ports/espressif/common-hal/pulseio/__init__.c diff --git a/ports/esp32s2/common-hal/pwmio/PWMOut.c b/ports/espressif/common-hal/pwmio/PWMOut.c similarity index 97% rename from ports/esp32s2/common-hal/pwmio/PWMOut.c rename to ports/espressif/common-hal/pwmio/PWMOut.c index 7b3c005ff4..71cf5c19d0 100644 --- a/ports/esp32s2/common-hal/pwmio/PWMOut.c +++ b/ports/espressif/common-hal/pwmio/PWMOut.c @@ -152,7 +152,7 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, varfreq_timers[timer_index] = true; } self->variable_frequency = variable_frequency; - self->pin_number = pin->number; + self->pin = pin; self->deinited = false; self->duty_resolution = duty_bits; claim_pin(pin); @@ -167,7 +167,7 @@ void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { never_reset_tim[self->tim_handle.timer_num] = true; never_reset_chan[self->chan_handle.channel] = true; - never_reset_pin_number(self->pin_number); + never_reset_pin_number(self->pin->number); } void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { @@ -202,7 +202,7 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) { // if timer isn't varfreq this will be off aleady varfreq_timers[self->tim_handle.timer_num] = false; } - reset_pin_number(self->pin_number); + common_hal_reset_pin(self->pin); self->deinited = true; } @@ -232,3 +232,7 @@ uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t *self) { bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t *self) { return self->variable_frequency; } + +const mcu_pin_obj_t *common_hal_pwmio_pwmout_get_pin(pwmio_pwmout_obj_t *self) { + return self->pin; +} diff --git a/ports/esp32s2/common-hal/pwmio/PWMOut.h b/ports/espressif/common-hal/pwmio/PWMOut.h similarity index 98% rename from ports/esp32s2/common-hal/pwmio/PWMOut.h rename to ports/espressif/common-hal/pwmio/PWMOut.h index 9480b8885a..f94325248b 100644 --- a/ports/esp32s2/common-hal/pwmio/PWMOut.h +++ b/ports/espressif/common-hal/pwmio/PWMOut.h @@ -34,7 +34,7 @@ typedef struct { mp_obj_base_t base; ledc_timer_config_t tim_handle; ledc_channel_config_t chan_handle; - uint16_t pin_number; + const mcu_pin_obj_t *pin; uint8_t duty_resolution; bool variable_frequency : 1; bool deinited : 1; diff --git a/ports/esp32s2/common-hal/pwmio/__init__.c b/ports/espressif/common-hal/pwmio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/pwmio/__init__.c rename to ports/espressif/common-hal/pwmio/__init__.c diff --git a/ports/esp32s2/common-hal/rgbmatrix/RGBMatrix.c b/ports/espressif/common-hal/rgbmatrix/RGBMatrix.c similarity index 100% rename from ports/esp32s2/common-hal/rgbmatrix/RGBMatrix.c rename to ports/espressif/common-hal/rgbmatrix/RGBMatrix.c diff --git a/ports/esp32s2/common-hal/rgbmatrix/RGBMatrix.h b/ports/espressif/common-hal/rgbmatrix/RGBMatrix.h similarity index 100% rename from ports/esp32s2/common-hal/rgbmatrix/RGBMatrix.h rename to ports/espressif/common-hal/rgbmatrix/RGBMatrix.h diff --git a/ports/esp32s2/common-hal/rgbmatrix/__init__.c b/ports/espressif/common-hal/rgbmatrix/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/rgbmatrix/__init__.c rename to ports/espressif/common-hal/rgbmatrix/__init__.c diff --git a/ports/esp32s2/common-hal/rgbmatrix/__init__.h b/ports/espressif/common-hal/rgbmatrix/__init__.h similarity index 100% rename from ports/esp32s2/common-hal/rgbmatrix/__init__.h rename to ports/espressif/common-hal/rgbmatrix/__init__.h diff --git a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.c similarity index 100% rename from ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c rename to ports/espressif/common-hal/rotaryio/IncrementalEncoder.c diff --git a/ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h b/ports/espressif/common-hal/rotaryio/IncrementalEncoder.h similarity index 100% rename from ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.h rename to ports/espressif/common-hal/rotaryio/IncrementalEncoder.h diff --git a/ports/esp32s2/common-hal/rotaryio/__init__.c b/ports/espressif/common-hal/rotaryio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/rotaryio/__init__.c rename to ports/espressif/common-hal/rotaryio/__init__.c diff --git a/ports/esp32s2/common-hal/rtc/RTC.c b/ports/espressif/common-hal/rtc/RTC.c similarity index 100% rename from ports/esp32s2/common-hal/rtc/RTC.c rename to ports/espressif/common-hal/rtc/RTC.c diff --git a/ports/esp32s2/common-hal/rtc/RTC.h b/ports/espressif/common-hal/rtc/RTC.h similarity index 100% rename from ports/esp32s2/common-hal/rtc/RTC.h rename to ports/espressif/common-hal/rtc/RTC.h diff --git a/ports/esp32s2/common-hal/rtc/__init__.c b/ports/espressif/common-hal/rtc/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/rtc/__init__.c rename to ports/espressif/common-hal/rtc/__init__.c diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/espressif/common-hal/socketpool/Socket.c similarity index 100% rename from ports/esp32s2/common-hal/socketpool/Socket.c rename to ports/espressif/common-hal/socketpool/Socket.c diff --git a/ports/esp32s2/common-hal/socketpool/Socket.h b/ports/espressif/common-hal/socketpool/Socket.h similarity index 100% rename from ports/esp32s2/common-hal/socketpool/Socket.h rename to ports/espressif/common-hal/socketpool/Socket.h diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.c b/ports/espressif/common-hal/socketpool/SocketPool.c similarity index 100% rename from ports/esp32s2/common-hal/socketpool/SocketPool.c rename to ports/espressif/common-hal/socketpool/SocketPool.c diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.h b/ports/espressif/common-hal/socketpool/SocketPool.h similarity index 100% rename from ports/esp32s2/common-hal/socketpool/SocketPool.h rename to ports/espressif/common-hal/socketpool/SocketPool.h diff --git a/ports/esp32s2/common-hal/socketpool/__init__.c b/ports/espressif/common-hal/socketpool/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/socketpool/__init__.c rename to ports/espressif/common-hal/socketpool/__init__.c diff --git a/ports/esp32s2/common-hal/socketpool/__init__.h b/ports/espressif/common-hal/socketpool/__init__.h similarity index 100% rename from ports/esp32s2/common-hal/socketpool/__init__.h rename to ports/espressif/common-hal/socketpool/__init__.h diff --git a/ports/esp32s2/common-hal/ssl/SSLContext.c b/ports/espressif/common-hal/ssl/SSLContext.c similarity index 100% rename from ports/esp32s2/common-hal/ssl/SSLContext.c rename to ports/espressif/common-hal/ssl/SSLContext.c diff --git a/ports/esp32s2/common-hal/ssl/SSLContext.h b/ports/espressif/common-hal/ssl/SSLContext.h similarity index 100% rename from ports/esp32s2/common-hal/ssl/SSLContext.h rename to ports/espressif/common-hal/ssl/SSLContext.h diff --git a/ports/esp32s2/common-hal/ssl/SSLSocket.c b/ports/espressif/common-hal/ssl/SSLSocket.c similarity index 100% rename from ports/esp32s2/common-hal/ssl/SSLSocket.c rename to ports/espressif/common-hal/ssl/SSLSocket.c diff --git a/ports/esp32s2/common-hal/ssl/SSLSocket.h b/ports/espressif/common-hal/ssl/SSLSocket.h similarity index 100% rename from ports/esp32s2/common-hal/ssl/SSLSocket.h rename to ports/espressif/common-hal/ssl/SSLSocket.h diff --git a/ports/esp32s2/common-hal/ssl/__init__.c b/ports/espressif/common-hal/ssl/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/ssl/__init__.c rename to ports/espressif/common-hal/ssl/__init__.c diff --git a/ports/esp32s2/common-hal/ssl/__init__.h b/ports/espressif/common-hal/ssl/__init__.h similarity index 100% rename from ports/esp32s2/common-hal/ssl/__init__.h rename to ports/espressif/common-hal/ssl/__init__.h diff --git a/ports/esp32s2/common-hal/supervisor/Runtime.c b/ports/espressif/common-hal/supervisor/Runtime.c similarity index 100% rename from ports/esp32s2/common-hal/supervisor/Runtime.c rename to ports/espressif/common-hal/supervisor/Runtime.c diff --git a/ports/esp32s2/common-hal/supervisor/Runtime.h b/ports/espressif/common-hal/supervisor/Runtime.h similarity index 100% rename from ports/esp32s2/common-hal/supervisor/Runtime.h rename to ports/espressif/common-hal/supervisor/Runtime.h diff --git a/ports/esp32s2/common-hal/supervisor/__init__.c b/ports/espressif/common-hal/supervisor/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/supervisor/__init__.c rename to ports/espressif/common-hal/supervisor/__init__.c diff --git a/ports/esp32s2/common-hal/time/__init__.c b/ports/espressif/common-hal/time/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/time/__init__.c rename to ports/espressif/common-hal/time/__init__.c diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.c b/ports/espressif/common-hal/touchio/TouchIn.c similarity index 100% rename from ports/esp32s2/common-hal/touchio/TouchIn.c rename to ports/espressif/common-hal/touchio/TouchIn.c diff --git a/ports/esp32s2/common-hal/touchio/TouchIn.h b/ports/espressif/common-hal/touchio/TouchIn.h similarity index 100% rename from ports/esp32s2/common-hal/touchio/TouchIn.h rename to ports/espressif/common-hal/touchio/TouchIn.h diff --git a/ports/esp32s2/common-hal/touchio/__init__.c b/ports/espressif/common-hal/touchio/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/touchio/__init__.c rename to ports/espressif/common-hal/touchio/__init__.c diff --git a/ports/esp32s2/common-hal/watchdog/WatchDogMode.c b/ports/espressif/common-hal/watchdog/WatchDogMode.c similarity index 100% rename from ports/esp32s2/common-hal/watchdog/WatchDogMode.c rename to ports/espressif/common-hal/watchdog/WatchDogMode.c diff --git a/ports/esp32s2/common-hal/watchdog/WatchDogTimer.c b/ports/espressif/common-hal/watchdog/WatchDogTimer.c similarity index 100% rename from ports/esp32s2/common-hal/watchdog/WatchDogTimer.c rename to ports/espressif/common-hal/watchdog/WatchDogTimer.c diff --git a/ports/esp32s2/common-hal/watchdog/WatchDogTimer.h b/ports/espressif/common-hal/watchdog/WatchDogTimer.h similarity index 100% rename from ports/esp32s2/common-hal/watchdog/WatchDogTimer.h rename to ports/espressif/common-hal/watchdog/WatchDogTimer.h diff --git a/ports/esp32s2/common-hal/watchdog/__init__.c b/ports/espressif/common-hal/watchdog/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/watchdog/__init__.c rename to ports/espressif/common-hal/watchdog/__init__.c diff --git a/ports/esp32s2/common-hal/wifi/Network.c b/ports/espressif/common-hal/wifi/Network.c similarity index 100% rename from ports/esp32s2/common-hal/wifi/Network.c rename to ports/espressif/common-hal/wifi/Network.c diff --git a/ports/esp32s2/common-hal/wifi/Network.h b/ports/espressif/common-hal/wifi/Network.h similarity index 100% rename from ports/esp32s2/common-hal/wifi/Network.h rename to ports/espressif/common-hal/wifi/Network.h diff --git a/ports/esp32s2/common-hal/wifi/Radio.c b/ports/espressif/common-hal/wifi/Radio.c similarity index 100% rename from ports/esp32s2/common-hal/wifi/Radio.c rename to ports/espressif/common-hal/wifi/Radio.c diff --git a/ports/esp32s2/common-hal/wifi/Radio.h b/ports/espressif/common-hal/wifi/Radio.h similarity index 100% rename from ports/esp32s2/common-hal/wifi/Radio.h rename to ports/espressif/common-hal/wifi/Radio.h diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.c b/ports/espressif/common-hal/wifi/ScannedNetworks.c similarity index 100% rename from ports/esp32s2/common-hal/wifi/ScannedNetworks.c rename to ports/espressif/common-hal/wifi/ScannedNetworks.c diff --git a/ports/esp32s2/common-hal/wifi/ScannedNetworks.h b/ports/espressif/common-hal/wifi/ScannedNetworks.h similarity index 100% rename from ports/esp32s2/common-hal/wifi/ScannedNetworks.h rename to ports/espressif/common-hal/wifi/ScannedNetworks.h diff --git a/ports/esp32s2/common-hal/wifi/__init__.c b/ports/espressif/common-hal/wifi/__init__.c similarity index 100% rename from ports/esp32s2/common-hal/wifi/__init__.c rename to ports/espressif/common-hal/wifi/__init__.c diff --git a/ports/esp32s2/common-hal/wifi/__init__.h b/ports/espressif/common-hal/wifi/__init__.h similarity index 100% rename from ports/esp32s2/common-hal/wifi/__init__.h rename to ports/espressif/common-hal/wifi/__init__.h diff --git a/ports/espressif/esp-idf b/ports/espressif/esp-idf new file mode 160000 index 0000000000..48ae2309fd --- /dev/null +++ b/ports/espressif/esp-idf @@ -0,0 +1 @@ +Subproject commit 48ae2309fd9cea600ff960b61a029892be1fdc1b diff --git a/ports/esp32s2/esp-idf-config/partitions-16MB.csv b/ports/espressif/esp-idf-config/partitions-16MB.csv similarity index 100% rename from ports/esp32s2/esp-idf-config/partitions-16MB.csv rename to ports/espressif/esp-idf-config/partitions-16MB.csv diff --git a/ports/esp32s2/esp-idf-config/partitions-4MB.csv b/ports/espressif/esp-idf-config/partitions-4MB.csv similarity index 100% rename from ports/esp32s2/esp-idf-config/partitions-4MB.csv rename to ports/espressif/esp-idf-config/partitions-4MB.csv diff --git a/ports/esp32s2/esp-idf-config/partitions-8MB.csv b/ports/espressif/esp-idf-config/partitions-8MB.csv similarity index 100% rename from ports/esp32s2/esp-idf-config/partitions-8MB.csv rename to ports/espressif/esp-idf-config/partitions-8MB.csv diff --git a/ports/esp32s2/esp-idf-config/sdkconfig-16MB.defaults b/ports/espressif/esp-idf-config/sdkconfig-16MB.defaults similarity index 100% rename from ports/esp32s2/esp-idf-config/sdkconfig-16MB.defaults rename to ports/espressif/esp-idf-config/sdkconfig-16MB.defaults diff --git a/ports/esp32s2/esp-idf-config/sdkconfig-4MB.defaults b/ports/espressif/esp-idf-config/sdkconfig-4MB.defaults similarity index 100% rename from ports/esp32s2/esp-idf-config/sdkconfig-4MB.defaults rename to ports/espressif/esp-idf-config/sdkconfig-4MB.defaults diff --git a/ports/esp32s2/esp-idf-config/sdkconfig-8MB.defaults b/ports/espressif/esp-idf-config/sdkconfig-8MB.defaults similarity index 100% rename from ports/esp32s2/esp-idf-config/sdkconfig-8MB.defaults rename to ports/espressif/esp-idf-config/sdkconfig-8MB.defaults diff --git a/ports/esp32s2/esp-idf-config/sdkconfig-debug.defaults b/ports/espressif/esp-idf-config/sdkconfig-debug.defaults similarity index 100% rename from ports/esp32s2/esp-idf-config/sdkconfig-debug.defaults rename to ports/espressif/esp-idf-config/sdkconfig-debug.defaults diff --git a/ports/esp32s2/esp-idf-config/sdkconfig-opt.defaults b/ports/espressif/esp-idf-config/sdkconfig-opt.defaults similarity index 100% rename from ports/esp32s2/esp-idf-config/sdkconfig-opt.defaults rename to ports/espressif/esp-idf-config/sdkconfig-opt.defaults diff --git a/ports/esp32s2/esp-idf-config/sdkconfig.defaults b/ports/espressif/esp-idf-config/sdkconfig.defaults similarity index 100% rename from ports/esp32s2/esp-idf-config/sdkconfig.defaults rename to ports/espressif/esp-idf-config/sdkconfig.defaults diff --git a/ports/esp32s2/esp32s2_peripherals_config.h b/ports/espressif/esp32s2_peripherals_config.h similarity index 100% rename from ports/esp32s2/esp32s2_peripherals_config.h rename to ports/espressif/esp32s2_peripherals_config.h diff --git a/ports/esp32s2/esp_error.c b/ports/espressif/esp_error.c similarity index 100% rename from ports/esp32s2/esp_error.c rename to ports/espressif/esp_error.c diff --git a/ports/esp32s2/fatfs_port.c b/ports/espressif/fatfs_port.c similarity index 100% rename from ports/esp32s2/fatfs_port.c rename to ports/espressif/fatfs_port.c diff --git a/ports/esp32s2/modules/module.h b/ports/espressif/modules/module.h similarity index 100% rename from ports/esp32s2/modules/module.h rename to ports/espressif/modules/module.h diff --git a/ports/esp32s2/modules/none.c b/ports/espressif/modules/none.c similarity index 100% rename from ports/esp32s2/modules/none.c rename to ports/espressif/modules/none.c diff --git a/ports/esp32s2/modules/wroom.c b/ports/espressif/modules/wroom.c similarity index 100% rename from ports/esp32s2/modules/wroom.c rename to ports/espressif/modules/wroom.c diff --git a/ports/esp32s2/modules/wrover.c b/ports/espressif/modules/wrover.c similarity index 100% rename from ports/esp32s2/modules/wrover.c rename to ports/espressif/modules/wrover.c diff --git a/ports/esp32s2/mpconfigport.h b/ports/espressif/mpconfigport.h similarity index 65% rename from ports/esp32s2/mpconfigport.h rename to ports/espressif/mpconfigport.h index a3db0ab3d5..385c5eb55f 100644 --- a/ports/esp32s2/mpconfigport.h +++ b/ports/espressif/mpconfigport.h @@ -42,8 +42,23 @@ #define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x9000) +// 20kB is statically allocated to nvs, but when overwriting an existing +// item, it's temporarily necessary to store both the old and new copies. +// Additionally, there is some overhad for the names and values of items +// in nvs, and alignment to 4kB flash erase boundaries may give better +// performance characteristics (h/t @tannewt). This implies we should select an +// 8kB size for CircuitPython'ns NVM. #ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (20 * 1024) +#define CIRCUITPY_INTERNAL_NVM_SIZE (8 * 1024) #endif +// Define to (1) in mpconfigboard.h if the board has a defined I2C port that +// lacks pull up resistors (Espressif's HMI Devkit), and the internal pull-up +// resistors will be enabled for all busio.I2C objects. This is only to +// compensate for design decisions that are out of the control of the authors +// of CircuitPython and is not an endorsement of running without appropriate +// external pull up resistors. +#ifndef CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP +#define CIRCUITPY_I2C_ALLOW_INTERNAL_PULL_UP (0) +#endif #endif // __INCLUDED_ESP32S2_MPCONFIGPORT_H diff --git a/ports/esp32s2/mpconfigport.mk b/ports/espressif/mpconfigport.mk similarity index 70% rename from ports/esp32s2/mpconfigport.mk rename to ports/espressif/mpconfigport.mk index 9f48e62568..206de09ab7 100644 --- a/ports/esp32s2/mpconfigport.mk +++ b/ports/espressif/mpconfigport.mk @@ -10,31 +10,31 @@ INTERNAL_LIBM = 1 LONGINT_IMPL = MPZ # These modules are implemented in ports//common-hal: -CIRCUITPY_FULL_BUILD = 1 -CIRCUITPY_ALARM = 1 -CIRCUITPY_AUDIOCORE = 1 -CIRCUITPY_AUDIOMP3 = 0 -CIRCUITPY_AUDIOBUSIO = 1 -CIRCUITPY_AUDIOBUSIO_PDMIN = 0 -CIRCUITPY_AUDIOBUSIO_I2SOUT = 1 -CIRCUITPY_AUDIOIO = 0 -CIRCUITPY_AUDIOMIXER = 1 -CIRCUITPY_CANIO = 1 -CIRCUITPY_COUNTIO = 1 -CIRCUITPY_DUALBANK = 1 -CIRCUITPY_FRAMEBUFFERIO = 1 -CIRCUITPY_FREQUENCYIO = 1 +CIRCUITPY_FULL_BUILD ?= 1 +CIRCUITPY_ALARM ?= 1 +CIRCUITPY_AUDIOCORE ?= 1 +CIRCUITPY_AUDIOMP3 ?= 0 +CIRCUITPY_AUDIOBUSIO ?= 1 +CIRCUITPY_AUDIOBUSIO_PDMIN ?= 0 +CIRCUITPY_AUDIOBUSIO_I2SOUT ?= 1 +CIRCUITPY_AUDIOIO ?= 0 +CIRCUITPY_AUDIOMIXER ?= 1 +CIRCUITPY_CANIO ?= 1 +CIRCUITPY_COUNTIO ?= 1 +CIRCUITPY_DUALBANK ?= 1 +CIRCUITPY_FRAMEBUFFERIO ?= 1 +CIRCUITPY_FREQUENCYIO ?= 1 CIRCUITPY_IMAGECAPTURE ?= 1 -CIRCUITPY_I2CPERIPHERAL = 0 -CIRCUITPY_RGBMATRIX = 1 -CIRCUITPY_ROTARYIO = 1 -CIRCUITPY_NVM = 1 +CIRCUITPY_I2CPERIPHERAL ?= 0 +CIRCUITPY_RGBMATRIX ?= 1 +CIRCUITPY_ROTARYIO ?= 1 +CIRCUITPY_NVM ?= 1 CIRCUITPY_PS2IO ?= 1 CIRCUITPY_TOUCHIO_USE_NATIVE ?= 1 -CIRCUITPY_WIFI = 1 +CIRCUITPY_WIFI ?= 1 CIRCUITPY_WATCHDOG ?= 1 -CIRCUITPY_ESPIDF = 1 +CIRCUITPY_ESPIDF ?= 1 CIRCUITPY_MODULE ?= none diff --git a/ports/esp32s2/mphalport.c b/ports/espressif/mphalport.c similarity index 100% rename from ports/esp32s2/mphalport.c rename to ports/espressif/mphalport.c diff --git a/ports/esp32s2/mphalport.h b/ports/espressif/mphalport.h similarity index 100% rename from ports/esp32s2/mphalport.h rename to ports/espressif/mphalport.h diff --git a/ports/esp32s2/peripherals/pcnt.c b/ports/espressif/peripherals/pcnt.c similarity index 100% rename from ports/esp32s2/peripherals/pcnt.c rename to ports/espressif/peripherals/pcnt.c diff --git a/ports/esp32s2/peripherals/pcnt.h b/ports/espressif/peripherals/pcnt.h similarity index 100% rename from ports/esp32s2/peripherals/pcnt.h rename to ports/espressif/peripherals/pcnt.h diff --git a/ports/esp32s2/peripherals/pins.c b/ports/espressif/peripherals/pins.c similarity index 100% rename from ports/esp32s2/peripherals/pins.c rename to ports/espressif/peripherals/pins.c diff --git a/ports/esp32s2/peripherals/pins.h b/ports/espressif/peripherals/pins.h similarity index 100% rename from ports/esp32s2/peripherals/pins.h rename to ports/espressif/peripherals/pins.h diff --git a/ports/esp32s2/peripherals/rmt.c b/ports/espressif/peripherals/rmt.c similarity index 100% rename from ports/esp32s2/peripherals/rmt.c rename to ports/espressif/peripherals/rmt.c diff --git a/ports/esp32s2/peripherals/rmt.h b/ports/espressif/peripherals/rmt.h similarity index 100% rename from ports/esp32s2/peripherals/rmt.h rename to ports/espressif/peripherals/rmt.h diff --git a/ports/esp32s2/peripherals/timer.c b/ports/espressif/peripherals/timer.c similarity index 100% rename from ports/esp32s2/peripherals/timer.c rename to ports/espressif/peripherals/timer.c diff --git a/ports/esp32s2/peripherals/timer.h b/ports/espressif/peripherals/timer.h similarity index 100% rename from ports/esp32s2/peripherals/timer.h rename to ports/espressif/peripherals/timer.h diff --git a/ports/esp32s2/peripherals/touch.c b/ports/espressif/peripherals/touch.c similarity index 100% rename from ports/esp32s2/peripherals/touch.c rename to ports/espressif/peripherals/touch.c diff --git a/ports/esp32s2/peripherals/touch.h b/ports/espressif/peripherals/touch.h similarity index 100% rename from ports/esp32s2/peripherals/touch.h rename to ports/espressif/peripherals/touch.h diff --git a/ports/esp32s2/qstrdefsport.h b/ports/espressif/qstrdefsport.h similarity index 100% rename from ports/esp32s2/qstrdefsport.h rename to ports/espressif/qstrdefsport.h diff --git a/ports/esp32s2/supervisor/esp_port.h b/ports/espressif/supervisor/esp_port.h similarity index 100% rename from ports/esp32s2/supervisor/esp_port.h rename to ports/espressif/supervisor/esp_port.h diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/espressif/supervisor/internal_flash.c similarity index 100% rename from ports/esp32s2/supervisor/internal_flash.c rename to ports/espressif/supervisor/internal_flash.c diff --git a/ports/esp32s2/supervisor/internal_flash.h b/ports/espressif/supervisor/internal_flash.h similarity index 100% rename from ports/esp32s2/supervisor/internal_flash.h rename to ports/espressif/supervisor/internal_flash.h diff --git a/ports/esp32s2/supervisor/internal_flash_root_pointers.h b/ports/espressif/supervisor/internal_flash_root_pointers.h similarity index 100% rename from ports/esp32s2/supervisor/internal_flash_root_pointers.h rename to ports/espressif/supervisor/internal_flash_root_pointers.h diff --git a/ports/esp32s2/supervisor/port.c b/ports/espressif/supervisor/port.c similarity index 98% rename from ports/esp32s2/supervisor/port.c rename to ports/espressif/supervisor/port.c index 1fca60a1c3..de6941ed70 100644 --- a/ports/esp32s2/supervisor/port.c +++ b/ports/espressif/supervisor/port.c @@ -48,6 +48,7 @@ #include "common-hal/watchdog/WatchDogTimer.h" #include "common-hal/socketpool/Socket.h" #include "common-hal/wifi/__init__.h" +#include "supervisor/background_callback.h" #include "supervisor/memory.h" #include "supervisor/shared/tick.h" #include "shared-bindings/rtc/__init__.h" @@ -329,7 +330,9 @@ void port_interrupt_after_ticks(uint32_t ticks) { // On the ESP we use FreeRTOS notifications instead of interrupts so this is a // bit of a misnomer. void port_idle_until_interrupt(void) { - xTaskNotifyWait(0x01, 0x01, NULL, portMAX_DELAY); + if (!background_callback_pending()) { + xTaskNotifyWait(0x01, 0x01, NULL, portMAX_DELAY); + } } // Wrap main in app_main that the IDF expects. diff --git a/ports/esp32s2/supervisor/usb.c b/ports/espressif/supervisor/usb.c similarity index 95% rename from ports/esp32s2/supervisor/usb.c rename to ports/espressif/supervisor/usb.c index 05e0746b00..0aa379b166 100644 --- a/ports/esp32s2/supervisor/usb.c +++ b/ports/espressif/supervisor/usb.c @@ -28,6 +28,7 @@ #include "py/runtime.h" #include "supervisor/usb.h" #include "supervisor/esp_port.h" +#include "supervisor/port.h" #include "lib/utils/interrupt_char.h" #include "lib/mp-readline/readline.h" @@ -109,6 +110,7 @@ void init_usb_hardware(void) { usb_device_stack, &usb_device_taskdef); } + /** * Callback invoked when received an "wanted" char. * @param itf Interface index (for multiple cdc interfaces) @@ -116,13 +118,13 @@ void init_usb_hardware(void) { */ void tud_cdc_rx_wanted_cb(uint8_t itf, char wanted_char) { (void)itf; // not used + // CircuitPython's VM is run in a separate FreeRTOS task from TinyUSB. + // So, we must notify the other task when a CTRL-C is received. + port_wake_main_task(); // Workaround for using lib/utils/interrupt_char.c // Compare mp_interrupt_char with wanted_char and ignore if not matched if (mp_interrupt_char == wanted_char) { tud_cdc_read_flush(); // flush read fifo mp_sched_keyboard_interrupt(); - // CircuitPython's VM is run in a separate FreeRTOS task from TinyUSB. - // So, we must notify the other task when a CTRL-C is received. - xTaskNotifyGive(circuitpython_task); } } diff --git a/ports/esp32s2/tools/build_memory_info.py b/ports/espressif/tools/build_memory_info.py similarity index 100% rename from ports/esp32s2/tools/build_memory_info.py rename to ports/espressif/tools/build_memory_info.py diff --git a/ports/esp32s2/tools/decode_backtrace.py b/ports/espressif/tools/decode_backtrace.py similarity index 100% rename from ports/esp32s2/tools/decode_backtrace.py rename to ports/espressif/tools/decode_backtrace.py diff --git a/ports/litex/boards/fomu/pins.c b/ports/litex/boards/fomu/pins.c index 804a8b37f9..9744f5c73e 100644 --- a/ports/litex/boards/fomu/pins.c +++ b/ports/litex/boards/fomu/pins.c @@ -1,9 +1,11 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_TOUCH1), MP_ROM_PTR(&pin_TOUCH1) }, { MP_ROM_QSTR(MP_QSTR_TOUCH2), MP_ROM_PTR(&pin_TOUCH2) }, { MP_ROM_QSTR(MP_QSTR_TOUCH3), MP_ROM_PTR(&pin_TOUCH3) }, { MP_ROM_QSTR(MP_QSTR_TOUCH4), MP_ROM_PTR(&pin_TOUCH4) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/Makefile b/ports/mimxrt10xx/Makefile index c112902639..310b5d6f31 100644 --- a/ports/mimxrt10xx/Makefile +++ b/ports/mimxrt10xx/Makefile @@ -81,11 +81,13 @@ CFLAGS += -Os -ftree-vrp -DNDEBUG -ffreestanding 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 #Debugging/Optimization +# 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-inline -fno-ipa-sra + CFLAGS += -fno-ipa-sra else #CFLAGS += -flto -flto-partition=none endif diff --git a/ports/mimxrt10xx/boards/feather_m7_1011/pins.c b/ports/mimxrt10xx/boards/feather_m7_1011/pins.c index f08173943e..4bd7f13668 100644 --- a/ports/mimxrt10xx/boards/feather_m7_1011/pins.c +++ b/ports/mimxrt10xx/boards/feather_m7_1011/pins.c @@ -2,7 +2,9 @@ #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Analog { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_11) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_10) }, @@ -43,4 +45,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1011/pins.c b/ports/mimxrt10xx/boards/feather_mimxrt1011/pins.c index 4d2536a941..0014c4a145 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1011/pins.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1011/pins.c @@ -2,7 +2,9 @@ #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Analog { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_11) }, @@ -52,4 +54,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/feather_mimxrt1062/pins.c b/ports/mimxrt10xx/boards/feather_mimxrt1062/pins.c index 9747aefd19..2a333f7f46 100644 --- a/ports/mimxrt10xx/boards/feather_mimxrt1062/pins.c +++ b/ports/mimxrt10xx/boards/feather_mimxrt1062/pins.c @@ -2,7 +2,9 @@ #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Analog { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B0_13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_10) }, @@ -45,4 +47,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c b/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c index dac4fc0d6e..a78004d143 100644 --- a/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c +++ b/ports/mimxrt10xx/boards/imxrt1010_evk/pins.c @@ -2,7 +2,9 @@ #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_10) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_AD_05) }, @@ -35,6 +37,8 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_USER_LED), MP_ROM_PTR(&pin_GPIO_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_11) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO_SD_05) }, // Audio Interface @@ -57,4 +61,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/imxrt1020_evk/pins.c b/ports/mimxrt10xx/boards/imxrt1020_evk/pins.c index 2052a12429..d93a7de9f2 100644 --- a/ports/mimxrt10xx/boards/imxrt1020_evk/pins.c +++ b/ports/mimxrt10xx/boards/imxrt1020_evk/pins.c @@ -2,7 +2,9 @@ #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B1_08) }, @@ -32,6 +34,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_USER_LED), MP_ROM_PTR(&pin_GPIO_AD_B0_05) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_AD_B0_05) }, // SD Card { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_03) }, @@ -81,4 +84,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/imxrt1060_evk/pins.c b/ports/mimxrt10xx/boards/imxrt1060_evk/pins.c index b24e4dc86d..9febc3dae8 100644 --- a/ports/mimxrt10xx/boards/imxrt1060_evk/pins.c +++ b/ports/mimxrt10xx/boards/imxrt1060_evk/pins.c @@ -2,7 +2,9 @@ #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B1_07) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, @@ -34,6 +36,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00) }, { MP_OBJ_NEW_QSTR(MP_QSTR_USER_LED), MP_ROM_PTR(&pin_GPIO_AD_B0_09) }, + { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_AD_B0_09) }, // Camera Sensor Interface { MP_OBJ_NEW_QSTR(MP_QSTR_CSI_VSYNC), MP_ROM_PTR(&pin_GPIO_AD_B1_06) }, @@ -125,4 +128,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/metro_m7_1011/pins.c b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c index fe9db8c634..0198ed90cc 100644 --- a/ports/mimxrt10xx/boards/metro_m7_1011/pins.c +++ b/ports/mimxrt10xx/boards/metro_m7_1011/pins.c @@ -2,7 +2,9 @@ #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Analog { MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_01) }, @@ -54,4 +56,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/teensy40/pins.c b/ports/mimxrt10xx/boards/teensy40/pins.c index 64b4aa7f69..2188c6c0e2 100644 --- a/ports/mimxrt10xx/boards/teensy40/pins.c +++ b/ports/mimxrt10xx/boards/teensy40/pins.c @@ -2,14 +2,18 @@ #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_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) }, @@ -19,64 +23,89 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_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_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_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_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_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_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_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_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_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_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) }, @@ -84,4 +113,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/boards/teensy41/pins.c b/ports/mimxrt10xx/boards/teensy41/pins.c index cf24513019..32e57b1a14 100644 --- a/ports/mimxrt10xx/boards/teensy41/pins.c +++ b/ports/mimxrt10xx/boards/teensy41/pins.c @@ -2,14 +2,19 @@ #include "supervisor/board.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_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) }, @@ -19,20 +24,26 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_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_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_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) }, @@ -41,29 +52,41 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { // 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_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_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_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_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_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09) }, @@ -81,36 +104,46 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { // 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_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_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_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_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_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_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_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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/mimxrt10xx/common-hal/busio/OneWire.h b/ports/mimxrt10xx/common-hal/busio/OneWire.h deleted file mode 100644 index bb4bc016a4..0000000000 --- a/ports/mimxrt10xx/common-hal/busio/OneWire.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * - * 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_MIMXRT10XX_COMMON_HAL_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_ONEWIRE_H - -// Use bitbangio. -#include "shared-module/busio/OneWire.h" - -#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_BUSIO_ONEWIRE_H diff --git a/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c b/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c deleted file mode 100644 index f7889c70f4..0000000000 --- a/ports/mimxrt10xx/common-hal/displayio/ParallelBus.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 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 "shared-bindings/displayio/ParallelBus.h" - -#include - -#include "common-hal/microcontroller/Pin.h" -#include "py/runtime.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "shared-bindings/microcontroller/__init__.h" - -void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *self, - const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select, - const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) { - - mp_raise_NotImplementedError(translate("ParallelBus not yet supported")); -} - -void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self) { - -} - -bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { - return false; -} - -bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { - return false; -} - -bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { - - return false; -} - -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, - display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { - -} - -void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { - -} diff --git a/ports/mimxrt10xx/common-hal/displayio/ParallelBus.h b/ports/mimxrt10xx/common-hal/displayio/ParallelBus.h deleted file mode 100644 index 845e44df06..0000000000 --- a/ports/mimxrt10xx/common-hal/displayio/ParallelBus.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2020 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. - */ - -#ifndef MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_DISPLAYIO_PARALLELBUS_H -#define MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_DISPLAYIO_PARALLELBUS_H - -#include "common-hal/digitalio/DigitalInOut.h" - -typedef struct { - mp_obj_base_t base; -} displayio_parallelbus_obj_t; - -#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_DISPLAYIO_PARALLELBUS_H diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c deleted file mode 100644 index c1f7ce20b6..0000000000 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017-2018 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 "common-hal/pulseio/PulseIn.h" - -#include - -#include "background.h" -#include "mpconfigport.h" -#include "py/gc.h" -#include "py/runtime.h" - -#include "shared-bindings/microcontroller/__init__.h" -#include "shared-bindings/pulseio/PulseIn.h" -#include "supervisor/shared/translate.h" - -// TODO -// static void pulsein_set_config(pulseio_pulsein_obj_t* self, bool first_edge) { -// uint32_t sense_setting; -// if (!first_edge) { -// sense_setting = EIC_CONFIG_SENSE0_BOTH_Val; -// configure_eic_channel(self->channel, sense_setting); -// return; -// } else if (self->idle_state) { -// sense_setting = EIC_CONFIG_SENSE0_FALL_Val; -// } else { -// sense_setting = EIC_CONFIG_SENSE0_RISE_Val; -// } -// set_eic_handler(self->channel, EIC_HANDLER_PULSEIN); -// turn_on_eic_channel(self->channel, sense_setting); -// } - -// void pulsein_interrupt_handler(uint8_t channel) { -// // Grab the current time first. -// uint32_t current_us; -// uint64_t current_ms; -// current_tick(¤t_ms, ¤t_us); -// -// // current_tick gives us the remaining us until the next tick but we want the number since the -// // last ms. -// current_us = 1000 - current_us; -// pulseio_pulsein_obj_t* self = get_eic_channel_data(channel); -// if (!supervisor_background_tasks_ok() || self->errored_too_fast) { -// self->errored_too_fast = true; -// common_hal_pulseio_pulsein_pause(self); -// return; -// } -// if (self->first_edge) { -// self->first_edge = false; -// pulsein_set_config(self, false); -// } else { -// uint32_t ms_diff = current_ms - self->last_ms; -// uint16_t us_diff = current_us - self->last_us; -// uint32_t total_diff = us_diff; -// if (self->last_us > current_us) { -// total_diff = 1000 + current_us - self->last_us; -// if (ms_diff > 1) { -// total_diff += (ms_diff - 1) * 1000; -// } -// } else { -// total_diff += ms_diff * 1000; -// } -// uint16_t duration = 0xffff; -// if (total_diff < duration) { -// duration = total_diff; -// } -// -// uint16_t i = (self->start + self->len) % self->maxlen; -// self->buffer[i] = duration; -// if (self->len < self->maxlen) { -// self->len++; -// } else { -// self->start++; -// } -// } -// self->last_ms = current_ms; -// self->last_us = current_us; -// } - -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")); -// } -// if (eic_get_enable() && !eic_channel_free(pin->extint_channel)) { -// mp_raise_RuntimeError(translate("EXTINT channel already in use")); -// } -// -// 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)); -// } -// self->channel = pin->extint_channel; -// self->pin = pin->number; -// self->maxlen = maxlen; -// self->idle_state = idle_state; -// self->start = 0; -// self->len = 0; -// self->first_edge = true; -// self->last_us = 0; -// self->last_ms = 0; -// self->errored_too_fast = false; -// -// set_eic_channel_data(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(pin->number, GPIO_PIN_FUNCTION_A); -// -// turn_on_cpu_interrupt(self->channel); -// -// claim_pin(pin); -// -// // Set config will enable the EIC. -// pulsein_set_config(self, true); -} - -bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t *self) { -// return self->pin == NO_PIN; - return true; -} - -void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t *self) { -// if (common_hal_pulseio_pulsein_deinited(self)) { -// return; -// } -// set_eic_handler(self->channel, EIC_HANDLER_NO_INTERRUPT); -// turn_off_eic_channel(self->channel); -// reset_pin_number(self->pin); -// self->pin = NO_PIN; -} - -void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t *self) { -// uint32_t mask = 1 << self->channel; -// EIC->INTENCLR.reg = mask << EIC_INTENSET_EXTINT_Pos; -} - -void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self, - uint16_t trigger_duration) { -// // Make sure we're paused. -// common_hal_pulseio_pulsein_pause(self); -// -// // Reset erroring -// self->errored_too_fast = false; -// -// // Send the trigger pulse. -// if (trigger_duration > 0) { -// gpio_set_pin_pull_mode(self->pin, GPIO_PULL_OFF); -// gpio_set_pin_direction(self->pin, GPIO_DIRECTION_OUT); -// gpio_set_pin_level(self->pin, !self->idle_state); -// common_hal_mcu_delay_us((uint32_t)trigger_duration); -// gpio_set_pin_level(self->pin, self->idle_state); -// } -// -// // Reconfigure the pin and make sure its set to detect the first edge. -// self->first_edge = true; -// self->last_ms = 0; -// self->last_us = 0; -// gpio_set_pin_function(self->pin, GPIO_PIN_FUNCTION_A); -// uint32_t mask = 1 << self->channel; -// // Clear previous interrupt state and re-enable it. -// EIC->INTFLAG.reg = mask << EIC_INTFLAG_EXTINT_Pos; -// EIC->INTENSET.reg = mask << EIC_INTENSET_EXTINT_Pos; -// -// pulsein_set_config(self, true); -} - -void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t *self) { -// common_hal_mcu_disable_interrupts(); -// self->start = 0; -// self->len = 0; -// common_hal_mcu_enable_interrupts(); -} - -uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t *self) { -// if (self->len == 0) { -// mp_raise_IndexError_varg(translate("pop from empty %q"), MP_QSTR_PulseIn); -// } -// common_hal_mcu_disable_interrupts(); -// uint16_t value = self->buffer[self->start]; -// self->start = (self->start + 1) % self->maxlen; -// self->len--; -// common_hal_mcu_enable_interrupts(); -// -// return value; - return 0; -} - -uint16_t common_hal_pulseio_pulsein_get_maxlen(pulseio_pulsein_obj_t *self) { -// return self->maxlen; - return 0; -} - -uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t *self) { -// return self->len; - return 0; -} - -bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t *self) { -// uint32_t mask = 1 << self->channel; -// return (EIC->INTENSET.reg & (mask << EIC_INTENSET_EXTINT_Pos)) == 0; - return true; -} - -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); -// } -// uint16_t value = self->buffer[(self->start + index) % self->maxlen]; -// common_hal_mcu_enable_interrupts(); -// return value; - return 0; -} diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.h b/ports/mimxrt10xx/common-hal/pulseio/PulseIn.h deleted file mode 100644 index cce4f58ca7..0000000000 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseIn.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 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. - */ - -#ifndef MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PULSEIN_H -#define MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PULSEIN_H - -#include "common-hal/microcontroller/Pin.h" - -#include "py/obj.h" - -// TODO -typedef struct { - mp_obj_base_t base; -// uint8_t channel; -// uint8_t pin; -// uint16_t* buffer; -// uint16_t maxlen; -// bool idle_state; -// volatile uint16_t start; -// volatile uint16_t len; -// volatile bool first_edge; -// volatile uint64_t last_ms; -// volatile uint16_t last_us; -// volatile bool errored_too_fast; -} pulseio_pulsein_obj_t; - -// void pulsein_reset(void); -// -// void pulsein_interrupt_handler(uint8_t channel); - -#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PULSEIN_H diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c b/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c deleted file mode 100644 index b38f6f093f..0000000000 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseOut.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * SPDX-FileCopyrightText: Copyright (c) 2016 Damien P. George - * 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 "common-hal/pulseio/PulseOut.h" - -#include - -#include "mpconfigport.h" -#include "py/gc.h" -#include "py/runtime.h" -#include "shared-bindings/pulseio/PulseOut.h" -#include "supervisor/shared/translate.h" - -// TODO - -// This timer is shared amongst all PulseOut objects under the assumption that -// the code is single threaded. -// static uint8_t refcount = 0; -// -// static uint8_t pulseout_tc_index = 0xff; -// -// static __IO PORT_PINCFG_Type *active_pincfg = NULL; -// static uint16_t *pulse_buffer = NULL; -// static volatile uint16_t pulse_index = 0; -// static uint16_t pulse_length; -// static volatile uint32_t current_compare = 0; -// -// static void turn_on(__IO PORT_PINCFG_Type * pincfg) { -// pincfg->reg = PORT_PINCFG_PMUXEN; -// } -// -// static void turn_off(__IO PORT_PINCFG_Type * pincfg) { -// pincfg->reg = PORT_PINCFG_RESETVALUE; -// } -// -// void pulse_finish(void) { -// pulse_index++; -// -// if (active_pincfg == NULL) { -// return; -// } -// // Always turn it off. -// turn_off(active_pincfg); -// if (pulse_index >= pulse_length) { -// return; -// } -// current_compare = (current_compare + pulse_buffer[pulse_index] * 3 / 4) & 0xffff; -// Tc* tc = tc_insts[pulseout_tc_index]; -// tc->COUNT16.CC[0].reg = current_compare; -// if (pulse_index % 2 == 0) { -// turn_on(active_pincfg); -// } -// } - -void pulseout_interrupt_handler(uint8_t index) { -// if (index != pulseout_tc_index) return; -// Tc* tc = tc_insts[index]; -// if (!tc->COUNT16.INTFLAG.bit.MC0) return; -// -// pulse_finish(); -// -// // Clear the interrupt bit. -// tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC0; -} - -void pulseout_reset() { -// refcount = 0; -// pulseout_tc_index = 0xff; -// active_pincfg = NULL; -} - -void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, - const pwmio_pwmout_obj_t *carrier, - const mcu_pin_obj_t *pin, - uint32_t frequency, - uint16_t duty_cycle) { -// if (refcount == 0) { -// // Find a spare timer. -// Tc *tc = NULL; -// int8_t index = TC_INST_NUM - 1; -// for (; index >= 0; index--) { -// if (tc_insts[index]->COUNT16.CTRLA.bit.ENABLE == 0) { -// tc = tc_insts[index]; -// break; -// } -// } -// if (tc == NULL) { -// mp_raise_RuntimeError(translate("All timers in use")); -// } -// -// pulseout_tc_index = index; -// -// set_timer_handler(true, index, TC_HANDLER_PULSEOUT); -// // We use GCLK0 for SAMD21 and GCLK1 for SAMD51 because they both run at 48mhz making our -// // math the same across the boards. -// #ifdef SAMD21 -// turn_on_clocks(true, index, 0); -// #endif -// #ifdef SAMD51 -// turn_on_clocks(true, index, 1); -// #endif -// -// -// #ifdef SAMD21 -// tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | -// TC_CTRLA_PRESCALER_DIV64 | -// TC_CTRLA_WAVEGEN_NFRQ; -// #endif -// #ifdef SAMD51 -// tc_reset(tc); -// tc_set_enable(tc, false); -// tc->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV64; -// tc->COUNT16.WAVE.reg = TC_WAVE_WAVEGEN_NFRQ; -// #endif -// -// tc_set_enable(tc, true); -// tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_STOP; -// } -// refcount++; -// -// self->pin = carrier->pin->number; -// -// PortGroup *const port_base = &PORT->Group[GPIO_PORT(self->pin)]; -// self->pincfg = &port_base->PINCFG[self->pin % 32]; -// -// // Set the port to output a zero. -// port_base->OUTCLR.reg = 1 << (self->pin % 32); -// port_base->DIRSET.reg = 1 << (self->pin % 32); -// -// // Turn off the pinmux which should connect the port output. -// turn_off(self->pincfg); -} - -bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t *self) { -// return self->pin == NO_PIN; - return false; -} - -void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { -// if (common_hal_pulseio_pulseout_deinited(self)) { -// return; -// } -// PortGroup *const port_base = &PORT->Group[GPIO_PORT(self->pin)]; -// port_base->DIRCLR.reg = 1 << (self->pin % 32); -// -// turn_on(self->pincfg); -// -// refcount--; -// if (refcount == 0) { -// tc_reset(tc_insts[pulseout_tc_index]); -// pulseout_tc_index = 0xff; -// } -// self->pin = NO_PIN; -} - -void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t *self, uint16_t *pulses, uint16_t length) { -// if (active_pincfg != NULL) { -// mp_raise_RuntimeError(translate("Another send is already active")); -// } -// active_pincfg = self->pincfg; -// pulse_buffer = pulses; -// pulse_index = 0; -// pulse_length = length; -// -// current_compare = pulses[0] * 3 / 4; -// Tc* tc = tc_insts[pulseout_tc_index]; -// tc->COUNT16.CC[0].reg = current_compare; -// -// // Clear our interrupt in case it was set earlier -// tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC0; -// tc->COUNT16.INTENSET.reg = TC_INTENSET_MC0; -// tc_enable_interrupts(pulseout_tc_index); -// turn_on(active_pincfg); -// tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_RETRIGGER; -// -// while(pulse_index < length) { -// // Do other things while we wait. The interrupts will handle sending the -// // signal. -// RUN_BACKGROUND_TASKS; -// } -// -// tc->COUNT16.CTRLBSET.reg = TC_CTRLBSET_CMD_STOP; -// tc->COUNT16.INTENCLR.reg = TC_INTENCLR_MC0; -// tc_disable_interrupts(pulseout_tc_index); -// active_pincfg = NULL; -} diff --git a/ports/mimxrt10xx/common-hal/pulseio/PulseOut.h b/ports/mimxrt10xx/common-hal/pulseio/PulseOut.h deleted file mode 100644 index da022b738d..0000000000 --- a/ports/mimxrt10xx/common-hal/pulseio/PulseOut.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2017 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. - */ - -#ifndef MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PULSEOUT_H -#define MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PULSEOUT_H - -#include "common-hal/microcontroller/Pin.h" - -#include "py/obj.h" - -// TODO -typedef struct { - mp_obj_base_t base; -// __IO PORT_PINCFG_Type *pincfg; -// uint8_t pin; -} pulseio_pulseout_obj_t; - -void pulseout_reset(void); -// void pulseout_interrupt_handler(uint8_t index); - -#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PULSEOUT_H diff --git a/ports/mimxrt10xx/common-hal/pulseio/__init__.c b/ports/mimxrt10xx/common-hal/pulseio/__init__.c deleted file mode 100644 index 2bee925bc7..0000000000 --- a/ports/mimxrt10xx/common-hal/pulseio/__init__.c +++ /dev/null @@ -1 +0,0 @@ -// No pulseio module functions. diff --git a/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c index d48bda7cd1..8eb3251bf3 100644 --- a/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c +++ b/ports/mimxrt10xx/common-hal/pwmio/PWMOut.c @@ -56,97 +56,16 @@ static void config_periph_pin(const mcu_pwm_obj_t *periph) { | IOMUXC_SW_PAD_CTL_PAD_DSE(6) | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); } -// TODO -// #include "samd/pins.h" - -// #undef ENABLE -// -// # define _TCC_SIZE(unused, n) TCC ## n ## _SIZE, -// # define TCC_SIZES { REPEAT_MACRO(_TCC_SIZE, 0, TCC_INST_NUM) } -// -// static uint32_t tcc_periods[TCC_INST_NUM]; -// static uint32_t tc_periods[TC_INST_NUM]; -// -// uint32_t target_tcc_frequencies[TCC_INST_NUM]; -// uint8_t tcc_refcount[TCC_INST_NUM]; -// -//// This bitmask keeps track of which channels of a TCC are currently claimed. -// #ifdef SAMD21 -// uint8_t tcc_channels[3]; // Set by pwmout_reset() to {0xf0, 0xfc, 0xfc} initially. -// #endif -// #ifdef SAMD51 -// uint8_t tcc_channels[5]; // Set by pwmout_reset() to {0xc0, 0xf0, 0xf8, 0xfc, 0xfc} initially. -// #endif -// -// static uint8_t never_reset_tc_or_tcc[TC_INST_NUM + TCC_INST_NUM]; void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { -// if (self->timer->is_tc) { -// never_reset_tc_or_tcc[self->timer->index] += 1; -// } else { -// never_reset_tc_or_tcc[TC_INST_NUM + self->timer->index] += 1; -// } -// -// never_reset_pin_number(self->pin->number); } void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { -// if (self->timer->is_tc) { -// never_reset_tc_or_tcc[self->timer->index] -= 1; -// } else { -// never_reset_tc_or_tcc[TC_INST_NUM + self->timer->index] -= 1; -// } } void pwmout_reset(void) { -// // Reset all timers -// for (int i = 0; i < TCC_INST_NUM; i++) { -// target_tcc_frequencies[i] = 0; -// tcc_refcount[i] = 0; -// } -// Tcc *tccs[TCC_INST_NUM] = TCC_INSTS; -// for (int i = 0; i < TCC_INST_NUM; i++) { -// if (never_reset_tc_or_tcc[TC_INST_NUM + i] > 0) { -// continue; -// } -// // Disable the module before resetting it. -// if (tccs[i]->CTRLA.bit.ENABLE == 1) { -// tccs[i]->CTRLA.bit.ENABLE = 0; -// while (tccs[i]->SYNCBUSY.bit.ENABLE == 1) { -// } -// } -// uint8_t mask = 0xff; -// for (uint8_t j = 0; j < tcc_cc_num[i]; j++) { -// mask <<= 1; -// } -// tcc_channels[i] = mask; -// tccs[i]->CTRLA.bit.SWRST = 1; -// while (tccs[i]->CTRLA.bit.SWRST == 1) { -// } -// } -// Tc *tcs[TC_INST_NUM] = TC_INSTS; -// for (int i = 0; i < TC_INST_NUM; i++) { -// if (never_reset_tc_or_tcc[i] > 0) { -// continue; -// } -// tcs[i]->COUNT16.CTRLA.bit.SWRST = 1; -// while (tcs[i]->COUNT16.CTRLA.bit.SWRST == 1) { -// } -// } } -// static uint8_t tcc_channel(const pin_timer_t* t) { -// // For the SAMD51 this hardcodes the use of OTMX == 0x0, the output matrix mapping, which uses -// // SAMD21-style modulo mapping. -// return t->wave_output % tcc_cc_num[t->index]; -// } - -// bool channel_ok(const pin_timer_t* t) { -// uint8_t channel_bit = 1 << tcc_channel(t); -// return (!t->is_tc && ((tcc_channels[t->index] & channel_bit) == 0)) || -// t->is_tc; -// } - #define PWM_SRC_CLK_FREQ CLOCK_GetFreq(kCLOCK_IpgClk) static int calculate_pulse_count(uint32_t frequency, uint8_t *prescaler) { @@ -325,3 +244,7 @@ uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t *self) { bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t *self) { return self->variable_frequency; } + +const mcu_pin_obj_t *common_hal_pwmio_pwmout_get_pin(pwmio_pwmout_obj_t *self) { + return self->pin; +} diff --git a/ports/mimxrt10xx/linking/common.ld b/ports/mimxrt10xx/linking/common.ld index 720361aa0a..44e8d537c4 100644 --- a/ports/mimxrt10xx/linking/common.ld +++ b/ports/mimxrt10xx/linking/common.ld @@ -51,7 +51,6 @@ SECTIONS KEEP(* (.boot_hdr.dcd_data)) . = ALIGN(4); } > FLASH_IVT - image_vector_table = LOADADDR(.ivt); .text : { diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index ac5e7fc8ed..ed9446d0e7 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -24,10 +24,12 @@ INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOBUSIO = 0 CIRCUITPY_BUSDEVICE = 1 +CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 CIRCUITPY_I2CPERIPHERAL = 0 CIRCUITPY_NVM = 0 +CIRCUITPY_PARALLELDISPLAY = 0 +CIRCUITPY_PULSEIO = 0 CIRCUITPY_ROTARYIO = 0 -CIRCUITPY_COUNTIO = 0 CIRCUITPY_USB_MIDI = 1 LONGINT_IMPL = MPZ diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 2493252d78..88a4ce5bb7 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -37,19 +37,15 @@ #include "fsl_device_registers.h" #include "common-hal/microcontroller/Pin.h" -#include "common-hal/pulseio/PulseIn.h" -#include "common-hal/pulseio/PulseOut.h" #include "common-hal/pwmio/PWMOut.h" #include "common-hal/rtc/RTC.h" #include "common-hal/busio/SPI.h" +#include "shared-bindings/microcontroller/__init__.h" #include "reset.h" -#include "tusb.h" +#include "supervisor/background_callback.h" -#if CIRCUITPY_GAMEPAD -#include "shared-module/gamepad/__init__.h" -#endif #if CIRCUITPY_GAMEPADSHIFT #include "shared-module/gamepadshift/__init__.h" #endif @@ -289,9 +285,6 @@ void reset_port(void) { // eic_reset(); - #if CIRCUITPY_PULSEIO - pulseout_reset(); - #endif #if CIRCUITPY_PWMIO pwmout_reset(); #endif @@ -300,9 +293,6 @@ void reset_port(void) { rtc_reset(); #endif - #if CIRCUITPY_GAMEPAD - gamepad_reset(); - #endif #if CIRCUITPY_GAMEPADSHIFT gamepadshift_reset(); #endif @@ -411,10 +401,15 @@ void port_idle_until_interrupt(void) { __set_FPSCR(__get_FPSCR() & ~(0x9f)); (void)__get_FPSCR(); } - NVIC_ClearPendingIRQ(SNVS_HP_WRAPPER_IRQn); - CLOCK_SetMode(kCLOCK_ModeWait); - __WFI(); - CLOCK_SetMode(kCLOCK_ModeRun); + + common_hal_mcu_disable_interrupts(); + if (!background_callback_pending()) { + NVIC_ClearPendingIRQ(SNVS_HP_WRAPPER_IRQn); + CLOCK_SetMode(kCLOCK_ModeWait); + __WFI(); + CLOCK_SetMode(kCLOCK_ModeRun); + } + common_hal_mcu_enable_interrupts(); } /** diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index ce74f5d203..01050324f5 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -103,6 +103,18 @@ CFLAGS += $(OPTIMIZATION_FLAGS) CFLAGS += $(INC) -Wall -Werror -std=gnu11 -nostdlib -fshort-enums $(BASE_CFLAGS) $(CFLAGS_MOD) $(COPT) +# Nordic Softdevice SDK header files contains inline assembler that has +# broken constraints. As a result the IPA-modref pass, introduced in gcc-11, +# is able to "prove" that arguments to wrapper functions generated with +# the SVCALL() macro are unused and, as a result, the optimizer will remove +# code within the callers that sets up these arguments (which results in +# a broken bootloader). The broken headers come from Nordic-supplied zip +# files and are not trivial to patch so, for now, we'll simply disable the +# new gcc-11 inter-procedural optimizations. +ifeq (,$(findstring unrecognized,$(shell $(CC) $(CFLAGS) -fno-ipa-modref 2>&1))) +CFLAGS += -fno-ipa-modref +endif + # Undo some warnings. # nrfx does casts that increase alignment requirements. CFLAGS += -Wno-cast-align @@ -120,7 +132,7 @@ CFLAGS += \ # TODO: check this CFLAGS += -D__START=main -LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -Wl,-nostdlib -Wl,-z,max-page-size=0x1000 -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc LDFLAGS += -mthumb -mcpu=cortex-m4 @@ -191,7 +203,7 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) # There may be duplicates between SRC_COMMON_HAL_EXPANDED and SRC_SHARED_MODULE_EXPANDED, -# because a few modules have files both in common-hal/ and shared-modules/. +# because a few modules have files both in common-hal/ and shared-module/. # Doing a $(sort ...) removes duplicates as part of sorting. SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) diff --git a/ports/nrf/boards/ADM_B_NRF52840_1/pins.c b/ports/nrf/boards/ADM_B_NRF52840_1/pins.c index 83be4f0ac7..6829bb9b59 100644 --- a/ports/nrf/boards/ADM_B_NRF52840_1/pins.c +++ b/ports/nrf/boards/ADM_B_NRF52840_1/pins.c @@ -1,6 +1,8 @@ #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_P1_10), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_P1_11), MP_ROM_PTR(&pin_P1_11) }, diff --git a/ports/nrf/boards/TG-Watch/pins.c b/ports/nrf/boards/TG-Watch/pins.c index 275b89b226..0b2fe07aaa 100644 --- a/ports/nrf/boards/TG-Watch/pins.c +++ b/ports/nrf/boards/TG-Watch/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + /* default ports */ { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, diff --git a/ports/nrf/boards/adafruit_led_glasses_nrf52840/board.c b/ports/nrf/boards/adafruit_led_glasses_nrf52840/board.c new file mode 100644 index 0000000000..688cfb4ded --- /dev/null +++ b/ports/nrf/boards/adafruit_led_glasses_nrf52840/board.c @@ -0,0 +1,38 @@ +/* + * 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) { + +} diff --git a/ports/nrf/boards/adafruit_led_glasses_nrf52840/mpconfigboard.h b/ports/nrf/boards/adafruit_led_glasses_nrf52840/mpconfigboard.h new file mode 100644 index 0000000000..e82d6ceed9 --- /dev/null +++ b/ports/nrf/boards/adafruit_led_glasses_nrf52840/mpconfigboard.h @@ -0,0 +1,30 @@ +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "Adafruit LED Glasses Driver nRF52840" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_NEOPIXEL (&pin_P1_15) + +#define MICROPY_HW_LED_STATUS (&pin_P0_31) + +#if QSPI_FLASH_FILESYSTEM +#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(1, 00) +#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21) +#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22) +#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 23) +#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19) +#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20) +#endif + +#if SPI_FLASH_FILESYSTEM +#define SPI_FLASH_MOSI_PIN &pin_P1_00 +#define SPI_FLASH_MISO_PIN &pin_P0_21 +#define SPI_FLASH_SCK_PIN &pin_P0_19 +#define SPI_FLASH_CS_PIN &pin_P0_20 +#endif + +// Board does not have a 32kHz crystal. It does have a 32MHz crystal, in the module. +#define BOARD_HAS_32KHZ_XTAL (0) + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_08) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_06) diff --git a/ports/nrf/boards/adafruit_led_glasses_nrf52840/mpconfigboard.mk b/ports/nrf/boards/adafruit_led_glasses_nrf52840/mpconfigboard.mk new file mode 100644 index 0000000000..5d90582865 --- /dev/null +++ b/ports/nrf/boards/adafruit_led_glasses_nrf52840/mpconfigboard.mk @@ -0,0 +1,10 @@ +USB_VID = 0x239A +USB_PID = 0x810E +USB_PRODUCT = "nRF52840 LED Glasses Driver" +USB_MANUFACTURER = "Adafruit Industries LLC" + +MCU_CHIP = nrf52840 + + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICES = "GD25Q16C" diff --git a/ports/nrf/boards/adafruit_led_glasses_nrf52840/pins.c b/ports/nrf/boards/adafruit_led_glasses_nrf52840/pins.c new file mode 100644 index 0000000000..8bc4ead19b --- /dev/null +++ b/ports/nrf/boards/adafruit_led_glasses_nrf52840/pins.c @@ -0,0 +1,26 @@ +#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_MICROPHONE_CLOCK), MP_ROM_PTR(&pin_P0_00) }, + { MP_ROM_QSTR(MP_QSTR_MICROPHONE_DATA), MP_ROM_PTR(&pin_P0_27) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P1_15) }, + + { MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_P0_30) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_P0_01) }, + + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_P0_04) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_06) }, + + { 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/nrf/boards/aramcon2_badge/pins.c b/ports/nrf/boards/aramcon2_badge/pins.c index 0a44f0d5a9..43d2f7f1c6 100644 --- a/ports/nrf/boards/aramcon2_badge/pins.c +++ b/ports/nrf/boards/aramcon2_badge/pins.c @@ -1,6 +1,8 @@ #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_UP_BUTTON), MP_ROM_PTR(&pin_P0_31) }, { MP_ROM_QSTR(MP_QSTR_LEFT_BUTTON), MP_ROM_PTR(&pin_P0_29) }, { MP_ROM_QSTR(MP_QSTR_DOWN_BUTTON), MP_ROM_PTR(&pin_P1_13) }, diff --git a/ports/nrf/boards/aramcon_badge_2019/pins.c b/ports/nrf/boards/aramcon_badge_2019/pins.c index 82ab200131..789fd0dfee 100644 --- a/ports/nrf/boards/aramcon_badge_2019/pins.c +++ b/ports/nrf/boards/aramcon_badge_2019/pins.c @@ -1,6 +1,8 @@ #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_LEFT_BUTTON), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_MIDDLE_BUTTON), MP_ROM_PTR(&pin_P0_29) }, { MP_ROM_QSTR(MP_QSTR_RIGHT_BUTTON), MP_ROM_PTR(&pin_P0_31) }, diff --git a/ports/nrf/boards/arduino_nano_33_ble/pins.c b/ports/nrf/boards/arduino_nano_33_ble/pins.c index 9cdd369331..ca420dedf9 100644 --- a/ports/nrf/boards/arduino_nano_33_ble/pins.c +++ b/ports/nrf/boards/arduino_nano_33_ble/pins.c @@ -1,6 +1,8 @@ #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_D2), MP_ROM_PTR(&pin_P1_11) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_12) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_15) }, diff --git a/ports/nrf/boards/bastble/pins.c b/ports/nrf/boards/bastble/pins.c index b35dad43de..d6df28aebe 100644 --- a/ports/nrf/boards/bastble/pins.c +++ b/ports/nrf/boards/bastble/pins.c @@ -1,6 +1,8 @@ #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_D2), MP_ROM_PTR(&pin_P1_11) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_10) }, { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_00) }, diff --git a/ports/nrf/boards/bless_dev_board_multi_sensor/pins.c b/ports/nrf/boards/bless_dev_board_multi_sensor/pins.c index c6010a8c33..87ab3c4f98 100644 --- a/ports/nrf/boards/bless_dev_board_multi_sensor/pins.c +++ b/ports/nrf/boards/bless_dev_board_multi_sensor/pins.c @@ -1,6 +1,8 @@ #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_D2), MP_ROM_PTR(&pin_P0_02) }, // TP7 { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_03) }, // TP6 { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_04) }, // LED1 diff --git a/ports/nrf/boards/bluemicro840/board.c b/ports/nrf/boards/bluemicro840/board.c new file mode 100644 index 0000000000..688cfb4ded --- /dev/null +++ b/ports/nrf/boards/bluemicro840/board.c @@ -0,0 +1,38 @@ +/* + * 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) { + +} diff --git a/ports/nrf/boards/bluemicro840/mpconfigboard.h b/ports/nrf/boards/bluemicro840/mpconfigboard.h new file mode 100644 index 0000000000..99a1e0bfbe --- /dev/null +++ b/ports/nrf/boards/bluemicro840/mpconfigboard.h @@ -0,0 +1,46 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2021 Pierre Constantineau + * + * + * 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 "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "BlueMicro840" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define BOARD_HAS_CRYSTAL 1 + +#define MICROPY_HW_LED_STATUS (&pin_P1_04) // RED + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_17) // 0.17 - same position as Pro Micro +#define DEFAULT_I2C_BUS_SDA (&pin_P0_15) // 0.15 - same position as Pro Micro + +#define DEFAULT_SPI_BUS_SCK (&pin_P0_24) // 0.24 - same position as Pro Micro +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_10) // 0.10 - same position as Pro Micro +#define DEFAULT_SPI_BUS_MISO (&pin_P0_09) // 0.09 - same position as Pro Micro + +#define DEFAULT_UART_BUS_RX (&pin_P0_08) // 0.08 - same position as Pro Micro +#define DEFAULT_UART_BUS_TX (&pin_P0_06) // 0.06 - same position as Pro Micro diff --git a/ports/nrf/boards/bluemicro840/mpconfigboard.mk b/ports/nrf/boards/bluemicro840/mpconfigboard.mk new file mode 100644 index 0000000000..16d36704a3 --- /dev/null +++ b/ports/nrf/boards/bluemicro840/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x1D50 +USB_PID = 0x6161 +USB_PRODUCT = "BlueMicro840" +USB_MANUFACTURER = "nrf52.jpconstantineau.com" + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/bluemicro840/pins.c b/ports/nrf/boards/bluemicro840/pins.c new file mode 100644 index 0000000000..368af9ea9c --- /dev/null +++ b/ports/nrf/boards/bluemicro840/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_P0_02), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P0_03), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_P0_05), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_P0_06), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_P0_07), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_P0_08), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_P0_09), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_P0_10), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_P0_11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_P0_14), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_P0_15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_P0_16), MP_ROM_PTR(&pin_P0_16) }, + { MP_ROM_QSTR(MP_QSTR_P0_17), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_P0_19), MP_ROM_PTR(&pin_P0_19) }, + { MP_ROM_QSTR(MP_QSTR_P0_20), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_P0_21), MP_ROM_PTR(&pin_P0_21) }, + { MP_ROM_QSTR(MP_QSTR_P0_22), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_P0_23), MP_ROM_PTR(&pin_P0_23) }, + { MP_ROM_QSTR(MP_QSTR_P0_24), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_P0_25), MP_ROM_PTR(&pin_P0_25) }, + { MP_ROM_QSTR(MP_QSTR_P0_26), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_P0_27), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_P0_28), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_P0_29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_P0_30), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_P0_31), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_P1_00), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_P1_01), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_P1_02), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_P1_03), MP_ROM_PTR(&pin_P1_03) }, + { MP_ROM_QSTR(MP_QSTR_P1_04), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_P1_05), MP_ROM_PTR(&pin_P1_05) }, + { MP_ROM_QSTR(MP_QSTR_P1_06), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_P1_07), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_08), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_P1_09), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_P1_10), MP_ROM_PTR(&pin_P1_10) }, + { MP_ROM_QSTR(MP_QSTR_P1_11), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_P1_12), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_P1_13), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_P1_14), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_P1_15), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_LED2), MP_ROM_PTR(&pin_P1_10) }, + { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_10) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_VCC_ON), MP_ROM_PTR(&pin_P0_12) }, + { 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_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/nrf/boards/circuitplayground_bluefruit/board.c b/ports/nrf/boards/circuitplayground_bluefruit/board.c index a0013e7215..938d92aff1 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/board.c +++ b/ports/nrf/boards/circuitplayground_bluefruit/board.c @@ -33,14 +33,7 @@ #include "nrf_gpio.h" void board_init(void) { -} - -bool board_requests_safe_mode(void) { - return false; -} - -void reset_board(void) { - // Turn off board.POWER_SWITCH (power-saving switch) on each soft reload, to prevent confusion. + // Turn on power to sensors and neopixels. nrf_gpio_cfg(POWER_SWITCH_PIN->number, NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT, @@ -48,6 +41,23 @@ void reset_board(void) { NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE); nrf_gpio_pin_write(POWER_SWITCH_PIN->number, false); +} +void board_deinit(void) { + // Turn off power to sensors and neopixels. + nrf_gpio_cfg(POWER_SWITCH_PIN->number, + NRF_GPIO_PIN_DIR_OUTPUT, + NRF_GPIO_PIN_INPUT_DISCONNECT, + NRF_GPIO_PIN_NOPULL, + NRF_GPIO_PIN_S0S1, + NRF_GPIO_PIN_NOSENSE); + 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); } diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h index da32230a6f..69bff08761 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h @@ -32,6 +32,9 @@ #define MICROPY_HW_LED_STATUS (&pin_P1_14) +#define MICROPY_HW_NEOPIXEL (&pin_P0_13) +#define MICROPY_HW_NEOPIXEL_COUNT (10) + // Board does not have a 32kHz crystal. It does have a 32MHz crystal. #define BOARD_HAS_32KHZ_XTAL (0) diff --git a/ports/nrf/boards/circuitplayground_bluefruit/pins.c b/ports/nrf/boards/circuitplayground_bluefruit/pins.c index f600282528..9c0b815a5b 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/pins.c +++ b/ports/nrf/boards/circuitplayground_bluefruit/pins.c @@ -1,6 +1,8 @@ #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_AUDIO), MP_ROM_PTR(&pin_P0_26) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_26) }, { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_P0_26) }, diff --git a/ports/nrf/boards/clue_nrf52840_express/board.c b/ports/nrf/boards/clue_nrf52840_express/board.c index b5c0f56ba3..c926813732 100644 --- a/ports/nrf/boards/clue_nrf52840_express/board.c +++ b/ports/nrf/boards/clue_nrf52840_express/board.c @@ -80,7 +80,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_P1_05, // backlight pin diff --git a/ports/nrf/boards/clue_nrf52840_express/pins.c b/ports/nrf/boards/clue_nrf52840_express/pins.c index 61d77cedc9..648477da4a 100644 --- a/ports/nrf/boards/clue_nrf52840_express/pins.c +++ b/ports/nrf/boards/clue_nrf52840_express/pins.c @@ -4,6 +4,8 @@ #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_P0), MP_ROM_PTR(&pin_P0_04) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_04) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_04) }, @@ -73,6 +75,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P17), MP_ROM_PTR(&pin_P1_01) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_P1_01) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_01) }, { MP_ROM_QSTR(MP_QSTR_P18), MP_ROM_PTR(&pin_P0_16) }, { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_P0_16) }, diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index 855d8522fc..dda31e4fdc 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -62,8 +62,8 @@ SECTIONS .text : { . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.text))) /* .text sections (code) */ + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.text*))) /* .text* sections (code) */ *(.rodata) /* .rodata sections (constants, strings, etc.) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ /* *(.glue_7) */ /* glue arm to thumb code */ @@ -73,32 +73,32 @@ SECTIONS _etext = .; /* define a global symbol at end of code */ } >FLASH_FIRMWARE - /* used by the startup to initialize data */ - _sidata = .; - /* This is the initialized data section The program executes knowing that the data is in the RAM but the loader puts the initial values in the FLASH (inidata). It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT (_sidata) + .data : { . = ALIGN(4); _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ _ram_start = .; /* create a global symbol at ram start for garbage collector */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.data))) /* .data sections */ + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.data*))) /* .data* sections */ . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >APP_RAM + } >APP_RAM AT > FLASH_FIRMWARE + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); /* Zero-initialized data section */ .bss : { . = ALIGN(4); _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss))) + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.bss*))) *(COMMON) . = ALIGN(4); diff --git a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk index 30946057c9..2b46f4397a 100644 --- a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk +++ b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.mk @@ -8,5 +8,4 @@ MCU_CHIP = nrf52840 INTERNAL_FLASH_FILESYSTEM = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_DISPLAYIO = 1 -CIRCUITPY_GAMEPAD = 1 CIRCUITPY_STAGE = 1 diff --git a/ports/nrf/boards/electronut_labs_blip/pins.c b/ports/nrf/boards/electronut_labs_blip/pins.c index a8f9af1cd7..6018ca5d55 100644 --- a/ports/nrf/boards/electronut_labs_blip/pins.c +++ b/ports/nrf/boards/electronut_labs_blip/pins.c @@ -1,6 +1,8 @@ #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_P0_03) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_04) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_28) }, @@ -57,6 +59,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P0_14) }, { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_14) }, { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P0_15) }, { MP_ROM_QSTR(MP_QSTR_GREEN_LED), MP_ROM_PTR(&pin_P0_13) }, diff --git a/ports/nrf/boards/electronut_labs_papyr/pins.c b/ports/nrf/boards/electronut_labs_papyr/pins.c index ef0178e9b1..6bfaf2f92d 100644 --- a/ports/nrf/boards/electronut_labs_papyr/pins.c +++ b/ports/nrf/boards/electronut_labs_papyr/pins.c @@ -1,6 +1,8 @@ #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_A5), MP_ROM_PTR(&pin_P0_05) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_06) }, @@ -31,6 +33,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_05) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_14) }, { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P0_14) }, { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P0_15) }, diff --git a/ports/nrf/boards/feather_bluefruit_sense/pins.c b/ports/nrf/boards/feather_bluefruit_sense/pins.c index c4863e17fb..d0414c6b73 100644 --- a/ports/nrf/boards/feather_bluefruit_sense/pins.c +++ b/ports/nrf/boards/feather_bluefruit_sense/pins.c @@ -1,6 +1,8 @@ #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_P0_04) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_30) }, @@ -41,6 +43,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_12) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_09) }, { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_09) }, { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_10) }, diff --git a/ports/nrf/boards/feather_nrf52840_express/pins.c b/ports/nrf/boards/feather_nrf52840_express/pins.c index ec2689ab45..89757e3b5c 100644 --- a/ports/nrf/boards/feather_nrf52840_express/pins.c +++ b/ports/nrf/boards/feather_nrf52840_express/pins.c @@ -1,6 +1,8 @@ #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_P0_04) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_30) }, @@ -40,6 +42,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_12) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_15) }, diff --git a/ports/nrf/boards/hiibot_bluefi/board.c b/ports/nrf/boards/hiibot_bluefi/board.c index daca539619..29d0927dfe 100644 --- a/ports/nrf/boards/hiibot_bluefi/board.c +++ b/ports/nrf/boards/hiibot_bluefi/board.c @@ -81,7 +81,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_P1_13, // backlight pin diff --git a/ports/nrf/boards/hiibot_bluefi/pins.c b/ports/nrf/boards/hiibot_bluefi/pins.c index f871d5db86..2a18996c72 100644 --- a/ports/nrf/boards/hiibot_bluefi/pins.c +++ b/ports/nrf/boards/hiibot_bluefi/pins.c @@ -4,6 +4,8 @@ #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_P0), MP_ROM_PTR(&pin_P0_28) }, { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_28) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_28) }, @@ -70,6 +72,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_P17), MP_ROM_PTR(&pin_P1_12) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_12) }, { MP_ROM_QSTR(MP_QSTR_REDLED), MP_ROM_PTR(&pin_P1_12) }, { MP_ROM_QSTR(MP_QSTR_P18), MP_ROM_PTR(&pin_P1_10) }, diff --git a/ports/nrf/boards/ikigaisense_vita/pins.c b/ports/nrf/boards/ikigaisense_vita/pins.c index 021f94f306..4c8a45b9c9 100644 --- a/ports/nrf/boards/ikigaisense_vita/pins.c +++ b/ports/nrf/boards/ikigaisense_vita/pins.c @@ -1,6 +1,8 @@ #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_P0_29) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P1_13) }, @@ -27,6 +29,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_ADDON_SDA), MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_27) }, { MP_ROM_QSTR(MP_QSTR_YELLOW_LED), MP_ROM_PTR(&pin_P0_27) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, diff --git a/ports/nrf/boards/itsybitsy_nrf52840_express/pins.c b/ports/nrf/boards/itsybitsy_nrf52840_express/pins.c index ad5fabc509..2895fc4684 100644 --- a/ports/nrf/boards/itsybitsy_nrf52840_express/pins.c +++ b/ports/nrf/boards/itsybitsy_nrf52840_express/pins.c @@ -1,6 +1,8 @@ #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_P0_04) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_30) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_28) }, @@ -38,6 +40,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_20) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, diff --git a/ports/nrf/boards/makerdiary_m60_keyboard/pins.c b/ports/nrf/boards/makerdiary_m60_keyboard/pins.c index 82e9dfc5a0..9ee0a06e59 100644 --- a/ports/nrf/boards/makerdiary_m60_keyboard/pins.c +++ b/ports/nrf/boards/makerdiary_m60_keyboard/pins.c @@ -4,6 +4,8 @@ #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_R1), MP_ROM_PTR(&pin_P0_05) }, { MP_ROM_QSTR(MP_QSTR_R2), MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_R3), MP_ROM_PTR(&pin_P0_07) }, diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c index 51e453c1f0..0ed150f2b1 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/board.c @@ -81,7 +81,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_P0_20, // backlight pin diff --git a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c index a8eaab092e..b5b88001b4 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c +++ b/ports/nrf/boards/makerdiary_nrf52840_m2_devkit/pins.c @@ -4,6 +4,8 @@ #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_AIN0), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_AIN1), MP_ROM_PTR(&pin_P0_03) }, { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_04) }, diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/pins.c b/ports/nrf/boards/makerdiary_nrf52840_mdk/pins.c index bd0e6e4802..00d2b394ac 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk/pins.c +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/pins.c @@ -1,6 +1,8 @@ #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_AIN0), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_AIN1), MP_ROM_PTR(&pin_P0_03) }, { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_04) }, diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/pins.c b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/pins.c index 05813bd04a..da09d86648 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/pins.c +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/pins.c @@ -1,6 +1,8 @@ #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_AIN0), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_AIN1), MP_ROM_PTR(&pin_P0_03) }, { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_04) }, diff --git a/ports/nrf/boards/metro_nrf52840_express/pins.c b/ports/nrf/boards/metro_nrf52840_express/pins.c index 452e31202b..44e353ea4a 100644 --- a/ports/nrf/boards/metro_nrf52840_express/pins.c +++ b/ports/nrf/boards/metro_nrf52840_express/pins.c @@ -1,6 +1,8 @@ #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_P0_04) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_28) }, @@ -32,7 +34,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_08) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P1_09) }, - { MP_ROM_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P0_14) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_15) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_16) }, @@ -44,6 +46,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_11) }, { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_13) }, { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_13) }, { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_15) }, diff --git a/ports/nrf/boards/microbit_v2/pins.c b/ports/nrf/boards/microbit_v2/pins.c index 4f33b98e5a..f7de5c33e4 100644 --- a/ports/nrf/boards/microbit_v2/pins.c +++ b/ports/nrf/boards/microbit_v2/pins.c @@ -1,6 +1,8 @@ #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_P0), MP_ROM_PTR(&pin_P0_02) }, // RING0 { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_P0_03) }, // RING1 { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_P0_04) }, // RING2 diff --git a/ports/nrf/boards/nice_nano/pins.c b/ports/nrf/boards/nice_nano/pins.c index 98c1251fe3..1a8dcc101f 100644 --- a/ports/nrf/boards/nice_nano/pins.c +++ b/ports/nrf/boards/nice_nano/pins.c @@ -1,6 +1,8 @@ #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_P0_02), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, { MP_ROM_QSTR(MP_QSTR_P0_06), MP_ROM_PTR(&pin_P0_06) }, diff --git a/ports/nrf/boards/ohs2020_badge/board.c b/ports/nrf/boards/ohs2020_badge/board.c index 1522e45c9a..da90e08239 100644 --- a/ports/nrf/boards/ohs2020_badge/board.c +++ b/ports/nrf/boards/ohs2020_badge/board.c @@ -80,7 +80,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_P0_02, // backlight pin diff --git a/ports/nrf/boards/ohs2020_badge/pins.c b/ports/nrf/boards/ohs2020_badge/pins.c index 2cf783cc1e..ab895289d0 100644 --- a/ports/nrf/boards/ohs2020_badge/pins.c +++ b/ports/nrf/boards/ohs2020_badge/pins.c @@ -2,6 +2,8 @@ #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_MICROPHONE_CLOCK), MP_ROM_PTR(&pin_P0_25) }, { MP_ROM_QSTR(MP_QSTR_MICROPHONE_DATA), MP_ROM_PTR(&pin_P0_28) }, diff --git a/ports/nrf/boards/particle_argon/mpconfigboard.h b/ports/nrf/boards/particle_argon/mpconfigboard.h index a4952fc797..a858a20b05 100644 --- a/ports/nrf/boards/particle_argon/mpconfigboard.h +++ b/ports/nrf/boards/particle_argon/mpconfigboard.h @@ -30,11 +30,9 @@ #define MICROPY_HW_BOARD_NAME "Particle Argon" #define MICROPY_HW_MCU_NAME "nRF52840" -#define MICROPY_HW_LED_STATUS (&pin_P1_12) - -#define MICROPY_HW_RGB_LED_RED (&pin_P0_13) -#define MICROPY_HW_RGB_LED_GREEN (&pin_P0_14) -#define MICROPY_HW_RGB_LED_BLUE (&pin_P0_15) +#define CIRCUITPY_RGB_STATUS_R (&pin_P0_13) +#define CIRCUITPY_RGB_STATUS_G (&pin_P0_14) +#define CIRCUITPY_RGB_STATUS_B (&pin_P0_15) #if QSPI_FLASH_FILESYSTEM #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20) diff --git a/ports/nrf/boards/particle_argon/pins.c b/ports/nrf/boards/particle_argon/pins.c index 9fab9e6b6a..6619266914 100644 --- a/ports/nrf/boards/particle_argon/pins.c +++ b/ports/nrf/boards/particle_argon/pins.c @@ -1,6 +1,8 @@ #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_P0_03) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_04) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_28) }, @@ -23,8 +25,11 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_08) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_10) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P1_12) }, { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P1_03) }, { MP_ROM_QSTR(MP_QSTR_RGB_LED_RED), MP_ROM_PTR(&pin_P0_13) }, diff --git a/ports/nrf/boards/particle_boron/mpconfigboard.h b/ports/nrf/boards/particle_boron/mpconfigboard.h index bab1b3d5cd..fd000d7376 100644 --- a/ports/nrf/boards/particle_boron/mpconfigboard.h +++ b/ports/nrf/boards/particle_boron/mpconfigboard.h @@ -30,11 +30,9 @@ #define MICROPY_HW_BOARD_NAME "Particle Boron" #define MICROPY_HW_MCU_NAME "nRF52840" -#define MICROPY_HW_LED_STATUS (&pin_P1_12) - -#define MICROPY_HW_RGB_LED_RED (&pin_P0_13) -#define MICROPY_HW_RGB_LED_GREEN (&pin_P0_14) -#define MICROPY_HW_RGB_LED_BLUE (&pin_P0_15) +#define CIRCUITPY_RGB_STATUS_R (&pin_P0_13) +#define CIRCUITPY_RGB_STATUS_G (&pin_P0_14) +#define CIRCUITPY_RGB_STATUS_B (&pin_P0_15) #if QSPI_FLASH_FILESYSTEM #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20) diff --git a/ports/nrf/boards/particle_boron/pins.c b/ports/nrf/boards/particle_boron/pins.c index 4d6f3e7de2..c16a1e8763 100644 --- a/ports/nrf/boards/particle_boron/pins.c +++ b/ports/nrf/boards/particle_boron/pins.c @@ -1,6 +1,8 @@ #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_P0_03) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_04) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_28) }, @@ -22,8 +24,11 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_08) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_10) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P1_12) }, { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P1_03) }, { MP_ROM_QSTR(MP_QSTR_RGB_LED_RED), MP_ROM_PTR(&pin_P0_13) }, diff --git a/ports/nrf/boards/particle_xenon/pins.c b/ports/nrf/boards/particle_xenon/pins.c index a50c8b6418..4b0529be24 100644 --- a/ports/nrf/boards/particle_xenon/pins.c +++ b/ports/nrf/boards/particle_xenon/pins.c @@ -1,6 +1,8 @@ #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_P0_03) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_04) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_28) }, @@ -23,8 +25,11 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_08) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_10) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P1_12) }, { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P1_03) }, { MP_ROM_QSTR(MP_QSTR_RGB_LED_RED), MP_ROM_PTR(&pin_P0_13) }, diff --git a/ports/nrf/boards/pca10056/examples/buttons.py b/ports/nrf/boards/pca10056/examples/buttons.py deleted file mode 100644 index 4db3576970..0000000000 --- a/ports/nrf/boards/pca10056/examples/buttons.py +++ /dev/null @@ -1,26 +0,0 @@ -import board -import digitalio -import gamepad -import time - -pad = gamepad.GamePad( - digitalio.DigitalInOut(board.P0_11), - digitalio.DigitalInOut(board.P0_12), - digitalio.DigitalInOut(board.P0_24), - digitalio.DigitalInOut(board.P0_25), -) - -prev_buttons = 0 - -while True: - buttons = pad.get_pressed() - - if buttons != prev_buttons: - for i in range(0, 4): - bit = 1 << i - if (buttons & bit) != (prev_buttons & bit): - print("Button %d %s" % (i + 1, "pressed" if buttons & bit else "released")) - - prev_buttons = buttons - - time.sleep(0.1) diff --git a/ports/nrf/boards/pca10056/pins.c b/ports/nrf/boards/pca10056/pins.c index e00bc8a11e..75b1c3ea6c 100644 --- a/ports/nrf/boards/pca10056/pins.c +++ b/ports/nrf/boards/pca10056/pins.c @@ -1,6 +1,8 @@ #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_P0_00), MP_ROM_PTR(&pin_P0_00) }, { MP_ROM_QSTR(MP_QSTR_P0_01), MP_ROM_PTR(&pin_P0_01) }, { MP_ROM_QSTR(MP_QSTR_P0_02), MP_ROM_PTR(&pin_P0_02) }, diff --git a/ports/nrf/boards/pca10059/pins.c b/ports/nrf/boards/pca10059/pins.c index 932b925d17..f49a290ddf 100644 --- a/ports/nrf/boards/pca10059/pins.c +++ b/ports/nrf/boards/pca10059/pins.c @@ -1,6 +1,8 @@ #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_P0_02), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, { MP_ROM_QSTR(MP_QSTR_P0_05), MP_ROM_PTR(&pin_P0_05) }, diff --git a/ports/nrf/boards/pca10100/mpconfigboard.h b/ports/nrf/boards/pca10100/mpconfigboard.h index 00c10fc255..20d9d9aeb3 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.h +++ b/ports/nrf/boards/pca10100/mpconfigboard.h @@ -39,6 +39,9 @@ #define CIRCUITPY_BLE_CONFIG_SIZE (12 * 1024) +// Take 1k RAM to save 1k flash. +#define CIRCUITPY_PRECOMPUTE_QSTR_ATTR (0) + // Reduce nRF SoftRadio memory usage #define BLEIO_VS_UUID_COUNT 10 #define BLEIO_HVN_TX_QUEUE_SIZE 2 @@ -48,3 +51,5 @@ #define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 2) #define SOFTDEVICE_RAM_SIZE (32 * 1024) + +#define MICROPY_FATFS_EXFAT 0 diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk index 6381df74f4..59f2b217c3 100644 --- a/ports/nrf/boards/pca10100/mpconfigboard.mk +++ b/ports/nrf/boards/pca10100/mpconfigboard.mk @@ -7,10 +7,12 @@ 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 @@ -26,8 +28,10 @@ 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 diff --git a/ports/nrf/boards/pca10100/pins.c b/ports/nrf/boards/pca10100/pins.c index dd030bae9a..68d87d0e8f 100644 --- a/ports/nrf/boards/pca10100/pins.c +++ b/ports/nrf/boards/pca10100/pins.c @@ -1,6 +1,8 @@ #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_NFC1), MP_ROM_PTR(&pin_P0_09) }, { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, diff --git a/ports/nrf/boards/pitaya_go/pins.c b/ports/nrf/boards/pitaya_go/pins.c index c0f2976a57..40ab422714 100644 --- a/ports/nrf/boards/pitaya_go/pins.c +++ b/ports/nrf/boards/pitaya_go/pins.c @@ -1,6 +1,8 @@ #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_AIN0), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_AIN1), MP_ROM_PTR(&pin_P0_03) }, { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_04) }, diff --git a/ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.h b/ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.h index 93fdce3a0e..28bfbd1703 100644 --- a/ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.h +++ b/ports/nrf/boards/raytac_mdbt50q-db-40/mpconfigboard.h @@ -28,3 +28,4 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_HW_LED_STATUS (&pin_P0_13) +#define MICROPY_HW_LED_STATUS_INVERTED (1) diff --git a/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c b/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c index 426498cc20..0af7e6c6c1 100644 --- a/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c +++ b/ports/nrf/boards/raytac_mdbt50q-db-40/pins.c @@ -1,6 +1,8 @@ #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_P0_02), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_P0_03), MP_ROM_PTR(&pin_P0_03) }, { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, @@ -66,6 +68,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_CTS), MP_ROM_PTR(&pin_P0_07) }, { MP_ROM_QSTR(MP_QSTR_RTS), MP_ROM_PTR(&pin_P0_05) }, + // Note that these are inverted; you must pull them low to turn on the LEDs. { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_P0_14) }, { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_P0_13) }, { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_P0_15) }, diff --git a/ports/nrf/boards/raytac_mdbt50q-rx/board.c b/ports/nrf/boards/raytac_mdbt50q-rx/board.c new file mode 100644 index 0000000000..688cfb4ded --- /dev/null +++ b/ports/nrf/boards/raytac_mdbt50q-rx/board.c @@ -0,0 +1,38 @@ +/* + * 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) { + +} diff --git a/ports/nrf/boards/raytac_mdbt50q-rx/mpconfigboard.h b/ports/nrf/boards/raytac_mdbt50q-rx/mpconfigboard.h new file mode 100644 index 0000000000..92629a9e47 --- /dev/null +++ b/ports/nrf/boards/raytac_mdbt50q-rx/mpconfigboard.h @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * + * 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 "MDBT50Q-RX Dongle" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_LED_STATUS (&pin_P1_13) +#define MICROPY_HW_LED_STATUS_INVERTED (1) diff --git a/ports/nrf/boards/raytac_mdbt50q-rx/mpconfigboard.mk b/ports/nrf/boards/raytac_mdbt50q-rx/mpconfigboard.mk new file mode 100644 index 0000000000..08c7266d36 --- /dev/null +++ b/ports/nrf/boards/raytac_mdbt50q-rx/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x239A +USB_PID = 0x810C +USB_PRODUCT = "MDBT50Q-RX Dongle" +USB_MANUFACTURER = "Raytac Corporation" + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/raytac_mdbt50q-rx/pins.c b/ports/nrf/boards/raytac_mdbt50q-rx/pins.c new file mode 100644 index 0000000000..04ee337543 --- /dev/null +++ b/ports/nrf/boards/raytac_mdbt50q-rx/pins.c @@ -0,0 +1,13 @@ +#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_P0_15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_P0_15) }, + + { MP_ROM_QSTR(MP_QSTR_P1_13), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_INVERTED_LED), MP_ROM_PTR(&pin_P1_13) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/nrf/boards/simmel/mpconfigboard.h b/ports/nrf/boards/simmel/mpconfigboard.h index 9361e8ef23..984d3df03c 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.h +++ b/ports/nrf/boards/simmel/mpconfigboard.h @@ -57,3 +57,5 @@ #define BLEIO_ATTR_TAB_SIZE (BLE_GATTS_ATTR_TAB_SIZE_DEFAULT * 2) #define SOFTDEVICE_RAM_SIZE (32 * 1024) + +#define MICROPY_FATFS_EXFAT 0 diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk index 4f6385260e..82fc68a235 100644 --- a/ports/nrf/boards/simmel/mpconfigboard.mk +++ b/ports/nrf/boards/simmel/mpconfigboard.mk @@ -20,6 +20,7 @@ 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 @@ -27,6 +28,7 @@ CIRCUITPY_NVM = 0 CIRCUITPY_PIXELBUF = 0 CIRCUITPY_PULSEIO = 0 CIRCUITPY_PWMIO = 1 +CIRCUITPY_RAINBOWIO = 0 CIRCUITPY_RGBMATRIX = 0 CIRCUITPY_ROTARYIO = 0 CIRCUITPY_RTC = 1 diff --git a/ports/nrf/boards/simmel/pins.c b/ports/nrf/boards/simmel/pins.c index e9710967b6..6ff455b628 100644 --- a/ports/nrf/boards/simmel/pins.c +++ b/ports/nrf/boards/simmel/pins.c @@ -1,6 +1,8 @@ #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_SPI_CSN), MP_ROM_PTR(&pin_P1_06) }, { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_P1_04) }, { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_P0_09) }, diff --git a/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md b/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md index 094102c277..5c41fdb7cf 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md +++ b/ports/nrf/boards/sparkfun_nrf52840_micromod/README.md @@ -10,56 +10,64 @@ We've also routed two I2C buses, 2 SPI buses, eleven GPIO, dedicated CircuitPython pin definitions, while simialr to other boards represent a slight departure from just the typical `A` and `D` pin definitions. The majority of general pins are labled as `G` (or alternatively, `BUS`,) as the MicroMod system they build on uses those names to specify pins that may not be specficially analog or digital. -This can be somewhat confusing, especially around the analog pins. Here's a quick pin-map. This pin map will use the label either on the [SparkFun MicroMod ATP Carrier Board](https://www.sparkfun.com/products/16885), or the pin name on the [graphical datasheet](https://cdn.sparkfun.com/assets/learn_tutorials/1/4/0/1/MicroMod_nRF52840_v1.0_Graphical_Datasheet.pdf). Some of the aditional aliases are just names to make naming consistent (e.g.: RTS/CTS), but they also can refer to additional functionality a pin may have (e.g.: NFC pins) +This can be somewhat confusing, especially around the analog pins. Here's a quick pin-map: MicroMod Pin # | ATP Pin Label | Pin Definition | Additional Definitons | Pin/Port Reference | Notes :--------------|:--------------|:--------------|:-----------------------|:-------------------|:------ 8 | G11 | | | (Not Connected) | 10 | D0 | D0 | | P0_27 | -11 | BOOT | BOOT | BUTTON1 | P0_07 | -12 | SDA | SDA | | P0_08 | -13 | RTS1 | RTS | RTS1 | P1_02 | -14 | SCL | SCL | | P0_11 | -15 | CTS1 | CTS | CTS1 | P1_09 | -16 | /I2C INT | I2C_INT | P0_15 | -17 | TX | TX | TX1 | P1_03 | -18 | D1 | D1 | CAM_TRIG | P1_08 | -19 | RX | RX | RX1 | P1_10 | -20 | RX2 | RX2 | | P1_05 | -22 | TX2 | TX2 | | P1_07 | -32 | PWM0 | PWM0 | P0_06 | -34 | A0 | A0 | ADC0 | P0_04 | Attached to AIN2 -38 | A1 | A1 | ADC1 | P0_05 | Attached to AIN3 +11 | BOOT | BOOT | | P0_07 | +12 | SDA | I2C_SDA | SDA | P0_08 | +13 | RTS1 | UART_RTS1 | | P1_02 | +14 | SCL | I2C_SCL | SCL | P0_11 | +15 | CTS1 | UART_CTS1 | | P1_09 | +16 | /I2C INT | I2C_INT | |P0_15| +17 | TX | UART_TX1 | TX | P1_03 | +18 | D1 | D1 | | P1_08 | +19 | RX | UART_RX1 | RX | P1_10 | +20 | RX2 | UART_RX2 | | P1_05 | +22 | TX2 | UART_TX2 | | P1_07 | +32 | PWM0 | PWM0 | |P0_06| +34 | A0 | A0 | | P0_04 | Attached to AIN2 +38 | A1 | A1 | | P0_05 | Attached to AIN3 40 | G0 | G0 | BUS0 | P0_29 | Attached to AIN5 42 | G1 | G1 | BUS1 | P0_03 | Attached to AIN1 44 | G2 | G2 | BUS2 | P1_13 | 46 | G3 | G3 | BUS3 | P1_12 | -47 | PWM1 | PWM1 | P0_16 | +47 | PWM1 | PWM1 | |P0_16| 48 | G4 | G4 | BUS4 | P1_11 | -49 | BATT_VIN | BATT_VIN3 | | P0_30 | Attached to AIN6, will be battery voltage / 3. | +49 | BATT_VIN | BATT_VIN3 | | P0_30 | Attached to AIN6, will be battery voltage / 3. 50 | PDM_CLK | PDM_CLK | | P0_25 | -51 | SDA1 | SDA1 | | P1_01 | +51 | SDA1 | I2C_SDA1 | | P1_01 | 52 | PDM_DATA | PDM_DATA | | P0_26 | -53 | SCL1 | SCL1 | | P0_24 | -55 | /CS | CS | | P0_20 | -57 | SCK | SCK | | P0_28 | Attached to AIN4 -59 | COPI | COPI | MOSI | P0_31 | Attached to AIN7 -61 | CIPO | CIPO | MISO | P0_02 | -63 | G10 | G10 | NFC2, ADC_DP, CAM_VSYNC | P0_10 | Attached to NFC2 -65 | G9 | G9 | NFC1, ADC_DM, CAM_HSYNC | P0_09 | Attached to NFC1 +53 | SCL1 | I2C_SCL1 | | P0_24 | +55 | /CS | SPI_CS | | P0_20 | +57 | SCK | SPI_SCK | LED_CLK | P0_28 | Attached to AIN4 +59 | COPI | SPI_COPI | SPI_MOSI, LED_DAT | P0_31 | Attached to AIN7 +60 | SCK1 | SDIO_SCK | SPI_SCK1 | | +61 | CIPO | SPI_CIPO | SPI_MISO | P0_02 | +62 | COPI1 | SDIO_CMD | SPI_COPI1 | | +63 | G10 | G10 | | P0_10 | Attached to NFC2 +64 | CIPO1 | SDIO_DATA0 | SPI_CIPO1 | | +65 | G9 | G9 | | P0_09 | Attached to NFC1 +66 | DAT1 | SDIO_DATA1 | | | 67 | G8 | G8 | | P1_14 | +68 | DAT2 | SDIO_DATA2 | | | 69 | G7 | G7 | BUS7 | P1_04 | +70 | CS1 | SDIO_DATA3 | SPI_CS1 | | 71 | G6 | G6 | BUS6 | P1_06 | 73 | G5 | G5 | BUS5 | P0_15 | ## Peripheral Naming -CircuitPython attempts to stay in line with the naming of the serial peripheral naming in the MicroMod system. The bare UART pins are also named 1. The UART 2 pins are named 2. However, the I2C names on MicroMod are and 1. Perhaps this will change in the future, but as of [Interface v1](https://cdn.sparkfun.com/assets/learn_tutorials/1/2/0/6/SparkFun_MicroMod_Interface_v1.0_-_Pin_Descriptions.pdf), it may lead to some confusion. +The SparkFun MicroMod spec uses a zero-based peripheral numbering scheme. The 0th peripheral is the default and the "0" is omitted from the peripheral name. For example, the first I2C peripheral is named `I2C` (instead of `I2C0`) and the second I2C peripheral is named `I2C1`. Note: MicroMod `UART` is not present in the edge connector pinout because the primary debug serial port (i.e.`UART0`) is exposed as a virtual serial port over USB. As a result, the first UART peripheral in the edge connector pinout is `UART1` and the second UART peripheral is `UART2`. + +For more details, see https://www.sparkfun.com/micromod#tech-specs. ## Bootloader Notes -The MicroMod nRF52840 Processor needs to have the [Adafruit nRF52 UF2 bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader/pull/194) flashed on it. [[TODO: LINK TO BUILD]] +The MicroMod nRF52840 Processor needs to have the [Adafruit nRF52 UF2 bootloader](https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/latest) flashed on it. ## Hardware Reference diff --git a/ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.h b/ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.h index c53fc45d22..fec1d5ae02 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.h +++ b/ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.h @@ -27,9 +27,12 @@ #include "nrfx/hal/nrf_gpio.h" -#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod nRF52840" +#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod nRF52840 Processor" #define MICROPY_HW_MCU_NAME "nRF52840" +// Status LED +#define MICROPY_HW_LED_STATUS (&pin_P0_13) + #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) #define DEFAULT_I2C_BUS_SDA (&pin_P0_08) diff --git a/ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.mk b/ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.mk index 21ca20825a..83d51ecc6d 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.mk +++ b/ports/nrf/boards/sparkfun_nrf52840_micromod/mpconfigboard.mk @@ -1,6 +1,6 @@ USB_VID = 0x1B4F USB_PID = 0x0021 -USB_PRODUCT = "SFE_nRF52840_MicroMod" +USB_PRODUCT = "SparkFun MicroMod nRF52840 Processor" USB_MANUFACTURER = "SparkFun Electronics" MCU_CHIP = nrf52840 diff --git a/ports/nrf/boards/sparkfun_nrf52840_micromod/pins.c b/ports/nrf/boards/sparkfun_nrf52840_micromod/pins.c index 65700f24e4..13a63831e8 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_micromod/pins.c +++ b/ports/nrf/boards/sparkfun_nrf52840_micromod/pins.c @@ -1,113 +1,222 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2021 Chris Wilson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - // D pins (D0-D1) - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_27) }, // 0.27 - D0 - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P1_08) }, // 1.08 - D1 | CAM_TRIG - { MP_ROM_QSTR(MP_QSTR_CAM_TRIG), MP_ROM_PTR(&pin_P1_08) }, // CAM_TRIG alias + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // The SparkFun MicroMod spec uses a zero-based peripheral numbering scheme. + // The 0th peripheral is the default and the "0" is omitted from the + // peripheral name (e.g. "I2C" instead of "I2C0"). + // + // For more details, see https://www.sparkfun.com/micromod#tech-specs - // A pins (A0-A1) - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_04) }, // 0.04 - A0 | ADC0 (AIN2) - { MP_ROM_QSTR(MP_QSTR_ADC0), MP_ROM_PTR(&pin_P0_04) }, // ADC0 alias - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) }, // 0.05 - A1 | ADC1 (AIN3) - { MP_ROM_QSTR(MP_QSTR_ADC1), MP_ROM_PTR(&pin_P0_05) }, // ADC1 alias + // MicroMod built-in status LED pin + // Requirement from the "Designing with MicroMod" SparkFun article: + // "... every Processor Board shall include one status LED connected to a + // pin that is not connected to the board edge." + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_13) }, // MicroMod LED (P0.13) - // G pins (G0-G11, G11 NC) - { MP_ROM_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_P0_29) }, // 0.29 - G0 | GPIO0 | BUS0 (AIN5) - { MP_ROM_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_P0_29) }, // BUS0 alias - { MP_ROM_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_P0_03) }, // 0.03 - G1 | GPIO1 | BUS1 (AIN1) - { MP_ROM_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_P0_03) }, // BUS1 alias - { MP_ROM_QSTR(MP_QSTR_G2), MP_ROM_PTR(&pin_P1_13) }, // 1.13 - G2 | GPIO2 | BUS2 - { MP_ROM_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_P1_13) }, // BUS2 alias - { MP_ROM_QSTR(MP_QSTR_G3), MP_ROM_PTR(&pin_P1_12) }, // 1.12 - G3 | GPIO3 | BUS3 - { MP_ROM_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_P1_12) }, // BUS3 alias - { MP_ROM_QSTR(MP_QSTR_G4), MP_ROM_PTR(&pin_P1_11) }, // 1.11 - G4 | GPIO4 | BUS4 - { MP_ROM_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_P1_11) }, // BUS4 alias - { MP_ROM_QSTR(MP_QSTR_G5), MP_ROM_PTR(&pin_P0_17) }, // 0.17 - G5 | GPIO5 | BUS5 - { MP_ROM_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_P0_17) }, // BUS5 alias - { MP_ROM_QSTR(MP_QSTR_G6), MP_ROM_PTR(&pin_P1_06) }, // 1.06 - G6 | GPIO6 | BUS6 - { MP_ROM_QSTR(MP_QSTR_BUS6), MP_ROM_PTR(&pin_P1_06) }, // BUS6 alias - { MP_ROM_QSTR(MP_QSTR_G7), MP_ROM_PTR(&pin_P1_04) }, // 1.04 - G7 | GPIO7 | BUS7 - { MP_ROM_QSTR(MP_QSTR_BUS7), MP_ROM_PTR(&pin_P1_04) }, // BUS7 alias - { MP_ROM_QSTR(MP_QSTR_G8), MP_ROM_PTR(&pin_P1_14) }, // 1.14 - G8 | GPIO8 - { MP_ROM_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_P0_09) }, // 0.09 - G9 | GPIO9/NFC1 | ADC_D- | CAM_HSYNC (NFC1) - { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, // NFC1 alias - { MP_ROM_QSTR(MP_QSTR_ADC_DM), MP_ROM_PTR(&pin_P0_09) }, // ADC_DM alias - { MP_ROM_QSTR(MP_QSTR_CAM_HSYNC), MP_ROM_PTR(&pin_P0_09) }, // CAM_HSYNC alias - { MP_ROM_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_P0_10) }, // 0.10 - G10 | GPIO10/NFC2 | ADC_D+ | CAM_VSYNC (NFC2) - { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, // NFC2 alias - { MP_ROM_QSTR(MP_QSTR_ADC_DP), MP_ROM_PTR(&pin_P0_10) }, // ADC_DP alias - { MP_ROM_QSTR(MP_QSTR_CAM_VSYNC), MP_ROM_PTR(&pin_P0_10) }, // CAM_VSYNC alias - // NC - G11 + // MicroMod USB bus input voltage (+5V) pin + // { MP_ROM_QSTR(MP_QSTR_USB_VIN), MP_ROM_PTR() }, // MicroMod USB_VIN (MDBT50Q-P1M has a dedicated HW VBUS pin) - // PWM pins (PWM0-PWM1) - { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_P0_06) }, // 0.06 - PWM0 - { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_P0_16) }, // 0.16 - PWM1 + // MicroMod +3.3V enable pin + { MP_ROM_QSTR(MP_QSTR_P3V3_EN), MP_ROM_PTR(&pin_P1_15) }, // MicroMod 3.3V_EN (P1.15) - // PDM - { MP_ROM_QSTR(MP_QSTR_PDM_CLK), MP_ROM_PTR(&pin_P0_25) }, // 0.25 - PDM_CLK | AUD_BCLK - { MP_ROM_QSTR(MP_QSTR_PDM_DATA), MP_ROM_PTR(&pin_P0_26) }, // 0.26 - PDM_DATA | AUD_LRCLK + // MicroMod battery voltage sense pin + { MP_ROM_QSTR(MP_QSTR_BATT_VIN3), MP_ROM_PTR(&pin_P0_30) }, // MicroMod BATT_VIN/3 (P0.30) - // Battery Voltage Monitor - { MP_ROM_QSTR(MP_QSTR_BATT_VIN3), MP_ROM_PTR(&pin_P0_30) }, // 0.30 - BATT_VIN/3 (AIN6) + // MicroMod reset pin + { MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR(&pin_P0_18) }, // MicroMod RESET# (P0.18) - // I2C - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_08) }, // 0.08 - SDA - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_11) }, // 0.11 - SCL (TRACEDATA2) + // MicroMod boot pin + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_P0_07) }, // MicroMod BOOT (P0.07) - { MP_ROM_QSTR(MP_QSTR_I2C_INT), MP_ROM_PTR(&pin_P0_15) }, // 0.15 - I2C_INT + // MicroMod USB device pins + // USB device is always used internally by CircuitPython, so skip creating + // the pin objects for it. + // { MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR() }, // MicroMod USB_D- (MDBT50Q-P1M has a dedicated HW D- pin) + // { MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR() }, // MicroMod USB_D+ (MDBT50Q-P1M has a dedicated HW D+ pin) - { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_P1_01) }, // 1.01 - SDA1 - { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_P0_24) }, // 0.24 - SCL1 + // MicroMod USB host pins + // { MP_ROM_QSTR(MP_QSTR_USBHOST_DM), MP_ROM_PTR() }, // MicroMod USBHOST_D- (not supported) + // { MP_ROM_QSTR(MP_QSTR_USBHOST_DP), MP_ROM_PTR() }, // MicroMod USBHOST_D+ (not supported) - // SPI - { MP_ROM_QSTR(MP_QSTR_CIPO), MP_ROM_PTR(&pin_P0_02) }, // 0.02 - CIPO | SPI_CIPO - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_02) }, // MISO alias - { MP_ROM_QSTR(MP_QSTR_COPI), MP_ROM_PTR(&pin_P0_31) }, // 0.31 - COPI | SPI_COPI (AIN7) - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_31) }, // MOSI alias - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_28) }, // 0.28 - SCK | SPI_SCK (AIN4) - { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_P0_20) }, // 0.20 - /CS | SPI_/CS + // MicroMod CAN pins + // { MP_ROM_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR() }, // MicroMod CAN_RX (not supported) + // { MP_ROM_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR() }, // MicroMod CAN_TX (not supported) - // QSPI, used by flash on this board, but is broken out - // on the MicroMod connector, to to the SDIO pins. - { MP_ROM_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR(&pin_P0_19) }, // 0.00 - SDIO SCK | Used as: QSPI flash SCK - { MP_ROM_QSTR(MP_QSTR_SPI_SCK1), MP_ROM_PTR(&pin_P0_19) }, // SPI_SCK1 alias - { MP_ROM_QSTR(MP_QSTR_SDIO_CMD), MP_ROM_PTR(&pin_P0_14) }, // 0.00 - SDIO CMD | Used as: QSPI flash D0 (or SDI) - { MP_ROM_QSTR(MP_QSTR_SPI_COPI1), MP_ROM_PTR(&pin_P0_14) }, // SPI_COPI1 alias - { MP_ROM_QSTR(MP_QSTR_SDIO_DATA0), MP_ROM_PTR(&pin_P0_21) },// 0.00 - SDIO DATA0 | Used as: QSPI flash D1 (or SDO) - { MP_ROM_QSTR(MP_QSTR_SPI_CIPO1), MP_ROM_PTR(&pin_P0_21) }, // SPI_CIPO1 alias - { MP_ROM_QSTR(MP_QSTR_SDIO_DATA1), MP_ROM_PTR(&pin_P0_22) },// 0.00 - SDIO DATA1 | Unused for flash. - { MP_ROM_QSTR(MP_QSTR_SDIO_DATA2), MP_ROM_PTR(&pin_P0_23) },// 0.00 - SDIO DATA2 | Used as: QSPI flash D2 - { MP_ROM_QSTR(MP_QSTR_SDIO_DATA3), MP_ROM_PTR(&pin_P1_00) },// 0.00 - SDIO DATA3 | Use das: QSPI flash D3 (or /HOLD) - { MP_ROM_QSTR(MP_QSTR_SPI_CS1), MP_ROM_PTR(&pin_P1_00) }, // SPI_CS1 alias + // Note: MicroMod UART (UART0) is not present in the edge connector pinout + // because the primary debug serial port is exposed as a virtual serial port + // over USB. - // Reset Pin - { MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR(&pin_P1_14) }, // 0.18 - /RESET (NRESET) + // MicroMod UART1 pins + { MP_ROM_QSTR(MP_QSTR_UART_TX1), MP_ROM_PTR(&pin_P1_03) }, // MicroMod UART_TX1 | CircuitPython TX (P1.03) + { MP_ROM_QSTR(MP_QSTR_UART_RX1), MP_ROM_PTR(&pin_P1_10) }, // MicroMod UART_RX1 | CircuitPython RX (P1.10) + { MP_ROM_QSTR(MP_QSTR_UART_RTS1), MP_ROM_PTR(&pin_P1_02) }, // MicroMod RTS1 (P1.02) + { MP_ROM_QSTR(MP_QSTR_UART_CTS1), MP_ROM_PTR(&pin_P1_09) }, // MicroMod CTS1 (P1.09) - // LED - { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_P0_13) }, // 0.13 - LED_BUILTIN | STAT | Blue LED + // CircuitPython default UART pins + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P1_03) }, // CircuitPython TX | MicroMod UART_TX1 (P1.03) + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P1_10) }, // CircuitPython RX | MicroMod UART_RX1 (P1.10) - // Button - { MP_ROM_QSTR(MP_QSTR_BUTTON1), MP_ROM_PTR(&pin_P0_07) }, // 0.07 - /BOOT [Active Low] (TRACECLK) - Is button on carriers. - { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_P0_07) }, // BOOT alias + // MicroMod UART2 pins + { MP_ROM_QSTR(MP_QSTR_UART_TX2), MP_ROM_PTR(&pin_P1_07) }, // MicroMod UART_TX2 (P1.07) + { MP_ROM_QSTR(MP_QSTR_UART_RX2), MP_ROM_PTR(&pin_P1_05) }, // MicroMod UART_RX2 (P1.05) - // UART - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P1_10) }, // 1.10 - UART RX | RX1 - { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_P1_10) }, // RX1 alias - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P1_03) }, // 1.03 - UART TX | TX1 - { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_P1_03) }, // TX1 alias - { MP_ROM_QSTR(MP_QSTR_CTS), MP_ROM_PTR(&pin_P1_09) }, // 1.09 - UART CTS | CTS1 (TRACEDATA3) - { MP_ROM_QSTR(MP_QSTR_CTS1), MP_ROM_PTR(&pin_P1_09) }, // CTS1 alias - { MP_ROM_QSTR(MP_QSTR_RTS), MP_ROM_PTR(&pin_P1_02) }, // 1.02 - UART RTS | RTS1 - { MP_ROM_QSTR(MP_QSTR_RTS1), MP_ROM_PTR(&pin_P1_02) }, // RTS1 alias + // MicroMod I2C pins + { MP_ROM_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_P0_08) }, // MicroMod I2C_SDA (P0.08) + { MP_ROM_QSTR(MP_QSTR_I2C_SCL), MP_ROM_PTR(&pin_P0_11) }, // MicroMod I2C_SCL (P0.11) - { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_P1_05) }, // 1.05 - UART RX | RX2 - { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_P1_07) }, // 1.07 - UART TX | TX2 + // CircuitPython default I2C pins + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_08) }, // CircuitPython SDA | MicroMod I2C_SDA (P0.08) + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_11) }, // CircuitPython SCL | MicroMod I2C_SCL (P0.11) - // Board Objects - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, - { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + // MicroMod I2C interrupt pin + { MP_ROM_QSTR(MP_QSTR_I2C_INT), MP_ROM_PTR(&pin_P0_15) }, // MicroMod I2C_INT (P0.15) + + // MicroMod I2C1 pins + { MP_ROM_QSTR(MP_QSTR_I2C_SDA1), MP_ROM_PTR(&pin_P1_01) }, // MicroMod I2C_SDA1 (P1.01) + { MP_ROM_QSTR(MP_QSTR_I2C_SCL1), MP_ROM_PTR(&pin_P0_24) }, // MicroMod I2C_SCL1 (P0.24) + + // MicroMod SPI pins + { MP_ROM_QSTR(MP_QSTR_SPI_CIPO), MP_ROM_PTR(&pin_P0_02) }, // MicroMod SPI_CIPO | CircuitPython CIPO (P0.02) + { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_P0_02) }, // MicroMod SPI_MISO | CircuitPython MISO (P0.02) + { MP_ROM_QSTR(MP_QSTR_SPI_COPI), MP_ROM_PTR(&pin_P0_31) }, // MicroMod SPI_COPI | CircuitPython COPI | LED_DAT (P0.31) + { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_P0_31) }, // MicroMod SPI_MOSI | CircuitPython MOSI (P0.31) + { MP_ROM_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_P0_28) }, // MicroMod SPI_SCK | CircuitPython SCK | LED_CLK (P0.28) + { MP_ROM_QSTR(MP_QSTR_SPI_CS), MP_ROM_PTR(&pin_P0_20) }, // MicroMod SPI_CS | CircuitPython CS (P0.20) + + // CircuitPython default SPI pins + { MP_ROM_QSTR(MP_QSTR_CIPO), MP_ROM_PTR(&pin_P0_02) }, // CircuitPython CIPO | MicroMod SPI_CIPO (P0.02) + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_02) }, // CircuitPython MISO | MicroMod SPI_MISO (P0.02) + { MP_ROM_QSTR(MP_QSTR_COPI), MP_ROM_PTR(&pin_P0_31) }, // CircuitPython COPI | MicroMod SPI_COPI | LED_DAT (P0.31) + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_31) }, // CircuitPython MOSI | MicroMod SPI_MOSI (P0.31) + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_28) }, // CircuitPython SCK | MicroMod SPI_SCK | LED_CLK (P0.28) + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_P0_20) }, // CircuitPython CS | MicroMod SPI_CS (P0.20) + + // MicroMod 2-wire serial LED pins + { MP_ROM_QSTR(MP_QSTR_LED_DAT), MP_ROM_PTR(&pin_P0_31) }, // MicroMod LED_DAT | SPI_COPI (P0.31) + { MP_ROM_QSTR(MP_QSTR_LED_CLK), MP_ROM_PTR(&pin_P0_28) }, // MicroMod LED_CLK | SPI_SCK (P0.28) + + // MicroMod SDIO pins + { MP_ROM_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR(&pin_P0_19) }, // MicroMod SDIO_SCK | SPI_SCK1 (P0.19) + { MP_ROM_QSTR(MP_QSTR_SDIO_CMD), MP_ROM_PTR(&pin_P0_14) }, // MicroMod SDIO_CMD | SPI_COPI1 (P0.14) + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA0), MP_ROM_PTR(&pin_P0_21) }, // MicroMod SDIO_DATA0 | SPI_CIPO1 (P0.21) + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA1), MP_ROM_PTR(&pin_P0_22) }, // MicroMod SDIO_DATA1 (P0.22) + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA2), MP_ROM_PTR(&pin_P0_23) }, // MicroMod SDIO_DATA2 (P0.23) + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA3), MP_ROM_PTR(&pin_P1_00) }, // MicroMod SDIO_DATA3 | SPI_CS1 (P1.00) + + // MicroMod SPI1 pins + { MP_ROM_QSTR(MP_QSTR_SPI_CIPO1), MP_ROM_PTR(&pin_P0_21) }, // MicroMod SPI_CIPO1 | SDIO_DATA0 (P0.21) + { MP_ROM_QSTR(MP_QSTR_SPI_MISO1), MP_ROM_PTR(&pin_P0_21) }, // MicroMod SPI_MISO1 (P0.21) + { MP_ROM_QSTR(MP_QSTR_SPI_COPI1), MP_ROM_PTR(&pin_P0_14) }, // MicroMod SPI_COPI1 | SDIO_CMD (P0.14) + { MP_ROM_QSTR(MP_QSTR_SPI_MOSI1), MP_ROM_PTR(&pin_P0_14) }, // MicroMod SPI_MOSI1 (P0.14) + { MP_ROM_QSTR(MP_QSTR_SPI_SCK1), MP_ROM_PTR(&pin_P0_19) }, // MicroMod SPI_SCK1 | SDIO_SCK (P0.19) + { MP_ROM_QSTR(MP_QSTR_SPI_CS1), MP_ROM_PTR(&pin_P1_00) }, // MicroMod SPI_CS1 | SDIO_DATA3 (P1.00) + + // MicroMod audio pins (not supported by MDBT50Q-P1M) + // { MP_ROM_QSTR(MP_QSTR_AUD_MCLK), MP_ROM_PTR() }, // MicroMod AUD_MCLK (not connected) + // { MP_ROM_QSTR(MP_QSTR_AUD_OUT), MP_ROM_PTR() }, // MicroMod AUD_OUT | I2S_OUT | PCM_OUT | CAM_MCLK (not connected) + // { MP_ROM_QSTR(MP_QSTR_AUD_IN), MP_ROM_PTR() }, // MicroMod AUD_IN | I2S_IN | PCM_IN | CAM_PCLK (not connected) + // { MP_ROM_QSTR(MP_QSTR_AUD_LRCLK), MP_ROM_PTR(&pin_P0_26) },// MicroMod AUD_LRCLK | I2S_WS | PCM_SYNC | PDM_DATA (P0.26) + // { MP_ROM_QSTR(MP_QSTR_AUD_BCLK), MP_ROM_PTR(&pin_P0_25) }, // MicroMod AUD_BCLK | I2S_SCK | PCM_CLK | PDM_CLK (P0.25) + + // MicroMod I2S pins (not supported by MDBT50Q-P1M) + // { MP_ROM_QSTR(MP_QSTR_I2S_OUT), MP_ROM_PTR() }, // MicroMod I2S_OUT | AUD_OUT | PCM_OUT | CAM_MCLK (not connected) + // { MP_ROM_QSTR(MP_QSTR_I2S_IN), MP_ROM_PTR() }, // MicroMod I2S_IN | AUD_IN | PCM_IN | CAM_PCLK (not connected) + // { MP_ROM_QSTR(MP_QSTR_I2S_WS), MP_ROM_PTR(&pin_P0_26) }, // MicroMod I2S_WS | AUD_LRCLK | PCM_SYNC | PDM_DATA (P0.26) + // { MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_P0_25) }, // MicroMod I2S_SCK | AUD_BCLK | PCM_CLK | PDM_CLK (P0.25) + + // MicroMod PCM pins (not supported by MDBT50Q-P1M) + // { MP_ROM_QSTR(MP_QSTR_PCM_OUT), MP_ROM_PTR() }, // MicroMod PCM_OUT | AUD_OUT | I2S_OUT | CAM_MCLK (not connected) + // { MP_ROM_QSTR(MP_QSTR_PCM_IN), MP_ROM_PTR() }, // MicroMod PCM_IN | AUD_IN | I2S_IN | CAM_PCLK (not connected) + // { MP_ROM_QSTR(MP_QSTR_PCM_SYNC), MP_ROM_PTR(&pin_P0_26) }, // MicroMod PCM_SYNC | AUD_LRCLK | I2S_WS | PDM_DATA (P0.26) + // { MP_ROM_QSTR(MP_QSTR_PCM_CLK), MP_ROM_PTR(&pin_P0_25) }, // MicroMod PCM_CLK | AUD_BCLK | I2S_SCK | PDM_CLK (P0.25) + + // MicroMod PDM pins + { MP_ROM_QSTR(MP_QSTR_PDM_DATA), MP_ROM_PTR(&pin_P0_26) }, // MicroMod PDM_DATA | AUD_LRCLK | I2S_WS | PCM_SYNC (P0.26) + { MP_ROM_QSTR(MP_QSTR_PDM_CLK), MP_ROM_PTR(&pin_P0_25) }, // MicroMod PDM_CLK | AUD_BCLK | I2S_SCK | PCM_CLK (P0.25) + + // MicroMod SWD pins + // { MP_ROM_QSTR(MP_QSTR_SWDIO), MP_ROM_PTR() }, // MicroMod SWDIO (MDBT50Q-P1M has a dedicated HW SWDIO pin) + // { MP_ROM_QSTR(MP_QSTR_SWCLK), MP_ROM_PTR() }, // MicroMod SWDCK (MDBT50Q-P1M has a dedicated HW SWDCLK pin) + // { MP_ROM_QSTR(MP_QSTR_SWO), MP_ROM_PTR() }, // MicroMod SWO | G11 (not supported) + + // MicroMod ADC pins + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_05) }, // MicroMod A0 (P0.05) + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_04) }, // MicroMod A1 (P0.04) + + // MicroMod PWM pins + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_P0_06) }, // MicroMod PWM0 (P0.06) + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_P0_16) }, // MicroMod PWM1 (P0.16) + + // MicroMod digital pins + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_27) }, // MicroMod D0 (P0.27) + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P1_08) }, // MicroMod D1 | CAM_TRIG (P1.08) + + // MicroMod general purpose pins + { MP_ROM_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_P0_29) }, // MicroMod G0 | BUS0 (P0.29) + { MP_ROM_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_P0_03) }, // MicroMod G1 | BUS1 (P0.03) + { MP_ROM_QSTR(MP_QSTR_G2), MP_ROM_PTR(&pin_P1_13) }, // MicroMod G2 | BUS2 (P1.13) + { MP_ROM_QSTR(MP_QSTR_G3), MP_ROM_PTR(&pin_P1_12) }, // MicroMod G3 | BUS3 (P1.12) + { MP_ROM_QSTR(MP_QSTR_G4), MP_ROM_PTR(&pin_P1_11) }, // MicroMod G4 | BUS4 (P1.11) + { MP_ROM_QSTR(MP_QSTR_G5), MP_ROM_PTR(&pin_P0_17) }, // MicroMod G5 | BUS5 (P0.17) + { MP_ROM_QSTR(MP_QSTR_G6), MP_ROM_PTR(&pin_P1_06) }, // MicroMod G6 | BUS6 (P1.06) + { MP_ROM_QSTR(MP_QSTR_G7), MP_ROM_PTR(&pin_P1_04) }, // MicroMod G7 | BUS7 (P1.04) + { MP_ROM_QSTR(MP_QSTR_G8), MP_ROM_PTR(&pin_P1_14) }, // MicroMod G8 (P1.14) + { MP_ROM_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_P0_09) }, // MicroMod G9 | ADC_D- | CAM_HSYNC (P0.09) + { MP_ROM_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_P0_10) }, // MicroMod G10 | ADC_D+ | CAM_VSYNC (P0.10) + // { MP_ROM_QSTR(MP_QSTR_G11), MP_ROM_PTR() }, // MicroMod G11 | SWO (not connected) + + // MicroMod 8-bit bus pins + { MP_ROM_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_P0_29) }, // MicroMod BUS0 | G0 (P0.29) + { MP_ROM_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_P0_03) }, // MicroMod BUS1 | G1 (P0.03) + { MP_ROM_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_P1_13) }, // MicroMod BUS2 | G2 (P1.13) + { MP_ROM_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_P1_12) }, // MicroMod BUS3 | G3 (P1.12) + { MP_ROM_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_P1_11) }, // MicroMod BUS4 | G4 (P1.11) + { MP_ROM_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_P0_17) }, // MicroMod BUS5 | G5 (P0.17) + { MP_ROM_QSTR(MP_QSTR_BUS6), MP_ROM_PTR(&pin_P1_06) }, // MicroMod BUS6 | G6 (P1.06) + { MP_ROM_QSTR(MP_QSTR_BUS7), MP_ROM_PTR(&pin_P1_04) }, // MicroMod BUS7 | G7 (P1.04) + + // MicroMod differential ADC input pins (not supported by MDBT50Q-P1M) + // { MP_ROM_QSTR(MP_QSTR_ADC_DM), MP_ROM_PTR(&pin_P0_09) }, // MicroMod ADC_D- | G9 | CAM_HSYNC (P0.09) + // { MP_ROM_QSTR(MP_QSTR_ADC_DP), MP_ROM_PTR(&pin_P0_10) }, // MicroMod ADC_D+ | G10 | CAM_VSYNC (P0.10) + + // MicroMod camera pins (not supported by MDBT50Q-P1M) + // { MP_ROM_QSTR(MP_QSTR_CAM_MCLK), MP_ROM_PTR() }, // MicroMod CAM_MCLK | AUD_OUT | I2S_OUT | PCM_OUT (not connected) + // { MP_ROM_QSTR(MP_QSTR_CAM_PCLK), MP_ROM_PTR() }, // MicroMod CAM_PCLK | AUD_IN | I2S_IN | PCM_IN (not connected) + // { MP_ROM_QSTR(MP_QSTR_CAM_TRIG), MP_ROM_PTR(&pin_P1_08) }, // MicroMod CAM_TRIG | D1 (P1.08) + // { MP_ROM_QSTR(MP_QSTR_CAM_HSYNC), MP_ROM_PTR(&pin_P0_09) },// MicroMod CAM_HSYNC | ADC_D- | G9 (P0.09) + // { MP_ROM_QSTR(MP_QSTR_CAM_VSYNC), MP_ROM_PTR(&pin_P0_10) },// MicroMod CAM_VSYNC | ADC_D+ | G10 (P0.10) + + // CircuitPython board objects + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, // CircuitPython I2C + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, // CircuitPython SPI + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, // CircuitPython UART }; - MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/pins.c b/ports/nrf/boards/sparkfun_nrf52840_mini/pins.c index 026b566ef8..a1e2e27cc1 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/pins.c +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/pins.c @@ -1,6 +1,8 @@ #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_P1_15) }, // D1/TX { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_17) }, // D0/RX // D2 on qwiic gap diff --git a/ports/nrf/boards/teknikio_bluebird/pins.c b/ports/nrf/boards/teknikio_bluebird/pins.c index 1ff1198a15..3e05773b12 100644 --- a/ports/nrf/boards/teknikio_bluebird/pins.c +++ b/ports/nrf/boards/teknikio_bluebird/pins.c @@ -1,6 +1,8 @@ #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_P0_12), MP_ROM_PTR(&pin_P0_12) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_12) }, diff --git a/ports/nrf/boards/tinkeringtech_scoutmakes_azul/pins.c b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/pins.c index ec2689ab45..af26f8e71e 100644 --- a/ports/nrf/boards/tinkeringtech_scoutmakes_azul/pins.c +++ b/ports/nrf/boards/tinkeringtech_scoutmakes_azul/pins.c @@ -1,6 +1,8 @@ #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_P0_04) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_05) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_30) }, @@ -41,6 +43,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_P1_10) }, diff --git a/ports/nrf/boards/warmbit_bluepixel/board.c b/ports/nrf/boards/warmbit_bluepixel/board.c new file mode 100644 index 0000000000..688cfb4ded --- /dev/null +++ b/ports/nrf/boards/warmbit_bluepixel/board.c @@ -0,0 +1,38 @@ +/* + * 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) { + +} diff --git a/ports/nrf/boards/warmbit_bluepixel/mpconfigboard.h b/ports/nrf/boards/warmbit_bluepixel/mpconfigboard.h new file mode 100644 index 0000000000..224bdd5e90 --- /dev/null +++ b/ports/nrf/boards/warmbit_bluepixel/mpconfigboard.h @@ -0,0 +1,20 @@ +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "WarmBit BluePixel nRF52840" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_LED_STATUS (&pin_P0_12) + +#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 + +#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) + +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_08) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_04) + +#define DEFAULT_UART_BUS_RX (&pin_P0_24) +#define DEFAULT_UART_BUS_TX (&pin_P0_22) diff --git a/ports/nrf/boards/warmbit_bluepixel/mpconfigboard.mk b/ports/nrf/boards/warmbit_bluepixel/mpconfigboard.mk new file mode 100644 index 0000000000..757c3cfad5 --- /dev/null +++ b/ports/nrf/boards/warmbit_bluepixel/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x192F +USB_PID = 0xB1B2 +USB_PRODUCT = "WarmBit BluePixel nRF52840" +USB_MANUFACTURER = "WarmBit" + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/warmbit_bluepixel/pins.c b/ports/nrf/boards/warmbit_bluepixel/pins.c new file mode 100644 index 0000000000..667eb31b72 --- /dev/null +++ b/ports/nrf/boards/warmbit_bluepixel/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_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P0_18) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_08) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_04) }, + + { MP_ROM_QSTR(MP_QSTR_MAXTEMP_SCL), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_MAXTEMP_SDA), MP_ROM_PTR(&pin_P1_15) }, + + { MP_ROM_QSTR(MP_QSTR_ACC_SCL), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_ACC_SDA), MP_ROM_PTR(&pin_P1_10) }, + + { MP_ROM_QSTR(MP_QSTR_ADDON_SCL), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_ADDON_SDA), MP_ROM_PTR(&pin_P0_06) }, + + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_27) }, + { MP_ROM_QSTR(MP_QSTR_YELLOW_LED), MP_ROM_PTR(&pin_P0_27) }, + + { 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_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 9f5f46f656..288cf2f217 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -507,6 +507,16 @@ mp_obj_t common_hal_bleio_adapter_start_scan(bleio_adapter_obj_t *self, uint8_t } self->scan_results = NULL; } + // Check to see if advertising is going already. + if (self->current_advertising_data != NULL && self->current_advertising_data == self->advertising_data) { + check_nrf_error(NRF_ERROR_BUSY); + } + + // If the current advertising data isn't owned by the adapter then it must be an internal + // advertisement that we should stop. + if (self->current_advertising_data != NULL) { + common_hal_bleio_adapter_stop_advertising(self); + } self->scan_results = shared_module_bleio_new_scanresults(buffer_size, prefixes, prefix_length, minimum_rssi); size_t max_packet_size = extended ? BLE_GAP_SCAN_BUFFER_EXTENDED_MAX_SUPPORTED : BLE_GAP_SCAN_BUFFER_MAX; uint8_t *raw_data = m_malloc(sizeof(ble_data_t) + max_packet_size, false); @@ -952,8 +962,11 @@ bool common_hal_bleio_adapter_is_bonded_to_central(bleio_adapter_obj_t *self) { } void bleio_adapter_gc_collect(bleio_adapter_obj_t *adapter) { - gc_collect_root((void **)adapter, sizeof(bleio_adapter_obj_t) / sizeof(size_t)); - gc_collect_root((void **)bleio_connections, sizeof(bleio_connections) / sizeof(size_t)); + // We divide by size_t so that we can scan each 32-bit aligned value to see + // if it is a pointer. This allows us to change the structs without worrying + // about collecting new pointers. + gc_collect_root((void **)adapter, sizeof(bleio_adapter_obj_t) / (sizeof(size_t))); + gc_collect_root((void **)bleio_connections, sizeof(bleio_connections) / (sizeof(size_t))); } void bleio_adapter_reset(bleio_adapter_obj_t *adapter) { diff --git a/ports/nrf/common-hal/alarm/__init__.c b/ports/nrf/common-hal/alarm/__init__.c index 8accc88764..5006d726f0 100644 --- a/ports/nrf/common-hal/alarm/__init__.c +++ b/ports/nrf/common-hal/alarm/__init__.c @@ -137,6 +137,8 @@ mp_obj_t common_hal_alarm_create_wake_alarm(void) { // Set up light sleep or deep sleep alarms. STATIC void _setup_sleep_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t *alarms) { + sleepmem_wakeup_event = SLEEPMEM_WAKEUP_BY_NONE; + sleepmem_wakeup_pin = WAKEUP_PIN_UNDEF; alarm_pin_pinalarm_set_alarms(deep_sleep, n_alarms, alarms); alarm_time_timealarm_set_alarms(deep_sleep, n_alarms, alarms); alarm_touch_touchalarm_set_alarm(deep_sleep, n_alarms, alarms); @@ -145,7 +147,7 @@ STATIC void _setup_sleep_alarms(bool deep_sleep, size_t n_alarms, const mp_obj_t // TODO: this handles all possible types of wakeup, which is redundant with main. // revise to extract all parts essential to enabling sleep wakeup, but leave the // alarm/non-alarm sorting to the existing main loop. -void system_on_idle_until_alarm(int64_t timediff_ms, uint32_t prescaler) { +void system_on_idle_until_alarm(int64_t timediff_ms, bool wake_from_serial, uint32_t prescaler) { bool have_timeout = false; uint64_t start_tick = 0, end_tick = 0; int64_t tickdiff; @@ -156,10 +158,6 @@ void system_on_idle_until_alarm(int64_t timediff_ms, uint32_t prescaler) { if (timediff_ms != -1) { have_timeout = true; - #if 0 - int64_t now = common_hal_time_monotonic_ms(); - dbg_printf("now_ms=%ld timediff_ms=%ld\r\n", (long)now, (long)timediff_ms); - #endif if (timediff_ms < 0) { timediff_ms = 0; } @@ -175,34 +173,17 @@ void system_on_idle_until_alarm(int64_t timediff_ms, uint32_t prescaler) { start_tick = port_get_raw_ticks(NULL); end_tick = start_tick + tickdiff; } - #if 0 - dbg_printf("start_tick=%ld end_tick=%ld have_timeout=%c\r\n", (long)start_tick, (long)end_tick, have_timeout ? 'T' : 'F'); - #endif int64_t remaining; - sleepmem_wakeup_event = SLEEPMEM_WAKEUP_BY_NONE; - sleepmem_wakeup_pin = WAKEUP_PIN_UNDEF; - - #ifdef NRF_DEBUG_PRINT - int ct = 40; - char reason = '?'; -#define WAKEUP_REASON(x) reason = (x) - #else -#define WAKEUP_REASON(x) - #endif - while (1) { if (mp_hal_is_interrupted()) { - WAKEUP_REASON('I'); break; } - if (serial_connected() && serial_bytes_available()) { - WAKEUP_REASON('S'); + if (wake_from_serial && serial_connected() && serial_bytes_available()) { break; } RUN_BACKGROUND_TASKS; if (common_hal_alarm_woken_from_sleep()) { - WAKEUP_REASON('W'); break; } if (have_timeout) { @@ -210,51 +191,28 @@ void system_on_idle_until_alarm(int64_t timediff_ms, uint32_t prescaler) { // We break a bit early so we don't risk setting the alarm before the time when we call // sleep. if (remaining < 1) { - WAKEUP_REASON('t'); break; } port_interrupt_after_ticks(remaining); } // Idle until an interrupt happens. port_idle_until_interrupt(); - #ifdef NRF_DEBUG_PRINT - if (ct > 0) { - mp_printf(&mp_plat_print, "_"); - --ct; - } - #endif if (have_timeout) { remaining = end_tick - port_get_raw_ticks(NULL); if (remaining <= 0) { sleepmem_wakeup_event = SLEEPMEM_WAKEUP_BY_TIMER; - WAKEUP_REASON('T'); break; } } } - #ifdef NRF_DEBUG_PRINT - mp_printf(&mp_plat_print, "%c\r\n", reason); - #endif #if defined(MICROPY_QSPI_CS) qspi_flash_exit_sleep(); #endif - - #ifdef NRF_DEBUG_PRINT - tickdiff = port_get_raw_ticks(NULL) - start_tick; - double sec; - if (prescaler == 0) { - sec = (double)tickdiff / 1024; - } else { - sec = (double)(tickdiff * prescaler) / 1024; - } - mp_printf(&mp_plat_print, "lapse %6.1f sec\r\n", sec); - #endif } mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj_t *alarms) { mp_obj_t wake_alarm = mp_const_none; - alarm_time_timealarm_clear_wakeup_time(); _setup_sleep_alarms(false, n_alarms, alarms); #ifdef NRF_DEBUG_PRINT @@ -262,7 +220,7 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj #endif int64_t timediff_ms = alarm_time_timealarm_get_wakeup_timediff_ms(); - system_on_idle_until_alarm(timediff_ms, 0); + system_on_idle_until_alarm(timediff_ms, false, 0); if (mp_hal_is_interrupted()) { wake_alarm = mp_const_none; @@ -290,7 +248,6 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj } void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *alarms) { - alarm_time_timealarm_clear_wakeup_time(); _setup_sleep_alarms(true, n_alarms, alarms); } @@ -305,7 +262,7 @@ void NORETURN common_hal_alarm_enter_deep_sleep(void) { #endif int64_t timediff_ms = alarm_time_timealarm_get_wakeup_timediff_ms(); tick_set_prescaler(PRESCALER_VALUE_IN_DEEP_SLEEP - 1); - system_on_idle_until_alarm(timediff_ms, PRESCALER_VALUE_IN_DEEP_SLEEP); + system_on_idle_until_alarm(timediff_ms, false, PRESCALER_VALUE_IN_DEEP_SLEEP); #ifdef NRF_DEBUG_PRINT mp_printf(&mp_plat_print, "RESET...\r\n\r\n"); @@ -328,7 +285,7 @@ void common_hal_alarm_pretending_deep_sleep(void) { #endif int64_t timediff_ms = alarm_time_timealarm_get_wakeup_timediff_ms(); - system_on_idle_until_alarm(timediff_ms, 0); + system_on_idle_until_alarm(timediff_ms, true, 0); alarm_reset(); } diff --git a/ports/nrf/common-hal/alarm/pin/PinAlarm.c b/ports/nrf/common-hal/alarm/pin/PinAlarm.c index 300369bb36..4bf412d85b 100644 --- a/ports/nrf/common-hal/alarm/pin/PinAlarm.c +++ b/ports/nrf/common-hal/alarm/pin/PinAlarm.c @@ -141,14 +141,6 @@ void alarm_pin_pinalarm_reset(void) { } static void configure_pins_for_sleep(void) { - nrfx_err_t err; - if (nrfx_gpiote_is_init()) { - nrfx_gpiote_uninit(); - } - err = nrfx_gpiote_init(NRFX_GPIOTE_CONFIG_IRQ_PRIORITY); - assert(err == NRFX_SUCCESS); - (void)err; // to suppress unused warning - _pinhandler_gpiote_count = 0; nrfx_gpiote_in_config_t cfg = { @@ -176,9 +168,10 @@ static void configure_pins_for_sleep(void) { cfg.sense = NRF_GPIOTE_POLARITY_TOGGLE; cfg.pull = NRF_GPIO_PIN_NOPULL; } - err = nrfx_gpiote_in_init((nrfx_gpiote_pin_t)i, &cfg, + nrfx_err_t err = nrfx_gpiote_in_init((nrfx_gpiote_pin_t)i, &cfg, pinalarm_gpiote_handler); assert(err == NRFX_SUCCESS); + (void)err; // In case the assert doesn't use err. nrfx_gpiote_in_event_enable((nrfx_gpiote_pin_t)i, true); if (((high_alarms & mask) != 0) && ((low_alarms & mask) == 0)) { nrf_gpio_cfg_sense_set((uint32_t)i, NRF_GPIO_PIN_SENSE_HIGH); diff --git a/ports/nrf/common-hal/alarm/time/TimeAlarm.c b/ports/nrf/common-hal/alarm/time/TimeAlarm.c index 54d9a8921f..c5f3bfd705 100644 --- a/ports/nrf/common-hal/alarm/time/TimeAlarm.c +++ b/ports/nrf/common-hal/alarm/time/TimeAlarm.c @@ -70,10 +70,6 @@ int64_t alarm_time_timealarm_get_wakeup_timediff_ms(void) { return wakeup_time_saved - common_hal_time_monotonic_ms(); } -void alarm_time_timealarm_clear_wakeup_time(void) { - wakeup_time_saved = 0; -} - void alarm_time_timealarm_reset(void) { port_disable_interrupt_after_ticks_ch(1); wakeup_time_saved = 0; diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index ded03c07c2..8626ce714d 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -230,7 +230,7 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self, } bool common_hal_audiobusio_i2sout_deinited(audiobusio_i2sout_obj_t *self) { - return self->data_pin_number == 0xff; + return self->data_pin_number == NO_PIN; } void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t *self) { @@ -240,11 +240,11 @@ void common_hal_audiobusio_i2sout_deinit(audiobusio_i2sout_obj_t *self) { NRF_I2S->TASKS_STOP = 1; NRF_I2S->ENABLE = I2S_ENABLE_ENABLE_Disabled; reset_pin_number(self->bit_clock_pin_number); - self->bit_clock_pin_number = 0xff; + self->bit_clock_pin_number = NO_PIN; reset_pin_number(self->word_select_pin_number); - self->word_select_pin_number = 0xff; + self->word_select_pin_number = NO_PIN; reset_pin_number(self->data_pin_number); - self->data_pin_number = 0xff; + self->data_pin_number = NO_PIN; instance = NULL; supervisor_disable_tick(); } diff --git a/ports/nrf/common-hal/audiobusio/PDMIn.c b/ports/nrf/common-hal/audiobusio/PDMIn.c index 47d7365777..c34a4ebba9 100644 --- a/ports/nrf/common-hal/audiobusio/PDMIn.c +++ b/ports/nrf/common-hal/audiobusio/PDMIn.c @@ -69,16 +69,16 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self, } bool common_hal_audiobusio_pdmin_deinited(audiobusio_pdmin_obj_t *self) { - return !self->clock_pin_number; + return self->clock_pin_number == NO_PIN; } void common_hal_audiobusio_pdmin_deinit(audiobusio_pdmin_obj_t *self) { nrf_pdm->ENABLE = 0; reset_pin_number(self->clock_pin_number); - self->clock_pin_number = 0; + self->clock_pin_number = NO_PIN; reset_pin_number(self->data_pin_number); - self->data_pin_number = 0; + self->data_pin_number = NO_PIN; } uint8_t common_hal_audiobusio_pdmin_get_bit_depth(audiobusio_pdmin_obj_t *self) { diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index f606fe898f..55d1c967ac 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -269,18 +269,8 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self, const uint8_t *data, size } bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_value) { - uint8_t *next_chunk = data; - - while (len > 0) { - size_t chunk_size = MIN(len, self->spim_peripheral->max_xfer_size); - const nrfx_spim_xfer_desc_t xfer = NRFX_SPIM_XFER_RX(next_chunk, chunk_size); - if (nrfx_spim_xfer(&self->spim_peripheral->spim, &xfer, 0) != NRFX_SUCCESS) { - return false; - } - next_chunk += chunk_size; - len -= chunk_size; - } - return true; + memset(data, write_value, len); + return common_hal_busio_spi_transfer(self, data, data, len); } bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_out, uint8_t *data_in, size_t len) { diff --git a/ports/nrf/common-hal/countio/Counter.c b/ports/nrf/common-hal/countio/Counter.c index e863f5475a..452c9d9c83 100644 --- a/ports/nrf/common-hal/countio/Counter.c +++ b/ports/nrf/common-hal/countio/Counter.c @@ -1,5 +1,8 @@ #include "common-hal/countio/Counter.h" + +#include "py/runtime.h" + #include "nrfx_gpiote.h" // obj array to map pin number -> self since nrfx hide the mapping @@ -29,11 +32,14 @@ void common_hal_countio_counter_construct(countio_counter_obj_t *self, .skip_gpio_setup = false }; - nrfx_gpiote_in_init(self->pin_a, &cfg, _intr_handler); + + nrfx_err_t err = nrfx_gpiote_in_init(self->pin_a, &cfg, _intr_handler); + if (err != NRFX_SUCCESS) { + mp_raise_RuntimeError(translate("All channels in use")); + } nrfx_gpiote_in_event_enable(self->pin_a, true); claim_pin(pin_a); - } bool common_hal_countio_counter_deinited(countio_counter_obj_t *self) { diff --git a/ports/nrf/common-hal/microcontroller/Processor.c b/ports/nrf/common-hal/microcontroller/Processor.c index f59fc54972..f01b22fb47 100644 --- a/ports/nrf/common-hal/microcontroller/Processor.c +++ b/ports/nrf/common-hal/microcontroller/Processor.c @@ -27,6 +27,8 @@ #include "py/runtime.h" #include "common-hal/microcontroller/Processor.h" + +#include "common-hal/alarm/__init__.h" #include "shared-bindings/microcontroller/ResetReason.h" #include "supervisor/shared/translate.h" @@ -136,6 +138,14 @@ mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) { r = RESET_REASON_WATCHDOG; } else if (reset_reason_saved & POWER_RESETREAS_SREQ_Msk) { r = RESET_REASON_SOFTWARE; + #if CIRCUITPY_ALARM + // Our "deep sleep" is still actually light sleep followed by a software + // reset. Adding this check here ensures we treat it as-if we're waking + // from deep sleep. + if (sleepmem_wakeup_event != SLEEPMEM_WAKEUP_BY_NONE) { + r = RESET_REASON_DEEP_SLEEP_ALARM; + } + #endif } else if ((reset_reason_saved & POWER_RESETREAS_OFF_Msk) || (reset_reason_saved & POWER_RESETREAS_LPCOMP_Msk) || (reset_reason_saved & POWER_RESETREAS_NFC_Msk) || diff --git a/ports/nrf/common-hal/displayio/ParallelBus.c b/ports/nrf/common-hal/paralleldisplay/ParallelBus.c similarity index 85% rename from ports/nrf/common-hal/displayio/ParallelBus.c rename to ports/nrf/common-hal/paralleldisplay/ParallelBus.c index 7e0aea0d63..6f84ceb214 100644 --- a/ports/nrf/common-hal/displayio/ParallelBus.c +++ b/ports/nrf/common-hal/paralleldisplay/ParallelBus.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/displayio/ParallelBus.h" +#include "shared-bindings/paralleldisplay/ParallelBus.h" #include @@ -33,7 +33,7 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/microcontroller/__init__.h" -void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *self, +void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbus_obj_t *self, const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select, const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) { @@ -94,7 +94,7 @@ void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *sel common_hal_digitalio_digitalinout_construct(&self->reset, reset); common_hal_digitalio_digitalinout_switch_to_output(&self->reset, true, DRIVE_MODE_PUSH_PULL); never_reset_pin_number(reset->number); - common_hal_displayio_parallelbus_reset(self); + common_hal_paralleldisplay_parallelbus_reset(self); } never_reset_pin_number(command->number); @@ -106,7 +106,7 @@ void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *sel } } -void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self) { +void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_obj_t *self) { for (uint8_t i = 0; i < 8; i++) { reset_pin_number(self->data0_pin + i); } @@ -118,8 +118,8 @@ void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self) reset_pin_number(self->reset.pin->number); } -bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); +bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) { + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); if (self->reset.base.type == &mp_type_NoneType) { return false; } @@ -130,20 +130,20 @@ bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { return true; } -bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { +bool common_hal_paralleldisplay_parallelbus_bus_free(mp_obj_t obj) { return true; } -bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); +bool common_hal_paralleldisplay_parallelbus_begin_transaction(mp_obj_t obj) { + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->chip_select, false); return true; } // This ignores chip_select behaviour because data is clocked in by the write line toggling. -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, +void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->command, byte_type == DISPLAY_DATA); uint32_t *clear_write = (uint32_t *)&self->write_group->OUTCLR; uint32_t *set_write = (uint32_t *)&self->write_group->OUTSET; @@ -155,7 +155,7 @@ void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byt } } -void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); +void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t obj) { + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->chip_select, true); } diff --git a/ports/nrf/common-hal/displayio/ParallelBus.h b/ports/nrf/common-hal/paralleldisplay/ParallelBus.h similarity index 86% rename from ports/nrf/common-hal/displayio/ParallelBus.h rename to ports/nrf/common-hal/paralleldisplay/ParallelBus.h index 30a0c7e61e..14ba7bbc11 100644 --- a/ports/nrf/common-hal/displayio/ParallelBus.h +++ b/ports/nrf/common-hal/paralleldisplay/ParallelBus.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_DISPLAYIO_PARALLELBUS_H -#define MICROPY_INCLUDED_NRF_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H +#define MICROPY_INCLUDED_NRF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H #include "common-hal/digitalio/DigitalInOut.h" @@ -40,6 +40,6 @@ typedef struct { uint8_t data0_pin; NRF_GPIO_Type *write_group; uint32_t write_mask; -} displayio_parallelbus_obj_t; +} paralleldisplay_parallelbus_obj_t; -#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index f8f877d965..84545f5293 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -112,11 +112,6 @@ static void _pulsein_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action } void pulsein_reset(void) { - if (nrfx_gpiote_is_init()) { - nrfx_gpiote_uninit(); - } - nrfx_gpiote_init(NRFX_GPIOTE_CONFIG_IRQ_PRIORITY); - if (timer != NULL) { nrf_peripherals_free_timer(timer); } @@ -178,7 +173,10 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, const mcu .hi_accuracy = true, .skip_gpio_setup = false }; - nrfx_gpiote_in_init(self->pin, &cfg, _pulsein_handler); + nrfx_err_t err = nrfx_gpiote_in_init(self->pin, &cfg, _pulsein_handler); + if (err != NRFX_SUCCESS) { + mp_raise_RuntimeError(translate("All channels in use")); + } nrfx_gpiote_in_event_enable(self->pin, true); } diff --git a/ports/nrf/common-hal/pulseio/PulseOut.c b/ports/nrf/common-hal/pulseio/PulseOut.c index 17f498ba8e..1c3c317a05 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.c +++ b/ports/nrf/common-hal/pulseio/PulseOut.c @@ -48,14 +48,14 @@ static volatile uint16_t pulse_array_index = 0; static uint16_t pulse_array_length; static void turn_on(pulseio_pulseout_obj_t *pulseout) { - pulseout->pwmout->pwm->PSEL.OUT[0] = pulseout->pwmout->pin_number; + pulseout->pwmout.pwm->PSEL.OUT[0] = pulseout->pwmout.pin->number; } static void turn_off(pulseio_pulseout_obj_t *pulseout) { // Disconnect pin from PWM. - pulseout->pwmout->pwm->PSEL.OUT[0] = 0xffffffff; + pulseout->pwmout.pwm->PSEL.OUT[0] = 0xffffffff; // Make sure pin is low. - nrf_gpio_pin_clear(pulseout->pwmout->pin_number); + nrf_gpio_pin_clear(pulseout->pwmout.pin->number); } static void start_timer(void) { @@ -100,13 +100,15 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, - const pwmio_pwmout_obj_t *carrier, const mcu_pin_obj_t *pin, uint32_t frequency, uint16_t duty_cycle) { - if (!carrier || pin || frequency) { - mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead")); - } + + pwmout_result_t result = common_hal_pwmio_pwmout_construct( + &self->pwmout, pin, duty_cycle, frequency, false); + + // This will raise an exception and not return if needed. + common_hal_pwmio_pwmout_raise_error(result); if (refcount == 0) { timer = nrf_peripherals_allocate_timer_or_throw(); @@ -122,14 +124,12 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, .p_context = self, }; - self->pwmout = carrier; - nrfx_timer_init(timer, &timer_config, &pulseout_event_handler); turn_off(self); } bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t *self) { - return self->pwmout == NULL; + return common_hal_pwmio_pwmout_deinited(&self->pwmout); } void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { @@ -137,7 +137,7 @@ void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { return; } turn_on(self); - self->pwmout = NULL; + common_hal_pwmio_pwmout_deinit(&self->pwmout); refcount--; if (refcount == 0) { diff --git a/ports/nrf/common-hal/pulseio/PulseOut.h b/ports/nrf/common-hal/pulseio/PulseOut.h index 714f740b20..03560bceac 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.h +++ b/ports/nrf/common-hal/pulseio/PulseOut.h @@ -34,7 +34,7 @@ typedef struct { mp_obj_base_t base; - const pwmio_pwmout_obj_t *pwmout; + pwmio_pwmout_obj_t pwmout; } pulseio_pulseout_obj_t; void pulseout_reset(void); diff --git a/ports/nrf/common-hal/pwmio/PWMOut.c b/ports/nrf/common-hal/pwmio/PWMOut.c index e49214631b..6dd4a153b8 100644 --- a/ports/nrf/common-hal/pwmio/PWMOut.c +++ b/ports/nrf/common-hal/pwmio/PWMOut.c @@ -74,7 +74,7 @@ void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { } } - never_reset_pin_number(self->pin_number); + common_hal_never_reset_pin(self->pin); } void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) { @@ -232,14 +232,14 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, } self->channel = channel; - self->pin_number = pin->number; + self->pin = pin; claim_pin(pin); self->frequency = frequency; self->variable_frequency = variable_frequency; // Note this is standard, not strong drive. - nrf_gpio_cfg_output(self->pin_number); + nrf_gpio_cfg_output(self->pin->number); // disable before mapping pin channel nrf_pwm_disable(self->pwm); @@ -267,15 +267,15 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) { return; } - nrf_gpio_cfg_default(self->pin_number); + nrf_gpio_cfg_default(self->pin->number); NRF_PWM_Type *pwm = self->pwm; self->pwm = NULL; pwmout_free_channel(pwm, self->channel); - reset_pin_number(self->pin_number); - self->pin_number = NO_PIN; + common_hal_reset_pin(self->pin); + self->pin = NULL; } void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uint16_t duty_cycle) { @@ -313,3 +313,7 @@ uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t *self) { bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t *self) { return self->variable_frequency; } + +const mcu_pin_obj_t *common_hal_pwmio_pwmout_get_pin(pwmio_pwmout_obj_t *self) { + return self->pin; +} diff --git a/ports/nrf/common-hal/pwmio/PWMOut.h b/ports/nrf/common-hal/pwmio/PWMOut.h index f96c5e4f81..49e67c3b66 100644 --- a/ports/nrf/common-hal/pwmio/PWMOut.h +++ b/ports/nrf/common-hal/pwmio/PWMOut.h @@ -29,13 +29,14 @@ #include "nrfx_pwm.h" #include "py/obj.h" +#include "shared-bindings/microcontroller/Pin.h" typedef struct { mp_obj_base_t base; NRF_PWM_Type *pwm; - uint8_t pin_number; uint8_t channel : 7; bool variable_frequency : 1; + const mcu_pin_obj_t *pin; uint16_t duty_cycle; uint32_t frequency; } pwmio_pwmout_obj_t; diff --git a/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c b/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c index bc5851ccd4..425da9e6de 100644 --- a/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/nrf/common-hal/rotaryio/IncrementalEncoder.c @@ -64,8 +64,15 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode .hi_accuracy = true, .skip_gpio_setup = false }; - nrfx_gpiote_in_init(self->pin_a, &cfg, _intr_handler); - nrfx_gpiote_in_init(self->pin_b, &cfg, _intr_handler); + nrfx_err_t err = nrfx_gpiote_in_init(self->pin_a, &cfg, _intr_handler); + if (err != NRFX_SUCCESS) { + mp_raise_RuntimeError(translate("All channels in use")); + } + err = nrfx_gpiote_in_init(self->pin_b, &cfg, _intr_handler); + if (err != NRFX_SUCCESS) { + nrfx_gpiote_in_uninit(self->pin_a); + mp_raise_RuntimeError(translate("All channels in use")); + } nrfx_gpiote_in_event_enable(self->pin_a, true); nrfx_gpiote_in_event_enable(self->pin_b, true); diff --git a/ports/nrf/common-hal/watchdog/WatchDogTimer.c b/ports/nrf/common-hal/watchdog/WatchDogTimer.c index 3423d3466b..1798c52609 100644 --- a/ports/nrf/common-hal/watchdog/WatchDogTimer.c +++ b/ports/nrf/common-hal/watchdog/WatchDogTimer.c @@ -28,6 +28,7 @@ #include #include +#include "py/gc.h" #include "py/obj.h" #include "py/objproperty.h" #include "py/runtime.h" @@ -94,7 +95,11 @@ void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) { void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { if (self->mode == WATCHDOGMODE_RESET) { - mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); + if (gc_alloc_possible()) { + mp_raise_NotImplementedError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET")); + } + // Don't change anything because RESET cannot be undone. + return; } if (timer) { timer_free(); diff --git a/ports/nrf/fatfs_port.c b/ports/nrf/fatfs_port.c index 5347af4177..f2644adbd3 100644 --- a/ports/nrf/fatfs_port.c +++ b/ports/nrf/fatfs_port.c @@ -30,7 +30,11 @@ #include "shared-bindings/rtc/RTC.h" #include "shared-bindings/time/__init__.h" +DWORD _time_override = 0; DWORD get_fattime(void) { + if (_time_override > 0) { + return _time_override; + } #if CIRCUITPY_RTC timeutils_struct_time_t tm; common_hal_rtc_get_time(&tm); @@ -40,3 +44,7 @@ DWORD get_fattime(void) { 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/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index e984c3f326..17e9817b5c 100644 --- a/ports/nrf/supervisor/port.c +++ b/ports/nrf/supervisor/port.c @@ -25,12 +25,15 @@ * THE SOFTWARE. */ -#include #include "supervisor/port.h" + +#include +#include "supervisor/background_callback.h" #include "supervisor/board.h" #include "nrfx/hal/nrf_clock.h" #include "nrfx/hal/nrf_power.h" +#include "nrfx/drivers/include/nrfx_gpiote.h" #include "nrfx/drivers/include/nrfx_power.h" #include "nrfx/drivers/include/nrfx_rtc.h" @@ -39,7 +42,8 @@ #include "nrf/power.h" #include "nrf/timers.h" -#include "shared-module/gamepad/__init__.h" +#include "nrf_nvic.h" + #include "common-hal/microcontroller/Pin.h" #include "common-hal/_bleio/__init__.h" #include "common-hal/analogio/AnalogIn.h" @@ -207,10 +211,6 @@ safe_mode_t port_init(void) { } void reset_port(void) { - #ifdef CIRCUITPY_GAMEPAD_TICKS - gamepad_reset(); - #endif - #if CIRCUITPY_BUSIO i2c_reset(); spi_reset(); @@ -253,6 +253,12 @@ void reset_port(void) { watchdog_reset(); #endif + // Always reset GPIOTE because it is shared. + if (nrfx_gpiote_is_init()) { + nrfx_gpiote_uninit(); + } + nrfx_gpiote_init(NRFX_GPIOTE_CONFIG_IRQ_PRIORITY); + reset_all_pins(); } @@ -365,7 +371,9 @@ void port_idle_until_interrupt(void) { sd_softdevice_is_enabled(&sd_enabled); if (sd_enabled) { - sd_app_evt_wait(); + if (!background_callback_pending()) { + sd_app_evt_wait(); + } } else { // Call wait for interrupt ourselves if the SD isn't enabled. // Note that `wfi` should be called with interrupts disabled, @@ -381,11 +389,7 @@ void port_idle_until_interrupt(void) { // function (whether or not SD is enabled) int nested = __get_PRIMASK(); __disable_irq(); - bool ok = true; - #if CIRCUITPY_USB - ok = !tud_task_event_ready(); - #endif - if (ok) { + if (!background_callback_pending()) { __DSB(); __WFI(); } diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile index 840b723398..ffab1fbcd0 100644 --- a/ports/raspberrypi/Makefile +++ b/ports/raspberrypi/Makefile @@ -117,7 +117,7 @@ CFLAGS += $(OPTIMIZATION_FLAGS) #Debugging/Optimization ifeq ($(DEBUG), 1) - CFLAGS += -ggdb3 -Og + CFLAGS += -ggdb3 -O3 # No LTO because we may place some functions in RAM instead of flash. else CFLAGS += -DNDEBUG @@ -213,7 +213,7 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) # There may be duplicates between SRC_COMMON_HAL_EXPANDED and SRC_SHARED_MODULE_EXPANDED, -# because a few modules have files both in common-hal/ and shared-modules/. +# because a few modules have files both in common-hal/ and shared-module/. # Doing a $(sort ...) removes duplicates as part of sorting. SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) diff --git a/ports/raspberrypi/audio_dma.c b/ports/raspberrypi/audio_dma.c index 52b1c84b91..b7e5a0db44 100644 --- a/ports/raspberrypi/audio_dma.c +++ b/ports/raspberrypi/audio_dma.c @@ -28,6 +28,7 @@ #include "shared-bindings/audiocore/RawSample.h" #include "shared-bindings/audiocore/WaveFile.h" +#include "shared-bindings/microcontroller/__init__.h" #include "supervisor/background_callback.h" #include "py/mpstate.h" @@ -37,10 +38,8 @@ #if CIRCUITPY_AUDIOPWMIO || CIRCUITPY_AUDIOBUSIO -#define AUDIO_DMA_CHANNEL_COUNT NUM_DMA_CHANNELS - void audio_dma_reset(void) { - for (size_t channel = 0; channel < AUDIO_DMA_CHANNEL_COUNT; channel++) { + for (size_t channel = 0; channel < NUM_DMA_CHANNELS; channel++) { if (MP_STATE_PORT(playing_audio)[channel] == NULL) { continue; } @@ -49,116 +48,127 @@ void audio_dma_reset(void) { } } -void audio_dma_convert_signed(audio_dma_t *dma, uint8_t *buffer, uint32_t buffer_length, - uint8_t **output_buffer, uint32_t *output_buffer_length) { - if (dma->first_buffer_free) { - *output_buffer = dma->first_buffer; - } else { - *output_buffer = dma->second_buffer; - } + +STATIC size_t audio_dma_convert_samples(audio_dma_t *dma, uint8_t *input, uint32_t input_length, uint8_t *output, uint32_t output_length) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wcast-align" - if (dma->signed_to_unsigned || - dma->unsigned_to_signed || - dma->sample_spacing > 1 || - (dma->sample_resolution != dma->output_resolution)) { - *output_buffer_length = buffer_length / dma->sample_spacing; - uint32_t out_i = 0; - if (dma->sample_resolution <= 8 && dma->output_resolution > 8) { - size_t shift = dma->output_resolution - dma->sample_resolution; - for (uint32_t i = 0; i < buffer_length; i += dma->sample_spacing) { - if (dma->signed_to_unsigned) { - ((uint16_t *)*output_buffer)[out_i] = ((uint16_t)((int8_t *)buffer)[i] + 0x80) << shift; - } else if (dma->unsigned_to_signed) { - ((int16_t *)*output_buffer)[out_i] = ((int16_t)((uint8_t *)buffer)[i] - 0x80) << shift; - } else { - ((uint16_t *)*output_buffer)[out_i] = ((uint16_t)((uint8_t *)buffer)[i]) << shift; - } - out_i += 1; + uint32_t output_length_used = input_length / dma->sample_spacing; + + if (output_length_used > output_length) { + mp_raise_RuntimeError(translate("Internal audio buffer too small")); + } + + uint32_t out_i = 0; + if (dma->sample_resolution <= 8 && dma->output_resolution > 8) { + // reading bytes, writing 16-bit words, so output buffer will be bigger. + + output_length_used = output_length * 2; + if (output_length_used > output_length) { + mp_raise_RuntimeError(translate("Internal audio buffer too small")); + } + + size_t shift = dma->output_resolution - dma->sample_resolution; + + for (uint32_t i = 0; i < input_length; i += dma->sample_spacing) { + if (dma->signed_to_unsigned) { + ((uint16_t *)output)[out_i] = ((uint16_t)((int8_t *)input)[i] + 0x80) << shift; + } else if (dma->unsigned_to_signed) { + ((int16_t *)output)[out_i] = ((int16_t)((uint8_t *)input)[i] - 0x80) << shift; + } else { + ((uint16_t *)output)[out_i] = ((uint16_t)((uint8_t *)input)[i]) << shift; } - } else if (dma->sample_resolution <= 8 && dma->output_resolution <= 8) { - for (uint32_t i = 0; i < buffer_length; i += dma->sample_spacing) { - if (dma->signed_to_unsigned) { - ((uint8_t *)*output_buffer)[out_i] = ((int8_t *)buffer)[i] + 0x80; - } else if (dma->unsigned_to_signed) { - ((int8_t *)*output_buffer)[out_i] = ((uint8_t *)buffer)[i] - 0x80; - } else { - ((uint8_t *)*output_buffer)[out_i] = ((uint8_t *)buffer)[i]; - } - out_i += 1; + out_i += 1; + } + } else if (dma->sample_resolution <= 8 && dma->output_resolution <= 8) { + for (uint32_t i = 0; i < input_length; i += dma->sample_spacing) { + if (dma->signed_to_unsigned) { + ((uint8_t *)output)[out_i] = ((int8_t *)input)[i] + 0x80; + } else if (dma->unsigned_to_signed) { + ((int8_t *)output)[out_i] = ((uint8_t *)input)[i] - 0x80; + } else { + ((uint8_t *)output)[out_i] = ((uint8_t *)input)[i]; } - } else if (dma->sample_resolution > 8 && dma->output_resolution > 8) { - size_t shift = 16 - dma->output_resolution; - for (uint32_t i = 0; i < buffer_length / 2; i += dma->sample_spacing) { - if (dma->signed_to_unsigned) { - ((uint16_t *)*output_buffer)[out_i] = ((int16_t *)buffer)[i] + 0x8000; - } else if (dma->unsigned_to_signed) { - ((int16_t *)*output_buffer)[out_i] = ((uint16_t *)buffer)[i] - 0x8000; - } else { - ((uint16_t *)*output_buffer)[out_i] = ((uint16_t *)buffer)[i]; - } - if (dma->output_resolution < 16) { - if (dma->output_signed) { - ((int16_t *)*output_buffer)[out_i] = ((int16_t *)*output_buffer)[out_i] >> shift; - } else { - ((uint16_t *)*output_buffer)[out_i] = ((uint16_t *)*output_buffer)[out_i] >> shift; - } - } - out_i += 1; + out_i += 1; + } + } else if (dma->sample_resolution > 8 && dma->output_resolution > 8) { + size_t shift = 16 - dma->output_resolution; + for (uint32_t i = 0; i < input_length / 2; i += dma->sample_spacing) { + if (dma->signed_to_unsigned) { + ((uint16_t *)output)[out_i] = ((int16_t *)input)[i] + 0x8000; + } else if (dma->unsigned_to_signed) { + ((int16_t *)output)[out_i] = ((uint16_t *)input)[i] - 0x8000; + } else { + ((uint16_t *)output)[out_i] = ((uint16_t *)input)[i]; } + if (dma->output_resolution < 16) { + if (dma->output_signed) { + ((int16_t *)output)[out_i] = ((int16_t *)output)[out_i] >> shift; + } else { + ((uint16_t *)output)[out_i] = ((uint16_t *)output)[out_i] >> shift; + } + } + out_i += 1; } } else { - *output_buffer = buffer; - *output_buffer_length = buffer_length; + // (dma->sample_resolution > 8 && dma->output_resolution <= 8) + // Not currently used, but might be in the future. + mp_raise_RuntimeError(translate("Audio conversion not implemented")); } #pragma GCC diagnostic pop - dma->first_buffer_free = !dma->first_buffer_free; + return output_length_used; } -void audio_dma_load_next_block(audio_dma_t *dma) { - uint8_t dma_channel = dma->channel[1]; - if (dma->first_channel_free) { - dma_channel = dma->channel[0]; - } - dma->first_channel_free = !dma->first_channel_free; +// buffer_idx is 0 or 1. +STATIC void audio_dma_load_next_block(audio_dma_t *dma, size_t buffer_idx) { + size_t dma_channel = dma->channel[buffer_idx]; - uint8_t *output_buffer; - uint32_t output_buffer_length; audioio_get_buffer_result_t get_buffer_result; - uint8_t *buffer; - uint32_t buffer_length; + uint8_t *sample_buffer; + uint32_t sample_buffer_length; get_buffer_result = audiosample_get_buffer(dma->sample, - dma->single_channel_output, dma->audio_channel, &buffer, &buffer_length); + dma->single_channel_output, dma->audio_channel, &sample_buffer, &sample_buffer_length); if (get_buffer_result == GET_BUFFER_ERROR) { audio_dma_stop(dma); return; } - audio_dma_convert_signed(dma, buffer, buffer_length, &output_buffer, &output_buffer_length); + // Convert the sample format resolution and signedness, as necessary. + // The input sample buffer is what was read from a file, Mixer, or a raw sample buffer. + // The output buffer is one of the DMA buffers (passed in). - // If we don't have an output buffer, save the pointer to first_buffer for use in the single - // buffer special case. - if (dma->first_buffer == NULL) { - dma->first_buffer = output_buffer; - } + size_t output_length_used = audio_dma_convert_samples( + dma, sample_buffer, sample_buffer_length, + dma->buffer[buffer_idx], dma->buffer_length[buffer_idx]); + + dma_channel_set_read_addr(dma_channel, dma->buffer[buffer_idx], false /* trigger */); + dma_channel_set_trans_count(dma_channel, output_length_used / dma->output_size, false /* trigger */); - dma_channel_set_trans_count(dma_channel, output_buffer_length / dma->output_size, false /* trigger */); - dma_channel_set_read_addr(dma_channel, output_buffer, false /* trigger */); if (get_buffer_result == GET_BUFFER_DONE) { if (dma->loop) { audiosample_reset_buffer(dma->sample, dma->single_channel_output, dma->audio_channel); } else { // Set channel trigger to ourselves so we don't keep going. dma_channel_hw_t *c = &dma_hw->ch[dma_channel]; - c->al1_ctrl = (c->al1_ctrl & ~DMA_CH0_CTRL_TRIG_CHAIN_TO_BITS) | (dma_channel << DMA_CH0_CTRL_TRIG_CHAIN_TO_LSB); + c->al1_ctrl = + (c->al1_ctrl & ~DMA_CH0_CTRL_TRIG_CHAIN_TO_BITS) | + (dma_channel << DMA_CH0_CTRL_TRIG_CHAIN_TO_LSB); + + if (output_length_used == 0 && + !dma_channel_is_busy(dma->channel[0]) && + !dma_channel_is_busy(dma->channel[1])) { + // No data has been read, and both DMA channels have now finished, so it's safe to stop. + audio_dma_stop(dma); + dma->playing_in_progress = false; + } } } } // Playback should be shutdown before calling this. -audio_dma_result audio_dma_setup_playback(audio_dma_t *dma, +audio_dma_result audio_dma_setup_playback( + audio_dma_t *dma, mp_obj_t sample, bool loop, bool single_channel_output, @@ -167,6 +177,7 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma, uint8_t output_resolution, uint32_t output_register_address, uint8_t dma_trigger_source) { + // Use two DMA channels to play because the DMA can't wrap to itself without the // buffer being power of two aligned. int dma_channel_0_maybe = dma_claim_unused_channel(false); @@ -191,12 +202,15 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma, dma->unsigned_to_signed = false; dma->output_signed = output_signed; dma->sample_spacing = 1; - dma->first_channel_free = true; dma->output_resolution = output_resolution; dma->sample_resolution = audiosample_bits_per_sample(sample); + dma->output_register_address = output_register_address; + audiosample_reset_buffer(sample, single_channel_output, audio_channel); - bool single_buffer; + + bool single_buffer; // True if data fits in one single buffer. + bool samples_signed; uint32_t max_buffer_length; audiosample_get_buffer_structure(sample, single_channel_output, &single_buffer, &samples_signed, @@ -210,22 +224,25 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma, dma->sample_spacing > 1 || (dma->sample_resolution != dma->output_resolution)) { max_buffer_length /= dma->sample_spacing; - dma->first_buffer = (uint8_t *)m_realloc(dma->first_buffer, max_buffer_length); - if (dma->first_buffer == NULL) { + } + + dma->buffer[0] = (uint8_t *)m_realloc(dma->buffer[0], max_buffer_length); + dma->buffer_length[0] = max_buffer_length; + if (dma->buffer[0] == NULL) { + return AUDIO_DMA_MEMORY_ERROR; + } + + if (!single_buffer) { + dma->buffer[1] = (uint8_t *)m_realloc(dma->buffer[1], max_buffer_length); + dma->buffer_length[1] = max_buffer_length; + if (dma->buffer[1] == NULL) { return AUDIO_DMA_MEMORY_ERROR; } - - dma->first_buffer_free = true; - if (!single_buffer) { - dma->second_buffer = (uint8_t *)m_realloc(dma->second_buffer, max_buffer_length); - if (dma->second_buffer == NULL) { - return AUDIO_DMA_MEMORY_ERROR; - } - } - dma->signed_to_unsigned = !output_signed && samples_signed; - dma->unsigned_to_signed = output_signed && !samples_signed; } + dma->signed_to_unsigned = !output_signed && samples_signed; + dma->unsigned_to_signed = output_signed && !samples_signed; + if (output_resolution > 8) { dma->output_size = 2; } else { @@ -248,9 +265,11 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma, channel_config_set_dreq(&c, dma_trigger_source); channel_config_set_read_increment(&c, true); channel_config_set_write_increment(&c, false); + // Chain to the other channel by default. channel_config_set_chain_to(&c, dma->channel[(i + 1) % 2]); dma_channel_set_config(dma->channel[i], &c, false /* trigger */); + dma_channel_set_write_addr(dma->channel[i], (void *)output_register_address, false /* trigger */); } @@ -260,9 +279,9 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma, MP_STATE_PORT(playing_audio)[dma->channel[1]] = dma; // Load the first two blocks up front. - audio_dma_load_next_block(dma); + audio_dma_load_next_block(dma, 0); if (!single_buffer) { - audio_dma_load_next_block(dma); + audio_dma_load_next_block(dma, 1); } // Special case the DMA for a single buffer. It's commonly used for a single wave length of sound @@ -279,16 +298,17 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma, channel_config_set_chain_to(&c, dma->channel[1]); // Chain to ourselves so we stop. dma_channel_configure(dma->channel[1], &c, &dma_hw->ch[dma->channel[0]].al3_read_addr_trig, // write address - &dma->first_buffer, // read address + &dma->buffer[0], // read address 1, // transaction count false); // trigger } else { - // Enable our DMA channels on DMA0 to the CPU. This will wake us up when + // Enable our DMA channels on DMA_IRQ_0 to the CPU. This will wake us up when // we're WFI. dma_hw->inte0 |= (1 << dma->channel[0]) | (1 << dma->channel[1]); irq_set_mask_enabled(1 << DMA_IRQ_0, true); } + dma->playing_in_progress = true; dma_channel_start(dma->channel[0]); return AUDIO_DMA_OK; @@ -296,7 +316,14 @@ audio_dma_result audio_dma_setup_playback(audio_dma_t *dma, void audio_dma_stop(audio_dma_t *dma) { // Disable our interrupts. - dma_hw->inte0 &= ~((1 << dma->channel[0]) | (1 << dma->channel[1])); + uint32_t channel_mask = 0; + if (dma->channel[0] < NUM_DMA_CHANNELS) { + channel_mask |= 1 << dma->channel[0]; + } + if (dma->channel[1] < NUM_DMA_CHANNELS) { + channel_mask |= 1 << dma->channel[1]; + } + dma_hw->inte0 &= ~channel_mask; irq_set_mask_enabled(1 << DMA_IRQ_0, false); // Run any remaining audio tasks because we remove ourselves from @@ -305,6 +332,10 @@ void audio_dma_stop(audio_dma_t *dma) { for (size_t i = 0; i < 2; i++) { size_t channel = dma->channel[i]; + if (channel == NUM_DMA_CHANNELS) { + // Channel not in use. + continue; + } dma_channel_config c = dma_channel_get_default_config(dma->channel[i]); channel_config_set_enable(&c, false); @@ -313,6 +344,7 @@ void audio_dma_stop(audio_dma_t *dma) { if (dma_channel_is_busy(channel)) { dma_channel_abort(channel); } + dma_channel_set_read_addr(channel, NULL, false /* trigger */); dma_channel_set_write_addr(channel, NULL, false /* trigger */); dma_channel_set_trans_count(channel, 0, false /* trigger */); @@ -320,6 +352,7 @@ void audio_dma_stop(audio_dma_t *dma) { MP_STATE_PORT(playing_audio)[channel] = NULL; dma->channel[i] = NUM_DMA_CHANNELS; } + dma->playing_in_progress = false; // Hold onto our buffers. } @@ -344,7 +377,7 @@ void audio_dma_resume(audio_dma_t *dma) { } bool audio_dma_get_paused(audio_dma_t *dma) { - if (dma->channel[0] >= AUDIO_DMA_CHANNEL_COUNT) { + if (dma->channel[0] >= NUM_DMA_CHANNELS) { return false; } uint32_t control = dma_hw->ch[dma->channel[0]].ctrl_trig; @@ -353,30 +386,26 @@ bool audio_dma_get_paused(audio_dma_t *dma) { } void audio_dma_init(audio_dma_t *dma) { - dma->first_buffer = NULL; - dma->second_buffer = NULL; + dma->buffer[0] = NULL; + dma->buffer[1] = NULL; + dma->channel[0] = NUM_DMA_CHANNELS; dma->channel[1] = NUM_DMA_CHANNELS; } void audio_dma_deinit(audio_dma_t *dma) { - m_free(dma->first_buffer); - dma->first_buffer = NULL; + m_free(dma->buffer[0]); + dma->buffer[0] = NULL; - m_free(dma->second_buffer); - dma->second_buffer = NULL; + m_free(dma->buffer[1]); + dma->buffer[1] = NULL; } bool audio_dma_get_playing(audio_dma_t *dma) { if (dma->channel[0] == NUM_DMA_CHANNELS) { return false; } - if (!dma_channel_is_busy(dma->channel[0]) && - !dma_channel_is_busy(dma->channel[1])) { - return false; - } - - return true; + return dma->playing_in_progress; } // WARN(tannewt): DO NOT print from here, or anything it calls. Printing calls @@ -389,7 +418,25 @@ STATIC void dma_callback_fun(void *arg) { return; } - audio_dma_load_next_block(dma); + common_hal_mcu_disable_interrupts(); + uint32_t channels_to_load_mask = dma->channels_to_load_mask; + dma->channels_to_load_mask = 0; + common_hal_mcu_enable_interrupts(); + + // Load the blocks for the requested channels. + uint32_t channel = 0; + while (channels_to_load_mask) { + if (channels_to_load_mask & 1) { + if (dma->channel[0] == channel) { + audio_dma_load_next_block(dma, 0); + } + if (dma->channel[1] == channel) { + audio_dma_load_next_block(dma, 1); + } + } + channels_to_load_mask >>= 1; + channel++; + } } void isr_dma_0(void) { @@ -397,6 +444,8 @@ void isr_dma_0(void) { uint32_t mask = 1 << i; if ((dma_hw->intr & mask) != 0 && 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; } diff --git a/ports/raspberrypi/audio_dma.h b/ports/raspberrypi/audio_dma.h index f84f6debeb..ae9a07a604 100644 --- a/ports/raspberrypi/audio_dma.h +++ b/ports/raspberrypi/audio_dma.h @@ -34,22 +34,23 @@ typedef struct { mp_obj_t sample; + uint8_t *buffer[2]; + size_t buffer_length[2]; + uint32_t channels_to_load_mask; + uint32_t output_register_address; + background_callback_t callback; uint8_t channel[2]; uint8_t audio_channel; uint8_t output_size; uint8_t sample_spacing; + uint8_t output_resolution; // in bits + uint8_t sample_resolution; // in bits bool loop; bool single_channel_output; bool signed_to_unsigned; bool unsigned_to_signed; bool output_signed; - bool first_channel_free; - bool first_buffer_free; - uint8_t output_resolution; // in bits - uint8_t sample_resolution; // in bits - uint8_t *first_buffer; - uint8_t *second_buffer; - background_callback_t callback; + bool playing_in_progress; } audio_dma_t; typedef enum { diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c index 8d96c51dfe..3dffc39363 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c @@ -80,12 +80,13 @@ //| initial_sideset_pin_direction: int = 0x1f, //| exclusive_pin_use: bool = True, //| auto_pull: bool = False, -//| pull_threshold : int = 32, -//| out_shift_right : bool = True, +//| pull_threshold: int = 32, +//| out_shift_right: bool = True, //| wait_for_txstall: bool = True, //| auto_push: bool = False, -//| push_threshold : int = 32, -//| in_shift_right : bool = True) -> None: +//| push_threshold: int = 32, +//| in_shift_right: bool = True, +//| user_interruptible: bool = True) -> None: //| //| """Construct a StateMachine object on the given pins with the given program. //| @@ -126,7 +127,14 @@ //| :param int push_threshold: Number of bits to shift before saving the ISR value to the RX FIFO //| :param bool in_shift_right: When True, data is shifted into the right side (LSB) of the //| ISR. It is shifted into the left (MSB) otherwise. NOTE! This impacts data alignment -//| when the number of bytes is not a power of two (1, 2 or 4 bytes).""" +//| when the number of bytes is not a power of two (1, 2 or 4 bytes). +//| :param bool user_interruptible: When True (the default), +//| `write()`, `readinto()`, and `write_readinto()` can be interrupted by a ctrl-C. +//| This is useful when developing a PIO program: if there is an error in the program +//| 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. +//| """ //| ... //| @@ -143,7 +151,8 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n 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_auto_push, ARG_push_threshold, ARG_in_shift_right, + ARG_user_interruptible,}; 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 }, @@ -179,6 +188,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n { MP_QSTR_auto_push, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, { 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_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); @@ -252,7 +262,8 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n 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_auto_push].u_bool, push_threshold, args[ARG_in_shift_right].u_bool, + args[ARG_user_interruptible].u_bool); return MP_OBJ_FROM_PTR(self); } diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.h b/ports/raspberrypi/bindings/rp2pio/StateMachine.h index 295a414cd9..effa9c9ce3 100644 --- a/ports/raspberrypi/bindings/rp2pio/StateMachine.h +++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.h @@ -49,7 +49,8 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, 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 auto_push, uint8_t push_threshold, bool in_shift_right, + bool user_interruptible); void common_hal_rp2pio_statemachine_deinit(rp2pio_statemachine_obj_t *self); bool common_hal_rp2pio_statemachine_deinited(rp2pio_statemachine_obj_t *self); diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_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/adafruit_feather_rp2040/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c index 8d5be961e0..6afba676b4 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, @@ -33,4 +35,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/adafruit_itsybitsy_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_itsybitsy_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_itsybitsy_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/adafruit_itsybitsy_rp2040/pins.c b/ports/raspberrypi/boards/adafruit_itsybitsy_rp2040/pins.c index bc8ace4654..37ae364dc7 100644 --- a/ports/raspberrypi/boards/adafruit_itsybitsy_rp2040/pins.c +++ b/ports/raspberrypi/boards/adafruit_itsybitsy_rp2040/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, @@ -41,4 +43,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c b/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c index 214662e331..1e16629f30 100644 --- a/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c +++ b/ports/raspberrypi/boards/adafruit_macropad_rp2040/board.c @@ -69,7 +69,7 @@ void board_init(void) { &pin_GPIO24, // Command or data &pin_GPIO22, // Chip select &pin_GPIO23, // Reset - 1000000, // Baudrate + 10000000, // Baudrate 0, // Polarity 0); // Phase @@ -91,7 +91,6 @@ void board_init(void) { 0, // Set column command 0, // Set row command 0, // Write memory command - 0xd3, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), NULL, diff --git a/ports/raspberrypi/boards/adafruit_macropad_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_macropad_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_macropad_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/adafruit_macropad_rp2040/pins.c b/ports/raspberrypi/boards/adafruit_macropad_rp2040/pins.c index f5ff3618c9..470d4d5371 100644 --- a/ports/raspberrypi/boards/adafruit_macropad_rp2040/pins.c +++ b/ports/raspberrypi/boards/adafruit_macropad_rp2040/pins.c @@ -1,7 +1,9 @@ #include "shared-bindings/board/__init__.h" #include "shared-module/displayio/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_KEY1), MP_ROM_PTR(&pin_GPIO1) }, { MP_ROM_QSTR(MP_QSTR_KEY2), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_KEY3), MP_ROM_PTR(&pin_GPIO3) }, @@ -17,7 +19,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, - { MP_ROM_QSTR(MP_QSTR_SPEAKER_SHUTDOWN), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_SPEAKER_ENABLE), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_ENCODER_SWITCH), MP_ROM_PTR(&pin_GPIO0) }, @@ -47,4 +49,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)} }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/adafruit_qt2040_trinkey/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_qt2040_trinkey/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_qt2040_trinkey/pico-sdk-configboard.h @@ -0,0 +1,4 @@ +// Put board-specific pico-sdk definitions here. This file must exist. + +// Allow extra time for xosc to start. +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 diff --git a/ports/raspberrypi/boards/adafruit_qt2040_trinkey/pins.c b/ports/raspberrypi/boards/adafruit_qt2040_trinkey/pins.c index 1f7dc5eb41..98fd7cf56f 100644 --- a/ports/raspberrypi/boards/adafruit_qt2040_trinkey/pins.c +++ b/ports/raspberrypi/boards/adafruit_qt2040_trinkey/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO16) }, @@ -14,4 +16,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/adafruit_qtpy_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_qtpy_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_qtpy_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/adafruit_qtpy_rp2040/pins.c b/ports/raspberrypi/boards/adafruit_qtpy_rp2040/pins.c index e9e726f35a..0d6835f48b 100644 --- a/ports/raspberrypi/boards/adafruit_qtpy_rp2040/pins.c +++ b/ports/raspberrypi/boards/adafruit_qtpy_rp2040/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -46,4 +48,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/arduino_nano_rp2040_connect/mpconfigboard.mk b/ports/raspberrypi/boards/arduino_nano_rp2040_connect/mpconfigboard.mk index 4eb0ac75b3..4cef8395c5 100644 --- a/ports/raspberrypi/boards/arduino_nano_rp2040_connect/mpconfigboard.mk +++ b/ports/raspberrypi/boards/arduino_nano_rp2040_connect/mpconfigboard.mk @@ -7,6 +7,6 @@ USB_MANUFACTURER = "Arduino" CHIP_VARIANT = RP2040 CHIP_FAMILY = rp2 -EXTERNAL_FLASH_DEVICES = "AT25SF128A" +EXTERNAL_FLASH_DEVICES = "AT25SF128A, IS25LP128F" CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/arduino_nano_rp2040_connect/pico-sdk-configboard.h b/ports/raspberrypi/boards/arduino_nano_rp2040_connect/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/arduino_nano_rp2040_connect/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/arduino_nano_rp2040_connect/pins.c b/ports/raspberrypi/boards/arduino_nano_rp2040_connect/pins.c index 68b42ccd09..dd77b185b0 100644 --- a/ports/raspberrypi/boards/arduino_nano_rp2040_connect/pins.c +++ b/ports/raspberrypi/boards/arduino_nano_rp2040_connect/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, @@ -60,4 +62,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +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 new file mode 100644 index 0000000000..de6e424ed9 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi/board.c @@ -0,0 +1,40 @@ +/* + * 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" + +void board_init(void) { +} + +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/mpconfigboard.h b/ports/raspberrypi/boards/challenger_rp2040_wifi/mpconfigboard.h new file mode 100644 index 0000000000..8382822b29 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi/mpconfigboard.h @@ -0,0 +1,10 @@ +#define MICROPY_HW_BOARD_NAME "Challenger RP2040 WiFi" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define DEFAULT_UART_BUS_TX (&pin_GPIO16) +#define DEFAULT_UART_BUS_RX (&pin_GPIO16) +#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_wifi/mpconfigboard.mk b/ports/raspberrypi/boards/challenger_rp2040_wifi/mpconfigboard.mk new file mode 100644 index 0000000000..1f1ff5a391 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x2e8a +USB_PID = 0x1006 +USB_PRODUCT = "Challenger RP2040 WiFi" +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/pico-sdk-configboard.h b/ports/raspberrypi/boards/challenger_rp2040_wifi/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi/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/pins.c b/ports/raspberrypi/boards/challenger_rp2040_wifi/pins.c new file mode 100644 index 0000000000..baec08eccb --- /dev/null +++ b/ports/raspberrypi/boards/challenger_rp2040_wifi/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_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_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_LED), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_WIFI_MODE), MP_ROM_PTR(&pin_GPIO13) }, + { 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_D0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_TX), 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_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) }, + + { 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_pi_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c index 869cad17d3..8aedbc928d 100644 --- a/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c +++ b/ports/raspberrypi/boards/cytron_maker_pi_rp2040/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -59,4 +61,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_VBATT), 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_global_dict_table); +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 new file mode 100644 index 0000000000..57866b00ab --- /dev/null +++ b/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/board.c @@ -0,0 +1,45 @@ +/* + * 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 "shared-bindings/board/__init__.h" +#include "shared-bindings/microcontroller/Pin.h" +#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_GPIO15, 9); +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/mpconfigboard.h new file mode 100644 index 0000000000..317aec7f99 --- /dev/null +++ b/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/mpconfigboard.h @@ -0,0 +1,11 @@ +#define MICROPY_HW_BOARD_NAME "EncoderPad RP2040" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO15) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO9) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO26) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO27) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO28) diff --git a/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/mpconfigboard.mk b/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/mpconfigboard.mk new file mode 100644 index 0000000000..d8d5129b33 --- /dev/null +++ b/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x1d50 +USB_PID = 0x6154 +USB_PRODUCT = "EncoderPad RP2040" +USB_MANUFACTURER = "JPConstantineau" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q128JVxQ" diff --git a/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/jpconstantineau_encoderpad_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/jpconstantineau_encoderpad_rp2040/pins.c b/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/pins.c new file mode 100644 index 0000000000..36f33df443 --- /dev/null +++ b/ports/raspberrypi/boards/jpconstantineau_encoderpad_rp2040/pins.c @@ -0,0 +1,39 @@ +#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_KEY1), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_KEY2), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_KEY3), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_KEY4), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_KEY5), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_KEY6), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_KEY7), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_KEY8), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_KEY9), MP_ROM_PTR(&pin_GPIO4) }, + + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_ENCODER_A), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_ROTA), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_ENCODER_B), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_ROTB), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO29) }, + + { 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_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/jpconstantineau_pykey60/board.c b/ports/raspberrypi/boards/jpconstantineau_pykey60/board.c new file mode 100644 index 0000000000..e4e5a8bc57 --- /dev/null +++ b/ports/raspberrypi/boards/jpconstantineau_pykey60/board.c @@ -0,0 +1,45 @@ +/* + * 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 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) { +} diff --git a/ports/raspberrypi/boards/jpconstantineau_pykey60/mpconfigboard.h b/ports/raspberrypi/boards/jpconstantineau_pykey60/mpconfigboard.h new file mode 100644 index 0000000000..f4ccde3fca --- /dev/null +++ b/ports/raspberrypi/boards/jpconstantineau_pykey60/mpconfigboard.h @@ -0,0 +1,2 @@ +#define MICROPY_HW_BOARD_NAME "PyKey60" +#define MICROPY_HW_MCU_NAME "rp2040" diff --git a/ports/raspberrypi/boards/jpconstantineau_pykey60/mpconfigboard.mk b/ports/raspberrypi/boards/jpconstantineau_pykey60/mpconfigboard.mk new file mode 100644 index 0000000000..263f7ad3b2 --- /dev/null +++ b/ports/raspberrypi/boards/jpconstantineau_pykey60/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x1d50 +USB_PID = 0x6153 +USB_PRODUCT = "Pykey60" +USB_MANUFACTURER = "JPConstantineau" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/jpconstantineau_pykey60/pico-sdk-configboard.h b/ports/raspberrypi/boards/jpconstantineau_pykey60/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/jpconstantineau_pykey60/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/jpconstantineau_pykey60/pins.c b/ports/raspberrypi/boards/jpconstantineau_pykey60/pins.c new file mode 100644 index 0000000000..b33373c9a0 --- /dev/null +++ b/ports/raspberrypi/boards/jpconstantineau_pykey60/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_COL1), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_COL2), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_COL3), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_COL4), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_COL5), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_COL6), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_COL7), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_COL8), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_COL9), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_COL10), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_COL11), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_COL12), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_COL13), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_COL14), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_ROW1), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_ROW2), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_ROW3), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_ROW4), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_ROW5), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_SPEAKER), 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_GPIO24) }, + { 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_GP27), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO29) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO23) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO27) }, + + { 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_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/pimoroni_interstate75/board.c b/ports/raspberrypi/boards/pimoroni_interstate75/board.c new file mode 100644 index 0000000000..de6e424ed9 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_interstate75/board.c @@ -0,0 +1,40 @@ +/* + * 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" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/pimoroni_interstate75/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_interstate75/mpconfigboard.h new file mode 100644 index 0000000000..052c47fa68 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_interstate75/mpconfigboard.h @@ -0,0 +1,10 @@ +#define MICROPY_HW_BOARD_NAME "Pimoroni Interstate 75" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define CIRCUITPY_RGB_STATUS_INVERTED_PWM +#define CIRCUITPY_RGB_STATUS_R (&pin_GPIO16) +#define CIRCUITPY_RGB_STATUS_G (&pin_GPIO17) +#define CIRCUITPY_RGB_STATUS_B (&pin_GPIO18) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO21) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO20) diff --git a/ports/raspberrypi/boards/pimoroni_interstate75/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_interstate75/mpconfigboard.mk new file mode 100644 index 0000000000..b52b31a9d9 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_interstate75/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x2E8A +USB_PID = 0x1009 +USB_PRODUCT = "Interstate 75" +USB_MANUFACTURER = "Pimoroni" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/pimoroni_interstate75/pico-sdk-configboard.h b/ports/raspberrypi/boards/pimoroni_interstate75/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_interstate75/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_interstate75/pins.c b/ports/raspberrypi/boards/pimoroni_interstate75/pins.c new file mode 100644 index 0000000000..1244f63a22 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_interstate75/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_R0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_B0), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_R1), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_B1), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_ROW_A), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_ROW_B), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_ROW_C), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_ROW_D), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_ROW_E), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_LAT), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_OE), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_SW_A), MP_ROM_PTR(&pin_GPIO14) }, + + { 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) }, + + { 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_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_CURRENT_SENSE), MP_ROM_PTR(&pin_GPIO29) }, + + { 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/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h index ecc127db68..0641aed52d 100644 --- a/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h @@ -1,39 +1,8 @@ #define MICROPY_HW_BOARD_NAME "Pimoroni Keybow 2040" #define MICROPY_HW_MCU_NAME "rp2040" -#define MICROPY_HW_SW0 (&pin_GPIO21) -#define MICROPY_HW_SW1 (&pin_GPIO20) -#define MICROPY_HW_SW2 (&pin_GPIO19) -#define MICROPY_HW_SW3 (&pin_GPIO18) -#define MICROPY_HW_SW4 (&pin_GPIO17) -#define MICROPY_HW_SW5 (&pin_GPIO16) -#define MICROPY_HW_SW6 (&pin_GPIO15) -#define MICROPY_HW_SW7 (&pin_GPIO14) -#define MICROPY_HW_SW8 (&pin_GPIO13) -#define MICROPY_HW_SW9 (&pin_GPIO12) -#define MICROPY_HW_SW10 (&pin_GPIO11) -#define MICROPY_HW_SW11 (&pin_GPIO10) -#define MICROPY_HW_SW12 (&pin_GPIO9) -#define MICROPY_HW_SW13 (&pin_GPIO8) -#define MICROPY_HW_SW14 (&pin_GPIO7) -#define MICROPY_HW_SW15 (&pin_GPIO6) - -#define MICROPY_HW_USER_SW (&pin_GPIO23) - -#define MICROPY_HW_I2C_INT (&pin_GPIO3) - #define DEFAULT_I2C_BUS_SCL (&pin_GPIO5) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO4) #define DEFAULT_UART_BUS_RX (&pin_GPIO1) #define DEFAULT_UART_BUS_TX (&pin_GPIO0) - -// These pins are unconnected -#define IGNORE_PIN_GPIO2 1 -#define IGNORE_PIN_GPIO22 1 -#define IGNORE_PIN_GPIO24 1 -#define IGNORE_PIN_GPIO25 1 -#define IGNORE_PIN_GPIO26 1 -#define IGNORE_PIN_GPIO27 1 -#define IGNORE_PIN_GPIO28 1 -#define IGNORE_PIN_GPIO29 1 diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/pimoroni_keybow2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/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_keybow2040/pins.c b/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c index c4cdb7b293..c150de3044 100644 --- a/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c +++ b/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, @@ -33,4 +35,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/pimoroni_pga2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/pimoroni_pga2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_pga2040/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_pga2040/pins.c b/ports/raspberrypi/boards/pimoroni_pga2040/pins.c index 1ddc885082..40975c5ad2 100644 --- a/ports/raspberrypi/boards/pimoroni_pga2040/pins.c +++ b/ports/raspberrypi/boards/pimoroni_pga2040/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -44,4 +46,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/pimoroni_picolipo_16mb/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_picolipo_16mb/mpconfigboard.h index 4261b9e006..a8e5d4bb15 100644 --- a/ports/raspberrypi/boards/pimoroni_picolipo_16mb/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_picolipo_16mb/mpconfigboard.h @@ -1,10 +1,5 @@ #define MICROPY_HW_BOARD_NAME "Pimoroni Pico LiPo (16MB)" #define MICROPY_HW_MCU_NAME "rp2040" -#define MICROPY_HW_VBUS_DETECT (&pin_GPIO24) -#define MICROPY_HW_BAT_SENSE (&pin_GPIO29) - -#define MICROPY_HW_USER_SW (&pin_GPIO23) - #define DEFAULT_I2C_BUS_SCL (&pin_GPIO5) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO4) diff --git a/ports/raspberrypi/boards/pimoroni_picolipo_16mb/pico-sdk-configboard.h b/ports/raspberrypi/boards/pimoroni_picolipo_16mb/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_picolipo_16mb/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_picolipo_16mb/pins.c b/ports/raspberrypi/boards/pimoroni_picolipo_16mb/pins.c index 229d510ead..577b29736e 100644 --- a/ports/raspberrypi/boards/pimoroni_picolipo_16mb/pins.c +++ b/ports/raspberrypi/boards/pimoroni_picolipo_16mb/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -49,4 +51,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/pimoroni_picolipo_4mb/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_picolipo_4mb/mpconfigboard.h index e34a05abf2..7241b3bd56 100644 --- a/ports/raspberrypi/boards/pimoroni_picolipo_4mb/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_picolipo_4mb/mpconfigboard.h @@ -1,10 +1,5 @@ #define MICROPY_HW_BOARD_NAME "Pimoroni Pico LiPo (4MB)" #define MICROPY_HW_MCU_NAME "rp2040" -#define MICROPY_HW_VBUS_DETECT (&pin_GPIO24) -#define MICROPY_HW_BAT_SENSE (&pin_GPIO29) - -#define MICROPY_HW_USER_SW (&pin_GPIO23) - #define DEFAULT_I2C_BUS_SCL (&pin_GPIO5) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO4) diff --git a/ports/raspberrypi/boards/pimoroni_picolipo_4mb/pico-sdk-configboard.h b/ports/raspberrypi/boards/pimoroni_picolipo_4mb/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_picolipo_4mb/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_picolipo_4mb/pins.c b/ports/raspberrypi/boards/pimoroni_picolipo_4mb/pins.c index 229d510ead..577b29736e 100644 --- a/ports/raspberrypi/boards/pimoroni_picolipo_4mb/pins.c +++ b/ports/raspberrypi/boards/pimoroni_picolipo_4mb/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -49,4 +51,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h index 97ea17376d..7c39848256 100644 --- a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h @@ -1,48 +1,13 @@ #define MICROPY_HW_BOARD_NAME "Pimoroni PicoSystem" #define MICROPY_HW_MCU_NAME "rp2040" -#define MICROPY_HW_VBUS_DETECT (&pin_GPIO2) - -#define MICROPY_HW_LCD_RESET (&pin_GPIO4) -#define MICROPY_HW_LCD_CS (&pin_GPIO5) -#define MICROPY_HW_LCD_SCLK (&pin_GPIO6) -#define MICROPY_HW_LCD_MOSI (&pin_GPIO7) -#define MICROPY_HW_LCD_VSYNC (&pin_GPIO8) -#define MICROPY_HW_LCD_DS (&pin_GPIO9) - -#define MICROPY_HW_AUDIO (&pin_GPIO11) -#define MICROPY_HW_BACKLIGHT (&pin_GPIO12) -#define MICROPY_HW_VBUS_DETECT (&pin_GPIO2) - #define CIRCUITPY_RGB_STATUS_INVERTED_PWM #define CIRCUITPY_RGB_STATUS_G (&pin_GPIO13) #define CIRCUITPY_RGB_STATUS_R (&pin_GPIO14) #define CIRCUITPY_RGB_STATUS_B (&pin_GPIO15) -#define MICROPY_HW_SW_Y (&pin_GPIO16) -#define MICROPY_HW_SW_X (&pin_GPIO17) -#define MICROPY_HW_SW_A (&pin_GPIO18) -#define MICROPY_HW_SW_B (&pin_GPIO19) - -#define MICROPY_HW_SW_DOWN (&pin_GPIO20) -#define MICROPY_HW_SW_RIGHT (&pin_GPIO21) -#define MICROPY_HW_SW_LEFT (&pin_GPIO22) -#define MICROPY_HW_SW_UP (&pin_GPIO23) - -#define MICROPY_HW_CHARGE_STAT (&pin_GPIO24) - -#define MICROPY_HW_BAT_SENSE (&pin_GPIO26) - #define DEFAULT_SPI_BUS_SCK (&pin_GPIO6) #define DEFAULT_SPI_BUS_MOSI (&pin_GPIO7) #define DEFAULT_UART_BUS_RX (&pin_GPIO1) #define DEFAULT_UART_BUS_TX (&pin_GPIO0) - -// These pins are unconnected -#define IGNORE_PIN_GPIO3 1 -#define IGNORE_PIN_GPIO10 1 -#define IGNORE_PIN_GPIO25 1 -#define IGNORE_PIN_GPIO27 1 -#define IGNORE_PIN_GPIO28 1 -#define IGNORE_PIN_GPIO29 1 diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/pico-sdk-configboard.h b/ports/raspberrypi/boards/pimoroni_picosystem/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_picosystem/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_picosystem/pins.c b/ports/raspberrypi/boards/pimoroni_picosystem/pins.c index 30aafacbad..bfd51225fb 100644 --- a/ports/raspberrypi/boards/pimoroni_picosystem/pins.c +++ b/ports/raspberrypi/boards/pimoroni_picosystem/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) }, @@ -40,4 +42,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/pimoroni_plasma2040/board.c b/ports/raspberrypi/boards/pimoroni_plasma2040/board.c new file mode 100644 index 0000000000..de6e424ed9 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_plasma2040/board.c @@ -0,0 +1,40 @@ +/* + * 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" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} + +void board_deinit(void) { +} diff --git a/ports/raspberrypi/boards/pimoroni_plasma2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_plasma2040/mpconfigboard.h new file mode 100644 index 0000000000..b8e48a26a2 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_plasma2040/mpconfigboard.h @@ -0,0 +1,10 @@ +#define MICROPY_HW_BOARD_NAME "Pimoroni Plasma 2040" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define CIRCUITPY_RGB_STATUS_INVERTED_PWM +#define CIRCUITPY_RGB_STATUS_R (&pin_GPIO16) +#define CIRCUITPY_RGB_STATUS_G (&pin_GPIO17) +#define CIRCUITPY_RGB_STATUS_B (&pin_GPIO18) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO21) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO20) diff --git a/ports/raspberrypi/boards/pimoroni_plasma2040/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_plasma2040/mpconfigboard.mk new file mode 100644 index 0000000000..10bfb5cc87 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_plasma2040/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x2E8A +USB_PID = 0x100a +USB_PRODUCT = "Plasma 2040" +USB_MANUFACTURER = "Pimoroni" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ" + +CIRCUITPY__EVE = 1 diff --git a/ports/raspberrypi/boards/pimoroni_plasma2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/pimoroni_plasma2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_plasma2040/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_plasma2040/pins.c b/ports/raspberrypi/boards/pimoroni_plasma2040/pins.c new file mode 100644 index 0000000000..5f685a3528 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_plasma2040/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_SW_A), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_SW_B), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_DATA), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) }, + + { 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) }, + + { 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_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_CURRENT_SENSE), MP_ROM_PTR(&pin_GPIO29) }, + + { 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/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h index 29bde18060..4184f35a7a 100644 --- a/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h @@ -5,21 +5,3 @@ #define CIRCUITPY_RGB_STATUS_R (&pin_GPIO18) #define CIRCUITPY_RGB_STATUS_G (&pin_GPIO19) #define CIRCUITPY_RGB_STATUS_B (&pin_GPIO20) - -#define MICROPY_HW_USER_SW (&pin_GPIO23) - -// These pins are unconnected -#define IGNORE_PIN_GPIO8 1 -#define IGNORE_PIN_GPIO9 1 -#define IGNORE_PIN_GPIO10 1 -#define IGNORE_PIN_GPIO11 1 -#define IGNORE_PIN_GPIO12 1 -#define IGNORE_PIN_GPIO13 1 -#define IGNORE_PIN_GPIO14 1 -#define IGNORE_PIN_GPIO15 1 -#define IGNORE_PIN_GPIO16 1 -#define IGNORE_PIN_GPIO17 1 -#define IGNORE_PIN_GPIO21 1 -#define IGNORE_PIN_GPIO22 1 -#define IGNORE_PIN_GPIO24 1 -#define IGNORE_PIN_GPIO25 1 diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/pimoroni_tiny2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/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_tiny2040/pins.c b/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c index de79ee7320..6dd90a90bb 100644 --- a/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c +++ b/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -31,9 +33,5 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_GP29_A3), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_GP29), MP_ROM_PTR(&pin_GPIO29) }, - - { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/raspberry_pi_pico/pico-sdk-configboard.h b/ports/raspberrypi/boards/raspberry_pi_pico/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/raspberry_pi_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/raspberry_pi_pico/pins.c b/ports/raspberrypi/boards/raspberry_pi_pico/pins.c index 057eaec2af..87ff27fa46 100644 --- a/ports/raspberrypi/boards/raspberry_pi_pico/pins.c +++ b/ports/raspberrypi/boards/raspberry_pi_pico/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +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) }, @@ -49,4 +51,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/sparkfun_micromod_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/sparkfun_micromod_rp2040/mpconfigboard.h index d7dd7a6376..edeaf2e039 100644 --- a/ports/raspberrypi/boards/sparkfun_micromod_rp2040/mpconfigboard.h +++ b/ports/raspberrypi/boards/sparkfun_micromod_rp2040/mpconfigboard.h @@ -1,12 +1,15 @@ -#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod ATP - RP2040" +#define MICROPY_HW_BOARD_NAME "SparkFun MicroMod RP2040 Processor" #define MICROPY_HW_MCU_NAME "rp2040" +// Status LED +#define MICROPY_HW_LED_STATUS (&pin_GPIO25) + #define DEFAULT_I2C_BUS_SCL (&pin_GPIO5) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO4) -#define DEFAULT_SPI_BUS_SCK (&pin_GPIO14) -#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO15) -#define DEFAULT_SPI_BUS_MISO (&pin_GPIO12) +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO22) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO23) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO20) #define DEFAULT_UART_BUS_RX (&pin_GPIO1) #define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/sparkfun_micromod_rp2040/mpconfigboard.mk b/ports/raspberrypi/boards/sparkfun_micromod_rp2040/mpconfigboard.mk index 2ed559d8db..90f05a1754 100644 --- a/ports/raspberrypi/boards/sparkfun_micromod_rp2040/mpconfigboard.mk +++ b/ports/raspberrypi/boards/sparkfun_micromod_rp2040/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x1B4F USB_PID = 0x0024 -USB_PRODUCT = "MicroMod RP2040" -USB_MANUFACTURER = "SparkFun" +USB_PRODUCT = "SparkFun MicroMod RP2040 Processor" +USB_MANUFACTURER = "SparkFun Electronics" CHIP_VARIANT = RP2040 CHIP_FAMILY = rp2 diff --git a/ports/raspberrypi/boards/sparkfun_micromod_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/sparkfun_micromod_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/sparkfun_micromod_rp2040/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/sparkfun_micromod_rp2040/pins.c b/ports/raspberrypi/boards/sparkfun_micromod_rp2040/pins.c index 90069a7e6f..2c8a217a25 100644 --- a/ports/raspberrypi/boards/sparkfun_micromod_rp2040/pins.c +++ b/ports/raspberrypi/boards/sparkfun_micromod_rp2040/pins.c @@ -1,105 +1,224 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * Copyright (c) 2021 Chris Wilson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { - // D (Digital only) pins (D0,D1) - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO6) }, // GPIO6 - D0 - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO7) }, // GPIO7 - D1 +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // The SparkFun MicroMod spec uses a zero-based peripheral numbering scheme. + // The 0th peripheral is the default and the "0" is omitted from the + // peripheral name (e.g. "I2C" instead of "I2C0"). + // + // For more details, see https://www.sparkfun.com/micromod#tech-specs - // A (ADC) pins (A0,A1) - { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, // GPIO26 - A0 | ADC0 - { MP_ROM_QSTR(MP_QSTR_ADC0), MP_ROM_PTR(&pin_GPIO26) }, // ADC0 alias - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, // GPIO27 - A1 | ADC1 - { MP_ROM_QSTR(MP_QSTR_ADC1), MP_ROM_PTR(&pin_GPIO27) }, // ADC1 alias + // MicroMod built-in status LED pin + // Requirement from the "Designing with MicroMod" SparkFun article: + // "... every Processor Board shall include one status LED connected to a + // pin that is not connected to the board edge." + // Note: GPIO25 is connected to both the status LED and edge connector pin + // G10, which doesn't comply with the requirement above... + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) }, // MicroMod LED (GPIO25) - // G (General/BUS) pins (G0-G7, G8 NC, G9-G10, G11 NC) - { MP_ROM_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_GPIO16) }, // GPIO16 - G0 | BUS0 - { MP_ROM_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_GPIO16) }, // BUS0 alias - { MP_ROM_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_GPIO17) }, // GPIO17 - G1 | BUS1 - { MP_ROM_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_GPIO17) }, // BUS1 alias - { MP_ROM_QSTR(MP_QSTR_G2), MP_ROM_PTR(&pin_GPIO18) }, // GPIO18 - G2 | BUS2 - { MP_ROM_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_GPIO18) }, // BUS2 alias - { MP_ROM_QSTR(MP_QSTR_G3), MP_ROM_PTR(&pin_GPIO19) }, // GPIO19 - G3 | BUS3 - { MP_ROM_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_GPIO19) }, // BUS3 alias - { MP_ROM_QSTR(MP_QSTR_G4), MP_ROM_PTR(&pin_GPIO20) }, // GPIO20 - G4 | BUS4 | SPI_CIPO - { MP_ROM_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_GPIO20) }, // BUS4 alias - { MP_ROM_QSTR(MP_QSTR_G5), MP_ROM_PTR(&pin_GPIO21) }, // GPIO21 - G5 | BUS5 | SPI_CS - { MP_ROM_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_GPIO21) }, // BUS5 alias - { MP_ROM_QSTR(MP_QSTR_G6), MP_ROM_PTR(&pin_GPIO22) }, // GPIO22 - G6 | BUS6 | SPI_SCK - { MP_ROM_QSTR(MP_QSTR_BUS6), MP_ROM_PTR(&pin_GPIO22) }, // BUS6 alias - { MP_ROM_QSTR(MP_QSTR_G7), MP_ROM_PTR(&pin_GPIO23) }, // GPIO23 - G7 | BUS7 | SPI_COPI - { MP_ROM_QSTR(MP_QSTR_BUS7), MP_ROM_PTR(&pin_GPIO23) }, // BUS7 alias - // NC - G8 - { MP_ROM_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_GPIO28) }, // GPIO28- G9 | BUS9 | ADC_D- | CAM_HSYNC - { MP_ROM_QSTR(MP_QSTR_BUS9), MP_ROM_PTR(&pin_GPIO28) }, // BUS9 alias - { MP_ROM_QSTR(MP_QSTR_ADC_DM), MP_ROM_PTR(&pin_GPIO28) }, // ADC_DM alias - { MP_ROM_QSTR(MP_QSTR_CAM_HSYNC), MP_ROM_PTR(&pin_GPIO28) }, // CAM_HSYNC alias - { MP_ROM_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_GPIO25) }, // GPIO25 - G10 | BUS10 | ADC_D+ | CAM_VSYNC - { MP_ROM_QSTR(MP_QSTR_BUS10), MP_ROM_PTR(&pin_GPIO25) }, // BUS10 alias - { MP_ROM_QSTR(MP_QSTR_ADC_DP), MP_ROM_PTR(&pin_GPIO25) }, // ADC_DP alias - { MP_ROM_QSTR(MP_QSTR_CAM_VSYNC), MP_ROM_PTR(&pin_GPIO25) }, // CAM_VSYNC alias - // NC - G11 + // MicroMod USB bus input voltage (+5V) pin + // { MP_ROM_QSTR(MP_QSTR_USB_VIN), MP_ROM_PTR() }, // MicroMod USB_VIN (not connected) - // PWM pins (PWM0,PWM1) - { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO13) }, // GPIO13 - PWM0 - { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO24) }, // GPIO24 - PWM1 | AUD_MCLK + // MicroMod +3.3V enable pin + // { MP_ROM_QSTR(MP_QSTR_P3V3_EN), MP_ROM_PTR() }, // MicroMod 3.3V_EN (not connected) - // AUD (audio) - { MP_ROM_QSTR(MP_QSTR_AUD_MCLK), MP_ROM_PTR(&pin_GPIO24) }, // GPIO24 - AUD_MCLK | PWM1 - { MP_ROM_QSTR(MP_QSTR_AUD_OUT), MP_ROM_PTR(&pin_GPIO10) }, // GPIO10 - AUD_OUT | SDIO_DAT2 - { MP_ROM_QSTR(MP_QSTR_AUD_IN), MP_ROM_PTR(&pin_GPIO11) }, // GPIO11 - AUD_IN | SDIO_DAT1 - { MP_ROM_QSTR(MP_QSTR_AUD_LRCLK), MP_ROM_PTR(&pin_GPIO2) }, // GPIO2 - AUD_LRCLK | CTS1 - { MP_ROM_QSTR(MP_QSTR_AUD_BCLK), MP_ROM_PTR(&pin_GPIO3) }, // GPIO3 - AUD_BCLK | UART_RTS1 + // MicroMod battery voltage sense pin + { MP_ROM_QSTR(MP_QSTR_BATT_VIN3), MP_ROM_PTR(&pin_GPIO29) }, // MicroMod BATT_VIN/3 (GPIO29) - // Battery Voltage Monitor - { MP_ROM_QSTR(MP_QSTR_BATT_VIN3), MP_ROM_PTR(&pin_GPIO29) }, // GPIO29 - BATT_VIN/3 (ADC03) + // MicroMod reset pin + // { MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR() }, // MicroMod RESET# (RP2040 has a dedicated HW RUN pin) + // MicroMod boot pin + // { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR() }, // MicroMod BOOT (RP2040 does not have a dedicated BOOT pin) - // I2C - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) }, // GPIO4 - SDA - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO5) }, // GPIO5 - SCL + // MicroMod USB device pins + // USB device is always used internally by CircuitPython, so skip creating + // the pin objects for it. + // { MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR() }, // MicroMod USB_D- (RP2040 has a dedicated HW USB_DM pin) + // { MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR() }, // MicroMod USB_D+ (RP2040 has a dedicated HW USB_DP pin) - { MP_ROM_QSTR(MP_QSTR_I2C_INT), MP_ROM_PTR(&pin_GPIO8) }, // GPIO9 - I2C_INT | TX2 + // MicroMod USB host pins + // { MP_ROM_QSTR(MP_QSTR_USBHOST_DM), MP_ROM_PTR() }, // MicroMod USBHOST_D- (RP2040 has a dedicated HW USB_DM pin) + // { MP_ROM_QSTR(MP_QSTR_USBHOST_DP), MP_ROM_PTR() }, // MicroMod USBHOST_D+ (RP2040 has a dedicated HW USB_DP pin) - // SPI - { MP_ROM_QSTR(MP_QSTR_CIPO), MP_ROM_PTR(&pin_GPIO20) }, // GPIO20 - CIPO | SPI_CIPO | G4 - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO20) }, // MISO alias - { MP_ROM_QSTR(MP_QSTR_COPI), MP_ROM_PTR(&pin_GPIO23) }, // GPIO23 - COPI | SPI_COPI | G7 - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, // MOSI alias - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO22) }, // GPIO22 - SCK | SPI_SCK | G6 - { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO21) }, // GPIO21 - /CS | SPI_/CS | G5 + // MicroMod CAN pins + // { MP_ROM_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR() }, // MicroMod CAN_RX (not supported) + // { MP_ROM_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR() }, // MicroMod CAN_TX (not supported) - // SDI/SPI1 - { MP_ROM_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR(&pin_GPIO14) }, // GPIO14 - SDIO SCK | SDIO_CLK - { MP_ROM_QSTR(MP_QSTR_SPI_SCK1), MP_ROM_PTR(&pin_GPIO14) }, // SPI_SCK1 alias - { MP_ROM_QSTR(MP_QSTR_SDIO_CMD), MP_ROM_PTR(&pin_GPIO15) }, // GPIO15 - SDIO CMD | SDIO_CMD - { MP_ROM_QSTR(MP_QSTR_SPI_COPI1), MP_ROM_PTR(&pin_GPIO15) },// SPI_COPI1 alias - { MP_ROM_QSTR(MP_QSTR_SDIO_DATA0), MP_ROM_PTR(&pin_GPIO12) },// GPIO12 - SDIO DATA0 | SDIO_DATA0 - { MP_ROM_QSTR(MP_QSTR_SPI_CIPO1), MP_ROM_PTR(&pin_GPIO12) }, // SPI_CIPO1 alias - { MP_ROM_QSTR(MP_QSTR_SDIO_DATA1), MP_ROM_PTR(&pin_GPIO11) },// GPIO11 - SDIO DATA1 | SDIO_DATA1 | AUD_IN - { MP_ROM_QSTR(MP_QSTR_SDIO_DATA2), MP_ROM_PTR(&pin_GPIO10) },// GPIO10 - SDIO DATA2 | SDIO_DATA2 | AUD_OUT - { MP_ROM_QSTR(MP_QSTR_SDIO_DATA3), MP_ROM_PTR(&pin_GPIO9) },// GPIO9 - SDIO DATA3 | SDIO_DATA3 | SPI_CS1 - { MP_ROM_QSTR(MP_QSTR_SPI_CS1), MP_ROM_PTR(&pin_GPIO9) }, // SPI_CS1 alias + // Note: MicroMod UART (UART0) is not present in the edge connector pinout + // because the primary debug serial port is exposed as a virtual serial port + // over USB. - // Status LED - { MP_ROM_QSTR(MP_QSTR_LED1), MP_ROM_PTR(&pin_GPIO25) }, // GPIO25 - LED_BUILTIN | STAT | Blue LED | G10 + // MicroMod UART1 pins + { MP_ROM_QSTR(MP_QSTR_UART_TX1), MP_ROM_PTR(&pin_GPIO0) }, // MicroMod UART_TX1 | CircuitPython TX (GPIO0) + { MP_ROM_QSTR(MP_QSTR_UART_RX1), MP_ROM_PTR(&pin_GPIO1) }, // MicroMod UART_RX1 | CircuitPython RX (GPIO1) + { MP_ROM_QSTR(MP_QSTR_UART_RTS1), MP_ROM_PTR(&pin_GPIO3) }, // MicroMod RTS1 (GPIO3) + { MP_ROM_QSTR(MP_QSTR_UART_CTS1), MP_ROM_PTR(&pin_GPIO2) }, // MicroMod CTS1 (GPIO2) - // UART - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, // GPIO1 - UART RX | UART_RX1 | RX1 - { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO1) }, // RX1 alias - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, // GPIO0 - UART TX | UART_TX1 | TX1 - { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO0) }, // TX1 alias - { MP_ROM_QSTR(MP_QSTR_CTS), MP_ROM_PTR(&pin_GPIO2) }, // GPIO2 - UART CTS | CTS1 (TRACEDATA3) - { MP_ROM_QSTR(MP_QSTR_CTS1), MP_ROM_PTR(&pin_GPIO2) }, // CTS1 alias - { MP_ROM_QSTR(MP_QSTR_RTS), MP_ROM_PTR(&pin_GPIO3) }, // GPIO3 - UART RTS | RTS1 - { MP_ROM_QSTR(MP_QSTR_RTS1), MP_ROM_PTR(&pin_GPIO3) }, // RTS1 alias + // CircuitPython default UART pins + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, // CircuitPython TX | MicroMod UART_TX1 (GPIO0) + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, // CircuitPython RX | MicroMod UART_RX1 (GPIO1) - { MP_ROM_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO9) }, // GPIO9 - UART RX | UART_RX2 | RX2 | SDIO_DAT3 | SPI_CS1 - { MP_ROM_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO8) }, // GPIO8 - UART TX | UART_TX2 | TX2 | I2C_INT + // MicroMod UART2 pins + { MP_ROM_QSTR(MP_QSTR_UART_TX2), MP_ROM_PTR(&pin_GPIO8) }, // MicroMod UART_TX2 (GPIO8) + { MP_ROM_QSTR(MP_QSTR_UART_RX2), MP_ROM_PTR(&pin_GPIO9) }, // MicroMod UART_RX2 (GPIO9) - // Board objects - { 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 I2C pins + { MP_ROM_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_GPIO4) }, // MicroMod I2C_SDA | CircuitPython SDA (GPIO4) + { MP_ROM_QSTR(MP_QSTR_I2C_SCL), MP_ROM_PTR(&pin_GPIO5) }, // MicroMod I2C_SCL | CircuitPython SCL (GPIO5) + // CircuitPython default I2C pins + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) }, // CircuitPython SDA | MicroMod I2C_SDA (GPIO4) + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO5) }, // CircuitPython SCL | MicroMod I2C_SCL (GPIO5) + + // MicroMod I2C interrupt pin + { MP_ROM_QSTR(MP_QSTR_I2C_INT), MP_ROM_PTR(&pin_GPIO8) }, // MicroMod I2C_INT (GPIO8) + + // MicroMod I2C1 pins + // { MP_ROM_QSTR(MP_QSTR_I2C_SDA1), MP_ROM_PTR() }, // MicroMod I2C_SDA1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_I2C_SCL1), MP_ROM_PTR() }, // MicroMod I2C_SCL1 (not connected) + + // MicroMod SPI pins + { MP_ROM_QSTR(MP_QSTR_SPI_CIPO), MP_ROM_PTR(&pin_GPIO20) }, // MicroMod SPI_CIPO | CircuitPython CIPO (GPIO20) + { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_GPIO20) }, // MicroMod SPI_MISO | CircuitPython MISO (GPIO20) + { MP_ROM_QSTR(MP_QSTR_SPI_COPI), MP_ROM_PTR(&pin_GPIO23) }, // MicroMod SPI_COPI | CircuitPython COPI | LED_DAT (GPIO23) + { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_GPIO23) }, // MicroMod SPI_MOSI | CircuitPython MOSI (GPIO23) + { MP_ROM_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_GPIO22) }, // MicroMod SPI_SCK | CircuitPython SCK | LED_CLK (GPIO22) + { MP_ROM_QSTR(MP_QSTR_SPI_CS), MP_ROM_PTR(&pin_GPIO21) }, // MicroMod SPI_CS | CircuitPython CS (GPIO21) + + // CircuitPython default SPI pins + { MP_ROM_QSTR(MP_QSTR_CIPO), MP_ROM_PTR(&pin_GPIO20) }, // CircuitPython CIPO | MicroMod SPI_CIPO (GPIO20) + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO20) }, // CircuitPython MISO | MicroMod SPI_MISO (GPIO20) + { MP_ROM_QSTR(MP_QSTR_COPI), MP_ROM_PTR(&pin_GPIO23) }, // CircuitPython COPI | MicroMod SPI_COPI | LED_DAT (GPIO23) + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO23) }, // CircuitPython MOSI | MicroMod SPI_MOSI (GPIO23) + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO22) }, // CircuitPython SCK | MicroMod SPI_SCK | LED_CLK (GPIO22) + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO21) }, // CircuitPython CS | MicroMod SPI_CS (GPIO21) + + // MicroMod 2-wire serial LED pins + { MP_ROM_QSTR(MP_QSTR_LED_DAT), MP_ROM_PTR(&pin_GPIO23) }, // MicroMod LED_DAT | SPI_COPI + { MP_ROM_QSTR(MP_QSTR_LED_CLK), MP_ROM_PTR(&pin_GPIO22) }, // MicroMod LED_CLK | SPI_SCK + + // MicroMod SDIO pins + { MP_ROM_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR(&pin_GPIO14) }, // MicroMod SDIO_SCK | SPI_SCK1 (GPIO14) + { MP_ROM_QSTR(MP_QSTR_SDIO_CMD), MP_ROM_PTR(&pin_GPIO15) }, // MicroMod SDIO_CMD | SPI_COPI1 (GPIO15) + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA0), MP_ROM_PTR(&pin_GPIO12) }, // MicroMod SDIO_DATA0 | SPI_CIPO1 (GPIO12) + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA1), MP_ROM_PTR(&pin_GPIO11) }, // MicroMod SDIO_DATA1 (GPIO11) + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA2), MP_ROM_PTR(&pin_GPIO10) }, // MicroMod SDIO_DATA2 (GPIO10) + { MP_ROM_QSTR(MP_QSTR_SDIO_DATA3), MP_ROM_PTR(&pin_GPIO9) }, // MicroMod SDIO_DATA3 | SPI_CS1 (GPIO9) + + // MicroMod SPI1 pins + { MP_ROM_QSTR(MP_QSTR_SPI_CIPO1), MP_ROM_PTR(&pin_GPIO12) }, // MicroMod SPI_CIPO1 | SDIO_DATA0 (GPIO12) + { MP_ROM_QSTR(MP_QSTR_SPI_MISO1), MP_ROM_PTR(&pin_GPIO12) }, // MicroMod SPI_MISO1 (GPIO12) + { MP_ROM_QSTR(MP_QSTR_SPI_COPI1), MP_ROM_PTR(&pin_GPIO15) }, // MicroMod SPI_COPI1 | SDIO_CMD (GPIO15) + { MP_ROM_QSTR(MP_QSTR_SPI_MOSI1), MP_ROM_PTR(&pin_GPIO15) }, // MicroMod SPI_MOSI1 (GPIO15) + { MP_ROM_QSTR(MP_QSTR_SPI_SCK1), MP_ROM_PTR(&pin_GPIO14) }, // MicroMod SPI_SCK1 | SDIO_SCK (GPIO14) + { MP_ROM_QSTR(MP_QSTR_SPI_CS1), MP_ROM_PTR(&pin_GPIO9) }, // MicroMod SPI_CS1 | SDIO_DATA3 (GPIO9) + + // MicroMod audio pins + { MP_ROM_QSTR(MP_QSTR_AUD_MCLK), MP_ROM_PTR(&pin_GPIO24) }, // MicroMod AUD_MCLK (GPIO24) + { MP_ROM_QSTR(MP_QSTR_AUD_OUT), MP_ROM_PTR(&pin_GPIO10) }, // MicroMod AUD_OUT | I2S_OUT | PCM_OUT | CAM_MCLK (GPIO10) + { MP_ROM_QSTR(MP_QSTR_AUD_IN), MP_ROM_PTR(&pin_GPIO11) }, // MicroMod AUD_IN | I2S_IN | PCM_IN | CAM_PCLK (GPIO11) + { MP_ROM_QSTR(MP_QSTR_AUD_LRCLK), MP_ROM_PTR(&pin_GPIO2) }, // MicroMod AUD_LRCLK | I2S_WS | PCM_SYNC | PDM_DATA (GPIO2) + { MP_ROM_QSTR(MP_QSTR_AUD_BCLK), MP_ROM_PTR(&pin_GPIO3) }, // MicroMod AUD_BCLK | I2S_SCK | PCM_CLK | PDM_CLK (GPIO3) + + // MicroMod I2S pins + { MP_ROM_QSTR(MP_QSTR_I2S_OUT), MP_ROM_PTR(&pin_GPIO10) }, // MicroMod I2S_OUT | AUD_OUT | PCM_OUT | CAM_MCLK (GPIO10) + { MP_ROM_QSTR(MP_QSTR_I2S_IN), MP_ROM_PTR(&pin_GPIO11) }, // MicroMod I2S_IN | AUD_IN | PCM_IN | CAM_PCLK (GPIO11) + { MP_ROM_QSTR(MP_QSTR_I2S_WS), MP_ROM_PTR(&pin_GPIO2) }, // MicroMod I2S_WS | AUD_LRCLK | PCM_SYNC | PDM_DATA (GPIO2) + { MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_GPIO3) }, // MicroMod I2S_SCK | AUD_BCLK | PCM_CLK | PDM_CLK (GPIO3) + + // MicroMod PCM pins + { MP_ROM_QSTR(MP_QSTR_PCM_OUT), MP_ROM_PTR(&pin_GPIO10) }, // MicroMod PCM_OUT | AUD_OUT | I2S_OUT | CAM_MCLK (GPIO10) + { MP_ROM_QSTR(MP_QSTR_PCM_IN), MP_ROM_PTR(&pin_GPIO11) }, // MicroMod PCM_IN | AUD_IN | I2S_IN | CAM_PCLK (GPIO11) + { MP_ROM_QSTR(MP_QSTR_PCM_SYNC), MP_ROM_PTR(&pin_GPIO2) }, // MicroMod PCM_SYNC | AUD_LRCLK | I2S_WS | PDM_DATA (GPIO2) + { MP_ROM_QSTR(MP_QSTR_PCM_CLK), MP_ROM_PTR(&pin_GPIO3) }, // MicroMod PCM_CLK | AUD_BCLK | I2S_SCK | PDM_CLK (GPIO3) + + // MicroMod PDM pins + { MP_ROM_QSTR(MP_QSTR_PDM_DATA), MP_ROM_PTR(&pin_GPIO2) }, // MicroMod PDM_DATA | AUD_LRCLK | I2S_WS | PCM_SYNC (GPIO2) + { MP_ROM_QSTR(MP_QSTR_PDM_CLK), MP_ROM_PTR(&pin_GPIO3) }, // MicroMod PDM_CLK | AUD_BCLK | I2S_SCK | PCM_CLK (GPIO3) + + // MicroMod SWD pins + // { MP_ROM_QSTR(MP_QSTR_SWDIO), MP_ROM_PTR() }, // MicroMod SWDIO (RP2040 has a dedicated HW SWDIO pin) + // { MP_ROM_QSTR(MP_QSTR_SWCLK), MP_ROM_PTR() }, // MicroMod SWDCK (RP2040 has a dedicated HW SWCLK pin) + // { MP_ROM_QSTR(MP_QSTR_SWO), MP_ROM_PTR() }, // MicroMod SWO | G11 (not supported) + + // MicroMod ADC pins + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, // MicroMod A0 (GPIO26) + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, // MicroMod A1 (GPIO27) + + // MicroMod PWM pins + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO13) }, // MicroMod PWM0 (GPIO13) + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO24) }, // MicroMod PWM1 (GPIO24) + + // MicroMod digital pins + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO6) }, // MicroMod D0 (GPIO6) + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO7) }, // MicroMod D1 | CAM_TRIG (GPIO7) + + // MicroMod general purpose pins + { MP_ROM_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_GPIO16) }, // MicroMod G0 | BUS0 (GPIO16) + { MP_ROM_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_GPIO17) }, // MicroMod G1 | BUS1 (GPIO17) + { MP_ROM_QSTR(MP_QSTR_G2), MP_ROM_PTR(&pin_GPIO18) }, // MicroMod G2 | BUS2 (GPIO18) + { MP_ROM_QSTR(MP_QSTR_G3), MP_ROM_PTR(&pin_GPIO19) }, // MicroMod G3 | BUS3 (GPIO19) + { MP_ROM_QSTR(MP_QSTR_G4), MP_ROM_PTR(&pin_GPIO20) }, // MicroMod G4 | BUS4 (GPIO20) + { MP_ROM_QSTR(MP_QSTR_G5), MP_ROM_PTR(&pin_GPIO21) }, // MicroMod G5 | BUS5 (GPIO21) + { MP_ROM_QSTR(MP_QSTR_G6), MP_ROM_PTR(&pin_GPIO22) }, // MicroMod G6 | BUS6 (GPIO22) + { MP_ROM_QSTR(MP_QSTR_G7), MP_ROM_PTR(&pin_GPIO23) }, // MicroMod G7 | BUS7 (GPIO23) + // { MP_ROM_QSTR(MP_QSTR_G8), MP_ROM_PTR() }, // MicroMod G8 (not connected) + { MP_ROM_QSTR(MP_QSTR_G9), MP_ROM_PTR(&pin_GPIO28) }, // MicroMod G9 | ADC_D- | CAM_HSYNC (GPIO28) + { MP_ROM_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_GPIO25) }, // MicroMod G10 | ADC_D+ | CAM_VSYNC (GPIO25) + // { MP_ROM_QSTR(MP_QSTR_G11), MP_ROM_PTR() }, // MicroMod G11 | SWO (not connected) + + // MicroMod 8-bit bus pins + { MP_ROM_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_GPIO16) }, // MicroMod BUS0 | G0 (GPIO16) + { MP_ROM_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_GPIO17) }, // MicroMod BUS1 | G1 (GPIO17) + { MP_ROM_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_GPIO18) }, // MicroMod BUS2 | G2 (GPIO18) + { MP_ROM_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_GPIO19) }, // MicroMod BUS3 | G3 (GPIO19) + { MP_ROM_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_GPIO20) }, // MicroMod BUS4 | G4 (GPIO20) + { MP_ROM_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_GPIO21) }, // MicroMod BUS5 | G5 (GPIO21) + { MP_ROM_QSTR(MP_QSTR_BUS6), MP_ROM_PTR(&pin_GPIO22) }, // MicroMod BUS6 | G6 (GPIO22) + { MP_ROM_QSTR(MP_QSTR_BUS7), MP_ROM_PTR(&pin_GPIO23) }, // MicroMod BUS7 | G7 (GPIO23) + + // MicroMod differential ADC input pins (not supported by RP2040) + // { MP_ROM_QSTR(MP_QSTR_ADC_DM), MP_ROM_PTR(&pin_GPIO28) }, // MicroMod ADC_D- | G9 | CAM_HSYNC (GPIO28) + // { MP_ROM_QSTR(MP_QSTR_ADC_DP), MP_ROM_PTR(&pin_GPIO25) }, // MicroMod ADC_D+ | G10 | CAM_VSYNC (GPIO25) + + // MicroMod camera pins + { MP_ROM_QSTR(MP_QSTR_CAM_MCLK), MP_ROM_PTR(&pin_GPIO10) }, // MicroMod CAM_MCLK | AUD_OUT | I2S_OUT | PCM_OUT (GPIO10) + { MP_ROM_QSTR(MP_QSTR_CAM_PCLK), MP_ROM_PTR(&pin_GPIO11) }, // MicroMod CAM_PCLK | AUD_IN | I2S_IN | PCM_IN (GPIO11) + { MP_ROM_QSTR(MP_QSTR_CAM_TRIG), MP_ROM_PTR(&pin_GPIO7) }, // MicroMod CAM_TRIG | D1 (GPIO7) + { MP_ROM_QSTR(MP_QSTR_CAM_HSYNC), MP_ROM_PTR(&pin_GPIO28) }, // MicroMod CAM_HSYNC | ADC_D- | G9 (GPIO28) + { MP_ROM_QSTR(MP_QSTR_CAM_VSYNC), MP_ROM_PTR(&pin_GPIO25) }, // MicroMod CAM_VSYNC | ADC_D+ | G10 (GPIO25) + + // CircuitPython board objects + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, // CircuitPython I2C + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, // CircuitPython SPI + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, // CircuitPython UART }; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/pins.c b/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/pins.c index e8f2335d99..bc7cb048de 100644 --- a/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/pins.c +++ b/ports/raspberrypi/boards/sparkfun_pro_micro_rp2040/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, { MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, @@ -41,4 +43,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..36da55d457 --- /dev/null +++ b/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pico-sdk-configboard.h @@ -0,0 +1 @@ +// Put board-specific pico-sdk definitions here. This file must exist. diff --git a/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pins.c b/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pins.c index a27a6c6550..a72342c86a 100644 --- a/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pins.c +++ b/ports/raspberrypi/boards/sparkfun_thing_plus_rp2040/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // Left side breakouts, top-to-bottom, as labeled { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO6) }, @@ -60,4 +62,4 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { 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_global_dict_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/raspberrypi/common-hal/audiobusio/I2SOut.c b/ports/raspberrypi/common-hal/audiobusio/I2SOut.c index 15a7cd523b..da50e17f42 100644 --- a/ports/raspberrypi/common-hal/audiobusio/I2SOut.c +++ b/ports/raspberrypi/common-hal/audiobusio/I2SOut.c @@ -117,7 +117,8 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self, } // Use the state machine to manage pins. - common_hal_rp2pio_statemachine_construct(&self->state_machine, + common_hal_rp2pio_statemachine_construct( + &self->state_machine, program, program_len, 44100 * 32 * 6, // Clock at 44.1 khz to warm the DAC up. NULL, 0, @@ -131,7 +132,8 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t *self, true, // exclusive pin use false, 32, false, // shift out left to start with MSB false, // Wait for txstall - false, 32, false); // in settings + false, 32, false, // in settings + false); // Not user-interruptible. self->playing = false; audio_dma_init(&self->dma); @@ -172,14 +174,19 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self, uint16_t bits_per_sample_output = bits_per_sample * 2; size_t clocks_per_bit = 6; uint32_t frequency = bits_per_sample_output * audiosample_sample_rate(sample); - common_hal_rp2pio_statemachine_set_frequency(&self->state_machine, clocks_per_bit * frequency); - common_hal_rp2pio_statemachine_restart(&self->state_machine); - uint8_t channel_count = audiosample_channel_count(sample); if (channel_count > 2) { mp_raise_ValueError(translate("Too many channels in sample.")); } + common_hal_rp2pio_statemachine_set_frequency(&self->state_machine, clocks_per_bit * frequency); + common_hal_rp2pio_statemachine_restart(&self->state_machine); + + // On the RP2040, output registers are always written with a 32-bit write. + // If the write is 8 or 16 bits wide, the data will be replicated in upper bytes. + // See section 2.1.4 Narrow IO Register Writes in the RP2040 datasheet. + // This means that identical 16-bit audio data will be written in both halves of the incoming PIO + // FIFO register. Thus we get mono-to-stereo conversion for the I2S output for free. audio_dma_result result = audio_dma_setup_playback( &self->dma, sample, @@ -199,8 +206,6 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t *self, mp_raise_RuntimeError(translate("Unable to allocate buffers for signed conversion")); } - // Turn on the state machine's clock. - self->playing = true; } diff --git a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c index 4dc14eaeda..323a3dfbc8 100644 --- a/ports/raspberrypi/common-hal/audiobusio/PDMIn.c +++ b/ports/raspberrypi/common-hal/audiobusio/PDMIn.c @@ -76,7 +76,8 @@ void common_hal_audiobusio_pdmin_construct(audiobusio_pdmin_obj_t *self, true, // exclusive pin use false, 32, false, // out settings false, // Wait for txstall - false, 32, true); // in settings + false, 32, true, // in settings + false); // Not user-interruptible uint32_t actual_frequency = common_hal_rp2pio_statemachine_get_frequency(&self->state_machine); if (actual_frequency < MIN_MIC_CLOCK) { diff --git a/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c b/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c index 3a8a7ef226..0654037d66 100644 --- a/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c @@ -26,6 +26,7 @@ #include "common-hal/audiopwmio/PWMAudioOut.h" +#include #include #include @@ -38,7 +39,6 @@ #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Processor.h" -#include "supervisor/shared/tick.h" #include "supervisor/shared/translate.h" #include "src/rp2040/hardware_structs/include/hardware/structs/dma.h" @@ -52,6 +52,58 @@ #define SAMPLE_BITS_TO_DISCARD (16 - BITS_PER_SAMPLE) #define PWM_TOP ((1 << BITS_PER_SAMPLE) - 1) + +static uint32_t gcd(uint32_t a, uint32_t b) { + while (b) { + uint32_t tmp = a % b; + a = b; + b = tmp; + } + return a; +} + +static uint32_t limit_denominator(uint32_t max_denominator, uint32_t num_in, uint32_t den_in, uint32_t *den_out) { +// Algorithm based on Python's limit_denominator + uint32_t p0 = 0, q0 = 1, p1 = 1, q1 = 0; + uint32_t d = den_in, n = num_in; + uint32_t g = gcd(n, d); + d /= g; + n /= g; + if (d < max_denominator) { + *den_out = d; + return n; + } + while (1) { + uint32_t a = n / d; + uint32_t q2 = q0 + a * q1; + if (q2 > max_denominator) { + break; + } + + uint32_t p_tmp = p0 + a * p1; + p0 = p1; + q0 = q1; + p1 = p_tmp; + q1 = q2; + + uint32_t d_tmp = n - a * d; + n = d; + d = d_tmp; + } + uint32_t k = (max_denominator - q0) / q1; + uint32_t bound1_num = p0 + k * p1, bound1_den = q0 + k * q1; + uint32_t bound2_num = p1, bound2_den = q1; + + if (fabsf((float)bound1_num / bound1_den - (float)num_in / den_in) <= + fabsf((float)bound2_num / bound2_den - (float)num_in / den_in)) { + *den_out = bound2_den; + return bound2_num; + } + + *den_out = bound1_den; + return bound1_num; +} + void audiopwmout_reset() { for (size_t i = 0; i < NUM_DMA_TIMERS; i++) { dma_hw->timer[i] = 0; @@ -158,6 +210,23 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t *self, tx_register += self->left_pwm.channel * sizeof(uint16_t); } + self->pacing_timer = pacing_timer; + + // Playback with two independent clocks. One is the sample rate which + // determines when we push a new sample to the PWM slice. The second is the + // PWM frequency itself. + + // Determine the DMA divisor. The RP2040 has four pacing timers we can use + // to trigger the DMA. Each has a 16 bit fractional divisor system clock * X / Y where X and Y + // are 16-bit. + + uint32_t sample_rate = audiosample_sample_rate(sample); + + uint32_t system_clock = common_hal_mcu_processor_get_frequency(); + uint32_t best_denominator; + uint32_t best_numerator = limit_denominator(0xffff, sample_rate, system_clock, &best_denominator); + + dma_hw->timer[pacing_timer] = best_numerator << 16 | best_denominator; audio_dma_result result = audio_dma_setup_playback( &self->dma, sample, @@ -177,44 +246,7 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t *self, common_hal_audiopwmio_pwmaudioout_stop(self); mp_raise_RuntimeError(translate("Unable to allocate buffers for signed conversion")); } - // OK! We got all of the resources we need and dma is ready. - self->pacing_timer = pacing_timer; - - // Playback with two independent clocks. One is the sample rate which - // determines when we push a new sample to the PWM slice. The second is the - // PWM frequency itself. - - // Determine the DMA divisor. The RP2040 has four pacing timers we can use - // to trigger the DMA. Each has a 16 bit fractional divisor system clock * X / Y where X and Y - // are 16-bit. - - uint32_t sample_rate = audiosample_sample_rate(sample); - - uint32_t system_clock = common_hal_mcu_processor_get_frequency(); - uint32_t best_numerator = 0; - uint32_t best_denominator = 0; - uint32_t best_error = system_clock; - - for (uint32_t denominator = 0xffff; denominator > 0; denominator--) { - uint32_t numerator = (denominator * sample_rate) / system_clock; - uint32_t remainder = (denominator * sample_rate) % system_clock; - if (remainder > (system_clock / 2)) { - numerator += 1; - remainder = system_clock - remainder; - } - if (remainder < best_error) { - best_denominator = denominator; - best_numerator = numerator; - best_error = remainder; - // Stop early if we can't do better. - if (remainder == 0) { - break; - } - } - } - - dma_hw->timer[pacing_timer] = best_numerator << 16 | best_denominator; } void common_hal_audiopwmio_pwmaudioout_stop(audiopwmio_pwmaudioout_obj_t *self) { @@ -226,9 +258,11 @@ void common_hal_audiopwmio_pwmaudioout_stop(audiopwmio_pwmaudioout_obj_t *self) audio_dma_stop(&self->dma); // Set to quiescent level. - pwm_hw->slice[self->left_pwm.slice].cc = self->quiescent_value; + common_hal_pwmio_pwmout_set_duty_cycle(&self->left_pwm, self->quiescent_value); + pwmio_pwmout_set_top(&self->left_pwm, PWM_TOP); if (self->stereo) { - pwm_hw->slice[self->right_pwm.slice].cc = self->quiescent_value; + common_hal_pwmio_pwmout_set_duty_cycle(&self->right_pwm, self->quiescent_value); + pwmio_pwmout_set_top(&self->right_pwm, PWM_TOP); } } diff --git a/ports/raspberrypi/common-hal/busio/I2C.c b/ports/raspberrypi/common-hal/busio/I2C.c index a72675d6b6..96038b4241 100644 --- a/ports/raspberrypi/common-hal/busio/I2C.c +++ b/ports/raspberrypi/common-hal/busio/I2C.c @@ -59,9 +59,10 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, 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. - if (scl->number % 2 == 1 && sda->number % 2 == 0 && scl->number / 2 == sda->number / 2) { - size_t instance = (scl->number / 2) % 2; - self->peripheral = i2c[instance]; + 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) { mp_raise_ValueError(translate("Invalid pins")); diff --git a/ports/raspberrypi/common-hal/countio/Counter.c b/ports/raspberrypi/common-hal/countio/Counter.c index 2dcd1de123..3d2d291b99 100644 --- a/ports/raspberrypi/common-hal/countio/Counter.c +++ b/ports/raspberrypi/common-hal/countio/Counter.c @@ -1,4 +1,4 @@ -#include "common-hal/countio/Counter.h" +#include "shared-bindings/countio/Counter.h" #include "py/runtime.h" #include "py/mpstate.h" @@ -48,6 +48,15 @@ void common_hal_countio_counter_construct(countio_counter_obj_t *self, pwm_set_enabled(self->slice_num, true); } + +void reset_countio(void) { + for (size_t i = 0; i < NUM_PWM_SLICES; i++) { + if (MP_STATE_PORT(counting)[i] != NULL) { + common_hal_countio_counter_deinit(MP_STATE_PORT(counting)[i]); + } + } +} + bool common_hal_countio_counter_deinited(countio_counter_obj_t *self) { return self->pin_a == 0; } diff --git a/ports/raspberrypi/common-hal/countio/Counter.h b/ports/raspberrypi/common-hal/countio/Counter.h index 201034cf46..78e00e0dd2 100644 --- a/ports/raspberrypi/common-hal/countio/Counter.h +++ b/ports/raspberrypi/common-hal/countio/Counter.h @@ -16,4 +16,6 @@ typedef struct { void counter_interrupt_handler(); +void reset_countio(void); + #endif // MICROPY_INCLUDED_RASPBERRRYPI_COMMON_HAL_COUNTIO_COUNTER_H diff --git a/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c b/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c index 0b388f4b3e..1d0355d1c0 100644 --- a/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c +++ b/ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c @@ -116,7 +116,9 @@ void common_hal_imagecapture_parallelimagecapture_construct(imagecapture_paralle true, // exclusive pin use false, 32, false, // out settings false, // wait for txstall - true, 32, true); // in settings + true, 32, true, // in settings + false); // Not user-interruptible. + PIO pio = self->state_machine.pio; uint8_t pio_index = pio_get_index(pio); diff --git a/ports/raspberrypi/common-hal/microcontroller/Processor.c b/ports/raspberrypi/common-hal/microcontroller/Processor.c index e22286ca3d..68518d75b3 100644 --- a/ports/raspberrypi/common-hal/microcontroller/Processor.c +++ b/ports/raspberrypi/common-hal/microcontroller/Processor.c @@ -34,6 +34,11 @@ #include "src/rp2_common/hardware_adc/include/hardware/adc.h" #include "src/rp2_common/hardware_clocks/include/hardware/clocks.h" +#include "src/rp2040/hardware_regs/include/hardware/regs/vreg_and_chip_reset.h" +#include "src/rp2040/hardware_regs/include/hardware/regs/watchdog.h" +#include "src/rp2040/hardware_structs/include/hardware/structs/vreg_and_chip_reset.h" +#include "src/rp2040/hardware_structs/include/hardware/structs/watchdog.h" + float common_hal_mcu_processor_get_temperature(void) { adc_init(); adc_set_temp_sensor_enabled(true); @@ -60,5 +65,34 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) { } mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) { - return RESET_REASON_UNKNOWN; + mcu_reset_reason_t reason = RESET_REASON_UNKNOWN; + + uint32_t watchdog_reset_reg = watchdog_hw->reason; + uint32_t chip_reset_reg = vreg_and_chip_reset_hw->chip_reset; + + if (chip_reset_reg & VREG_AND_CHIP_RESET_CHIP_RESET_HAD_PSM_RESTART_BITS) { + reason = RESET_REASON_RESCUE_DEBUG; + } + + if (chip_reset_reg & VREG_AND_CHIP_RESET_CHIP_RESET_HAD_RUN_BITS) { + reason = RESET_REASON_RESET_PIN; + } + + if (chip_reset_reg & VREG_AND_CHIP_RESET_CHIP_RESET_HAD_POR_BITS) { + // NOTE: This register is also used for brownout, but there is no way to differentiate between power on and brown out + reason = RESET_REASON_POWER_ON; + } + + // Check watchdog after chip reset since watchdog doesn't clear chip_reset, while chip_reset clears the watchdog + + if (watchdog_reset_reg & WATCHDOG_REASON_TIMER_BITS) { + // This bit can also be set during a software reset because the pico-sdk performs a software reset by setting an extremely low timeout on the watchdog, rather than triggering a watchdog reset manually + reason = RESET_REASON_WATCHDOG; + } + + if (watchdog_reset_reg & WATCHDOG_REASON_FORCE_BITS) { + reason = RESET_REASON_SOFTWARE; + } + + return reason; } diff --git a/ports/raspberrypi/common-hal/neopixel_write/__init__.c b/ports/raspberrypi/common-hal/neopixel_write/__init__.c index 3f923c8e0b..b3d704453c 100644 --- a/ports/raspberrypi/common-hal/neopixel_write/__init__.c +++ b/ports/raspberrypi/common-hal/neopixel_write/__init__.c @@ -76,7 +76,8 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t *digitalinout, true, 8, false, // TX, auto pull every 8 bits. shift left to output msb first true, // Wait for txstall. If we don't, then we'll deinit too quickly. false, 32, true, // RX setting we don't use - false); // claim pins + false, // claim pins + false); // Not user-interruptible. if (!ok) { // Do nothing. Maybe bitbang? return; diff --git a/ports/raspberrypi/common-hal/displayio/ParallelBus.c b/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c similarity index 84% rename from ports/raspberrypi/common-hal/displayio/ParallelBus.c rename to ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c index 5b97c79521..9971474042 100644 --- a/ports/raspberrypi/common-hal/displayio/ParallelBus.c +++ b/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/displayio/ParallelBus.h" +#include "shared-bindings/paralleldisplay/ParallelBus.h" #include @@ -43,7 +43,7 @@ static const uint16_t parallel_program[] = { // .wrap }; -void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *self, +void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbus_obj_t *self, const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select, const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) { @@ -80,7 +80,7 @@ void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *sel common_hal_digitalio_digitalinout_construct(&self->reset, reset); common_hal_digitalio_digitalinout_switch_to_output(&self->reset, true, DRIVE_MODE_PUSH_PULL); never_reset_pin_number(reset->number); - common_hal_displayio_parallelbus_reset(self); + common_hal_paralleldisplay_parallelbus_reset(self); } never_reset_pin_number(command->number); @@ -104,13 +104,13 @@ void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *sel 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, 32, true, // RX setting we don't use + false); // Not user-interruptible. common_hal_rp2pio_statemachine_never_reset(&self->state_machine); } -void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self) { +void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_obj_t *self) { common_hal_rp2pio_statemachine_deinit(&self->state_machine); for (uint8_t i = 0; i < 8; i++) { @@ -124,8 +124,8 @@ void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self) reset_pin_number(self->reset.pin->number); } -bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); +bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t obj) { + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); if (self->reset.base.type == &mp_type_NoneType) { return false; } @@ -136,26 +136,26 @@ bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { return true; } -bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { +bool common_hal_paralleldisplay_parallelbus_bus_free(mp_obj_t obj) { return true; } -bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); +bool common_hal_paralleldisplay_parallelbus_begin_transaction(mp_obj_t obj) { + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->chip_select, false); return true; } -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, +void common_hal_paralleldisplay_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); + 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); } -void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { - displayio_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); +void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t obj) { + paralleldisplay_parallelbus_obj_t *self = MP_OBJ_TO_PTR(obj); common_hal_digitalio_digitalinout_set_value(&self->chip_select, true); } diff --git a/ports/raspberrypi/common-hal/displayio/ParallelBus.h b/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.h similarity index 86% rename from ports/raspberrypi/common-hal/displayio/ParallelBus.h rename to ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.h index 3d83c8fca7..87f149b9b8 100644 --- a/ports/raspberrypi/common-hal/displayio/ParallelBus.h +++ b/ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_DISPLAYIO_PARALLELBUS_H -#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H +#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H #include "common-hal/digitalio/DigitalInOut.h" #include "bindings/rp2pio/StateMachine.h" @@ -40,6 +40,6 @@ typedef struct { uint8_t write; uint8_t data0_pin; rp2pio_statemachine_obj_t state_machine; -} displayio_parallelbus_obj_t; +} paralleldisplay_parallelbus_obj_t; -#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_DISPLAYIO_PARALLELBUS_H +#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_PARALLELDISPLAY_PARALLELBUS_H diff --git a/ports/raspberrypi/common-hal/pulseio/PulseIn.c b/ports/raspberrypi/common-hal/pulseio/PulseIn.c index b9210af5f0..4e9b56a1a1 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseIn.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseIn.c @@ -72,7 +72,8 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self, false, 8, false, // TX, unused false, true, 32, true, // RX auto-push every 32 bits - false); // claim pins + false, // claim pins + false); // Not user-interruptible. if (!ok) { mp_raise_RuntimeError(translate("All state machines in use")); diff --git a/ports/raspberrypi/common-hal/pulseio/PulseOut.c b/ports/raspberrypi/common-hal/pulseio/PulseOut.c index 4e403fa020..2b4ab7185c 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseOut.c +++ b/ports/raspberrypi/common-hal/pulseio/PulseOut.c @@ -35,30 +35,24 @@ #include "common-hal/pwmio/PWMOut.h" #include "supervisor/shared/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" #include "src/common/pico_time/include/pico/time.h" -static uint8_t refcount = 0; volatile alarm_id_t cur_alarm = 0; -void turn_off(uint8_t slice) { - pwm_hw->slice[slice].ctr = 0; - pwm_hw->slice[slice].cc = 0; - pwm_hw->slice[slice].top = 0; - pwm_hw->slice[slice].div = 1u << PWM_CH0_DIV_INT_LSB; - pwm_hw->slice[slice].csr = PWM_CH0_CSR_EN_BITS; - pwm_hw->slice[slice].csr = 0; -} - void pulse_finish(pulseio_pulseout_obj_t *self) { self->pulse_index++; - // Turn pwm pin off by setting duty cyle to 1. - common_hal_pwmio_pwmout_set_duty_cycle(self->carrier,1); + // Turn pwm pin off by switching the GPIO mux to SIO (the cpu manual + // control). if (self->pulse_index >= self->pulse_length) { + gpio_set_function(self->pin, GPIO_FUNC_SIO); return; } if (self->pulse_index % 2 == 0) { - common_hal_pwmio_pwmout_set_duty_cycle(self->carrier,self->current_duty_cycle); + gpio_set_function(self->pin, GPIO_FUNC_PWM); + } else { + gpio_set_function(self->pin, GPIO_FUNC_SIO); } uint64_t delay = self->pulse_buffer[self->pulse_index]; if (delay < self->min_pulse) { @@ -78,24 +72,27 @@ int64_t pulseout_interrupt_handler(alarm_id_t id, void *user_data) { } void pulseout_reset() { - refcount = 0; } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, - const pwmio_pwmout_obj_t *carrier, const mcu_pin_obj_t *pin, uint32_t frequency, uint16_t duty_cycle) { - refcount++; - self->carrier = (pwmio_pwmout_obj_t *)carrier; - self->current_duty_cycle = common_hal_pwmio_pwmout_get_duty_cycle(self->carrier); - pwm_set_enabled(self->carrier->slice,false); - turn_off(self->carrier->slice); - common_hal_pwmio_pwmout_set_duty_cycle(self->carrier,1); - self->pin = self->carrier->pin->number; - self->slice = self->carrier->slice; - self->min_pulse = (1000000 / self->carrier->actual_frequency); + pwmout_result_t result = common_hal_pwmio_pwmout_construct( + &self->carrier, pin, 0, frequency, false); + // This will raise an exception and not return if needed. + common_hal_pwmio_pwmout_raise_error(result); + + // Disable gpio output before we set the duty cycle. + gpio_put(pin->number, false); + gpio_set_dir(pin->number, GPIO_OUT); + gpio_set_function(pin->number, GPIO_FUNC_SIO); + common_hal_pwmio_pwmout_set_duty_cycle(&self->carrier, duty_cycle); + + self->pin = pin->number; + self->slice = self->carrier.slice; + self->min_pulse = (1000000 / self->carrier.actual_frequency); } bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t *self) { @@ -106,7 +103,8 @@ void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { if (common_hal_pulseio_pulseout_deinited(self)) { return; } - refcount--; + gpio_set_dir(self->pin, GPIO_IN); + common_hal_pwmio_pwmout_deinit(&self->carrier); self->pin = NO_PIN; } @@ -115,8 +113,8 @@ void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t *self, uint16_t *pu self->pulse_index = 0; self->pulse_length = length; - common_hal_pwmio_pwmout_set_duty_cycle(self->carrier,self->current_duty_cycle); - pwm_set_enabled(self->slice,true); + // Turn on the signal by connecting the PWM to the outside pin. + gpio_set_function(self->pin, GPIO_FUNC_PWM); uint64_t delay = self->pulse_buffer[0]; if (delay < self->min_pulse) { delay = self->min_pulse; @@ -133,7 +131,4 @@ void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t *self, uint16_t *pu // signal. RUN_BACKGROUND_TASKS; } - // Ensure pin is left low - turn_off(self->slice); - pwm_set_enabled(self->slice,false); } diff --git a/ports/raspberrypi/common-hal/pulseio/PulseOut.h b/ports/raspberrypi/common-hal/pulseio/PulseOut.h index 49a14f3a51..3366946210 100644 --- a/ports/raspberrypi/common-hal/pulseio/PulseOut.h +++ b/ports/raspberrypi/common-hal/pulseio/PulseOut.h @@ -39,10 +39,9 @@ typedef struct { mp_obj_base_t base; uint8_t pin; uint8_t slice; - pwmio_pwmout_obj_t *carrier; + pwmio_pwmout_obj_t carrier; uint16_t *pulse_buffer; uint16_t pulse_length; - uint16_t current_duty_cycle; uint32_t min_pulse; volatile uint16_t pulse_index; } pulseio_pulseout_obj_t; diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c index 5215f2b8df..25590a1332 100644 --- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c +++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c @@ -26,6 +26,7 @@ #include +#include "lib/utils/interrupt_char.h" #include "py/runtime.h" #include "common-hal/pwmio/PWMOut.h" #include "shared-bindings/pwmio/PWMOut.h" @@ -235,6 +236,14 @@ extern void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uin } // compare_count is the CC register value, which should be TOP+1 for 100% duty cycle. pwm_set_chan_level(self->slice, self->channel, compare_count); + // Wait for wrap so that we know our new cc value has been applied. Clear + // the internal interrupt and then wait for it to be set. Worst case, we + // wait a full cycle. + pwm_hw->intr = 1 << self->channel; + while ((pwm_hw->en & (1 << self->channel)) != 0 && + (pwm_hw->intr & (1 << self->channel)) == 0 && + !mp_hal_is_interrupted()) { + } } uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t *self) { @@ -292,3 +301,7 @@ uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t *self) { bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t *self) { return self->variable_frequency; } + +const mcu_pin_obj_t *common_hal_pwmio_pwmout_get_pin(pwmio_pwmout_obj_t *self) { + return self->pin; +} diff --git a/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c b/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c index d5251f6598..7849130ff7 100644 --- a/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c +++ b/ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c @@ -89,9 +89,8 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode true, // exclusive pin use false, 32, false, // out settings false, // Wait for txstall - false, 32, false); // in settings - - common_hal_rp2pio_statemachine_run(&self->state_machine, encoder_init, MP_ARRAY_SIZE(encoder_init)); + false, 32, false, // in settings + false); // Not user-interruptible. // We're guaranteed by the init code that some output will be available promptly uint8_t quiescent_state; diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c index 6594dd9c6f..c35adc21e2 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c @@ -163,7 +163,9 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, 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 claim_pins) { + bool claim_pins, + bool user_interruptible + ) { // 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); @@ -303,6 +305,7 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, self->out_shift_right = out_shift_right; self->in_shift_right = in_shift_right; self->wait_for_txstall = wait_for_txstall; + self->user_interruptible = user_interruptible; self->init = init; self->init_len = init_len; @@ -338,7 +341,8 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, 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 auto_push, uint8_t push_threshold, bool in_shift_right, + bool user_interruptible) { // 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; @@ -482,7 +486,8 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, if (initial_pin_direction & (pull_up | pull_down)) { mp_raise_ValueError(translate("pull masks conflict with direction masks")); } - bool ok = rp2pio_statemachine_construct(self, + bool ok = rp2pio_statemachine_construct( + self, program, program_len, frequency, init, init_len, @@ -497,7 +502,8 @@ void common_hal_rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, auto_pull, pull_threshold, out_shift_right, wait_for_txstall, auto_push, push_threshold, in_shift_right, - true /* claim pins */); + true /* claim pins */, + user_interruptible); if (!ok) { mp_raise_RuntimeError(translate("All state machines in use")); } @@ -553,6 +559,8 @@ 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); + uint8_t sm = self->state_machine; uint8_t pio_index = pio_get_index(self->pio); common_hal_mcu_disable_interrupts(); @@ -664,6 +672,16 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, (tx && dma_channel_is_busy(chan_tx))) { // TODO: We should idle here until we get a DMA interrupt or something else. RUN_BACKGROUND_TASKS; + if (self->user_interruptible && mp_hal_is_interrupted()) { + if (rx && dma_channel_is_busy(chan_rx)) { + dma_channel_abort(chan_rx); + } + if (tx && dma_channel_is_busy(chan_tx)) { + dma_channel_abort(chan_tx); + } + break; + } + } // Clear the stall bit so we can detect when the state machine is done transmitting. self->pio->fdebug = stall_mask; @@ -678,7 +696,7 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, dma_channel_unclaim(chan_tx); } - if (!use_dma) { + if (!use_dma && !(self->user_interruptible && mp_hal_is_interrupted())) { // Use software for small transfers, or if couldn't claim two DMA channels size_t rx_remaining = in_len / in_stride_in_bytes; size_t tx_remaining = out_len / out_stride_in_bytes; @@ -707,6 +725,9 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, --rx_remaining; } RUN_BACKGROUND_TASKS; + if (self->user_interruptible && mp_hal_is_interrupted()) { + break; + } } // Clear the stall bit so we can detect when the state machine is done transmitting. self->pio->fdebug = stall_mask; @@ -717,6 +738,9 @@ static bool _transfer(rp2pio_statemachine_obj_t *self, while (!pio_sm_is_tx_fifo_empty(self->pio, self->state_machine) || (self->wait_for_txstall && (self->pio->fdebug & stall_mask) == 0)) { RUN_BACKGROUND_TASKS; + if (self->user_interruptible && mp_hal_is_interrupted()) { + break; + } } } return true; diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.h b/ports/raspberrypi/common-hal/rp2pio/StateMachine.h index b04d9c5049..f877bdb152 100644 --- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.h +++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.h @@ -43,15 +43,16 @@ typedef struct { uint32_t initial_pin_direction; uint32_t pull_pin_up; uint32_t pull_pin_down; + uint tx_dreq; + uint rx_dreq; + uint32_t actual_frequency; + pio_sm_config sm_config; bool in; bool out; bool wait_for_txstall; - uint tx_dreq; - uint rx_dreq; bool out_shift_right; bool in_shift_right; - uint32_t actual_frequency; - pio_sm_config sm_config; + bool user_interruptible; uint8_t offset; } rp2pio_statemachine_obj_t; @@ -73,7 +74,8 @@ bool rp2pio_statemachine_construct(rp2pio_statemachine_obj_t *self, 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 claim_pins); + bool claim_pins, + bool interruptible); 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); diff --git a/ports/raspberrypi/sdk_config/pico/config_autogen.h b/ports/raspberrypi/sdk_config/pico/config_autogen.h index a8ff324e1c..a29ccb458a 100644 --- a/ports/raspberrypi/sdk_config/pico/config_autogen.h +++ b/ports/raspberrypi/sdk_config/pico/config_autogen.h @@ -1,5 +1,7 @@ #pragma once +#include "pico-sdk-configboard.h" + // alphabetized #define LIB_PICO_BINARY_INFO (0) #define LIB_PICO_PRINTF_NONE (0) diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c index 443cfc2715..fca6d6554c 100644 --- a/ports/raspberrypi/supervisor/port.c +++ b/ports/raspberrypi/supervisor/port.c @@ -27,6 +27,7 @@ #include #include +#include "supervisor/background_callback.h" #include "supervisor/board.h" #include "supervisor/port.h" @@ -35,6 +36,7 @@ #include "shared-bindings/audiopwmio/PWMAudioOut.h" #include "shared-bindings/busio/I2C.h" #include "shared-bindings/busio/SPI.h" +#include "shared-bindings/countio/Counter.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/rtc/__init__.h" #include "shared-bindings/pwmio/PWMOut.h" @@ -54,8 +56,6 @@ #include "src/common/pico_time/include/pico/time.h" #include "src/common/pico_binary_info/include/pico/binary_info.h" -#include "tusb.h" - #include "pico/bootrom.h" #include "hardware/watchdog.h" @@ -136,6 +136,10 @@ void reset_port(void) { reset_uart(); #endif + #if CIRCUITPY_COUNTIO + reset_countio(); + #endif + #if CIRCUITPY_PWMIO pwmout_reset(); #endif @@ -233,9 +237,10 @@ void port_interrupt_after_ticks(uint32_t ticks) { void port_idle_until_interrupt(void) { common_hal_mcu_disable_interrupts(); - if (!tud_task_event_ready()) { -// asm volatile ("dsb 0xF":::"memory"); -// __wfi(); + if (!background_callback_pending()) { + // TODO: Does not work when board is power-cycled. + // asm volatile ("dsb 0xF" ::: "memory"); + // __wfi(); } common_hal_mcu_enable_interrupts(); } diff --git a/ports/raspberrypi/supervisor/usb.c b/ports/raspberrypi/supervisor/usb.c index 799ed06953..2fc07a20a9 100644 --- a/ports/raspberrypi/supervisor/usb.c +++ b/ports/raspberrypi/supervisor/usb.c @@ -44,4 +44,10 @@ void post_usb_init(void) { irq_set_exclusive_handler(USBCTRL_IRQ, usb_irq_handler); irq_set_enabled(USBCTRL_IRQ, true); + + // There is a small window where the USB interrupt may be handled by the + // pico-sdk instead of CircuitPython. If that is the case, then we'll have + // USB events to process that we didn't queue up a background task for. So, + // queue one up here even if we might not have anything to do. + usb_background_schedule(); } diff --git a/ports/stm/boards/STM32F411_nofs.ld b/ports/stm/boards/STM32F411_nofs.ld new file mode 100644 index 0000000000..3091a59275 --- /dev/null +++ b/ports/stm/boards/STM32F411_nofs.ld @@ -0,0 +1,26 @@ +/* + GNU linker script for STM32F411 without nvm and an external flash chip. + No space is reserved for a filesystem. +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* entire flash */ + FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 16K /* sector 0 */ + FLASH_FIRMWARE (rx) : ORIGIN = 0x08004000, LENGTH = 496K /* sectors 1,2,3 are 16k, sector 4 is 64K, sectors 5,6,7 are 128K */ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K +} + +/* produce a link error if there is not this amount of RAM for these sections */ +_minimum_stack_size = 24K; +_minimum_heap_size = 16K; + +/* Define the top end of the stack. The stack is full descending so begins just + above last byte of RAM. Note that EABI requires the stack to be 8-byte + aligned for a call. */ +_estack = ORIGIN(RAM) + LENGTH(RAM); + +/* RAM extents for the garbage collector */ +_ram_start = ORIGIN(RAM); +_ram_end = ORIGIN(RAM) + LENGTH(RAM); diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.h b/ports/stm/boards/espruino_pico/mpconfigboard.h index 1623d57aa0..cd5cd23255 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.h +++ b/ports/stm/boards/espruino_pico/mpconfigboard.h @@ -41,3 +41,5 @@ #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) // #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // #define LSE_VALUE ((uint32_t)32768) + +#define MICROPY_FATFS_EXFAT 0 diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk index 3f3e81d553..851357b4d6 100644 --- a/ports/stm/boards/espruino_pico/mpconfigboard.mk +++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk @@ -17,6 +17,7 @@ LD_FILE = boards/STM32F401xd_fs.ld # INTERNAL_FLASH_FILESYSTEM. It can probably be reenabled if we enable # lto for this port, and if other stuff hasn't been added in the # meantime +CIRCUITPY_AESIO = 0 CIRCUITPY_AUDIOCORE = 0 CIRCUITPY_AUDIOPWMIO = 0 CIRCUITPY_BUSDEVICE = 0 diff --git a/ports/stm/boards/espruino_pico/pins.c b/ports/stm/boards/espruino_pico/pins.c index 55c0336c54..fbd288e179 100644 --- a/ports/stm/boards/espruino_pico/pins.c +++ b/ports/stm/boards/espruino_pico/pins.c @@ -1,6 +1,8 @@ #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_B15), MP_ROM_PTR(&pin_PB15) }, { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, diff --git a/ports/stm/boards/espruino_wifi/pins.c b/ports/stm/boards/espruino_wifi/pins.c index 2d36ae8b95..216d5b4213 100644 --- a/ports/stm/boards/espruino_wifi/pins.c +++ b/ports/stm/boards/espruino_wifi/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // P1 { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) }, diff --git a/ports/stm/boards/feather_stm32f405_express/pins.c b/ports/stm/boards/feather_stm32f405_express/pins.c index 1d91bc2f03..b039b0af0c 100644 --- a/ports/stm/boards/feather_stm32f405_express/pins.c +++ b/ports/stm/boards/feather_stm32f405_express/pins.c @@ -13,6 +13,8 @@ STATIC const mp_rom_obj_tuple_t sdio_data_tuple = { }; 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_PA04) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA06) }, @@ -50,7 +52,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_SDIO_COMMAND), MP_ROM_PTR(&pin_PD02) }, { MP_ROM_QSTR(MP_QSTR_SDIO_DATA), MP_ROM_PTR(&sdio_data_tuple) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB09) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB08) }, + { MP_ROM_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB09) }, }; MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/meowbit_v121/board.c b/ports/stm/boards/meowbit_v121/board.c index 7a31c14e7e..7330809a88 100644 --- a/ports/stm/boards/meowbit_v121/board.c +++ b/ports/stm/boards/meowbit_v121/board.c @@ -53,7 +53,7 @@ uint8_t display_init_sequence[] = { 0xc4, 2, 0x8a, 0xee, 0xc5, 1, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0x20, 0, // _INVOFF //MISMATCh 0x2a vs 0x20 - 0x36, 1, 0x18, // _MADCTL bottom to top refresh + 0x36, 1, 0x60, // _MADCTL bottom to top refresh // 1 clk cycle nonoverlap, 2 cycle gate rise, 3 sycle osc equalie, // fix on VTL 0x3a, 1, 0x05, // COLMOD - 16bit color @@ -90,7 +90,7 @@ void board_init(void) { 128, // Height 0, // column start 0, // row start - 90, // rotation + 0, // rotation 16, // Color depth false, // Grayscale false, // Pixels in a byte share a row. Only used for depth < 8 @@ -100,7 +100,6 @@ void board_init(void) { MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command - 0x37, // set vertical scroll command display_init_sequence, sizeof(display_init_sequence), &pin_PB03, diff --git a/ports/stm/boards/meowbit_v121/mpconfigboard.mk b/ports/stm/boards/meowbit_v121/mpconfigboard.mk index d846755c28..ed96e99871 100644 --- a/ports/stm/boards/meowbit_v121/mpconfigboard.mk +++ b/ports/stm/boards/meowbit_v121/mpconfigboard.mk @@ -20,5 +20,9 @@ LD_FILE = boards/STM32F401xe_boot.ld # For debugging - also comment BOOTLOADER_OFFSET and BOARD_VTOR_DEFER # LD_FILE = boards/STM32F401xe_fs.ld +CIRCUITPY_AESIO = 0 CIRCUITPY_BLEIO_HCI = 0 CIRCUITPY_ULAB = 0 +CIRCUITPY_STAGE = 1 + +FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/meowbit diff --git a/ports/stm/boards/meowbit_v121/pins.c b/ports/stm/boards/meowbit_v121/pins.c index fd988b5919..3de558d07e 100644 --- a/ports/stm/boards/meowbit_v121/pins.c +++ b/ports/stm/boards/meowbit_v121/pins.c @@ -7,6 +7,8 @@ extern audiopwmio_pwmaudioout_obj_t board_buzz_obj; STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + { MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_PB04) }, { MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_PB05) }, diff --git a/ports/stm/boards/nucleo_f746zg/pins.c b/ports/stm/boards/nucleo_f746zg/pins.c index 251ce4bcba..fdb9575b57 100644 --- a/ports/stm/boards/nucleo_f746zg/pins.c +++ b/ports/stm/boards/nucleo_f746zg/pins.c @@ -1,6 +1,8 @@ #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_PA03) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC00) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, diff --git a/ports/stm/boards/nucleo_f767zi/pins.c b/ports/stm/boards/nucleo_f767zi/pins.c index 0373fc4fb6..79de1f87a7 100644 --- a/ports/stm/boards/nucleo_f767zi/pins.c +++ b/ports/stm/boards/nucleo_f767zi/pins.c @@ -1,6 +1,8 @@ #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_PA03) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC00) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, diff --git a/ports/stm/boards/nucleo_h743zi_2/pins.c b/ports/stm/boards/nucleo_h743zi_2/pins.c index d35f40dd2d..e36b2dba86 100644 --- a/ports/stm/boards/nucleo_h743zi_2/pins.c +++ b/ports/stm/boards/nucleo_h743zi_2/pins.c @@ -1,6 +1,8 @@ #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_PA03) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PC00) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) }, diff --git a/ports/stm/boards/openmv_h7/pins.c b/ports/stm/boards/openmv_h7/pins.c index 2f7fa93c1d..c7f435cef5 100644 --- a/ports/stm/boards/openmv_h7/pins.c +++ b/ports/stm/boards/openmv_h7/pins.c @@ -1,6 +1,8 @@ #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_P0), MP_ROM_PTR(&pin_PB15) }, { MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_PB13) }, diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h index 0960687d1e..f85d27d4b1 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.h +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.h @@ -47,3 +47,5 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) #define AUTORESET_DELAY_MS (500) + +#define MICROPY_FATFS_EXFAT 0 diff --git a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk index d1a627569c..4ff181c7f3 100644 --- a/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk +++ b/ports/stm/boards/pyb_nano_v2/mpconfigboard.mk @@ -19,3 +19,4 @@ CIRCUITPY_AUDIOPWMIO = 0 CIRCUITPY_KEYPAD = 0 CIRCUITPY_MIDI = 0 CIRCUITPY_MSGPACK = 0 +CIRCUITPY_BITMAPTOOLS = 0 diff --git a/ports/stm/boards/pyb_nano_v2/pins.c b/ports/stm/boards/pyb_nano_v2/pins.c index e10124f6af..28742378de 100644 --- a/ports/stm/boards/pyb_nano_v2/pins.c +++ b/ports/stm/boards/pyb_nano_v2/pins.c @@ -1,6 +1,8 @@ #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_Y10), MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_Y9), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_Y8), MP_ROM_PTR(&pin_PA14) }, diff --git a/ports/stm/boards/pyboard_v11/pins.c b/ports/stm/boards/pyboard_v11/pins.c index 8783dfcf10..9c4505d037 100644 --- a/ports/stm/boards/pyboard_v11/pins.c +++ b/ports/stm/boards/pyboard_v11/pins.c @@ -1,6 +1,8 @@ #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_Y1), MP_ROM_PTR(&pin_PC06) }, { MP_ROM_QSTR(MP_QSTR_Y2), MP_ROM_PTR(&pin_PC07) }, { MP_ROM_QSTR(MP_QSTR_Y3), MP_ROM_PTR(&pin_PB08) }, diff --git a/shared-module/gamepad/__init__.h b/ports/stm/boards/sparkfun_stm32f405_micromod/board.c similarity index 83% rename from shared-module/gamepad/__init__.h rename to ports/stm/boards/sparkfun_stm32f405_micromod/board.c index 1fae570f98..f8e462f938 100644 --- a/shared-module/gamepad/__init__.h +++ b/ports/stm/boards/sparkfun_stm32f405_micromod/board.c @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (c) 2016 Scott Shawcroft for Adafruit Industries + * 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 @@ -24,10 +24,16 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_GAMEPAD_H -#define MICROPY_INCLUDED_GAMEPAD_H +#include "supervisor/board.h" +#include "mpconfigboard.h" -void gamepad_tick(void); -void gamepad_reset(void); +void board_init(void) { +} -#endif // MICROPY_INCLUDED_GAMEPAD_H +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/stm/boards/sparkfun_stm32f405_micromod/mpconfigboard.h b/ports/stm/boards/sparkfun_stm32f405_micromod/mpconfigboard.h new file mode 100644 index 0000000000..ed3a643322 --- /dev/null +++ b/ports/stm/boards/sparkfun_stm32f405_micromod/mpconfigboard.h @@ -0,0 +1,65 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Chris Wilson + * + * 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 "SparkFun STM32 MicroMod Processor" +#define MICROPY_HW_MCU_NAME "STM32F405RG" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (0x4000) + +#define HSE_VALUE ((uint32_t)12000000) +#define LSE_VALUE ((uint32_t)32768) +#define BOARD_HAS_LOW_SPEED_CRYSTAL (1) + +// Status LED +#define MICROPY_HW_LED_STATUS (&pin_PA15) + +// On-board SPI flash +#define SPI_FLASH_MOSI_PIN (&pin_PC12) +#define SPI_FLASH_MISO_PIN (&pin_PC11) +#define SPI_FLASH_SCK_PIN (&pin_PC10) +#define SPI_FLASH_CS_PIN (&pin_PC03) + +// Bootloader only +#ifdef UF2_BOOTLOADER_ENABLED + #define BOARD_VTOR_DEFER (1) // Leave VTOR relocation to bootloader +#endif + +#define DEFAULT_I2C_BUS_SCL (&pin_PB10) +#define DEFAULT_I2C_BUS_SDA (&pin_PB11) + +#define DEFAULT_SPI_BUS_SCK (&pin_PA05) +#define DEFAULT_SPI_BUS_MOSI (&pin_PA07) +#define DEFAULT_SPI_BUS_MISO (&pin_PA06) + +#define DEFAULT_UART_BUS_RX (&pin_PA03) +#define DEFAULT_UART_BUS_TX (&pin_PA02) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA11 (1) +#define IGNORE_PIN_PA12 (1) diff --git a/ports/stm/boards/sparkfun_stm32f405_micromod/mpconfigboard.mk b/ports/stm/boards/sparkfun_stm32f405_micromod/mpconfigboard.mk new file mode 100644 index 0000000000..d1df685c67 --- /dev/null +++ b/ports/stm/boards/sparkfun_stm32f405_micromod/mpconfigboard.mk @@ -0,0 +1,19 @@ +USB_VID = 0X1B4F +USB_PID = 0x0027 +USB_PRODUCT = "SparkFun STM32 MicroMod Processor" +USB_MANUFACTURER = "SparkFun Electronics" + +SPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICES = W25Q128JVxM + +MCU_SERIES = F4 +MCU_VARIANT = STM32F405xx +MCU_PACKAGE = LQFP64 + +LD_COMMON = boards/common_default.ld +LD_DEFAULT = boards/STM32F405_default.ld +# UF2 boot option +LD_BOOT = boards/STM32F405_boot.ld +UF2_OFFSET = 0x8010000 + +CIRCUITPY_RGBMATRIX ?= 1 diff --git a/ports/stm/boards/sparkfun_stm32f405_micromod/pins.c b/ports/stm/boards/sparkfun_stm32f405_micromod/pins.c new file mode 100644 index 0000000000..c864ad4dd5 --- /dev/null +++ b/ports/stm/boards/sparkfun_stm32f405_micromod/pins.c @@ -0,0 +1,226 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Chris Wilson + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + // The SparkFun MicroMod spec uses a zero-based peripheral numbering scheme. + // The 0th peripheral is the default and the "0" is omitted from the + // peripheral name (e.g. "I2C" instead of "I2C0"). + // + // For more details, see https://www.sparkfun.com/micromod#tech-specs + + // MicroMod built-in status LED pin + // Requirement from the "Designing with MicroMod" SparkFun article: + // "... every Processor Board shall include one status LED connected to a + // pin that is not connected to the board edge." + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA15) }, // MicroMod LED (PA15) + + // MicroMod USB bus input voltage (+5V) pin + // { MP_ROM_QSTR(MP_QSTR_USB_VIN), MP_ROM_PTR() }, // MicroMod USB_VIN (not connected) + + // MicroMod +3.3V enable pin + // { MP_ROM_QSTR(MP_QSTR_P3V3_EN), MP_ROM_PTR() }, // MicroMod 3.3V_EN (not connected) + + // MicroMod battery voltage sense pin + { MP_ROM_QSTR(MP_QSTR_BATT_VIN3), MP_ROM_PTR(&pin_PA01) }, // MicroMod BATT_VIN/3 (PA1) + + // MicroMod reset pin + // { MP_ROM_QSTR(MP_QSTR_RESET), MP_ROM_PTR() }, // MicroMod RESET# (STM32 has a dedicated HW NRST pin) + + // MicroMod boot pin + // { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR() }, // MicroMod BOOT (STM32 has a dedicated HW BOOT0 pin) + + // MicroMod USB device pins + // USB device is always used internally by CircuitPython, so skip creating + // the pin objects for it. See explicit ignores in mpconfigboard.h. + // { MP_ROM_QSTR(MP_QSTR_USB_DM), MP_ROM_PTR(&pin_PA11) }, // MicroMod USB_D- (PA11) + // { MP_ROM_QSTR(MP_QSTR_USB_DP), MP_ROM_PTR(&pin_PA12) }, // MicroMod USB_D+ (PA12) + + // MicroMod USB host pins + { MP_ROM_QSTR(MP_QSTR_USBHOST_DM), MP_ROM_PTR(&pin_PB14) }, // MicroMod USBHOST_D- (PB14) + { MP_ROM_QSTR(MP_QSTR_USBHOST_DP), MP_ROM_PTR(&pin_PB15) }, // MicroMod USBHOST_D+ (PB15) + + // MicroMod CAN pins + { MP_ROM_QSTR(MP_QSTR_CAN_RX), MP_ROM_PTR(&pin_PB08) }, // MicroMod CAN_RX (PB8) + { MP_ROM_QSTR(MP_QSTR_CAN_TX), MP_ROM_PTR(&pin_PB09) }, // MicroMod CAN_TX (PB9) + + // Note: MicroMod UART (UART0) is not present in the edge connector pinout + // because the primary debug serial port is exposed as a virtual serial port + // over USB. + + // MicroMod UART1 pins + { MP_ROM_QSTR(MP_QSTR_UART_TX1), MP_ROM_PTR(&pin_PA02) }, // MicroMod UART_TX1 | CircuitPython TX (PA2) + { MP_ROM_QSTR(MP_QSTR_UART_RX1), MP_ROM_PTR(&pin_PA03) }, // MicroMod UART_RX1 | CircuitPython RX (PA3) + // { MP_ROM_QSTR(MP_QSTR_UART_RTS1), MP_ROM_PTR() }, // MicroMod RTS1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_UART_CTS1), MP_ROM_PTR() }, // MicroMod CTS1 (not connected) + + // CircuitPython default UART pins + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA02) }, // CircuitPython TX | MicroMod UART_TX1 (PA2) + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA03) }, // CircuitPython RX | MicroMod UART_RX1 (PA3) + + // MicroMod UART2 pins + // { MP_ROM_QSTR(MP_QSTR_UART_TX2), MP_ROM_PTR() }, // MicroMod UART_TX2 (not connected) + // { MP_ROM_QSTR(MP_QSTR_UART_RX2), MP_ROM_PTR() }, // MicroMod UART_RX2 (not connected) + + // MicroMod I2C pins + { MP_ROM_QSTR(MP_QSTR_I2C_SDA), MP_ROM_PTR(&pin_PB11) }, // MicroMod I2C_SDA | CircuitPython SDA (PB11) + { MP_ROM_QSTR(MP_QSTR_I2C_SCL), MP_ROM_PTR(&pin_PB10) }, // MicroMod I2C_SCL | CircuitPython SCL (PB10) + + // CircuitPython default I2C pins + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB11) }, // CircuitPython SDA | MicroMod I2C_SDA (PB11) + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB10) }, // CircuitPython SCL | MicroMod I2C_SCL (PB10) + + // MicroMod I2C interrupt pin + { MP_ROM_QSTR(MP_QSTR_I2C_INT), MP_ROM_PTR(&pin_PB01) }, // MicroMod I2C_INT (PB1) + + // MicroMod I2C1 pins + { MP_ROM_QSTR(MP_QSTR_I2C_SDA1), MP_ROM_PTR(&pin_PB07) }, // MicroMod I2C_SDA1 (PB7) + { MP_ROM_QSTR(MP_QSTR_I2C_SCL1), MP_ROM_PTR(&pin_PB06) }, // MicroMod I2C_SCL1 (PB6) + + // MicroMod SPI pins + { MP_ROM_QSTR(MP_QSTR_SPI_CIPO), MP_ROM_PTR(&pin_PA06) }, // MicroMod SPI_CIPO | CircuitPython CIPO (PA6) + { MP_ROM_QSTR(MP_QSTR_SPI_MISO), MP_ROM_PTR(&pin_PA06) }, // MicroMod SPI_MISO | CircuitPython MISO (PA6) + { MP_ROM_QSTR(MP_QSTR_SPI_COPI), MP_ROM_PTR(&pin_PA07) }, // MicroMod SPI_COPI | CircuitPython COPI | LED_DAT (PA7) + { MP_ROM_QSTR(MP_QSTR_SPI_MOSI), MP_ROM_PTR(&pin_PA07) }, // MicroMod SPI_MOSI | CircuitPython MOSI (PA7) + { MP_ROM_QSTR(MP_QSTR_SPI_SCK), MP_ROM_PTR(&pin_PA05) }, // MicroMod SPI_SCK | CircuitPython SCK | LED_CLK (PA5) + { MP_ROM_QSTR(MP_QSTR_SPI_CS), MP_ROM_PTR(&pin_PA04) }, // MicroMod SPI_CS | CircuitPython CS (PC4) + + // CircuitPython default SPI pins + { MP_ROM_QSTR(MP_QSTR_CIPO), MP_ROM_PTR(&pin_PA06) }, // CircuitPython CIPO | MicroMod SPI_CIPO (PA6) + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA06) }, // CircuitPython MISO | MicroMod SPI_MISO (PA6) + { MP_ROM_QSTR(MP_QSTR_COPI), MP_ROM_PTR(&pin_PA07) }, // CircuitPython COPI | MicroMod SPI_COPI | LED_DAT (PA7) + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA07) }, // CircuitPython MOSI | MicroMod SPI_MOSI (PA7) + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA05) }, // CircuitPython SCK | MicroMod SPI_SCK | LED_CLK (PA5) + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PA04) }, // CircuitPython CS | MicroMod SPI_CS (PC4) + + // MicroMod 2-wire serial LED pins + { MP_ROM_QSTR(MP_QSTR_LED_DAT), MP_ROM_PTR(&pin_PA07) }, // MicroMod LED_DAT | SPI_COPI (PA7) + { MP_ROM_QSTR(MP_QSTR_LED_CLK), MP_ROM_PTR(&pin_PA05) }, // MicroMod LED_CLK | SPI_SCK (PA5) + + // MicroMod SDIO pins + // { MP_ROM_QSTR(MP_QSTR_SDIO_CLK), MP_ROM_PTR() }, // MicroMod SDIO_SCK | SPI_SCK1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SDIO_CMD), MP_ROM_PTR() }, // MicroMod SDIO_CMD | SPI_COPI1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SDIO_DATA0), MP_ROM_PTR() }, // MicroMod SDIO_DATA0 | SPI_CIPO1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SDIO_DATA1), MP_ROM_PTR() }, // MicroMod SDIO_DATA1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SDIO_DATA2), MP_ROM_PTR() }, // MicroMod SDIO_DATA2 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SDIO_DATA3), MP_ROM_PTR() }, // MicroMod SDIO_DATA3 | SPI_CS1 (not connected) + + // MicroMod SPI1 pins + // { MP_ROM_QSTR(MP_QSTR_SPI_CIPO1), MP_ROM_PTR() }, // MicroMod SPI_CIPO1 | SDIO_DATA0 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SPI_MISO1), MP_ROM_PTR() }, // MicroMod SPI_MISO1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SPI_COPI1), MP_ROM_PTR() }, // MicroMod SPI_COPI1 | SDIO_CMD (not connected) + // { MP_ROM_QSTR(MP_QSTR_SPI_MOSI1), MP_ROM_PTR() }, // MicroMod SPI_MOSI1 (not connected) + // { MP_ROM_QSTR(MP_QSTR_SPI_SCK1), MP_ROM_PTR() }, // MicroMod SPI_SCK1 | SDIO_SCK (not connected) + // { MP_ROM_QSTR(MP_QSTR_SPI_CS1), MP_ROM_PTR() }, // MicroMod SPI_CS1 | SDIO_DATA3 (not connected) + + // MicroMod audio pins + // { MP_ROM_QSTR(MP_QSTR_AUD_MCLK), MP_ROM_PTR() }, // MicroMod AUD_MCLK (not connected) + // { MP_ROM_QSTR(MP_QSTR_AUD_OUT), MP_ROM_PTR(&pin_PB04) }, // MicroMod AUD_OUT | I2S_OUT | PCM_OUT | CAM_MCLK (PB4) + // { MP_ROM_QSTR(MP_QSTR_AUD_IN), MP_ROM_PTR(&pin_PB05) }, // MicroMod AUD_IN | I2S_IN | PCM_IN | CAM_PCLK (PB5) + // { MP_ROM_QSTR(MP_QSTR_AUD_LRCLK), MP_ROM_PTR(&pin_PA04) }, // MicroMod AUD_LRCLK | I2S_WS | PCM_SYNC | PDM_DATA (PA4) + // { MP_ROM_QSTR(MP_QSTR_AUD_BCLK), MP_ROM_PTR(&pin_PB03) }, // MicroMod AUD_BCLK | I2S_SCK | PCM_CLK | PDM_CLK (PB3) + + // MicroMod I2S pins + { MP_ROM_QSTR(MP_QSTR_I2S_OUT), MP_ROM_PTR(&pin_PB04) }, // MicroMod I2S_OUT | AUD_OUT | PCM_OUT | CAM_MCLK (PB4) + { MP_ROM_QSTR(MP_QSTR_I2S_IN), MP_ROM_PTR(&pin_PB05) }, // MicroMod I2S_IN | AUD_IN | PCM_IN | CAM_PCLK (PB5) + { MP_ROM_QSTR(MP_QSTR_I2S_WS), MP_ROM_PTR(&pin_PA04) }, // MicroMod I2S_WS | AUD_LRCLK | PCM_SYNC | PDM_DATA (PA4) + { MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_PB03) }, // MicroMod I2S_SCK | AUD_BCLK | PCM_CLK | PDM_CLK (PB3) + + // MicroMod PCM pins + { MP_ROM_QSTR(MP_QSTR_PCM_OUT), MP_ROM_PTR(&pin_PB04) }, // MicroMod PCM_OUT | AUD_OUT | I2S_OUT | CAM_MCLK (PB4) + { MP_ROM_QSTR(MP_QSTR_PCM_IN), MP_ROM_PTR(&pin_PB05) }, // MicroMod PCM_IN | AUD_IN | I2S_IN | CAM_PCLK (PB5) + { MP_ROM_QSTR(MP_QSTR_PCM_SYNC), MP_ROM_PTR(&pin_PA04) }, // MicroMod PCM_SYNC | AUD_LRCLK | I2S_WS | PDM_DATA (PA4) + { MP_ROM_QSTR(MP_QSTR_PCM_CLK), MP_ROM_PTR(&pin_PB03) }, // MicroMod PCM_CLK | AUD_BCLK | I2S_SCK | PDM_CLK (PB3) + + // MicroMod PDM pins + { MP_ROM_QSTR(MP_QSTR_PDM_DATA), MP_ROM_PTR(&pin_PA04) }, // MicroMod PDM_DATA | AUD_LRCLK | I2S_WS | PCM_SYNC (PA4) + { MP_ROM_QSTR(MP_QSTR_PDM_CLK), MP_ROM_PTR(&pin_PB03) }, // MicroMod PDM_CLK | AUD_BCLK | I2S_SCK | PCM_CLK (PB3) + + // MicroMod SWD pins + { MP_ROM_QSTR(MP_QSTR_SWDIO), MP_ROM_PTR(&pin_PA13) }, // MicroMod SWDIO (PA13) + { MP_ROM_QSTR(MP_QSTR_SWCLK), MP_ROM_PTR(&pin_PA14) }, // MicroMod SWDCK (PA14) + // { MP_ROM_QSTR(MP_QSTR_SWO), MP_ROM_PTR() }, // MicroMod SWO | G11 (not connected) + + // MicroMod ADC pins + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PC05) }, // MicroMod A0 (PC5) + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB00) }, // MicroMod A1 (PB0) + + // MicroMod PWM pins + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_PC06) }, // MicroMod PWM0 (PC6) + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_PC07) }, // MicroMod PWM1 (PC7) + + // MicroMod digital pins + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PC00) }, // MicroMod D0 (PC0) + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PC01) }, // MicroMod D1 | CAM_TRIG (PC1) + + // MicroMod general purpose pins + { MP_ROM_QSTR(MP_QSTR_G0), MP_ROM_PTR(&pin_PD02) }, // MicroMod G0 | BUS0 (PD2) + { MP_ROM_QSTR(MP_QSTR_G1), MP_ROM_PTR(&pin_PA08) }, // MicroMod G1 | BUS1 (PA8) + { MP_ROM_QSTR(MP_QSTR_G2), MP_ROM_PTR(&pin_PA00) }, // MicroMod G2 | BUS2 (PA0) + { MP_ROM_QSTR(MP_QSTR_G3), MP_ROM_PTR(&pin_PC08) }, // MicroMod G3 | BUS3 (PC8) + { MP_ROM_QSTR(MP_QSTR_G4), MP_ROM_PTR(&pin_PC09) }, // MicroMod G4 | BUS4 (PC9) + { MP_ROM_QSTR(MP_QSTR_G5), MP_ROM_PTR(&pin_PC13) }, // MicroMod G5 | BUS5 (PC13) + { MP_ROM_QSTR(MP_QSTR_G6), MP_ROM_PTR(&pin_PC02) }, // MicroMod G6 | BUS6 (PC2) + // { MP_ROM_QSTR(MP_QSTR_G7), MP_ROM_PTR() }, // MicroMod G7 | BUS7 (not connected) + // { MP_ROM_QSTR(MP_QSTR_G8), MP_ROM_PTR() }, // MicroMod G8 (not connected) + // { MP_ROM_QSTR(MP_QSTR_G9), MP_ROM_PTR() }, // MicroMod G9 | ADC_D- | CAM_HSYNC (not connected) + { MP_ROM_QSTR(MP_QSTR_G10), MP_ROM_PTR(&pin_PB13) }, // MicroMod G10 | ADC_D+ | CAM_VSYNC (PB13) + { MP_ROM_QSTR(MP_QSTR_G11), MP_ROM_PTR(&pin_PB12) }, // MicroMod G11 | SWO (PB12) + + // MicroMod 8-bit bus pins + { MP_ROM_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_PD02) }, // MicroMod BUS0 | G0 (PD2) + { MP_ROM_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_PA08) }, // MicroMod BUS1 | G1 (PA8) + { MP_ROM_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_PA00) }, // MicroMod BUS2 | G2 (PA0) + { MP_ROM_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_PC08) }, // MicroMod BUS3 | G3 (PC8) + { MP_ROM_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_PC09) }, // MicroMod BUS4 | G4 (PC9) + { MP_ROM_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_PC13) }, // MicroMod BUS5 | G5 (PC13) + { MP_ROM_QSTR(MP_QSTR_BUS6), MP_ROM_PTR(&pin_PC02) }, // MicroMod BUS6 | G6 (PC2) + // { MP_ROM_QSTR(MP_QSTR_BUS7), MP_ROM_PTR() }, // MicroMod BUS7 | G7 (not connected) + + // MicroMod differential ADC input pins + // { MP_ROM_QSTR(MP_QSTR_ADC_DM), MP_ROM_PTR() }, // MicroMod ADC_D- | G9 | CAM_HSYNC (not connected) + // { MP_ROM_QSTR(MP_QSTR_ADC_DP), MP_ROM_PTR(&pin_PB13) }, // MicroMod ADC_D+ | G10 | CAM_VSYNC (PB13) + + // MicroMod camera pins + // { MP_ROM_QSTR(MP_QSTR_CAM_MCLK), MP_ROM_PTR(&pin_PB04) }, // MicroMod CAM_MCLK | AUD_OUT | I2S_OUT | PCM_OUT (PB4) + // { MP_ROM_QSTR(MP_QSTR_CAM_PCLK), MP_ROM_PTR(&pin_PB05) }, // MicroMod CAM_PCLK | AUD_IN | I2S_IN | PCM_IN (PB5) + // { MP_ROM_QSTR(MP_QSTR_CAM_TRIG), MP_ROM_PTR(&pin_PC01) }, // MicroMod CAM_TRIG | D1 (PC1) + // { MP_ROM_QSTR(MP_QSTR_CAM_HSYNC), MP_ROM_PTR() }, // MicroMod CAM_HSYNC | ADC_D- | G9 (not connected) + // { MP_ROM_QSTR(MP_QSTR_CAM_VSYNC), MP_ROM_PTR(&pin_PB13) }, // MicroMod CAM_VSYNC | ADC_D+ | G10 (PB13) + + // Module-specific aliases (not part of the MicroMod spec) + { MP_ROM_QSTR(MP_QSTR_HOST_VBUS), MP_ROM_PTR(&pin_PB13) }, // HOST_VBUS | G10 | ADC_D+ | CAM_VSYNC (PB13) + { MP_ROM_QSTR(MP_QSTR_HOST_ID), MP_ROM_PTR(&pin_PB12) }, // HOST_ID | G11 | SWO (PB12) + + // CircuitPython board objects + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, // CircuitPython I2C + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, // CircuitPython SPI + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, // CircuitPython UART +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk index dc1dfad0d6..db83a5ce6b 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ce_blackpill/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x239A USB_PID = 0x806A USB_PRODUCT = "stm32f411ce blackpill" -USB_MANUFACTURER = "Unknown" +USB_MANUFACTURER = "WeAct" # SPI_FLASH_FILESYSTEM = 1 # EXTERNAL_FLASH_DEVICES = xxxxxx #See supervisor/shared/external_flash/devices.h for options diff --git a/ports/stm/boards/stm32f411ce_blackpill/pins.c b/ports/stm/boards/stm32f411ce_blackpill/pins.c index 7e25ad042b..b21ae0da5e 100644 --- a/ports/stm/boards/stm32f411ce_blackpill/pins.c +++ b/ports/stm/boards/stm32f411ce_blackpill/pins.c @@ -1,6 +1,8 @@ #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_B12), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, diff --git a/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.h b/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.h index a7d56209c4..b86bdc1ee7 100644 --- a/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.h @@ -50,3 +50,5 @@ #define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) #define AUTORESET_DELAY_MS (500) + +#define MICROPY_FATFS_EXFAT 0 diff --git a/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.mk b/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.mk index 37dccadb99..9da7163743 100644 --- a/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ce_blackpill_with_flash/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x239A USB_PID = 0x006A USB_PRODUCT = "stm32f411ce blackpill with flash" -USB_MANUFACTURER = "Unknown" +USB_MANUFACTURER = "WeAct" SPI_FLASH_FILESYSTEM = 1 #See supervisor/shared/external_flash/devices.h for options @@ -15,11 +15,7 @@ MCU_VARIANT = STM32F411xE MCU_PACKAGE = UFQFPN48 LD_COMMON = boards/common_default.ld -LD_FILE = boards/STM32F411_nvm_nofs.ld +LD_FILE = boards/STM32F411_nofs.ld # Too big for the flash -CIRCUITPY_AUDIOCORE = 0 -CIRCUITPY_AUDIOPWMIO = 0 -CIRCUITPY_SYNTHIO = 0 -CIRCUITPY_BITMAPTOOLS = 0 -CIRCUITPY_VECTORIO = 0 +CIRCUITPY_ULAB = 0 diff --git a/ports/stm/boards/stm32f411ce_blackpill_with_flash/pins.c b/ports/stm/boards/stm32f411ce_blackpill_with_flash/pins.c index 7e25ad042b..b21ae0da5e 100644 --- a/ports/stm/boards/stm32f411ce_blackpill_with_flash/pins.c +++ b/ports/stm/boards/stm32f411ce_blackpill_with_flash/pins.c @@ -1,6 +1,8 @@ #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_B12), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_B13), MP_ROM_PTR(&pin_PB13) }, { MP_ROM_QSTR(MP_QSTR_B14), MP_ROM_PTR(&pin_PB14) }, diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h index ec6e548339..3b2485b3ec 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.h @@ -39,3 +39,5 @@ // The schematic has a 32k crystal that isn't fitted. Uncommented the line below if you add it. // #define BOARD_HAS_LOW_SPEED_CRYSTAL (1) // #define LSE_VALUE ((uint32_t)32000U) + +#define MICROPY_FATFS_EXFAT 0 diff --git a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk index c8dc80a70c..61e372b2c3 100644 --- a/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk +++ b/ports/stm/boards/stm32f411ve_discovery/mpconfigboard.mk @@ -18,3 +18,5 @@ CIRCUITPY_AUDIOPWMIO = 0 CIRCUITPY_KEYPAD = 0 CIRCUITPY_MIDI = 0 CIRCUITPY_MSGPACK = 0 +CIRCUITPY_BITMAPTOOLS = 0 +CIRCUITPY_VECTORIO = 0 diff --git a/ports/stm/boards/stm32f411ve_discovery/pins.c b/ports/stm/boards/stm32f411ve_discovery/pins.c index 6261513342..680985856b 100644 --- a/ports/stm/boards/stm32f411ve_discovery/pins.c +++ b/ports/stm/boards/stm32f411ve_discovery/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // P1 { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, diff --git a/ports/stm/boards/stm32f412zg_discovery/pins.c b/ports/stm/boards/stm32f412zg_discovery/pins.c index 84e646ca7f..8fc2fc0ce0 100644 --- a/ports/stm/boards/stm32f412zg_discovery/pins.c +++ b/ports/stm/boards/stm32f412zg_discovery/pins.c @@ -1,6 +1,8 @@ #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_PE02), MP_ROM_PTR(&pin_PE02) }, { MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) }, { MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) }, diff --git a/ports/stm/boards/stm32f4_discovery/pins.c b/ports/stm/boards/stm32f4_discovery/pins.c index ee53fbd784..a3301b3057 100644 --- a/ports/stm/boards/stm32f4_discovery/pins.c +++ b/ports/stm/boards/stm32f4_discovery/pins.c @@ -1,6 +1,8 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + // P1 { MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) }, { MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) }, diff --git a/ports/stm/boards/stm32f746g_discovery/pins.c b/ports/stm/boards/stm32f746g_discovery/pins.c index bd9c1dcb15..8c0a41569b 100644 --- a/ports/stm/boards/stm32f746g_discovery/pins.c +++ b/ports/stm/boards/stm32f746g_discovery/pins.c @@ -1,6 +1,8 @@ #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_PA00) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PF10) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PF09) }, diff --git a/ports/stm/boards/thunderpack_v11/mpconfigboard.h b/ports/stm/boards/thunderpack_v11/mpconfigboard.h index 9c3c116e51..9afbd3d033 100644 --- a/ports/stm/boards/thunderpack_v11/mpconfigboard.h +++ b/ports/stm/boards/thunderpack_v11/mpconfigboard.h @@ -51,3 +51,5 @@ #define DEFAULT_I2C_BUS_SCL (&pin_PB06) #define DEFAULT_I2C_BUS_SDA (&pin_PB07) + +#define MICROPY_FATFS_EXFAT 0 diff --git a/ports/stm/boards/thunderpack_v11/mpconfigboard.mk b/ports/stm/boards/thunderpack_v11/mpconfigboard.mk index 8f645068d7..9aa50c0225 100644 --- a/ports/stm/boards/thunderpack_v11/mpconfigboard.mk +++ b/ports/stm/boards/thunderpack_v11/mpconfigboard.mk @@ -16,4 +16,7 @@ MCU_PACKAGE = UFQFPN48 LD_COMMON = boards/common_nvm.ld LD_FILE = boards/STM32F411_nvm.ld +CIRCUITPY_AESIO = 0 +CIRCUITPY_BLEIO_HCI = 0 +CIRCUITPY_VECTORIO = 0 CIRCUITPY_ULAB = 0 diff --git a/ports/stm/boards/thunderpack_v11/pins.c b/ports/stm/boards/thunderpack_v11/pins.c index eed54eb3c8..b37e37825a 100644 --- a/ports/stm/boards/thunderpack_v11/pins.c +++ b/ports/stm/boards/thunderpack_v11/pins.c @@ -1,6 +1,8 @@ #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_PA0), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_PA1), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_PA2), MP_ROM_PTR(&pin_PA02) }, diff --git a/ports/stm/boards/thunderpack_v12/pins.c b/ports/stm/boards/thunderpack_v12/pins.c index 1e07621eaa..f106c8a26b 100644 --- a/ports/stm/boards/thunderpack_v12/pins.c +++ b/ports/stm/boards/thunderpack_v12/pins.c @@ -1,6 +1,8 @@ #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_PA0), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_PA1), MP_ROM_PTR(&pin_PA01) }, { MP_ROM_QSTR(MP_QSTR_PA2), MP_ROM_PTR(&pin_PA02) }, diff --git a/ports/stm/common-hal/alarm/SleepMemory.c b/ports/stm/common-hal/alarm/SleepMemory.c index 3b89efbca3..dc19222d63 100644 --- a/ports/stm/common-hal/alarm/SleepMemory.c +++ b/ports/stm/common-hal/alarm/SleepMemory.c @@ -29,21 +29,45 @@ #include "py/runtime.h" #include "common-hal/alarm/SleepMemory.h" +#include STM32_HAL_H + +#define STM_BKPSRAM_SIZE 0x1000 +#define STM_BKPSRAM_START BKPSRAM_BASE + +STATIC bool initialized = false; + +STATIC void lazy_init(void) { + if (!initialized) { + __HAL_RCC_BKPSRAM_CLK_ENABLE(); + HAL_PWREx_EnableBkUpReg(); + HAL_PWR_EnableBkUpAccess(); + initialized = true; + } +} + void alarm_sleep_memory_reset(void) { } uint32_t common_hal_alarm_sleep_memory_get_length(alarm_sleep_memory_obj_t *self) { - mp_raise_NotImplementedError(translate("Sleep Memory not available")); - return 0; + lazy_init(); + return STM_BKPSRAM_SIZE; } bool common_hal_alarm_sleep_memory_set_bytes(alarm_sleep_memory_obj_t *self, uint32_t start_index, const uint8_t *values, uint32_t len) { - mp_raise_NotImplementedError(translate("Sleep Memory not available")); - return false; + if (start_index + len > STM_BKPSRAM_SIZE) { + return false; + } + lazy_init(); + memcpy((uint8_t *)(STM_BKPSRAM_START + start_index), values, len); + return true; } void common_hal_alarm_sleep_memory_get_bytes(alarm_sleep_memory_obj_t *self, uint32_t start_index, uint8_t *values, uint32_t len) { - mp_raise_NotImplementedError(translate("Sleep Memory not available")); + if (start_index + len > STM_BKPSRAM_SIZE) { + return; + } + lazy_init(); + memcpy(values, (uint8_t *)(STM_BKPSRAM_START + start_index), len); return; } diff --git a/ports/stm/common-hal/busio/OneWire.h b/ports/stm/common-hal/busio/OneWire.h deleted file mode 100644 index 0099593f03..0000000000 --- a/ports/stm/common-hal/busio/OneWire.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2016 Scott Shawcroft - * - * 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_STM32_COMMON_HAL_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_STM32_COMMON_HAL_BUSIO_ONEWIRE_H - -// Use bitbangio. -#include "shared-module/busio/OneWire.h" - -#endif // MICROPY_INCLUDED_STM32F_COMMON_HAL_BUSIO_ONEWIRE_H diff --git a/ports/stm/common-hal/canio/Listener.c b/ports/stm/common-hal/canio/Listener.c index 23634eba69..dc819180f9 100644 --- a/ports/stm/common-hal/canio/Listener.c +++ b/ports/stm/common-hal/canio/Listener.c @@ -30,6 +30,8 @@ #include "py/obj.h" #include "py/runtime.h" +#include "lib/utils/interrupt_char.h" + #include "common-hal/canio/__init__.h" #include "common-hal/canio/Listener.h" #include "shared-bindings/canio/Listener.h" @@ -272,6 +274,11 @@ mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) { if (supervisor_ticks_ms64() > deadline) { return NULL; } + RUN_BACKGROUND_TASKS; + // Allow user to break out of a timeout with a KeyboardInterrupt. + if (mp_hal_is_interrupted()) { + return NULL; + } } while (!common_hal_canio_listener_in_waiting(self)); } diff --git a/ports/stm/common-hal/displayio/ParallelBus.c b/ports/stm/common-hal/displayio/ParallelBus.c deleted file mode 100644 index d36d8ad64a..0000000000 --- a/ports/stm/common-hal/displayio/ParallelBus.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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/displayio/ParallelBus.h" - -#include - -#include "common-hal/microcontroller/Pin.h" -#include "py/runtime.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "shared-bindings/microcontroller/__init__.h" - -void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *self, - const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select, - const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency) { - - mp_raise_NotImplementedError(translate("ParallelBus not yet supported")); -} - -void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self) { - -} - -bool common_hal_displayio_parallelbus_reset(mp_obj_t obj) { - return false; -} - -bool common_hal_displayio_parallelbus_bus_free(mp_obj_t obj) { - return false; -} - -bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t obj) { - - return false; -} - -void common_hal_displayio_parallelbus_send(mp_obj_t obj, display_byte_type_t byte_type, - display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length) { - -} - -void common_hal_displayio_parallelbus_end_transaction(mp_obj_t obj) { - -} diff --git a/ports/stm/common-hal/displayio/ParallelBus.h b/ports/stm/common-hal/displayio/ParallelBus.h deleted file mode 100644 index 85d100715e..0000000000 --- a/ports/stm/common-hal/displayio/ParallelBus.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This file is part of the MicroPython project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2019 Lucian Copeland 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_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H -#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H - -#include "common-hal/digitalio/DigitalInOut.h" - -typedef struct { - mp_obj_base_t base; -} displayio_parallelbus_obj_t; - -#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_DISPLAYIO_PARALLELBUS_H diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index 9e28002a69..fe3caa08b2 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -52,15 +52,15 @@ STATIC pulseio_pulseout_obj_t *curr_pulseout = NULL; STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) { // Turn on PWM - HAL_TIM_PWM_Start(&(pulseout->pwmout->handle), pulseout->pwmout->channel); + HAL_TIM_PWM_Start(&(pulseout->pwmout.handle), pulseout->pwmout.channel); } STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) { // Turn off PWM - HAL_TIM_PWM_Stop(&(pulseout->pwmout->handle), pulseout->pwmout->channel); + HAL_TIM_PWM_Stop(&(pulseout->pwmout.handle), pulseout->pwmout.channel); // Make sure pin is low. - HAL_GPIO_WritePin(pin_port(pulseout->pwmout->tim->pin->port), - pin_mask(pulseout->pwmout->tim->pin->number), 0); + HAL_GPIO_WritePin(pin_port(pulseout->pwmout.tim->pin->port), + pin_mask(pulseout->pwmout.tim->pin->number), 0); } STATIC void start_timer(void) { @@ -80,7 +80,7 @@ STATIC void pulseout_event_handler(void) { if (__HAL_TIM_GET_FLAG(&tim_handle, TIM_FLAG_UPDATE) != RESET) { if (__HAL_TIM_GET_IT_SOURCE(&tim_handle, TIM_IT_UPDATE) != RESET) { __HAL_TIM_CLEAR_IT(&tim_handle, TIM_IT_UPDATE); - if (curr_pulseout->pwmout == NULL) { + if (common_hal_pulseio_pulseout_deinited(curr_pulseout)) { return; // invalid interrupt } @@ -111,13 +111,12 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, - const pwmio_pwmout_obj_t *carrier, - const mcu_pin_obj_t *pin, - uint32_t frequency, - uint16_t duty_cycle) { - if (!carrier || pin || frequency) { - mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead")); - } + const mcu_pin_obj_t *pin, uint32_t frequency, uint16_t duty_cycle) { + pwmout_result_t result = common_hal_pwmio_pwmout_construct( + &self->pwmout, pin, duty_cycle, frequency, false); + + // This will raise an exception and not return if needed. + common_hal_pwmio_pwmout_raise_error(result); // Add to active PulseOuts refcount++; @@ -139,13 +138,12 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, HAL_TIM_Base_Init(&tim_handle); tim_handle.Instance->SR = 0; - // The HAL can't work with const, recast required. - self->pwmout = (pwmio_pwmout_obj_t *)carrier; + turn_off(self); } bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t *self) { - return self->pwmout == NULL; + return common_hal_pwmio_pwmout_deinited(&self->pwmout); } void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { @@ -153,7 +151,7 @@ void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t *self) { return; } turn_on(self); - self->pwmout = NULL; + common_hal_pwmio_pwmout_deinit(&self->pwmout); refcount--; if (refcount == 0) { diff --git a/ports/stm/common-hal/pulseio/PulseOut.h b/ports/stm/common-hal/pulseio/PulseOut.h index 29894f27d2..3a0c460ff7 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.h +++ b/ports/stm/common-hal/pulseio/PulseOut.h @@ -34,7 +34,7 @@ typedef struct { mp_obj_base_t base; - pwmio_pwmout_obj_t *pwmout; + pwmio_pwmout_obj_t pwmout; } pulseio_pulseout_obj_t; void pulseout_reset(void); diff --git a/ports/stm/common-hal/pwmio/PWMOut.c b/ports/stm/common-hal/pwmio/PWMOut.c index 17ef82a060..e5dc18cd79 100644 --- a/ports/stm/common-hal/pwmio/PWMOut.c +++ b/ports/stm/common-hal/pwmio/PWMOut.c @@ -89,8 +89,8 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, for (uint i = 0; i < tim_num; i++) { const mcu_tim_pin_obj_t *l_tim = &mcu_tim_pin_list[i]; - uint8_t l_tim_index = l_tim->tim_index - 1; - uint8_t l_tim_channel = l_tim->channel_index - 1; + uint8_t l_tim_index = l_tim->tim_index; + uint8_t l_tim_channel = l_tim->channel_index; // if pin is same if (l_tim->pin == pin) { @@ -127,14 +127,14 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, // handle valid/invalid timer instance if (self->tim != NULL) { // create instance - TIMx = mcu_tim_banks[self->tim->tim_index - 1]; + TIMx = mcu_tim_banks[self->tim->tim_index]; // reserve timer/channel if (variable_frequency) { - reserved_tim[self->tim->tim_index - 1] = 0x0F; + reserved_tim[self->tim->tim_index] = 0x0F; } else { - reserved_tim[self->tim->tim_index - 1] |= 1 << (self->tim->channel_index - 1); + reserved_tim[self->tim->tim_index] |= 1 << self->tim->channel_index; } - tim_frequencies[self->tim->tim_index - 1] = frequency; + tim_frequencies[self->tim->tim_index] = frequency; stm_peripherals_timer_reserve(TIMx); } else { // no match found if (tim_chan_taken || tim_taken_internal) { @@ -148,6 +148,13 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, } } + uint32_t prescaler = 0; // prescaler is 15 bit + uint32_t period = 0; // period is 16 bit + uint32_t source_freq = stm_peripherals_timer_get_source_freq(TIMx); + if (!timer_get_optimal_divisors(&period, &prescaler, frequency, source_freq)) { + return PWMOUT_INVALID_FREQUENCY; + } + GPIO_InitTypeDef GPIO_InitStruct = {0}; GPIO_InitStruct.Pin = pin_mask(pin->number); GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; @@ -155,18 +162,12 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self, GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; GPIO_InitStruct.Alternate = self->tim->altfn_index; HAL_GPIO_Init(pin_port(pin->port), &GPIO_InitStruct); + self->pin = pin; - tim_clock_enable(1 << (self->tim->tim_index - 1)); + tim_clock_enable(1 << (self->tim->tim_index)); // translate channel into handle value - self->channel = 4 * (self->tim->channel_index - 1); - - uint32_t prescaler = 0; // prescaler is 15 bit - uint32_t period = 0; // period is 16 bit - uint32_t source_freq = stm_peripherals_timer_get_source_freq(TIMx); - if (!timer_get_optimal_divisors(&period, &prescaler, frequency, source_freq)) { - return PWMOUT_INVALID_FREQUENCY; - } + self->channel = 4 * self->tim->channel_index; // Timer init self->handle.Instance = TIMx; @@ -207,7 +208,7 @@ void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) { for (size_t i = 0; i < TIM_BANK_ARRAY_LEN; i++) { if (mcu_tim_banks[i] == self->handle.Instance) { never_reset_tim[i] = true; - never_reset_pin_number(self->tim->pin->port, self->tim->pin->number); + common_hal_never_reset_pin(self->pin); break; } } @@ -232,16 +233,16 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) { } // var freq shuts down entire timer, others just their channel if (self->variable_frequency) { - reserved_tim[self->tim->tim_index - 1] = 0x00; + reserved_tim[self->tim->tim_index] = 0x00; } else { - reserved_tim[self->tim->tim_index - 1] &= ~(1 << self->tim->channel_index); + reserved_tim[self->tim->tim_index] &= ~(1 << self->tim->channel_index); HAL_TIM_PWM_Stop(&self->handle, self->channel); } - reset_pin_number(self->tim->pin->port,self->tim->pin->number); + common_hal_reset_pin(self->pin); // if reserved timer has no active channels, we can disable it - if (!reserved_tim[self->tim->tim_index - 1]) { - tim_frequencies[self->tim->tim_index - 1] = 0x00; + if (reserved_tim[self->tim->tim_index] == 0) { + tim_frequencies[self->tim->tim_index] = 0x00; stm_peripherals_timer_free(self->handle.Instance); } @@ -290,7 +291,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t fr mp_raise_ValueError(translate("Could not restart PWM")); } - tim_frequencies[self->tim->tim_index - 1] = frequency; + tim_frequencies[self->tim->tim_index] = frequency; self->frequency = frequency; self->period = period; } @@ -302,3 +303,7 @@ uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t *self) { bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t *self) { return self->variable_frequency; } + +const mcu_pin_obj_t *common_hal_pwmio_pwmout_get_pin(pwmio_pwmout_obj_t *self) { + return self->pin; +} diff --git a/ports/stm/common-hal/pwmio/PWMOut.h b/ports/stm/common-hal/pwmio/PWMOut.h index 4cf2b1c670..de3a304721 100644 --- a/ports/stm/common-hal/pwmio/PWMOut.h +++ b/ports/stm/common-hal/pwmio/PWMOut.h @@ -44,6 +44,7 @@ typedef struct { uint16_t duty_cycle; uint32_t frequency; uint32_t period; + const mcu_pin_obj_t *pin; } pwmio_pwmout_obj_t; void pwmout_reset(void); diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk index c68a5077ee..16c098841c 100644 --- a/ports/stm/mpconfigport.mk +++ b/ports/stm/mpconfigport.mk @@ -61,3 +61,5 @@ ifeq ($(MCU_SERIES),F7) USB_NUM_ENDPOINT_PAIRS = 6 endif + +CIRCUITPY_PARALLELDISPLAY := 0 diff --git a/ports/stm/peripherals/periph.h b/ports/stm/peripherals/periph.h index 488541d096..d9e65c2172 100644 --- a/ports/stm/peripherals/periph.h +++ b/ports/stm/peripherals/periph.h @@ -59,9 +59,9 @@ typedef struct { #define TIM(index, alt, channel, tim_pin) \ { \ - .tim_index = index, \ + .tim_index = index - 1, \ .altfn_index = alt, \ - .channel_index = channel, \ + .channel_index = channel - 1, \ .pin = tim_pin, \ } diff --git a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c index 451e4220c4..cc1aaa6875 100644 --- a/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c +++ b/ports/stm/peripherals/stm32f4/stm32f405xx/periph.c @@ -220,7 +220,7 @@ const mcu_periph_obj_t mcu_sdio_data3_list[1] = { // CAN CAN_TypeDef *mcu_can_banks[2] = {CAN1, CAN2}; -const mcu_periph_obj_t mcu_can_tx_list[6] = { +const mcu_periph_obj_t mcu_can_rx_list[6] = { PERIPH(1, 9, &pin_PA11), PERIPH(1, 9, &pin_PB08), PERIPH(1, 9, &pin_PD00), @@ -230,7 +230,7 @@ const mcu_periph_obj_t mcu_can_tx_list[6] = { PERIPH(2, 9, &pin_PB05), }; -const mcu_periph_obj_t mcu_can_rx_list[6] = { +const mcu_periph_obj_t mcu_can_tx_list[6] = { PERIPH(1, 9, &pin_PA12), PERIPH(1, 9, &pin_PB09), PERIPH(1, 9, &pin_PD01), diff --git a/ports/stm/peripherals/timers.c b/ports/stm/peripherals/timers.c index 6121deab16..24060678e4 100644 --- a/ports/stm/peripherals/timers.c +++ b/ports/stm/peripherals/timers.c @@ -41,8 +41,12 @@ static bool stm_timer_reserved[MP_ARRAY_SIZE(mcu_tim_banks)]; static bool stm_timer_never_reset[MP_ARRAY_SIZE(mcu_tim_banks)]; -static void (*stm_timer_callback[MP_ARRAY_SIZE (mcu_tim_banks)])(void); - static size_t irq_map[] = { + +typedef void (*stm_timer_callback_t)(void); +// Array of function pointers. +static stm_timer_callback_t stm_timer_callback[MP_ARRAY_SIZE(mcu_tim_banks)]; + +static size_t irq_map[] = { #ifdef TIM1 TIM1_CC_IRQn, #else @@ -139,7 +143,7 @@ static void (*stm_timer_callback[MP_ARRAY_SIZE (mcu_tim_banks)])(void); // If the APB prescaler is 1, then the timer clock is equal to its respective // APB clock. Otherwise (APB prescaler > 1) the timer clock is twice its // respective APB clock. See DM00031020 Rev 4, page 115. - uint32_t stm_peripherals_timer_get_source_freq(TIM_TypeDef *timer) { +uint32_t stm_peripherals_timer_get_source_freq(TIM_TypeDef *timer) { size_t tim_id = stm_peripherals_timer_get_index(timer); uint32_t source, clk_div; if (tim_id == 1 || (8 <= tim_id && tim_id <= 11)) { @@ -158,12 +162,12 @@ static void (*stm_timer_callback[MP_ARRAY_SIZE (mcu_tim_banks)])(void); return source; } - size_t stm_peripherals_timer_get_irqnum(TIM_TypeDef *instance) { +size_t stm_peripherals_timer_get_irqnum(TIM_TypeDef *instance) { size_t tim_id = stm_peripherals_timer_get_index(instance); return irq_map[tim_id]; } - void timers_reset(void) { +void timers_reset(void) { uint16_t never_reset_mask = 0x00; for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_tim_banks); i++) { if (!stm_timer_never_reset[i]) { @@ -175,14 +179,14 @@ static void (*stm_timer_callback[MP_ARRAY_SIZE (mcu_tim_banks)])(void); tim_clock_disable(ALL_CLOCKS & ~(never_reset_mask)); } - TIM_TypeDef *stm_peripherals_find_timer(void) { +TIM_TypeDef *stm_peripherals_find_timer(void) { // Check for timers on pins outside the package size for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_tim_banks); i++) { bool timer_in_package = false; // Find each timer instance on the given bank for (size_t j = 0; j < MP_ARRAY_SIZE(mcu_tim_pin_list); j++) { // If a pin is claimed, we skip it - if ((mcu_tim_pin_list[j].tim_index == i + 1) + if ((mcu_tim_pin_list[j].tim_index == i) && (common_hal_mcu_pin_is_free(mcu_tim_pin_list[j].pin) == true)) { // Search whether any pins in the package array match it for (size_t k = 0; k < mcu_pin_globals.map.alloc; k++) { @@ -210,7 +214,7 @@ static void (*stm_timer_callback[MP_ARRAY_SIZE (mcu_tim_banks)])(void); return NULL; } - void stm_peripherals_timer_preinit(TIM_TypeDef *instance, uint8_t prio, void (*callback)(void)) { +void stm_peripherals_timer_preinit(TIM_TypeDef *instance, uint8_t prio, void (*callback)(void)) { size_t tim_idx = stm_peripherals_timer_get_index(instance); stm_timer_callback[tim_idx] = callback; tim_clock_enable(1 << tim_idx); @@ -218,16 +222,16 @@ static void (*stm_timer_callback[MP_ARRAY_SIZE (mcu_tim_banks)])(void); HAL_NVIC_EnableIRQ(irq_map[tim_idx]); } - void stm_peripherals_timer_reserve(TIM_TypeDef *instance) { +void stm_peripherals_timer_reserve(TIM_TypeDef *instance) { size_t tim_idx = stm_peripherals_timer_get_index(instance); stm_timer_reserved[tim_idx] = true; } - void stm_peripherals_timer_set_callback(void (*callback)(void), TIM_TypeDef *timer) { +void stm_peripherals_timer_set_callback(void (*callback)(void), TIM_TypeDef *timer) { stm_timer_callback[stm_peripherals_timer_get_index(timer)] = callback; } - void stm_peripherals_timer_free(TIM_TypeDef *instance) { +void stm_peripherals_timer_free(TIM_TypeDef *instance) { size_t tim_idx = stm_peripherals_timer_get_index(instance); HAL_NVIC_DisableIRQ(irq_map[tim_idx]); stm_timer_callback[tim_idx] = NULL; @@ -236,24 +240,27 @@ static void (*stm_timer_callback[MP_ARRAY_SIZE (mcu_tim_banks)])(void); stm_timer_never_reset[tim_idx] = false; } - void stm_peripherals_timer_never_reset(TIM_TypeDef *instance) { +void stm_peripherals_timer_never_reset(TIM_TypeDef *instance) { size_t tim_idx = stm_peripherals_timer_get_index(instance); stm_timer_never_reset[tim_idx] = true; } - void stm_peripherals_timer_reset_ok(TIM_TypeDef *instance) { + +void stm_peripherals_timer_reset_ok(TIM_TypeDef *instance) { size_t tim_idx = stm_peripherals_timer_get_index(instance); stm_timer_never_reset[tim_idx] = false; } - bool stm_peripherals_timer_is_never_reset(TIM_TypeDef *instance) { + +bool stm_peripherals_timer_is_never_reset(TIM_TypeDef *instance) { size_t tim_idx = stm_peripherals_timer_get_index(instance); return stm_timer_never_reset[tim_idx]; } - bool stm_peripherals_timer_is_reserved(TIM_TypeDef *instance) { + +bool stm_peripherals_timer_is_reserved(TIM_TypeDef *instance) { size_t tim_idx = stm_peripherals_timer_get_index(instance); return stm_timer_reserved[tim_idx]; } - size_t stm_peripherals_timer_get_index(TIM_TypeDef *instance) { +size_t stm_peripherals_timer_get_index(TIM_TypeDef *instance) { for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_tim_banks); i++) { if (instance == mcu_tim_banks[i]) { return i; @@ -262,7 +269,7 @@ static void (*stm_timer_callback[MP_ARRAY_SIZE (mcu_tim_banks)])(void); return ~(size_t)0; } - void tim_clock_enable(uint16_t mask) { +void tim_clock_enable(uint16_t mask) { #ifdef TIM1 if (mask & (1 << 0)) { __HAL_RCC_TIM1_CLK_ENABLE(); @@ -326,7 +333,7 @@ static void (*stm_timer_callback[MP_ARRAY_SIZE (mcu_tim_banks)])(void); #endif } - void tim_clock_disable(uint16_t mask) { +void tim_clock_disable(uint16_t mask) { #ifdef TIM1 if (mask & (1 << 0)) { __HAL_RCC_TIM1_CLK_DISABLE(); @@ -390,65 +397,79 @@ static void (*stm_timer_callback[MP_ARRAY_SIZE (mcu_tim_banks)])(void); #endif } - STATIC void callback_router(size_t index) { +STATIC void callback_router(size_t index) { if (stm_timer_callback[index - 1]) { (*stm_timer_callback[index - 1])(); } } - void TIM1_CC_IRQHandler(void) { // Advanced timer +void TIM1_CC_IRQHandler(void) { // Advanced timer callback_router(1); } - void TIM2_IRQHandler(void) { + +void TIM2_IRQHandler(void) { callback_router(2); } - void TIM3_IRQHandler(void) { + +void TIM3_IRQHandler(void) { callback_router(3); } - void TIM4_IRQHandler(void) { + +void TIM4_IRQHandler(void) { callback_router(4); } - void TIM5_IRQHandler(void) { + +void TIM5_IRQHandler(void) { callback_router(5); } - void TIM6_DAC_IRQHandler(void) { // Basic timer (DAC) + +void TIM6_DAC_IRQHandler(void) { // Basic timer (DAC) callback_router(6); } - void TIM7_IRQHandler(void) { // Basic timer + +void TIM7_IRQHandler(void) { // Basic timer callback_router(7); } - void TIM8_CC_IRQHandler(void) { // Advanced timer + +void TIM8_CC_IRQHandler(void) { // Advanced timer callback_router(8); } // Advanced timer interrupts are currently unused. - void TIM1_BRK_TIM9_IRQHandler(void) { +void TIM1_BRK_TIM9_IRQHandler(void) { callback_router(9); } - void TIM1_UP_TIM10_IRQHandler(void) { + +void TIM1_UP_TIM10_IRQHandler(void) { callback_router(10); } - void TIM1_TRG_COM_TIM11_IRQHandler(void) { + +void TIM1_TRG_COM_TIM11_IRQHandler(void) { callback_router(11); } - void TIM8_BRK_TIM12_IRQHandler(void) { + +void TIM8_BRK_TIM12_IRQHandler(void) { callback_router(12); } - void TIM8_UP_TIM13_IRQHandler(void) { + +void TIM8_UP_TIM13_IRQHandler(void) { callback_router(13); } - void TIM8_TRG_COM_TIM14_IRQHandler(void) { + +void TIM8_TRG_COM_TIM14_IRQHandler(void) { callback_router(14); } #if (CPY_STM32H7) - void TIM15_IRQHandler(void) { +void TIM15_IRQHandler(void) { callback_router(15); } - void TIM16_IRQHandler(void) { + +void TIM16_IRQHandler(void) { callback_router(16); } - void TIM17_IRQHandler(void) { + +void TIM17_IRQHandler(void) { callback_router(17); } #endif diff --git a/ports/stm/supervisor/port.c b/ports/stm/supervisor/port.c index b62fe9d24a..9dc6eeb870 100644 --- a/ports/stm/supervisor/port.c +++ b/ports/stm/supervisor/port.c @@ -26,11 +26,13 @@ */ #include -#include "supervisor/port.h" +#include "supervisor/background_callback.h" #include "supervisor/board.h" +#include "supervisor/port.h" #include "lib/timeutils/timeutils.h" #include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/__init__.h" #ifdef CIRCUITPY_AUDIOPWMIO #include "common-hal/audiopwmio/PWMAudioOut.h" @@ -366,7 +368,11 @@ void port_idle_until_interrupt(void) { if (stm32_peripherals_rtc_alarm_triggered(PERIPHERALS_ALARM_A)) { return; } - __WFI(); + common_hal_mcu_disable_interrupts(); + if (!background_callback_pending()) { + __WFI(); + } + common_hal_mcu_enable_interrupts(); } // Required by __libc_init_array in startup code if we are compiling using diff --git a/ports/stm/tools/parse_pins_csv.py b/ports/stm/tools/parse_pins_csv.py index 972c6b6a88..07fe3dce63 100644 --- a/ports/stm/tools/parse_pins_csv.py +++ b/ports/stm/tools/parse_pins_csv.py @@ -37,6 +37,7 @@ with open(sys.argv[1]) as csv_file: line_count = 0 print("STATIC const mp_rom_map_elem_t board_module_globals_table[] = {") + print(" { MP_ROM_QSTR(MP_QSTR_ID), MP_ROM_PTR(&board_module_id_obj) },") for row in csv_reader: label = row[0] diff --git a/ports/unix/Makefile b/ports/unix/Makefile index d966e71327..ec60d8d2ad 100644 --- a/ports/unix/Makefile +++ b/ports/unix/Makefile @@ -213,7 +213,7 @@ ifeq ($(HASCPP17), 1) else CXXFLAGS += -std=c++11 endif -CXXFLAGS += $(filter-out -Wmissing-prototypes -Wold-style-definition -std=gnu99,$(CFLAGS) $(CXXFLAGS_MOD)) +CXXFLAGS += $(filter-out -Wmissing-prototypes -Wold-style-definition -std=gnu99 -std=gnu11,$(CFLAGS) $(CXXFLAGS_MOD)) ifeq ($(MICROPY_FORCE_32BIT),1) RUN_TESTS_MPY_CROSS_FLAGS = --mpy-cross-flags='-mcache-lookup-bc -march=x86' diff --git a/ports/unix/mpconfigport.h b/ports/unix/mpconfigport.h index 99da47f31b..166825ab81 100644 --- a/ports/unix/mpconfigport.h +++ b/ports/unix/mpconfigport.h @@ -60,6 +60,7 @@ #define MICROPY_MALLOC_USES_ALLOCATED_SIZE (1) #define MICROPY_MEM_STATS (1) #define MICROPY_DEBUG_PRINTERS (1) +#define CIRCUITPY_MICROPYTHON_ADVANCED (1) // Printing debug to stderr may give tests which // check stdout a chance to pass, etc. #define MICROPY_DEBUG_PRINTER (&mp_stderr_print) @@ -106,7 +107,6 @@ #define MICROPY_PY_BUILTINS_SLICE_ATTRS (1) #define MICROPY_PY_BUILTINS_SLICE_INDICES (1) #define MICROPY_PY_SYS_EXIT (1) -#define MICROPY_PY_SYS_ATEXIT (1) #if MICROPY_PY_SYS_SETTRACE #define MICROPY_PERSISTENT_CODE_SAVE (1) #define MICROPY_COMP_CONST (0) diff --git a/ports/unix/variants/coverage/mpconfigvariant.mk b/ports/unix/variants/coverage/mpconfigvariant.mk index aa554200bb..e5d0f7e2d3 100644 --- a/ports/unix/variants/coverage/mpconfigvariant.mk +++ b/ports/unix/variants/coverage/mpconfigvariant.mk @@ -21,5 +21,11 @@ MICROPY_VFS_LFS2 = 1 FROZEN_DIR=variants/coverage/frzstr FROZEN_MPY_DIR=variants/coverage/frzmpy +SRC_QRIO := $(patsubst ../../%,%,$(wildcard ../../shared-bindings/qrio/*.c ../../shared-module/qrio/*.c ../../lib/quirc/lib/*.c)) +SRC_C += $(SRC_QRIO) + +CFLAGS += -DCIRCUITPY_QRIO=1 +$(BUILD)/lib/quirc/lib/%.o: CFLAGS += -Wno-shadow -Wno-sign-compare -include shared-module/qrio/quirc_alloc.h + SRC_C += coverage.c SRC_CXX += coveragecpp.cpp diff --git a/py/argcheck.c b/py/argcheck.c index 0d14c5eff2..a2b5f63f33 100644 --- a/py/argcheck.c +++ b/py/argcheck.c @@ -195,11 +195,11 @@ mp_float_t mp_arg_validate_obj_float_non_negative(mp_obj_t float_in, mp_float_t return f; } -size_t mp_arg_validate_length_with_name(mp_int_t i, size_t length, qstr arg_name, qstr length_name) { - if (i != (mp_int_t)length) { - mp_raise_ValueError_varg(translate("%q length must be %q"), MP_QSTR_pressed, MP_QSTR_num_keys); +mp_uint_t mp_arg_validate_length_range(mp_uint_t length, mp_uint_t min, mp_uint_t max, qstr arg_name) { + if (length < min || length > max) { + mp_raise_ValueError_varg(translate("%q length must be %d-%d"), arg_name, min, max); } - return (size_t)i; + return length; } mp_obj_t mp_arg_validate_type(mp_obj_t obj, const mp_obj_type_t *type, qstr arg_name) { diff --git a/py/builtinhelp.c b/py/builtinhelp.c index 344ded80b0..35bd3d3bca 100644 --- a/py/builtinhelp.c +++ b/py/builtinhelp.c @@ -131,10 +131,7 @@ STATIC void mp_help_print_modules(void) { #if MICROPY_ENABLE_EXTERNAL_IMPORT // let the user know there may be other modules available from the filesystem - const compressed_string_t *compressed = translate("Plus any modules on the filesystem\n"); - char decompressed[decompress_length(compressed)]; - decompress(compressed, decompressed); - mp_print_str(MP_PYTHON_PRINTER, decompressed); + serial_write_compressed(translate("Plus any modules on the filesystem\n")); #endif } #endif @@ -150,18 +147,10 @@ STATIC void mp_help_print_obj(const mp_obj_t obj) { const mp_obj_type_t *type = mp_obj_get_type(obj); // try to print something sensible about the given object - const compressed_string_t *compressed = translate("object "); - char decompressed_object[decompress_length(compressed)]; - decompress(compressed, decompressed_object); - - mp_print_str(MP_PYTHON_PRINTER, decompressed_object); + mp_cprintf(MP_PYTHON_PRINTER, translate("object ")); mp_obj_print(obj, PRINT_STR); - compressed = translate(" is of type %q\n"); - char decompressed_typestring[decompress_length(compressed)]; - decompress(compressed, decompressed_typestring); - - mp_printf(MP_PYTHON_PRINTER, decompressed_typestring, type->name); + mp_cprintf(MP_PYTHON_PRINTER, translate(" is of type %q\n"), type->name); mp_map_t *map = NULL; if (type == &mp_type_module) { @@ -186,11 +175,9 @@ STATIC void mp_help_print_obj(const mp_obj_t obj) { STATIC mp_obj_t mp_builtin_help(size_t n_args, const mp_obj_t *args) { if (n_args == 0) { // print a general help message. Translate only works on single strings on one line. - const compressed_string_t *compressed = - translate("Welcome to Adafruit CircuitPython %s!\n\nPlease visit learn.adafruit.com/category/circuitpython for project guides.\n\nTo list built-in modules please do `help(\"modules\")`.\n"); - char decompressed[decompress_length(compressed)]; - decompress(compressed, decompressed); - mp_printf(MP_PYTHON_PRINTER, decompressed, MICROPY_GIT_TAG); + mp_cprintf(MP_PYTHON_PRINTER, + translate("Welcome to Adafruit CircuitPython %s!\n\nPlease visit learn.adafruit.com/category/circuitpython for project guides.\n\nTo list built-in modules please do `help(\"modules\")`.\n"), + MICROPY_GIT_TAG); } else { // try to print something sensible about the given object mp_help_print_obj(args[0]); diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 495f5fd10a..74290fe3d7 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -114,6 +114,9 @@ endif ifeq ($(CIRCUITPY_ANALOGIO),1) SRC_PATTERNS += analogio/% endif +ifeq ($(CIRCUITPY_ATEXIT),1) +SRC_PATTERNS += atexit/% +endif ifeq ($(CIRCUITPY_AUDIOBUSIO),1) SRC_PATTERNS += audiobusio/% endif @@ -155,7 +158,7 @@ ifeq ($(CIRCUITPY_BUSDEVICE),1) SRC_PATTERNS += adafruit_bus_device/% endif ifeq ($(CIRCUITPY_BUSIO),1) -SRC_PATTERNS += busio/% bitbangio/OneWire.% +SRC_PATTERNS += busio/% endif ifeq ($(CIRCUITPY_CAMERA),1) SRC_PATTERNS += camera/% @@ -172,6 +175,9 @@ 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 @@ -184,12 +190,13 @@ endif ifeq ($(CIRCUITPY_FREQUENCYIO),1) SRC_PATTERNS += frequencyio/% endif -ifeq ($(CIRCUITPY_GAMEPAD),1) -SRC_PATTERNS += gamepad/% -endif + ifeq ($(CIRCUITPY_GAMEPADSHIFT),1) SRC_PATTERNS += gamepadshift/% endif +ifeq ($(CIRCUITPY_GETPASS),1) +SRC_PATTERNS += getpass/% +endif ifeq ($(CIRCUITPY_GNSS),1) SRC_PATTERNS += gnss/% endif @@ -217,6 +224,9 @@ endif ifeq ($(CIRCUITPY_NVM),1) SRC_PATTERNS += nvm/% endif +ifeq ($(CIRCUITPY_ONEWIREIO),1) +SRC_PATTERNS += onewireio/% +endif ifeq ($(CIRCUITPY_OS),1) SRC_PATTERNS += os/% endif @@ -226,6 +236,9 @@ endif ifeq ($(CIRCUITPY_PIXELBUF),1) SRC_PATTERNS += adafruit_pixelbuf/% endif +ifeq ($(CIRCUITPY_QRIO),1) +SRC_PATTERNS += qrio/% +endif ifeq ($(CIRCUITPY_RAINBOWIO),1) SRC_PATTERNS += rainbowio/% endif @@ -295,6 +308,9 @@ endif ifeq ($(CIRCUITPY_TOUCHIO),1) SRC_PATTERNS += touchio/% endif +ifeq ($(CIRCUITPY_TRACEBACK),1) +SRC_PATTERNS += traceback/% +endif ifeq ($(CIRCUITPY_UHEAP),1) SRC_PATTERNS += uheap/% endif @@ -372,7 +388,6 @@ SRC_COMMON_HAL_ALL = \ countio/__init__.c \ digitalio/DigitalInOut.c \ digitalio/__init__.c \ - displayio/ParallelBus.c \ dualbank/__init__.c \ frequencyio/FrequencyIn.c \ frequencyio/__init__.c \ @@ -391,6 +406,7 @@ SRC_COMMON_HAL_ALL = \ nvm/ByteArray.c \ nvm/__init__.c \ os/__init__.c \ + paralleldisplay/ParallelBus.c \ ps2io/Ps2.c \ ps2io/__init__.c \ pulseio/PulseIn.c \ @@ -444,6 +460,8 @@ $(filter $(SRC_PATTERNS), \ _eve/__init__.c \ camera/ImageFormat.c \ canio/Match.c \ + qrio/PixelPolicy.c \ + qrio/QRInfo.c \ digitalio/Direction.c \ digitalio/DriveMode.c \ digitalio/Pull.c \ @@ -453,6 +471,8 @@ $(filter $(SRC_PATTERNS), \ microcontroller/RunMode.c \ msgpack/__init__.c \ msgpack/ExtType.c \ + paralleldisplay/__init__.c \ + paralleldisplay/ParallelBus.c \ supervisor/RunReason.c \ wifi/AuthMode.c \ ) @@ -473,6 +493,7 @@ SRC_SHARED_MODULE_ALL = \ _stage/__init__.c \ aesio/__init__.c \ aesio/aes.c \ + atexit/__init__.c \ audiocore/RawSample.c \ audiocore/WaveFile.c \ audiocore/__init__.c \ @@ -484,7 +505,6 @@ SRC_SHARED_MODULE_ALL = \ audiomp3/__init__.c \ audiopwmio/__init__.c \ bitbangio/I2C.c \ - bitbangio/OneWire.c \ bitbangio/SPI.c \ bitbangio/__init__.c \ bitmaptools/__init__.c \ @@ -493,7 +513,6 @@ SRC_SHARED_MODULE_ALL = \ adafruit_bus_device/__init__.c \ adafruit_bus_device/I2CDevice.c \ adafruit_bus_device/SPIDevice.c \ - busio/OneWire.c \ canio/Match.c \ canio/Message.c \ canio/RemoteTransmissionRequest.c \ @@ -513,6 +532,9 @@ SRC_SHARED_MODULE_ALL = \ fontio/__init__.c \ framebufferio/FramebufferDisplay.c \ framebufferio/__init__.c \ + gamepadshift/GamePadShift.c \ + gamepadshift/__init__.c \ + getpass/__init__.c \ ipaddress/IPv4Address.c \ ipaddress/__init__.c \ keypad/__init__.c \ @@ -521,23 +543,23 @@ SRC_SHARED_MODULE_ALL = \ keypad/KeyMatrix.c \ keypad/ShiftRegisterKeys.c \ keypad/Keys.c \ - sdcardio/SDCard.c \ - sdcardio/__init__.c \ - gamepad/GamePad.c \ - gamepad/__init__.c \ - gamepadshift/GamePadShift.c \ - gamepadshift/__init__.c \ memorymonitor/__init__.c \ memorymonitor/AllocationAlarm.c \ memorymonitor/AllocationSize.c \ network/__init__.c \ msgpack/__init__.c \ + onewireio/__init__.c \ + onewireio/OneWire.c \ os/__init__.c \ + qrio/__init__.c \ + qrio/QRDecoder.c \ rainbowio/__init__.c \ random/__init__.c \ rgbmatrix/RGBMatrix.c \ rgbmatrix/__init__.c \ rotaryio/IncrementalEncoder.c \ + sdcardio/SDCard.c \ + sdcardio/__init__.c \ sharpdisplay/SharpMemoryFramebuffer.c \ sharpdisplay/__init__.c \ socket/__init__.c \ @@ -548,6 +570,7 @@ SRC_SHARED_MODULE_ALL = \ terminalio/Terminal.c \ terminalio/__init__.c \ time/__init__.c \ + traceback/__init__.c \ uheap/__init__.c \ ustack/__init__.c \ vectorio/Circle.c \ @@ -668,6 +691,11 @@ SRC_CIRCUITPY_COMMON = \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c +ifeq ($(CIRCUITPY_QRIO),1) +SRC_CIRCUITPY_COMMON += lib/quirc/lib/decode.c lib/quirc/lib/identify.c lib/quirc/lib/quirc.c lib/quirc/lib/version_db.c +$(BUILD)/lib/quirc/lib/%.o: CFLAGS += -Wno-shadow -Wno-sign-compare -include shared-module/qrio/quirc_alloc.h +endif + ifdef LD_TEMPLATE_FILE # Generate a linker script (.ld file) from a template, for those builds that use it. GENERATED_LD_FILE = $(BUILD)/$(notdir $(patsubst %.template.ld,%.ld,$(LD_TEMPLATE_FILE))) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index fa55185d75..3f998b7795 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -132,12 +132,14 @@ // // 1 = SFN/ANSI 437=LFN/U.S.(OEM) #define MICROPY_FATFS_ENABLE_LFN (1) +// Code page is ignored because unicode is enabled. // Don't use parens on the value below because it gets combined with a prefix in // the preprocessor. #define MICROPY_FATFS_LFN_CODE_PAGE 437 #define MICROPY_FATFS_USE_LABEL (1) #define MICROPY_FATFS_RPATH (2) #define MICROPY_FATFS_MULTI_PARTITION (1) +#define MICROPY_FATFS_LFN_UNICODE 2 // UTF-8 // Only enable this if you really need it. It allocates a byte cache of this size. // #define MICROPY_FATFS_MAX_SS (4096) @@ -188,7 +190,9 @@ typedef long mp_off_t; // Turning off FULL_BUILD removes some functionality to reduce flash size on tiny SAMD21s #define MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG (CIRCUITPY_FULL_BUILD) +#ifndef MICROPY_CPYTHON_COMPAT #define MICROPY_CPYTHON_COMPAT (CIRCUITPY_FULL_BUILD) +#endif #define MICROPY_PY_BUILTINS_POW3 (CIRCUITPY_BUILTINS_POW3) #define MICROPY_COMP_FSTRING_LITERAL (MICROPY_CPYTHON_COMPAT) #define MICROPY_MODULE_WEAK_LINKS (0) @@ -207,6 +211,12 @@ typedef long mp_off_t; #define MICROPY_PY_URE_MATCH_SPAN_START_END (CIRCUITPY_RE) #define MICROPY_PY_URE_SUB (CIRCUITPY_RE) +#define CIRCUITPY_MICROPYTHON_ADVANCED (CIRCUITPY_FULL_BUILD) + +#ifndef MICROPY_FATFS_EXFAT +#define MICROPY_FATFS_EXFAT (CIRCUITPY_FULL_BUILD) +#endif + // LONGINT_IMPL_xxx are defined in the Makefile. // #ifdef LONGINT_IMPL_NONE @@ -234,69 +244,6 @@ typedef long mp_off_t; // 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. -#if CIRCUITPY_AESIO -extern const struct _mp_obj_module_t aesio_module; -#define AESIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_aesio), (mp_obj_t)&aesio_module }, -#else -#define AESIO_MODULE -#endif - -#if CIRCUITPY_ALARM -extern const struct _mp_obj_module_t alarm_module; -#define ALARM_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_alarm), (mp_obj_t)&alarm_module }, -#else -#define ALARM_MODULE -#endif - -#if CIRCUITPY_ANALOGIO -#define ANALOGIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_analogio), (mp_obj_t)&analogio_module }, -extern const struct _mp_obj_module_t analogio_module; -#else -#define ANALOGIO_MODULE -#endif - -#if CIRCUITPY_AUDIOBUSIO -#define AUDIOBUSIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audiobusio), (mp_obj_t)&audiobusio_module }, -extern const struct _mp_obj_module_t audiobusio_module; -#else -#define AUDIOBUSIO_MODULE -#endif - -#if CIRCUITPY_AUDIOCORE -#define AUDIOCORE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audiocore), (mp_obj_t)&audiocore_module }, -extern const struct _mp_obj_module_t audiocore_module; -#else -#define AUDIOCORE_MODULE -#endif - -#if CIRCUITPY_AUDIOIO -#define AUDIOIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audioio), (mp_obj_t)&audioio_module }, -extern const struct _mp_obj_module_t audioio_module; -#else -#define AUDIOIO_MODULE -#endif - -#if CIRCUITPY_AUDIOMIXER -#define AUDIOMIXER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audiomixer), (mp_obj_t)&audiomixer_module }, -extern const struct _mp_obj_module_t audiomixer_module; -#else -#define AUDIOMIXER_MODULE -#endif - -#if CIRCUITPY_AUDIOMP3 -#define AUDIOMP3_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audiomp3), (mp_obj_t)&audiomp3_module }, -extern const struct _mp_obj_module_t audiomp3_module; -#else -#define AUDIOMP3_MODULE -#endif - -#if CIRCUITPY_AUDIOPWMIO -#define AUDIOPWMIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_audiopwmio), (mp_obj_t)&audiopwmio_module }, -extern const struct _mp_obj_module_t audiopwmio_module; -#else -#define AUDIOPWMIO_MODULE -#endif - #if CIRCUITPY_BINASCII #define MICROPY_PY_UBINASCII CIRCUITPY_BINASCII #define BINASCII_MODULE { MP_ROM_QSTR(MP_QSTR_binascii), MP_ROM_PTR(&mp_module_ubinascii) }, @@ -304,38 +251,7 @@ extern const struct _mp_obj_module_t audiopwmio_module; #define BINASCII_MODULE #endif -#if CIRCUITPY_BITBANGIO -#define BITBANGIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitbangio), (mp_obj_t)&bitbangio_module }, -extern const struct _mp_obj_module_t bitbangio_module; -#else -#define BITBANGIO_MODULE -#endif - -#if CIRCUITPY_BITMAPTOOLS -#define BITMAPTOOLS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitmaptools), (mp_obj_t)&bitmaptools_module }, -extern const struct _mp_obj_module_t bitmaptools_module; -#else -#define BITMAPTOOLS_MODULE -#endif - -#if CIRCUITPY_BITOPS -extern const struct _mp_obj_module_t bitops_module; -#define BITOPS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_bitops),(mp_obj_t)&bitops_module }, -#else -#define BITOPS_MODULE -#endif - -#if CIRCUITPY_BLEIO -#define BLEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__bleio), (mp_obj_t)&bleio_module }, -extern const struct _mp_obj_module_t bleio_module; -#else -#define BLEIO_MODULE -#endif - #if CIRCUITPY_BOARD -#define BOARD_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_board), (mp_obj_t)&board_module }, -extern const struct _mp_obj_module_t board_module; - #define BOARD_I2C (defined(DEFAULT_I2C_BUS_SDA) && defined(DEFAULT_I2C_BUS_SCL)) #define BOARD_SPI (defined(DEFAULT_SPI_BUS_SCK) && defined(DEFAULT_SPI_BUS_MISO) && defined(DEFAULT_SPI_BUS_MOSI)) #define BOARD_UART (defined(DEFAULT_UART_BUS_RX) && defined(DEFAULT_UART_BUS_TX)) @@ -349,80 +265,17 @@ extern const struct _mp_obj_module_t board_module; #endif #else -#define BOARD_MODULE #define BOARD_UART_ROOT_POINTER #endif -#if CIRCUITPY_BUSDEVICE -extern const struct _mp_obj_module_t adafruit_bus_device_module; -#define BUSDEVICE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_adafruit_bus_device), (mp_obj_t)&adafruit_bus_device_module }, -#else -#define BUSDEVICE_MODULE -#endif - -#if CIRCUITPY_BUSIO -extern const struct _mp_obj_module_t busio_module; -#define BUSIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_busio), (mp_obj_t)&busio_module }, -#else -#define BUSIO_MODULE -#endif - -#if CIRCUITPY_CAMERA -extern const struct _mp_obj_module_t camera_module; -#define CAMERA_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_camera), (mp_obj_t)&camera_module }, -#else -#define CAMERA_MODULE -#endif - -#if CIRCUITPY_CANIO -extern const struct _mp_obj_module_t canio_module; -#define CANIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_canio), (mp_obj_t)&canio_module }, -#else -#define CANIO_MODULE -#endif - -#if CIRCUITPY_COUNTIO -extern const struct _mp_obj_module_t countio_module; -#define COUNTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_countio), (mp_obj_t)&countio_module }, -#else -#define COUNTIO_MODULE -#endif - -#if CIRCUITPY_DIGITALIO -extern const struct _mp_obj_module_t digitalio_module; -#define DIGITALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_digitalio), (mp_obj_t)&digitalio_module }, -#else -#define DIGITALIO_MODULE -#endif - #if CIRCUITPY_DISPLAYIO -extern const struct _mp_obj_module_t displayio_module; -extern const struct _mp_obj_module_t fontio_module; -extern const struct _mp_obj_module_t terminalio_module; -#define DISPLAYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_displayio), (mp_obj_t)&displayio_module }, #ifndef CIRCUITPY_DISPLAY_LIMIT #define CIRCUITPY_DISPLAY_LIMIT (1) #endif #else -#define DISPLAYIO_MODULE #define CIRCUITPY_DISPLAY_LIMIT (0) #endif -#if CIRCUITPY_DISPLAYIO && CIRCUITPY_TERMINALIO -#define FONTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_fontio), (mp_obj_t)&fontio_module }, -#define TERMINALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_terminalio), (mp_obj_t)&terminalio_module }, -#else -#define FONTIO_MODULE -#define TERMINALIO_MODULE -#endif - -#if CIRCUITPY_DUALBANK -extern const struct _mp_obj_module_t dualbank_module; -#define DUALBANK_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_dualbank), (mp_obj_t)&dualbank_module }, -#else -#define DUALBANK_MODULE -#endif - #if CIRCUITPY_ERRNO #define MICROPY_PY_UERRNO (1) // Uses about 80 bytes. @@ -440,49 +293,7 @@ extern const struct _mp_obj_module_t espidf_module; #define ESPIDF_MODULE #endif -#if CIRCUITPY__EVE -extern const struct _mp_obj_module_t _eve_module; -#define _EVE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__eve), (mp_obj_t)&_eve_module }, -#else -#define _EVE_MODULE -#endif - -#if CIRCUITPY_FRAMEBUFFERIO -extern const struct _mp_obj_module_t framebufferio_module; -#define FRAMEBUFFERIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_framebufferio), (mp_obj_t)&framebufferio_module }, -#else -#define FRAMEBUFFERIO_MODULE -#endif - -#if CIRCUITPY_VECTORIO -extern const struct _mp_obj_module_t vectorio_module; -#define VECTORIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_vectorio), (mp_obj_t)&vectorio_module }, -#else -#define VECTORIO_MODULE -#endif - -#if CIRCUITPY_FREQUENCYIO -extern const struct _mp_obj_module_t frequencyio_module; -#define FREQUENCYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_frequencyio), (mp_obj_t)&frequencyio_module }, -#else -#define FREQUENCYIO_MODULE -#endif - -#if CIRCUITPY_GAMEPAD -extern const struct _mp_obj_module_t gamepad_module; -#define GAMEPAD_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_gamepad),(mp_obj_t)&gamepad_module }, -#else -#define GAMEPAD_MODULE -#endif - #if CIRCUITPY_GAMEPADSHIFT -extern const struct _mp_obj_module_t gamepadshift_module; -#define GAMEPADSHIFT_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_gamepadshift),(mp_obj_t)&gamepadshift_module }, -#else -#define GAMEPADSHIFT_MODULE -#endif - -#if CIRCUITPY_GAMEPAD || CIRCUITPY_GAMEPADSHIFT // Scan gamepad every 32ms #define CIRCUITPY_GAMEPAD_TICKS 0x1f #define GAMEPAD_ROOT_POINTERS mp_obj_t gamepad_singleton; @@ -490,34 +301,6 @@ extern const struct _mp_obj_module_t gamepadshift_module; #define GAMEPAD_ROOT_POINTERS #endif -#if CIRCUITPY_GNSS -extern const struct _mp_obj_module_t gnss_module; -#define GNSS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_gnss), (mp_obj_t)&gnss_module }, -#else -#define GNSS_MODULE -#endif - -#if CIRCUITPY_I2CPERIPHERAL -extern const struct _mp_obj_module_t i2cperipheral_module; -#define I2CPERIPHERAL_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_i2cperipheral), (mp_obj_t)&i2cperipheral_module }, -#else -#define I2CPERIPHERAL_MODULE -#endif - -#if CIRCUITPY_IMAGECAPTURE -extern const struct _mp_obj_module_t imagecapture_module; -#define IMAGECAPTURE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_imagecapture), (mp_obj_t)&imagecapture_module }, -#else -#define IMAGECAPTURE_MODULE -#endif - -#if CIRCUITPY_IPADDRESS -extern const struct _mp_obj_module_t ipaddress_module; -#define IPADDRESS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ipaddress), (mp_obj_t)&ipaddress_module }, -#else -#define IPADDRESS_MODULE -#endif - #if CIRCUITPY_JSON #define MICROPY_PY_UJSON (1) #define MICROPY_PY_IO (1) @@ -531,53 +314,18 @@ extern const struct _mp_obj_module_t ipaddress_module; #endif #if CIRCUITPY_KEYPAD -extern const struct _mp_obj_module_t keypad_module; -#define KEYPAD_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_keypad), (mp_obj_t)&keypad_module }, #define KEYPAD_ROOT_POINTERS mp_obj_t keypad_scanners_linked_list; #else -#define KEYPAD_MODULE #define KEYPAD_ROOT_POINTERS #endif -#if CIRCUITPY_GAMEPAD || 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_MATH -extern const struct _mp_obj_module_t math_module; -#define MATH_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_math), (mp_obj_t)&math_module }, -#else -#define MATH_MODULE -#endif - #if CIRCUITPY_MEMORYMONITOR -extern const struct _mp_obj_module_t memorymonitor_module; -#define MEMORYMONITOR_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_memorymonitor), (mp_obj_t)&memorymonitor_module }, #define MEMORYMONITOR_ROOT_POINTERS mp_obj_t active_allocationsizes; \ mp_obj_t active_allocationalarms; #else -#define MEMORYMONITOR_MODULE #define MEMORYMONITOR_ROOT_POINTERS #endif -#if CIRCUITPY_MICROCONTROLLER -extern const struct _mp_obj_module_t microcontroller_module; -#define MICROCONTROLLER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_microcontroller), (mp_obj_t)µcontroller_module }, -#else -#define MICROCONTROLLER_MODULE -#endif - -#if CIRCUITPY_NEOPIXEL_WRITE -extern const struct _mp_obj_module_t neopixel_write_module; -#define NEOPIXEL_WRITE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write),(mp_obj_t)&neopixel_write_module }, -#else -#define NEOPIXEL_WRITE_MODULE -#endif - // This is not a top-level module; it's microcontroller.nvm. #if CIRCUITPY_NVM extern const struct _mp_obj_module_t nvm_module; @@ -592,56 +340,6 @@ extern const struct _mp_obj_module_t os_module; #define OS_MODULE_ALT_NAME #endif -#if CIRCUITPY_PEW -extern const struct _mp_obj_module_t pew_module; -#define PEW_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__pew),(mp_obj_t)&pew_module }, -#else -#define PEW_MODULE -#endif - -#if CIRCUITPY_PIXELBUF -extern const struct _mp_obj_module_t pixelbuf_module; -#define PIXELBUF_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_adafruit_pixelbuf),(mp_obj_t)&pixelbuf_module }, \ - { MP_OBJ_NEW_QSTR(MP_QSTR__pixelbuf),(mp_obj_t)&pixelbuf_module }, -#else -#define PIXELBUF_MODULE -#endif - -#if CIRCUITPY_PS2IO -extern const struct _mp_obj_module_t ps2io_module; -#define PS2IO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ps2io), (mp_obj_t)&ps2io_module }, -#else -#define PS2IO_MODULE -#endif - -#if CIRCUITPY_PULSEIO -extern const struct _mp_obj_module_t pulseio_module; -#define PULSEIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_pulseio), (mp_obj_t)&pulseio_module }, -#else -#define PULSEIO_MODULE -#endif - -#if CIRCUITPY_PWMIO -extern const struct _mp_obj_module_t pwmio_module; -#define PWMIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_pwmio), (mp_obj_t)&pwmio_module }, -#else -#define PWMIO_MODULE -#endif - -#if CIRCUITPY_RAINBOWIO -extern const struct _mp_obj_module_t rainbowio_module; -#define RAINBOWIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rainbowio), (mp_obj_t)&rainbowio_module }, -#else -#define RAINBOWIO_MODULE -#endif - -#if CIRCUITPY_RANDOM -extern const struct _mp_obj_module_t random_module; -#define RANDOM_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_random), (mp_obj_t)&random_module }, -#else -#define RANDOM_MODULE -#endif - #if CIRCUITPY_RE #define MICROPY_PY_URE (1) #define RE_MODULE { MP_ROM_QSTR(MP_QSTR_re), MP_ROM_PTR(&mp_module_ure) }, @@ -649,20 +347,6 @@ extern const struct _mp_obj_module_t random_module; #define RE_MODULE #endif -#if CIRCUITPY_RGBMATRIX -extern const struct _mp_obj_module_t rgbmatrix_module; -#define RGBMATRIX_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rgbmatrix),(mp_obj_t)&rgbmatrix_module }, -#else -#define RGBMATRIX_MODULE -#endif - -#if CIRCUITPY_ROTARYIO -extern const struct _mp_obj_module_t rotaryio_module; -#define ROTARYIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rotaryio), (mp_obj_t)&rotaryio_module }, -#else -#define ROTARYIO_MODULE -#endif - #if CIRCUITPY_RP2PIO extern const struct _mp_obj_module_t rp2pio_module; #define RP2PIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rp2pio),(mp_obj_t)&rp2pio_module }, @@ -670,13 +354,6 @@ extern const struct _mp_obj_module_t rp2pio_module; #define RP2PIO_MODULE #endif -#if CIRCUITPY_RTC -extern const struct _mp_obj_module_t rtc_module; -#define RTC_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_rtc), (mp_obj_t)&rtc_module }, -#else -#define RTC_MODULE -#endif - #if CIRCUITPY_SAMD extern const struct _mp_obj_module_t samd_module; #define SAMD_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_samd),(mp_obj_t)&samd_module }, @@ -684,76 +361,6 @@ extern const struct _mp_obj_module_t samd_module; #define SAMD_MODULE #endif -#if CIRCUITPY_SDCARDIO -extern const struct _mp_obj_module_t sdcardio_module; -#define SDCARDIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sdcardio), (mp_obj_t)&sdcardio_module }, -#else -#define SDCARDIO_MODULE -#endif - -#if CIRCUITPY_SDIOIO -extern const struct _mp_obj_module_t sdioio_module; -#define SDIOIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sdioio), (mp_obj_t)&sdioio_module }, -#else -#define SDIOIO_MODULE -#endif - -#if CIRCUITPY_SHARPDISPLAY -extern const struct _mp_obj_module_t sharpdisplay_module; -#define SHARPDISPLAY_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_sharpdisplay),(mp_obj_t)&sharpdisplay_module }, -#else -#define SHARPDISPLAY_MODULE -#endif - -#if CIRCUITPY_SOCKETPOOL -extern const struct _mp_obj_module_t socketpool_module; -#define SOCKETPOOL_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_socketpool), (mp_obj_t)&socketpool_module }, -#else -#define SOCKETPOOL_MODULE -#endif - -#if CIRCUITPY_SSL -extern const struct _mp_obj_module_t ssl_module; -#define SSL_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ssl), (mp_obj_t)&ssl_module }, -#else -#define SSL_MODULE -#endif - -#if CIRCUITPY_STAGE -extern const struct _mp_obj_module_t stage_module; -#define STAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__stage), (mp_obj_t)&stage_module }, -#else -#define STAGE_MODULE -#endif - -#if CIRCUITPY_STORAGE -extern const struct _mp_obj_module_t storage_module; -#define STORAGE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_storage), (mp_obj_t)&storage_module }, -#else -#define STORAGE_MODULE -#endif - -#if CIRCUITPY_STRUCT -extern const struct _mp_obj_module_t struct_module; -#define STRUCT_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_struct), (mp_obj_t)&struct_module }, -#else -#define STRUCT_MODULE -#endif - -#if CIRCUITPY_SUPERVISOR -extern const struct _mp_obj_module_t supervisor_module; -#define SUPERVISOR_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_supervisor), (mp_obj_t)&supervisor_module }, -#else -#define SUPERVISOR_MODULE -#endif - -#if CIRCUITPY_SYNTHIO -#define SYNTHIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_synthio), (mp_obj_t)&synthio_module }, -extern const struct _mp_obj_module_t synthio_module; -#else -#define SYNTHIO_MODULE -#endif - #if CIRCUITPY_TIME extern const struct _mp_obj_module_t time_module; #define TIME_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_time), (mp_obj_t)&time_module }, @@ -763,48 +370,6 @@ extern const struct _mp_obj_module_t time_module; #define TIME_MODULE_ALT_NAME #endif -#if CIRCUITPY_TOUCHIO -extern const struct _mp_obj_module_t touchio_module; -#define TOUCHIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_touchio), (mp_obj_t)&touchio_module }, -#else -#define TOUCHIO_MODULE -#endif - -#if CIRCUITPY_UHEAP -extern const struct _mp_obj_module_t uheap_module; -#define UHEAP_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_uheap),(mp_obj_t)&uheap_module }, -#else -#define UHEAP_MODULE -#endif - -#if CIRCUITPY_USB_CDC -extern const struct _mp_obj_module_t usb_cdc_module; -#define USB_CDC_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usb_cdc),(mp_obj_t)&usb_cdc_module }, -#else -#define USB_CDC_MODULE -#endif - -#if CIRCUITPY_USB_HID -extern const struct _mp_obj_module_t usb_hid_module; -#define USB_HID_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usb_hid),(mp_obj_t)&usb_hid_module }, -#else -#define USB_HID_MODULE -#endif - -#if CIRCUITPY_USB_MIDI -extern const struct _mp_obj_module_t usb_midi_module; -#define USB_MIDI_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usb_midi),(mp_obj_t)&usb_midi_module }, -#else -#define USB_MIDI_MODULE -#endif - -#if CIRCUITPY_USTACK -extern const struct _mp_obj_module_t ustack_module; -#define USTACK_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ustack),(mp_obj_t)&ustack_module }, -#else -#define USTACK_MODULE -#endif - #if defined(CIRCUITPY_ULAB) && CIRCUITPY_ULAB // ulab requires reverse special methods #if defined(MICROPY_PY_REVERSE_SPECIAL_METHODS) && !MICROPY_PY_REVERSE_SPECIAL_METHODS @@ -816,28 +381,6 @@ extern const struct _mp_obj_module_t ustack_module; #define ULAB_MODULE #endif -// This is not a top-level module; it's microcontroller.watchdog. -#if CIRCUITPY_WATCHDOG -extern const struct _mp_obj_module_t watchdog_module; -#define WATCHDOG_MODULE { MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&watchdog_module) }, -#else -#define WATCHDOG_MODULE -#endif - -#if CIRCUITPY_WIFI -extern const struct _mp_obj_module_t wifi_module; -#define WIFI_MODULE { MP_ROM_QSTR(MP_QSTR_wifi), MP_ROM_PTR(&wifi_module) }, -#else -#define WIFI_MODULE -#endif - -#if CIRCUITPY_MSGPACK -extern const struct _mp_obj_module_t msgpack_module; -#define MSGPACK_MODULE { MP_ROM_QSTR(MP_QSTR_msgpack), MP_ROM_PTR(&msgpack_module) }, -#else -#define MSGPACK_MODULE -#endif - // Define certain native modules with weak links so they can be replaced with Python // implementations. This list may grow over time. #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ @@ -853,85 +396,94 @@ extern const struct _mp_obj_module_t msgpack_module; TIME_MODULE_ALT_NAME \ // This is an inclusive list that should correspond to the CIRCUITPY_XXX list above, -// including dependencies such as TERMINALIO depending on DISPLAYIO (shown by indentation). +// including dependencies. // Some of these definitions will be blank depending on what is turned on and off. // Some are omitted because they're in MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS above. + #define MICROPY_PORT_BUILTIN_MODULES_STRONG_LINKS \ - AESIO_MODULE \ - ALARM_MODULE \ - ANALOGIO_MODULE \ - AUDIOBUSIO_MODULE \ - AUDIOCORE_MODULE \ - AUDIOIO_MODULE \ - AUDIOMIXER_MODULE \ - AUDIOMP3_MODULE \ - AUDIOPWMIO_MODULE \ BINASCII_MODULE \ - BITBANGIO_MODULE \ - BITMAPTOOLS_MODULE \ - BITOPS_MODULE \ - BLEIO_MODULE \ - BOARD_MODULE \ - BUSDEVICE_MODULE \ - BUSIO_MODULE \ - CAMERA_MODULE \ - CANIO_MODULE \ - COUNTIO_MODULE \ - DIGITALIO_MODULE \ - DISPLAYIO_MODULE \ - DUALBANK_MODULE \ - FONTIO_MODULE \ - TERMINALIO_MODULE \ - VECTORIO_MODULE \ ERRNO_MODULE \ ESPIDF_MODULE \ - _EVE_MODULE \ - FRAMEBUFFERIO_MODULE \ - FREQUENCYIO_MODULE \ - GAMEPAD_MODULE \ - GAMEPADSHIFT_MODULE \ - GNSS_MODULE \ - I2CPERIPHERAL_MODULE \ - IPADDRESS_MODULE \ - IMAGECAPTURE_MODULE \ JSON_MODULE \ - KEYPAD_MODULE \ - MATH_MODULE \ - MEMORYMONITOR_MODULE \ - MICROCONTROLLER_MODULE \ - MSGPACK_MODULE \ - NEOPIXEL_WRITE_MODULE \ - PEW_MODULE \ - PIXELBUF_MODULE \ - PS2IO_MODULE \ - PULSEIO_MODULE \ - PWMIO_MODULE \ - RAINBOWIO_MODULE \ - RANDOM_MODULE \ RE_MODULE \ - RGBMATRIX_MODULE \ - ROTARYIO_MODULE \ RP2PIO_MODULE \ - RTC_MODULE \ SAMD_MODULE \ - SDCARDIO_MODULE \ - SDIOIO_MODULE \ - SHARPDISPLAY_MODULE \ - SOCKETPOOL_MODULE \ - SSL_MODULE \ - STAGE_MODULE \ - STORAGE_MODULE \ - STRUCT_MODULE \ - SUPERVISOR_MODULE \ - SYNTHIO_MODULE \ - TOUCHIO_MODULE \ - UHEAP_MODULE \ - USB_CDC_MODULE \ - USB_HID_MODULE \ - USB_MIDI_MODULE \ - USTACK_MODULE \ - WATCHDOG_MODULE \ - WIFI_MODULE \ + +// The following modules are defined in their respective __init__.c file in the +// shared-bindings directory using MP_REGISTER_MODULE. +// +// CIRCUITPY_AESIO +// CIRCUITPY_ANALOGIO +// CIRCUITPY_ATEXIT +// CIRCUITPY_AUDIOBUSIO +// CIRCUITPY_AUDIOCORE +// CIRCUITPY_AUDIOIO +// CIRCUITPY_AUDIOMIXER +// CIRCUITPY_AUDIOMP3 +// CIRCUITPY_AUDIOPWMIO +// CIRCUITPY_BITBANGIO +// CIRCUITPY_BITMAPTOOLS +// CIRCUITPY_BITOPS +// CIRCUITPY_BLEIO +// CIRCUITPY_BOARD +// CIRCUITPY_BUSDEVICE +// CIRCUITPY_BUSIO +// CIRCUITPY_CAMERA +// CIRCUITPY_CANIO +// CIRCUITPY_COUNTIO +// CIRCUITPY_DIGITALIO +// CIRCUITPY_DISPLAYIO +// CIRCUITPY_DUALBANK +// CIRCUITPY__EVE +// CIRCUITPY_FONTIO +// CIRCUITPY_FRAMEBUFFERIO +// CIRCUITPY_FREQUENCYIO +// CIRCUITPY_GAMEPADSHIFT +// CIRCUITPY_GETPASS +// CIRCUITPY_GNSS +// CIRCUITPY_I2CPERIPHERAL +// CIRCUITPY_IMAGECAPTURE +// CIRCUITPY_IPADDRESS +// CIRCUITPY_KEYPAD +// CIRCUITPY_MATH +// CIRCUITPY_MEMORYMONITOR +// CIRCUITPY_MICROCONTROLLER +// CIRCUITPY_MSGPACK +// CIRCUITPY_NEOPIXEL_WRITE +// CIRCUITPY_ONEWIREIO_WRITE +// CIRCUITPY_PARALLELDISPLAY +// CIRCUITPY_PEW +// CIRCUITPY_PIXELBUF +// CIRCUITPY_PS2IO +// CIRCUITPY_PULSEIO +// CIRCUITPY_PWMIO +// CIRCUITPY_QRIO +// CIRCUITPY_RAINBOWIO +// CIRCUITPY_RANDOM +// CIRCUITPY_RGBMATRIX +// CIRCUITPY_ROTARYIO +// CIRCUITPY_RTC +// CIRCUITPY_SDCARDIO +// CIRCUITPY_SDIOIO +// CIRCUITPY_SHARPDISPLAY +// CIRCUITPY_SOCKETPOOL +// CIRCUITPY_SSL +// CIRCUITPY_STAGE +// CIRCUITPY_STORAGE +// CIRCUITPY_STRUCT +// CIRCUITPY_SUPERVISOR +// CIRCUITPY_SYNTHIO +// CIRCUITPY_TERMINALIO +// CIRCUITPY_TOUCHIO +// CIRCUITPY_TRACEBACK +// CIRCUITPY_UHEAP +// CIRCUITPY_USB_CDC +// CIRCUITPY_USB_HID +// CIRCUITPY_USB_MIDI +// CIRCUITPY_USTACK +// CIRCUITPY_VECTORIO +// CIRCUITPY_WATCHDOG +// CIRCUITPY_WIFI // If weak links are enabled, just include strong links in the main list of modules, // and also include the underscore alternate names. @@ -1004,6 +556,13 @@ void supervisor_run_background_tasks_if_tick(void); #define CIRCUITPY_VERBOSE_BLE 0 +// This trades ~1k flash space (1) for that much in RAM plus the cost to compute +// the values once on init (0). Only turn it off, when you really need the flash +// space and are willing to trade the RAM. +#ifndef CIRCUITPY_PRECOMPUTE_QSTR_ATTR +#define CIRCUITPY_PRECOMPUTE_QSTR_ATTR (1) +#endif + // USB settings // If the port requires certain USB endpoint numbers, define these in mpconfigport.h. @@ -1048,6 +607,16 @@ void supervisor_run_background_tasks_if_tick(void); #define USB_HID_EP_NUM_IN (0) #endif +// The most complicated device currently known of is the head and eye tracker, which requires 5 +// report ids. +// https://usb.org/sites/default/files/hutrr74_-_usage_page_for_head_and_eye_trackers_0.pdf +// The default descriptors only use 1, so that is the minimum. +#ifndef CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR +#define CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR (6) +#elif CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR < 1 +#error "CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR must be at least 1" +#endif + #ifndef USB_MIDI_EP_NUM_OUT #define USB_MIDI_EP_NUM_OUT (0) #endif diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 42ff9e391b..51e6fb8a11 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -36,7 +36,7 @@ CFLAGS += -DCIRCUITPY_FULL_BUILD=$(CIRCUITPY_FULL_BUILD) MICROPY_PY_ASYNC_AWAIT ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DMICROPY_PY_ASYNC_AWAIT=$(MICROPY_PY_ASYNC_AWAIT) -CIRCUITPY_AESIO ?= 0 +CIRCUITPY_AESIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO) # TODO: CIRCUITPY_ALARM will gradually be added to @@ -48,6 +48,9 @@ CFLAGS += -DCIRCUITPY_ALARM=$(CIRCUITPY_ALARM) CIRCUITPY_ANALOGIO ?= 1 CFLAGS += -DCIRCUITPY_ANALOGIO=$(CIRCUITPY_ANALOGIO) +CIRCUITPY_ATEXIT ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_ATEXIT=$(CIRCUITPY_ATEXIT) + CIRCUITPY_AUDIOBUSIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_AUDIOBUSIO=$(CIRCUITPY_AUDIOBUSIO) @@ -121,9 +124,15 @@ CFLAGS += -DCIRCUITPY_BUILTINS_POW3=$(CIRCUITPY_BUILTINS_POW3) CIRCUITPY_BUSIO ?= 1 CFLAGS += -DCIRCUITPY_BUSIO=$(CIRCUITPY_BUSIO) +# These two flags pretend to implement their class but raise a ValueError due to +# unsupported pins. This should be used sparingly on boards that don't break out +# generic IO but need parts of busio. CIRCUITPY_BUSIO_SPI ?= 1 CFLAGS += -DCIRCUITPY_BUSIO_SPI=$(CIRCUITPY_BUSIO_SPI) +CIRCUITPY_BUSIO_UART ?= 1 +CFLAGS += -DCIRCUITPY_BUSIO_UART=$(CIRCUITPY_BUSIO_UART) + CIRCUITPY_CAMERA ?= 0 CFLAGS += -DCIRCUITPY_CAMERA=$(CIRCUITPY_CAMERA) @@ -145,6 +154,13 @@ CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO) CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO) +ifeq ($(CIRCUITPY_DISPLAYIO),1) +CIRCUITPY_PARALLELDISPLAY ?= $(CIRCUITPY_FULL_BUILD) +else +CIRCUITPY_PARALLELDISPLAY = 0 +endif +CFLAGS += -DCIRCUITPY_PARALLELDISPLAY=$(CIRCUITPY_PARALLELDISPLAY) + # bitmaptools and framebufferio rely on displayio ifeq ($(CIRCUITPY_DISPLAYIO),1) CIRCUITPY_BITMAPTOOLS ?= $(CIRCUITPY_FULL_BUILD) @@ -169,7 +185,7 @@ CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE) CIRCUITPY_ERRNO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_ERRNO=$(CIRCUITPY_ERRNO) -# CIRCUITPY_ESPIDF is handled in the esp32s2 tree. +# CIRCUITPY_ESPIDF is handled in the espressif tree. # Only for ESP32S chips. # Assume not a ESP build. CIRCUITPY_ESPIDF ?= 0 @@ -181,18 +197,21 @@ CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE) CIRCUITPY_FREQUENCYIO ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_FREQUENCYIO=$(CIRCUITPY_FREQUENCYIO) -CIRCUITPY_GAMEPAD ?= 0 -CFLAGS += -DCIRCUITPY_GAMEPAD=$(CIRCUITPY_GAMEPAD) - CIRCUITPY_GAMEPADSHIFT ?= 0 CFLAGS += -DCIRCUITPY_GAMEPADSHIFT=$(CIRCUITPY_GAMEPADSHIFT) +CIRCUITPY_GETPASS ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_GETPASS=$(CIRCUITPY_GETPASS) + CIRCUITPY_GNSS ?= 0 CFLAGS += -DCIRCUITPY_GNSS=$(CIRCUITPY_GNSS) CIRCUITPY_I2CPERIPHERAL ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_I2CPERIPHERAL=$(CIRCUITPY_I2CPERIPHERAL) +CIRCUITPY_IMAGECAPTURE ?= 0 +CFLAGS += -DCIRCUITPY_IMAGECAPTURE=$(CIRCUITPY_IMAGECAPTURE) + CIRCUITPY_IPADDRESS ?= $(CIRCUITPY_WIFI) CFLAGS += -DCIRCUITPY_IPADDRESS=$(CIRCUITPY_IPADDRESS) @@ -220,12 +239,12 @@ CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE) CIRCUITPY_NVM ?= 1 CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM) +CIRCUITPY_ONEWIREIO ?= $(CIRCUITPY_BUSIO) +CFLAGS += -DCIRCUITPY_ONEWIREIO=$(CIRCUITPY_ONEWIREIO) + CIRCUITPY_OS ?= 1 CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS) -CIRCUITPY_IMAGECAPTURE ?= 0 -CFLAGS += -DCIRCUITPY_IMAGECAPTURE=$(CIRCUITPY_IMAGECAPTURE) - CIRCUITPY_PEW ?= 0 CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW) @@ -242,6 +261,9 @@ CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO) CIRCUITPY_PWMIO ?= 1 CFLAGS += -DCIRCUITPY_PWMIO=$(CIRCUITPY_PWMIO) +CIRCUITPY_QRIO ?= $(CIRCUITPY_IMAGECAPTURE) +CFLAGS += -DCIRCUITPY_QRIO=$(CIRCUITPY_QRIO) + CIRCUITPY_RAINBOWIO ?= 1 CFLAGS += -DCIRCUITPY_RAINBOWIO=$(CIRCUITPY_RAINBOWIO) @@ -327,6 +349,9 @@ CFLAGS += -DCIRCUITPY_TOUCHIO_USE_NATIVE=$(CIRCUITPY_TOUCHIO_USE_NATIVE) CIRCUITPY_TOUCHIO ?= 1 CFLAGS += -DCIRCUITPY_TOUCHIO=$(CIRCUITPY_TOUCHIO) +CIRCUITPY_TRACEBACK ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_TRACEBACK=$(CIRCUITPY_TRACEBACK) + # For debugging. CIRCUITPY_UHEAP ?= 0 CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP) diff --git a/py/gc.c b/py/gc.c index 789d3036b3..69ab969da7 100644 --- a/py/gc.c +++ b/py/gc.c @@ -32,6 +32,10 @@ #include "py/gc.h" #include "py/runtime.h" +#if MICROPY_DEBUG_VALGRIND +#include +#endif + #include "supervisor/shared/safe_mode.h" #if CIRCUITPY_MEMORYMONITOR @@ -126,7 +130,7 @@ void gc_init(void *start, void *end) { // => T = A * (1 + BLOCKS_PER_ATB / BLOCKS_PER_FTB + BLOCKS_PER_ATB * BYTES_PER_BLOCK) size_t total_byte_len = (byte *)end - (byte *)start; #if MICROPY_ENABLE_FINALISER - MP_STATE_MEM(gc_alloc_table_byte_len) = total_byte_len * MP_BITS_PER_BYTE / (MP_BITS_PER_BYTE + MP_BITS_PER_BYTE * BLOCKS_PER_ATB / BLOCKS_PER_FTB + MP_BITS_PER_BYTE * BLOCKS_PER_ATB * BYTES_PER_BLOCK); + MP_STATE_MEM(gc_alloc_table_byte_len) = (total_byte_len - 1) * MP_BITS_PER_BYTE / (MP_BITS_PER_BYTE + MP_BITS_PER_BYTE * BLOCKS_PER_ATB / BLOCKS_PER_FTB + MP_BITS_PER_BYTE * BLOCKS_PER_ATB * BYTES_PER_BLOCK); #else MP_STATE_MEM(gc_alloc_table_byte_len) = total_byte_len / (1 + MP_BITS_PER_BYTE / 2 * BYTES_PER_BLOCK); #endif @@ -135,7 +139,7 @@ void gc_init(void *start, void *end) { #if MICROPY_ENABLE_FINALISER size_t gc_finaliser_table_byte_len = (MP_STATE_MEM(gc_alloc_table_byte_len) * BLOCKS_PER_ATB + BLOCKS_PER_FTB - 1) / BLOCKS_PER_FTB; - MP_STATE_MEM(gc_finaliser_table_start) = MP_STATE_MEM(gc_alloc_table_start) + MP_STATE_MEM(gc_alloc_table_byte_len); + MP_STATE_MEM(gc_finaliser_table_start) = MP_STATE_MEM(gc_alloc_table_start) + MP_STATE_MEM(gc_alloc_table_byte_len) + 1; #endif size_t gc_pool_block_len = MP_STATE_MEM(gc_alloc_table_byte_len) * BLOCKS_PER_ATB; @@ -146,8 +150,10 @@ void gc_init(void *start, void *end) { assert(MP_STATE_MEM(gc_pool_start) >= MP_STATE_MEM(gc_finaliser_table_start) + gc_finaliser_table_byte_len); #endif - // clear ATBs - memset(MP_STATE_MEM(gc_alloc_table_start), 0, MP_STATE_MEM(gc_alloc_table_byte_len)); + // Clear ATBs plus one more byte. The extra byte might be read when we read the final ATB and + // then try to count its tail. Clearing the byte ensures it is 0 and ends the chain. Without an + // FTB, it'll just clear the pool byte early. + memset(MP_STATE_MEM(gc_alloc_table_start), 0, MP_STATE_MEM(gc_alloc_table_byte_len) + 1); #if MICROPY_ENABLE_FINALISER // clear FTBs @@ -391,6 +397,11 @@ void gc_collect_ptr(void *ptr) { __attribute__((no_sanitize_address)) #endif static void *gc_get_ptr(void **ptrs, int i) { + #if MICROPY_DEBUG_VALGRIND + if (!VALGRIND_CHECK_MEM_IS_ADDRESSABLE(&ptrs[i], sizeof(*ptrs))) { + return NULL; + } + #endif return ptrs[i]; } diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py index d2a10d29db..74ad78c47d 100644 --- a/py/makeqstrdata.py +++ b/py/makeqstrdata.py @@ -333,12 +333,9 @@ def compute_huffman_coding(translations, compression_filename): bits_per_codepoint = 16 if max_ord > 255 else 8 values_type = "uint16_t" if max_ord > 255 else "uint8_t" - max_words_len = 160 if max_ord > 255 else 255 - - sum_len = 0 - while True: + while len(words) < max_words: # Until the dictionary is filled to capacity, use a heuristic to find - # the best "word" (3- to 9-gram) to add to it. + # 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 @@ -369,7 +366,8 @@ def compute_huffman_coding(translations, compression_filename): # 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. + # 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 @@ -383,14 +381,14 @@ def compute_huffman_coding(translations, compression_filename): # 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 + 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=3, maxlen=9): + 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 @@ -410,16 +408,9 @@ def compute_huffman_coding(translations, compression_filename): break word = scores[0][0] - - # If we can successfully add it to the dictionary, do so. Otherwise, - # we've filled the dictionary to capacity and are done. - if sum_len + len(word) - 2 > max_words_len: - break - if len(words) == max_words: - break words.append(word) - sum_len += len(word) - 2 + words.sort(key=len) extractor = TextSplitter(words) counter = collections.Counter() for t in texts: @@ -469,16 +460,15 @@ def compute_huffman_coding(translations, compression_filename): len(translation.encode("utf-8")) for (original, translation) in translations ) - wends = list(len(w) - 2 for w in words) - for i in range(1, len(wends)): - wends[i] += wends[i - 1] + 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 {} values[] = {{ {} }};\n".format( - values_type, ", ".join(str(ord(u)) for u in values) - ) + "const mchar_t values[] = {{ {} }};\n".format(", ".join(str(ord(u)) for u in values)) ) f.write( "#define compress_max_length_bits ({})\n".format( @@ -486,13 +476,17 @@ def compute_huffman_coding(translations, compression_filename): ) ) f.write( - "const {} words[] = {{ {} }};\n".format( - values_type, ", ".join(str(ord(c)) for w in words for c in w) + "const mchar_t words[] = {{ {} }};\n".format( + ", ".join(str(ord(c)) for w in words for c in w) ) ) - f.write("const uint8_t wends[] = {{ {} }};\n".format(", ".join(str(p) for p in wends))) + 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) diff --git a/py/mkrules.mk b/py/mkrules.mk index 81dd961ac6..50f35ffb22 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -65,7 +65,7 @@ vpath %.cpp . $(TOP) $(USER_C_MODULES) $(BUILD)/%.o: %.cpp $(call compile_cxx) -QSTR_GEN_EXTRA_CFLAGS += -DNO_QSTR +QSTR_GEN_EXTRA_CFLAGS += -DNO_QSTR -x c # frozen.c and frozen_mpy.c are created in $(BUILD), so use our rule # for those as well. diff --git a/py/modmicropython.c b/py/modmicropython.c index 8f61cd2979..0465a4eef8 100644 --- a/py/modmicropython.c +++ b/py/modmicropython.c @@ -37,7 +37,7 @@ // Various builtins specific to MicroPython runtime, // living in micropython module -#if MICROPY_ENABLE_COMPILER +#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_COMPILER STATIC mp_obj_t mp_micropython_opt_level(size_t n_args, const mp_obj_t *args) { if (n_args == 0) { return MP_OBJ_NEW_SMALL_INT(MP_STATE_VM(mp_optimise_value)); @@ -49,7 +49,7 @@ STATIC mp_obj_t mp_micropython_opt_level(size_t n_args, const mp_obj_t *args) { STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_micropython_opt_level_obj, 0, 1, mp_micropython_opt_level); #endif -#if MICROPY_PY_MICROPYTHON_MEM_INFO +#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_PY_MICROPYTHON_MEM_INFO #if MICROPY_MEM_STATS STATIC mp_obj_t mp_micropython_mem_total(void) { @@ -109,21 +109,21 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_micropython_qstr_info_obj, 0, 1, m #endif // MICROPY_PY_MICROPYTHON_MEM_INFO -#if MICROPY_PY_MICROPYTHON_STACK_USE +#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_PY_MICROPYTHON_STACK_USE STATIC mp_obj_t mp_micropython_stack_use(void) { return MP_OBJ_NEW_SMALL_INT(mp_stack_usage()); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_stack_use_obj, mp_micropython_stack_use); #endif -#if MICROPY_ENABLE_PYSTACK +#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_PYSTACK STATIC mp_obj_t mp_micropython_pystack_use(void) { return MP_OBJ_NEW_SMALL_INT(mp_pystack_usage()); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_pystack_use_obj, mp_micropython_pystack_use); #endif -#if MICROPY_ENABLE_GC +#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_GC STATIC mp_obj_t mp_micropython_heap_lock(void) { gc_lock(); return mp_const_none; @@ -144,11 +144,11 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(mp_micropython_heap_locked_obj, mp_micropython_ #endif #endif -#if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0) +#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0) STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_alloc_emergency_exception_buf_obj, mp_alloc_emergency_exception_buf); #endif -#if MICROPY_KBD_EXCEPTION +#if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_KBD_EXCEPTION STATIC mp_obj_t mp_micropython_kbd_intr(mp_obj_t int_chr_in) { mp_hal_set_interrupt_char(mp_obj_get_int(int_chr_in)); return mp_const_none; @@ -169,10 +169,10 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(mp_micropython_schedule_obj, mp_micropython_sch STATIC const mp_rom_map_elem_t mp_module_micropython_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_micropython) }, { MP_ROM_QSTR(MP_QSTR_const), MP_ROM_PTR(&mp_identity_obj) }, - #if MICROPY_ENABLE_COMPILER + #if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_COMPILER { MP_ROM_QSTR(MP_QSTR_opt_level), MP_ROM_PTR(&mp_micropython_opt_level_obj) }, #endif - #if MICROPY_PY_MICROPYTHON_MEM_INFO + #if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_PY_MICROPYTHON_MEM_INFO #if MICROPY_MEM_STATS { MP_ROM_QSTR(MP_QSTR_mem_total), MP_ROM_PTR(&mp_micropython_mem_total_obj) }, { MP_ROM_QSTR(MP_QSTR_mem_current), MP_ROM_PTR(&mp_micropython_mem_current_obj) }, @@ -181,23 +181,23 @@ STATIC const mp_rom_map_elem_t mp_module_micropython_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_mem_info), MP_ROM_PTR(&mp_micropython_mem_info_obj) }, { MP_ROM_QSTR(MP_QSTR_qstr_info), MP_ROM_PTR(&mp_micropython_qstr_info_obj) }, #endif - #if MICROPY_PY_MICROPYTHON_STACK_USE + #if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_PY_MICROPYTHON_STACK_USE { MP_ROM_QSTR(MP_QSTR_stack_use), MP_ROM_PTR(&mp_micropython_stack_use_obj) }, #endif - #if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0) + #if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF && (MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE == 0) { MP_ROM_QSTR(MP_QSTR_alloc_emergency_exception_buf), MP_ROM_PTR(&mp_alloc_emergency_exception_buf_obj) }, #endif - #if MICROPY_ENABLE_PYSTACK + #if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_PYSTACK { MP_ROM_QSTR(MP_QSTR_pystack_use), MP_ROM_PTR(&mp_micropython_pystack_use_obj) }, #endif - #if MICROPY_ENABLE_GC + #if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_ENABLE_GC { MP_ROM_QSTR(MP_QSTR_heap_lock), MP_ROM_PTR(&mp_micropython_heap_lock_obj) }, { MP_ROM_QSTR(MP_QSTR_heap_unlock), MP_ROM_PTR(&mp_micropython_heap_unlock_obj) }, #if MICROPY_PY_MICROPYTHON_HEAP_LOCKED { MP_ROM_QSTR(MP_QSTR_heap_locked), MP_ROM_PTR(&mp_micropython_heap_locked_obj) }, #endif #endif - #if MICROPY_KBD_EXCEPTION + #if CIRCUITPY_MICROPYTHON_ADVANCED && MICROPY_KBD_EXCEPTION { MP_ROM_QSTR(MP_QSTR_kbd_intr), MP_ROM_PTR(&mp_micropython_kbd_intr_obj) }, #endif #if MICROPY_ENABLE_SCHEDULER diff --git a/py/modsys.c b/py/modsys.c index cbd1712920..484e29f411 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -120,25 +120,6 @@ STATIC mp_obj_t mp_sys_exit(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_sys_exit_obj, 0, 1, mp_sys_exit); -STATIC mp_obj_t mp_sys_print_exception(size_t n_args, const mp_obj_t *args) { - #if MICROPY_PY_IO && MICROPY_PY_SYS_STDFILES - void *stream_obj = &mp_sys_stdout_obj; - if (n_args > 1) { - mp_get_stream_raise(args[1], MP_STREAM_OP_WRITE); - stream_obj = MP_OBJ_TO_PTR(args[1]); - } - - mp_print_t print = {stream_obj, mp_stream_write_adaptor}; - mp_obj_print_exception(&print, args[0]); - #else - (void)n_args; - mp_obj_print_exception(&mp_plat_print, args[0]); - #endif - - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_sys_print_exception_obj, 1, 2, mp_sys_print_exception); - #if MICROPY_PY_SYS_EXC_INFO STATIC mp_obj_t mp_sys_exc_info(void) { mp_obj_t cur_exc = MP_OBJ_FROM_PTR(MP_STATE_VM(cur_exception)); diff --git a/py/mpconfig.h b/py/mpconfig.h index 2cd2a0d356..973900053f 100644 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -486,6 +486,11 @@ #define MICROPY_DEBUG_VM_STACK_OVERFLOW (0) #endif +// Whether to enable extra instrumentation for valgrind +#ifndef MICROPY_DEBUG_VALGRIND +#define MICROPY_DEBUG_VALGRIND (0) +#endif + /*****************************************************************************/ /* Optimisations */ diff --git a/py/mpprint.c b/py/mpprint.c index b99b5d658d..df73587449 100644 --- a/py/mpprint.c +++ b/py/mpprint.c @@ -376,6 +376,13 @@ int mp_print_float(const mp_print_t *print, mp_float_t f, char fmt, int flags, c } #endif +static int print_str_common(const mp_print_t *print, const char *str, int prec, size_t len, int flags, int fill, int width) { + if (prec >= 0 && (size_t)prec < len) { + len = prec; + } + return mp_print_strn(print, str, len, flags, fill, width); +} + int mp_printf(const mp_print_t *print, const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -484,19 +491,24 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) { qstr qst = va_arg(args, qstr); size_t len; const char *str = (const char *)qstr_data(qst, &len); - if (prec >= 0 && (size_t)prec < len) { - len = prec; - } - chrs += mp_print_strn(print, str, len, flags, fill, width); + chrs += print_str_common(print, str, prec, len, flags, fill, width); + break; + } + case 'S': { + compressed_string_t *arg = va_arg(args, compressed_string_t *); + size_t len_with_nul = decompress_length(arg); + size_t len = len_with_nul - 1; + char str[len_with_nul]; + decompress(arg, str); + chrs += print_str_common(print, str, prec, len, flags, fill, width); break; } case 's': { const char *str = va_arg(args, const char *); #ifndef NDEBUG // With debugging enabled, catch printing of null string pointers - if (prec != 0 && str == NULL) { - chrs += mp_print_strn(print, "(null)", 6, flags, fill, width); - break; + if (str == NULL) { + str = "(null)"; } #endif size_t len = strlen(str); @@ -533,7 +545,12 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) { case 'p': case 'P': // don't bother to handle upcase for 'P' // Use unsigned long int to work on both ILP32 and LP64 systems - chrs += mp_print_int(print, va_arg(args, unsigned long int), 0, 16, 'a', flags, fill, width); + #if SUPPORT_INT_BASE_PREFIX + chrs += mp_print_int(print, va_arg(args, unsigned long int), 0, 16, 'a', flags | PF_FLAG_SHOW_PREFIX, fill, width); + #else + print->print_strn(print->data, "0x", 2); + chrs += mp_print_int(print, va_arg(args, unsigned long int), 0, 16, 'a', flags, fill, width) + 2; + #endif break; #if MICROPY_PY_BUILTINS_FLOAT case 'e': @@ -574,3 +591,19 @@ int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args) { } return chrs; } + +int mp_cprintf(const mp_print_t *print, const compressed_string_t *compressed_fmt, ...) { + va_list ap; + va_start(ap, compressed_fmt); + int ret = mp_vcprintf(print, compressed_fmt, ap); + va_end(ap); + return ret; +} + +int mp_vcprintf(const mp_print_t *print, const compressed_string_t *compressed_fmt, va_list args) { + char fmt[decompress_length(compressed_fmt)]; + // TODO: Optimise this to format-while-decompressing (and not require the temp stack space). + decompress(compressed_fmt, fmt); + + return mp_vprintf(print, fmt, args); +} diff --git a/py/mpprint.h b/py/mpprint.h index 4458ea883b..9284935f96 100644 --- a/py/mpprint.h +++ b/py/mpprint.h @@ -71,4 +71,10 @@ int mp_printf(const mp_print_t *print, const char *fmt, ...); int mp_vprintf(const mp_print_t *print, const char *fmt, va_list args); #endif +struct compressed_string; +int mp_cprintf(const mp_print_t *print, const struct compressed_string *compressed_fmt, ...); +#ifdef va_start +int mp_vcprintf(const mp_print_t *print, const struct compressed_string *compressed_fmt, va_list args); +#endif + #endif // MICROPY_INCLUDED_PY_MPPRINT_H diff --git a/py/mpstate.h b/py/mpstate.h index 423463109d..38f1f5188d 100644 --- a/py/mpstate.h +++ b/py/mpstate.h @@ -120,6 +120,9 @@ typedef struct _mp_state_vm_t { qstr_pool_t *last_pool; + // non-heap memory for creating a traceback if we can't allocate RAM + mp_obj_traceback_t mp_emergency_traceback_obj; + // non-heap memory for creating an exception if we can't allocate RAM mp_obj_exception_t mp_emergency_exception_obj; @@ -137,10 +140,14 @@ typedef struct _mp_state_vm_t { #if MICROPY_KBD_EXCEPTION // exception object of type KeyboardInterrupt mp_obj_exception_t mp_kbd_exception; + // traceback object to store traceback + mp_obj_traceback_t mp_kbd_traceback; #endif // exception object of type ReloadException mp_obj_exception_t mp_reload_exception; + // traceback object to store traceback + mp_obj_traceback_t mp_reload_traceback; // dictionary with loaded modules (may be exposed as sys.modules) mp_obj_dict_t mp_loaded_modules_dict; diff --git a/py/obj.c b/py/obj.c index c8a1106a3d..fa3cd0c51c 100644 --- a/py/obj.c +++ b/py/obj.c @@ -143,41 +143,55 @@ void mp_obj_print(mp_obj_t o_in, mp_print_kind_t kind) { } // helper function to print an exception with traceback -void mp_obj_print_exception(const mp_print_t *print, mp_obj_t exc) { +void mp_obj_print_exception_with_limit(const mp_print_t *print, mp_obj_t exc, mp_int_t limit) { if (mp_obj_is_exception_instance(exc) && stack_ok()) { size_t n, *values; mp_obj_exception_get_traceback(exc, &n, &values); if (n > 0) { assert(n % 3 == 0); - // Decompress the format strings - const compressed_string_t *traceback = MP_ERROR_TEXT("Traceback (most recent call last):\n"); - char decompressed[decompress_length(traceback)]; - decompress(traceback, decompressed); #if MICROPY_ENABLE_SOURCE_LINE const compressed_string_t *frame = MP_ERROR_TEXT(" File \"%q\", line %d"); #else const compressed_string_t *frame = MP_ERROR_TEXT(" File \"%q\""); #endif - char decompressed_frame[decompress_length(frame)]; - decompress(frame, decompressed_frame); const compressed_string_t *block_fmt = MP_ERROR_TEXT(", in %q\n"); - char decompressed_block[decompress_length(block_fmt)]; - decompress(block_fmt, decompressed_block); + + // Set traceback formatting + // Default: Print full traceback + limit = limit * 3; + mp_int_t i = n - 3, j; + if (limit > 0) { + // Print upto limit traceback + // entries from caller's frame + if ((unsigned)limit > n) { + limit = n; + } + limit = n - limit; + } else if (limit < 0) { + // Print upto limit traceback + // entries from last + if ((unsigned)-limit > n) { + limit = -n; + } + i = 0, limit = limit + 3; + } // Print the traceback - mp_print_str(print, decompressed); - for (int i = n - 3; i >= 0; i -= 3) { + mp_cprintf(print, MP_ERROR_TEXT("Traceback (most recent call last):\n")); + + for (; i >= limit; i -= 3) { + j = (i < 0) ? -i : i; #if MICROPY_ENABLE_SOURCE_LINE - mp_printf(print, decompressed_frame, values[i], (int)values[i + 1]); + mp_cprintf(print, frame, values[j], (int)values[j + 1]); #else - mp_printf(print, decompressed_frame, values[i]); + mp_cprintf(print, frame, values[j]); #endif - // the block name can be NULL if it's unknown - qstr block = values[i + 2]; + // The block name can be NULL if it's unknown + qstr block = values[j + 2]; if (block == MP_QSTRnull) { mp_print_str(print, "\n"); } else { - mp_printf(print, decompressed_block, block); + mp_cprintf(print, block_fmt, block); } } } @@ -186,6 +200,10 @@ void mp_obj_print_exception(const mp_print_t *print, mp_obj_t exc) { mp_print_str(print, "\n"); } +void mp_obj_print_exception(const mp_print_t *print, mp_obj_t exc) { + mp_obj_print_exception_with_limit(print, exc, 0); +} + bool PLACE_IN_ITCM(mp_obj_is_true)(mp_obj_t arg) { if (arg == mp_const_false) { return 0; diff --git a/py/obj.h b/py/obj.h index b259128a2a..a043154ada 100644 --- a/py/obj.h +++ b/py/obj.h @@ -692,6 +692,7 @@ extern const mp_obj_type_t mp_type_bytearray; extern const mp_obj_type_t mp_type_memoryview; extern const mp_obj_type_t mp_type_float; extern const mp_obj_type_t mp_type_complex; +extern const mp_obj_type_t mp_type_traceback; extern const mp_obj_type_t mp_type_tuple; extern const mp_obj_type_t mp_type_list; extern const mp_obj_type_t mp_type_map; // map (the python builtin, not the dict implementation detail) @@ -791,6 +792,7 @@ extern const struct _mp_obj_bool_t mp_const_true_obj; extern const struct _mp_obj_str_t mp_const_empty_bytes_obj; extern const struct _mp_obj_tuple_t mp_const_empty_tuple_obj; extern const struct _mp_obj_dict_t mp_const_empty_dict_obj; +extern const struct _mp_obj_traceback_t mp_const_empty_traceback_obj; extern const struct _mp_obj_singleton_t mp_const_ellipsis_obj; extern const struct _mp_obj_singleton_t mp_const_notimplemented_obj; extern const struct _mp_obj_exception_t mp_const_GeneratorExit_obj; @@ -886,6 +888,7 @@ mp_obj_t mp_obj_cast_to_native_base(mp_obj_t self_in, mp_const_obj_t native_type void mp_obj_print_helper(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); void mp_obj_print(mp_obj_t o, mp_print_kind_t kind); void mp_obj_print_exception(const mp_print_t *print, mp_obj_t exc); +void mp_obj_print_exception_with_limit(const mp_print_t *print, mp_obj_t exc, mp_int_t limit); bool mp_obj_is_true(mp_obj_t arg); bool mp_obj_is_callable(mp_obj_t o_in); diff --git a/py/objexcept.c b/py/objexcept.c index d5a858a442..e572225bbc 100644 --- a/py/objexcept.c +++ b/py/objexcept.c @@ -156,7 +156,15 @@ mp_obj_t mp_obj_exception_make_new(const mp_obj_type_t *type, size_t n_args, con // Populate the exception object o_exc->base.type = type; - o_exc->traceback_data = NULL; + + // Try to allocate memory for the traceback, with fallback to emergency traceback object + o_exc->traceback = m_new_obj_maybe(mp_obj_traceback_t); + if (o_exc->traceback == NULL) { + o_exc->traceback = &MP_STATE_VM(mp_emergency_traceback_obj); + } + + // Populate the traceback object + *o_exc->traceback = mp_const_empty_traceback_obj; mp_obj_tuple_t *o_tuple; if (n_args == 0) { @@ -208,22 +216,25 @@ void mp_obj_exception_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) { mp_obj_exception_t *self = MP_OBJ_TO_PTR(self_in); if (dest[0] != MP_OBJ_NULL) { // store/delete attribute - if (attr == MP_QSTR___traceback__ && dest[1] == mp_const_none) { - // We allow 'exc.__traceback__ = None' assignment as low-level - // optimization of pre-allocating exception instance and raising - // it repeatedly - this avoids memory allocation during raise. - // However, uPy will keep adding traceback entries to such - // exception instance, so before throwing it, traceback should - // be cleared like above. - self->traceback_len = 0; + if (attr == MP_QSTR___traceback__) { + if (dest[1] == mp_const_none) { + self->traceback->data = NULL; + } else { + if (!mp_obj_is_type(dest[1], &mp_type_traceback)) { + mp_raise_TypeError(MP_ERROR_TEXT("invalid traceback")); + } + self->traceback = MP_OBJ_TO_PTR(dest[1]); + } dest[0] = MP_OBJ_NULL; // indicate success } return; } if (attr == MP_QSTR_args) { dest[0] = MP_OBJ_FROM_PTR(self->args); - } else if (self->base.type == &mp_type_StopIteration && attr == MP_QSTR_value) { + } else if (attr == MP_QSTR_value && self->base.type == &mp_type_StopIteration) { dest[0] = mp_obj_exception_get_value(self_in); + } else if (attr == MP_QSTR___traceback__) { + dest[0] = (self->traceback->data) ? MP_OBJ_FROM_PTR(self->traceback) : mp_const_none; #if MICROPY_CPYTHON_COMPAT } else if (mp_obj_is_subclass_fast(MP_OBJ_FROM_PTR(self->base.type), MP_OBJ_FROM_PTR(&mp_type_OSError))) { if (attr == MP_QSTR_errno) { @@ -454,12 +465,9 @@ mp_obj_t mp_obj_new_exception_msg_vlist(const mp_obj_type_t *exc_type, const com o_str->data = NULL; } else { // We have some memory to format the string. - // TODO: Optimise this to format-while-decompressing (and not require the temp stack space). struct _exc_printer_t exc_pr = {!used_emg_buf, o_str_alloc, 0, o_str_buf}; mp_print_t print = {&exc_pr, exc_add_strn}; - char fmt_decompressed[decompress_length(fmt)]; - decompress(fmt, fmt_decompressed); - mp_vprintf(&print, fmt_decompressed, ap); + mp_vcprintf(&print, fmt, ap); exc_pr.buf[exc_pr.len] = '\0'; o_str->len = exc_pr.len; o_str->data = exc_pr.buf; @@ -552,7 +560,7 @@ void mp_obj_exception_clear_traceback(mp_obj_t self_in) { GET_NATIVE_EXCEPTION(self, self_in); // just set the traceback to the null object // we don't want to call any memory management functions here - self->traceback_data = NULL; + self->traceback->data = NULL; } void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, size_t line, qstr block) { @@ -561,16 +569,16 @@ void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, size_t line, qs // append this traceback info to traceback data // if memory allocation fails (eg because gc is locked), just return - if (self->traceback_data == NULL) { - self->traceback_data = m_new_maybe(size_t, TRACEBACK_ENTRY_LEN); - if (self->traceback_data == NULL) { + if (self->traceback->data == NULL) { + self->traceback->data = m_new_maybe(size_t, TRACEBACK_ENTRY_LEN); + if (self->traceback->data == NULL) { #if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF if (mp_emergency_exception_buf_size >= (mp_int_t)(EMG_BUF_TRACEBACK_OFFSET + EMG_BUF_TRACEBACK_SIZE)) { // There is room in the emergency buffer for traceback data size_t *tb = (size_t *)((uint8_t *)MP_STATE_VM(mp_emergency_exception_buf) + EMG_BUF_TRACEBACK_OFFSET); - self->traceback_data = tb; - self->traceback_alloc = EMG_BUF_TRACEBACK_SIZE / sizeof(size_t); + self->traceback->data = tb; + self->traceback->alloc = EMG_BUF_TRACEBACK_SIZE / sizeof(size_t); } else { // Can't allocate and no room in emergency buffer return; @@ -581,28 +589,28 @@ void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, size_t line, qs #endif } else { // Allocated the traceback data on the heap - self->traceback_alloc = TRACEBACK_ENTRY_LEN; + self->traceback->alloc = TRACEBACK_ENTRY_LEN; } - self->traceback_len = 0; - } else if (self->traceback_len + TRACEBACK_ENTRY_LEN > self->traceback_alloc) { + self->traceback->len = 0; + } else if (self->traceback->len + TRACEBACK_ENTRY_LEN > self->traceback->alloc) { #if MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF - if (self->traceback_data == (size_t *)MP_STATE_VM(mp_emergency_exception_buf)) { + if (self->traceback->data == (size_t *)MP_STATE_VM(mp_emergency_exception_buf)) { // Can't resize the emergency buffer return; } #endif // be conservative with growing traceback data - size_t *tb_data = m_renew_maybe(size_t, self->traceback_data, self->traceback_alloc, - self->traceback_alloc + TRACEBACK_ENTRY_LEN, true); + size_t *tb_data = m_renew_maybe(size_t, self->traceback->data, self->traceback->alloc, + self->traceback->alloc + TRACEBACK_ENTRY_LEN, true); if (tb_data == NULL) { return; } - self->traceback_data = tb_data; - self->traceback_alloc += TRACEBACK_ENTRY_LEN; + self->traceback->data = tb_data; + self->traceback->alloc += TRACEBACK_ENTRY_LEN; } - size_t *tb_data = &self->traceback_data[self->traceback_len]; - self->traceback_len += TRACEBACK_ENTRY_LEN; + size_t *tb_data = &self->traceback->data[self->traceback->len]; + self->traceback->len += TRACEBACK_ENTRY_LEN; tb_data[0] = file; tb_data[1] = line; tb_data[2] = block; @@ -611,12 +619,12 @@ void mp_obj_exception_add_traceback(mp_obj_t self_in, qstr file, size_t line, qs void mp_obj_exception_get_traceback(mp_obj_t self_in, size_t *n, size_t **values) { GET_NATIVE_EXCEPTION(self, self_in); - if (self->traceback_data == NULL) { + if (self->traceback->data == NULL) { *n = 0; *values = NULL; } else { - *n = self->traceback_len; - *values = self->traceback_data; + *n = self->traceback->len; + *values = self->traceback->data; } } diff --git a/py/objexcept.h b/py/objexcept.h index d7b39add87..261885e54d 100644 --- a/py/objexcept.h +++ b/py/objexcept.h @@ -28,13 +28,12 @@ #include "py/obj.h" #include "py/objtuple.h" +#include "py/objtraceback.h" typedef struct _mp_obj_exception_t { mp_obj_base_t base; - size_t traceback_alloc : (8 * sizeof(size_t) / 2); - size_t traceback_len : (8 * sizeof(size_t) / 2); - size_t *traceback_data; mp_obj_tuple_t *args; + mp_obj_traceback_t *traceback; } mp_obj_exception_t; void mp_obj_exception_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind); diff --git a/py/objfun.c b/py/objfun.c index 115957e09c..23698ad95c 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -182,7 +182,7 @@ qstr mp_obj_fun_get_name(mp_const_obj_t fun_in) { STATIC void fun_bc_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { (void)kind; mp_obj_fun_bc_t *o = MP_OBJ_TO_PTR(o_in); - mp_printf(print, "", mp_obj_fun_get_name(o_in), o); + mp_printf(print, "", mp_obj_fun_get_name(o_in), o); } #endif diff --git a/py/objgenerator.c b/py/objgenerator.c index 2139e4478a..f7bf235848 100644 --- a/py/objgenerator.c +++ b/py/objgenerator.c @@ -38,7 +38,7 @@ #include "supervisor/shared/translate.h" // Instance of GeneratorExit exception - needed by generator.close() -const mp_obj_exception_t mp_const_GeneratorExit_obj = {{&mp_type_GeneratorExit}, 0, 0, NULL, (mp_obj_tuple_t *)&mp_const_empty_tuple_obj}; +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}; /******************************************************************************/ /* generator wrapper */ @@ -185,11 +185,13 @@ STATIC void gen_instance_print(const mp_print_t *print, mp_obj_t self_in, mp_pri mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in); #if MICROPY_PY_ASYNC_AWAIT if (self->coroutine_generator) { - mp_printf(print, "", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); - return; + mp_printf(print, "<%q object '%q' at %p>", MP_QSTR_coroutine, mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); + } else { + mp_printf(print, "<%q object '%q' at %p>", MP_QSTR_generator, mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); } - #endif + #else mp_printf(print, "", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self); + #endif } mp_vm_return_kind_t mp_obj_gen_resume(mp_obj_t self_in, mp_obj_t send_value, mp_obj_t throw_value, mp_obj_t *ret_val) { diff --git a/py/objmodule.c b/py/objmodule.c index 8fa36ab42e..ea10fb8ba2 100644 --- a/py/objmodule.c +++ b/py/objmodule.c @@ -161,9 +161,6 @@ STATIC const mp_rom_map_elem_t mp_builtin_module_table[] = { { MP_ROM_QSTR(MP_QSTR_builtins), MP_ROM_PTR(&mp_module_builtins) }, { MP_ROM_QSTR(MP_QSTR_micropython), MP_ROM_PTR(&mp_module_micropython) }, - #if MICROPY_PY_ARRAY - { MP_ROM_QSTR(MP_QSTR_array), MP_ROM_PTR(&mp_module_array) }, - #endif #if MICROPY_PY_IO #if CIRCUITPY { MP_ROM_QSTR(MP_QSTR_io), MP_ROM_PTR(&mp_module_io) }, diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 47d695cf6a..eb79d54991 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -41,6 +41,13 @@ STATIC mp_obj_t mp_obj_new_str_iterator(mp_obj_t str, mp_obj_iter_buf_t *iter_bu /******************************************************************************/ /* str */ + +// These settings approximate CPython's printability. It is not +// exhaustive and may print "unprintable" characters. All ASCII control codes +// are escaped along with variable space widths and paragraph designators. +// Unlike CPython, we do not escape private use codes or reserved characters. +// We assume that the unicode is well formed. +// CPython policy is documented here: https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Objects/unicodectype.c#L147-L159 STATIC void uni_print_quoted(const mp_print_t *print, const byte *str_data, uint str_len) { // this escapes characters, but it will be very slow to print (calling print many times) bool has_single_quote = false; @@ -61,25 +68,26 @@ STATIC void uni_print_quoted(const mp_print_t *print, const byte *str_data, uint while (s < top) { unichar ch; ch = utf8_get_char(s); + const byte *start = s; s = utf8_next_char(s); if (ch == quote_char) { mp_printf(print, "\\%c", quote_char); } else if (ch == '\\') { mp_print_str(print, "\\\\"); - } else if (32 <= ch && ch <= 126) { - mp_printf(print, "%c", ch); } else if (ch == '\n') { mp_print_str(print, "\\n"); } else if (ch == '\r') { mp_print_str(print, "\\r"); } else if (ch == '\t') { mp_print_str(print, "\\t"); - } else if (ch < 0x100) { + } else if (ch <= 0x1f || (0x7f <= ch && ch <= 0xa0) || ch == 0xad) { mp_printf(print, "\\x%02x", ch); - } else if (ch < 0x10000) { + } else if ((0x2000 <= ch && ch <= 0x200f) || ch == 0x2028 || ch == 0x2029) { mp_printf(print, "\\u%04x", ch); } else { - mp_printf(print, "\\U%08x", ch); + // Print the full character out. + int width = s - start; + mp_print_strn(print, (const char *)start, width, 0, ' ', width); } } mp_printf(print, "%c", quote_char); diff --git a/py/objtraceback.c b/py/objtraceback.c new file mode 100644 index 0000000000..989521a0a6 --- /dev/null +++ b/py/objtraceback.c @@ -0,0 +1,42 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/runtime.h" +#include "py/objtraceback.h" + +const mp_obj_traceback_t mp_const_empty_traceback_obj = {{&mp_type_traceback}, 0, 0, NULL}; + +STATIC void mp_obj_traceback_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t kind) { + (void)kind; + mp_obj_traceback_t *o = MP_OBJ_TO_PTR(o_in); + mp_printf(print, "<%q object at %p>", MP_QSTR_traceback, o); +} + +const mp_obj_type_t mp_type_traceback = { + { &mp_type_type }, + .name = MP_QSTR_traceback, + .print = mp_obj_traceback_print, +}; diff --git a/py/objtraceback.h b/py/objtraceback.h new file mode 100644 index 0000000000..992fe89b01 --- /dev/null +++ b/py/objtraceback.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_PY_OBJTRACEBACK_H +#define MICROPY_INCLUDED_PY_OBJTRACEBACK_H + +#include "py/obj.h" + +typedef struct _mp_obj_traceback_t { + mp_obj_base_t base; + size_t alloc : (8 * sizeof(size_t) / 2); + size_t len : (8 * sizeof(size_t) / 2); + size_t *data; +} mp_obj_traceback_t; + +#endif // MICROPY_INCLUDED_PY_OBJTRACEBACK_H diff --git a/py/profile.c b/py/profile.c index e5fb35f0ed..2e59b97703 100644 --- a/py/profile.c +++ b/py/profile.c @@ -68,7 +68,7 @@ STATIC void code_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t k const mp_raw_code_t *rc = o->rc; const mp_bytecode_prelude_t *prelude = &rc->prelude; mp_printf(print, - "", + "", prelude->qstr_block_name, o, prelude->qstr_source_file, @@ -202,7 +202,7 @@ STATIC void frame_print(const mp_print_t *print, mp_obj_t o_in, mp_print_kind_t const mp_raw_code_t *rc = code->rc; const mp_bytecode_prelude_t *prelude = &rc->prelude; mp_printf(print, - "", + "", frame, prelude->qstr_source_file, frame->lineno, @@ -950,7 +950,7 @@ void mp_prof_print_instr(const byte *ip, mp_code_state_t *code_state) { /* long path */ if (1) { mp_printf(&mp_plat_print, - "@0x%p:%q:%q+0x%04x:%d", + "@%p:%q:%q+0x%04x:%d", ip, prelude->qstr_source_file, prelude->qstr_block_name, diff --git a/py/py.cmake b/py/py.cmake index 2b5d437b57..6f0514e0e3 100644 --- a/py/py.cmake +++ b/py/py.cmake @@ -95,6 +95,7 @@ set(MICROPY_SOURCE_PY ${MICROPY_PY_DIR}/objstr.c ${MICROPY_PY_DIR}/objstringio.c ${MICROPY_PY_DIR}/objstrunicode.c + ${MICROPY_PY_DIR}/objtraceback.c ${MICROPY_PY_DIR}/objtuple.c ${MICROPY_PY_DIR}/objtype.c ${MICROPY_PY_DIR}/objzip.c diff --git a/py/py.mk b/py/py.mk index 94ac82f6f0..7c3eaf4f46 100644 --- a/py/py.mk +++ b/py/py.mk @@ -153,6 +153,7 @@ PY_CORE_O_BASENAME = $(addprefix py/,\ objstr.o \ objstrunicode.o \ objstringio.o \ + objtraceback.o \ objtuple.o \ objtype.o \ objzip.o \ diff --git a/py/qstr.c b/py/qstr.c index 230a230909..d7b05930f7 100644 --- a/py/qstr.c +++ b/py/qstr.c @@ -76,8 +76,11 @@ mp_uint_t qstr_compute_hash(const byte *data, size_t len) { } return hash; } - -const qstr_attr_t mp_qstr_const_attr[] = { +#ifndef CIRCUITPY_PRECOMPUTE_QSTR_ATTR +#define CIRCUITPY_PRECOMPUTE_QSTR_ATTR (1) +#endif +#if CIRCUITPY_PRECOMPUTE_QSTR_ATTR == 1 +const qstr_attr_t mp_qstr_const_attr[MP_QSTRnumber_of] = { #ifndef NO_QSTR #define QDEF(id, hash, len, str) { hash, len }, #define TRANSLATION(id, length, compressed ...) @@ -86,6 +89,9 @@ const qstr_attr_t mp_qstr_const_attr[] = { #undef QDEF #endif }; +#else +qstr_attr_t mp_qstr_const_attr[MP_QSTRnumber_of]; +#endif const qstr_pool_t mp_qstr_const_pool = { NULL, // no previous pool @@ -115,6 +121,16 @@ void qstr_init(void) { MP_STATE_VM(last_pool) = (qstr_pool_t *)&CONST_POOL; // we won't modify the const_pool since it has no allocated room left MP_STATE_VM(qstr_last_chunk) = NULL; + #if CIRCUITPY_PRECOMPUTE_QSTR_ATTR == 0 + if (mp_qstr_const_attr[MP_QSTR_circuitpython].len == 0) { + for (size_t i = 0; i < mp_qstr_const_pool.len; i++) { + size_t len = strlen(mp_qstr_const_pool.qstrs[i]); + mp_qstr_const_attr[i].hash = qstr_compute_hash((const byte *)mp_qstr_const_pool.qstrs[i], len); + mp_qstr_const_attr[i].len = len; + } + } + #endif + #if MICROPY_PY_THREAD && !MICROPY_PY_THREAD_GIL mp_thread_mutex_init(&MP_STATE_VM(qstr_mutex)); #endif diff --git a/py/runtime.c b/py/runtime.c index ceb5e83b14..55f26021ab 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -79,17 +79,15 @@ void mp_init(void) { #if MICROPY_KBD_EXCEPTION // initialise the exception object for raising KeyboardInterrupt MP_STATE_VM(mp_kbd_exception).base.type = &mp_type_KeyboardInterrupt; - MP_STATE_VM(mp_kbd_exception).traceback_alloc = 0; - MP_STATE_VM(mp_kbd_exception).traceback_len = 0; - MP_STATE_VM(mp_kbd_exception).traceback_data = NULL; MP_STATE_VM(mp_kbd_exception).args = (mp_obj_tuple_t *)&mp_const_empty_tuple_obj; + MP_STATE_VM(mp_kbd_exception).traceback = &MP_STATE_VM(mp_kbd_traceback); + *MP_STATE_VM(mp_kbd_exception).traceback = mp_const_empty_traceback_obj; #endif MP_STATE_VM(mp_reload_exception).base.type = &mp_type_ReloadException; - MP_STATE_VM(mp_reload_exception).traceback_alloc = 0; - MP_STATE_VM(mp_reload_exception).traceback_len = 0; - MP_STATE_VM(mp_reload_exception).traceback_data = NULL; MP_STATE_VM(mp_reload_exception).args = (mp_obj_tuple_t *)&mp_const_empty_tuple_obj; + MP_STATE_VM(mp_reload_exception).traceback = &MP_STATE_VM(mp_reload_traceback); + *MP_STATE_VM(mp_reload_exception).traceback = mp_const_empty_traceback_obj; // call port specific initialization if any #ifdef MICROPY_PORT_INIT_FUNC diff --git a/py/runtime.h b/py/runtime.h index fc6434ca72..b93f484ec8 100644 --- a/py/runtime.h +++ b/py/runtime.h @@ -95,7 +95,7 @@ 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); mp_float_t mp_arg_validate_obj_float_non_negative(mp_obj_t float_in, mp_float_t default_for_null, qstr arg_name); -size_t mp_arg_validate_length_with_name(mp_int_t i, size_t length, qstr arg_name, qstr length_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_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); diff --git a/py/scheduler.c b/py/scheduler.c index f11317dc1d..733722e46a 100644 --- a/py/scheduler.c +++ b/py/scheduler.c @@ -40,7 +40,7 @@ void MICROPY_WRAP_MP_SCHED_EXCEPTION(mp_sched_exception)(mp_obj_t exc) { #if MICROPY_KBD_EXCEPTION // This function may be called asynchronously at any time so only do the bare minimum. void MICROPY_WRAP_MP_SCHED_KEYBOARD_INTERRUPT(mp_sched_keyboard_interrupt)(void) { - MP_STATE_VM(mp_kbd_exception).traceback_data = NULL; + MP_STATE_VM(mp_kbd_exception).traceback->data = NULL; mp_sched_exception(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))); } #endif diff --git a/requirements-dev.txt b/requirements-dev.txt index 6db56d8940..c3b33f8713 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -7,6 +7,7 @@ jinja2 typer requests +requests-cache sh click setuptools diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 8262830aee..c126ee79f2 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -197,10 +197,10 @@ const mp_obj_property_t bleio_adapter_name_obj = { //| """Starts advertising until `stop_advertising` is called or if connectable, another device //| connects to us. //| -//| .. warning: If data is longer than 31 bytes, then this will automatically advertise as an +//| .. warning:: If data is longer than 31 bytes, then this will automatically advertise as an //| extended advertisement that older BLE 4.x clients won't be able to scan for. //| -//| .. note: If you set ``anonymous=True``, then a timeout must be specified. If no timeout is +//| .. note:: If you set ``anonymous=True``, then a timeout must be specified. If no timeout is //| specified, then the maximum allowed timeout will be selected automatically. //| //| :param ~_typing.ReadableBuffer data: advertising data packet bytes diff --git a/shared-bindings/_bleio/__init__.c b/shared-bindings/_bleio/__init__.c index c89a787d2e..72d96846aa 100644 --- a/shared-bindings/_bleio/__init__.c +++ b/shared-bindings/_bleio/__init__.c @@ -201,3 +201,5 @@ const mp_obj_module_t bleio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&bleio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR__bleio, bleio_module, CIRCUITPY_BLEIO); diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index dc68c946de..001c1d3197 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -1105,3 +1105,5 @@ const mp_obj_module_t _eve_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&mp_module__eve_globals, }; + +MP_REGISTER_MODULE(MP_QSTR__eve, _eve_module, CIRCUITPY__EVE); diff --git a/shared-bindings/_pew/__init__.c b/shared-bindings/_pew/__init__.c index 2ecf341900..e338869d18 100644 --- a/shared-bindings/_pew/__init__.c +++ b/shared-bindings/_pew/__init__.c @@ -63,3 +63,5 @@ const mp_obj_module_t pew_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&pew_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR__pew, pew_module, CIRCUITPY_PEW); diff --git a/shared-bindings/_stage/__init__.c b/shared-bindings/_stage/__init__.c index 9505c3a4de..1d5c06c862 100644 --- a/shared-bindings/_stage/__init__.c +++ b/shared-bindings/_stage/__init__.c @@ -111,3 +111,5 @@ const mp_obj_module_t stage_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&stage_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR__stage, stage_module, CIRCUITPY_STAGE); diff --git a/shared-bindings/adafruit_bus_device/__init__.c b/shared-bindings/adafruit_bus_device/__init__.c index 84abbd0c2e..f25a882557 100644 --- a/shared-bindings/adafruit_bus_device/__init__.c +++ b/shared-bindings/adafruit_bus_device/__init__.c @@ -76,3 +76,5 @@ const mp_obj_module_t adafruit_bus_device_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&adafruit_bus_device_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_adafruit_bus_device, adafruit_bus_device_module, CIRCUITPY_BUSDEVICE); diff --git a/shared-bindings/adafruit_pixelbuf/__init__.c b/shared-bindings/adafruit_pixelbuf/__init__.c index 1f4ecb8ae1..7b8d0da829 100644 --- a/shared-bindings/adafruit_pixelbuf/__init__.c +++ b/shared-bindings/adafruit_pixelbuf/__init__.c @@ -54,3 +54,5 @@ const mp_obj_module_t pixelbuf_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&pixelbuf_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_adafruit_pixelbuf, pixelbuf_module, CIRCUITPY_PIXELBUF); diff --git a/shared-bindings/aesio/__init__.c b/shared-bindings/aesio/__init__.c index 80913b70ad..716d20393e 100644 --- a/shared-bindings/aesio/__init__.c +++ b/shared-bindings/aesio/__init__.c @@ -63,3 +63,5 @@ const mp_obj_module_t aesio_module = { .base = {&mp_type_module}, .globals = (mp_obj_dict_t *)&aesio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_aesio, aesio_module, CIRCUITPY_AESIO); diff --git a/shared-bindings/alarm/__init__.c b/shared-bindings/alarm/__init__.c index ca84d4878c..2f5e36148b 100644 --- a/shared-bindings/alarm/__init__.c +++ b/shared-bindings/alarm/__init__.c @@ -248,3 +248,5 @@ extern void port_idle_until_interrupt(void); MP_WEAK void common_hal_alarm_pretending_deep_sleep(void) { port_idle_until_interrupt(); } + +MP_REGISTER_MODULE(MP_QSTR_alarm, alarm_module, CIRCUITPY_ALARM); diff --git a/shared-bindings/analogio/__init__.c b/shared-bindings/analogio/__init__.c index 4e5aebf010..51f8a21537 100644 --- a/shared-bindings/analogio/__init__.c +++ b/shared-bindings/analogio/__init__.c @@ -72,3 +72,5 @@ const mp_obj_module_t analogio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&analogio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_analogio, analogio_module, CIRCUITPY_ANALOGIO); diff --git a/shared-bindings/atexit/__init__.c b/shared-bindings/atexit/__init__.c new file mode 100644 index 0000000000..e6d1372ccf --- /dev/null +++ b/shared-bindings/atexit/__init__.c @@ -0,0 +1,95 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-module/atexit/__init__.h" + +//| """Atexit Module +//| +//| This module defines functions to register and unregister cleanup functions. +//| Functions thus registered are automatically executed upon normal vm termination. +//| +//| 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``. +//| +//| """ +//| ... +//| + +//| def register(func: Callable[..., Any], *args: Optional[Any], **kwargs: Optional[Any]) -> Callable[..., Any]: +//| +//| """Register func as a function to be executed at termination. +//| +//| Any optional arguments that are to be passed to func must be passed as arguments to `register()`. +//| It is possible to register the same function and arguments more than once. +//| +//| At normal program termination (for instance, if `sys.exit()` is called or the vm execution completes), +//| all functions registered are called in last in, first out order. +//| +//| If an exception is raised during execution of the exit handler, +//| a traceback is printed (unless `SystemExit` is raised) and the execution stops. +//| +//| This function returns func, which makes it possible to use it as a decorator. +//| +//| """ +//| ... +//| +STATIC mp_obj_t atexit_register(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + shared_module_atexit_register(pos_args[0], (n_args - 1), ((n_args > 1) ? &pos_args[1] : NULL), kw_args); + return pos_args[0]; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(atexit_register_obj, 1, atexit_register); + +//| def unregister(func: Callable[..., Any]) -> None: +//| +//| """Remove func from the list of functions to be run at termination. +//| +//| `unregister()` silently does nothing if func was not previously registered. If func has been registered more than once, +//| every occurrence of that function in the atexit call stack will be removed. +//| +//| """ +//| ... +//| +STATIC mp_obj_t atexit_unregister(const mp_obj_t self_in) { + shared_module_atexit_unregister(&self_in); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_1(atexit_unregister_obj, atexit_unregister); + +STATIC const mp_rom_map_elem_t atexit_module_globals_table[] = { + // module name + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_atexit) }, + // module functions + { MP_ROM_QSTR(MP_QSTR_register), MP_ROM_PTR(&atexit_register_obj) }, + { MP_ROM_QSTR(MP_QSTR_unregister), MP_ROM_PTR(&atexit_unregister_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(atexit_module_globals, atexit_module_globals_table); + +const mp_obj_module_t atexit_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&atexit_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_atexit, atexit_module, CIRCUITPY_ATEXIT); diff --git a/shared-bindings/audiobusio/__init__.c b/shared-bindings/audiobusio/__init__.c index 23e246ec22..0476443768 100644 --- a/shared-bindings/audiobusio/__init__.c +++ b/shared-bindings/audiobusio/__init__.c @@ -58,3 +58,5 @@ const mp_obj_module_t audiobusio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&audiobusio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_audiobusio, audiobusio_module, CIRCUITPY_AUDIOBUSIO); diff --git a/shared-bindings/audiocore/WaveFile.c b/shared-bindings/audiocore/WaveFile.c index ebf8a7807e..c46976229e 100644 --- a/shared-bindings/audiocore/WaveFile.c +++ b/shared-bindings/audiocore/WaveFile.c @@ -38,13 +38,16 @@ //| //| A .wav file prepped for audio playback. Only mono and stereo files are supported. Samples must //| be 8 bit unsigned or 16 bit signed. If a buffer is provided, it will be used instead of allocating -//| an internal buffer.""" +//| an internal buffer, which can prevent memory fragmentation.""" //| //| def __init__(self, file: typing.BinaryIO, buffer: WriteableBuffer) -> None: //| """Load a .wav file for playback with `audioio.AudioOut` or `audiobusio.I2SOut`. //| //| :param typing.BinaryIO file: Already opened wave file -//| :param ~_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 256 byte buffers are allocated internally. +//| :param ~_typing.WriteableBuffer buffer: Optional pre-allocated buffer, +//| that will be split in half and used for double-buffering of the data. +//| The buffer must be 8 to 1024 bytes long. +//| If not provided, two 256 byte buffers are initially allocated internally. //| //| //| Playing a wave file from flash:: @@ -83,7 +86,7 @@ STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_ar mp_buffer_info_t bufinfo; mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE); buffer = bufinfo.buf; - buffer_size = bufinfo.len; + buffer_size = mp_arg_validate_length_range(bufinfo.len, 8, 1024, MP_QSTR_buffer); } common_hal_audioio_wavefile_construct(self, MP_OBJ_TO_PTR(args[0]), buffer, buffer_size); diff --git a/shared-bindings/audiocore/__init__.c b/shared-bindings/audiocore/__init__.c index 9fe4a81c4c..f03c64ccf8 100644 --- a/shared-bindings/audiocore/__init__.c +++ b/shared-bindings/audiocore/__init__.c @@ -50,3 +50,5 @@ const mp_obj_module_t audiocore_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&audiocore_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_audiocore, audiocore_module, CIRCUITPY_AUDIOCORE); diff --git a/shared-bindings/audioio/__init__.c b/shared-bindings/audioio/__init__.c index 426f756d44..9f8411f484 100644 --- a/shared-bindings/audioio/__init__.c +++ b/shared-bindings/audioio/__init__.c @@ -61,3 +61,5 @@ const mp_obj_module_t audioio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&audioio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_audioio, audioio_module, CIRCUITPY_AUDIOIO); diff --git a/shared-bindings/audiomixer/__init__.c b/shared-bindings/audiomixer/__init__.c index 9d0bf676fc..a29d4f18ef 100644 --- a/shared-bindings/audiomixer/__init__.c +++ b/shared-bindings/audiomixer/__init__.c @@ -46,3 +46,5 @@ const mp_obj_module_t audiomixer_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&audiomixer_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_audiomixer, audiomixer_module, CIRCUITPY_AUDIOMIXER); diff --git a/shared-bindings/audiomp3/__init__.c b/shared-bindings/audiomp3/__init__.c index 29bdd0bb21..d6c408b143 100644 --- a/shared-bindings/audiomp3/__init__.c +++ b/shared-bindings/audiomp3/__init__.c @@ -45,3 +45,5 @@ const mp_obj_module_t audiomp3_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&audiomp3_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_audiomp3, audiomp3_module, CIRCUITPY_AUDIOMP3); diff --git a/shared-bindings/audiopwmio/__init__.c b/shared-bindings/audiopwmio/__init__.c index 2bafb608a4..41a756e8b6 100644 --- a/shared-bindings/audiopwmio/__init__.c +++ b/shared-bindings/audiopwmio/__init__.c @@ -57,3 +57,5 @@ const mp_obj_module_t audiopwmio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&audiopwmio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_audiopwmio, audiopwmio_module, CIRCUITPY_AUDIOPWMIO); diff --git a/shared-bindings/bitbangio/I2C.c b/shared-bindings/bitbangio/I2C.c index f6be845473..9f39e84061 100644 --- a/shared-bindings/bitbangio/I2C.c +++ b/shared-bindings/bitbangio/I2C.c @@ -217,7 +217,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a } MP_DEFINE_CONST_FUN_OBJ_KW(bitbangio_i2c_readfrom_into_obj, 3, bitbangio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None, stop: bool = True) -> None: +//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: //| """Write the bytes from ``buffer`` to the device selected by ``address`` and then transmits a //| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start //| before a read. diff --git a/shared-bindings/bitbangio/OneWire.c b/shared-bindings/bitbangio/OneWire.c deleted file mode 100644 index 15cf833242..0000000000 --- a/shared-bindings/bitbangio/OneWire.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * This file is part of the Micro Python 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 - -#include "lib/utils/context_manager_helpers.h" -#include "py/objproperty.h" -#include "py/runtime.h" -#include "py/runtime0.h" -#include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/bitbangio/OneWire.h" -#include "shared-bindings/util.h" - -//| class OneWire: -//| """Lowest-level of the Maxim OneWire protocol -//| -//| :class:`~bitbangio.OneWire` implements the timing-sensitive foundation of -//| the Maxim (formerly Dallas Semi) OneWire protocol. -//| -//| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126""" -//| -//| def __init__(self, pin: microcontroller.Pin) -> None: -//| -//| """Create a OneWire object associated with the given pin. The object -//| implements the lowest level timing-sensitive bits of the protocol. -//| -//| :param ~microcontroller.Pin pin: Pin to read pulses from. -//| -//| Read a short series of pulses:: -//| -//| import bitbangio -//| import board -//| -//| onewire = bitbangio.OneWire(board.D7) -//| onewire.reset() -//| onewire.write_bit(True) -//| onewire.write_bit(False) -//| print(onewire.read_bit())""" -//| ... -//| -STATIC mp_obj_t bitbangio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_pin }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, - }; - 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 mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); - - bitbangio_onewire_obj_t *self = m_new_obj(bitbangio_onewire_obj_t); - self->base.type = &bitbangio_onewire_type; - - shared_module_bitbangio_onewire_construct(self, pin); - return MP_OBJ_FROM_PTR(self); -} - -//| def deinit(self) -> None: -//| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" -//| ... -//| -STATIC mp_obj_t bitbangio_onewire_deinit(mp_obj_t self_in) { - bitbangio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); - shared_module_bitbangio_onewire_deinit(self); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_onewire_deinit_obj, bitbangio_onewire_deinit); - -STATIC void check_for_deinit(bitbangio_onewire_obj_t *self) { - if (shared_module_bitbangio_onewire_deinited(self)) { - raise_deinited_error(); - } -} - -//| def __enter__(self) -> OneWire: -//| """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 bitbangio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) { - (void)n_args; - shared_module_bitbangio_onewire_deinit(args[0]); - return mp_const_none; -} -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitbangio_onewire___exit___obj, 4, 4, bitbangio_onewire_obj___exit__); - -//| def reset(self) -> bool: -//| """Reset the OneWire bus""" -//| ... -//| -STATIC mp_obj_t bitbangio_onewire_obj_reset(mp_obj_t self_in) { - bitbangio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return mp_obj_new_bool(shared_module_bitbangio_onewire_reset(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_onewire_reset_obj, bitbangio_onewire_obj_reset); - -//| def read_bit(self) -> bool: -//| """Read in a bit -//| -//| :returns: bit state read -//| :rtype: bool""" -//| ... -//| -STATIC mp_obj_t bitbangio_onewire_obj_read_bit(mp_obj_t self_in) { - bitbangio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - return mp_obj_new_bool(shared_module_bitbangio_onewire_read_bit(self)); -} -MP_DEFINE_CONST_FUN_OBJ_1(bitbangio_onewire_read_bit_obj, bitbangio_onewire_obj_read_bit); - -//| def write_bit(self, value: bool) -> None: -//| """Write out a bit based on value.""" -//| ... -//| -STATIC mp_obj_t bitbangio_onewire_obj_write_bit(mp_obj_t self_in, mp_obj_t bool_obj) { - bitbangio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); - check_for_deinit(self); - - shared_module_bitbangio_onewire_write_bit(self, mp_obj_is_true(bool_obj)); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_2(bitbangio_onewire_write_bit_obj, bitbangio_onewire_obj_write_bit); - -STATIC const mp_rom_map_elem_t bitbangio_onewire_locals_dict_table[] = { - // Methods - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&bitbangio_onewire_deinit_obj) }, - { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&bitbangio_onewire___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&bitbangio_onewire_reset_obj) }, - { MP_ROM_QSTR(MP_QSTR_read_bit), MP_ROM_PTR(&bitbangio_onewire_read_bit_obj) }, - { MP_ROM_QSTR(MP_QSTR_write_bit), MP_ROM_PTR(&bitbangio_onewire_write_bit_obj) }, -}; -STATIC MP_DEFINE_CONST_DICT(bitbangio_onewire_locals_dict, bitbangio_onewire_locals_dict_table); - -const mp_obj_type_t bitbangio_onewire_type = { - { &mp_type_type }, - .name = MP_QSTR_OneWire, - .make_new = bitbangio_onewire_make_new, - .locals_dict = (mp_obj_dict_t *)&bitbangio_onewire_locals_dict, -}; diff --git a/shared-bindings/bitbangio/__init__.c b/shared-bindings/bitbangio/__init__.c index 81e9d91a37..57348a3c1e 100644 --- a/shared-bindings/bitbangio/__init__.c +++ b/shared-bindings/bitbangio/__init__.c @@ -34,7 +34,7 @@ #include "shared-bindings/bitbangio/__init__.h" #include "shared-bindings/bitbangio/I2C.h" -#include "shared-bindings/bitbangio/OneWire.h" +#include "shared-bindings/onewireio/OneWire.h" #include "shared-bindings/bitbangio/SPI.h" #include "py/runtime.h" @@ -72,7 +72,9 @@ 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) }, - { MP_ROM_QSTR(MP_QSTR_OneWire), MP_ROM_PTR(&bitbangio_onewire_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) }, }; @@ -82,3 +84,5 @@ const mp_obj_module_t bitbangio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&bitbangio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_bitbangio, bitbangio_module, CIRCUITPY_BITBANGIO); diff --git a/shared-bindings/bitmaptools/__init__.c b/shared-bindings/bitmaptools/__init__.c index 2a5195d1a4..4e14a061f0 100644 --- a/shared-bindings/bitmaptools/__init__.c +++ b/shared-bindings/bitmaptools/__init__.c @@ -296,6 +296,68 @@ STATIC mp_obj_t bitmaptools_obj_fill_region(size_t n_args, const mp_obj_t *pos_a } MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_fill_region_obj, 0, bitmaptools_obj_fill_region); +//| +//| def boundary_fill( +//| dest_bitmap: displayio.Bitmap, +//| x: int, y: int, +//| fill_color_value: int, replaced_color_value: int) -> None: +//| """Draws the color value into the destination bitmap enclosed +//| area of pixels of the background_value color. Like "Paint Bucket" +//| fill tool. +//| +//| :param bitmap dest_bitmap: Destination bitmap that will be written into +//| :param int x: x-pixel position of the first pixel to check and fill if needed +//| :param int y: y-pixel position of the first pixel to check and fill if needed +//| :param int fill_color_value: Bitmap palette index that will be written into the +//| enclosed area in the destination bitmap +//| :param int replaced_color_value: Bitmap palette index that will filled with the +//| value color in the enclosed area in the destination bitmap""" +//| ... +//| +STATIC mp_obj_t bitmaptools_obj_boundary_fill(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum {ARG_dest_bitmap, ARG_x, ARG_y, ARG_fill_color_value, ARG_replaced_color_value}; + + static const mp_arg_t allowed_args[] = { + {MP_QSTR_dest_bitmap, MP_ARG_REQUIRED | MP_ARG_OBJ}, + {MP_QSTR_x, MP_ARG_REQUIRED | MP_ARG_INT}, + {MP_QSTR_y, MP_ARG_REQUIRED | MP_ARG_INT}, + {MP_QSTR_fill_color_value, MP_ARG_REQUIRED | MP_ARG_INT}, + {MP_QSTR_replaced_color_value, MP_ARG_INT, {.u_int = INT_MAX} }, + }; + 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); + + displayio_bitmap_t *destination = MP_OBJ_TO_PTR(mp_arg_validate_type(args[ARG_dest_bitmap].u_obj, &displayio_bitmap_type, MP_QSTR_dest_bitmap)); // the destination bitmap + + uint32_t fill_color_value, color_depth; + fill_color_value = args[ARG_fill_color_value].u_int; + color_depth = (1 << destination->bits_per_value); + if (color_depth <= fill_color_value) { + mp_raise_ValueError(translate("value out of range of target")); + } + + uint32_t replaced_color_value; + replaced_color_value = args[ARG_replaced_color_value].u_int; + if (replaced_color_value != INT_MAX && color_depth <= replaced_color_value) { + mp_raise_ValueError(translate("background value out of range of target")); + } + + int16_t x = args[ARG_x].u_int; + int16_t y = args[ARG_y].u_int; + + if (x < 0 || x >= destination->width) { + mp_raise_ValueError(translate("out of range of target")); + } + if (y < 0 || y >= destination->height) { + mp_raise_ValueError(translate("out of range of target")); + } + + common_hal_bitmaptools_boundary_fill(destination, x, y, fill_color_value, replaced_color_value); + + return mp_const_none; +} + +MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_boundary_fill_obj, 0, bitmaptools_obj_boundary_fill); // requires all 6 arguments //| @@ -501,7 +563,7 @@ STATIC mp_obj_t bitmaptools_readinto(size_t n_args, const mp_obj_t *pos_args, mp case 32: break; default: - mp_raise_ValueError_varg(translate("invalid bits_per_pixel %d, must be, 1, 4, 8, 16, 24, or 32"), bits_per_pixel); + mp_raise_ValueError_varg(translate("invalid bits_per_pixel %d, must be, 1, 2, 4, 8, 16, 24, or 32"), bits_per_pixel); } bool reverse_pixels_in_element = args[ARG_reverse_pixels_in_element].u_bool; @@ -516,10 +578,12 @@ STATIC mp_obj_t bitmaptools_readinto(size_t n_args, const mp_obj_t *pos_args, mp MP_DEFINE_CONST_FUN_OBJ_KW(bitmaptools_readinto_obj, 0, bitmaptools_readinto); STATIC const mp_rom_map_elem_t bitmaptools_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_bitmaptools) }, { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&bitmaptools_readinto_obj) }, { MP_ROM_QSTR(MP_QSTR_rotozoom), MP_ROM_PTR(&bitmaptools_rotozoom_obj) }, { MP_ROM_QSTR(MP_QSTR_arrayblit), MP_ROM_PTR(&bitmaptools_arrayblit_obj) }, { MP_ROM_QSTR(MP_QSTR_fill_region), MP_ROM_PTR(&bitmaptools_fill_region_obj) }, + { MP_ROM_QSTR(MP_QSTR_boundary_fill), MP_ROM_PTR(&bitmaptools_boundary_fill_obj) }, { MP_ROM_QSTR(MP_QSTR_draw_line), MP_ROM_PTR(&bitmaptools_draw_line_obj) }, }; STATIC MP_DEFINE_CONST_DICT(bitmaptools_module_globals, bitmaptools_module_globals_table); @@ -528,3 +592,5 @@ const mp_obj_module_t bitmaptools_module = { .base = {&mp_type_module }, .globals = (mp_obj_dict_t *)&bitmaptools_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_bitmaptools, bitmaptools_module, CIRCUITPY_BITMAPTOOLS); diff --git a/shared-bindings/bitmaptools/__init__.h b/shared-bindings/bitmaptools/__init__.h index fc1eb59068..6415b20258 100644 --- a/shared-bindings/bitmaptools/__init__.h +++ b/shared-bindings/bitmaptools/__init__.h @@ -46,6 +46,10 @@ void common_hal_bitmaptools_fill_region(displayio_bitmap_t *destination, int16_t x2, int16_t y2, uint32_t value); +void common_hal_bitmaptools_boundary_fill(displayio_bitmap_t *destination, + int16_t x, int16_t y, + uint32_t fill_color_value, uint32_t replaced_color_value); + void common_hal_bitmaptools_draw_line(displayio_bitmap_t *destination, int16_t x0, int16_t y0, int16_t x1, int16_t y1, diff --git a/shared-bindings/bitops/__init__.c b/shared-bindings/bitops/__init__.c index 89f32f1dc2..d9849da917 100644 --- a/shared-bindings/bitops/__init__.c +++ b/shared-bindings/bitops/__init__.c @@ -99,3 +99,5 @@ const mp_obj_module_t bitops_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&bitops_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_bitops, bitops_module, CIRCUITPY_BITOPS); diff --git a/shared-bindings/board/__init__.c b/shared-bindings/board/__init__.c index 06b3a899d8..3951639c04 100644 --- a/shared-bindings/board/__init__.c +++ b/shared-bindings/board/__init__.c @@ -124,3 +124,5 @@ const mp_obj_module_t board_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&board_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_board, board_module, CIRCUITPY_BOARD); diff --git a/shared-bindings/board/__init__.h b/shared-bindings/board/__init__.h index a9b652ba8d..837608fa9e 100644 --- a/shared-bindings/board/__init__.h +++ b/shared-bindings/board/__init__.h @@ -28,10 +28,12 @@ #define MICROPY_INCLUDED_SHARED_BINDINGS_BOARD___INIT___H #include "py/obj.h" +#include "py/objstr.h" #include "shared-bindings/microcontroller/Pin.h" // for the pin definitions extern const mp_obj_dict_t board_module_globals; +STATIC const MP_DEFINE_STR_OBJ(board_module_id_obj, CIRCUITPY_BOARD_ID); mp_obj_t common_hal_board_get_i2c(void); mp_obj_t common_hal_board_create_i2c(void); @@ -45,4 +47,8 @@ mp_obj_t common_hal_board_get_uart(void); mp_obj_t common_hal_board_create_uart(void); MP_DECLARE_CONST_FUN_OBJ_0(board_uart_obj); +#define CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS \ + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_board) }, \ + { MP_ROM_QSTR(MP_QSTR_board_id), MP_ROM_PTR(&board_module_id_obj) }, + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_BOARD___INIT___H diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index d300956d0a..344dad8acc 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -228,7 +228,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args, } MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into); -//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None, stop: bool = True) -> None: +//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: Optional[int] = None) -> None: //| """Write the bytes from ``buffer`` to the device selected by ``address`` and //| then transmit a stop bit. //| diff --git a/shared-bindings/busio/OneWire.h b/shared-bindings/busio/OneWire.h deleted file mode 100644 index a270bab5c9..0000000000 --- a/shared-bindings/busio/OneWire.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of the Micro Python 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. - */ - -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_ONEWIRE_H - -#include "common-hal/microcontroller/Pin.h" -#include "common-hal/busio/OneWire.h" - -extern const mp_obj_type_t busio_onewire_type; - -extern void common_hal_busio_onewire_construct(busio_onewire_obj_t *self, - const mcu_pin_obj_t *pin); -extern void common_hal_busio_onewire_deinit(busio_onewire_obj_t *self); -extern bool common_hal_busio_onewire_deinited(busio_onewire_obj_t *self); -extern bool common_hal_busio_onewire_reset(busio_onewire_obj_t *self); -extern bool common_hal_busio_onewire_read_bit(busio_onewire_obj_t *self); -extern void common_hal_busio_onewire_write_bit(busio_onewire_obj_t *self, bool bit); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSIO_ONEWIRE_H diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 31f3a9021e..a611d8e1d5 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -104,7 +104,7 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con common_hal_busio_spi_construct(self, clock, mosi, miso); return MP_OBJ_FROM_PTR(self); #else - mp_raise_NotImplementedError(NULL); + mp_raise_ValueError(translate("Invalid pins")); #endif // CIRCUITPY_BUSIO_SPI } diff --git a/shared-bindings/busio/SPI.h b/shared-bindings/busio/SPI.h index 67ca752bab..f4737da0c0 100644 --- a/shared-bindings/busio/SPI.h +++ b/shared-bindings/busio/SPI.h @@ -52,7 +52,7 @@ extern void common_hal_busio_spi_unlock(busio_spi_obj_t *self); // Writes out the given data. extern bool common_hal_busio_spi_write(busio_spi_obj_t *self, const uint8_t *data, size_t len); -// Reads in len bytes while outputting zeroes. +// Reads in len bytes while outputting the byte write_value. extern bool common_hal_busio_spi_read(busio_spi_obj_t *self, uint8_t *data, size_t len, uint8_t write_value); // Reads and write len bytes simultaneously. diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c index bd97910192..efb0643d0b 100644 --- a/shared-bindings/busio/UART.c +++ b/shared-bindings/busio/UART.c @@ -72,13 +72,16 @@ typedef struct { extern const busio_uart_parity_obj_t busio_uart_parity_even_obj; extern const busio_uart_parity_obj_t busio_uart_parity_odd_obj; +#if CIRCUITPY_BUSIO_UART STATIC void validate_timeout(mp_float_t timeout) { if (timeout < (mp_float_t)0.0f || timeout > (mp_float_t)100.0f) { mp_raise_ValueError(translate("timeout must be 0.0-100.0 seconds")); } } +#endif // CIRCUITPY_BUSIO_UART STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + #if CIRCUITPY_BUSIO_UART // Always initially allocate the UART object within the long-lived heap. // This is needed to avoid crashes with certain UART implementations which // cannot accomodate being moved after creation. (See @@ -141,8 +144,12 @@ STATIC mp_obj_t busio_uart_make_new(const mp_obj_type_t *type, size_t n_args, co args[ARG_baudrate].u_int, bits, parity, stop, timeout, args[ARG_receiver_buffer_size].u_int, NULL, false); return (mp_obj_t)self; + #else + mp_raise_ValueError(translate("Invalid pins")); + #endif // CIRCUITPY_BUSIO_UART } +#if CIRCUITPY_BUSIO_UART // Helper to ensure we have the native super class instead of a subclass. busio_uart_obj_t *native_uart(mp_obj_t uart_obj) { @@ -358,6 +365,7 @@ STATIC mp_obj_t busio_uart_obj_reset_input_buffer(mp_obj_t self_in) { return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_uart_reset_input_buffer_obj, busio_uart_obj_reset_input_buffer); +#endif // CIRCUITPY_BUSIO_UART //| class Parity: //| """Enum-like class to define the parity used to verify correct data transfer.""" @@ -400,6 +408,7 @@ const mp_obj_type_t busio_uart_parity_type = { }; STATIC const mp_rom_map_elem_t busio_uart_locals_dict_table[] = { + #if CIRCUITPY_BUSIO_UART { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&busio_uart_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&busio_uart_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, @@ -417,12 +426,14 @@ STATIC const mp_rom_map_elem_t busio_uart_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_baudrate), MP_ROM_PTR(&busio_uart_baudrate_obj) }, { MP_ROM_QSTR(MP_QSTR_in_waiting), MP_ROM_PTR(&busio_uart_in_waiting_obj) }, { MP_ROM_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&busio_uart_timeout_obj) }, + #endif // CIRCUITPY_BUSIO_UART // Nested Enum-like Classes. { MP_ROM_QSTR(MP_QSTR_Parity), MP_ROM_PTR(&busio_uart_parity_type) }, }; STATIC MP_DEFINE_CONST_DICT(busio_uart_locals_dict, busio_uart_locals_dict_table); +#if CIRCUITPY_BUSIO_UART STATIC const mp_stream_p_t uart_stream_p = { MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream) .read = busio_uart_read, @@ -445,3 +456,11 @@ const mp_obj_type_t busio_uart_type = { .protocol = &uart_stream_p, ), }; +#else +const mp_obj_type_t busio_uart_type = { + { &mp_type_type }, + .name = MP_QSTR_UART, + .make_new = busio_uart_make_new, + .locals_dict = (mp_obj_dict_t *)&busio_uart_locals_dict, +}; +#endif // CIRCUITPY_BUSIO_UART diff --git a/shared-bindings/busio/__init__.c b/shared-bindings/busio/__init__.c index e7df331c12..b2397a65cc 100644 --- a/shared-bindings/busio/__init__.c +++ b/shared-bindings/busio/__init__.c @@ -32,9 +32,9 @@ #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/busio/__init__.h" #include "shared-bindings/busio/I2C.h" -#include "shared-bindings/busio/OneWire.h" #include "shared-bindings/busio/SPI.h" #include "shared-bindings/busio/UART.h" +#include "shared-bindings/onewireio/OneWire.h" #include "py/runtime.h" @@ -73,7 +73,9 @@ 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) }, - { MP_ROM_QSTR(MP_QSTR_OneWire), MP_ROM_PTR(&busio_onewire_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) }, }; @@ -83,3 +85,5 @@ const mp_obj_module_t busio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&busio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_busio, busio_module, CIRCUITPY_BUSIO); diff --git a/shared-bindings/camera/__init__.c b/shared-bindings/camera/__init__.c index dfe1093a40..12cebae7db 100644 --- a/shared-bindings/camera/__init__.c +++ b/shared-bindings/camera/__init__.c @@ -48,3 +48,5 @@ const mp_obj_module_t camera_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&camera_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_camera, camera_module, CIRCUITPY_CAMERA); diff --git a/shared-bindings/canio/__init__.c b/shared-bindings/canio/__init__.c index d9863e8a21..ef1b90df97 100644 --- a/shared-bindings/canio/__init__.c +++ b/shared-bindings/canio/__init__.c @@ -80,7 +80,7 @@ MAKE_ENUM_VALUE(canio_bus_state_type, bus_state, BUS_OFF, BUS_STATE_OFF); //| ERROR_WARNING: object //| """The bus is in the normal (active) state, but a moderate number of errors have occurred recently. //| -//| NOTE: Not all implementations may use ERROR_WARNING. Do not rely on seeing ERROR_WARNING before ERROR_PASSIVE.""" +//| .. note:: Not all implementations may use ``ERROR_WARNING``. Do not rely on seeing ``ERROR_WARNING`` before ``ERROR_PASSIVE``.""" //| //| ERROR_PASSIVE: object //| """The bus is in the passive state due to the number of errors that have occurred recently. @@ -108,6 +108,7 @@ MAKE_PRINTER(canio, canio_bus_state); MAKE_ENUM_TYPE(canio, BusState, canio_bus_state); STATIC const mp_rom_map_elem_t canio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_canio) }, { MP_ROM_QSTR(MP_QSTR_BusState), MP_ROM_PTR(&canio_bus_state_type) }, { MP_ROM_QSTR(MP_QSTR_CAN), MP_ROM_PTR(&canio_can_type) }, { MP_ROM_QSTR(MP_QSTR_Listener), MP_ROM_PTR(&canio_listener_type) }, @@ -123,3 +124,5 @@ const mp_obj_module_t canio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&canio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_canio, canio_module, CIRCUITPY_CANIO); diff --git a/shared-bindings/countio/__init__.c b/shared-bindings/countio/__init__.c index f6c0a4221c..faa23da9b0 100644 --- a/shared-bindings/countio/__init__.c +++ b/shared-bindings/countio/__init__.c @@ -34,3 +34,5 @@ const mp_obj_module_t countio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&countio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_countio, countio_module, CIRCUITPY_COUNTIO); diff --git a/shared-bindings/digitalio/__init__.c b/shared-bindings/digitalio/__init__.c index 52ce377e37..39b569253b 100644 --- a/shared-bindings/digitalio/__init__.c +++ b/shared-bindings/digitalio/__init__.c @@ -90,3 +90,5 @@ const mp_obj_module_t digitalio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&digitalio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_digitalio, digitalio_module, CIRCUITPY_DIGITALIO); diff --git a/shared-bindings/displayio/ColorConverter.c b/shared-bindings/displayio/ColorConverter.c index 75ba43162a..7c1e87efeb 100644 --- a/shared-bindings/displayio/ColorConverter.c +++ b/shared-bindings/displayio/ColorConverter.c @@ -86,7 +86,7 @@ STATIC mp_obj_t displayio_colorconverter_obj_convert(mp_obj_t self_in, mp_obj_t MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_convert_obj, displayio_colorconverter_obj_convert); //| dither: bool -//| """When true the color converter dithers the output by adding random noise when +//| """When `True` the ColorConverter dithers the output by adding random noise when //| truncating to display bitdepth""" //| STATIC mp_obj_t displayio_colorconverter_obj_get_dither(mp_obj_t self_in) { @@ -111,8 +111,11 @@ const mp_obj_property_t displayio_colorconverter_dither_obj = { MP_ROM_NONE}, }; -//| def make_transparent(self, pixel: int) -> None: -//| """Sets a pixel to not opaque.""" +//| def make_transparent(self, color: int) -> None: +//| """Set the transparent color or index for the ColorConverter. This will +//| raise an Exception if there is already a selected transparent index. +//| +//| :param int color: The color to be transparent""" //| STATIC mp_obj_t displayio_colorconverter_make_transparent(mp_obj_t self_in, mp_obj_t transparent_color_obj) { displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); @@ -123,8 +126,10 @@ STATIC mp_obj_t displayio_colorconverter_make_transparent(mp_obj_t self_in, mp_o } MP_DEFINE_CONST_FUN_OBJ_2(displayio_colorconverter_make_transparent_obj, displayio_colorconverter_make_transparent); -//| def make_opaque(self, pixel: int) -> None: -//| """Sets a pixel to opaque.""" +//| def make_opaque(self, color: int) -> None: +//| """Make the ColorConverter be opaque and have no transparent pixels. +//| +//| :param int color: [IGNORED] Use any value""" //| STATIC mp_obj_t displayio_colorconverter_make_opaque(mp_obj_t self_in, mp_obj_t transparent_color_obj) { displayio_colorconverter_t *self = MP_OBJ_TO_PTR(self_in); diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index e12e398802..96ce284efa 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -39,8 +39,8 @@ #include "shared-module/displayio/__init__.h" #include "supervisor/shared/translate.h" -//| _DisplayBus = Union['FourWire', 'ParallelBus', 'I2CDisplay'] -//| """:py:class:`FourWire`, :py:class:`ParallelBus` or :py:class:`I2CDisplay`""" +//| _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, set_vertical_scroll: int = 0, 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, 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: //| 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 @@ -100,7 +100,6 @@ //| :param int set_column_command: Command used to set the start and end columns to update //| :param int set_row_command: Command used so set the start and end rows to update //| :param int write_ram_command: Command used to write pixels values into the update region. Ignored if data_as_commands is set. -//| :param int set_vertical_scroll: Command used to set the first row to show //| :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. @@ -111,6 +110,7 @@ //| :param int native_frames_per_second: Number of display refreshes per second that occur with the given init_sequence. //| :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. //| """ //| ... //| @@ -184,7 +184,6 @@ STATIC mp_obj_t displayio_display_make_new(const mp_obj_type_t *type, size_t n_a args[ARG_reverse_bytes_in_word].u_bool, args[ARG_set_column_command].u_int, args[ARG_set_row_command].u_int, args[ARG_write_ram_command].u_int, - args[ARG_set_vertical_scroll].u_int, bufinfo.buf, bufinfo.len, MP_OBJ_TO_PTR(backlight_pin), args[ARG_brightness_command].u_int, @@ -230,23 +229,24 @@ STATIC mp_obj_t displayio_display_obj_show(mp_obj_t self_in, mp_obj_t group_in) } MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_show_obj, displayio_display_obj_show); -//| def refresh(self, *, target_frames_per_second: Optional[int] = None, minimum_frames_per_second: int = 1) -> bool: -//| """When auto refresh is off, waits for the target frame rate and then refreshes the display, -//| returning True. If the call has taken too long since the last refresh call for the given -//| target frame rate, then the refresh returns False immediately without updating the screen to +//| def refresh(self, *, target_frames_per_second: Optional[int] = None, minimum_frames_per_second: int = 0) -> bool: +//| """When auto_refresh is off, and :py:attr:`target_frames_per_second` is not `None` this waits +//| for the target frame rate and then refreshes the display, +//| returning `True`. If the call has taken too long since the last refresh call for the given +//| target frame rate, then the refresh returns `False` immediately without updating the screen to //| hopefully help getting caught up. //| //| If the time since the last successful refresh is below the minimum frame rate, then an -//| exception will be raised. Set ``minimum_frames_per_second`` to 0 to disable. +//| exception will be raised. The default :py:attr:`minimum_frames_per_second` of 0 disables this behavior. //| -//| When auto refresh is off, ``display.refresh()`` or ``display.refresh(target_frames_per_second=None)`` +//| When auto_refresh is off, and :py:attr:`target_frames_per_second` is `None` this //| will update the display immediately. //| -//| When auto refresh is on, updates the display immediately. (The display will also update +//| When auto_refresh is on, updates the display immediately. (The display will also update //| without calls to this.) //| -//| :param int target_frames_per_second: How many times a second `refresh` should be called and the screen updated. -//| Set to `None` for immediate refresh. +//| :param Optional[int] target_frames_per_second: The target frame rate that :py:func:`refresh` should try to +//| achieve. Set to `None` for immediate refresh. //| :param int minimum_frames_per_second: The minimum number of times the screen should be updated per second.""" //| ... //| @@ -254,7 +254,7 @@ STATIC mp_obj_t displayio_display_obj_refresh(size_t n_args, const mp_obj_t *pos enum { ARG_target_frames_per_second, ARG_minimum_frames_per_second }; static const mp_arg_t allowed_args[] = { { MP_QSTR_target_frames_per_second, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_obj = mp_const_none} }, - { MP_QSTR_minimum_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} }, + { MP_QSTR_minimum_frames_per_second, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index 36015cd56f..54a4ec84df 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -42,7 +42,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, mp_obj_t bus, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, 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 set_vertical_scroll, + 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, bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, diff --git a/shared-bindings/displayio/EPaperDisplay.c b/shared-bindings/displayio/EPaperDisplay.c index e80b243223..afe1321251 100644 --- a/shared-bindings/displayio/EPaperDisplay.c +++ b/shared-bindings/displayio/EPaperDisplay.c @@ -54,7 +54,9 @@ //| width: int, height: int, ram_width: int, ram_height: int, //| colstart: int = 0, rowstart: int = 0, rotation: int = 0, //| set_column_window_command: Optional[int] = None, -//| set_row_window_command: Optional[int] = None, single_byte_bounds: bool = False, +//| set_row_window_command: Optional[int] = None, +//| set_current_column_command: Optional[int] = None, +//| set_current_row_command: Optional[int] = None, //| write_black_ram_command: int, black_bits_inverted: bool = False, //| write_color_ram_command: Optional[int] = None, //| color_bits_inverted: bool = False, highlight_color: int = 0x000000, @@ -62,7 +64,7 @@ //| busy_pin: Optional[microcontroller.Pin] = None, busy_state: bool = True, //| seconds_per_frame: float = 180, always_toggle_chip_select: bool = False, //| grayscale: bool = False) -> None: -//| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`). +//| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `paralleldisplay.ParallelBus`). //| //| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every //| command begins with a command byte followed by a byte to determine the parameter count and @@ -73,7 +75,7 @@ //| extra long 500 ms delay instead of 255 ms. The next byte will begin a new command definition. //| //| :param display_bus: The bus that the display is connected to -//| :type _DisplayBus: displayio.FourWire or displayio.ParallelBus +//| :type _DisplayBus: displayio.FourWire or paralleldisplay.ParallelBus //| :param ~_typing.ReadableBuffer start_sequence: Byte-packed initialization sequence. //| :param ~_typing.ReadableBuffer stop_sequence: Byte-packed initialization sequence. //| :param int width: Width in pixels @@ -215,6 +217,31 @@ STATIC mp_obj_t displayio_epaperdisplay_obj_show(mp_obj_t self_in, mp_obj_t grou } MP_DEFINE_CONST_FUN_OBJ_2(displayio_epaperdisplay_show_obj, displayio_epaperdisplay_obj_show); +//| def update_refresh_mode(self, start_sequence: ReadableBuffer, seconds_per_frame: float = 180) -> None: +//| """Updates the ``start_sequence`` and ``seconds_per_frame`` parameters to enable +//| varying the refresh mode of the display.""" +//| +STATIC mp_obj_t displayio_epaperdisplay_update_refresh_mode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_start_sequence, ARG_seconds_per_frame }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_start_sequence, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_seconds_per_frame, MP_ARG_OBJ, {.u_obj = MP_OBJ_NEW_SMALL_INT(180)} }, + }; + displayio_epaperdisplay_obj_t *self = native_display(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); + + // Get parameters + mp_buffer_info_t start_sequence; + mp_get_buffer_raise(args[ARG_start_sequence].u_obj, &start_sequence, MP_BUFFER_READ); + float seconds_per_frame = mp_obj_get_float(args[ARG_seconds_per_frame].u_obj); + + // Update parameters + displayio_epaperdisplay_change_refresh_mode_parameters(self, &start_sequence, seconds_per_frame); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_KW(displayio_epaperdisplay_update_refresh_mode_obj, 3, displayio_epaperdisplay_update_refresh_mode); + //| def refresh(self) -> None: //| """Refreshes the display immediately or raises an exception if too soon. Use //| ``time.sleep(display.time_to_refresh)`` to sleep until a refresh can occur.""" @@ -337,6 +364,7 @@ const mp_obj_property_t displayio_epaperdisplay_bus_obj = { STATIC const mp_rom_map_elem_t displayio_epaperdisplay_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_show), MP_ROM_PTR(&displayio_epaperdisplay_show_obj) }, + { MP_ROM_QSTR(MP_QSTR_update_refresh_mode), MP_ROM_PTR(&displayio_epaperdisplay_update_refresh_mode_obj) }, { MP_ROM_QSTR(MP_QSTR_refresh), MP_ROM_PTR(&displayio_epaperdisplay_refresh_obj) }, { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_epaperdisplay_width_obj) }, diff --git a/shared-bindings/displayio/FourWire.c b/shared-bindings/displayio/FourWire.c index 3ba55a4470..2145425342 100644 --- a/shared-bindings/displayio/FourWire.c +++ b/shared-bindings/displayio/FourWire.c @@ -111,7 +111,7 @@ STATIC mp_obj_t displayio_fourwire_obj_reset(mp_obj_t self_in) { } MP_DEFINE_CONST_FUN_OBJ_1(displayio_fourwire_reset_obj, displayio_fourwire_obj_reset); -//| def send(self, command: int, data: FourWire, *, toggle_every_byte: bool = False) -> None: +//| def send(self, command: int, data: ReadableBuffer, *, toggle_every_byte: bool = False) -> None: //| """Sends the given command value followed by the full set of data. Display state, such as //| vertical scroll, set via ``send`` may or may not be reset once the code is done.""" //| ... diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index d636ee335b..b706b627c4 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -183,7 +183,7 @@ const mp_obj_property_t displayio_group_y_obj = { MP_ROM_NONE}, }; -//| def append(self, layer: Union[vectorio.VectorShape, Group, TileGrid]) -> None: +//| 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.""" //| ... //| @@ -194,7 +194,7 @@ STATIC mp_obj_t displayio_group_obj_append(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_append_obj, displayio_group_obj_append); -//| def insert(self, index: int, layer: Union[vectorio.VectorShape, Group, TileGrid]) -> None: +//| def insert(self, index: int, layer: Union[vectorio.Circle, vectorio.Rectangle, vectorio.Polygon, Group, TileGrid]) -> None: //| """Insert a layer into the group.""" //| ... //| @@ -210,7 +210,7 @@ STATIC mp_obj_t displayio_group_obj_insert(mp_obj_t self_in, mp_obj_t index_obj, MP_DEFINE_CONST_FUN_OBJ_3(displayio_group_insert_obj, displayio_group_obj_insert); -//| def index(self, layer: Union[vectorio.VectorShape, Group, TileGrid]) -> int: +//| def index(self, layer: Union[vectorio.Circle, vectorio.Rectangle, vectorio.Polygon, Group, TileGrid]) -> int: //| """Returns the index of the first copy of layer. Raises ValueError if not found.""" //| ... //| @@ -224,7 +224,7 @@ STATIC mp_obj_t displayio_group_obj_index(mp_obj_t self_in, mp_obj_t layer) { } MP_DEFINE_CONST_FUN_OBJ_2(displayio_group_index_obj, displayio_group_obj_index); -//| def pop(self, i: int = -1) -> Union[vectorio.VectorShape, Group, TileGrid]: +//| def pop(self, i: int = -1) -> Union[vectorio.Circle, vectorio.Rectangle, vectorio.Polygon, Group, TileGrid]: //| """Remove the ith item and return it.""" //| ... //| @@ -247,7 +247,7 @@ STATIC mp_obj_t displayio_group_obj_pop(size_t n_args, const mp_obj_t *pos_args, MP_DEFINE_CONST_FUN_OBJ_KW(displayio_group_pop_obj, 1, displayio_group_obj_pop); -//| def remove(self, layer: Union[vectorio.VectorShape, Group, TileGrid]) -> None: +//| def remove(self, layer: Union[vectorio.Circle, vectorio.Rectangle, vectorio.Polygon, Group, TileGrid]) -> None: //| """Remove the first copy of layer. Raises ValueError if it is not present.""" //| ... //| @@ -280,7 +280,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } -//| def __getitem__(self, index: int) -> Union[vectorio.VectorShape, Group, TileGrid]: +//| def __getitem__(self, index: int) -> Union[vectorio.Circle, vectorio.Rectangle, vectorio.Polygon, Group, TileGrid]: //| """Returns the value at the given index. //| //| This allows you to:: @@ -288,7 +288,7 @@ STATIC mp_obj_t group_unary_op(mp_unary_op_t op, mp_obj_t self_in) { //| print(group[0])""" //| ... //| -//| def __setitem__(self, index: int, value: Union[vectorio.VectorShape, Group, TileGrid]) -> None: +//| def __setitem__(self, index: int, value: Union[vectorio.Circle, vectorio.Rectangle, vectorio.Polygon, Group, TileGrid]) -> None: //| """Sets the value at the given index. //| //| This allows you to:: @@ -335,7 +335,7 @@ STATIC mp_obj_t displayio_group_obj_sort(size_t n_args, const mp_obj_t *pos_args args[i] = pos_args[i]; } args[0] = MP_OBJ_FROM_PTR(self->members); - return mp_obj_list_sort(n_args, pos_args, kw_args); + return mp_obj_list_sort(n_args, args, kw_args); } MP_DEFINE_CONST_FUN_OBJ_KW(displayio_group_sort_obj, 1, displayio_group_obj_sort); diff --git a/shared-bindings/displayio/TileGrid.c b/shared-bindings/displayio/TileGrid.c index 9503e0a33c..1c6e6efda3 100644 --- a/shared-bindings/displayio/TileGrid.c +++ b/shared-bindings/displayio/TileGrid.c @@ -48,14 +48,14 @@ //| //| A single tile grid is also known as a Sprite.""" //| -//| def __init__(self, bitmap: Bitmap, *, pixel_shader: Union[ColorConverter, Palette], width: int = 1, height: int = 1, tile_width: Optional[int] = None, tile_height: Optional[int] = None, default_tile: int = 0, x: int = 0, y: int = 0) -> None: +//| def __init__(self, bitmap: Union[Bitmap, OnDiskBitmap, Shape], *, pixel_shader: Union[ColorConverter, Palette], width: int = 1, height: int = 1, tile_width: Optional[int] = None, tile_height: Optional[int] = None, default_tile: int = 0, x: int = 0, y: int = 0) -> None: //| """Create a TileGrid object. The bitmap is source for 2d pixels. The pixel_shader is used to //| 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. //| //| tile_width and tile_height match the height of the bitmap by default. //| -//| :param Bitmap bitmap: The bitmap storing one or more tiles. +//| :param Bitmap,OnDiskBitmap,Shape bitmap: The bitmap storing one or more tiles. //| :param ColorConverter,Palette pixel_shader: The pixel shader that produces colors from values //| :param int width: Width of the grid in tiles. //| :param int height: Height of the grid in tiles. diff --git a/shared-bindings/displayio/__init__.c b/shared-bindings/displayio/__init__.c index dc4971de2a..7ac2a84903 100644 --- a/shared-bindings/displayio/__init__.c +++ b/shared-bindings/displayio/__init__.c @@ -40,7 +40,9 @@ #include "shared-bindings/displayio/I2CDisplay.h" #include "shared-bindings/displayio/OnDiskBitmap.h" #include "shared-bindings/displayio/Palette.h" -#include "shared-bindings/displayio/ParallelBus.h" +#if CIRCUITPY_PARALLELDISPLAY +#include "shared-bindings/paralleldisplay/ParallelBus.h" +#endif #include "shared-bindings/displayio/Shape.h" #include "shared-bindings/displayio/TileGrid.h" @@ -50,6 +52,8 @@ //| including synchronizing with refresh rates and partial updating.""" //| +//| import paralleldisplay + //| def release_displays() -> None: //| """Releases any actively used displays so their busses and pins can be used again. This will also //| release the builtin display on boards that have one. You will need to reinitialize it yourself @@ -125,7 +129,9 @@ STATIC const mp_rom_map_elem_t displayio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_FourWire), MP_ROM_PTR(&displayio_fourwire_type) }, { MP_ROM_QSTR(MP_QSTR_I2CDisplay), MP_ROM_PTR(&displayio_i2cdisplay_type) }, - { MP_ROM_QSTR(MP_QSTR_ParallelBus), MP_ROM_PTR(&displayio_parallelbus_type) }, + #if CIRCUITPY_PARALLELDISPLAY + { MP_ROM_QSTR(MP_QSTR_ParallelBus), MP_ROM_PTR(¶lleldisplay_parallelbus_type) }, + #endif { MP_ROM_QSTR(MP_QSTR_release_displays), MP_ROM_PTR(&displayio_release_displays_obj) }, }; @@ -136,3 +142,5 @@ const mp_obj_module_t displayio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&displayio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_displayio, displayio_module, CIRCUITPY_DISPLAYIO); diff --git a/shared-bindings/dualbank/__init__.c b/shared-bindings/dualbank/__init__.c index 3b267a56fa..f907c91e0e 100644 --- a/shared-bindings/dualbank/__init__.c +++ b/shared-bindings/dualbank/__init__.c @@ -113,3 +113,5 @@ const mp_obj_module_t dualbank_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&dualbank_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_dualbank, dualbank_module, CIRCUITPY_DUALBANK); diff --git a/shared-bindings/fontio/__init__.c b/shared-bindings/fontio/__init__.c index c80d68a879..fc5c011eb3 100644 --- a/shared-bindings/fontio/__init__.c +++ b/shared-bindings/fontio/__init__.c @@ -48,3 +48,5 @@ const mp_obj_module_t fontio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&fontio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_fontio, fontio_module, CIRCUITPY_DISPLAYIO && CIRCUITPY_TERMINALIO); diff --git a/shared-bindings/framebufferio/__init__.c b/shared-bindings/framebufferio/__init__.c index ae0f3f906f..5d95ef41f5 100644 --- a/shared-bindings/framebufferio/__init__.c +++ b/shared-bindings/framebufferio/__init__.c @@ -42,9 +42,13 @@ static const mp_rom_map_elem_t framebufferio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_framebufferio) }, { MP_ROM_QSTR(MP_QSTR_FramebufferDisplay), MP_ROM_PTR(&framebufferio_framebufferdisplay_type) }, }; + STATIC MP_DEFINE_CONST_DICT(framebufferio_module_globals, framebufferio_module_globals_table); + const mp_obj_module_t framebufferio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&framebufferio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_framebufferio, framebufferio_module, CIRCUITPY_FRAMEBUFFERIO); #endif diff --git a/shared-bindings/frequencyio/__init__.c b/shared-bindings/frequencyio/__init__.c index 0ad8bbbe9b..02f19de65d 100644 --- a/shared-bindings/frequencyio/__init__.c +++ b/shared-bindings/frequencyio/__init__.c @@ -72,3 +72,5 @@ const mp_obj_module_t frequencyio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&frequencyio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_frequencyio, frequencyio_module, CIRCUITPY_FREQUENCYIO); diff --git a/shared-bindings/gamepad/GamePad.c b/shared-bindings/gamepad/GamePad.c deleted file mode 100644 index 0776839939..0000000000 --- a/shared-bindings/gamepad/GamePad.c +++ /dev/null @@ -1,166 +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 "shared-bindings/gamepad/GamePad.h" - -#include "py/obj.h" -#include "py/runtime.h" -#include "py/mphal.h" -#include "py/gc.h" -#include "py/mpstate.h" -#include "shared-bindings/gamepad/__init__.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "supervisor/shared/translate.h" -#include "supervisor/shared/tick.h" - -//| class GamePad: -//| """Scan buttons for presses -//| -//| Usage:: -//| -//| import board -//| import digitalio -//| import gamepad -//| import time -//| -//| B_UP = 1 << 0 -//| B_DOWN = 1 << 1 -//| -//| -//| pad = gamepad.GamePad( -//| digitalio.DigitalInOut(board.D10), -//| digitalio.DigitalInOut(board.D11), -//| ) -//| -//| y = 0 -//| while True: -//| buttons = pad.get_pressed() -//| if buttons & B_UP: -//| y -= 1 -//| print(y) -//| elif buttons & B_DOWN: -//| y += 1 -//| print(y) -//| time.sleep(0.1) -//| while buttons: -//| # Wait for all buttons to be released. -//| buttons = pad.get_pressed() -//| time.sleep(0.1)""" -//| -//| def __init__( -//| self, -//| b1: digitalio.DigitalInOut, -//| b2: digitalio.DigitalInOut, -//| b3: digitalio.DigitalInOut, -//| b4: digitalio.DigitalInOut, -//| b5: digitalio.DigitalInOut, -//| b6: digitalio.DigitalInOut, -//| b7: digitalio.DigitalInOut, -//| b8: digitalio.DigitalInOut, -//| ) -> None: -//| """Initializes button scanning routines. -//| -//| The ``b1``-``b8`` parameters are ``DigitalInOut`` objects, which -//| immediately get switched to input with a pull-up, (unless they already -//| were set to pull-down, in which case they remain so), and then scanned -//| regularly for button presses. The order is the same as the order of -//| bits returned by the ``get_pressed`` function. You can re-initialize -//| it with different keys, then the new object will replace the previous -//| one. -//| -//| The basic feature required here is the ability to poll the keys at -//| regular intervals (so that de-bouncing is consistent) and fast enough -//| (so that we don't miss short button presses) while at the same time -//| letting the user code run normally, call blocking functions and wait -//| on delays. -//| -//| They 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.""" -//| ... -//| -STATIC mp_obj_t gamepad_make_new(const mp_obj_type_t *type, size_t n_args, - const mp_obj_t *args, mp_map_t *kw_args) { - if (n_args > 8 || n_args == 0) { - mp_raise_TypeError(translate("argument num/types mismatch")); - } - for (size_t i = 0; i < n_args; ++i) { - assert_digitalinout(args[i]); - } - gamepad_obj_t *gamepad_singleton = MP_STATE_VM(gamepad_singleton); - if (!gamepad_singleton || - !mp_obj_is_type(MP_OBJ_FROM_PTR(gamepad_singleton), &gamepad_type)) { - gamepad_singleton = m_new_ll_obj(gamepad_obj_t); - gamepad_singleton->base.type = &gamepad_type; - if (!MP_STATE_VM(gamepad_singleton)) { - supervisor_enable_tick(); - } - MP_STATE_VM(gamepad_singleton) = gamepad_singleton; - } - common_hal_gamepad_gamepad_init(gamepad_singleton, args, n_args); - 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 gamepad_get_pressed(mp_obj_t self_in) { - gamepad_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(gamepad_get_pressed_obj, gamepad_get_pressed); - - -//| def deinit(self) -> None: -//| """Disable button scanning.""" -//| ... -//| -STATIC mp_obj_t gamepad_deinit(mp_obj_t self_in) { - common_hal_gamepad_gamepad_deinit(self_in); - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_1(gamepad_deinit_obj, gamepad_deinit); - - -STATIC const mp_rom_map_elem_t gamepad_locals_dict_table[] = { - { MP_OBJ_NEW_QSTR(MP_QSTR_get_pressed), MP_ROM_PTR(&gamepad_get_pressed_obj)}, - { MP_OBJ_NEW_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&gamepad_deinit_obj)}, -}; -STATIC MP_DEFINE_CONST_DICT(gamepad_locals_dict, gamepad_locals_dict_table); -const mp_obj_type_t gamepad_type = { - { &mp_type_type }, - .name = MP_QSTR_GamePad, - .make_new = gamepad_make_new, - .locals_dict = (mp_obj_dict_t *)&gamepad_locals_dict, -}; diff --git a/shared-bindings/gamepad/GamePad.h b/shared-bindings/gamepad/GamePad.h deleted file mode 100644 index 3bbad4c97b..0000000000 --- a/shared-bindings/gamepad/GamePad.h +++ /dev/null @@ -1,38 +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. - */ - - -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD_GAMEPAD_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD_GAMEPAD_H - -#include "shared-module/gamepad/GamePad.h" - -extern const mp_obj_type_t gamepad_type; - -void common_hal_gamepad_gamepad_init(gamepad_obj_t *gamepad, const mp_obj_t pins[], size_t n_pins); -void common_hal_gamepad_gamepad_deinit(gamepad_obj_t *gamepad); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD_GAMEPAD_H diff --git a/shared-bindings/gamepad/__init__.h b/shared-bindings/gamepad/__init__.h deleted file mode 100644 index 2ae5efb3a0..0000000000 --- a/shared-bindings/gamepad/__init__.h +++ /dev/null @@ -1,31 +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. - */ - - -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD___INIT___H -#define MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD___INIT___H - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_GAMEPAD___INIT___H diff --git a/shared-bindings/gamepadshift/GamePadShift.c b/shared-bindings/gamepadshift/GamePadShift.c index aba699b23f..a232683c96 100644 --- a/shared-bindings/gamepadshift/GamePadShift.c +++ b/shared-bindings/gamepadshift/GamePadShift.c @@ -46,8 +46,7 @@ //| is called, at which point the button state is cleared, and the new //| button presses start to be recorded. //| -//| Only one gamepad (`gamepad.GamePad` or `gamepadshift.GamePadShift`) -//| may be used at a time.""" +//| 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, diff --git a/shared-bindings/gamepadshift/__init__.c b/shared-bindings/gamepadshift/__init__.c index 1b25d342a7..816fd8d7b0 100644 --- a/shared-bindings/gamepadshift/__init__.c +++ b/shared-bindings/gamepadshift/__init__.c @@ -30,15 +30,22 @@ #include "shared-bindings/digitalio/DigitalInOut.h" #include "shared-bindings/util.h" -//| """Tracks button presses read through a shift register""" +//| """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/getpass/__init__.c b/shared-bindings/getpass/__init__.c new file mode 100644 index 0000000000..7c2de89b34 --- /dev/null +++ b/shared-bindings/getpass/__init__.c @@ -0,0 +1,88 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/stream.h" +#include "shared-module/getpass/__init__.h" + +//| """Getpass Module +//| +//| This module provides a way to get input from user without echoing it. +//| +//| """ +//| ... +//| + +//| def getpass(prompt: Optional[str] = 'Password: ', stream: Optional[io.FileIO] = None) -> str: +//| +//| """Prompt the user without echoing. +//| +//| :param str prompt: The user is prompted using the string ``prompt``, which defaults to ``'Password: '``. +//| :param io.FileIO stream: The ``prompt`` is written to the file-like object ``stream`` if provided. +//| +//| """ +//| ... +//| +STATIC mp_obj_t getpass_getpass(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_prompt, ARG_stream }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_prompt, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_stream, 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 *prompt = (args[ARG_prompt].u_obj == mp_const_none) ? "Password: " : mp_obj_str_get_str(args[ARG_prompt].u_obj); + + mp_print_t print = {.data = NULL}; + if (args[ARG_stream].u_obj != mp_const_none) { + #if MICROPY_PY_IO && MICROPY_PY_SYS_STDFILES + mp_get_stream_raise(args[ARG_stream].u_obj, MP_STREAM_OP_WRITE); + print.data = MP_OBJ_TO_PTR(args[ARG_stream].u_obj); + print.print_strn = mp_stream_write_adaptor; + #else + mp_raise_NotImplementedError(translate("stream operation not supported")); + #endif + } + + return shared_module_getpass_getpass(prompt, ((print.data) ? &print : NULL)); +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(getpass_getpass_obj, 0, getpass_getpass); + +STATIC const mp_rom_map_elem_t getpass_module_globals_table[] = { + // module name + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_getpass) }, + // module functions + { MP_ROM_QSTR(MP_QSTR_getpass), MP_ROM_PTR(&getpass_getpass_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(getpass_module_globals, getpass_module_globals_table); + +const mp_obj_module_t getpass_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&getpass_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_getpass, getpass_module, CIRCUITPY_GETPASS); diff --git a/shared-bindings/gnss/__init__.c b/shared-bindings/gnss/__init__.c index 80901a8c5a..ab6cbf56cf 100644 --- a/shared-bindings/gnss/__init__.c +++ b/shared-bindings/gnss/__init__.c @@ -29,3 +29,5 @@ const mp_obj_module_t gnss_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&gnss_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_gnss, gnss_module, CIRCUITPY_GNSS); diff --git a/shared-bindings/i2cperipheral/__init__.c b/shared-bindings/i2cperipheral/__init__.c index 183b8511c0..fde7002daf 100644 --- a/shared-bindings/i2cperipheral/__init__.c +++ b/shared-bindings/i2cperipheral/__init__.c @@ -104,3 +104,5 @@ const mp_obj_module_t i2cperipheral_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&i2cperipheral_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_i2cperipheral, i2cperipheral_module, CIRCUITPY_I2CPERIPHERAL); diff --git a/shared-bindings/imagecapture/__init__.c b/shared-bindings/imagecapture/__init__.c index 8f7ce231a6..0e5092aee8 100644 --- a/shared-bindings/imagecapture/__init__.c +++ b/shared-bindings/imagecapture/__init__.c @@ -45,3 +45,5 @@ const mp_obj_module_t imagecapture_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&imagecapture_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_imagecapture, imagecapture_module, CIRCUITPY_IMAGECAPTURE); diff --git a/shared-bindings/ipaddress/__init__.c b/shared-bindings/ipaddress/__init__.c index 314c539c27..6da5a52299 100644 --- a/shared-bindings/ipaddress/__init__.c +++ b/shared-bindings/ipaddress/__init__.c @@ -111,3 +111,5 @@ const mp_obj_module_t ipaddress_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&ipaddress_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_ipaddress, ipaddress_module, CIRCUITPY_IPADDRESS); diff --git a/shared-bindings/keypad/EventQueue.c b/shared-bindings/keypad/EventQueue.c index 15cc027b8c..2cb449551b 100644 --- a/shared-bindings/keypad/EventQueue.c +++ b/shared-bindings/keypad/EventQueue.c @@ -68,7 +68,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(keypad_eventqueue_get_obj, keypad_eventqueue_get); //| Note that the queue size is limited; see ``max_events`` in the constructor of //| a scanner such as `Keys` or `KeyMatrix`. //| -//| :return ``True`` if an event was available and stored, ``False`` if not. +//| :return: ``True`` if an event was available and stored, ``False`` if not. //| :rtype: bool //| """ //| ... diff --git a/shared-bindings/keypad/KeyMatrix.c b/shared-bindings/keypad/KeyMatrix.c index 0b854ef475..dbb4ac6822 100644 --- a/shared-bindings/keypad/KeyMatrix.c +++ b/shared-bindings/keypad/KeyMatrix.c @@ -90,6 +90,8 @@ STATIC mp_obj_t keypad_keymatrix_make_new(const mp_obj_type_t *type, size_t n_ar mcu_pin_obj_t *row_pins_array[num_row_pins]; mcu_pin_obj_t *column_pins_array[num_column_pins]; + validate_no_duplicate_pins_2(row_pins, column_pins, MP_QSTR_row_pins, MP_QSTR_column_pins); + for (size_t row = 0; row < num_row_pins; row++) { mcu_pin_obj_t *pin = validate_obj_is_free_pin(mp_obj_subscr(row_pins, MP_OBJ_NEW_SMALL_INT(row), MP_OBJ_SENTINEL)); diff --git a/shared-bindings/keypad/Keys.c b/shared-bindings/keypad/Keys.c index d616bcff84..dc533a2e2b 100644 --- a/shared-bindings/keypad/Keys.c +++ b/shared-bindings/keypad/Keys.c @@ -78,6 +78,7 @@ STATIC mp_obj_t keypad_keys_make_new(const mp_obj_type_t *type, size_t n_args, c mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); mp_obj_t pins = args[ARG_pins].u_obj; + validate_no_duplicate_pins(pins, MP_QSTR_row_pins); // mp_obj_len() will be >= 0. const size_t num_pins = (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(pins)); diff --git a/shared-bindings/keypad/__init__.c b/shared-bindings/keypad/__init__.c index 30d3dd49f0..e12992ec5f 100644 --- a/shared-bindings/keypad/__init__.c +++ b/shared-bindings/keypad/__init__.c @@ -57,3 +57,5 @@ const mp_obj_module_t keypad_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&keypad_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_keypad, keypad_module, CIRCUITPY_KEYPAD); diff --git a/shared-bindings/math/__init__.c b/shared-bindings/math/__init__.c index f5a8ca9cb3..e38b0a2f7e 100644 --- a/shared-bindings/math/__init__.c +++ b/shared-bindings/math/__init__.c @@ -427,4 +427,6 @@ const mp_obj_module_t math_module = { .globals = (mp_obj_dict_t *)&mp_module_math_globals, }; -#endif // MICROPY_PY_BUILTINS_FLOAT && MICROPY_PY_MATH +MP_REGISTER_MODULE(MP_QSTR_math, math_module, CIRCUITPY_MATH); + +#endif // MICROPY_PY_BUILTINS_FLOAT diff --git a/shared-bindings/memorymonitor/__init__.c b/shared-bindings/memorymonitor/__init__.c index f6546c25d5..64a3a6a77f 100644 --- a/shared-bindings/memorymonitor/__init__.c +++ b/shared-bindings/memorymonitor/__init__.c @@ -74,3 +74,5 @@ const mp_obj_module_t memorymonitor_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&memorymonitor_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_memorymonitor, memorymonitor_module, CIRCUITPY_MEMORYMONITOR); diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c index acb1710f3d..78c1c90f4d 100644 --- a/shared-bindings/microcontroller/Pin.c +++ b/shared-bindings/microcontroller/Pin.c @@ -105,6 +105,45 @@ mcu_pin_obj_t *validate_obj_is_free_pin(mp_obj_t obj) { return pin; } +// Validate every element in the list is a unique pin +void validate_no_duplicate_pins(mp_obj_t seq, qstr arg_name) { + const size_t num_pins = (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(seq)); + + for (size_t pin_cnt = 0; pin_cnt < num_pins; pin_cnt++) { + mp_obj_t pin1_obj = mp_obj_subscr(seq, MP_OBJ_NEW_SMALL_INT(pin_cnt), MP_OBJ_SENTINEL); + mcu_pin_obj_t *pin1 = validate_obj_is_pin(pin1_obj); + + for (size_t pin_cnt_2 = pin_cnt + 1; pin_cnt_2 < num_pins; pin_cnt_2++) { + mp_obj_t pin2_obj = mp_obj_subscr(seq, MP_OBJ_NEW_SMALL_INT(pin_cnt_2), MP_OBJ_SENTINEL); + mcu_pin_obj_t *pin2 = validate_obj_is_pin(pin2_obj); + if (pin1 == pin2) { + mp_raise_TypeError_varg(translate("%q contains duplicate pins"), arg_name); + } + } + } +} + +void validate_no_duplicate_pins_2(mp_obj_t seq1, mp_obj_t seq2, qstr arg_name1, qstr arg_name2) { + const size_t num_pins_1 = (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(seq1)); + const size_t num_pins_2 = (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(seq2)); + + validate_no_duplicate_pins(seq1, arg_name1); + validate_no_duplicate_pins(seq2, arg_name2); + + for (size_t pin_cnt_1 = 0; pin_cnt_1 < num_pins_1; pin_cnt_1++) { + mp_obj_t pin1_obj = mp_obj_subscr(seq1, MP_OBJ_NEW_SMALL_INT(pin_cnt_1), MP_OBJ_SENTINEL); + mcu_pin_obj_t *pin1 = validate_obj_is_pin(pin1_obj); + + for (size_t pin_cnt_2 = 0; pin_cnt_2 < num_pins_2; pin_cnt_2++) { + mp_obj_t pin2_obj = mp_obj_subscr(seq2, MP_OBJ_NEW_SMALL_INT(pin_cnt_2), MP_OBJ_SENTINEL); + mcu_pin_obj_t *pin2 = validate_obj_is_pin(pin2_obj); + if (pin1 == pin2) { + mp_raise_TypeError_varg(translate("%q and %q contain duplicate pins"), arg_name1, arg_name2); + } + } + } +} + // Validate every element in the list to be a free pin. void validate_list_is_free_pins(qstr what, mcu_pin_obj_t **pins_out, mp_int_t max_pins, mp_obj_t seq, uint8_t *count_out) { mp_int_t len = MP_OBJ_SMALL_INT_VALUE(mp_obj_len(seq)); diff --git a/shared-bindings/microcontroller/Pin.h b/shared-bindings/microcontroller/Pin.h index 44019ff267..a8ac6eeb1c 100644 --- a/shared-bindings/microcontroller/Pin.h +++ b/shared-bindings/microcontroller/Pin.h @@ -37,6 +37,8 @@ mcu_pin_obj_t *validate_obj_is_pin(mp_obj_t obj); mcu_pin_obj_t *validate_obj_is_pin_or_none(mp_obj_t obj); mcu_pin_obj_t *validate_obj_is_free_pin(mp_obj_t obj); mcu_pin_obj_t *validate_obj_is_free_pin_or_none(mp_obj_t obj); +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, 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); diff --git a/shared-bindings/microcontroller/ResetReason.c b/shared-bindings/microcontroller/ResetReason.c index 1750e55204..905c19f83f 100644 --- a/shared-bindings/microcontroller/ResetReason.c +++ b/shared-bindings/microcontroller/ResetReason.c @@ -36,6 +36,7 @@ MAKE_ENUM_VALUE(mcu_reset_reason_type, reset_reason, DEEP_SLEEP_ALARM, RESET_REA MAKE_ENUM_VALUE(mcu_reset_reason_type, reset_reason, RESET_PIN, RESET_REASON_RESET_PIN); MAKE_ENUM_VALUE(mcu_reset_reason_type, reset_reason, WATCHDOG, RESET_REASON_WATCHDOG); MAKE_ENUM_VALUE(mcu_reset_reason_type, reset_reason, UNKNOWN, RESET_REASON_UNKNOWN); +MAKE_ENUM_VALUE(mcu_reset_reason_type, reset_reason, RESCUE_DEBUG, RESET_REASON_RESCUE_DEBUG); //| class ResetReason: //| """The reason the microntroller was last reset""" @@ -61,6 +62,9 @@ MAKE_ENUM_VALUE(mcu_reset_reason_type, reset_reason, UNKNOWN, RESET_REASON_UNKNO //| UNKNOWN: object //| """The microntroller restarted for an unknown reason.""" //| +//| RESCUE_DEBUG: object +//| """The microntroller was reset by the rescue debug port.""" +//| MAKE_ENUM_MAP(mcu_reset_reason) { MAKE_ENUM_MAP_ENTRY(reset_reason, POWER_ON), MAKE_ENUM_MAP_ENTRY(reset_reason, BROWNOUT), @@ -69,6 +73,7 @@ MAKE_ENUM_MAP(mcu_reset_reason) { MAKE_ENUM_MAP_ENTRY(reset_reason, RESET_PIN), MAKE_ENUM_MAP_ENTRY(reset_reason, WATCHDOG), MAKE_ENUM_MAP_ENTRY(reset_reason, UNKNOWN), + MAKE_ENUM_MAP_ENTRY(reset_reason, RESCUE_DEBUG), }; STATIC MP_DEFINE_CONST_DICT(mcu_reset_reason_locals_dict, mcu_reset_reason_locals_table); diff --git a/shared-bindings/microcontroller/ResetReason.h b/shared-bindings/microcontroller/ResetReason.h index 8ed5e48315..7abc54c00b 100644 --- a/shared-bindings/microcontroller/ResetReason.h +++ b/shared-bindings/microcontroller/ResetReason.h @@ -38,6 +38,7 @@ typedef enum { RESET_REASON_RESET_PIN, RESET_REASON_WATCHDOG, RESET_REASON_UNKNOWN, + RESET_REASON_RESCUE_DEBUG, } mcu_reset_reason_t; extern const mp_obj_type_t mcu_reset_reason_type; diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c index 053958cca1..ad77eb6536 100644 --- a/shared-bindings/microcontroller/__init__.c +++ b/shared-bindings/microcontroller/__init__.c @@ -193,3 +193,5 @@ const mp_obj_module_t microcontroller_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&mcu_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_microcontroller, microcontroller_module, CIRCUITPY_MICROCONTROLLER); diff --git a/shared-bindings/msgpack/__init__.c b/shared-bindings/msgpack/__init__.c index c4852f5427..65d5558e60 100644 --- a/shared-bindings/msgpack/__init__.c +++ b/shared-bindings/msgpack/__init__.c @@ -160,3 +160,5 @@ const mp_obj_module_t msgpack_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&msgpack_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_msgpack, msgpack_module, CIRCUITPY_MSGPACK); diff --git a/shared-bindings/neopixel_write/__init__.c b/shared-bindings/neopixel_write/__init__.c index a1f01e506f..ae30518bd1 100644 --- a/shared-bindings/neopixel_write/__init__.c +++ b/shared-bindings/neopixel_write/__init__.c @@ -81,3 +81,5 @@ const mp_obj_module_t neopixel_write_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&neopixel_write_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_neopixel_write, neopixel_write_module, CIRCUITPY_NEOPIXEL_WRITE); diff --git a/shared-bindings/busio/OneWire.c b/shared-bindings/onewireio/OneWire.c similarity index 54% rename from shared-bindings/busio/OneWire.c rename to shared-bindings/onewireio/OneWire.c index 026e1ee968..406b421fd1 100644 --- a/shared-bindings/busio/OneWire.c +++ b/shared-bindings/onewireio/OneWire.c @@ -31,37 +31,33 @@ #include "py/runtime.h" #include "py/runtime0.h" #include "shared-bindings/microcontroller/Pin.h" -#include "shared-bindings/busio/OneWire.h" +#include "shared-bindings/onewireio/OneWire.h" #include "shared-bindings/util.h" //| class OneWire: -//| """Lowest-level of the Maxim OneWire protocol""" -//| //| def __init__(self, pin: microcontroller.Pin) -> None: -//| """(formerly Dallas Semi) OneWire protocol. +//| """Create a OneWire object associated with the given pin. //| -//| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 -//| -//| .. class:: OneWire(pin) -//| -//| Create a OneWire object associated with the given pin. The object -//| implements the lowest level timing-sensitive bits of the protocol. +//| The object implements the lowest level timing-sensitive bits of the protocol. //| //| :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 busio +//| import onewireio //| import board //| -//| onewire = busio.OneWire(board.D7) +//| onewire = onewireio.OneWire(board.D7) //| onewire.reset() //| onewire.write_bit(True) //| onewire.write_bit(False) //| print(onewire.read_bit())""" //| ... //| -STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +STATIC mp_obj_t onewireio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_pin }; static const mp_arg_t allowed_args[] = { { MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, @@ -70,10 +66,10 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, mp_arg_parse_all(n_args, pos_args, kw_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); - busio_onewire_obj_t *self = m_new_obj(busio_onewire_obj_t); - self->base.type = &busio_onewire_type; + onewireio_onewire_obj_t *self = m_new_obj(onewireio_onewire_obj_t); + self->base.type = &onewireio_onewire_type; - common_hal_busio_onewire_construct(self, pin); + common_hal_onewireio_onewire_construct(self, pin); return MP_OBJ_FROM_PTR(self); } @@ -81,15 +77,15 @@ STATIC mp_obj_t busio_onewire_make_new(const mp_obj_type_t *type, size_t n_args, //| """Deinitialize the OneWire bus and release any hardware resources for reuse.""" //| ... //| -STATIC mp_obj_t busio_onewire_deinit(mp_obj_t self_in) { - busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); - common_hal_busio_onewire_deinit(self); +STATIC mp_obj_t onewireio_onewire_deinit(mp_obj_t self_in) { + onewireio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); + common_hal_onewireio_onewire_deinit(self); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_deinit_obj, busio_onewire_deinit); +STATIC MP_DEFINE_CONST_FUN_OBJ_1(onewireio_onewire_deinit_obj, onewireio_onewire_deinit); -STATIC void check_for_deinit(busio_onewire_obj_t *self) { - if (common_hal_busio_onewire_deinited(self)) { +STATIC void check_for_deinit(onewireio_onewire_obj_t *self) { + if (common_hal_onewireio_onewire_deinited(self)) { raise_deinited_error(); } } @@ -105,12 +101,12 @@ STATIC void check_for_deinit(busio_onewire_obj_t *self) { //| :ref:`lifetime-and-contextmanagers` for more info.""" //| ... //| -STATIC mp_obj_t busio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) { +STATIC mp_obj_t onewireio_onewire_obj___exit__(size_t n_args, const mp_obj_t *args) { (void)n_args; - common_hal_busio_onewire_deinit(args[0]); + common_hal_onewireio_onewire_deinit(args[0]); return mp_const_none; } -STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, busio_onewire_obj___exit__); +STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(onewireio_onewire___exit___obj, 4, 4, onewireio_onewire_obj___exit__); //| def reset(self) -> bool: //| """Reset the OneWire bus and read presence @@ -119,13 +115,13 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(busio_onewire___exit___obj, 4, 4, bus //| :rtype: bool""" //| ... //| -STATIC mp_obj_t busio_onewire_obj_reset(mp_obj_t self_in) { - busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t onewireio_onewire_obj_reset(mp_obj_t self_in) { + onewireio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - return mp_obj_new_bool(common_hal_busio_onewire_reset(self)); + return mp_obj_new_bool(common_hal_onewireio_onewire_reset(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset); +MP_DEFINE_CONST_FUN_OBJ_1(onewireio_onewire_reset_obj, onewireio_onewire_obj_reset); //| def read_bit(self) -> bool: //| """Read in a bit @@ -134,41 +130,41 @@ MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_reset_obj, busio_onewire_obj_reset); //| :rtype: bool""" //| ... //| -STATIC mp_obj_t busio_onewire_obj_read_bit(mp_obj_t self_in) { - busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t onewireio_onewire_obj_read_bit(mp_obj_t self_in) { + onewireio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - return mp_obj_new_bool(common_hal_busio_onewire_read_bit(self)); + return mp_obj_new_bool(common_hal_onewireio_onewire_read_bit(self)); } -MP_DEFINE_CONST_FUN_OBJ_1(busio_onewire_read_bit_obj, busio_onewire_obj_read_bit); +MP_DEFINE_CONST_FUN_OBJ_1(onewireio_onewire_read_bit_obj, onewireio_onewire_obj_read_bit); //| def write_bit(self, value: bool) -> None: //| """Write out a bit based on value.""" //| ... //| -STATIC mp_obj_t busio_onewire_obj_write_bit(mp_obj_t self_in, mp_obj_t bool_obj) { - busio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t onewireio_onewire_obj_write_bit(mp_obj_t self_in, mp_obj_t bool_obj) { + onewireio_onewire_obj_t *self = MP_OBJ_TO_PTR(self_in); check_for_deinit(self); - common_hal_busio_onewire_write_bit(self, mp_obj_is_true(bool_obj)); + common_hal_onewireio_onewire_write_bit(self, mp_obj_is_true(bool_obj)); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(busio_onewire_write_bit_obj, busio_onewire_obj_write_bit); +MP_DEFINE_CONST_FUN_OBJ_2(onewireio_onewire_write_bit_obj, onewireio_onewire_obj_write_bit); -STATIC const mp_rom_map_elem_t busio_onewire_locals_dict_table[] = { +STATIC const mp_rom_map_elem_t onewireio_onewire_locals_dict_table[] = { // Methods - { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&busio_onewire_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&onewireio_onewire_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, - { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&busio_onewire___exit___obj) }, - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&busio_onewire_reset_obj) }, - { MP_ROM_QSTR(MP_QSTR_read_bit), MP_ROM_PTR(&busio_onewire_read_bit_obj) }, - { MP_ROM_QSTR(MP_QSTR_write_bit), MP_ROM_PTR(&busio_onewire_write_bit_obj) }, + { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&onewireio_onewire___exit___obj) }, + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&onewireio_onewire_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_read_bit), MP_ROM_PTR(&onewireio_onewire_read_bit_obj) }, + { MP_ROM_QSTR(MP_QSTR_write_bit), MP_ROM_PTR(&onewireio_onewire_write_bit_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(busio_onewire_locals_dict, busio_onewire_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(onewireio_onewire_locals_dict, onewireio_onewire_locals_dict_table); -const mp_obj_type_t busio_onewire_type = { +const mp_obj_type_t onewireio_onewire_type = { { &mp_type_type }, .name = MP_QSTR_OneWire, - .make_new = busio_onewire_make_new, - .locals_dict = (mp_obj_dict_t *)&busio_onewire_locals_dict, + .make_new = onewireio_onewire_make_new, + .locals_dict = (mp_obj_dict_t *)&onewireio_onewire_locals_dict, }; diff --git a/shared-bindings/bitbangio/OneWire.h b/shared-bindings/onewireio/OneWire.h similarity index 63% rename from shared-bindings/bitbangio/OneWire.h rename to shared-bindings/onewireio/OneWire.h index 0dbc975122..c6d0fd6ebb 100644 --- a/shared-bindings/bitbangio/OneWire.h +++ b/shared-bindings/onewireio/OneWire.h @@ -24,20 +24,20 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_BITBANGIO_ONEWIRE_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_BITBANGIO_ONEWIRE_H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_ONEWIREIO_ONEWIRE_H +#define MICROPY_INCLUDED_SHARED_BINDINGS_ONEWIREIO_ONEWIRE_H #include "common-hal/microcontroller/Pin.h" -#include "shared-module/bitbangio/OneWire.h" +#include "shared-module/onewireio/OneWire.h" -extern const mp_obj_type_t bitbangio_onewire_type; +extern const mp_obj_type_t onewireio_onewire_type; -extern void shared_module_bitbangio_onewire_construct(bitbangio_onewire_obj_t *self, +extern void common_hal_onewireio_onewire_construct(onewireio_onewire_obj_t *self, const mcu_pin_obj_t *pin); -extern void shared_module_bitbangio_onewire_deinit(bitbangio_onewire_obj_t *self); -extern bool shared_module_bitbangio_onewire_deinited(bitbangio_onewire_obj_t *self); -extern bool shared_module_bitbangio_onewire_reset(bitbangio_onewire_obj_t *self); -extern bool shared_module_bitbangio_onewire_read_bit(bitbangio_onewire_obj_t *self); -extern void shared_module_bitbangio_onewire_write_bit(bitbangio_onewire_obj_t *self, bool bit); +extern void common_hal_onewireio_onewire_deinit(onewireio_onewire_obj_t *self); +extern bool common_hal_onewireio_onewire_deinited(onewireio_onewire_obj_t *self); +extern bool common_hal_onewireio_onewire_reset(onewireio_onewire_obj_t *self); +extern bool common_hal_onewireio_onewire_read_bit(onewireio_onewire_obj_t *self); +extern void common_hal_onewireio_onewire_write_bit(onewireio_onewire_obj_t *self, bool bit); -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BITBANGIO_ONEWIRE_H +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_ONEWIREIO_ONEWIRE_H diff --git a/shared-bindings/onewireio/__init__.c b/shared-bindings/onewireio/__init__.c new file mode 100644 index 0000000000..45d78b250a --- /dev/null +++ b/shared-bindings/onewireio/__init__.c @@ -0,0 +1,55 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 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/runtime.h" + +#include "shared-bindings/microcontroller/Pin.h" +#include "shared-bindings/onewireio/__init__.h" +#include "shared-bindings/onewireio/OneWire.h" + +#include "py/runtime.h" + +//| """Low-level bit primitives for Maxim (formerly Dallas Semi) one-wire protocol. +//| +//| Protocol definition is here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126""" +//| + +STATIC const mp_rom_map_elem_t onewireio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_onewireio) }, + { MP_ROM_QSTR(MP_QSTR_OneWire), MP_ROM_PTR(&onewireio_onewire_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(onewireio_module_globals, onewireio_module_globals_table); + +const mp_obj_module_t onewireio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&onewireio_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_onewireio, onewireio_module, CIRCUITPY_ONEWIREIO); diff --git a/ports/nrf/common-hal/busio/OneWire.h b/shared-bindings/onewireio/__init__.h similarity index 84% rename from ports/nrf/common-hal/busio/OneWire.h rename to shared-bindings/onewireio/__init__.h index 821cc64c1e..25384f6a7b 100644 --- a/ports/nrf/common-hal/busio/OneWire.h +++ b/shared-bindings/onewireio/__init__.h @@ -24,10 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_ONEWIRE_H +#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_ONEWIREIO___INIT___H +#define MICROPY_INCLUDED_SHARED_BINDINGS_ONEWIREIO___INIT___H -// Use bitbangio. -#include "shared-module/busio/OneWire.h" +#include "py/obj.h" -#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BUSIO_ONEWIRE_H +// Nothing now. + +#endif // MICROPY_INCLUDED_SHARED_BINDINGS_ONEWIREIO___INIT___H diff --git a/shared-bindings/displayio/ParallelBus.c b/shared-bindings/paralleldisplay/ParallelBus.c similarity index 71% rename from shared-bindings/displayio/ParallelBus.c rename to shared-bindings/paralleldisplay/ParallelBus.c index efa64dddf4..804886233a 100644 --- a/shared-bindings/displayio/ParallelBus.c +++ b/shared-bindings/paralleldisplay/ParallelBus.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "shared-bindings/displayio/ParallelBus.h" +#include "shared-bindings/paralleldisplay/ParallelBus.h" #include @@ -42,7 +42,7 @@ //| protocol may be refered to as 8080-I Series Parallel Interface in datasheets. It doesn't handle //| display initialization.""" //| -//| def __init__(self, *, data0: microcontroller.Pin, command: microcontroller.Pin, chip_select: microcontroller.Pin, write: microcontroller.Pin, read: microcontroller.Pin, reset: microcontroller.Pin) -> None: +//| def __init__(self, *, data0: microcontroller.Pin, command: microcontroller.Pin, chip_select: microcontroller.Pin, write: microcontroller.Pin, read: microcontroller.Pin, reset: microcontroller.Pin, frequency: int = 30_000_000) -> None: //| """Create a ParallelBus object associated with the given pins. The bus is inferred from data0 //| by implying the next 7 additional pins on a given GPIO port. //| @@ -56,10 +56,11 @@ //| :param microcontroller.Pin chip_select: Chip select pin //| :param microcontroller.Pin write: Write pin //| :param microcontroller.Pin read: Read pin -//| :param microcontroller.Pin reset: Reset pin""" +//| :param microcontroller.Pin reset: Reset pin +//| :param int frequency: The communication frequency in Hz for the display on the bus""" //| ... //| -STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { +STATIC mp_obj_t paralleldisplay_parallelbus_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { enum { ARG_data0, ARG_command, ARG_chip_select, ARG_write, ARG_read, ARG_reset, ARG_frequency }; static const mp_arg_t allowed_args[] = { { MP_QSTR_data0, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, @@ -80,10 +81,10 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t mcu_pin_obj_t *read = validate_obj_is_free_pin(args[ARG_read].u_obj); mcu_pin_obj_t *reset = validate_obj_is_free_pin(args[ARG_reset].u_obj); - displayio_parallelbus_obj_t *self = &allocate_display_bus_or_raise()->parallel_bus; - self->base.type = &displayio_parallelbus_type; + paralleldisplay_parallelbus_obj_t *self = &allocate_display_bus_or_raise()->parallel_bus; + self->base.type = ¶lleldisplay_parallelbus_type; - common_hal_displayio_parallelbus_construct(self, data0, command, chip_select, write, read, reset, args[ARG_frequency].u_int); + common_hal_paralleldisplay_parallelbus_construct(self, data0, command, chip_select, write, read, reset, args[ARG_frequency].u_int); return self; } @@ -93,22 +94,22 @@ STATIC mp_obj_t displayio_parallelbus_make_new(const mp_obj_type_t *type, size_t //| ... //| -STATIC mp_obj_t displayio_parallelbus_obj_reset(mp_obj_t self_in) { - displayio_parallelbus_obj_t *self = self_in; +STATIC mp_obj_t paralleldisplay_parallelbus_obj_reset(mp_obj_t self_in) { + paralleldisplay_parallelbus_obj_t *self = self_in; - if (!common_hal_displayio_parallelbus_reset(self)) { + if (!common_hal_paralleldisplay_parallelbus_reset(self)) { mp_raise_RuntimeError(translate("no reset pin available")); } return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_1(displayio_parallelbus_reset_obj, displayio_parallelbus_obj_reset); +MP_DEFINE_CONST_FUN_OBJ_1(paralleldisplay_parallelbus_reset_obj, paralleldisplay_parallelbus_obj_reset); //| def send(self, command: int, data: ReadableBuffer) -> None: //| """Sends the given command value followed by the full set of data. Display state, such as //| vertical scroll, set via ``send`` may or may not be reset once the code is done.""" //| ... //| -STATIC mp_obj_t displayio_parallelbus_obj_send(mp_obj_t self, mp_obj_t command_obj, mp_obj_t data_obj) { +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")); @@ -118,26 +119,26 @@ STATIC mp_obj_t displayio_parallelbus_obj_send(mp_obj_t self, mp_obj_t command_o mp_get_buffer_raise(data_obj, &bufinfo, MP_BUFFER_READ); // Wait for display bus to be available. - while (!common_hal_displayio_parallelbus_begin_transaction(self)) { + while (!common_hal_paralleldisplay_parallelbus_begin_transaction(self)) { RUN_BACKGROUND_TASKS; } - common_hal_displayio_parallelbus_send(self, DISPLAY_COMMAND, CHIP_SELECT_UNTOUCHED, &command, 1); - common_hal_displayio_parallelbus_send(self, DISPLAY_DATA, CHIP_SELECT_UNTOUCHED, ((uint8_t *)bufinfo.buf), bufinfo.len); - common_hal_displayio_parallelbus_end_transaction(self); + common_hal_paralleldisplay_parallelbus_send(self, DISPLAY_COMMAND, CHIP_SELECT_UNTOUCHED, &command, 1); + common_hal_paralleldisplay_parallelbus_send(self, DISPLAY_DATA, CHIP_SELECT_UNTOUCHED, ((uint8_t *)bufinfo.buf), bufinfo.len); + common_hal_paralleldisplay_parallelbus_end_transaction(self); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_3(displayio_parallelbus_send_obj, displayio_parallelbus_obj_send); +MP_DEFINE_CONST_FUN_OBJ_3(paralleldisplay_parallelbus_send_obj, paralleldisplay_parallelbus_obj_send); -STATIC const mp_rom_map_elem_t displayio_parallelbus_locals_dict_table[] = { - { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(&displayio_parallelbus_reset_obj) }, - { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&displayio_parallelbus_send_obj) }, +STATIC const mp_rom_map_elem_t paralleldisplay_parallelbus_locals_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_reset), MP_ROM_PTR(¶lleldisplay_parallelbus_reset_obj) }, + { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(¶lleldisplay_parallelbus_send_obj) }, }; -STATIC MP_DEFINE_CONST_DICT(displayio_parallelbus_locals_dict, displayio_parallelbus_locals_dict_table); +STATIC MP_DEFINE_CONST_DICT(paralleldisplay_parallelbus_locals_dict, paralleldisplay_parallelbus_locals_dict_table); -const mp_obj_type_t displayio_parallelbus_type = { +const mp_obj_type_t paralleldisplay_parallelbus_type = { { &mp_type_type }, .name = MP_QSTR_ParallelBus, - .make_new = displayio_parallelbus_make_new, - .locals_dict = (mp_obj_dict_t *)&displayio_parallelbus_locals_dict, + .make_new = paralleldisplay_parallelbus_make_new, + .locals_dict = (mp_obj_dict_t *)¶lleldisplay_parallelbus_locals_dict, }; diff --git a/shared-bindings/displayio/ParallelBus.h b/shared-bindings/paralleldisplay/ParallelBus.h similarity index 67% rename from shared-bindings/displayio/ParallelBus.h rename to shared-bindings/paralleldisplay/ParallelBus.h index 1a61aae0af..cd9e32f9be 100644 --- a/shared-bindings/displayio/ParallelBus.h +++ b/shared-bindings/paralleldisplay/ParallelBus.h @@ -24,31 +24,28 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYBUSIO_PARALLELBUS_H -#define MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYBUSIO_PARALLELBUS_H +#pragma once -#include "common-hal/displayio/ParallelBus.h" +#include "common-hal/paralleldisplay/ParallelBus.h" #include "common-hal/microcontroller/Pin.h" #include "shared-bindings/displayio/__init__.h" #include "shared-module/displayio/Group.h" -extern const mp_obj_type_t displayio_parallelbus_type; +extern const mp_obj_type_t paralleldisplay_parallelbus_type; -void common_hal_displayio_parallelbus_construct(displayio_parallelbus_obj_t *self, +void common_hal_paralleldisplay_parallelbus_construct(paralleldisplay_parallelbus_obj_t *self, const mcu_pin_obj_t *data0, const mcu_pin_obj_t *command, const mcu_pin_obj_t *chip_select, const mcu_pin_obj_t *write, const mcu_pin_obj_t *read, const mcu_pin_obj_t *reset, uint32_t frequency); -void common_hal_displayio_parallelbus_deinit(displayio_parallelbus_obj_t *self); +void common_hal_paralleldisplay_parallelbus_deinit(paralleldisplay_parallelbus_obj_t *self); -bool common_hal_displayio_parallelbus_reset(mp_obj_t self); -bool common_hal_displayio_parallelbus_bus_free(mp_obj_t self); +bool common_hal_paralleldisplay_parallelbus_reset(mp_obj_t self); +bool common_hal_paralleldisplay_parallelbus_bus_free(mp_obj_t self); -bool common_hal_displayio_parallelbus_begin_transaction(mp_obj_t self); +bool common_hal_paralleldisplay_parallelbus_begin_transaction(mp_obj_t self); -void common_hal_displayio_parallelbus_send(mp_obj_t self, display_byte_type_t byte_type, +void common_hal_paralleldisplay_parallelbus_send(mp_obj_t self, display_byte_type_t byte_type, display_chip_select_behavior_t chip_select, const uint8_t *data, uint32_t data_length); -void common_hal_displayio_parallelbus_end_transaction(mp_obj_t self); - -#endif // MICROPY_INCLUDED_SHARED_BINDINGS_DISPLAYBUSIO_PARALLELBUS_H +void common_hal_paralleldisplay_parallelbus_end_transaction(mp_obj_t self); diff --git a/shared-bindings/gamepad/__init__.c b/shared-bindings/paralleldisplay/__init__.c similarity index 60% rename from shared-bindings/gamepad/__init__.c rename to shared-bindings/paralleldisplay/__init__.c index 273f109bf5..e87479a9f9 100644 --- a/shared-bindings/gamepad/__init__.c +++ b/shared-bindings/paralleldisplay/__init__.c @@ -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 @@ -23,22 +23,29 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ + +#include + +#include "py/enum.h" #include "py/obj.h" #include "py/runtime.h" -#include "py/mphal.h" -#include "shared-bindings/gamepad/GamePad.h" -#include "shared-bindings/util.h" -//| """Button handling in the background""" -//| -STATIC const mp_rom_map_elem_t gamepad_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_gamepad) }, - { MP_OBJ_NEW_QSTR(MP_QSTR_GamePad), MP_ROM_PTR(&gamepad_type)}, +#include "shared-bindings/paralleldisplay/__init__.h" +#include "shared-bindings/paralleldisplay/ParallelBus.h" + +//| """Native helpers for driving parallel displays""" + + +STATIC const mp_rom_map_elem_t paralleldisplay_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_paralleldisplay) }, + { MP_ROM_QSTR(MP_QSTR_ParallelBus), MP_ROM_PTR(¶lleldisplay_parallelbus_type) }, }; -STATIC MP_DEFINE_CONST_DICT(gamepad_module_globals, - gamepad_module_globals_table); -const mp_obj_module_t gamepad_module = { +STATIC MP_DEFINE_CONST_DICT(paralleldisplay_module_globals, paralleldisplay_module_globals_table); + +const mp_obj_module_t paralleldisplay_module = { .base = { &mp_type_module }, - .globals = (mp_obj_dict_t *)&gamepad_module_globals, + .globals = (mp_obj_dict_t *)¶lleldisplay_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_paralleldisplay, paralleldisplay_module, CIRCUITPY_PARALLELDISPLAY); diff --git a/shared-bindings/paralleldisplay/__init__.h b/shared-bindings/paralleldisplay/__init__.h new file mode 100644 index 0000000000..f7b42875a1 --- /dev/null +++ b/shared-bindings/paralleldisplay/__init__.h @@ -0,0 +1,27 @@ +/* + * 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 diff --git a/shared-bindings/ps2io/__init__.c b/shared-bindings/ps2io/__init__.c index a71ffd515f..517816dbcf 100644 --- a/shared-bindings/ps2io/__init__.c +++ b/shared-bindings/ps2io/__init__.c @@ -59,3 +59,5 @@ const mp_obj_module_t ps2io_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&ps2io_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_ps2io, ps2io_module, CIRCUITPY_PS2IO); diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index ccea353386..88d7eb40e0 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -41,10 +41,15 @@ //| pulsed signal consists of timed on and off periods. Unlike PWM, there is no set duration //| for on and off pairs.""" //| -//| def __init__(self, carrier: pwmio.PWMOut) -> None: -//| """Create a PulseOut object associated with the given PWMout object. +//| def __init__(self, pin: microcontroller.Pin, *, frequency: int = 38000, duty_cycle: int = 1 << 15) -> None: +//| """Create a PulseOut object associated with the given pin. //| -//| :param ~pwmio.PWMOut carrier: PWMOut that is set to output on the desired pin. +//| :param ~microcontroller.Pin pin: Signal output pin +//| :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:: //| @@ -54,8 +59,7 @@ //| import board //| //| # 50% duty cycle at 38kHz. -//| pwm = pwmio.PWMOut(board.D13, frequency=38000, duty_cycle=32768) -//| pulse = pulseio.PulseOut(pwm) +//| pwm = pulseio.PulseOut(board.D13, frequency=38000, duty_cycle=32768) //| # on off on off on //| pulses = array.array('H', [65000, 1000, 65000, 65000, 1000]) //| pulse.send(pulses) @@ -66,27 +70,30 @@ //| ... //| STATIC mp_obj_t pulseio_pulseout_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_pin, ARG_frequency, ARG_duty_cycle}; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 38000} }, + { MP_QSTR_duty_cycle, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1 << 15} }, + }; + 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 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; - - mp_obj_t carrier_obj = pos_args[0]; - if (mp_obj_is_type(carrier_obj, &pwmio_pwmout_type)) { - // Use a PWMOut Carrier - mp_arg_check_num(n_args, kw_args, 1, 1, false); - common_hal_pulseio_pulseout_construct(self, (pwmio_pwmout_obj_t *)MP_OBJ_TO_PTR(carrier_obj), NULL, 0, 0); - } else { - // Use a Pin, frequency, and duty cycle - enum { ARG_pin, ARG_frequency}; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_pin, MP_ARG_REQUIRED | MP_ARG_OBJ }, - { MP_QSTR_frequency, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 38000} }, - { MP_QSTR_duty_cycle, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1 << 15} }, - }; - 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 mcu_pin_obj_t *pin = validate_obj_is_free_pin(args[ARG_pin].u_obj); - common_hal_pulseio_pulseout_construct(self, NULL, pin, args[ARG_frequency].u_int, args[ARG_frequency].u_int); - } + common_hal_pulseio_pulseout_construct(self, pin, frequency, duty_cycle); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/pulseio/PulseOut.h b/shared-bindings/pulseio/PulseOut.h index dce58a63e0..0c64c1363a 100644 --- a/shared-bindings/pulseio/PulseOut.h +++ b/shared-bindings/pulseio/PulseOut.h @@ -34,7 +34,6 @@ extern const mp_obj_type_t pulseio_pulseout_type; extern void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t *self, - const pwmio_pwmout_obj_t *carrier, const mcu_pin_obj_t *pin, uint32_t frequency, uint16_t duty_cycle); diff --git a/shared-bindings/pulseio/__init__.c b/shared-bindings/pulseio/__init__.c index 12050c9d36..0dba6ffad6 100644 --- a/shared-bindings/pulseio/__init__.c +++ b/shared-bindings/pulseio/__init__.c @@ -58,3 +58,5 @@ const mp_obj_module_t pulseio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&pulseio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_pulseio, pulseio_module, CIRCUITPY_PULSEIO); diff --git a/shared-bindings/pwmio/PWMOut.c b/shared-bindings/pwmio/PWMOut.c index 2a1bda2d38..e34b27ad4a 100644 --- a/shared-bindings/pwmio/PWMOut.c +++ b/shared-bindings/pwmio/PWMOut.c @@ -35,6 +35,39 @@ #include "shared-bindings/util.h" #include "supervisor/shared/translate.h" + +void common_hal_pwmio_pwmout_raise_error(pwmout_result_t result) { + switch (result) { + case PWMOUT_OK: + break; + case PWMOUT_INVALID_PIN: + mp_raise_ValueError(translate("Invalid pin")); + break; + case PWMOUT_INVALID_FREQUENCY: + mp_raise_ValueError(translate("Invalid PWM frequency")); + break; + case PWMOUT_INVALID_FREQUENCY_ON_PIN: + mp_raise_ValueError(translate("Frequency must match existing PWMOut using this timer")); + break; + case PWMOUT_VARIABLE_FREQUENCY_NOT_AVAILABLE: + mp_raise_ValueError(translate("Cannot vary frequency on a timer that is already in use")); + break; + case PWMOUT_ALL_TIMERS_ON_PIN_IN_USE: + mp_raise_ValueError(translate("All timers for this pin are in use")); + break; + case PWMOUT_ALL_TIMERS_IN_USE: + mp_raise_RuntimeError(translate("All timers in use")); + break; + case PWMOUT_ALL_CHANNELS_IN_USE: + mp_raise_RuntimeError(translate("All channels in use")); + break; + default: + case PWMOUT_INITIALIZATION_ERROR: + mp_raise_RuntimeError(translate("Could not start PWM")); + break; + } +} + //| class PWMOut: //| """Output a Pulse Width Modulated signal on a given pin.""" //| @@ -102,35 +135,7 @@ STATIC mp_obj_t pwmio_pwmout_make_new(const mp_obj_type_t *type, size_t n_args, pwmio_pwmout_obj_t *self = m_new_obj(pwmio_pwmout_obj_t); self->base.type = &pwmio_pwmout_type; pwmout_result_t result = common_hal_pwmio_pwmout_construct(self, pin, duty_cycle, frequency, variable_frequency); - switch (result) { - case PWMOUT_OK: - break; - case PWMOUT_INVALID_PIN: - mp_raise_ValueError(translate("Invalid pin")); - break; - case PWMOUT_INVALID_FREQUENCY: - mp_raise_ValueError(translate("Invalid PWM frequency")); - break; - case PWMOUT_INVALID_FREQUENCY_ON_PIN: - mp_raise_ValueError(translate("Frequency must match existing PWMOut using this timer")); - break; - case PWMOUT_VARIABLE_FREQUENCY_NOT_AVAILABLE: - mp_raise_ValueError(translate("Cannot vary frequency on a timer that is already in use")); - break; - case PWMOUT_ALL_TIMERS_ON_PIN_IN_USE: - mp_raise_ValueError(translate("All timers for this pin are in use")); - break; - case PWMOUT_ALL_TIMERS_IN_USE: - mp_raise_RuntimeError(translate("All timers in use")); - break; - case PWMOUT_ALL_CHANNELS_IN_USE: - mp_raise_RuntimeError(translate("All channels in use")); - break; - default: - case PWMOUT_INITIALIZATION_ERROR: - mp_raise_RuntimeError(translate("Could not start PWM")); - break; - } + common_hal_pwmio_pwmout_raise_error(result); return MP_OBJ_FROM_PTR(self); } diff --git a/shared-bindings/pwmio/PWMOut.h b/shared-bindings/pwmio/PWMOut.h index f4d205b215..e55205e756 100644 --- a/shared-bindings/pwmio/PWMOut.h +++ b/shared-bindings/pwmio/PWMOut.h @@ -55,8 +55,13 @@ extern void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint extern uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t *self); extern bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t *self); +// Don't use this! It is only used internally for backwards compatibility. +extern const mcu_pin_obj_t *common_hal_pwmio_pwmout_get_pin(pwmio_pwmout_obj_t *self); + // This is used by the supervisor to claim PWMOut devices indefinitely. extern void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self); extern void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self); +extern void common_hal_pwmio_pwmout_raise_error(pwmout_result_t result); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_PWMIO_PWMOUT_H diff --git a/shared-bindings/pwmio/__init__.c b/shared-bindings/pwmio/__init__.c index bf4ba31ddd..6c9e63a35f 100644 --- a/shared-bindings/pwmio/__init__.c +++ b/shared-bindings/pwmio/__init__.c @@ -71,3 +71,5 @@ const mp_obj_module_t pwmio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&pwmio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_pwmio, pwmio_module, CIRCUITPY_PWMIO); diff --git a/shared-bindings/qrio/PixelPolicy.c b/shared-bindings/qrio/PixelPolicy.c new file mode 100644 index 0000000000..6887081b24 --- /dev/null +++ b/shared-bindings/qrio/PixelPolicy.c @@ -0,0 +1,56 @@ +/* + * This file is part of the CircuitPython project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Jeff Epler + * + * 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/qrio/__init__.h" +#include "shared-bindings/qrio/PixelPolicy.h" +#include "py/obj.h" +#include "py/enum.h" + +//| class PixelPolicy: +//| EVERY_BYTE: PixelPolicy +//| """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.""" +//| +//| 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""" +//| + +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, 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, EVEN_BYTES), + MAKE_ENUM_MAP_ENTRY(qrio_pixel_policy, ODD_BYTES), +}; +STATIC MP_DEFINE_CONST_DICT(qrio_pixel_policy_locals_dict, qrio_pixel_policy_locals_table); + +MAKE_PRINTER(qrio, qrio_pixel_policy); + +MAKE_ENUM_TYPE(qrio, PixelPolicy, qrio_pixel_policy); diff --git a/shared-bindings/qrio/PixelPolicy.h b/shared-bindings/qrio/PixelPolicy.h new file mode 100644 index 0000000000..8be5dde1cc --- /dev/null +++ b/shared-bindings/qrio/PixelPolicy.h @@ -0,0 +1,39 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 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 "py/objnamedtuple.h" + +extern const mp_obj_type_t qrio_pixel_policy_type; + +typedef enum { + QRIO_EVERY_BYTE, QRIO_EVEN_BYTES, QRIO_ODD_BYTES +} 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 new file mode 100644 index 0000000000..73a5d64694 --- /dev/null +++ b/shared-bindings/qrio/QRDecoder.c @@ -0,0 +1,155 @@ +/* + * This file is part of the CircuitPython project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Jeff Epler + * + * 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/qrio/__init__.h" +#include "shared-bindings/qrio/QRDecoder.h" +#include "shared-module/qrio/QRDecoder.h" + +#include "py/obj.h" +#include "py/objproperty.h" +#include "py/enum.h" + +//| class QRDecoder: +//| +//| def __init__(self, width: int, height: int) -> None: +//| """Construct a QRDecoder object +//| +//| :param int width: The pixel width of the image to decode +//| :param int height: The pixel height of the image to decode +//| """ +//| ... + +STATIC mp_obj_t qrio_qrdecoder_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_width, ARG_height }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_width, MP_ARG_INT | MP_ARG_REQUIRED, {.u_int = 0} }, + { MP_QSTR_height, MP_ARG_INT | MP_ARG_REQUIRED, {.u_int = 0} }, + }; + 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); + + qrio_qrdecoder_obj_t *self = m_new_obj(qrio_qrdecoder_obj_t); + self->base.type = &qrio_qrdecoder_type_obj; + shared_module_qrio_qrdecoder_construct(self, args[ARG_width].u_int, args[ARG_height].u_int); + + return self; +} + +//| def decode(self, buffer: ReadableBuffer, pixel_policy: PixelPolicy = PixelPolicy.EVERY_BYTE) -> List[QRInfo]: +//| """Decode zero or more QR codes from the given image. The size of the buffer must be at least ``length``×``width`` bytes for `EVERY_BYTE`, and 2×``length``×``width`` bytes for `EVEN_BYTES` or `ODD_BYTES`.""" +//| +STATIC mp_obj_t qrio_qrdecoder_decode(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + qrio_qrdecoder_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]); + + enum { ARG_buffer, ARG_pixel_policy }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_buffer, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_int = 0} }, + { MP_QSTR_pixel_policy, MP_ARG_OBJ, {.u_obj = MP_ROM_PTR((mp_obj_t *)&qrio_pixel_policy_EVERY_BYTE_obj)} }, + }; + 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_buffer_info_t bufinfo; + mp_get_buffer_raise(args[ARG_buffer].u_obj, &bufinfo, MP_BUFFER_READ); + + int width = shared_module_qrio_qrdecoder_get_width(self); + int height = shared_module_qrio_qrdecoder_get_height(self); + + // verify that the buffer is big enough + int sz = width * height; + qrio_pixel_policy_t policy = cp_enum_value(&qrio_pixel_policy_type, args[ARG_pixel_policy].u_obj); + if (policy != QRIO_EVERY_BYTE) { + sz *= 2; + } + mp_get_index(mp_obj_get_type(args[ARG_buffer].u_obj), bufinfo.len, MP_OBJ_NEW_SMALL_INT(sz - 1), false); + + return shared_module_qrio_qrdecoder_decode(self, &bufinfo, policy); +} +MP_DEFINE_CONST_FUN_OBJ_KW(qrio_qrdecoder_decode_obj, 2, qrio_qrdecoder_decode); + +//| width: int +//| """The width of image the decoder expects""" +//| +STATIC mp_obj_t qrio_qrdecoder_get_width(mp_obj_t self_in) { + qrio_qrdecoder_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(shared_module_qrio_qrdecoder_get_width(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(qrio_qrdecoder_get_width_obj, qrio_qrdecoder_get_width); + +STATIC mp_obj_t qrio_qrdecoder_set_width(mp_obj_t self_in, mp_obj_t width_in) { + qrio_qrdecoder_obj_t *self = MP_OBJ_TO_PTR(self_in); + int width = mp_obj_get_int(width_in); + shared_module_qrio_qrdecoder_set_width(self, width); + return mp_const_none; +} +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}, +}; + +//| height: int +//| """The height of image the decoder expects""" +//| +STATIC mp_obj_t qrio_qrdecoder_get_height(mp_obj_t self_in) { + qrio_qrdecoder_obj_t *self = MP_OBJ_TO_PTR(self_in); + return mp_obj_new_int(shared_module_qrio_qrdecoder_get_height(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(qrio_qrdecoder_get_height_obj, qrio_qrdecoder_get_height); + +STATIC mp_obj_t qrio_qrdecoder_set_height(mp_obj_t self_in, mp_obj_t height_in) { + qrio_qrdecoder_obj_t *self = MP_OBJ_TO_PTR(self_in); + int height = mp_obj_get_int(height_in); + shared_module_qrio_qrdecoder_set_height(self, height); + return mp_const_none; +} +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}, +}; + +STATIC const mp_rom_map_elem_t qrio_qrdecoder_locals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_QRDecoder) }, + { MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&qrio_qrdecoder_width_obj) }, + { MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&qrio_qrdecoder_height_obj) }, + { MP_ROM_QSTR(MP_QSTR_decode), MP_ROM_PTR(&qrio_qrdecoder_decode_obj) }, +}; + +STATIC MP_DEFINE_CONST_DICT(qrio_qrdecoder_locals, qrio_qrdecoder_locals_table); + +const mp_obj_type_t qrio_qrdecoder_type_obj = { + { &mp_type_type }, + .name = MP_QSTR_QRDecoder, + .make_new = qrio_qrdecoder_make_new, + .locals_dict = (mp_obj_dict_t *)&qrio_qrdecoder_locals, +}; diff --git a/shared-bindings/qrio/QRDecoder.h b/shared-bindings/qrio/QRDecoder.h new file mode 100644 index 0000000000..0b01aeb44e --- /dev/null +++ b/shared-bindings/qrio/QRDecoder.h @@ -0,0 +1,37 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 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" + +typedef struct qrio_qrdecoder_obj qrio_qrdecoder_obj_t; + +extern const mp_obj_type_t qrio_qrdecoder_type_obj; + +void common_hal_qrio_qrdecoder_construct(qrio_qrdecoder_obj_t *self); + +mp_obj_t common_hal_qrio_qrdecoder_decode(qrio_qrdecoder_obj_t *self, int width, int height, mp_buffer_info_t *buf); diff --git a/shared-bindings/qrio/QRInfo.c b/shared-bindings/qrio/QRInfo.c new file mode 100644 index 0000000000..8eb03874ef --- /dev/null +++ b/shared-bindings/qrio/QRInfo.c @@ -0,0 +1,64 @@ +/* + * This file is part of the CircuitPython project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Jeff Epler + * + * 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/qrio/__init__.h" +#include "shared-bindings/qrio/QRInfo.h" +#include "py/obj.h" +#include "py/enum.h" + +//| class QRInfo: +//| """Information about a decoded QR code""" +//| +//| payload: bytes +//| """The content of the QR code""" +//| +//| data_type: Union[str, int] +//| """The encoding of the payload as a string (if a standard encoding) or int (if not standard)""" + +const mp_obj_namedtuple_type_t qrio_qrinfo_type_obj = { + .base = { + .base = { + .type = &mp_type_type + }, + .flags = MP_TYPE_FLAG_EXTENDED, + .name = MP_QSTR_QRInfo, + .print = namedtuple_print, + .parent = &mp_type_tuple, + .make_new = namedtuple_make_new, + .attr = namedtuple_attr, + MP_TYPE_EXTENDED_FIELDS( + .unary_op = mp_obj_tuple_unary_op, + .binary_op = mp_obj_tuple_binary_op, + .subscr = mp_obj_tuple_subscr, + .getiter = mp_obj_tuple_getiter, + ), + }, + .n_fields = 2, + .fields = { + MP_QSTR_payload, + MP_QSTR_data_type, + }, +}; diff --git a/shared-bindings/qrio/QRInfo.h b/shared-bindings/qrio/QRInfo.h new file mode 100644 index 0000000000..956cb42735 --- /dev/null +++ b/shared-bindings/qrio/QRInfo.h @@ -0,0 +1,31 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 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/objnamedtuple.h" + +extern const mp_obj_namedtuple_type_t qrio_qrinfo_type_obj; diff --git a/shared-bindings/qrio/__init__.c b/shared-bindings/qrio/__init__.c new file mode 100644 index 0000000000..b848190d7e --- /dev/null +++ b/shared-bindings/qrio/__init__.c @@ -0,0 +1,53 @@ +/* + * This file is part of the CircuitPython project, https://github.com/adafruit/circuitpython + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Jeff Epler + * + * 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/qrio/__init__.h" +#include "shared-bindings/qrio/QRDecoder.h" +#include "shared-bindings/qrio/QRInfo.h" +#include "shared-bindings/qrio/PixelPolicy.h" +#include "py/obj.h" +#include "py/enum.h" + +//| """`qrio` module. +//| +//| Provides the `QRDecoder` object.""" +//| + +STATIC const mp_rom_map_elem_t qrio_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_qrio) }, + { MP_ROM_QSTR(MP_QSTR_QRInfo), MP_ROM_PTR(&qrio_qrinfo_type_obj) }, + { MP_ROM_QSTR(MP_QSTR_QRDecoder), MP_ROM_PTR(&qrio_qrdecoder_type_obj) }, + { MP_ROM_QSTR(MP_QSTR_PixelPolicy), MP_ROM_PTR(&qrio_pixel_policy_type) }, +}; + +STATIC MP_DEFINE_CONST_DICT(qrio_module_globals, qrio_module_globals_table); + +const mp_obj_module_t qrio_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&qrio_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_qrio, qrio_module, CIRCUITPY_QRIO); diff --git a/shared-bindings/qrio/__init__.h b/shared-bindings/qrio/__init__.h new file mode 100644 index 0000000000..be9b3aefa7 --- /dev/null +++ b/shared-bindings/qrio/__init__.h @@ -0,0 +1,27 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 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 diff --git a/shared-bindings/rainbowio/__init__.c b/shared-bindings/rainbowio/__init__.c index 41a86deb60..12a33b7d0c 100644 --- a/shared-bindings/rainbowio/__init__.c +++ b/shared-bindings/rainbowio/__init__.c @@ -52,3 +52,5 @@ const mp_obj_module_t rainbowio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&rainbowio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_rainbowio, rainbowio_module, CIRCUITPY_RAINBOWIO); diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index e3ac4cdc69..d6aecbf322 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -184,3 +184,5 @@ const mp_obj_module_t random_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&mp_module_random_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_random, random_module, CIRCUITPY_RANDOM); diff --git a/shared-bindings/rgbmatrix/__init__.c b/shared-bindings/rgbmatrix/__init__.c index 451163dbec..a7da7089f5 100644 --- a/shared-bindings/rgbmatrix/__init__.c +++ b/shared-bindings/rgbmatrix/__init__.c @@ -45,3 +45,5 @@ const mp_obj_module_t rgbmatrix_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&rgbmatrix_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_rgbmatrix, rgbmatrix_module, CIRCUITPY_RGBMATRIX); diff --git a/shared-bindings/rotaryio/__init__.c b/shared-bindings/rotaryio/__init__.c index cdc7742bc1..43a884e9a1 100644 --- a/shared-bindings/rotaryio/__init__.c +++ b/shared-bindings/rotaryio/__init__.c @@ -56,3 +56,5 @@ const mp_obj_module_t rotaryio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&rotaryio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_rotaryio, rotaryio_module, CIRCUITPY_ROTARYIO); diff --git a/shared-bindings/rtc/__init__.c b/shared-bindings/rtc/__init__.c index 1071fa0eab..0220745c0f 100644 --- a/shared-bindings/rtc/__init__.c +++ b/shared-bindings/rtc/__init__.c @@ -86,3 +86,5 @@ const mp_obj_module_t rtc_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&rtc_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_rtc, rtc_module, CIRCUITPY_RTC); diff --git a/shared-bindings/sdcardio/__init__.c b/shared-bindings/sdcardio/__init__.c index e798ad0954..c64a8a38e4 100644 --- a/shared-bindings/sdcardio/__init__.c +++ b/shared-bindings/sdcardio/__init__.c @@ -45,3 +45,5 @@ const mp_obj_module_t sdcardio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&sdcardio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_sdcardio, sdcardio_module, CIRCUITPY_SDCARDIO); diff --git a/shared-bindings/sdioio/__init__.c b/shared-bindings/sdioio/__init__.c index 98867fc121..5204da22a4 100644 --- a/shared-bindings/sdioio/__init__.c +++ b/shared-bindings/sdioio/__init__.c @@ -45,3 +45,5 @@ const mp_obj_module_t sdioio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&sdioio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_sdioio, sdioio_module, CIRCUITPY_SDIOIO); diff --git a/shared-bindings/sharpdisplay/__init__.c b/shared-bindings/sharpdisplay/__init__.c index d3d3e14919..8c01c8c98c 100644 --- a/shared-bindings/sharpdisplay/__init__.c +++ b/shared-bindings/sharpdisplay/__init__.c @@ -45,3 +45,5 @@ const mp_obj_module_t sharpdisplay_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&sharpdisplay_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_sharpdisplay, sharpdisplay_module, CIRCUITPY_SHARPDISPLAY); diff --git a/shared-bindings/socketpool/__init__.c b/shared-bindings/socketpool/__init__.c index e6f36261aa..f10196ab0d 100644 --- a/shared-bindings/socketpool/__init__.c +++ b/shared-bindings/socketpool/__init__.c @@ -51,3 +51,5 @@ const mp_obj_module_t socketpool_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&socketpool_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_socketpool, socketpool_module, CIRCUITPY_SOCKETPOOL); diff --git a/shared-bindings/ssl/__init__.c b/shared-bindings/ssl/__init__.c index 151acfe80c..578c51dfbe 100644 --- a/shared-bindings/ssl/__init__.c +++ b/shared-bindings/ssl/__init__.c @@ -64,3 +64,5 @@ const mp_obj_module_t ssl_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&ssl_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_ssl, ssl_module, CIRCUITPY_SSL); diff --git a/shared-bindings/storage/__init__.c b/shared-bindings/storage/__init__.c index f19aaa4396..ddd2b9a1a9 100644 --- a/shared-bindings/storage/__init__.c +++ b/shared-bindings/storage/__init__.c @@ -165,7 +165,11 @@ MP_DEFINE_CONST_FUN_OBJ_0(storage_erase_filesystem_obj, storage_erase_filesystem //| ... //| STATIC mp_obj_t storage_disable_usb_drive(void) { + #if CIRCUITPY_USB_MSC if (!common_hal_storage_disable_usb_drive()) { + #else + if (true) { + #endif mp_raise_RuntimeError(translate("Cannot change USB devices now")); } return mp_const_none; @@ -186,7 +190,11 @@ MP_DEFINE_CONST_FUN_OBJ_0(storage_disable_usb_drive_obj, storage_disable_usb_dri //| ... //| STATIC mp_obj_t storage_enable_usb_drive(void) { + #if CIRCUITPY_USB_MSC if (!common_hal_storage_enable_usb_drive()) { + #else + if (true) { + #endif mp_raise_RuntimeError(translate("Cannot change USB devices now")); } return mp_const_none; @@ -262,3 +270,5 @@ const mp_obj_module_t storage_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&storage_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_storage, storage_module, CIRCUITPY_STORAGE); diff --git a/shared-bindings/struct/__init__.c b/shared-bindings/struct/__init__.c index 56371d3b9a..84654a3afe 100644 --- a/shared-bindings/struct/__init__.c +++ b/shared-bindings/struct/__init__.c @@ -179,3 +179,5 @@ const mp_obj_module_t struct_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&mp_module_struct_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_struct, struct_module, CIRCUITPY_STRUCT); diff --git a/shared-bindings/supervisor/__init__.c b/shared-bindings/supervisor/__init__.c index 055b3a9084..a9b99ed87d 100644 --- a/shared-bindings/supervisor/__init__.c +++ b/shared-bindings/supervisor/__init__.c @@ -32,6 +32,7 @@ #include "lib/utils/interrupt_char.h" #include "supervisor/shared/autoreload.h" +#include "supervisor/shared/bluetooth/bluetooth.h" #include "supervisor/shared/status_leds.h" #include "supervisor/shared/stack.h" #include "supervisor/shared/traceback.h" @@ -283,6 +284,21 @@ STATIC mp_obj_t supervisor_get_previous_traceback(void) { } MP_DEFINE_CONST_FUN_OBJ_0(supervisor_get_previous_traceback_obj, supervisor_get_previous_traceback); +//| def disable_ble_workflow() -> None: +//| """Disable ble workflow until a reset. This prevents BLE advertising outside of the VM and +//| the services used for it.""" +//| ... +//| +STATIC mp_obj_t supervisor_disable_ble_workflow(void) { + #if !CIRCUITPY_BLE_FILE_SERVICE && !CIRCUITPY_SERIAL_BLE + mp_raise_NotImplementedError(NULL); + #else + supervisor_bluetooth_disable_workflow(); + #endif + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_0(supervisor_disable_ble_workflow_obj, supervisor_disable_ble_workflow); + 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) }, @@ -295,6 +311,7 @@ STATIC const mp_rom_map_elem_t supervisor_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_set_next_code_file), MP_ROM_PTR(&supervisor_set_next_code_file_obj) }, { MP_ROM_QSTR(MP_QSTR_ticks_ms), MP_ROM_PTR(&supervisor_ticks_ms_obj) }, { 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) }, }; STATIC MP_DEFINE_CONST_DICT(supervisor_module_globals, supervisor_module_globals_table); @@ -303,3 +320,5 @@ const mp_obj_module_t supervisor_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&supervisor_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_supervisor, supervisor_module, CIRCUITPY_SUPERVISOR); diff --git a/shared-bindings/synthio/__init__.c b/shared-bindings/synthio/__init__.c index 90055ff0e4..72fe2eb31f 100644 --- a/shared-bindings/synthio/__init__.c +++ b/shared-bindings/synthio/__init__.c @@ -134,3 +134,5 @@ const mp_obj_module_t synthio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&synthio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_synthio, synthio_module, CIRCUITPY_SYNTHIO); diff --git a/shared-bindings/terminalio/__init__.c b/shared-bindings/terminalio/__init__.c index 084b76f21e..38313dc757 100644 --- a/shared-bindings/terminalio/__init__.c +++ b/shared-bindings/terminalio/__init__.c @@ -56,3 +56,5 @@ const mp_obj_module_t terminalio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&terminalio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_terminalio, terminalio_module, CIRCUITPY_DISPLAYIO && CIRCUITPY_TERMINALIO); diff --git a/shared-bindings/touchio/__init__.c b/shared-bindings/touchio/__init__.c index 3c3413438e..e2a6ad9317 100644 --- a/shared-bindings/touchio/__init__.c +++ b/shared-bindings/touchio/__init__.c @@ -68,3 +68,5 @@ const mp_obj_module_t touchio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&touchio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_touchio, touchio_module, CIRCUITPY_TOUCHIO); diff --git a/shared-bindings/traceback/__init__.c b/shared-bindings/traceback/__init__.c new file mode 100644 index 0000000000..37ef921cca --- /dev/null +++ b/shared-bindings/traceback/__init__.c @@ -0,0 +1,174 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/stream.h" +#include "py/runtime.h" + +#include "shared-module/traceback/__init__.h" + +//| """Traceback Module +//| +//| 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. +//| +//| """ +//| ... +//| + +STATIC void traceback_exception_common(mp_print_t *print, mp_obj_t value, mp_obj_t tb_obj, mp_obj_t limit_obj) { + if (!mp_obj_is_exception_instance(value)) { + mp_raise_TypeError(translate("invalid exception")); + } + mp_obj_exception_t exc = *(mp_obj_exception_t *)MP_OBJ_TO_PTR(value); + + mp_int_t limit = 0; + bool print_tb = true; + if (limit_obj != mp_const_none) { + limit = mp_obj_get_int(limit_obj); + print_tb = (limit != 0); + } + + if (tb_obj != mp_const_none && print_tb) { + if (!mp_obj_is_type(tb_obj, &mp_type_traceback)) { + mp_raise_TypeError(translate("invalid traceback")); + } + exc.traceback = MP_OBJ_TO_PTR(tb_obj); + } else { + exc.traceback = (mp_obj_traceback_t *)&mp_const_empty_traceback_obj; + } + + shared_module_traceback_print_exception(&exc, print, limit); +} + +//| def format_exception(etype: Type[BaseException], value: BaseException, tb: TracebackType, +//| limit: Optional[int] = None, chain: Optional[bool] = True) -> None: +//| """Format a stack trace and the exception information. +//| +//| The arguments have the same meaning as the corresponding arguments +//| to print_exception(). The return value is a list of strings, each +//| ending in a newline and some containing internal newlines. When +//| these lines are concatenated and printed, exactly the same text is +//| printed as does print_exception(). +//| +//| .. note:: Setting ``chain`` will have no effect as chained exceptions are not yet implemented. +//| +//| :param Type[BaseException] etype: This is ignored and inferred from the type of ``value``. +//| :param BaseException value: The exception. Must be an instance of `BaseException`. +//| :param TracebackType tb: The traceback object. If `None`, the traceback will not be printed. +//| :param int limit: Print up to limit stack trace entries (starting from the caller’s frame) if limit is positive. +//| Otherwise, print the last ``abs(limit)`` entries. If limit is omitted or None, all entries are printed. +//| :param bool chain: If `True` then chained exceptions will be printed (note: not yet implemented). +//| +//| """ +//| ... +//| +STATIC mp_obj_t traceback_format_exception(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_etype, ARG_value, ARG_tb, ARG_limit, ARG_chain }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_etype, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_value, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_tb, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_limit, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_chain, MP_ARG_BOOL, {.u_bool = true} }, + }; + + 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_print_t print; + vstr_t vstr; + vstr_init_print(&vstr, 0, &print); + traceback_exception_common(&print, args[ARG_value].u_obj, args[ARG_tb].u_obj, args[ARG_limit].u_obj); + return mp_obj_new_str_from_vstr(&mp_type_str, &vstr); +} + +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(traceback_format_exception_obj, 3, traceback_format_exception); + +//| def print_exception(etype: Type[BaseException], value: BaseException, tb: TracebackType, +//| limit: Optional[int] = None, file: Optional[io.FileIO] = None, chain: Optional[bool] = True) -> None: +//| +//| """Prints exception information and stack trace entries. +//| +//| .. note:: Setting ``chain`` will have no effect as chained exceptions are not yet implemented. +//| +//| :param Type[BaseException] etype: This is ignored and inferred from the type of ``value``. +//| :param BaseException value: The exception. Must be an instance of `BaseException`. +//| :param TracebackType tb: The traceback object. If `None`, the traceback will not be printed. +//| :param int limit: Print up to limit stack trace entries (starting from the caller’s frame) if limit is positive. +//| Otherwise, print the last ``abs(limit)`` entries. If limit is omitted or None, all entries are printed. +//| :param io.FileIO file: If file is omitted or `None`, the output goes to `sys.stderr`; otherwise it should be an open +//| file or file-like object to receive the output. +//| :param bool chain: If `True` then chained exceptions will be printed (note: not yet implemented). +//| +//| """ +//| ... +//| + +STATIC mp_obj_t traceback_print_exception(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + enum { ARG_etype, ARG_value, ARG_tb, ARG_limit, ARG_file, ARG_chain }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_etype, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_value, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_tb, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_limit, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_file, MP_ARG_OBJ, {.u_obj = mp_const_none} }, + { MP_QSTR_chain, MP_ARG_BOOL, {.u_bool = true} }, + }; + + 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_print_t print = mp_plat_print; + if (args[ARG_file].u_obj != mp_const_none) { + #if MICROPY_PY_IO && MICROPY_PY_SYS_STDFILES + mp_get_stream_raise(args[ARG_file].u_obj, MP_STREAM_OP_WRITE); + print.data = MP_OBJ_TO_PTR(args[ARG_file].u_obj); + print.print_strn = mp_stream_write_adaptor; + #else + mp_raise_NotImplementedError(translate("file write is not available")); + #endif + } + + traceback_exception_common(&print, args[ARG_value].u_obj, args[ARG_tb].u_obj, args[ARG_limit].u_obj); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_KW(traceback_print_exception_obj, 3, traceback_print_exception); + +STATIC const mp_rom_map_elem_t traceback_module_globals_table[] = { + // module name + { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_traceback) }, + // module functions + { MP_ROM_QSTR(MP_QSTR_format_exception), MP_ROM_PTR(&traceback_format_exception_obj) }, + { MP_ROM_QSTR(MP_QSTR_print_exception), MP_ROM_PTR(&traceback_print_exception_obj) }, +}; +STATIC MP_DEFINE_CONST_DICT(traceback_module_globals, traceback_module_globals_table); + +const mp_obj_module_t traceback_module = { + .base = { &mp_type_module }, + .globals = (mp_obj_dict_t *)&traceback_module_globals, +}; + +MP_REGISTER_MODULE(MP_QSTR_traceback, traceback_module, CIRCUITPY_TRACEBACK); diff --git a/shared-bindings/uheap/__init__.c b/shared-bindings/uheap/__init__.c index 8c9e2e81dc..40aa869225 100644 --- a/shared-bindings/uheap/__init__.c +++ b/shared-bindings/uheap/__init__.c @@ -57,3 +57,5 @@ const mp_obj_module_t uheap_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&uheap_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_uheap, uheap_module, CIRCUITPY_UHEAP); diff --git a/shared-bindings/usb_cdc/__init__.c b/shared-bindings/usb_cdc/__init__.c index 18e8356e34..eabe26ad07 100644 --- a/shared-bindings/usb_cdc/__init__.c +++ b/shared-bindings/usb_cdc/__init__.c @@ -139,3 +139,5 @@ void usb_cdc_set_console(mp_obj_t serial_obj) { void usb_cdc_set_data(mp_obj_t serial_obj) { set_module_dict_entry(MP_ROM_QSTR(MP_QSTR_data), serial_obj); } + +MP_REGISTER_MODULE(MP_QSTR_usb_cdc, usb_cdc_module, CIRCUITPY_USB_CDC); diff --git a/shared-bindings/usb_hid/Device.c b/shared-bindings/usb_hid/Device.c index 64803f8e13..774d991335 100644 --- a/shared-bindings/usb_hid/Device.c +++ b/shared-bindings/usb_hid/Device.c @@ -31,7 +31,7 @@ //| class Device: //| """HID Device specification""" //| -//| def __init__(self, *, descriptor: ReadableBuffer, usage_page: int, usage: int, in_report_length: int, out_report_length: int = 0, report_id_index: Optional[int]) -> None: +//| def __init__(self, *, descriptor: ReadableBuffer, usage_page: int, usage: int, report_ids: Sequence[int], in_report_lengths: Sequence[int], out_report_lengths: Sequence[int]) -> None: //| """Create a description of a USB HID device. The actual device is created when you //| pass a `Device` to `usb_hid.enable()`. //| @@ -39,38 +39,46 @@ //| not verified for correctness; it is up to you to make sure it is not malformed. //| :param int usage_page: The Usage Page value from the descriptor. Must match what is in the descriptor. //| :param int usage: The Usage value from the descriptor. Must match what is in the descriptor. -//| :param int in_report_length: Size in bytes of the HID report sent to the host. -//| "In" is with respect to the host. -//| :param int out_report_length: Size in bytes of the HID report received from the host. -//| "Out" is with respect to the host. If no reports are expected, use 0. -//| :param int report_id_index: position of byte in descriptor that contains the Report ID. -//| A Report ID will be assigned when the device is created. If there is no -//| Report ID, use ``None``. +//| :param int report_ids: Sequence of report ids used by the descriptor. +//| If the ``report_descriptor`` does not have a report ID, use 0. +//| :param int in_report_lengths: Sequence of sizes in bytes of the HIDs report sent to the host. +//| The sizes are in order of the ``report_ids``. +//| "IN" is with respect to the host. +//| :param int out_report_lengths: Size in bytes of the HID report received from the host. +//| The sizes are in order of the ``report_ids``. +//| "OUT" is with respect to the host. +//| +//| ``report_ids``, ``in_report_lengths``, and ``out_report_lengths`` must all be the same length. //| """ //| ... //| //| KEYBOARD: Device -//| """Standard keyboard device supporting keycodes 0x00-0xDD, modifiers 0xE-0xE7, and five LED indicators.""" +//| """Standard keyboard device supporting keycodes 0x00-0xDD, modifiers 0xE-0xE7, and five LED indicators. +//| Uses Report ID 1 for its IN and OUT reports. +//| """ //| //| MOUSE: Device //| """Standard mouse device supporting five mouse buttons, X and Y relative movements from -127 to 127 -//| in each report, and a relative mouse wheel change from -127 to 127 in each report.""" +//| in each report, and a relative mouse wheel change from -127 to 127 in each report. +//| Uses Report ID 2 for its IN report. +//| """ //| //| CONSUMER_CONTROL: Device -//| """Consumer Control device supporting sent values from 1-652, with no rollover.""" +//| """Consumer Control device supporting sent values from 1-652, with no rollover. +//| Uses Report ID 3 for its IN report.""" //| STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { usb_hid_device_obj_t *self = m_new_obj(usb_hid_device_obj_t); self->base.type = &usb_hid_device_type; - enum { ARG_report_descriptor, ARG_usage_page, ARG_usage, ARG_in_report_length, ARG_out_report_length, ARG_report_id_index }; + enum { ARG_report_descriptor, ARG_usage_page, ARG_usage, ARG_report_ids, ARG_in_report_lengths, ARG_out_report_lengths }; static const mp_arg_t allowed_args[] = { { MP_QSTR_report_descriptor, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_usage_page, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_INT }, { MP_QSTR_usage, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_INT }, - { MP_QSTR_in_report_length, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_INT }, - { MP_QSTR_out_report_length, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0 } }, - { MP_QSTR_report_id_index, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = mp_const_none } }, + { MP_QSTR_report_ids, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_in_report_lengths, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_out_report_lengths, MP_ARG_KW_ONLY | MP_ARG_REQUIRED | MP_ARG_OBJ }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -81,82 +89,144 @@ STATIC mp_obj_t usb_hid_device_make_new(const mp_obj_type_t *type, size_t n_args mp_obj_t descriptor = mp_obj_new_bytearray(descriptor_bufinfo.len, descriptor_bufinfo.buf); const mp_int_t usage_page_arg = args[ARG_usage_page].u_int; - if (usage_page_arg <= 0 || usage_page_arg > 255) { - mp_raise_ValueError_varg(translate("%q must be 1-255"), MP_QSTR_usage_page); - } + mp_arg_validate_int_range(usage_page_arg, 1, 255, MP_QSTR_usage_page); const uint8_t usage_page = usage_page_arg; const mp_int_t usage_arg = args[ARG_usage].u_int; - if (usage_arg <= 0 || usage_arg > 255) { - mp_raise_ValueError_varg(translate("%q must be 1-255"), MP_QSTR_usage); - } + mp_arg_validate_int_range(usage_arg, 1, 255, MP_QSTR_usage_page); const uint8_t usage = usage_arg; - const mp_int_t in_report_length_arg = args[ARG_in_report_length].u_int; - if (in_report_length_arg <= 0 || in_report_length_arg > 255) { - mp_raise_ValueError_varg(translate("%q must be 1-255"), MP_QSTR_in_report_length); - } - const uint8_t in_report_length = in_report_length_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; - const mp_int_t out_report_length_arg = args[ARG_out_report_length].u_int; - if (out_report_length_arg < 0 || out_report_length_arg > 255) { - mp_raise_ValueError_varg(translate("%q must be 0-255"), MP_QSTR_out_report_length); + 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); } - const uint8_t out_report_length = out_report_length_arg; - const mp_obj_t report_id_index_arg = args[ARG_report_id_index].u_obj; - uint8_t report_id_index = 0; - if (report_id_index_arg != mp_const_none) { - const mp_int_t report_id_index_int = mp_obj_int_get_checked(report_id_index_arg); - if (report_id_index_int <= 0 || (uint32_t)report_id_index_int >= descriptor_bufinfo.len) { - mp_raise_ValueError_varg(translate("%q must be None or between 1 and len(report_descriptor)-1"), - MP_QSTR_report_id_index); - } - report_id_index = report_id_index_int; + 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) { + mp_raise_ValueError_varg(translate("%q, %q, and %q must all be the same length"), + MP_QSTR_report_ids, MP_QSTR_in_report_lengths, MP_QSTR_out_report_lengths); + } + + uint8_t report_ids_array[report_ids_count]; + uint8_t in_report_lengths_array[report_ids_count]; + uint8_t out_report_lengths_array[report_ids_count]; + + // Validate the ids and lengths are all integers in range. + for (size_t i = 0; i < report_ids_count; i++) { + mp_obj_t i_obj = MP_OBJ_NEW_SMALL_INT(i); + + report_ids_array[i] = (uint8_t)mp_arg_validate_int_range( + // It's not the actual argument that's out of range, but its elements. + // But the error message is close enough. + MP_OBJ_SMALL_INT_VALUE(mp_obj_subscr(report_ids, i_obj, MP_OBJ_SENTINEL)), + 1, 255, MP_QSTR_report_ids); + + in_report_lengths_array[i] = (uint8_t)mp_arg_validate_int_range( + MP_OBJ_SMALL_INT_VALUE(mp_obj_subscr(in_report_lengths, i_obj, MP_OBJ_SENTINEL)), + 0, 255, MP_QSTR_in_report_lengths); + + out_report_lengths_array[i] = (uint8_t)mp_arg_validate_int_range( + MP_OBJ_SMALL_INT_VALUE(mp_obj_subscr(out_report_lengths, i_obj, MP_OBJ_SENTINEL)), + 0, 255, MP_QSTR_out_report_lengths); } common_hal_usb_hid_device_construct( - self, descriptor, usage_page, usage, in_report_length, out_report_length, report_id_index); + self, descriptor, usage_page, usage, report_ids_count, report_ids_array, in_report_lengths_array, out_report_lengths_array); return (mp_obj_t)self; } -//| def send_report(self, buf: ReadableBuffer) -> None: -//| """Send a HID report.""" +//| def send_report(self, buf: 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. +//| """ //| ... //| -STATIC mp_obj_t usb_hid_device_send_report(mp_obj_t self_in, mp_obj_t buffer) { - usb_hid_device_obj_t *self = MP_OBJ_TO_PTR(self_in); +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 }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_buf, MP_ARG_REQUIRED | MP_ARG_OBJ }, + { MP_QSTR_report_id, MP_ARG_OBJ, {.u_obj = mp_const_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); mp_buffer_info_t bufinfo; - mp_get_buffer_raise(buffer, &bufinfo, MP_BUFFER_READ); + mp_get_buffer_raise(args[ARG_buf].u_obj, &bufinfo, MP_BUFFER_READ); - common_hal_usb_hid_device_send_report(self, ((uint8_t *)bufinfo.buf), bufinfo.len); + // -1 asks common_hal to determine the report id if possible. + mp_int_t report_id_arg = -1; + if (args[ARG_report_id].u_obj != mp_const_none) { + report_id_arg = mp_obj_int_get_checked(args[ARG_report_id].u_obj); + } + const uint8_t report_id = common_hal_usb_hid_device_validate_report_id(self, report_id_arg); + + common_hal_usb_hid_device_send_report(self, ((uint8_t *)bufinfo.buf), bufinfo.len, report_id); return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_2(usb_hid_device_send_report_obj, usb_hid_device_send_report); +MP_DEFINE_CONST_FUN_OBJ_KW(usb_hid_device_send_report_obj, 2, usb_hid_device_send_report); + +//| def get_last_received_report(self, report_id: Optional[int] = None) -> bytes: +//| """Get the last received HID OUT 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. +//| """ +//| ... +//| +STATIC mp_obj_t usb_hid_device_get_last_received_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_report_id }; + static const mp_arg_t allowed_args[] = { + { MP_QSTR_report_id, MP_ARG_OBJ, {.u_obj = mp_const_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); + + mp_int_t report_id_arg = -1; + if (args[ARG_report_id].u_obj != mp_const_none) { + report_id_arg = mp_obj_int_get_checked(args[ARG_report_id].u_obj); + } + const uint8_t report_id = common_hal_usb_hid_device_validate_report_id(self, report_id_arg); + + return common_hal_usb_hid_device_get_last_received_report(self, report_id); +} +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.""" +//| """The HID OUT report as a `bytes` (read-only). `None` if nothing received. +//| Same as `get_last_received_report()` with no argument. //| -STATIC mp_obj_t usb_hid_device_obj_get_last_received_report(mp_obj_t self_in) { +//| 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); - if (self->out_report_buffer == 0) { - return mp_const_none; - } - return mp_obj_new_bytes(self->out_report_buffer, self->out_report_length); + + // 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_obj, usb_hid_device_obj_get_last_received_report); +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_obj, + .proxy = {(mp_obj_t)&usb_hid_device_get_last_received_report_property_obj, MP_ROM_NONE, MP_ROM_NONE}, }; //| usage_page: int -//| """The usage page of the device as an `int`. Can be thought of a category. (read-only)""" +//| """The device usage page identifier, which designates a category of device. (read-only)""" //| STATIC mp_obj_t usb_hid_device_obj_get_usage_page(mp_obj_t self_in) { usb_hid_device_obj_t *self = MP_OBJ_TO_PTR(self_in); @@ -172,7 +242,7 @@ const mp_obj_property_t usb_hid_device_usage_page_obj = { }; //| usage: int -//| """The functionality of the device as an int. (read-only) +//| """The device usage identifier, which designates a specific kind of device. (read-only) //| //| For example, Keyboard is 0x06 within the generic desktop usage page 0x01. //| Mouse is 0x02 within the same usage page.""" @@ -192,13 +262,15 @@ const mp_obj_property_t usb_hid_device_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_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) }, - { MP_ROM_QSTR(MP_QSTR_KEYBOARD), MP_ROM_PTR(&usb_hid_device_keyboard_obj) }, - { MP_ROM_QSTR(MP_QSTR_MOUSE), MP_ROM_PTR(&usb_hid_device_mouse_obj) }, - { MP_ROM_QSTR(MP_QSTR_CONSUMER_CONTROL), MP_ROM_PTR(&usb_hid_device_consumer_control_obj) }, + { 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) }, + + { MP_ROM_QSTR(MP_QSTR_KEYBOARD), MP_ROM_PTR(&usb_hid_device_keyboard_obj) }, + { MP_ROM_QSTR(MP_QSTR_MOUSE), MP_ROM_PTR(&usb_hid_device_mouse_obj) }, + { MP_ROM_QSTR(MP_QSTR_CONSUMER_CONTROL), MP_ROM_PTR(&usb_hid_device_consumer_control_obj) }, }; STATIC MP_DEFINE_CONST_DICT(usb_hid_device_locals_dict, usb_hid_device_locals_dict_table); diff --git a/shared-bindings/usb_hid/Device.h b/shared-bindings/usb_hid/Device.h index c1af92fd4f..a5e94c4d52 100644 --- a/shared-bindings/usb_hid/Device.h +++ b/shared-bindings/usb_hid/Device.h @@ -33,9 +33,11 @@ extern const mp_obj_type_t usb_hid_device_type; -void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t descriptor, uint8_t usage_page, uint8_t usage, uint8_t in_report_length, uint8_t out_report_length, uint8_t report_id_index); -void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t *report, uint8_t len); +void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t report_descriptor, uint8_t usage_page, uint8_t usage, size_t report_ids_count,uint8_t *report_ids, uint8_t *in_report_lengths, uint8_t *out_report_lengths); +void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t *report, uint8_t len, uint8_t report_id); +mp_obj_t common_hal_usb_hid_device_get_last_received_report(usb_hid_device_obj_t *self, uint8_t report_id); uint8_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self); uint8_t common_hal_usb_hid_device_get_usage(usb_hid_device_obj_t *self); +uint8_t common_hal_usb_hid_device_validate_report_id(usb_hid_device_obj_t *self, mp_int_t report_id); #endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_HID_DEVICE_H diff --git a/shared-bindings/usb_hid/__init__.c b/shared-bindings/usb_hid/__init__.c index f5a7c1cf72..d1b4357dc1 100644 --- a/shared-bindings/usb_hid/__init__.c +++ b/shared-bindings/usb_hid/__init__.c @@ -71,7 +71,7 @@ MP_DEFINE_CONST_FUN_OBJ_0(usb_hid_disable_obj, usb_hid_disable); //| //| If you enable too many devices at once, you will run out of USB endpoints. //| The number of available endpoints varies by microcontroller. -//| CircuitPython will go into safe mode after running boot.py to inform you if +//| CircuitPython will go into safe mode after running ``boot.py`` to inform you if //| not enough endpoints are available. //| """ //| ... @@ -116,3 +116,5 @@ void usb_hid_set_devices(mp_obj_t devices) { elem->value = devices; } } + +MP_REGISTER_MODULE(MP_QSTR_usb_hid, usb_hid_module, CIRCUITPY_USB_HID); diff --git a/shared-bindings/usb_midi/__init__.c b/shared-bindings/usb_midi/__init__.c index 9c583fb78e..ec065d1e18 100644 --- a/shared-bindings/usb_midi/__init__.c +++ b/shared-bindings/usb_midi/__init__.c @@ -94,3 +94,5 @@ const mp_obj_module_t usb_midi_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&usb_midi_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_usb_midi, usb_midi_module, CIRCUITPY_USB_MIDI); diff --git a/shared-bindings/ustack/__init__.c b/shared-bindings/ustack/__init__.c index e2a31e9c47..17bdcbb1c0 100644 --- a/shared-bindings/ustack/__init__.c +++ b/shared-bindings/ustack/__init__.c @@ -85,3 +85,5 @@ const mp_obj_module_t ustack_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&ustack_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_ustack, ustack_module, CIRCUITPY_USTACK); diff --git a/shared-bindings/vectorio/Circle.c b/shared-bindings/vectorio/Circle.c index 673a976687..abcbccd856 100644 --- a/shared-bindings/vectorio/Circle.c +++ b/shared-bindings/vectorio/Circle.c @@ -1,5 +1,6 @@ - +#include "shared-bindings/vectorio/__init__.h" #include "shared-bindings/vectorio/Circle.h" +#include "shared-bindings/vectorio/VectorShape.h" #include @@ -11,15 +12,21 @@ //| class Circle: //| -//| def __init__(self, radius: int) -> None: +//| def __init__(self, pixel_shader: Union[displayio.ColorConverter, displayio.Palette], radius: int, x: int, y: int) -> None: //| """Circle is positioned on screen by its center point. //| -//| :param radius: The radius of the circle in pixels""" +//| :param Union[~displayio.ColorConverter,~displayio.Palette] pixel_shader: The pixel shader that produces colors from values +//| :param int radius: The radius of the circle in pixels +//| :param int x: Initial x position of the axis. +//| :param int y: Initial y position of the axis.""" //| static mp_obj_t vectorio_circle_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_radius }; + enum { ARG_pixel_shader, ARG_radius, ARG_x, ARG_y }; static const mp_arg_t allowed_args[] = { + { MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_radius, MP_ARG_REQUIRED | MP_ARG_INT }, + { MP_QSTR_x, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, + { MP_QSTR_y, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, }; 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); @@ -33,9 +40,22 @@ static mp_obj_t vectorio_circle_make_new(const mp_obj_type_t *type, size_t n_arg self->base.type = &vectorio_circle_type; common_hal_vectorio_circle_construct(self, radius); + // VectorShape parts + mp_obj_t pixel_shader = args[ARG_pixel_shader].u_obj; + int32_t x = args[ARG_x].u_int; + int32_t y = args[ARG_y].u_int; + mp_obj_t vector_shape = vectorio_vector_shape_make_new(self, pixel_shader, x, y); + self->draw_protocol_instance = vector_shape; + return MP_OBJ_FROM_PTR(self); } +STATIC const vectorio_draw_protocol_t circle_draw_protocol = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_draw) + .draw_get_protocol_self = (draw_get_protocol_self_fun)common_hal_vectorio_circle_get_draw_protocol, + .draw_protocol_impl = &vectorio_vector_shape_draw_protocol_impl +}; + //| radius : int //| """The radius of the circle in pixels.""" @@ -61,14 +81,38 @@ const mp_obj_property_t vectorio_circle_radius_obj = { }; +// Documentation for properties inherited from VectorShape. + +//| x : int +//| """X position of the center point of the circle in the parent.""" +//| +//| y : int +//| """Y position of the center point of the circle in the parent.""" +//| +//| location : Tuple[int,int] +//| """(X,Y) position of the center point of the circle in the parent.""" +//| +//| pixel_shader : Union[displayio.ColorConverter,displayio.Palette] +//| """The pixel shader of the circle.""" +//| + STATIC const mp_rom_map_elem_t vectorio_circle_locals_dict_table[] = { + // Properties { MP_ROM_QSTR(MP_QSTR_radius), MP_ROM_PTR(&vectorio_circle_radius_obj) }, + { MP_ROM_QSTR(MP_QSTR_x), MP_ROM_PTR(&vectorio_vector_shape_x_obj) }, + { MP_ROM_QSTR(MP_QSTR_y), MP_ROM_PTR(&vectorio_vector_shape_y_obj) }, + { MP_ROM_QSTR(MP_QSTR_location), MP_ROM_PTR(&vectorio_vector_shape_location_obj) }, + { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&vectorio_vector_shape_pixel_shader_obj) }, }; STATIC MP_DEFINE_CONST_DICT(vectorio_circle_locals_dict, vectorio_circle_locals_dict_table); const mp_obj_type_t vectorio_circle_type = { { &mp_type_type }, .name = MP_QSTR_Circle, + .flags = MP_TYPE_FLAG_EXTENDED, .make_new = vectorio_circle_make_new, .locals_dict = (mp_obj_dict_t *)&vectorio_circle_locals_dict, + MP_TYPE_EXTENDED_FIELDS( + .protocol = &circle_draw_protocol, + ), }; diff --git a/shared-bindings/vectorio/Circle.h b/shared-bindings/vectorio/Circle.h index e8fc048eb8..37bbe9e65b 100644 --- a/shared-bindings/vectorio/Circle.h +++ b/shared-bindings/vectorio/Circle.h @@ -19,4 +19,6 @@ void common_hal_vectorio_circle_get_area(void *circle, displayio_area_t *out_are int16_t common_hal_vectorio_circle_get_radius(void *circle); void common_hal_vectorio_circle_set_radius(void *circle, int16_t radius); +mp_obj_t common_hal_vectorio_circle_get_draw_protocol(void *circle); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_CIRCLE_H diff --git a/shared-bindings/vectorio/Polygon.c b/shared-bindings/vectorio/Polygon.c index 23c7961ec7..8ce19eb8db 100644 --- a/shared-bindings/vectorio/Polygon.c +++ b/shared-bindings/vectorio/Polygon.c @@ -1,6 +1,7 @@ - +#include "shared-bindings/vectorio/__init__.h" #include "shared-module/vectorio/__init__.h" #include "shared-bindings/vectorio/Polygon.h" +#include "shared-bindings/vectorio/VectorShape.h" #include @@ -16,15 +17,23 @@ //| class Polygon: -//| def __init__(self, points: List[Tuple[int, int]]) -> None: -//| """Represents a closed shape by ordered vertices +//| def __init__(self, pixel_shader: Union[displayio.ColorConverter, displayio.Palette], points: List[Tuple[int, int]], x: int, y: int) -> None: +//| """Represents a closed shape by ordered vertices. The path will be treated as +//| 'closed', the last point will connect to the first point. //| -//| :param points: Vertices for the polygon""" +//| :param Union[~displayio.ColorConverter,~displayio.Palette] pixel_shader: The pixel +//| shader that produces colors from values +//| :param List[Tuple[int,int]] points: Vertices for the polygon +//| :param int x: Initial screen x position of the 0,0 origin in the points list. +//| :param int y: Initial screen y position of the 0,0 origin in the points list.""" //| static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_points_list }; + enum { ARG_pixel_shader, ARG_points_list, ARG_x, ARG_y }; static const mp_arg_t allowed_args[] = { + { MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_points, MP_ARG_REQUIRED | MP_ARG_OBJ, {.u_obj = MP_OBJ_NULL} }, + { MP_QSTR_x, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, + { MP_QSTR_y, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, }; 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); @@ -38,12 +47,25 @@ static mp_obj_t vectorio_polygon_make_new(const mp_obj_type_t *type, size_t n_ar common_hal_vectorio_polygon_construct(self, args[ARG_points_list].u_obj); + // VectorShape parts + mp_obj_t pixel_shader = args[ARG_pixel_shader].u_obj; + int32_t x = args[ARG_x].u_int; + int32_t y = args[ARG_y].u_int; + mp_obj_t vector_shape = vectorio_vector_shape_make_new(self, pixel_shader, x, y); + self->draw_protocol_instance = vector_shape; + return MP_OBJ_FROM_PTR(self); } +STATIC const vectorio_draw_protocol_t polygon_draw_protocol = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_draw) + .draw_get_protocol_self = (draw_get_protocol_self_fun)common_hal_vectorio_polygon_get_draw_protocol, + .draw_protocol_impl = &vectorio_vector_shape_draw_protocol_impl +}; + //| points: List[Tuple[int, int]] -//| """Set a new look and shape for this polygon""" +//| """Vertices for the polygon.""" //| STATIC mp_obj_t vectorio_polygon_obj_get_points(mp_obj_t self_in) { vectorio_polygon_t *self = MP_OBJ_TO_PTR(self_in); @@ -66,14 +88,39 @@ const mp_obj_property_t vectorio_polygon_points_obj = { MP_ROM_NONE}, }; + +// Documentation for properties inherited from VectorShape. + +//| x : int +//| """X position of the 0,0 origin in the points list.""" +//| +//| y : int +//| """Y position of the 0,0 origin in the points list.""" +//| +//| location : Tuple[int,int] +//| """(X,Y) position of the 0,0 origin in the points list.""" +//| +//| pixel_shader : Union[displayio.ColorConverter,displayio.Palette] +//| """The pixel shader of the polygon.""" +//| + STATIC const mp_rom_map_elem_t vectorio_polygon_locals_dict_table[] = { + // Properties { MP_ROM_QSTR(MP_QSTR_points), MP_ROM_PTR(&vectorio_polygon_points_obj) }, + { MP_ROM_QSTR(MP_QSTR_x), MP_ROM_PTR(&vectorio_vector_shape_x_obj) }, + { MP_ROM_QSTR(MP_QSTR_y), MP_ROM_PTR(&vectorio_vector_shape_y_obj) }, + { MP_ROM_QSTR(MP_QSTR_location), MP_ROM_PTR(&vectorio_vector_shape_location_obj) }, + { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&vectorio_vector_shape_pixel_shader_obj) }, }; STATIC MP_DEFINE_CONST_DICT(vectorio_polygon_locals_dict, vectorio_polygon_locals_dict_table); const mp_obj_type_t vectorio_polygon_type = { { &mp_type_type }, .name = MP_QSTR_Polygon, + .flags = MP_TYPE_FLAG_EXTENDED, .make_new = vectorio_polygon_make_new, .locals_dict = (mp_obj_dict_t *)&vectorio_polygon_locals_dict, + MP_TYPE_EXTENDED_FIELDS( + .protocol = &polygon_draw_protocol, + ), }; diff --git a/shared-bindings/vectorio/Polygon.h b/shared-bindings/vectorio/Polygon.h index 5594fbec4a..68136be6bd 100644 --- a/shared-bindings/vectorio/Polygon.h +++ b/shared-bindings/vectorio/Polygon.h @@ -20,5 +20,7 @@ void common_hal_vectorio_polygon_get_area(void *polygon, displayio_area_t *out_a mp_obj_t common_hal_vectorio_polygon_get_points(vectorio_polygon_t *self); void common_hal_vectorio_polygon_set_points(vectorio_polygon_t *self, mp_obj_t points_list); +mp_obj_t common_hal_vectorio_polygon_get_draw_protocol(void *polygon); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_POLYGON_H diff --git a/shared-bindings/vectorio/Rectangle.c b/shared-bindings/vectorio/Rectangle.c index a50a8a14b3..176cbaba7c 100644 --- a/shared-bindings/vectorio/Rectangle.c +++ b/shared-bindings/vectorio/Rectangle.c @@ -1,5 +1,7 @@ - +#include "shared-bindings/vectorio/__init__.h" #include "shared-bindings/vectorio/Rectangle.h" +#include "shared-module/vectorio/VectorShape.h" +#include "shared-bindings/vectorio/VectorShape.h" #include @@ -8,17 +10,23 @@ #include "supervisor/shared/translate.h" //| class Rectangle: -//| def __init__(self, width: int, height: int) -> None: +//| def __init__(self, pixel_shader: Union[displayio.ColorConverter, displayio.Palette], width: int, height: int, x: int, y: int) -> None: //| """Represents a rectangle by defining its bounds //| -//| :param width: The number of pixels wide -//| :param height: The number of pixels high""" +//| :param Union[~displayio.ColorConverter,~displayio.Palette] pixel_shader: The pixel shader that produces colors from values +//| :param int width: The number of pixels wide +//| :param int height: The number of pixels high +//| :param int x: Initial x position of the top left corner. +//| :param int y: Initial y position of the top left corner.""" //| static mp_obj_t vectorio_rectangle_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_width, ARG_height }; + enum { ARG_pixel_shader, ARG_width, ARG_height, ARG_x, ARG_y }; static const mp_arg_t allowed_args[] = { + { MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, { MP_QSTR_width, MP_ARG_REQUIRED | MP_ARG_INT }, { MP_QSTR_height, MP_ARG_REQUIRED | MP_ARG_INT }, + { MP_QSTR_x, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, + { MP_QSTR_y, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, }; 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); @@ -36,17 +44,54 @@ static mp_obj_t vectorio_rectangle_make_new(const mp_obj_type_t *type, size_t n_ self->base.type = &vectorio_rectangle_type; common_hal_vectorio_rectangle_construct(self, width, height); + // VectorShape parts + mp_obj_t pixel_shader = args[ARG_pixel_shader].u_obj; + int32_t x = args[ARG_x].u_int; + int32_t y = args[ARG_y].u_int; + mp_obj_t vector_shape = vectorio_vector_shape_make_new(self, pixel_shader, x, y); + self->draw_protocol_instance = vector_shape; + return MP_OBJ_FROM_PTR(self); } +STATIC const vectorio_draw_protocol_t rectangle_draw_protocol = { + MP_PROTO_IMPLEMENT(MP_QSTR_protocol_draw) + .draw_get_protocol_self = (draw_get_protocol_self_fun)common_hal_vectorio_rectangle_get_draw_protocol, + .draw_protocol_impl = &vectorio_vector_shape_draw_protocol_impl +}; + + +// Documentation for properties inherited from VectorShape. + +//| x : int +//| """X position of the top left corner of the rectangle in the parent.""" +//| +//| y : int +//| """Y position of the top left corner of the rectangle in the parent.""" +//| +//| location : Tuple[int,int] +//| """(X,Y) position of the top left corner of the rectangle in the parent.""" +//| +//| pixel_shader : Union[displayio.ColorConverter,displayio.Palette] +//| """The pixel shader of the rectangle.""" +//| STATIC const mp_rom_map_elem_t vectorio_rectangle_locals_dict_table[] = { + // Properties + { MP_ROM_QSTR(MP_QSTR_x), MP_ROM_PTR(&vectorio_vector_shape_x_obj) }, + { MP_ROM_QSTR(MP_QSTR_y), MP_ROM_PTR(&vectorio_vector_shape_y_obj) }, + { MP_ROM_QSTR(MP_QSTR_location), MP_ROM_PTR(&vectorio_vector_shape_location_obj) }, + { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&vectorio_vector_shape_pixel_shader_obj) }, }; STATIC MP_DEFINE_CONST_DICT(vectorio_rectangle_locals_dict, vectorio_rectangle_locals_dict_table); const mp_obj_type_t vectorio_rectangle_type = { { &mp_type_type }, .name = MP_QSTR_Rectangle, + .flags = MP_TYPE_FLAG_EXTENDED, .make_new = vectorio_rectangle_make_new, .locals_dict = (mp_obj_dict_t *)&vectorio_rectangle_locals_dict, + MP_TYPE_EXTENDED_FIELDS( + .protocol = &rectangle_draw_protocol, + ), }; diff --git a/shared-bindings/vectorio/Rectangle.h b/shared-bindings/vectorio/Rectangle.h index bb461ed9d5..24b103c26e 100644 --- a/shared-bindings/vectorio/Rectangle.h +++ b/shared-bindings/vectorio/Rectangle.h @@ -12,4 +12,6 @@ uint32_t common_hal_vectorio_rectangle_get_pixel(void *rectangle, int16_t x, int void common_hal_vectorio_rectangle_get_area(void *rectangle, displayio_area_t *out_area); +mp_obj_t common_hal_vectorio_rectangle_get_draw_protocol(void *rectangle); + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_RECTANGLE_H diff --git a/shared-bindings/vectorio/VectorShape.c b/shared-bindings/vectorio/VectorShape.c index ae8532eb95..c9cbf0a114 100644 --- a/shared-bindings/vectorio/VectorShape.c +++ b/shared-bindings/vectorio/VectorShape.c @@ -19,37 +19,16 @@ #include "supervisor/shared/translate.h" -//| class VectorShape: -//| def __init__(self, shape: Union[Polygon, Rectangle, Circle], pixel_shader: Union[displayio.ColorConverter, displayio.Palette], x: int=0, y: int=0) -> None: -//| """Binds a vector shape to a location and pixel color -//| -//| :param shape: The shape to draw. -//| :param pixel_shader: The pixel shader that produces colors from values -//| :param x: Initial x position of the center axis of the shape within the parent. -//| :param y: Initial y position of the center axis of the shape within the parent.""" -//| ... -//| -STATIC mp_obj_t vectorio_vector_shape_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { - enum { ARG_shape, ARG_pixel_shader, ARG_x, ARG_y }; - static const mp_arg_t allowed_args[] = { - { MP_QSTR_shape, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, - { MP_QSTR_pixel_shader, MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED }, - { MP_QSTR_x, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, - { MP_QSTR_y, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_int = 0} }, - }; - 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_obj_t pixel_shader = args[ARG_pixel_shader].u_obj; +// shape: The shape implementation to draw. +// pixel_shader: The pixel shader that produces colors from values. The shader can be a displayio.Palette(1); it will be asked to color pixel value 0. +// x: Initial x position of the center axis of the shape within the parent. +// y: Initial y position of the center axis of the shape within the parent.""" +mp_obj_t vectorio_vector_shape_make_new(const mp_obj_t shape, const mp_obj_t pixel_shader, int32_t x, int32_t y) { if (!mp_obj_is_type(pixel_shader, &displayio_colorconverter_type) && !mp_obj_is_type(pixel_shader, &displayio_palette_type)) { mp_raise_TypeError_varg(translate("unsupported %q type"), MP_QSTR_pixel_shader); } - int16_t x = args[ARG_x].u_int; - int16_t y = args[ARG_y].u_int; - - mp_obj_t shape = args[ARG_shape].u_obj; vectorio_ishape_t ishape; // Wire up shape functions if (mp_obj_is_type(shape, &vectorio_polygon_type)) { @@ -92,18 +71,32 @@ STATIC mp_obj_t vectorio_vector_shape_make_new(const mp_obj_type_t *type, size_t return MP_OBJ_FROM_PTR(self); } +vectorio_draw_protocol_impl_t vectorio_vector_shape_draw_protocol_impl = { + .draw_fill_area = (draw_fill_area_fun)vectorio_vector_shape_fill_area, + .draw_get_dirty_area = (draw_get_dirty_area_fun)vectorio_vector_shape_get_dirty_area, + .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, +}; + + +// Stub checker does not approve of these shared properties. +// x: int +// """X position of the center point of the shape in the parent.""" +// +STATIC mp_obj_t vectorio_vector_shape_obj_get_x(mp_obj_t wrapper_shape) { + // Relies on the fact that only vector_shape impl gets matched with a VectorShape. + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, wrapper_shape); + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(draw_protocol->draw_get_protocol_self(wrapper_shape)); -//| x: int -//| """X position of the center point of the shape in the parent.""" -//| -STATIC mp_obj_t vectorio_vector_shape_obj_get_x(mp_obj_t self_in) { - vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); return MP_OBJ_NEW_SMALL_INT(common_hal_vectorio_vector_shape_get_x(self)); } MP_DEFINE_CONST_FUN_OBJ_1(vectorio_vector_shape_get_x_obj, vectorio_vector_shape_obj_get_x); -STATIC mp_obj_t vectorio_vector_shape_obj_set_x(mp_obj_t self_in, mp_obj_t x_obj) { - vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t vectorio_vector_shape_obj_set_x(mp_obj_t wrapper_shape, mp_obj_t x_obj) { + // Relies on the fact that only vector_shape impl gets matched with a VectorShape. + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, wrapper_shape); + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(draw_protocol->draw_get_protocol_self(wrapper_shape)); mp_int_t x = mp_obj_get_int(x_obj); common_hal_vectorio_vector_shape_set_x(self, x); @@ -119,17 +112,22 @@ const mp_obj_property_t vectorio_vector_shape_x_obj = { }; -//| y: int -//| """Y position of the center point of the shape in the parent.""" -//| -STATIC mp_obj_t vectorio_vector_shape_obj_get_y(mp_obj_t self_in) { - vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); +// y: int +// """Y position of the center point of the shape in the parent.""" +// +STATIC mp_obj_t vectorio_vector_shape_obj_get_y(mp_obj_t wrapper_shape) { + // Relies on the fact that only vector_shape impl gets matched with a VectorShape. + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, wrapper_shape); + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(draw_protocol->draw_get_protocol_self(wrapper_shape)); + return MP_OBJ_NEW_SMALL_INT(common_hal_vectorio_vector_shape_get_y(self)); } MP_DEFINE_CONST_FUN_OBJ_1(vectorio_vector_shape_get_y_obj, vectorio_vector_shape_obj_get_y); -STATIC mp_obj_t vectorio_vector_shape_obj_set_y(mp_obj_t self_in, mp_obj_t y_obj) { - vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t vectorio_vector_shape_obj_set_y(mp_obj_t wrapper_shape, mp_obj_t y_obj) { + // Relies on the fact that only vector_shape impl gets matched with a VectorShape. + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, wrapper_shape); + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(draw_protocol->draw_get_protocol_self(wrapper_shape)); mp_int_t y = mp_obj_get_int(y_obj); common_hal_vectorio_vector_shape_set_y(self, y); @@ -145,17 +143,53 @@ const mp_obj_property_t vectorio_vector_shape_y_obj = { }; -//| pixel_shader: Union[displayio.ColorConverter, displayio.Palette] -//| """The pixel shader of the shape.""" -//| -STATIC mp_obj_t vectorio_vector_shape_obj_get_pixel_shader(mp_obj_t self_in) { - vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); +// location: Tuple[int, int] +// """location of the center point of the shape in the parent.""" +// +STATIC mp_obj_t vectorio_vector_shape_obj_get_location(mp_obj_t wrapper_shape) { + // Relies on the fact that only vector_shape impl gets matched with a VectorShape. + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, wrapper_shape); + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(draw_protocol->draw_get_protocol_self(wrapper_shape)); + + return MP_OBJ_TO_PTR(common_hal_vectorio_vector_shape_get_location(self)); +} +MP_DEFINE_CONST_FUN_OBJ_1(vectorio_vector_shape_get_location_obj, vectorio_vector_shape_obj_get_location); + +STATIC mp_obj_t vectorio_vector_shape_obj_set_location(mp_obj_t wrapper_shape, mp_obj_t location_obj) { + // Relies on the fact that only vector_shape impl gets matched with a VectorShape. + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, wrapper_shape); + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(draw_protocol->draw_get_protocol_self(wrapper_shape)); + + common_hal_vectorio_vector_shape_set_location(self, location_obj); + return mp_const_none; +} +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}, +}; + + +// pixel_shader: Union[ColorConverter, Palette] +// """The pixel shader of the shape.""" +// +STATIC mp_obj_t vectorio_vector_shape_obj_get_pixel_shader(mp_obj_t wrapper_shape) { + // Relies on the fact that only vector_shape impl gets matched with a VectorShape. + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, wrapper_shape); + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(draw_protocol->draw_get_protocol_self(wrapper_shape)); + return common_hal_vectorio_vector_shape_get_pixel_shader(self); } MP_DEFINE_CONST_FUN_OBJ_1(vectorio_vector_shape_get_pixel_shader_obj, vectorio_vector_shape_obj_get_pixel_shader); -STATIC mp_obj_t vectorio_vector_shape_obj_set_pixel_shader(mp_obj_t self_in, mp_obj_t pixel_shader) { - vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(self_in); +STATIC mp_obj_t vectorio_vector_shape_obj_set_pixel_shader(mp_obj_t wrapper_shape, mp_obj_t pixel_shader) { + // Relies on the fact that only vector_shape impl gets matched with a VectorShape. + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, wrapper_shape); + vectorio_vector_shape_t *self = MP_OBJ_TO_PTR(draw_protocol->draw_get_protocol_self(wrapper_shape)); + if (!mp_obj_is_type(pixel_shader, &displayio_palette_type) && !mp_obj_is_type(pixel_shader, &displayio_colorconverter_type)) { mp_raise_TypeError(translate("pixel_shader must be displayio.Palette or displayio.ColorConverter")); } @@ -175,16 +209,11 @@ const mp_obj_property_t vectorio_vector_shape_pixel_shader_obj = { STATIC const mp_rom_map_elem_t vectorio_vector_shape_locals_dict_table[] = { - // Properties - { MP_ROM_QSTR(MP_QSTR_x), MP_ROM_PTR(&vectorio_vector_shape_x_obj) }, - { MP_ROM_QSTR(MP_QSTR_y), MP_ROM_PTR(&vectorio_vector_shape_y_obj) }, - { MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&vectorio_vector_shape_pixel_shader_obj) }, }; STATIC MP_DEFINE_CONST_DICT(vectorio_vector_shape_locals_dict, vectorio_vector_shape_locals_dict_table); const mp_obj_type_t vectorio_vector_shape_type = { { &mp_type_type }, .name = MP_QSTR_VectorShape, - .make_new = vectorio_vector_shape_make_new, .locals_dict = (mp_obj_dict_t *)&vectorio_vector_shape_locals_dict, }; diff --git a/shared-bindings/vectorio/VectorShape.h b/shared-bindings/vectorio/VectorShape.h index fa11f73ffd..12c7e628ad 100644 --- a/shared-bindings/vectorio/VectorShape.h +++ b/shared-bindings/vectorio/VectorShape.h @@ -1,27 +1,44 @@ #ifndef MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_SHAPE_H #define MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_SHAPE_H +#include "py/objproperty.h" +#include "py/objtuple.h" + +#include "shared-bindings/vectorio/__init__.h" #include "shared-module/vectorio/VectorShape.h" #include "shared-module/displayio/area.h" extern const mp_obj_type_t vectorio_vector_shape_type; +// Python shared bindings constructor +mp_obj_t vectorio_vector_shape_make_new(const mp_obj_t shape, const mp_obj_t pixel_shader, int32_t x, int32_t y); + +// C data constructor void common_hal_vectorio_vector_shape_construct(vectorio_vector_shape_t *self, vectorio_ishape_t ishape, - mp_obj_t pixel_shader, uint16_t x, uint16_t y); + mp_obj_t pixel_shader, int32_t x, int32_t y); void common_hal_vectorio_vector_shape_set_dirty(void *self); mp_int_t common_hal_vectorio_vector_shape_get_x(vectorio_vector_shape_t *self); void common_hal_vectorio_vector_shape_set_x(vectorio_vector_shape_t *self, mp_int_t x); +mp_obj_tuple_t *common_hal_vectorio_vector_shape_get_location(vectorio_vector_shape_t *self); +void common_hal_vectorio_vector_shape_set_location(vectorio_vector_shape_t *self, mp_obj_t xy); + mp_int_t common_hal_vectorio_vector_shape_get_y(vectorio_vector_shape_t *self); void common_hal_vectorio_vector_shape_set_y(vectorio_vector_shape_t *self, mp_int_t y); mp_obj_t common_hal_vectorio_vector_shape_get_pixel_shader(vectorio_vector_shape_t *self); void common_hal_vectorio_vector_shape_set_pixel_shader(vectorio_vector_shape_t *self, mp_obj_t pixel_shader); - void vectorio_vector_shape_update_transform(vectorio_vector_shape_t *self, displayio_buffer_transform_t *group_transform); +// 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; + #endif // MICROPY_INCLUDED_SHARED_BINDINGS_VECTORIO_SHAPE_H diff --git a/shared-bindings/vectorio/__init__.c b/shared-bindings/vectorio/__init__.c index 12fb4d72b1..6e39f26591 100644 --- a/shared-bindings/vectorio/__init__.c +++ b/shared-bindings/vectorio/__init__.c @@ -6,9 +6,30 @@ #include "shared-bindings/vectorio/Circle.h" #include "shared-bindings/vectorio/Polygon.h" #include "shared-bindings/vectorio/Rectangle.h" -#include "shared-bindings/vectorio/VectorShape.h" -//| """Lightweight 2d shapes for displays""" +//| """Lightweight 2D shapes for displays +//| +//| The :py:attr:`vectorio` module provide simple filled drawing primitives for +//| use with `displayio`. +//| +//| .. code-block:: python +//| +//| group = displayio.Group() +//| +//| palette = displayio.Palette(1) +//| palette[0] = 0x125690 +//| +//| circle = vectorio.Circle(pixel_shader=palette, radius=25, x=70, y=40) +//| group.append(circle) +//| +//| rectangle = vectorio.Rectangle(pixel_shader=palette, width=40, height=30, x=55, y=45) +//| group.append(rectangle) +//| +//| points=[(5, 5), (100, 20), (20, 20), (20, 100)] +//| polygon = vectorio.Polygon(pixel_shader=palette, points=points, x=0, y=0) +//| group.append(polygon) +//| +//| """ //| STATIC const mp_rom_map_elem_t vectorio_module_globals_table[] = { @@ -16,7 +37,6 @@ STATIC const mp_rom_map_elem_t vectorio_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_Circle), MP_ROM_PTR(&vectorio_circle_type) }, { MP_ROM_QSTR(MP_QSTR_Polygon), MP_ROM_PTR(&vectorio_polygon_type) }, { MP_ROM_QSTR(MP_QSTR_Rectangle), MP_ROM_PTR(&vectorio_rectangle_type) }, - { MP_ROM_QSTR(MP_QSTR_VectorShape), MP_ROM_PTR(&vectorio_vector_shape_type) }, }; STATIC MP_DEFINE_CONST_DICT(vectorio_module_globals, vectorio_module_globals_table); @@ -25,3 +45,5 @@ const mp_obj_module_t vectorio_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&vectorio_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_vectorio, vectorio_module, CIRCUITPY_VECTORIO); diff --git a/shared-bindings/vectorio/__init__.h b/shared-bindings/vectorio/__init__.h new file mode 100644 index 0000000000..a34195de26 --- /dev/null +++ b/shared-bindings/vectorio/__init__.h @@ -0,0 +1,41 @@ +#ifndef SHARED_MODULE_VECTORIO__INIT__H +#define SHARED_MODULE_VECTORIO__INIT__H + +#include +#include + +#include "py/obj.h" +#include "py/proto.h" + +#include "shared-module/displayio/area.h" +#include "shared-module/displayio/Palette.h" + +// Returns the object on which the rest of the draw protocol methods are invoked. +typedef mp_obj_t (*draw_get_protocol_self_fun)(mp_obj_t protocol_container); + +typedef bool (*draw_fill_area_fun)(mp_obj_t draw_protocol_self, const _displayio_colorspace_t *colorspace, const displayio_area_t *area, uint32_t *mask, uint32_t *buffer); +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 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 { + draw_fill_area_fun draw_fill_area; + draw_get_dirty_area_fun draw_get_dirty_area; + draw_update_transform_fun draw_update_transform; + draw_finish_refresh_fun draw_finish_refresh; + draw_get_refresh_areas_fun draw_get_refresh_areas; +} vectorio_draw_protocol_impl_t; + +// Draw protocol +typedef struct _vectorio_draw_protocol_t { + MP_PROTOCOL_HEAD // MP_QSTR_protocol_draw + + // Instance of the draw protocol + draw_get_protocol_self_fun draw_get_protocol_self; + + // Implementation functions for the draw protocol + vectorio_draw_protocol_impl_t *draw_protocol_impl; +} vectorio_draw_protocol_t; + +#endif diff --git a/shared-bindings/watchdog/__init__.c b/shared-bindings/watchdog/__init__.c index 0911aca282..ced56a781b 100644 --- a/shared-bindings/watchdog/__init__.c +++ b/shared-bindings/watchdog/__init__.c @@ -61,10 +61,8 @@ const mp_obj_type_t mp_type_WatchDogTimeout = { mp_obj_exception_t mp_watchdog_timeout_exception = { .base.type = &mp_type_WatchDogTimeout, - .traceback_alloc = 0, - .traceback_len = 0, - .traceback_data = NULL, .args = (mp_obj_tuple_t *)&mp_const_empty_tuple_obj, + .traceback = (mp_obj_traceback_t *)&mp_const_empty_traceback_obj, }; STATIC const mp_rom_map_elem_t watchdog_module_globals_table[] = { @@ -79,3 +77,5 @@ const mp_obj_module_t watchdog_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&watchdog_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_watchdog, watchdog_module, CIRCUITPY_WATCHDOG); diff --git a/shared-bindings/wifi/__init__.c b/shared-bindings/wifi/__init__.c index 0285b98a07..ef72dced1f 100644 --- a/shared-bindings/wifi/__init__.c +++ b/shared-bindings/wifi/__init__.c @@ -70,3 +70,5 @@ const mp_obj_module_t wifi_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t *)&wifi_module_globals, }; + +MP_REGISTER_MODULE(MP_QSTR_wifi, wifi_module, CIRCUITPY_WIFI); diff --git a/shared-module/atexit/__init__.c b/shared-module/atexit/__init__.c new file mode 100644 index 0000000000..56271bbab8 --- /dev/null +++ b/shared-module/atexit/__init__.c @@ -0,0 +1,92 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/gc.h" +#include "py/runtime.h" +#include "shared-module/atexit/__init__.h" + +static size_t callback_len = 0; +static atexit_callback_t *callback = NULL; + +void atexit_reset(void) { + callback_len = 0; + m_free(callback); + callback = NULL; +} + +void atexit_gc_collect(void) { + gc_collect_ptr(callback); +} + +void shared_module_atexit_register(mp_obj_t *func, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) { + if (!mp_obj_is_callable(func)) { + mp_raise_TypeError_varg(translate("'%q' object is not callable"), mp_obj_get_type_qstr(func)); + } + size_t n_kw_args = (kw_args) ? kw_args->used : 0; + atexit_callback_t cb = { + .n_pos = 0, + .n_kw = 0, + .func = func, + .args = (n_args + n_kw_args) ? m_malloc((n_args + (n_kw_args * 2)) * sizeof(mp_obj_t), false) : NULL + }; + for (; cb.n_pos < n_args; cb.n_pos++) { + cb.args[cb.n_pos] = pos_args[cb.n_pos]; + } + for (size_t i = cb.n_pos; cb.n_kw < n_kw_args; i++, cb.n_kw++) { + cb.args[i] = kw_args->table[cb.n_kw].key; + cb.args[i += 1] = kw_args->table[cb.n_kw].value; + } + callback = (atexit_callback_t *)m_realloc(callback, (callback_len + 1) * sizeof(cb)); + callback[callback_len++] = cb; +} + +void shared_module_atexit_unregister(const mp_obj_t *func) { + for (size_t i = 0; i < callback_len; i++) { + if (callback[i].func == *func) { + callback[i].n_pos = 0; + callback[i].n_kw = 0; + callback[i].func = mp_const_none; + callback[i].args = NULL; + } + } +} + +void shared_module_atexit_execute(pyexec_result_t *result) { + if (callback) { + for (size_t i = callback_len; i-- > 0;) { + if (callback[i].func != mp_const_none) { + if (result != NULL) { + pyexec_result_t res; + if (pyexec_exit_handler(&callback[i], &res) == PYEXEC_DEEP_SLEEP) { + *result = res; + } + } else { + pyexec_exit_handler(&callback[i], NULL); + } + } + } + } +} diff --git a/shared-module/atexit/__init__.h b/shared-module/atexit/__init__.h new file mode 100644 index 0000000000..befccb3ea8 --- /dev/null +++ b/shared-module/atexit/__init__.h @@ -0,0 +1,46 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_ATEXIT___INIT___H +#define MICROPY_INCLUDED_SHARED_MODULE_ATEXIT___INIT___H + +#include "py/obj.h" +#include "lib/utils/pyexec.h" + +typedef struct _atexit_callback_t { + size_t n_pos, n_kw; + mp_obj_t func, *args; +} atexit_callback_t; + +extern void atexit_reset(void); +extern void atexit_gc_collect(void); + +extern void shared_module_atexit_register(mp_obj_t *func, + size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args); +extern void shared_module_atexit_unregister(const mp_obj_t *func); +extern void shared_module_atexit_execute(pyexec_result_t *result); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_ATEXIT___INIT___H diff --git a/shared-module/audiocore/WaveFile.c b/shared-module/audiocore/WaveFile.c index 6d42d27ddb..14c92ca411 100644 --- a/shared-module/audiocore/WaveFile.c +++ b/shared-module/audiocore/WaveFile.c @@ -206,7 +206,7 @@ audioio_get_buffer_result_t audioio_wavefile_get_buffer(audioio_wavefile_obj_t * } if (need_more_data) { - uint16_t num_bytes_to_load = self->len; + uint32_t num_bytes_to_load = self->len; if (num_bytes_to_load > self->bytes_remaining) { num_bytes_to_load = self->bytes_remaining; } diff --git a/shared-module/audiomp3/MP3Decoder.c b/shared-module/audiomp3/MP3Decoder.c index 27c69f735b..cc755d7d2f 100644 --- a/shared-module/audiomp3/MP3Decoder.c +++ b/shared-module/audiomp3/MP3Decoder.c @@ -319,6 +319,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t * uint8_t **bufptr, uint32_t *buffer_length) { if (!self->inbuf) { + *buffer_length = 0; return GET_BUFFER_ERROR; } if (!single_channel_output) { @@ -342,6 +343,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t * mp3file_skip_id3v2(self); if (!mp3file_find_sync_word(self)) { + *buffer_length = 0; return self->eof ? GET_BUFFER_DONE : GET_BUFFER_ERROR; } int bytes_left = BYTES_LEFT(self); @@ -349,6 +351,11 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t * int err = MP3Decode(self->decoder, &inbuf, &bytes_left, buffer, 0); CONSUME(self, BYTES_LEFT(self) - bytes_left); + if (err) { + *buffer_length = 0; + return GET_BUFFER_DONE; + } + if (self->inbuf_offset >= 512) { background_callback_add( &self->inbuf_fill_cb, @@ -356,10 +363,6 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t * self); } - if (err) { - return GET_BUFFER_DONE; - } - return GET_BUFFER_MORE_DATA; } diff --git a/shared-module/bitmaptools/__init__.c b/shared-module/bitmaptools/__init__.c index 4c8b887200..b6e0764fdb 100644 --- a/shared-module/bitmaptools/__init__.c +++ b/shared-module/bitmaptools/__init__.c @@ -24,7 +24,6 @@ * THE SOFTWARE. */ - #include "shared-bindings/bitmaptools/__init__.h" #include "shared-bindings/displayio/Bitmap.h" #include "shared-module/displayio/Bitmap.h" @@ -252,6 +251,145 @@ void common_hal_bitmaptools_fill_region(displayio_bitmap_t *destination, } } +void common_hal_bitmaptools_boundary_fill(displayio_bitmap_t *destination, + int16_t x, int16_t y, + uint32_t fill_color_value, uint32_t replaced_color_value) { + + if (fill_color_value == replaced_color_value) { + // There is nothing to do + return; + } + + uint32_t current_point_color_value; + + // the list of points that we'll check + mp_obj_t fill_area = mp_obj_new_list(0, NULL); + + // first point is the one user passed in + mp_obj_t point[] = { mp_obj_new_int(x), mp_obj_new_int(y) }; + mp_obj_list_append( + fill_area, + mp_obj_new_tuple(2, point) + ); + + int16_t minx = x; + int16_t miny = y; + int16_t maxx = x; + int16_t maxy = y; + + if (replaced_color_value == INT_MAX) { + current_point_color_value = common_hal_displayio_bitmap_get_pixel( + destination, + mp_obj_get_int(point[0]), + mp_obj_get_int(point[1])); + replaced_color_value = (uint32_t)current_point_color_value; + } + + mp_obj_t *fill_points; + size_t list_length = 0; + mp_obj_list_get(fill_area, &list_length, &fill_points); + + mp_obj_t current_point; + + size_t tuple_len = 0; + mp_obj_t *tuple_items; + + int cur_x, cur_y; + + // while there are still points to check + while (list_length > 0) { + mp_obj_list_get(fill_area, &list_length, &fill_points); + current_point = mp_obj_list_pop(fill_area, 0); + mp_obj_tuple_get(current_point, &tuple_len, &tuple_items); + current_point_color_value = common_hal_displayio_bitmap_get_pixel( + destination, + mp_obj_get_int(tuple_items[0]), + mp_obj_get_int(tuple_items[1])); + + // if the current point is not background color ignore it + if (current_point_color_value != replaced_color_value) { + mp_obj_list_get(fill_area, &list_length, &fill_points); + continue; + } + + cur_x = mp_obj_int_get_checked(tuple_items[0]); + cur_y = mp_obj_int_get_checked(tuple_items[1]); + + if (cur_x < minx) { + minx = (int16_t)cur_x; + } + if (cur_x > maxx) { + maxx = (int16_t)cur_x; + } + if (cur_y < miny) { + miny = (int16_t)cur_y; + } + if (cur_y > maxy) { + maxy = (int16_t)cur_y; + } + + // fill the current point with fill color + displayio_bitmap_write_pixel( + destination, + mp_obj_get_int(tuple_items[0]), + mp_obj_get_int(tuple_items[1]), + fill_color_value); + + // add all 4 surrounding points to the list to check + + // ignore points outside of the bitmap + if (mp_obj_int_get_checked(tuple_items[1]) - 1 >= 0) { + mp_obj_t above_point[] = { + tuple_items[0], + MP_OBJ_NEW_SMALL_INT(mp_obj_int_get_checked(tuple_items[1]) - 1) + }; + mp_obj_list_append( + fill_area, + mp_obj_new_tuple(2, above_point)); + } + + // ignore points outside of the bitmap + if (mp_obj_int_get_checked(tuple_items[0]) - 1 >= 0) { + mp_obj_t left_point[] = { + MP_OBJ_NEW_SMALL_INT(mp_obj_int_get_checked(tuple_items[0]) - 1), + tuple_items[1] + }; + mp_obj_list_append( + fill_area, + mp_obj_new_tuple(2, left_point)); + } + + // ignore points outside of the bitmap + if (mp_obj_int_get_checked(tuple_items[0]) + 1 < destination->width) { + mp_obj_t right_point[] = { + MP_OBJ_NEW_SMALL_INT(mp_obj_int_get_checked(tuple_items[0]) + 1), + tuple_items[1] + }; + mp_obj_list_append( + fill_area, + mp_obj_new_tuple(2, right_point)); + } + + // ignore points outside of the bitmap + if (mp_obj_int_get_checked(tuple_items[1]) + 1 < destination->height) { + mp_obj_t below_point[] = { + tuple_items[0], + MP_OBJ_NEW_SMALL_INT(mp_obj_int_get_checked(tuple_items[1]) + 1) + }; + mp_obj_list_append( + fill_area, + mp_obj_new_tuple(2, below_point)); + } + + mp_obj_list_get(fill_area, &list_length, &fill_points); + } + + // set dirty the area so displayio will draw + displayio_area_t area = { minx, miny, maxx + 1, maxy + 1}; + displayio_bitmap_set_dirty_area(destination, &area); + +} + void common_hal_bitmaptools_draw_line(displayio_bitmap_t *destination, int16_t x0, int16_t y0, int16_t x1, int16_t y1, @@ -453,7 +591,7 @@ void common_hal_bitmaptools_readinto(displayio_bitmap_t *self, pyb_file_obj_t *f break; case 24: - value = (rowdata8[x * 3] << 16) | (rowdata8[x * 3 + 1] << 8) | (rowdata8[x * 3 + 2] << 8); + value = (rowdata8[x * 3] << 16) | (rowdata8[x * 3 + 1] << 8) | rowdata8[x * 3 + 2]; break; case 32: diff --git a/shared-module/busio/OneWire.c b/shared-module/busio/OneWire.c deleted file mode 100644 index 80c55c7b2b..0000000000 --- a/shared-module/busio/OneWire.c +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of the Micro Python 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. - */ - -// Wraps the bitbangio implementation of OneWire for use in busio. -#include "common-hal/microcontroller/Pin.h" -#include "shared-bindings/bitbangio/OneWire.h" -#include "shared-module/busio/OneWire.h" - -void common_hal_busio_onewire_construct(busio_onewire_obj_t *self, - const mcu_pin_obj_t *pin) { - shared_module_bitbangio_onewire_construct(&self->bitbang, pin); -} - -bool common_hal_busio_onewire_deinited(busio_onewire_obj_t *self) { - return shared_module_bitbangio_onewire_deinited(&self->bitbang); -} - -void common_hal_busio_onewire_deinit(busio_onewire_obj_t *self) { - if (common_hal_busio_onewire_deinited(self)) { - return; - } - shared_module_bitbangio_onewire_deinit(&self->bitbang); -} - -bool common_hal_busio_onewire_reset(busio_onewire_obj_t *self) { - return shared_module_bitbangio_onewire_reset(&self->bitbang); -} - -bool common_hal_busio_onewire_read_bit(busio_onewire_obj_t *self) { - return shared_module_bitbangio_onewire_read_bit(&self->bitbang); -} - -void common_hal_busio_onewire_write_bit(busio_onewire_obj_t *self, - bool bit) { - shared_module_bitbangio_onewire_write_bit(&self->bitbang, bit); -} diff --git a/shared-module/busio/OneWire.h b/shared-module/busio/OneWire.h deleted file mode 100644 index 5d80bab17c..0000000000 --- a/shared-module/busio/OneWire.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -#ifndef MICROPY_INCLUDED_ATMEL_SAMD_SHARED_MODULE_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_ATMEL_SAMD_SHARED_MODULE_BUSIO_ONEWIRE_H - -#include "shared-module/bitbangio/OneWire.h" - -#include "py/obj.h" - -typedef struct { - mp_obj_base_t base; - bitbangio_onewire_obj_t bitbang; -} busio_onewire_obj_t; - -#endif // MICROPY_INCLUDED_ATMEL_SAMD_SHARED_MODULE_BUSIO_ONEWIRE_H diff --git a/shared-module/displayio/ColorConverter.c b/shared-module/displayio/ColorConverter.c index 4871ce81a0..be5b7d31a7 100644 --- a/shared-module/displayio/ColorConverter.c +++ b/shared-module/displayio/ColorConverter.c @@ -96,7 +96,7 @@ uint8_t displayio_colorconverter_compute_hue(uint32_t color_rgb888) { return hue; } -void displayio_colorconverter_compute_tricolor(const _displayio_colorspace_t *colorspace, uint8_t pixel_hue, uint8_t pixel_luma, uint32_t *color) { +void displayio_colorconverter_compute_tricolor(const _displayio_colorspace_t *colorspace, uint8_t pixel_hue, uint32_t *color) { int16_t hue_diff = colorspace->tricolor_hue - pixel_hue; if ((-10 <= hue_diff && hue_diff <= 10) || hue_diff <= -220 || hue_diff >= 220) { @@ -244,7 +244,7 @@ void displayio_colorconverter_convert(displayio_colorconverter_t *self, const _d return; } uint8_t pixel_hue = displayio_colorconverter_compute_hue(pixel); - displayio_colorconverter_compute_tricolor(colorspace, pixel_hue, luma, &output_color->pixel); + displayio_colorconverter_compute_tricolor(colorspace, pixel_hue, &output_color->pixel); return; } else if (colorspace->grayscale && colorspace->depth <= 8) { uint8_t luma = displayio_colorconverter_compute_luma(pixel); diff --git a/shared-module/displayio/ColorConverter.h b/shared-module/displayio/ColorConverter.h index d8805ed720..7e4e9819ac 100644 --- a/shared-module/displayio/ColorConverter.h +++ b/shared-module/displayio/ColorConverter.h @@ -51,6 +51,6 @@ uint16_t displayio_colorconverter_compute_rgb565(uint32_t color_rgb888); uint8_t displayio_colorconverter_compute_luma(uint32_t color_rgb888); uint8_t displayio_colorconverter_compute_chroma(uint32_t color_rgb888); uint8_t displayio_colorconverter_compute_hue(uint32_t color_rgb888); -void displayio_colorconverter_compute_tricolor(const _displayio_colorspace_t *colorspace, uint8_t pixel_hue, uint8_t pixel_luma, uint32_t *color); +void displayio_colorconverter_compute_tricolor(const _displayio_colorspace_t *colorspace, uint8_t pixel_hue, uint32_t *color); #endif // MICROPY_INCLUDED_SHARED_MODULE_DISPLAYIO_COLORCONVERTER_H diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index ba509c6986..f74b472bf4 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -29,7 +29,9 @@ #include "py/runtime.h" #include "shared-bindings/displayio/FourWire.h" #include "shared-bindings/displayio/I2CDisplay.h" -#include "shared-bindings/displayio/ParallelBus.h" +#if CIRCUITPY_PARALLELDISPLAY +#include "shared-bindings/paralleldisplay/ParallelBus.h" +#endif #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/__init__.h" @@ -45,7 +47,7 @@ void common_hal_displayio_display_construct(displayio_display_obj_t *self, mp_obj_t bus, uint16_t width, uint16_t height, int16_t colstart, int16_t rowstart, uint16_t rotation, uint16_t color_depth, bool grayscale, 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 set_vertical_scroll, + 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, bool single_byte_bounds, bool data_as_commands, bool auto_refresh, uint16_t native_frames_per_second, diff --git a/shared-module/displayio/EPaperDisplay.c b/shared-module/displayio/EPaperDisplay.c index 826fe9b8ea..b1d06fbd72 100644 --- a/shared-module/displayio/EPaperDisplay.c +++ b/shared-module/displayio/EPaperDisplay.c @@ -31,7 +31,9 @@ #include "shared-bindings/displayio/ColorConverter.h" #include "shared-bindings/displayio/FourWire.h" #include "shared-bindings/displayio/I2CDisplay.h" -#include "shared-bindings/displayio/ParallelBus.h" +#if CIRCUITPY_PARALLELDISPLAY +#include "shared-bindings/paralleldisplay/ParallelBus.h" +#endif #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/__init__.h" @@ -163,6 +165,13 @@ STATIC void send_command_sequence(displayio_epaperdisplay_obj_t *self, } } +void displayio_epaperdisplay_change_refresh_mode_parameters(displayio_epaperdisplay_obj_t *self, + mp_buffer_info_t *start_sequence, float seconds_per_frame) { + self->start_sequence = (uint8_t *)start_sequence->buf; + self->start_sequence_len = start_sequence->len; + self->milliseconds_per_frame = seconds_per_frame * 1000; +} + void displayio_epaperdisplay_start_refresh(displayio_epaperdisplay_obj_t *self) { // run start sequence self->core.bus_reset(self->core.bus); diff --git a/shared-module/displayio/EPaperDisplay.h b/shared-module/displayio/EPaperDisplay.h index f200813626..65a4dd7743 100644 --- a/shared-module/displayio/EPaperDisplay.h +++ b/shared-module/displayio/EPaperDisplay.h @@ -59,6 +59,8 @@ typedef struct { display_chip_select_behavior_t chip_select; } displayio_epaperdisplay_obj_t; +void displayio_epaperdisplay_change_refresh_mode_parameters(displayio_epaperdisplay_obj_t *self, + mp_buffer_info_t *start_sequence, float seconds_per_frame); void displayio_epaperdisplay_background(displayio_epaperdisplay_obj_t *self); void release_epaperdisplay(displayio_epaperdisplay_obj_t *self); size_t maybe_refresh_epaperdisplay(void); diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c index ec8ad7ba5a..b9179f0a00 100644 --- a/shared-module/displayio/Group.c +++ b/shared-module/displayio/Group.c @@ -144,10 +144,10 @@ static void _update_child_transforms(displayio_group_t *self) { for (size_t i = 0; i < self->members->len; i++) { mp_obj_t layer; #if CIRCUITPY_VECTORIO - layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_vector_shape_type); - if (layer != MP_OBJ_NULL) { - vectorio_vector_shape_update_transform(layer, &self->absolute_transform); + 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_update_transform(layer, &self->absolute_transform); continue; } #endif @@ -241,15 +241,14 @@ void common_hal_displayio_group_set_y(displayio_group_t *self, mp_int_t y) { } static void _add_layer(displayio_group_t *self, mp_obj_t layer) { - mp_obj_t native_layer; #if CIRCUITPY_VECTORIO - native_layer = mp_obj_cast_to_native_base(layer, &vectorio_vector_shape_type); - if (native_layer != MP_OBJ_NULL) { - vectorio_vector_shape_update_transform(native_layer, &self->absolute_transform); + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, layer); + if (draw_protocol != NULL) { + draw_protocol->draw_protocol_impl->draw_update_transform(draw_protocol->draw_get_protocol_self(layer), &self->absolute_transform); return; } #endif - native_layer = mp_obj_cast_to_native_base(layer, &displayio_tilegrid_type); + mp_obj_t native_layer = mp_obj_cast_to_native_base(layer, &displayio_tilegrid_type); if (native_layer != MP_OBJ_NULL) { displayio_tilegrid_t *tilegrid = native_layer; if (tilegrid->in_group) { @@ -283,12 +282,12 @@ static void _remove_layer(displayio_group_t *self, size_t index) { displayio_area_t layer_area; bool rendered_last_frame = false; #if CIRCUITPY_VECTORIO - layer = mp_obj_cast_to_native_base( - self->members->items[index], &vectorio_vector_shape_type); - if (layer != MP_OBJ_NULL) { - bool has_dirty_area = vectorio_vector_shape_get_dirty_area(layer, &layer_area); + const vectorio_draw_protocol_t *draw_protocol = mp_proto_get(MP_QSTR_protocol_draw, self->members->items[index]); + if (draw_protocol != NULL) { + layer = draw_protocol->draw_get_protocol_self(self->members->items[index]); + bool has_dirty_area = draw_protocol->draw_protocol_impl->draw_get_dirty_area(layer, &layer_area); rendered_last_frame = has_dirty_area; - vectorio_vector_shape_update_transform(layer, NULL); + draw_protocol->draw_protocol_impl->draw_update_transform(layer, NULL); } #endif layer = mp_obj_cast_to_native_base( @@ -362,10 +361,10 @@ bool displayio_group_fill_area(displayio_group_t *self, const _displayio_colorsp for (int32_t i = self->members->len - 1; i >= 0; i--) { mp_obj_t layer; #if CIRCUITPY_VECTORIO - layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_vector_shape_type); - if (layer != MP_OBJ_NULL) { - if (vectorio_vector_shape_fill_area(layer, colorspace, area, mask, buffer)) { + 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; @@ -396,10 +395,10 @@ void displayio_group_finish_refresh(displayio_group_t *self) { for (int32_t i = self->members->len - 1; i >= 0; i--) { mp_obj_t layer; #if CIRCUITPY_VECTORIO - layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_vector_shape_type); - if (layer != MP_OBJ_NULL) { - vectorio_vector_shape_finish_refresh(layer); + 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_finish_refresh(layer); continue; } #endif @@ -427,10 +426,10 @@ displayio_area_t *displayio_group_get_refresh_areas(displayio_group_t *self, dis for (int32_t i = self->members->len - 1; i >= 0; i--) { mp_obj_t layer; #if CIRCUITPY_VECTORIO - layer = mp_obj_cast_to_native_base( - self->members->items[i], &vectorio_vector_shape_type); - if (layer != MP_OBJ_NULL) { - tail = vectorio_vector_shape_get_refresh_areas(layer, tail); + 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]); + tail = draw_protocol->draw_protocol_impl->draw_get_refresh_areas(layer, tail); continue; } #endif diff --git a/shared-module/displayio/Palette.c b/shared-module/displayio/Palette.c index 9b6374ac38..47cad11ea5 100644 --- a/shared-module/displayio/Palette.c +++ b/shared-module/displayio/Palette.c @@ -85,7 +85,7 @@ bool displayio_palette_get_color(displayio_palette_t *self, const _displayio_col return true; } uint8_t pixel_hue = self->colors[palette_index].hue; - displayio_colorconverter_compute_tricolor(colorspace, pixel_hue, luma, color); + displayio_colorconverter_compute_tricolor(colorspace, pixel_hue, color); } else if (colorspace->grayscale) { size_t bitmask = (1 << colorspace->depth) - 1; *color = (self->colors[palette_index].luma >> colorspace->grayscale_bit) & bitmask; diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c index 23338275e8..d264531c99 100644 --- a/shared-module/displayio/__init__.c +++ b/shared-module/displayio/__init__.c @@ -109,8 +109,10 @@ void common_hal_displayio_release_displays(void) { common_hal_displayio_fourwire_deinit(&displays[i].fourwire_bus); } else if (bus_type == &displayio_i2cdisplay_type) { common_hal_displayio_i2cdisplay_deinit(&displays[i].i2cdisplay_bus); - } else if (bus_type == &displayio_parallelbus_type) { - common_hal_displayio_parallelbus_deinit(&displays[i].parallel_bus); + #if CIRCUITPY_PARALLELDISPLAY + } else if (bus_type == ¶lleldisplay_parallelbus_type) { + common_hal_paralleldisplay_parallelbus_deinit(&displays[i].parallel_bus); + #endif #if CIRCUITPY_RGBMATRIX } else if (bus_type == &rgbmatrix_RGBMatrix_type) { common_hal_rgbmatrix_rgbmatrix_deinit(&displays[i].rgbmatrix); @@ -296,13 +298,6 @@ bool displayio_area_compute_overlap(const displayio_area_t *a, return true; } -void displayio_copy_coords(const displayio_area_t *src, displayio_area_t *dest) { - dest->x1 = src->x1; - dest->y1 = src->y1; - dest->x2 = src->x2; - dest->y2 = src->y2; -} - bool displayio_area_empty(const displayio_area_t *a) { return (a->x1 == a->x2) || (a->y1 == a->y2); } @@ -325,11 +320,11 @@ void displayio_area_union(const displayio_area_t *a, displayio_area_t *u) { if (displayio_area_empty(a)) { - displayio_copy_coords(b, u); + displayio_area_copy(b, u); return; } if (displayio_area_empty(b)) { - displayio_copy_coords(a, u); + displayio_area_copy(a, u); return; } u->x1 = MIN(a->x1, b->x1); diff --git a/shared-module/displayio/__init__.h b/shared-module/displayio/__init__.h index 4a74b0e0e0..5bfee4d67d 100644 --- a/shared-module/displayio/__init__.h +++ b/shared-module/displayio/__init__.h @@ -35,7 +35,9 @@ #include "shared-bindings/displayio/FourWire.h" #include "shared-bindings/displayio/Group.h" #include "shared-bindings/displayio/I2CDisplay.h" -#include "shared-bindings/displayio/ParallelBus.h" +#if CIRCUITPY_PARALLELDISPLAY +#include "shared-bindings/paralleldisplay/ParallelBus.h" +#endif #if CIRCUITPY_RGBMATRIX #include "shared-bindings/rgbmatrix/RGBMatrix.h" #endif @@ -48,7 +50,9 @@ typedef struct { mp_obj_base_t bus_base; displayio_fourwire_obj_t fourwire_bus; displayio_i2cdisplay_obj_t i2cdisplay_bus; - displayio_parallelbus_obj_t parallel_bus; + #if CIRCUITPY_PARALLELDISPLAY + paralleldisplay_parallelbus_obj_t parallel_bus; + #endif #if CIRCUITPY_RGBMATRIX rgbmatrix_rgbmatrix_obj_t rgbmatrix; #endif diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 234c0a096b..114b274fd1 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -30,7 +30,9 @@ #include "py/runtime.h" #include "shared-bindings/displayio/FourWire.h" #include "shared-bindings/displayio/I2CDisplay.h" -#include "shared-bindings/displayio/ParallelBus.h" +#if CIRCUITPY_PARALLELDISPLAY +#include "shared-bindings/paralleldisplay/ParallelBus.h" +#endif #include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/time/__init__.h" #include "shared-module/displayio/__init__.h" @@ -61,13 +63,16 @@ void displayio_display_core_construct(displayio_display_core_t *self, // (framebufferdisplay already validated its 'bus' is a buffer-protocol object) if (bus) { - if (mp_obj_is_type(bus, &displayio_parallelbus_type)) { - self->bus_reset = common_hal_displayio_parallelbus_reset; - self->bus_free = common_hal_displayio_parallelbus_bus_free; - self->begin_transaction = common_hal_displayio_parallelbus_begin_transaction; - self->send = common_hal_displayio_parallelbus_send; - self->end_transaction = common_hal_displayio_parallelbus_end_transaction; - } else if (mp_obj_is_type(bus, &displayio_fourwire_type)) { + #if CIRCUITPY_PARALLELDISPLAY + if (mp_obj_is_type(bus, ¶lleldisplay_parallelbus_type)) { + self->bus_reset = common_hal_paralleldisplay_parallelbus_reset; + self->bus_free = common_hal_paralleldisplay_parallelbus_bus_free; + self->begin_transaction = common_hal_paralleldisplay_parallelbus_begin_transaction; + self->send = common_hal_paralleldisplay_parallelbus_send; + self->end_transaction = common_hal_paralleldisplay_parallelbus_end_transaction; + } else + #endif + if (mp_obj_is_type(bus, &displayio_fourwire_type)) { self->bus_reset = common_hal_displayio_fourwire_reset; self->bus_free = common_hal_displayio_fourwire_bus_free; self->begin_transaction = common_hal_displayio_fourwire_begin_transaction; diff --git a/shared-module/gamepad/GamePad.c b/shared-module/gamepad/GamePad.c deleted file mode 100644 index 55b447f1eb..0000000000 --- a/shared-module/gamepad/GamePad.c +++ /dev/null @@ -1,59 +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/mpstate.h" -#include "shared-bindings/digitalio/DigitalInOut.h" -#include "shared-bindings/gamepad/GamePad.h" -#include "supervisor/shared/tick.h" - -void common_hal_gamepad_gamepad_init(gamepad_obj_t *gamepad, - const mp_obj_t pins[], size_t n_pins) { - for (size_t i = 0; i < 8; ++i) { - gamepad->pins[i] = NULL; - } - gamepad->pulls = 0; - for (size_t i = 0; i < n_pins; ++i) { - digitalio_digitalinout_obj_t *pin = MP_OBJ_TO_PTR(pins[i]); - if (common_hal_digitalio_digitalinout_get_direction(pin) != - DIRECTION_INPUT) { - common_hal_digitalio_digitalinout_switch_to_input(pin, PULL_UP); - } - digitalio_pull_t pull = common_hal_digitalio_digitalinout_get_pull(pin); - if (pull == PULL_NONE) { - common_hal_digitalio_digitalinout_set_pull(pin, PULL_UP); - } - if (pull != PULL_DOWN) { - gamepad->pulls |= 1 << i; - } - gamepad->pins[i] = pin; - } - gamepad->last = 0; -} - -void common_hal_gamepad_gamepad_deinit(gamepad_obj_t *self) { - MP_STATE_VM(gamepad_singleton) = NULL; - supervisor_disable_tick(); -} diff --git a/shared-module/gamepad/GamePad.h b/shared-module/gamepad/GamePad.h deleted file mode 100644 index 7c28e2285b..0000000000 --- a/shared-module/gamepad/GamePad.h +++ /dev/null @@ -1,42 +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. - */ - -#ifndef MICROPY_INCLUDED_GAMEPAD_GAMEPAD_H -#define MICROPY_INCLUDED_GAMEPAD_GAMEPAD_H - -#include - -#include "shared-bindings/digitalio/DigitalInOut.h" - -typedef struct { - mp_obj_base_t base; - digitalio_digitalinout_obj_t *pins[8]; - volatile uint8_t last; - volatile uint8_t pressed; - uint8_t pulls; -} gamepad_obj_t; - -#endif // MICROPY_INCLUDED_GAMEPAD_GAMEPAD_H diff --git a/shared-module/gamepad/__init__.c b/shared-module/gamepad/__init__.c deleted file mode 100644 index 50e3edd9cf..0000000000 --- a/shared-module/gamepad/__init__.c +++ /dev/null @@ -1,67 +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 - -#include "py/mpstate.h" -#include "shared-bindings/gamepad/__init__.h" -#include "shared-bindings/gamepad/GamePad.h" -#include "supervisor/shared/tick.h" - -#include "shared-bindings/digitalio/DigitalInOut.h" - - -void gamepad_tick(void) { - uint8_t current = 0; - uint8_t bit = 1; - - void *singleton = MP_STATE_VM(gamepad_singleton); - if (singleton == NULL || !mp_obj_is_type(MP_OBJ_FROM_PTR(singleton), &gamepad_type)) { - return; - } - - gamepad_obj_t *self = MP_OBJ_TO_PTR(singleton); - for (int i = 0; i < 8; ++i) { - digitalio_digitalinout_obj_t *pin = self->pins[i]; - if (!pin) { - break; - } - if (common_hal_digitalio_digitalinout_get_value(pin)) { - current |= bit; - } - bit <<= 1; - } - current ^= self->pulls; - self->pressed |= self->last & current; - self->last = current; -} - -void gamepad_reset(void) { - if (MP_STATE_VM(gamepad_singleton)) { - supervisor_disable_tick(); - } - MP_STATE_VM(gamepad_singleton) = NULL; -} diff --git a/shared-module/getpass/__init__.c b/shared-module/getpass/__init__.c new file mode 100644 index 0000000000..f7ab96c378 --- /dev/null +++ b/shared-module/getpass/__init__.c @@ -0,0 +1,61 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "py/mphal.h" +#include "lib/mp-readline/readline.h" +#include "shared-module/getpass/__init__.h" + +mp_obj_t shared_module_getpass_getpass(const char *prompt, mp_print_t *print) { + vstr_t vstr; + vstr_init(&vstr, 16); + + if (print == NULL) { + mp_hal_stdout_tx_str(prompt); + } else { + mp_printf(print, prompt); + } + + for (;;) { + int c = mp_hal_stdin_rx_chr(); + if (c == CHAR_CTRL_C) { + mp_raise_type(&mp_type_KeyboardInterrupt); + } else if (c == CHAR_CTRL_D && vstr.len == 0) { + mp_raise_type(&mp_type_EOFError); + } else if (c == 8 || c == 127) { + // backspace + vstr_cut_tail_bytes(&vstr, 1); + } else if (c >= 32) { + // printable character + vstr_ins_char(&vstr, vstr.len, c); + } else if (c == '\r') { + // newline + mp_hal_stdout_tx_str("\r\n"); + break; + } + } + + return mp_obj_new_str_from_vstr(&mp_type_str, &vstr); +} diff --git a/shared-module/getpass/__init__.h b/shared-module/getpass/__init__.h new file mode 100644 index 0000000000..80595d41ba --- /dev/null +++ b/shared-module/getpass/__init__.h @@ -0,0 +1,34 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_GETPASS___INIT___H +#define MICROPY_INCLUDED_SHARED_MODULE_GETPASS___INIT___H + +#include "py/runtime.h" + +extern mp_obj_t shared_module_getpass_getpass(const char *prompt, mp_print_t *print); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_GETPASS___INIT___H diff --git a/shared-module/keypad/KeyMatrix.c b/shared-module/keypad/KeyMatrix.c index 88e9d09a83..6db012d0f6 100644 --- a/shared-module/keypad/KeyMatrix.c +++ b/shared-module/keypad/KeyMatrix.c @@ -77,8 +77,6 @@ void common_hal_keypad_keymatrix_construct(keypad_keymatrix_obj_t *self, mp_uint // Add self to the list of active keypad scanners. keypad_register_scanner((keypad_scanner_obj_t *)self); - - supervisor_enable_tick(); } void common_hal_keypad_keymatrix_deinit(keypad_keymatrix_obj_t *self) { diff --git a/shared-module/keypad/Keys.c b/shared-module/keypad/Keys.c index 1f232a03ed..2880d18de5 100644 --- a/shared-module/keypad/Keys.c +++ b/shared-module/keypad/Keys.c @@ -63,8 +63,6 @@ void common_hal_keypad_keys_construct(keypad_keys_obj_t *self, mp_uint_t num_pin // Add self to the list of active keypad scanners. keypad_register_scanner((keypad_scanner_obj_t *)self); - - supervisor_enable_tick(); } void common_hal_keypad_keys_deinit(keypad_keys_obj_t *self) { diff --git a/shared-module/keypad/ShiftRegisterKeys.c b/shared-module/keypad/ShiftRegisterKeys.c index 074f226998..5075437214 100644 --- a/shared-module/keypad/ShiftRegisterKeys.c +++ b/shared-module/keypad/ShiftRegisterKeys.c @@ -71,8 +71,6 @@ void common_hal_keypad_shiftregisterkeys_construct(keypad_shiftregisterkeys_obj_ // Add self to the list of active keypad scanners. keypad_register_scanner((keypad_scanner_obj_t *)self); - - supervisor_enable_tick(); } void common_hal_keypad_shiftregisterkeys_deinit(keypad_shiftregisterkeys_obj_t *self) { diff --git a/shared-module/keypad/__init__.c b/shared-module/keypad/__init__.c index fc41396617..e239c56b61 100644 --- a/shared-module/keypad/__init__.c +++ b/shared-module/keypad/__init__.c @@ -57,12 +57,9 @@ void keypad_tick(void) { } void keypad_reset(void) { - if (MP_STATE_VM(keypad_scanners_linked_list)) { - supervisor_disable_tick(); + while (MP_STATE_VM(keypad_scanners_linked_list)) { + keypad_deregister_scanner(MP_STATE_VM(keypad_scanners_linked_list)); } - - MP_STATE_VM(keypad_scanners_linked_list) = NULL; - keypad_scanners_linked_list_lock = false; } // Register a Keys, KeyMatrix, etc. that will be scanned in the background @@ -71,10 +68,16 @@ void keypad_register_scanner(keypad_scanner_obj_t *scanner) { scanner->next = MP_STATE_VM(keypad_scanners_linked_list); MP_STATE_VM(keypad_scanners_linked_list) = scanner; supervisor_release_lock(&keypad_scanners_linked_list_lock); + + // One more request for ticks. + supervisor_enable_tick(); } // Remove scanner from the list of active scanners. void keypad_deregister_scanner(keypad_scanner_obj_t *scanner) { + // One less request for ticks. + supervisor_disable_tick(); + supervisor_acquire_lock(&keypad_scanners_linked_list_lock); if (MP_STATE_VM(keypad_scanners_linked_list) == scanner) { // Scanner is at the front; splice it out. diff --git a/shared-module/bitbangio/OneWire.c b/shared-module/onewireio/OneWire.c similarity index 85% rename from shared-module/bitbangio/OneWire.c rename to shared-module/onewireio/OneWire.c index 8a73817f37..aeb4dcb00d 100644 --- a/shared-module/bitbangio/OneWire.c +++ b/shared-module/onewireio/OneWire.c @@ -25,24 +25,24 @@ */ #include "common-hal/microcontroller/Pin.h" -#include "shared-bindings/bitbangio/OneWire.h" +#include "shared-bindings/onewireio/OneWire.h" #include "shared-bindings/microcontroller/__init__.h" #include "shared-bindings/digitalio/DigitalInOut.h" // Durations are taken from here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126 -void shared_module_bitbangio_onewire_construct(bitbangio_onewire_obj_t *self, +void common_hal_onewireio_onewire_construct(onewireio_onewire_obj_t *self, const mcu_pin_obj_t *pin) { self->pin.base.type = &digitalio_digitalinout_type; common_hal_digitalio_digitalinout_construct(&self->pin, pin); } -bool shared_module_bitbangio_onewire_deinited(bitbangio_onewire_obj_t *self) { +bool common_hal_onewireio_onewire_deinited(onewireio_onewire_obj_t *self) { return common_hal_digitalio_digitalinout_deinited(&self->pin); } -void shared_module_bitbangio_onewire_deinit(bitbangio_onewire_obj_t *self) { - if (shared_module_bitbangio_onewire_deinited(self)) { +void common_hal_onewireio_onewire_deinit(onewireio_onewire_obj_t *self) { + if (common_hal_onewireio_onewire_deinited(self)) { return; } common_hal_digitalio_digitalinout_deinit(&self->pin); @@ -51,7 +51,7 @@ void shared_module_bitbangio_onewire_deinit(bitbangio_onewire_obj_t *self) { // We use common_hal_mcu_delay_us(). It should not be dependent on interrupts // to do accurate timekeeping, since we disable interrupts during the delays below. -bool shared_module_bitbangio_onewire_reset(bitbangio_onewire_obj_t *self) { +bool common_hal_onewireio_onewire_reset(onewireio_onewire_obj_t *self) { common_hal_mcu_disable_interrupts(); common_hal_digitalio_digitalinout_switch_to_output(&self->pin, false, DRIVE_MODE_OPEN_DRAIN); common_hal_mcu_delay_us(480); @@ -63,7 +63,7 @@ bool shared_module_bitbangio_onewire_reset(bitbangio_onewire_obj_t *self) { return value; } -bool shared_module_bitbangio_onewire_read_bit(bitbangio_onewire_obj_t *self) { +bool common_hal_onewireio_onewire_read_bit(onewireio_onewire_obj_t *self) { common_hal_mcu_disable_interrupts(); common_hal_digitalio_digitalinout_switch_to_output(&self->pin, false, DRIVE_MODE_OPEN_DRAIN); common_hal_mcu_delay_us(6); @@ -78,7 +78,7 @@ bool shared_module_bitbangio_onewire_read_bit(bitbangio_onewire_obj_t *self) { return value; } -void shared_module_bitbangio_onewire_write_bit(bitbangio_onewire_obj_t *self, +void common_hal_onewireio_onewire_write_bit(onewireio_onewire_obj_t *self, bool bit) { common_hal_mcu_disable_interrupts(); common_hal_digitalio_digitalinout_switch_to_output(&self->pin, false, DRIVE_MODE_OPEN_DRAIN); diff --git a/shared-module/bitbangio/OneWire.h b/shared-module/onewireio/OneWire.h similarity index 86% rename from shared-module/bitbangio/OneWire.h rename to shared-module/onewireio/OneWire.h index bc4cb2096f..594478f861 100644 --- a/shared-module/bitbangio/OneWire.h +++ b/shared-module/onewireio/OneWire.h @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_ONEWIRE_H -#define MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_ONEWIRE_H +#ifndef MICROPY_INCLUDED_SHARED_MODULE_ONEWIREIO_ONEWIRE_H +#define MICROPY_INCLUDED_SHARED_MODULE_ONEWIREIO_ONEWIRE_H #include "common-hal/digitalio/DigitalInOut.h" @@ -34,6 +34,6 @@ typedef struct { mp_obj_base_t base; digitalio_digitalinout_obj_t pin; -} bitbangio_onewire_obj_t; +} onewireio_onewire_obj_t; -#endif // MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_ONEWIRE_H +#endif // MICROPY_INCLUDED_SHARED_MODULE_ONEWIREIO_ONEWIRE_H diff --git a/shared-module/onewireio/__init__.c b/shared-module/onewireio/__init__.c new file mode 100644 index 0000000000..674343c533 --- /dev/null +++ b/shared-module/onewireio/__init__.c @@ -0,0 +1,27 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Scott Shawcroft + * + * 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. + */ + +// Nothing now. diff --git a/shared-module/qrio/QRDecoder.c b/shared-module/qrio/QRDecoder.c new file mode 100644 index 0000000000..227f3b39b4 --- /dev/null +++ b/shared-module/qrio/QRDecoder.c @@ -0,0 +1,137 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 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/gc.h" +#include "py/objnamedtuple.h" +#include "shared-bindings/qrio/__init__.h" +#include "shared-bindings/qrio/QRInfo.h" +#include "shared-module/qrio/QRDecoder.h" + +void shared_module_qrio_qrdecoder_construct(qrdecoder_qrdecoder_obj_t *self, int width, int height) { + self->quirc = quirc_new(); + quirc_resize(self->quirc, width, height); +} + +int shared_module_qrio_qrdecoder_get_height(qrdecoder_qrdecoder_obj_t *self) { + int height; + quirc_begin(self->quirc, NULL, &height); + return height; +} + +int shared_module_qrio_qrdecoder_get_width(qrdecoder_qrdecoder_obj_t *self) { + int width; + quirc_begin(self->quirc, &width, NULL); + return width; +} +void shared_module_qrio_qrdecoder_set_height(qrdecoder_qrdecoder_obj_t *self, int height) { + if (height != shared_module_qrio_qrdecoder_get_height(self)) { + int width = shared_module_qrio_qrdecoder_get_width(self); + quirc_resize(self->quirc, width, height); + } +} + +void shared_module_qrio_qrdecoder_set_width(qrdecoder_qrdecoder_obj_t *self, int width) { + if (width != shared_module_qrio_qrdecoder_get_width(self)) { + int height = shared_module_qrio_qrdecoder_get_height(self); + quirc_resize(self->quirc, width, height); + } +} + +STATIC mp_obj_t data_type(int type) { + switch (type) { + case QUIRC_ECI_ISO_8859_1: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_1); + case QUIRC_ECI_IBM437: + return MP_OBJ_NEW_QSTR(MP_QSTR_cp437); + case QUIRC_ECI_ISO_8859_2: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_2); + case QUIRC_ECI_ISO_8859_3: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_3); + case QUIRC_ECI_ISO_8859_4: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_4); + case QUIRC_ECI_ISO_8859_5: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_5); + case QUIRC_ECI_ISO_8859_6: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_6); + case QUIRC_ECI_ISO_8859_7: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_7); + case QUIRC_ECI_ISO_8859_8: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_8); + case QUIRC_ECI_ISO_8859_9: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_9); + case QUIRC_ECI_WINDOWS_874: + return MP_OBJ_NEW_QSTR(MP_QSTR_cp874); + case QUIRC_ECI_ISO_8859_13: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_13); + case QUIRC_ECI_ISO_8859_15: + return MP_OBJ_NEW_QSTR(MP_QSTR_iso_8859_hyphen_15); + case QUIRC_ECI_SHIFT_JIS: + return MP_OBJ_NEW_QSTR(MP_QSTR_shift_underscore_jis); + case QUIRC_ECI_UTF_8: + return MP_OBJ_NEW_QSTR(MP_QSTR_utf_hyphen_8); + } + return mp_obj_new_int(type); +} + +mp_obj_t shared_module_qrio_qrdecoder_decode(qrdecoder_qrdecoder_obj_t *self, const mp_buffer_info_t *bufinfo, qrio_pixel_policy_t policy) { + int width, height; + uint8_t *framebuffer = quirc_begin(self->quirc, &width, &height); + uint8_t *src = bufinfo->buf; + + switch (policy) { + case QRIO_EVERY_BYTE: + memcpy(framebuffer, src, width * height); + break; + + case QRIO_ODD_BYTES: + src++; + MP_FALLTHROUGH; + + case QRIO_EVEN_BYTES: + for (int i = 0; i < width * height; i++) { + framebuffer[i] = src[2 * i]; + } + } + quirc_end(self->quirc); + + int count = quirc_count(self->quirc); + mp_obj_t result = mp_obj_new_list(0, NULL); + for (int i = 0; i < count; i++) { + quirc_extract(self->quirc, i, &self->code); + if (quirc_decode(&self->code, &self->data) != QUIRC_SUCCESS) { + continue; + } + mp_obj_t elems[2] = { + mp_obj_new_bytes(self->data.payload, self->data.payload_len), + data_type(self->data.data_type), + }; + mp_obj_t code_obj = namedtuple_make_new((const mp_obj_type_t *)&qrio_qrinfo_type_obj, 2, elems, NULL); + mp_obj_list_append(result, code_obj); + } + return result; +} diff --git a/shared-module/qrio/QRDecoder.h b/shared-module/qrio/QRDecoder.h new file mode 100644 index 0000000000..096dcd2e3f --- /dev/null +++ b/shared-module/qrio/QRDecoder.h @@ -0,0 +1,45 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 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 "lib/quirc/lib/quirc.h" +#include "shared-bindings/qrio/PixelPolicy.h" + +typedef struct qrio_qrdecoder_obj { + mp_obj_base_t base; + struct quirc *quirc; + struct quirc_code code; + struct quirc_data data; +} qrdecoder_qrdecoder_obj_t; + +void shared_module_qrio_qrdecoder_construct(qrdecoder_qrdecoder_obj_t *, int width, int height); +int shared_module_qrio_qrdecoder_get_height(qrdecoder_qrdecoder_obj_t *); +int shared_module_qrio_qrdecoder_get_width(qrdecoder_qrdecoder_obj_t *); +void shared_module_qrio_qrdecoder_set_height(qrdecoder_qrdecoder_obj_t *, int height); +void shared_module_qrio_qrdecoder_set_width(qrdecoder_qrdecoder_obj_t *, int width); +mp_obj_t shared_module_qrio_qrdecoder_decode(qrdecoder_qrdecoder_obj_t *, const mp_buffer_info_t *bufinfo, qrio_pixel_policy_t policy); diff --git a/shared-module/qrio/__init__.c b/shared-module/qrio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared-module/qrio/quirc_alloc.h b/shared-module/qrio/quirc_alloc.h new file mode 100644 index 0000000000..b01fac5bfb --- /dev/null +++ b/shared-module/qrio/quirc_alloc.h @@ -0,0 +1,14 @@ +#pragma once + +#include "py/gc.h" + +#if !MICROPY_GC_CONSERVATIVE_CLEAR +// so that we can implement calloc as m_malloc +#error Requires MICROPY_GC_CONSERVATIVE_CLEAR +#endif + +#define QUIRC_MALLOC(x) gc_alloc((x), 0, false) +#define QUIRC_CALLOC(x,y) gc_alloc((x) * (y), 0, false) +#define QUIRC_FREE(x) gc_free((x)) + +#define QUIRC_SMALL_STACK (1) diff --git a/shared-module/terminalio/Terminal.c b/shared-module/terminalio/Terminal.c index 8e4979ecad..48010aa650 100644 --- a/shared-module/terminalio/Terminal.c +++ b/shared-module/terminalio/Terminal.c @@ -46,6 +46,10 @@ void common_hal_terminalio_terminal_construct(terminalio_terminal_obj_t *self, d } 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) { + return len; + } const byte *i = data; uint16_t start_y = self->cursor_y; while (i < data + len) { @@ -169,5 +173,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 true; + return self->tilegrid != NULL; } diff --git a/shared-module/traceback/__init__.c b/shared-module/traceback/__init__.c new file mode 100644 index 0000000000..a29bd5743f --- /dev/null +++ b/shared-module/traceback/__init__.c @@ -0,0 +1,31 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "shared-module/traceback/__init__.h" + +void shared_module_traceback_print_exception(mp_obj_exception_t *exc, mp_print_t *print, mp_int_t limit) { + mp_obj_print_exception_with_limit(print, exc, limit); +} diff --git a/shared-module/traceback/__init__.h b/shared-module/traceback/__init__.h new file mode 100644 index 0000000000..73edd07504 --- /dev/null +++ b/shared-module/traceback/__init__.h @@ -0,0 +1,36 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 microDev + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#ifndef MICROPY_INCLUDED_SHARED_MODULE_TRACEBACK___INIT___H +#define MICROPY_INCLUDED_SHARED_MODULE_TRACEBACK___INIT___H + +#include "py/objexcept.h" +#include "py/objtraceback.h" + +extern void shared_module_traceback_print_exception(mp_obj_exception_t *exc, + mp_print_t *print, mp_int_t limit); + +#endif // MICROPY_INCLUDED_SHARED_MODULE_TRACEBACK___INIT___H diff --git a/shared-module/usb_hid/Device.c b/shared-module/usb_hid/Device.c index ad64070448..71c6dea7af 100644 --- a/shared-module/usb_hid/Device.c +++ b/shared-module/usb_hid/Device.c @@ -36,38 +36,39 @@ #include "tusb.h" static const uint8_t keyboard_report_descriptor[] = { - 0x05, 0x01, // 0,1 Usage Page (Generic Desktop Ctrls) - 0x09, 0x06, // 2,3 Usage (Keyboard) - 0xA1, 0x01, // 4,5 Collection (Application) - 0x85, 0xFF, // 6,7 Report ID [SET AT RUNTIME] -#define KEYBOARD_REPORT_ID_INDEX (7) - 0x05, 0x07, // Usage Page (Kbrd/Keypad) - 0x19, 0xE0, // Usage Minimum (0xE0) - 0x29, 0xE7, // Usage Maximum (0xE7) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x75, 0x01, // Report Size (1) - 0x95, 0x08, // Report Count (8) - 0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) - 0x81, 0x01, // Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) - 0x19, 0x00, // Usage Minimum (0x00) - 0x29, 0xDD, // Usage Maximum (0xDD) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0xDD, // Logical Maximum (-35) - 0x75, 0x08, // Report Size (8) - 0x95, 0x06, // Report Count (6) - 0x81, 0x00, // Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) - 0x05, 0x08, // Usage Page (LEDs) - 0x19, 0x01, // Usage Minimum (Num Lock) - 0x29, 0x05, // Usage Maximum (Kana) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x75, 0x01, // Report Size (1) - 0x95, 0x05, // Report Count (5) - 0x91, 0x02, // Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) - 0x95, 0x03, // Report Count (3) - 0x91, 0x01, // Output (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) - 0xC0, // End Collection + 0x05, 0x01, // Usage Page (Generic Desktop Ctrls) + 0x09, 0x06, // Usage (Keyboard) + 0xA1, 0x01, // Collection (Application) + 0x85, 0x01, // Report ID (1) + 0x05, 0x07, // Usage Page (Kbrd/Keypad) + 0x19, 0xE0, // Usage Minimum (0xE0) + 0x29, 0xE7, // Usage Maximum (0xE7) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x75, 0x01, // Report Size (1) + 0x95, 0x08, // Report Count (8) + 0x81, 0x02, // Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position) + 0x95, 0x01, // Report Count (1) + 0x75, 0x08, // Report Size (8) + 0x81, 0x01, // Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) + 0x95, 0x03, // Report Count (3) + 0x75, 0x01, // Report Size (1) + 0x05, 0x08, // Usage Page (LEDs) + 0x19, 0x01, // Usage Minimum (Num Lock) + 0x29, 0x05, // Usage Maximum (Kana) + 0x91, 0x02, // Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) + 0x95, 0x01, // Report Count (1) + 0x75, 0x05, // Report Size (5) + 0x91, 0x01, // Output (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile) + 0x95, 0x06, // Report Count (6) + 0x75, 0x08, // Report Size (8) + 0x15, 0x00, // Logical Minimum (0) + 0x26, 0xFF, 0x00, // Logical Maximum (255) + 0x05, 0x07, // Usage Page (Kbrd/Keypad) + 0x19, 0x00, // Usage Minimum (0x00) + 0x2A, 0xFF, 0x00, // Usage Maximum (0xFF) + 0x81, 0x00, // Input (Data,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) + 0xC0, // End Collection }; const usb_hid_device_obj_t usb_hid_device_keyboard_obj = { @@ -78,20 +79,19 @@ const usb_hid_device_obj_t usb_hid_device_keyboard_obj = { .report_descriptor_length = sizeof(keyboard_report_descriptor), .usage_page = 0x01, .usage = 0x06, - .in_report_length = 8, - .out_report_length = 1, - .report_id_index = KEYBOARD_REPORT_ID_INDEX, - + .num_report_ids = 1, + .report_ids = { 0x01, }, + .in_report_lengths = { 8, }, + .out_report_lengths = { 1, }, }; static const uint8_t mouse_report_descriptor[] = { - 0x05, 0x01, // 0,1 Usage Page (Generic Desktop Ctrls) - 0x09, 0x02, // 2,3 Usage (Mouse) - 0xA1, 0x01, // 4,5 Collection (Application) - 0x09, 0x01, // 6,7 Usage (Pointer) - 0xA1, 0x00, // 8,9 Collection (Physical) - 0x85, 0xFF, // 10, 11 Report ID [SET AT RUNTIME] -#define MOUSE_REPORT_ID_INDEX (11) + 0x05, 0x01, // Usage Page (Generic Desktop Ctrls) + 0x09, 0x02, // Usage (Mouse) + 0xA1, 0x01, // Collection (Application) + 0x09, 0x01, // Usage (Pointer) + 0xA1, 0x00, // Collection (Physical) + 0x85, 0x02, // 10, 11 Report ID (2) 0x05, 0x09, // Usage Page (Button) 0x19, 0x01, // Usage Minimum (0x01) 0x29, 0x05, // Usage Maximum (0x05) @@ -129,17 +129,17 @@ const usb_hid_device_obj_t usb_hid_device_mouse_obj = { .report_descriptor_length = sizeof(mouse_report_descriptor), .usage_page = 0x01, .usage = 0x02, - .in_report_length = 4, - .out_report_length = 0, - .report_id_index = MOUSE_REPORT_ID_INDEX, + .num_report_ids = 1, + .report_ids = { 0x02, }, + .in_report_lengths = { 4, }, + .out_report_lengths = { 0, }, }; static const uint8_t consumer_control_report_descriptor[] = { - 0x05, 0x0C, // 0,1 Usage Page (Consumer) - 0x09, 0x01, // 2,3 Usage (Consumer Control) - 0xA1, 0x01, // 4,5 Collection (Application) - 0x85, 0xFF, // 6,7 Report ID [SET AT RUNTIME] -#define CONSUMER_CONTROL_REPORT_ID_INDEX (7) + 0x05, 0x0C, // Usage Page (Consumer) + 0x09, 0x01, // Usage (Consumer Control) + 0xA1, 0x01, // Collection (Application) + 0x85, 0x03, // Report ID (3) 0x75, 0x10, // Report Size (16) 0x95, 0x01, // Report Count (1) 0x15, 0x01, // Logical Minimum (1) @@ -158,20 +158,46 @@ const usb_hid_device_obj_t usb_hid_device_consumer_control_obj = { .report_descriptor_length = sizeof(consumer_control_report_descriptor), .usage_page = 0x0C, .usage = 0x01, - .in_report_length = 2, - .out_report_length = 0, - .report_id_index = CONSUMER_CONTROL_REPORT_ID_INDEX, + .num_report_ids = 1, + .report_ids = { 0x03 }, + .in_report_lengths = { 2, }, + .out_report_lengths = { 0, }, }; +STATIC size_t get_report_id_idx(usb_hid_device_obj_t *self, size_t report_id) { + for (size_t i = 0; i < self->num_report_ids; i++) { + if (report_id == self->report_ids[i]) { + return i; + } + } + return CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR; +} + +// See if report_id is used by this device. If it is -1, then return the sole report id used by this device, +// which might be 0 if no report_id was supplied. +uint8_t common_hal_usb_hid_device_validate_report_id(usb_hid_device_obj_t *self, mp_int_t report_id_arg) { + if (report_id_arg == -1 && self->num_report_ids == 1) { + return self->report_ids[0]; + } + 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); + } + return (uint8_t)report_id_arg; +} + +void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t report_descriptor, uint8_t usage_page, uint8_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); + } -void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t report_descriptor, uint8_t usage_page, uint8_t usage, uint8_t in_report_length, uint8_t out_report_length, uint8_t report_id_index) { // report buffer pointers are NULL at start, and are created when USB is initialized. - mp_buffer_info_t bufinfo; mp_get_buffer_raise(report_descriptor, &bufinfo, MP_BUFFER_READ); self->report_descriptor_length = bufinfo.len; - // Copy the raw the descriptor bytes into a heap obj. We don't keep the Python descriptor object. + // Copy the raw descriptor bytes into a heap obj. We don't keep the Python descriptor object. uint8_t *descriptor_bytes = gc_alloc(bufinfo.len, false, false); memcpy(descriptor_bytes, bufinfo.buf, bufinfo.len); @@ -179,9 +205,10 @@ void common_hal_usb_hid_device_construct(usb_hid_device_obj_t *self, mp_obj_t re self->usage_page = usage_page; self->usage = usage; - self->in_report_length = in_report_length; - self->out_report_length = out_report_length; - self->report_id_index = report_id_index; + self->num_report_ids = num_report_ids; + memcpy(self->report_ids, report_ids, num_report_ids); + memcpy(self->in_report_lengths, in_report_lengths, num_report_ids); + memcpy(self->out_report_lengths, out_report_lengths, num_report_ids); } uint8_t common_hal_usb_hid_device_get_usage_page(usb_hid_device_obj_t *self) { @@ -192,9 +219,13 @@ uint8_t common_hal_usb_hid_device_get_usage(usb_hid_device_obj_t *self) { return self->usage; } -void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t *report, uint8_t len) { - if (len != self->in_report_length) { - mp_raise_ValueError_varg(translate("Buffer incorrect size. Should be %d bytes."), self->in_report_length); +void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t *report, uint8_t len, uint8_t report_id) { + // 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]); } // Wait until interface is ready, timeout = 2 seconds @@ -207,25 +238,35 @@ void common_hal_usb_hid_device_send_report(usb_hid_device_obj_t *self, uint8_t * mp_raise_msg(&mp_type_OSError, translate("USB busy")); } - memcpy(self->in_report_buffer, report, len); - - if (!tud_hid_report(self->report_id, self->in_report_buffer, len)) { + if (!tud_hid_report(report_id, report, len)) { mp_raise_msg(&mp_type_OSError, translate("USB error")); } } +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 deveice. + size_t id_idx = get_report_id_idx(self, report_id); + return mp_obj_new_bytes(self->out_report_buffers[id_idx], self->out_report_lengths[id_idx]); +} void usb_hid_device_create_report_buffers(usb_hid_device_obj_t *self) { - if (self->in_report_length > 0) { - self->in_report_buffer = gc_alloc(self->in_report_length, false, true /*long-lived*/); - } - if (self->out_report_length > 0) { - self->out_report_buffer = gc_alloc(self->out_report_length, false, true /*long-lived*/); + for (size_t i = 0; i < self->num_report_ids; i++) { + // The IN buffers are used only for tud_hid_get_report_cb(), + // which is an unusual case. Normally we can just pass the data directly with tud_hid_report(). + self->in_report_buffers[i] = + self->in_report_lengths[i] > 0 + ? gc_alloc(self->in_report_lengths[i], false, true /*long-lived*/) + : NULL; + + self->out_report_buffers[i] = + self->out_report_lengths[i] > 0 + ? gc_alloc(self->out_report_lengths[i], false, true /*long-lived*/) + : NULL; } } -// Callbacks invoked when receive Get_Report request through control endpoint +// Callbacks invoked when we received Get_Report request through control endpoint uint16_t tud_hid_get_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t *buffer, uint16_t reqlen) { (void)itf; // only support Input Report @@ -234,11 +275,21 @@ uint16_t tud_hid_get_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t } // fill buffer with current report - memcpy(buffer, usb_hid_get_device_with_report_id(report_id)->in_report_buffer, reqlen); - return reqlen; + + usb_hid_device_obj_t *hid_device; + size_t id_idx; + // Find device with this report id, and get the report id index. + if (usb_hid_get_device_with_report_id(report_id, &hid_device, &id_idx)) { + // Make sure buffer exists before trying to copy into it. + if (hid_device->in_report_buffers[id_idx]) { + memcpy(buffer, hid_device->in_report_buffers[id_idx], reqlen); + return reqlen; + } + } + return 0; } -// Callbacks invoked when receive Set_Report request through control endpoint +// Callbacks invoked when we received Set_Report request through control endpoint void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t report_type, uint8_t const *buffer, uint16_t bufsize) { (void)itf; if (report_type == HID_REPORT_TYPE_INVALID) { @@ -249,9 +300,15 @@ void tud_hid_set_report_cb(uint8_t itf, uint8_t report_id, hid_report_type_t rep return; } - usb_hid_device_obj_t *hid_device = usb_hid_get_device_with_report_id(report_id); - - if (hid_device && hid_device->out_report_length >= bufsize) { - memcpy(hid_device->out_report_buffer, buffer, bufsize); + usb_hid_device_obj_t *hid_device; + size_t id_idx; + // Find device with this report id, and get the report id index. + if (usb_hid_get_device_with_report_id(report_id, &hid_device, &id_idx)) { + // If a report of the correct size has been read, save it in the proper OUT report buffer. + if (hid_device && + hid_device->out_report_buffers[id_idx] && + hid_device->out_report_lengths[id_idx] >= bufsize) { + memcpy(hid_device->out_report_buffers[id_idx], buffer, bufsize); + } } } diff --git a/shared-module/usb_hid/Device.h b/shared-module/usb_hid/Device.h index db3d8ecf65..5a09d19526 100644 --- a/shared-module/usb_hid/Device.h +++ b/shared-module/usb_hid/Device.h @@ -36,15 +36,15 @@ typedef struct { mp_obj_base_t base; // Python buffer object whose contents are the descriptor. const uint8_t *report_descriptor; - uint8_t *in_report_buffer; - uint8_t *out_report_buffer; - uint16_t report_id_index; + 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]; 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]; + uint8_t out_report_lengths[CIRCUITPY_USB_HID_MAX_REPORT_IDS_PER_DESCRIPTOR]; uint8_t usage_page; uint8_t usage; - uint8_t report_id; - uint8_t in_report_length; - uint8_t out_report_length; + uint8_t num_report_ids; } usb_hid_device_obj_t; extern const usb_hid_device_obj_t usb_hid_device_keyboard_obj; diff --git a/shared-module/usb_hid/__init__.c b/shared-module/usb_hid/__init__.c index 81a62c8eb3..efe37662ee 100644 --- a/shared-module/usb_hid/__init__.c +++ b/shared-module/usb_hid/__init__.c @@ -197,10 +197,6 @@ size_t usb_hid_report_descriptor_length(void) { total_hid_report_descriptor_length += hid_devices[i].report_descriptor_length; } - // Don't need space for a report id if there's only one device. - if (num_hid_devices == 1) { - total_hid_report_descriptor_length -= 2; - } return total_hid_report_descriptor_length; } @@ -215,24 +211,11 @@ void usb_hid_build_report_descriptor(uint8_t *report_descriptor_space, size_t re for (mp_int_t i = 0; i < num_hid_devices; i++) { usb_hid_device_obj_t *device = &hid_devices[i]; // Copy the report descriptor for this device. - if (num_hid_devices == 1) { - // There's only one device, so it shouldn't have a report ID. - // Copy the descriptor, but splice out the report id indicator and value (2 bytes). - memcpy(report_descriptor_start, device->report_descriptor, device->report_id_index - 1); - report_descriptor_start += device->report_id_index - 1; - memcpy(report_descriptor_start, device->report_descriptor + device->report_id_index + 1, - device->report_descriptor_length - device->report_id_index - 1); - } else { - // Copy the whole descriptor and fill in the report id. - memcpy(report_descriptor_start, device->report_descriptor, device->report_descriptor_length); - report_descriptor_start[device->report_id_index] = i + 1; + memcpy(report_descriptor_start, device->report_descriptor, device->report_descriptor_length); - // Remember the report id that was assigned. - device->report_id = i + 1; + // Advance to the next free chunk for the next report descriptor.x + report_descriptor_start += device->report_descriptor_length; - // Advance to the next free chunk for the next report descriptor.x - report_descriptor_start += device->report_descriptor_length; - } // Clear the heap pointer to the bytes of the descriptor. // We don't need it any more and it will get lost when the heap goes away. device->report_descriptor = NULL; @@ -260,24 +243,33 @@ void usb_hid_gc_collect(void) { gc_collect_ptr(hid_devices_tuple); // Mark possible heap pointers in the static device list as in use. - for (mp_int_t i = 0; i < num_hid_devices; i++) { + for (mp_int_t device_idx = 0; device_idx < num_hid_devices; device_idx++) { + // Cast away the const for .report_descriptor. It could be in flash or on the heap. // Constant report descriptors must be const so that they are used directly from flash // and not copied into RAM. - gc_collect_ptr((void *)hid_devices[i].report_descriptor); - gc_collect_ptr(hid_devices[i].in_report_buffer); - gc_collect_ptr(hid_devices[i].out_report_buffer); + gc_collect_ptr((void *)hid_devices[device_idx].report_descriptor); + + // Collect all the report buffers for this device. + for (size_t id_idx = 0; id_idx < hid_devices[device_idx].num_report_ids; id_idx++) { + gc_collect_ptr(hid_devices[device_idx].in_report_buffers[id_idx]); + gc_collect_ptr(hid_devices[device_idx].out_report_buffers[id_idx]); + } } } -usb_hid_device_obj_t *usb_hid_get_device_with_report_id(uint8_t report_id) { - for (uint8_t i = 0; i < num_hid_devices; i++) { - usb_hid_device_obj_t *device = &hid_devices[i]; - if (device->report_id == report_id) { - return &hid_devices[i]; +bool usb_hid_get_device_with_report_id(uint8_t report_id, usb_hid_device_obj_t **device_out, size_t *id_idx_out) { + for (uint8_t device_idx = 0; device_idx < num_hid_devices; device_idx++) { + usb_hid_device_obj_t *device = &hid_devices[device_idx]; + for (size_t id_idx = 0; id_idx < device->num_report_ids; id_idx++) { + if (device->report_ids[id_idx] == report_id) { + *device_out = device; + *id_idx_out = id_idx; + return true; + } } } - return NULL; + return false; } // Invoked when GET HID REPORT DESCRIPTOR is received. diff --git a/shared-module/usb_hid/__init__.h b/shared-module/usb_hid/__init__.h index 5069effd3d..6d85b50e9f 100644 --- a/shared-module/usb_hid/__init__.h +++ b/shared-module/usb_hid/__init__.h @@ -44,7 +44,7 @@ size_t usb_hid_report_descriptor_length(void); void usb_hid_build_report_descriptor(uint8_t *report_descriptor_space, size_t report_descriptor_length); void usb_hid_save_report_descriptor(uint8_t *report_descriptor_space, size_t report_descriptor_length); -usb_hid_device_obj_t *usb_hid_get_device_with_report_id(uint8_t report_id); +bool usb_hid_get_device_with_report_id(uint8_t report_id, usb_hid_device_obj_t **device_out, size_t *id_idx_out); void usb_hid_gc_collect(void); diff --git a/shared-module/vectorio/Circle.c b/shared-module/vectorio/Circle.c index 9c74580650..6b4c441620 100644 --- a/shared-module/vectorio/Circle.c +++ b/shared-module/vectorio/Circle.c @@ -59,3 +59,8 @@ void common_hal_vectorio_circle_set_radius(void *obj, int16_t radius) { self->on_dirty.event(self->on_dirty.obj); } } + +mp_obj_t common_hal_vectorio_circle_get_draw_protocol(void *circle) { + vectorio_circle_t *self = circle; + return self->draw_protocol_instance; +} diff --git a/shared-module/vectorio/Circle.h b/shared-module/vectorio/Circle.h index d6a77b1667..106bca6a71 100644 --- a/shared-module/vectorio/Circle.h +++ b/shared-module/vectorio/Circle.h @@ -11,6 +11,7 @@ typedef struct { mp_obj_base_t base; uint16_t radius; vectorio_event_t on_dirty; + mp_obj_t draw_protocol_instance; } vectorio_circle_t; #endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_CIRCLE_H diff --git a/shared-module/vectorio/Polygon.c b/shared-module/vectorio/Polygon.c index 00af1e0d7e..f0b241e351 100644 --- a/shared-module/vectorio/Polygon.c +++ b/shared-module/vectorio/Polygon.c @@ -1,4 +1,3 @@ - #include "shared-module/vectorio/__init__.h" #include "shared-bindings/vectorio/Polygon.h" #include "shared-module/displayio/area.h" @@ -11,7 +10,7 @@ #define VECTORIO_POLYGON_DEBUG(...) (void)0 -// #define VECTORIO_POLYGON_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) +// #define VECTORIO_POLYGON_DEBUG(...) mp_printf(&mp_plat_print, __VA_ARGS__) // Converts a list of points tuples to a flat list of ints for speedier internal use. @@ -23,7 +22,7 @@ static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple VECTORIO_POLYGON_DEBUG(" self.len: %d, len: %d, ", self->len, len); if (len < 3) { - mp_raise_TypeError_varg(translate("Polygon needs at least 3 points")); + mp_raise_TypeError(translate("Polygon needs at least 3 points")); } if (self->len < 2 * len) { @@ -31,12 +30,12 @@ static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple VECTORIO_POLYGON_DEBUG("free(%d), ", sizeof(self->points_list)); gc_free(self->points_list); } - self->points_list = gc_alloc(2 * len * sizeof(int), false, false); - VECTORIO_POLYGON_DEBUG("alloc(%p, %d)", self->points_list, 2 * len * sizeof(int)); + self->points_list = gc_alloc(2 * len * sizeof(uint16_t), false, false); + VECTORIO_POLYGON_DEBUG("alloc(%p, %d)", self->points_list, 2 * len * sizeof(uint16_t)); } self->len = 2 * len; - for (size_t i = 0; i < len; ++i) { + for (uint16_t i = 0; i < len; ++i) { size_t tuple_len = 0; mp_obj_t *tuple_items; mp_obj_tuple_get(items[i], &tuple_len, &tuple_items); @@ -44,14 +43,19 @@ static void _clobber_points_list(vectorio_polygon_t *self, mp_obj_t points_tuple if (tuple_len != 2) { mp_raise_ValueError_varg(translate("%q must be a tuple of length 2"), MP_QSTR_point); } - if (!mp_obj_get_int_maybe(tuple_items[ 0 ], &self->points_list[2 * i ]) - || !mp_obj_get_int_maybe(tuple_items[ 1 ], &self->points_list[2 * i + 1]) + mp_int_t x; + mp_int_t y; + if (!mp_obj_get_int_maybe(tuple_items[ 0 ], &x) + || !mp_obj_get_int_maybe(tuple_items[ 1 ], &y) + || x < SHRT_MIN || x > SHRT_MAX || y < SHRT_MIN || y > SHRT_MAX ) { - self->len = 0; gc_free(self->points_list); self->points_list = NULL; mp_raise_ValueError_varg(translate("unsupported %q type"), MP_QSTR_point); + self->len = 0; } + self->points_list[2 * i ] = (int16_t)x; + self->points_list[2 * i + 1] = (int16_t)y; } } @@ -69,16 +73,23 @@ void common_hal_vectorio_polygon_construct(vectorio_polygon_t *self, mp_obj_t po mp_obj_t common_hal_vectorio_polygon_get_points(vectorio_polygon_t *self) { VECTORIO_POLYGON_DEBUG("%p common_hal_vectorio_polygon_get_points {len: %d, points_list: %p}\n", self, self->len, self->points_list); - mp_obj_t list = mp_obj_new_list(self->len / 2, NULL); + mp_obj_list_t *list = MP_OBJ_TO_PTR(mp_obj_new_list(0, NULL)); + + VECTORIO_POLYGON_DEBUG(" >points\n"); + for (uint16_t i = 0; i < self->len; i += 2) { + VECTORIO_POLYGON_DEBUG(" (%4d, %4d)\n", self->points_list[i], self->points_list[i + 1]); + + mp_obj_tuple_t *pair = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL)); + pair->items[0] = mp_obj_new_int((mp_int_t)self->points_list[i ]); + pair->items[1] = mp_obj_new_int((mp_int_t)self->points_list[i + 1]); - for (size_t i = 0; i < self->len; i += 2) { - mp_obj_t tuple[] = { mp_obj_new_int(self->points_list[i]), mp_obj_new_int(self->points_list[i + 1]) }; mp_obj_list_append( list, - mp_obj_new_tuple(2, tuple) + pair ); } - return list; + VECTORIO_POLYGON_DEBUG(" x1 = SHRT_MAX; area->y1 = SHRT_MAX; area->x2 = SHRT_MIN; area->y2 = SHRT_MIN; - for (size_t i = 0; i < self->len; ++i) { - int x = self->points_list[i]; + for (uint16_t i = 0; i < self->len; ++i) { + int16_t x = self->points_list[i]; ++i; - int y = self->points_list[i]; - if (x <= area->x1) { - area->x1 = x - 1; + int16_t y = self->points_list[i]; + if (x < area->x1) { + VECTORIO_POLYGON_DEBUG(" x1: %d\n", x); + area->x1 = x; } - if (y <= area->y1) { - area->y1 = y - 1; + if (y < area->y1) { + VECTORIO_POLYGON_DEBUG(" y1: %d\n", y); + area->y1 = y; } - if (x >= area->x2) { - area->x2 = x + 1; + if (x > area->x2) { + VECTORIO_POLYGON_DEBUG(" x2: %d\n", x); + area->x2 = x; } - if (y >= area->y2) { - area->y2 = y + 1; + if (y > area->y2) { + VECTORIO_POLYGON_DEBUG(" y2: %d\n", y); + area->y2 = y; } } } @@ -127,7 +143,7 @@ void common_hal_vectorio_polygon_get_area(void *polygon, displayio_area_t *area) // <0 if the point is to the left of the line vector // 0 if the point is on the line // >0 if the point is to the right of the line vector -__attribute__((always_inline)) static inline int line_side(mp_int_t x1, mp_int_t y1, mp_int_t x2, mp_int_t y2, int16_t px, int16_t py) { +__attribute__((always_inline)) static inline int line_side(int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t px, int16_t py) { return (px - x1) * (y2 - y1) - (py - y1) * (x2 - x1); } @@ -141,14 +157,14 @@ uint32_t common_hal_vectorio_polygon_get_pixel(void *obj, int16_t x, int16_t y) return 0; } - int winding_number = 0; - int x1 = self->points_list[0]; - int y1 = self->points_list[1]; - for (size_t i = 2; i <= self->len + 1; ++i) { + int16_t winding_number = 0; + int16_t x1 = self->points_list[0]; + int16_t y1 = self->points_list[1]; + for (uint16_t i = 2; i <= self->len + 1; ++i) { VECTORIO_POLYGON_DEBUG(" {(%3d, %3d),", x1, y1); - int x2 = self->points_list[i % self->len]; + int16_t x2 = self->points_list[i % self->len]; ++i; - int y2 = self->points_list[i % self->len]; + int16_t y2 = self->points_list[i % self->len]; VECTORIO_POLYGON_DEBUG(" (%3d, %3d)}\n", x2, y2); if (y1 <= y) { if (y2 > y && line_side(x1, y1, x2, y2, x, y) < 0) { @@ -167,3 +183,8 @@ uint32_t common_hal_vectorio_polygon_get_pixel(void *obj, int16_t x, int16_t y) } return winding_number == 0 ? 0 : 1; } + +mp_obj_t common_hal_vectorio_polygon_get_draw_protocol(void *polygon) { + vectorio_polygon_t *self = polygon; + return self->draw_protocol_instance; +} diff --git a/shared-module/vectorio/Polygon.h b/shared-module/vectorio/Polygon.h index 70de9036d7..e1d94f9f97 100644 --- a/shared-module/vectorio/Polygon.h +++ b/shared-module/vectorio/Polygon.h @@ -9,9 +9,10 @@ typedef struct { mp_obj_base_t base; // An int array[ x, y, ... ] - int *points_list; - size_t len; + int16_t *points_list; + uint16_t len; vectorio_event_t on_dirty; + mp_obj_t draw_protocol_instance; } vectorio_polygon_t; #endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_POLYGON_H diff --git a/shared-module/vectorio/Rectangle.c b/shared-module/vectorio/Rectangle.c index 56be5ebb5e..2471daa608 100644 --- a/shared-module/vectorio/Rectangle.c +++ b/shared-module/vectorio/Rectangle.c @@ -12,10 +12,10 @@ void common_hal_vectorio_rectangle_construct(vectorio_rectangle_t *self, uint32_ uint32_t common_hal_vectorio_rectangle_get_pixel(void *obj, int16_t x, int16_t y) { vectorio_rectangle_t *self = obj; - if (x < 0 || x >= self->width || y >= self->height || y < 0) { - return 0; + if (x >= 0 && y >= 0 && x < self->width && y < self->height) { + return 1; } - return 1; + return 0; } @@ -32,3 +32,8 @@ uint32_t common_hal_vectorio_rectangle_get_height(void *rectangle) { vectorio_rectangle_t *self = rectangle; return self->height; } + +mp_obj_t common_hal_vectorio_rectangle_get_draw_protocol(void *rectangle) { + vectorio_rectangle_t *self = rectangle; + return self->draw_protocol_instance; +} diff --git a/shared-module/vectorio/Rectangle.h b/shared-module/vectorio/Rectangle.h index 56342a6d76..e3cfbb2676 100644 --- a/shared-module/vectorio/Rectangle.h +++ b/shared-module/vectorio/Rectangle.h @@ -9,6 +9,7 @@ typedef struct { mp_obj_base_t base; uint16_t width; uint16_t height; + mp_obj_t draw_protocol_instance; } vectorio_rectangle_t; #endif // MICROPY_INCLUDED_SHARED_MODULE_VECTORIO_RECTANGLE_H diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c index f0b6a725c1..7899e2710c 100644 --- a/shared-module/vectorio/VectorShape.c +++ b/shared-module/vectorio/VectorShape.c @@ -15,16 +15,51 @@ // Lifecycle actions. #define VECTORIO_SHAPE_DEBUG(...) (void)0 -// #define VECTORIO_SHAPE_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) +// #define VECTORIO_SHAPE_DEBUG(...) mp_printf(&mp_plat_print, __VA_ARGS__) // Used in both logging and ifdefs, for extra variables -// #define VECTORIO_PERF(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) +// #define VECTORIO_PERF(...) mp_printf(&mp_plat_print, __VA_ARGS__) // Really verbose. #define VECTORIO_SHAPE_PIXEL_DEBUG(...) (void)0 -// #define VECTORIO_SHAPE_PIXEL_DEBUG(...) mp_printf(&mp_plat_print __VA_OPT__(,) __VA_ARGS__) +// #define VECTORIO_SHAPE_PIXEL_DEBUG(...) mp_printf(&mp_plat_print, __VA_ARGS__) + +#define U32_TO_BINARY_FMT "%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c%c" +#define U32_TO_BINARY(u32) \ + (u32 & 0x80000000 ? '1' : '0'), \ + (u32 & 0x40000000 ? '1' : '0'), \ + (u32 & 0x20000000 ? '1' : '0'), \ + (u32 & 0x10000000 ? '1' : '0'), \ + (u32 & 0x8000000 ? '1' : '0'), \ + (u32 & 0x4000000 ? '1' : '0'), \ + (u32 & 0x2000000 ? '1' : '0'), \ + (u32 & 0x1000000 ? '1' : '0'), \ + (u32 & 0x800000 ? '1' : '0'), \ + (u32 & 0x400000 ? '1' : '0'), \ + (u32 & 0x200000 ? '1' : '0'), \ + (u32 & 0x100000 ? '1' : '0'), \ + (u32 & 0x80000 ? '1' : '0'), \ + (u32 & 0x40000 ? '1' : '0'), \ + (u32 & 0x20000 ? '1' : '0'), \ + (u32 & 0x10000 ? '1' : '0'), \ + (u32 & 0x8000 ? '1' : '0'), \ + (u32 & 0x4000 ? '1' : '0'), \ + (u32 & 0x2000 ? '1' : '0'), \ + (u32 & 0x1000 ? '1' : '0'), \ + (u32 & 0x800 ? '1' : '0'), \ + (u32 & 0x400 ? '1' : '0'), \ + (u32 & 0x200 ? '1' : '0'), \ + (u32 & 0x100 ? '1' : '0'), \ + (u32 & 0x80 ? '1' : '0'), \ + (u32 & 0x40 ? '1' : '0'), \ + (u32 & 0x20 ? '1' : '0'), \ + (u32 & 0x10 ? '1' : '0'), \ + (u32 & 0x8 ? '1' : '0'), \ + (u32 & 0x4 ? '1' : '0'), \ + (u32 & 0x2 ? '1' : '0'), \ + (u32 & 0x1 ? '1' : '0') inline __attribute__((always_inline)) @@ -32,70 +67,132 @@ static int32_t max(int32_t a, int32_t b) { return a > b ? a : b; } +inline __attribute__((always_inline)) +static uint32_t min(uint32_t a, uint32_t b) { + return a < b ? a : b; +} + +inline __attribute__((always_inline)) +static void area_transpose(displayio_area_t *to_transpose) { + int16_t swap = to_transpose->y1; + to_transpose->y1 = to_transpose->x1; + to_transpose->x1 = swap; + swap = to_transpose->y2; + to_transpose->y2 = to_transpose->x2; + to_transpose->x2 = swap; +} inline __attribute__((always_inline)) static void _get_screen_area(vectorio_vector_shape_t *self, displayio_area_t *out_area) { - VECTORIO_SHAPE_DEBUG("%p get_screen_area tform:{x:%d y:%d dx:%d dy:%d scl:%d w:%d h:%d mx:%d my:%d tr:%d}", self, + VECTORIO_SHAPE_DEBUG("%p get_screen_area (%3d,%3d) tform:{x:%d y:%d dx:%d dy:%d scl:%d w:%d h:%d mx:%d my:%d tr:%d}", self, self->x, self->y, self->absolute_transform->x, self->absolute_transform->y, self->absolute_transform->dx, self->absolute_transform->dy, self->absolute_transform->scale, self->absolute_transform->width, self->absolute_transform->height, self->absolute_transform->mirror_x, self->absolute_transform->mirror_y, self->absolute_transform->transpose_xy ); self->ishape.get_area(self->ishape.shape, out_area); VECTORIO_SHAPE_DEBUG(" in:{(%5d,%5d), (%5d,%5d)}", out_area->x1, out_area->y1, out_area->x2, out_area->y2); + + int16_t x; + int16_t y; if (self->absolute_transform->transpose_xy) { - int16_t swap = out_area->x1; - out_area->x1 = (out_area->y1 + self->y) * self->absolute_transform->dx + self->absolute_transform->x; - out_area->y1 = (swap + self->x) * self->absolute_transform->dy + self->absolute_transform->y; - swap = out_area->x2; - out_area->x2 = (out_area->y2 + self->y) * self->absolute_transform->dx + self->absolute_transform->x; - out_area->y2 = (swap + self->x) * self->absolute_transform->dy + self->absolute_transform->y; + x = self->absolute_transform->x + self->absolute_transform->dx * self->y; + y = self->absolute_transform->y + self->absolute_transform->dy * self->x; + if (self->absolute_transform->dx < 1) { + out_area->y1 = out_area->y1 * -1 + 1; + out_area->y2 = out_area->y2 * -1 + 1; + } + if (self->absolute_transform->dy < 1) { + out_area->x1 = out_area->x1 * -1 + 1; + out_area->x2 = out_area->x2 * -1 + 1; + } + area_transpose(out_area); } else { - out_area->x1 = (out_area->x1 + self->x) * self->absolute_transform->dx + self->absolute_transform->x; - out_area->y1 = (out_area->y1 + self->y) * self->absolute_transform->dy + self->absolute_transform->y; - out_area->x2 = (out_area->x2 + self->x) * self->absolute_transform->dx + self->absolute_transform->x; - out_area->y2 = (out_area->y2 + self->y) * self->absolute_transform->dy + self->absolute_transform->y; + x = self->absolute_transform->x + self->absolute_transform->dx * self->x; + y = self->absolute_transform->y + self->absolute_transform->dy * self->y; + + if (self->absolute_transform->dx < 1) { + out_area->x1 = out_area->x1 * -1 + 1; + out_area->x2 = out_area->x2 * -1 + 1; + } + if (self->absolute_transform->dy < 1) { + out_area->y1 = out_area->y1 * -1 + 1; + out_area->y2 = out_area->y2 * -1 + 1; + } } - // We might have mirrored due to dx displayio_area_canon(out_area); + displayio_area_shift(out_area, x, y); + VECTORIO_SHAPE_DEBUG(" out:{(%5d,%5d), (%5d,%5d)}\n", out_area->x1, out_area->y1, out_area->x2, out_area->y2); } +STATIC +void check_bounds_and_set_x(vectorio_vector_shape_t *self, mp_int_t x) { + if (x < SHRT_MIN || x > SHRT_MAX) { + mp_raise_ValueError_varg(translate("%q must be between %d and %d"), MP_QSTR_x, SHRT_MIN, SHRT_MAX); + } + self->x = x; +} + + +STATIC +void check_bounds_and_set_y(vectorio_vector_shape_t *self, mp_int_t y) { + if (y < SHRT_MIN || y > SHRT_MAX) { + mp_raise_ValueError_varg(translate("%q must be between %d and %d"), MP_QSTR_y, SHRT_MIN, SHRT_MAX); + } + self->y = y; +} + + // For use by Group to know where it needs to redraw on layer removal. bool vectorio_vector_shape_get_dirty_area(vectorio_vector_shape_t *self, displayio_area_t *out_area) { - displayio_area_copy(&self->ephemeral_dirty_area, out_area); + out_area->x1 = out_area->x2; + displayio_area_union( + &self->ephemeral_dirty_area, + &self->current_area, + out_area + ); return true; // For now just always redraw. } -// This must be invoked each time a shape changes its position or its shape in any way. +// This must be invoked after each time a shape changes its position, shape or appearance in any way. void common_hal_vectorio_vector_shape_set_dirty(void *vector_shape) { vectorio_vector_shape_t *self = vector_shape; // In screen space. Need to offset the shape space. displayio_area_t current_area; _get_screen_area(self, ¤t_area); - VECTORIO_SHAPE_DEBUG("%p shape_dirty current:{(%3d,%3d), (%3d,%3d)} dirty:{(%3d,%3d), (%3d,%3d)}", + VECTORIO_SHAPE_DEBUG("%p shape_dirty new:{(%3d,%3d), (%3d,%3d)} dirty:{(%3d,%3d), (%3d,%3d)}", self, current_area.x1, current_area.y1, current_area.x2, current_area.y2, self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); - self->dirty = true; - // Dirty area tracks the shape's footprint between draws. It's reset on refresh finish, - displayio_area_union(&self->ephemeral_dirty_area, ¤t_area, &self->ephemeral_dirty_area); - VECTORIO_SHAPE_DEBUG(" -> expanded:{(%3d,%3d), (%3d,%3d)}\n", self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); + + bool moved = !displayio_area_equal(¤t_area, &self->current_area); + if (moved) { + displayio_area_union(&self->current_area, &self->ephemeral_dirty_area, &self->ephemeral_dirty_area); + VECTORIO_SHAPE_DEBUG(" stale:{(%3d,%3d), (%3d,%3d)} -> expanded:{(%3d,%3d), (%3d,%3d)}\n", + self->current_area.x1, self->current_area.y1, self->current_area.x2, self->current_area.y2, + self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); + + // Dirty area tracks the shape's footprint between draws. It's reset on refresh finish. + displayio_area_copy(¤t_area, &self->current_area); + } + self->current_area_dirty = true; } void common_hal_vectorio_vector_shape_construct(vectorio_vector_shape_t *self, vectorio_ishape_t ishape, - mp_obj_t pixel_shader, uint16_t x, uint16_t y) { + mp_obj_t pixel_shader, int32_t x, int32_t y) { VECTORIO_SHAPE_DEBUG("%p vector_shape_construct x:%3d, y:%3d\n", self, x, y); - self->x = x; - self->y = y; + check_bounds_and_set_x(self, x); + check_bounds_and_set_y(self, y); self->pixel_shader = pixel_shader; self->ishape = ishape; - self->dirty = true; self->absolute_transform = &null_transform; // Critical to have a valid transform before getting screen area. - _get_screen_area(self, &self->ephemeral_dirty_area); + self->ephemeral_dirty_area.x1 = self->ephemeral_dirty_area.x2; // Cheat to set area to 0 self->ephemeral_dirty_area.next = NULL; + self->current_area_dirty = true; + _get_screen_area(self, &self->current_area); } @@ -110,7 +207,7 @@ void common_hal_vectorio_vector_shape_set_x(vectorio_vector_shape_t *self, mp_in if (self->x == x) { return; } - self->x = x; + check_bounds_and_set_x(self, x); common_hal_vectorio_vector_shape_set_dirty(self); } @@ -126,10 +223,48 @@ void common_hal_vectorio_vector_shape_set_y(vectorio_vector_shape_t *self, mp_in if (self->y == y) { return; } - self->y = y; + check_bounds_and_set_y(self, y); common_hal_vectorio_vector_shape_set_dirty(self); } +mp_obj_tuple_t *common_hal_vectorio_vector_shape_get_location(vectorio_vector_shape_t *self) { + VECTORIO_SHAPE_DEBUG("%p get_location\n", self); + mp_obj_tuple_t *pair = MP_OBJ_TO_PTR(mp_obj_new_tuple(2, NULL)); + pair->items[0] = mp_obj_new_int((mp_int_t)self->x); + pair->items[1] = mp_obj_new_int((mp_int_t)self->y); + return pair; +} + + +void common_hal_vectorio_vector_shape_set_location(vectorio_vector_shape_t *self, mp_obj_t xy) { + VECTORIO_SHAPE_DEBUG("%p set_location\n", 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_int_t x; + mp_int_t y; + if (!mp_obj_get_int_maybe(tuple_items[ 0 ], &x) + || !mp_obj_get_int_maybe(tuple_items[ 1 ], &y)) { + mp_raise_ValueError_varg(translate("unsupported %q type"), MP_QSTR_point); + } + bool dirty = false; + if (self->x != x) { + check_bounds_and_set_x(self, x); + dirty = true; + } + if (self->y != y) { + check_bounds_and_set_y(self, y); + dirty = true; + } + if (dirty) { + common_hal_vectorio_vector_shape_set_dirty(self); + } +} + mp_obj_t common_hal_vectorio_vector_shape_get_pixel_shader(vectorio_vector_shape_t *self) { VECTORIO_SHAPE_DEBUG("%p get_pixel_shader\n", self); @@ -153,13 +288,12 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ uint64_t start = common_hal_time_monotonic_ns(); uint64_t pixel_time = 0; #endif - displayio_area_t overlap; - VECTORIO_SHAPE_DEBUG("%p fill_area dirty:%d fill: {(%5d,%5d), (%5d,%5d)} dirty: {(%5d,%5d), (%5d,%5d)}", - self, self->dirty, - area->x1, area->y1, area->x2, area->y2, - self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2 + VECTORIO_SHAPE_DEBUG("%p fill_area: fill: {(%5d,%5d), (%5d,%5d)}", + self, + area->x1, area->y1, area->x2, area->y2 ); - if (!displayio_area_compute_overlap(area, &self->ephemeral_dirty_area, &overlap)) { + displayio_area_t overlap; + if (!displayio_area_compute_overlap(area, &self->current_area, &overlap)) { VECTORIO_SHAPE_DEBUG(" no overlap\n"); return false; } @@ -168,27 +302,35 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ bool full_coverage = displayio_area_equal(area, &overlap); uint8_t pixels_per_byte = 8 / colorspace->depth; + VECTORIO_SHAPE_DEBUG(" xy:(%3d %3d) tform:{x:%d y:%d dx:%d dy:%d scl:%d w:%d h:%d mx:%d my:%d tr:%d}", + self->x, self->y, + self->absolute_transform->x, self->absolute_transform->y, self->absolute_transform->dx, self->absolute_transform->dy, self->absolute_transform->scale, + self->absolute_transform->width, self->absolute_transform->height, self->absolute_transform->mirror_x, self->absolute_transform->mirror_y, self->absolute_transform->transpose_xy + ); - uint32_t linestride_px = displayio_area_width(area); - uint32_t line_dirty_offset_px = (overlap.y1 - area->y1) * linestride_px; - uint32_t column_dirty_offset_px = overlap.x1 - area->x1; + uint16_t linestride_px = displayio_area_width(area); + uint16_t line_dirty_offset_px = (overlap.y1 - area->y1) * linestride_px; + uint16_t column_dirty_offset_px = overlap.x1 - area->x1; VECTORIO_SHAPE_DEBUG(", linestride:%3d line_offset:%3d col_offset:%3d depth:%2d ppb:%2d shape:%s", linestride_px, line_dirty_offset_px, column_dirty_offset_px, colorspace->depth, pixels_per_byte, mp_obj_get_type_str(self->ishape.shape)); displayio_input_pixel_t input_pixel; displayio_output_pixel_t output_pixel; - uint32_t mask_start_px = line_dirty_offset_px; + displayio_area_t shape_area; + self->ishape.get_area(self->ishape.shape, &shape_area); + + uint16_t mask_start_px = line_dirty_offset_px; for (input_pixel.y = overlap.y1; input_pixel.y < overlap.y2; ++input_pixel.y) { mask_start_px += column_dirty_offset_px; for (input_pixel.x = overlap.x1; input_pixel.x < overlap.x2; ++input_pixel.x) { // Check the mask first to see if the pixel has already been set. - uint32_t pixel_index = mask_start_px + (input_pixel.x - overlap.x1); + uint16_t pixel_index = mask_start_px + (input_pixel.x - overlap.x1); uint32_t *mask_doubleword = &(mask[pixel_index / 32]); uint8_t mask_bit = pixel_index % 32; - VECTORIO_SHAPE_PIXEL_DEBUG("%p pixel_index: %5u mask_bit: %2u", self, pixel_index, mask_bit); + VECTORIO_SHAPE_PIXEL_DEBUG("\n%p pixel_index: %5u mask_bit: %2u mask: "U32_TO_BINARY_FMT, self, pixel_index, mask_bit, U32_TO_BINARY(*mask_doubleword)); if ((*mask_doubleword & (1u << mask_bit)) != 0) { - VECTORIO_SHAPE_PIXEL_DEBUG(" masked\n"); + VECTORIO_SHAPE_PIXEL_DEBUG(" masked"); continue; } output_pixel.pixel = 0; @@ -197,12 +339,39 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ int16_t pixel_to_get_x; int16_t pixel_to_get_y; if (self->absolute_transform->transpose_xy) { - pixel_to_get_x = (input_pixel.y - self->absolute_transform->dy * self->x - self->absolute_transform->y) / self->absolute_transform->dy; - pixel_to_get_y = (input_pixel.x - self->absolute_transform->dx * self->y - self->absolute_transform->x) / self->absolute_transform->dx; + pixel_to_get_x = input_pixel.y - self->absolute_transform->y - self->absolute_transform->dy * self->x; + pixel_to_get_y = input_pixel.x - self->absolute_transform->x - self->absolute_transform->dx * self->y; + + VECTORIO_SHAPE_PIXEL_DEBUG(" a(%3d, %3d)", pixel_to_get_x, pixel_to_get_y); + if (self->absolute_transform->dx < 1) { + pixel_to_get_y *= -1; + } + if (self->absolute_transform->dy < 1) { + pixel_to_get_x *= -1; + } + VECTORIO_SHAPE_PIXEL_DEBUG(" b(%3d, %3d)", pixel_to_get_x, pixel_to_get_y); } else { - pixel_to_get_x = (input_pixel.x - self->absolute_transform->dx * self->x - self->absolute_transform->x) / self->absolute_transform->dx; - pixel_to_get_y = (input_pixel.y - self->absolute_transform->dy * self->y - self->absolute_transform->y) / self->absolute_transform->dy; + pixel_to_get_x = input_pixel.x - self->absolute_transform->x - self->absolute_transform->dx * self->x; + pixel_to_get_y = input_pixel.y - self->absolute_transform->y - self->absolute_transform->dy * self->y; + + VECTORIO_SHAPE_PIXEL_DEBUG(" a(%3d, %3d)", pixel_to_get_x, pixel_to_get_y); + if (self->absolute_transform->dx < 1) { + pixel_to_get_x *= -1; + } + if (self->absolute_transform->dy < 1) { + pixel_to_get_y *= -1; + } + VECTORIO_SHAPE_PIXEL_DEBUG(" b(%3d, %3d)", pixel_to_get_x, pixel_to_get_y); + + // It's mirrored via dx. Maybe we need to add support for also separately mirroring? + // if (self->absolute_transform->mirror_x) { + // pixel_to_get_x = (shape_area.x2 - shape_area.x1) - (pixel_to_get_x - shape_area.x1) + shape_area.x1 - 1; + // } + // if (self->absolute_transform->mirror_y) { + // pixel_to_get_y = (shape_area.y2 - shape_area.y1) - (pixel_to_get_y - shape_area.y1) + +shape_area.y1 - 1; + // } } + VECTORIO_SHAPE_PIXEL_DEBUG(" get_pixel %p (%3d, %3d) -> ( %3d, %3d )", self->ishape.shape, input_pixel.x, input_pixel.y, pixel_to_get_x, pixel_to_get_y); #ifdef VECTORIO_PERF uint64_t pre_pixel = common_hal_time_monotonic_ns(); @@ -214,39 +383,50 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ #endif VECTORIO_SHAPE_PIXEL_DEBUG(" -> %d", input_pixel.pixel); - output_pixel.opaque = true; - if (self->pixel_shader == mp_const_none) { - output_pixel.pixel = input_pixel.pixel; - } else if (mp_obj_is_type(self->pixel_shader, &displayio_palette_type)) { - output_pixel.opaque = displayio_palette_get_color(self->pixel_shader, colorspace, input_pixel.pixel, &output_pixel.pixel); - } else if (mp_obj_is_type(self->pixel_shader, &displayio_colorconverter_type)) { - displayio_colorconverter_convert(self->pixel_shader, colorspace, &input_pixel, &output_pixel); - } - if (!output_pixel.opaque) { - VECTORIO_SHAPE_PIXEL_DEBUG(" (encountered transparent pixel; input area is not fully covered)\n"); + // vectorio shapes use 0 to mean "area is not covered." + // We can skip all the rest of the work for this pixel if it's not currently covered by the shape. + if (input_pixel.pixel == 0) { + VECTORIO_SHAPE_PIXEL_DEBUG(" (encountered transparent pixel; input area is not fully covered)"); full_coverage = false; } else { + // Pixel is not transparent. Let's pull the pixel value index down to 0-base for more error-resistant palettes. + input_pixel.pixel -= 1; + output_pixel.opaque = true; + + if (self->pixel_shader == mp_const_none) { + output_pixel.pixel = input_pixel.pixel; + } else if (mp_obj_is_type(self->pixel_shader, &displayio_palette_type)) { + output_pixel.opaque = displayio_palette_get_color(self->pixel_shader, colorspace, input_pixel.pixel, &output_pixel.pixel); + } else if (mp_obj_is_type(self->pixel_shader, &displayio_colorconverter_type)) { + displayio_colorconverter_convert(self->pixel_shader, colorspace, &input_pixel, &output_pixel); + } + + // We double-check this to fast-path the case when a pixel is not covered by the shape & not call the color converter unnecessarily. + if (!output_pixel.opaque) { + VECTORIO_SHAPE_PIXEL_DEBUG(" (encountered transparent pixel from colorconverter; input area is not fully covered)"); + full_coverage = false; + } + *mask_doubleword |= 1u << mask_bit; if (colorspace->depth == 16) { - VECTORIO_SHAPE_PIXEL_DEBUG(" buffer = %04x 16\n", output_pixel.pixel); + VECTORIO_SHAPE_PIXEL_DEBUG(" buffer = %04x 16", output_pixel.pixel); *(((uint16_t *)buffer) + pixel_index) = output_pixel.pixel; } else if (colorspace->depth == 8) { - VECTORIO_SHAPE_PIXEL_DEBUG(" buffer = %02x 8\n", output_pixel.pixel); + VECTORIO_SHAPE_PIXEL_DEBUG(" buffer = %02x 8", output_pixel.pixel); *(((uint8_t *)buffer) + pixel_index) = output_pixel.pixel; } else if (colorspace->depth < 8) { // Reorder the offsets to pack multiple rows into a byte (meaning they share a column). if (!colorspace->pixels_in_byte_share_row) { - uint16_t width = linestride_px; - uint16_t row = pixel_index / width; - uint16_t col = pixel_index % width; - pixel_index = col * pixels_per_byte + (row / pixels_per_byte) * pixels_per_byte * width + row % pixels_per_byte; + uint16_t row = pixel_index / linestride_px; + uint16_t col = pixel_index % linestride_px; + pixel_index = col * pixels_per_byte + (row / pixels_per_byte) * pixels_per_byte * linestride_px + row % pixels_per_byte; } uint8_t shift = (pixel_index % pixels_per_byte) * colorspace->depth; if (colorspace->reverse_pixels_in_byte) { // Reverse the shift by subtracting it from the leftmost shift. shift = (pixels_per_byte - 1) * colorspace->depth - shift; } - VECTORIO_SHAPE_PIXEL_DEBUG(" buffer = %2d %d\n", output_pixel.pixel, colorspace->depth); + VECTORIO_SHAPE_PIXEL_DEBUG(" buffer = %2d %d", output_pixel.pixel, colorspace->depth); ((uint8_t *)buffer)[pixel_index / pixels_per_byte] |= output_pixel.pixel << shift; } } @@ -265,20 +445,23 @@ bool vectorio_vector_shape_fill_area(vectorio_vector_shape_t *self, const _displ (double)(pixel_time / 1000.0 / pixels) ); #endif - VECTORIO_SHAPE_DEBUG(" -> pixels:%4d\n"); + VECTORIO_SHAPE_DEBUG(" -> pixels:%4d\n", (overlap.x2 - overlap.x1) * (overlap.y2 - overlap.y1)); return full_coverage; } void vectorio_vector_shape_finish_refresh(vectorio_vector_shape_t *self) { - if (!self->dirty) { + if (displayio_area_empty(&self->ephemeral_dirty_area) && !self->current_area_dirty) { return; } VECTORIO_SHAPE_DEBUG("%p finish_refresh was:{(%3d,%3d), (%3d,%3d)}\n", self, self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); - self->dirty = false; - // Reset dirty area tracking to current footprint - _get_screen_area(self, &self->ephemeral_dirty_area); + // Reset dirty area to nothing + self->ephemeral_dirty_area.x1 = self->ephemeral_dirty_area.x2; // Cheat to set area to empty self->ephemeral_dirty_area.next = NULL; + + self->current_area_dirty = false; // We don't clear current area so we can remember what to clean up if we move + self->current_area.next = NULL; + VECTORIO_SHAPE_DEBUG("%p finish_refresh now:{(%3d,%3d), (%3d,%3d)}\n", self, self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); if (mp_obj_is_type(self->pixel_shader, &displayio_palette_type)) { @@ -291,16 +474,55 @@ void vectorio_vector_shape_finish_refresh(vectorio_vector_shape_t *self) { // Assembles a singly linked list of dirty areas from all components on the display. displayio_area_t *vectorio_vector_shape_get_refresh_areas(vectorio_vector_shape_t *self, displayio_area_t *tail) { - if (self->dirty + if (self->current_area_dirty || (mp_obj_is_type(self->pixel_shader, &displayio_palette_type) && displayio_palette_needs_refresh(self->pixel_shader)) || (mp_obj_is_type(self->pixel_shader, &displayio_colorconverter_type) && displayio_colorconverter_needs_refresh(self->pixel_shader)) ) { - VECTORIO_SHAPE_DEBUG("%p get_refresh_area dirty:%d {(%3d,%3d), (%3d,%3d)}", self, self->dirty, self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); - common_hal_vectorio_vector_shape_set_dirty(self); - // vector.add_to_head + if (!displayio_area_empty(&self->ephemeral_dirty_area)) { + // Both are dirty, check if we should combine the areas or draw separately + // Draws as few pixels as possible both when animations move short distances and large distances. + // The display core implementation currently doesn't combine areas to reduce redrawing of masked areas. If it does, + // this could be simplified to just return the 2 possibly overlapping areas. + displayio_area_t area_swap; + displayio_area_compute_overlap(&self->ephemeral_dirty_area, &self->current_area, &area_swap); + uint32_t overlap_size = displayio_area_size(&area_swap); + displayio_area_union(&self->ephemeral_dirty_area, &self->current_area, &area_swap); // Leave area_swap as the union area for later. + uint32_t union_size = displayio_area_size(&area_swap); + uint32_t current_size = displayio_area_size(&self->current_area); + uint32_t dirty_size = displayio_area_size(&self->ephemeral_dirty_area); + + VECTORIO_SHAPE_DEBUG("%p get_refresh_area: dirty{(%3d,%3d), (%3d,%3d)} + current{(%3d,%3d), (%3d,%3d)} = union{(%3d,%3d), (%3d,%3d)}: union%d - dirty%d - curr%d + overlap%d = excluded%d : ", self, + self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2, + self->current_area.x1, self->current_area.y1, self->current_area.x2, self->current_area.y2, + area_swap.x1, area_swap.y1, area_swap.x2, area_swap.y2, + union_size, dirty_size, current_size, overlap_size, (int32_t)union_size - dirty_size - current_size + overlap_size + ); + + if ((int32_t)union_size - dirty_size - current_size + overlap_size <= min(dirty_size, current_size)) { + // The excluded / non-overlapping area from the disjoint dirty and current areas is smaller + // than the smallest area we need to draw. Redrawing the overlapping area would cost more + // than just drawing the union disjoint area once. + VECTORIO_SHAPE_DEBUG("combining to take disjoint area\n"); + displayio_area_copy(&area_swap, &self->ephemeral_dirty_area); + } else { + // The excluded area between the 2 dirty areas is larger than the smallest dirty area. It would be + // more costly to combine these areas than possibly redraw some overlap. + VECTORIO_SHAPE_DEBUG("excluded area too large, drawing separate area\n"); + self->current_area.next = tail; + tail = &self->current_area; + } + + self->ephemeral_dirty_area.next = tail; + tail = &self->ephemeral_dirty_area; + } else { + self->current_area.next = tail; + tail = &self->current_area; + VECTORIO_SHAPE_DEBUG("%p get_refresh_area: redrawing current: {(%3d,%3d), (%3d,%3d)}\n", self, self->current_area.x1, self->current_area.y1, self->current_area.x2, self->current_area.y2); + } + } else if (!displayio_area_empty(&self->ephemeral_dirty_area)) { self->ephemeral_dirty_area.next = tail; - VECTORIO_SHAPE_DEBUG(" this_area: %p next: %p after: %p\n", &self->ephemeral_dirty_area, tail, tail == NULL ? NULL : tail->next); - return &self->ephemeral_dirty_area; + tail = &self->ephemeral_dirty_area; + VECTORIO_SHAPE_DEBUG("%p get_refresh_area redrawing dirty: {(%3d,%3d), (%3d,%3d)}\n", self, self->ephemeral_dirty_area.x1, self->ephemeral_dirty_area.y1, self->ephemeral_dirty_area.x2, self->ephemeral_dirty_area.y2); } return tail; } diff --git a/shared-module/vectorio/VectorShape.h b/shared-module/vectorio/VectorShape.h index 1896c72d6e..fdbae964a8 100644 --- a/shared-module/vectorio/VectorShape.h +++ b/shared-module/vectorio/VectorShape.h @@ -31,11 +31,12 @@ typedef struct { int16_t x; int16_t y; displayio_buffer_transform_t *absolute_transform; - bool dirty; // True if we need to draw // Tracks current shape footprint and expands outward as the shape dirties and changes. // This is suboptimal if you move your shape far. Could add more state to only redraw // exactly what we left behind. displayio_area_t ephemeral_dirty_area; + displayio_area_t current_area; + bool current_area_dirty; } vectorio_vector_shape_t; displayio_area_t *vectorio_vector_shape_get_refresh_areas(vectorio_vector_shape_t *self, displayio_area_t *tail); diff --git a/supervisor/background_callback.h b/supervisor/background_callback.h index 535dd656be..651ac020a6 100644 --- a/supervisor/background_callback.h +++ b/supervisor/background_callback.h @@ -27,6 +27,8 @@ #ifndef CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H #define CIRCUITPY_INCLUDED_SUPERVISOR_BACKGROUND_CALLBACK_H +#include + /** Background callbacks are a linked list of tasks to call in the background. * * Include a member of type `background_callback_t` inside an object @@ -69,6 +71,10 @@ void background_callback_add(background_callback_t *cb, background_callback_fun * whenever the list is non-empty */ void background_callback_run_all(void); +/* True when a background callback is pending. Helpful for checking background state when + * interrupts are disabled. */ +bool background_callback_pending(void); + /* During soft reset, remove all pending callbacks and clear the critical section flag */ void background_callback_reset(void); diff --git a/ports/raspberrypi/common-hal/busio/OneWire.h b/supervisor/fatfs_port.h similarity index 83% rename from ports/raspberrypi/common-hal/busio/OneWire.h rename to supervisor/fatfs_port.h index e27723ab2c..e76ced524d 100644 --- a/ports/raspberrypi/common-hal/busio/OneWire.h +++ b/supervisor/fatfs_port.h @@ -24,10 +24,11 @@ * THE SOFTWARE. */ -#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_ONEWIRE_H -#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_ONEWIRE_H +#ifndef MICROPY_INCLUDED_SUPERVISOR_FATFS_PORT_H +#define MICROPY_INCLUDED_SUPERVISOR_FATFS_PORT_H -// Use bitbangio. -#include "shared-module/busio/OneWire.h" +#include "lib/oofatfs/ff.h" -#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_BUSIO_ONEWIRE_H +void override_fattime(DWORD time); + +#endif // MICROPY_INCLUDED_SUPERVISOR_FATFS_PORT_H diff --git a/supervisor/shared/autoreload.c b/supervisor/shared/autoreload.c index 19b683fff7..5c66c44298 100644 --- a/supervisor/shared/autoreload.c +++ b/supervisor/shared/autoreload.c @@ -35,7 +35,7 @@ supervisor_allocation *next_code_allocation; static volatile uint32_t autoreload_delay_ms = 0; static bool autoreload_enabled = false; -static bool autoreload_suspended = false; +static size_t autoreload_suspended = 0; volatile bool reload_requested = false; @@ -44,7 +44,7 @@ inline void autoreload_tick() { return; } if (autoreload_delay_ms == 1 && autoreload_enabled && - !autoreload_suspended && !reload_requested) { + autoreload_suspended == 0 && !reload_requested) { mp_raise_reload_exception(); reload_requested = true; supervisor_set_run_reason(RUN_REASON_AUTO_RELOAD); @@ -62,12 +62,12 @@ void autoreload_disable() { autoreload_enabled = false; } -void autoreload_suspend() { - autoreload_suspended = true; +void autoreload_suspend(size_t lock_mask) { + autoreload_suspended |= lock_mask; } -void autoreload_resume() { - autoreload_suspended = false; +void autoreload_resume(size_t lock_mask) { + autoreload_suspended &= ~lock_mask; } inline bool autoreload_is_enabled() { diff --git a/supervisor/shared/autoreload.h b/supervisor/shared/autoreload.h index 41f9faea85..7282b11a69 100644 --- a/supervisor/shared/autoreload.h +++ b/supervisor/shared/autoreload.h @@ -40,6 +40,11 @@ enum { SUPERVISOR_NEXT_CODE_OPT_NEWLY_SET = 0x20, }; +enum { + AUTORELOAD_LOCK_REPL = 0x1, + AUTORELOAD_LOCK_BLE = 0x2 +}; + typedef struct { uint8_t options; char filename[]; @@ -58,8 +63,8 @@ void autoreload_disable(void); bool autoreload_is_enabled(void); // Temporarily turn it off. Used during the REPL. -void autoreload_suspend(void); -void autoreload_resume(void); +void autoreload_suspend(size_t lock_mask); +void autoreload_resume(size_t lock_mask); void autoreload_now(void); diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c index 0dafb5398d..a59a6e85f5 100644 --- a/supervisor/shared/background_callback.c +++ b/supervisor/shared/background_callback.c @@ -67,9 +67,13 @@ void background_callback_add(background_callback_t *cb, background_callback_fun background_callback_add_core(cb); } +bool PLACE_IN_ITCM(background_callback_pending)(void) { + return callback_head != NULL; +} + static bool in_background_callback; void PLACE_IN_ITCM(background_callback_run_all)() { - if (!callback_head) { + if (!background_callback_pending()) { return; } CALLBACK_CRITICAL_BEGIN; diff --git a/supervisor/shared/bluetooth/bluetooth.c b/supervisor/shared/bluetooth/bluetooth.c index ade20a9f07..426aad9891 100644 --- a/supervisor/shared/bluetooth/bluetooth.c +++ b/supervisor/shared/bluetooth/bluetooth.c @@ -56,7 +56,7 @@ // 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, 0xd8, // 3-5 TX power level -40 + 0x02, 0x0a, 0xec, // 3-5 TX power level -20 #if CIRCUITPY_BLE_FILE_SERVICE 0x03, 0x02, 0xbb, 0xfe, // 6 - 9 Incomplete service list (File Transfer service) #endif @@ -79,17 +79,27 @@ const uint8_t private_advertising_data[] = { 0x02, 0x01, 0x06, // 0-2 Flags uint8_t circuitpython_scan_response_data[] = { 0x0a, 0x09, 0x43, 0x49, 0x52, 0x50, 0x59, 0x00, 0x00, 0x00, 0x00, #if CIRCUITPY_SERIAL_BLE - 0x11, 0x06, 0x9e, 0xca, 0xdc, 0x24, 0x0e, 0xe5, 0xa9, 0xe0, 0x93, 0xf3, 0xa3, 0xb5, 0x01, 0x00, 0x40, 0x6e, + 0x11, 0x06, 0x6e, 0x68, 0x74, 0x79, 0x50, 0x74, 0x69, 0x75, 0x63, 0x72, 0x69, 0x43, 0x01, 0x00, 0xaf, 0xad #endif }; -bool boot_in_discovery_mode = false; -bool advertising = false; + +#if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE +STATIC bool boot_in_discovery_mode = false; +STATIC bool advertising = false; +STATIC bool ble_started = false; + +#define WORKFLOW_UNSET 0 +#define WORKFLOW_ENABLED 1 +#define WORKFLOW_DISABLED 2 + +STATIC uint8_t workflow_state = WORKFLOW_UNSET; +STATIC bool was_connected = false; STATIC void supervisor_bluetooth_start_advertising(void) { - #if !CIRCUITPY_BLE_FILE_SERVICE && !CIRCUITPY_SERIAL_BLE - return; - #else + if (workflow_state != WORKFLOW_ENABLED) { + return; + } bool is_connected = common_hal_bleio_adapter_get_connected(&common_hal_bleio_adapter_obj); if (is_connected) { return; @@ -111,7 +121,7 @@ STATIC void supervisor_bluetooth_start_advertising(void) { // 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) { - tx_power = -40; + tx_power = -20; adv = public_advertising_data; adv_len = sizeof(public_advertising_data); scan_response = circuitpython_scan_response_data; @@ -130,16 +140,15 @@ STATIC void supervisor_bluetooth_start_advertising(void) { NULL); // This may fail if we are already advertising. advertising = status == NRF_SUCCESS; - #endif } +#endif // CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE + #define BLE_DISCOVERY_DATA_GUARD 0xbb0000bb #define BLE_DISCOVERY_DATA_GUARD_MASK 0xff0000ff void supervisor_bluetooth_init(void) { - #if !CIRCUITPY_BLE_FILE_SERVICE && !CIRCUITPY_SERIAL_BLE - return; - #endif + #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE uint32_t reset_state = port_get_saved_word(); uint32_t ble_mode = 0; if ((reset_state & BLE_DISCOVERY_DATA_GUARD_MASK) == BLE_DISCOVERY_DATA_GUARD) { @@ -209,10 +218,14 @@ void supervisor_bluetooth_init(void) { status_led_deinit(); #endif port_set_saved_word(reset_state); + #endif } -STATIC bool was_connected; void supervisor_bluetooth_background(void) { + #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE + if (!ble_started) { + return; + } bool is_connected = common_hal_bleio_adapter_get_connected(&common_hal_bleio_adapter_obj); if (was_connected && !is_connected) { #if CIRCUITPY_BLE_FILE_SERVICE @@ -228,12 +241,15 @@ void supervisor_bluetooth_background(void) { #if CIRCUITPY_BLE_FILE_SERVICE supervisor_bluetooth_file_transfer_background(); #endif + #endif } void supervisor_start_bluetooth(void) { - #if !CIRCUITPY_BLE_FILE_SERVICE && !CIRCUITPY_SERIAL_BLE - return; - #endif + #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE + + if (workflow_state != WORKFLOW_ENABLED) { + return; + } common_hal_bleio_adapter_set_enabled(&common_hal_bleio_adapter_obj, true); @@ -245,16 +261,41 @@ void supervisor_start_bluetooth(void) { supervisor_start_bluetooth_serial(); #endif - // Kick off advertisments + // Mark as started so that the background call does something. + ble_started = true; + + // Kick off advertisements supervisor_bluetooth_background(); + + #endif } void supervisor_stop_bluetooth(void) { - #if !CIRCUITPY_BLE_FILE_SERVICE && !CIRCUITPY_SERIAL_BLE - return; - #endif + #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE + + if (!ble_started && workflow_state != WORKFLOW_ENABLED) { + return; + } #if CIRCUITPY_SERIAL_BLE supervisor_stop_bluetooth_serial(); #endif + + #endif +} + +void supervisor_bluetooth_enable_workflow(void) { + #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE + if (workflow_state == WORKFLOW_DISABLED) { + return; + } + + workflow_state = WORKFLOW_ENABLED; + #endif +} + +void supervisor_bluetooth_disable_workflow(void) { + #if CIRCUITPY_BLE_FILE_SERVICE || CIRCUITPY_SERIAL_BLE + workflow_state = WORKFLOW_DISABLED; + #endif } diff --git a/supervisor/shared/bluetooth/bluetooth.h b/supervisor/shared/bluetooth/bluetooth.h index 577c0c76a1..9de82719a5 100644 --- a/supervisor/shared/bluetooth/bluetooth.h +++ b/supervisor/shared/bluetooth/bluetooth.h @@ -34,4 +34,8 @@ void supervisor_bluetooth_init(void); void supervisor_start_bluetooth(void); void supervisor_stop_bluetooth(void); +// Enable only works if it hasn't been set yet. +void supervisor_bluetooth_enable_workflow(void); +void supervisor_bluetooth_disable_workflow(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 943aed8c0f..03806ca5e1 100644 --- a/supervisor/shared/bluetooth/file_transfer.c +++ b/supervisor/shared/bluetooth/file_transfer.c @@ -28,6 +28,7 @@ #include "extmod/vfs.h" #include "extmod/vfs_fat.h" +#include "lib/timeutils/timeutils.h" #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Adapter.h" @@ -41,12 +42,14 @@ #include "common-hal/_bleio/__init__.h" +#include "supervisor/fatfs_port.h" #include "supervisor/shared/autoreload.h" #include "supervisor/shared/bluetooth/file_transfer_protocol.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; @@ -97,7 +100,7 @@ void supervisor_start_bluetooth_file_transfer(void) { NULL, // no initial value NULL); // no description - uint32_t version = 1; + uint32_t version = 4; mp_buffer_info_t bufinfo; bufinfo.buf = &version; bufinfo.len = sizeof(version); @@ -130,12 +133,26 @@ void supervisor_start_bluetooth_file_transfer(void) { #define ANY_COMMAND 0x00 #define THIS_COMMAND 0x01 +// 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. +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; +} + // Used by read and write. STATIC FIL active_file; STATIC uint8_t _process_read(const uint8_t *raw_buf, size_t command_len) { struct read_command *command = (struct read_command *)raw_buf; - size_t header_size = 12; - size_t response_size = 16; + size_t header_size = sizeof(struct read_command); + size_t response_size = sizeof(struct read_data); uint8_t data_buffer[response_size]; struct read_data response; response.command = READ_DATA; @@ -189,38 +206,38 @@ STATIC uint8_t _process_read(const uint8_t *raw_buf, size_t command_len) { return READ_PACING; } -STATIC uint8_t _process_read_pacing(const uint8_t *command, size_t command_len) { - size_t response_size = 4 * sizeof(uint32_t); - uint32_t response[response_size / sizeof(uint32_t)]; - uint8_t *response_bytes = (uint8_t *)response; - response_bytes[0] = READ_DATA; - response_bytes[1] = STATUS_OK; - uint32_t offset = ((uint32_t *)command)[1]; - uint32_t chunk_size = ((uint32_t *)command)[2]; +STATIC uint8_t _process_read_pacing(const uint8_t *raw_buf, size_t command_len) { + struct read_pacing *command = (struct read_pacing *)raw_buf; + struct read_data response; + response.command = READ_DATA; + response.status = STATUS_OK; + size_t response_size = sizeof(struct read_data); + uint32_t total_length = f_size(&active_file); // Write out the response header. - chunk_size = MIN(chunk_size, total_length - offset); - response[1] = offset; - response[2] = total_length; - response[3] = chunk_size; + uint32_t chunk_size = MIN(command->chunk_size, total_length - command->chunk_offset); + response.chunk_offset = command->chunk_offset; + response.total_length = total_length; + response.data_size = chunk_size; common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, response_size, NULL, 0); - f_lseek(&active_file, offset); + f_lseek(&active_file, command->chunk_offset); // Write out the chunk contents. We can do this in small pieces because PacketBuffer // will assemble them into larger packets of its own. size_t chunk_offset = 0; + uint8_t data[20]; while (chunk_offset < chunk_size) { size_t quantity_read; - size_t read_size = MIN(chunk_size - chunk_offset, response_size); - FRESULT result = f_read(&active_file, response, read_size, &quantity_read); + size_t read_size = MIN(chunk_size - chunk_offset, sizeof(data)); + FRESULT result = f_read(&active_file, &data, read_size, &quantity_read); if (quantity_read == 0 || result != FR_OK) { // TODO: If we can't read everything, then the file must have been shortened. Maybe we // should return 0s to pad it out. break; } - common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, quantity_read, NULL, 0); + common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&data, quantity_read, NULL, 0); chunk_offset += quantity_read; } - if ((offset + chunk_size) >= total_length) { + if ((chunk_offset + chunk_size) >= total_length) { f_close(&active_file); return ANY_COMMAND; } @@ -229,10 +246,27 @@ STATIC uint8_t _process_read_pacing(const uint8_t *command, size_t command_len) // Used by write and write data to know when the write is complete. STATIC size_t total_write_length; +STATIC uint64_t _truncated_time; + +// Returns true if usb is active and replies with an error if so. If not, it grabs +// the USB mass storage lock and returns false. Make sure to release the lock with +// usb_msc_unlock() when the transaction is complete. +STATIC bool _usb_active(void *response, size_t response_size) { + // 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()) { + // Status is always the second byte of the response. + ((uint8_t *)response)[1] = STATUS_ERROR_READONLY; + common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)response, response_size, NULL, 0); + return true; + } + #endif + return false; +} STATIC uint8_t _process_write(const uint8_t *raw_buf, size_t command_len) { struct write_command *command = (struct write_command *)raw_buf; - size_t header_size = 12; + size_t header_size = sizeof(struct write_command); struct write_pacing response; response.command = WRITE_PACING; response.status = STATUS_OK; @@ -250,17 +284,14 @@ STATIC uint8_t _process_write(const uint8_t *raw_buf, size_t command_len) { char *path = (char *)command->path; path[command->path_length] = '\0'; - - // 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()) { - response.status = STATUS_ERROR; - common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, sizeof(struct write_pacing), NULL, 0); + if (_usb_active(&response, sizeof(struct write_pacing))) { return ANY_COMMAND; } - #endif FATFS *fs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; + DWORD fattime; + _truncated_time = truncate_time(command->modification_time, &fattime); + override_fattime(fattime); FRESULT result = f_open(fs, &active_file, path, FA_WRITE | FA_OPEN_ALWAYS); if (result != FR_OK) { response.status = STATUS_ERROR; @@ -268,6 +299,7 @@ STATIC uint8_t _process_write(const uint8_t *raw_buf, size_t command_len) { #if CIRCUITPY_USB_MSC usb_msc_unlock(); #endif + override_fattime(0); return ANY_COMMAND; } // Write out the pacing response. @@ -280,18 +312,20 @@ STATIC uint8_t _process_write(const uint8_t *raw_buf, size_t command_len) { f_lseek(&active_file, offset); f_truncate(&active_file); f_close(&active_file); + override_fattime(0); #if CIRCUITPY_USB_MSC usb_msc_unlock(); #endif } response.offset = offset; response.free_space = chunk_size; + response.truncated_time = _truncated_time; common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, sizeof(struct write_pacing), NULL, 0); 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); // Trigger an autoreload - autoreload_now(); + autoreload_start(); return ANY_COMMAND; } @@ -300,7 +334,7 @@ STATIC uint8_t _process_write(const uint8_t *raw_buf, size_t command_len) { STATIC uint8_t _process_write_data(const uint8_t *raw_buf, size_t command_len) { struct write_data *command = (struct write_data *)raw_buf; - size_t header_size = 12; + size_t header_size = sizeof(struct write_data); struct write_pacing response; response.command = WRITE_PACING; response.status = STATUS_OK; @@ -311,6 +345,7 @@ STATIC uint8_t _process_write_data(const uint8_t *raw_buf, size_t command_len) { #if CIRCUITPY_USB_MSC usb_msc_unlock(); #endif + override_fattime(0); return ANY_COMMAND; } // We need to receive another packet to have the full path. @@ -328,6 +363,7 @@ STATIC uint8_t _process_write_data(const uint8_t *raw_buf, size_t command_len) { #if CIRCUITPY_USB_MSC usb_msc_unlock(); #endif + override_fattime(0); return ANY_COMMAND; } offset += command->data_size; @@ -335,25 +371,60 @@ STATIC uint8_t _process_write_data(const uint8_t *raw_buf, size_t command_len) { size_t chunk_size = MIN(total_write_length - offset, 512); response.offset = offset; response.free_space = chunk_size; + response.truncated_time = _truncated_time; common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, sizeof(struct write_pacing), NULL, 0); if (total_write_length == offset) { f_truncate(&active_file); f_close(&active_file); + override_fattime(0); #if CIRCUITPY_USB_MSC usb_msc_unlock(); #endif // Don't reload until everything is written out of the packet buffer. common_hal_bleio_packet_buffer_flush(&_transfer_packet_buffer); // Trigger an autoreload - autoreload_now(); + autoreload_start(); 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 = 4; + size_t header_size = sizeof(struct delete_command); struct delete_status response; response.command = DELETE_STATUS; response.status = STATUS_OK; @@ -363,6 +434,9 @@ STATIC uint8_t _process_delete(const uint8_t *raw_buf, size_t command_len) { common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, sizeof(struct delete_status), NULL, 0); return ANY_COMMAND; } + if (_usb_active(&response, sizeof(struct delete_status))) { + return ANY_COMMAND; + } // We need to receive another packet to have the full path. if (command_len < header_size + command->path_length) { return THIS_COMMAND; @@ -370,17 +444,46 @@ STATIC uint8_t _process_delete(const uint8_t *raw_buf, size_t command_len) { FATFS *fs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; char *path = (char *)((uint8_t *)command) + header_size; path[command->path_length] = '\0'; - FRESULT result = f_unlink(fs, path); + 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); + } + if (result == FR_OK) { + result = f_unlink(fs, path); + } + } + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif if (result != FR_OK) { response.status = STATUS_ERROR; } common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, sizeof(struct delete_status), NULL, 0); + 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); + // Trigger an autoreload + autoreload_start(); + } return ANY_COMMAND; } +// NULL-terminate the path and remove any trailing /. Older versions of the +// protocol require it but newer ones do not. +STATIC void _terminate_path(char *path, size_t path_length) { + // -1 because fatfs doesn't want a trailing / + if (path[path_length - 1] == '/') { + path[path_length - 1] = '\0'; + } else { + path[path_length] = '\0'; + } +} + STATIC uint8_t _process_mkdir(const uint8_t *raw_buf, size_t command_len) { const struct mkdir_command *command = (struct mkdir_command *)raw_buf; - size_t header_size = 4; + size_t header_size = sizeof(struct mkdir_command); struct mkdir_status response; response.command = MKDIR_STATUS; response.status = STATUS_OK; @@ -390,27 +493,43 @@ STATIC uint8_t _process_mkdir(const uint8_t *raw_buf, size_t command_len) { common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, sizeof(struct mkdir_status), NULL, 0); return ANY_COMMAND; } + if (_usb_active(&response, sizeof(struct mkdir_status))) { + return ANY_COMMAND; + } // We need to receive another packet to have the full path. 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; - char *path = (char *)((uint8_t *)command) + header_size; - // TODO: Check that the final character is a `/` - path[command->path_length - 1] = '\0'; + 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); + override_fattime(0); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif if (result != FR_OK) { response.status = STATUS_ERROR; } common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, sizeof(struct mkdir_status), NULL, 0); + 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); + // Trigger an autoreload + autoreload_start(); + } return ANY_COMMAND; } STATIC uint8_t _process_listdir(uint8_t *raw_buf, size_t command_len) { const struct listdir_command *command = (struct listdir_command *)raw_buf; struct listdir_entry *entry = (struct listdir_entry *)raw_buf; - size_t header_size = 4; - size_t response_size = 5 * sizeof(uint32_t); + size_t header_size = sizeof(struct listdir_command); + size_t response_size = sizeof(struct listdir_entry); // We reuse the command buffer so that we can produce long packets without // making the stack large. if (command->path_length > (COMMAND_SIZE - header_size - 1)) { // -1 for the null we'll write @@ -426,9 +545,8 @@ STATIC uint8_t _process_listdir(uint8_t *raw_buf, size_t command_len) { } FATFS *fs = &((fs_user_mount_t *)MP_STATE_VM(vfs_mount_table)->obj)->fatfs; - char *path = (char *)command->path; - // -1 because fatfs doesn't want a trailing / - path[command->path_length - 1] = '\0'; + char *path = (char *)&command->path; + _terminate_path(path, command->path_length); // mp_printf(&mp_plat_print, "list %s\n", path); FF_DIR dir; FRESULT res = f_opendir(fs, &dir, path); @@ -459,6 +577,13 @@ STATIC uint8_t _process_listdir(uint8_t *raw_buf, size_t command_len) { for (size_t i = 0; i < total_entries; i++) { res = f_readdir(&dir, &file_info); entry->entry_number = i; + uint64_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) * 1000000000ULL; + entry->truncated_time = truncated_time; if ((file_info.fattrib & AM_DIR) != 0) { entry->flags = 1; // Directory entry->file_size = 0; @@ -486,6 +611,53 @@ STATIC uint8_t _process_listdir(uint8_t *raw_buf, size_t command_len) { return ANY_COMMAND; } +STATIC uint8_t _process_move(const uint8_t *raw_buf, size_t command_len) { + const struct move_command *command = (struct move_command *)raw_buf; + size_t header_size = sizeof(struct move_command); + struct move_status response; + response.command = MOVE_STATUS; + response.status = STATUS_OK; + // +2 for null terminators. + uint32_t total_path_length = command->old_path_length + command->new_path_length + 1; + if (total_path_length > (COMMAND_SIZE - header_size - 1)) { + // TODO: throw away any more packets of path. + response.status = STATUS_ERROR; + common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, sizeof(struct move_status), NULL, 0); + return ANY_COMMAND; + } + if (_usb_active(&response, sizeof(struct move_status))) { + return ANY_COMMAND; + } + // We need to receive another packet to have the full path. + 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; + char *old_path = (char *)command->paths; + old_path[command->old_path_length] = '\0'; + + char *new_path = old_path + command->old_path_length + 1; + new_path[command->new_path_length] = '\0'; + + // mp_printf(&mp_plat_print, "move %s to %s\n", old_path, new_path); + + FRESULT result = f_rename(fs, old_path, new_path); + #if CIRCUITPY_USB_MSC + usb_msc_unlock(); + #endif + if (result != FR_OK) { + response.status = STATUS_ERROR; + } + common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, (const uint8_t *)&response, sizeof(struct move_status), NULL, 0); + 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); + // Trigger an autoreload + autoreload_start(); + } + return ANY_COMMAND; +} + // Background state that must live across background calls. After the _process // helpers to force them to not use them. STATIC uint8_t current_command[COMMAND_SIZE] __attribute__ ((aligned(4))); @@ -504,6 +676,7 @@ void supervisor_bluetooth_file_transfer_background(void) { if (size == 0) { break; } + autoreload_suspend(AUTORELOAD_LOCK_BLE); // TODO: If size < 0 return an error. current_offset += size; #if CIRCUITPY_VERBOSE_BLE @@ -521,6 +694,7 @@ void supervisor_bluetooth_file_transfer_background(void) { response[0] = next_command; response[1] = STATUS_ERROR_PROTOCOL; common_hal_bleio_packet_buffer_write(&_transfer_packet_buffer, response, 2, NULL, 0); + autoreload_resume(AUTORELOAD_LOCK_BLE); break; } switch (current_state) { @@ -545,11 +719,17 @@ void supervisor_bluetooth_file_transfer_background(void) { case LISTDIR: next_command = _process_listdir(current_command, current_offset); break; + case MOVE: + next_command = _process_move(current_command, current_offset); + break; } // Preserve the offset if we are waiting for more from this command. if (next_command != THIS_COMMAND) { current_offset = 0; } + if (next_command == ANY_COMMAND) { + autoreload_resume(AUTORELOAD_LOCK_BLE); + } } running = false; } @@ -558,4 +738,5 @@ void supervisor_bluetooth_file_transfer_disconnected(void) { next_command = ANY_COMMAND; current_offset = 0; f_close(&active_file); + autoreload_resume(AUTORELOAD_LOCK_BLE); } diff --git a/supervisor/shared/bluetooth/file_transfer_protocol.h b/supervisor/shared/bluetooth/file_transfer_protocol.h index 2c8fe1e5e7..3bc1f611c5 100644 --- a/supervisor/shared/bluetooth/file_transfer_protocol.h +++ b/supervisor/shared/bluetooth/file_transfer_protocol.h @@ -32,6 +32,11 @@ // See https://github.com/adafruit/Adafruit_CircuitPython_BLE_File_Transfer // for full protocol documentation and a Python client API. +// Each struct is packed so that no padding is added by the compiler. (structs +// may having padding at the end in order to align a particular element when in +// an array of the struct.) So, be careful that types added are aligned. Otherwise, +// the compiler may generate more code than necessary. + // 0x00 - 0x0f are never used by the protocol as a command #define READ 0x10 struct read_command { @@ -41,7 +46,7 @@ struct read_command { uint32_t chunk_offset; uint32_t chunk_size; uint8_t path[]; -}; +} __attribute__((packed)); #define READ_DATA 0x11 struct read_data { @@ -52,7 +57,7 @@ struct read_data { uint32_t total_length; uint32_t data_size; uint8_t data[]; -}; +} __attribute__((packed)); #define READ_PACING 0x12 struct read_pacing { @@ -61,7 +66,7 @@ struct read_pacing { uint16_t reserved; uint32_t chunk_offset; uint32_t chunk_size; -}; +} __attribute__((packed)); #define WRITE 0x20 struct write_command { @@ -69,9 +74,10 @@ struct write_command { uint8_t reserved; uint16_t path_length; uint32_t offset; + uint64_t modification_time; uint32_t total_length; uint8_t path[]; -}; +} __attribute__((packed)); #define WRITE_PACING 0x21 struct write_pacing { @@ -79,8 +85,9 @@ struct write_pacing { uint8_t status; uint16_t reserved; uint32_t offset; + uint64_t truncated_time; uint32_t free_space; -}; +} __attribute__((packed)); #define WRITE_DATA 0x22 struct write_data { @@ -90,7 +97,7 @@ struct write_data { uint32_t offset; uint32_t data_size; uint8_t data[]; -}; +} __attribute__((packed)); #define DELETE 0x30 struct delete_command { @@ -98,27 +105,32 @@ struct delete_command { uint8_t reserved; uint16_t path_length; uint8_t path[]; -}; +} __attribute__((packed)); #define DELETE_STATUS 0x31 struct delete_status { uint8_t command; uint8_t status; -}; +} __attribute__((packed)); #define MKDIR 0x40 struct mkdir_command { uint8_t command; uint8_t reserved; uint16_t path_length; + uint32_t reserved2; + uint64_t modification_time; uint8_t path[]; -}; +} __attribute__((packed)); #define MKDIR_STATUS 0x41 struct mkdir_status { uint8_t command; uint8_t status; -}; + uint16_t reserved; + uint32_t reserved2; + uint64_t truncated_time; +} __attribute__((packed)); #define LISTDIR 0x50 struct listdir_command { @@ -126,7 +138,7 @@ struct listdir_command { uint8_t reserved; uint16_t path_length; uint8_t path[]; -}; +} __attribute__((packed)); #define LISTDIR_ENTRY 0x51 struct listdir_entry { @@ -136,14 +148,33 @@ struct listdir_entry { uint32_t entry_number; uint32_t entry_count; uint32_t flags; + uint64_t truncated_time; uint32_t file_size; uint8_t path[]; -}; +} __attribute__((packed)); + +#define MOVE 0x60 +struct move_command { + uint8_t command; + uint8_t reserved; + uint16_t old_path_length; + uint16_t new_path_length; + // paths is two strings. The first is old_path and then a reserved byte. + // The last path is new_path. + uint8_t paths[]; +} __attribute__((packed)); + +#define MOVE_STATUS 0x61 +struct move_status { + uint8_t command; + uint8_t status; +} __attribute__((packed)); #define STATUS_OK 0x01 #define STATUS_ERROR 0x02 #define STATUS_ERROR_NO_FILE 0x03 #define STATUS_ERROR_PROTOCOL 0x04 +#define STATUS_ERROR_READONLY 0x05 #endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_BLUETOOTH_FILE_TRANSFER_PROTOCOL_H diff --git a/supervisor/shared/bluetooth/serial.c b/supervisor/shared/bluetooth/serial.c index d852a86d74..018acd5f4a 100644 --- a/supervisor/shared/bluetooth/serial.c +++ b/supervisor/shared/bluetooth/serial.c @@ -26,6 +26,7 @@ #include +#include "genhdr/mpversion.h" #include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Adapter.h" #include "shared-bindings/_bleio/Characteristic.h" @@ -39,18 +40,20 @@ #include "py/mpstate.h" -STATIC bleio_service_obj_t supervisor_ble_serial_service; -STATIC bleio_uuid_obj_t supervisor_ble_serial_service_uuid; -STATIC bleio_characteristic_obj_t supervisor_ble_rx_characteristic; -STATIC bleio_uuid_obj_t supervisor_ble_rx_uuid; -STATIC bleio_characteristic_obj_t supervisor_ble_tx_characteristic; -STATIC bleio_uuid_obj_t supervisor_ble_tx_uuid; +STATIC bleio_service_obj_t supervisor_ble_circuitpython_service; +STATIC bleio_uuid_obj_t supervisor_ble_circuitpython_service_uuid; +STATIC bleio_characteristic_obj_t supervisor_ble_circuitpython_rx_characteristic; +STATIC bleio_uuid_obj_t supervisor_ble_circuitpython_rx_uuid; +STATIC bleio_characteristic_obj_t supervisor_ble_circuitpython_tx_characteristic; +STATIC bleio_uuid_obj_t supervisor_ble_circuitpython_tx_uuid; +STATIC bleio_characteristic_obj_t supervisor_ble_circuitpython_version_characteristic; +STATIC bleio_uuid_obj_t supervisor_ble_circuitpython_version_uuid; -// This is the base UUID for the nordic uart service. -const uint8_t nordic_uart_base_uuid[16] = {0x9e, 0xca, 0xdc, 0x24, 0x0e, 0xe5, 0xa9, 0xe0, 0x93, 0xf3, 0xa3, 0xb5, 0x00, 0x00, 0x40, 0x6e }; +// This is the base UUID for the CircuitPython service. +const uint8_t circuitpython_base_uuid[16] = {0x6e, 0x68, 0x74, 0x79, 0x50, 0x74, 0x69, 0x75, 0x63, 0x72, 0x69, 0x43, 0x00, 0x00, 0xaf, 0xad }; STATIC mp_obj_list_t characteristic_list; -STATIC mp_obj_t characteristic_list_items[2]; +STATIC mp_obj_t characteristic_list_items[3]; STATIC uint32_t _outgoing1[BLE_GATTS_VAR_ATTR_LEN_MAX / 4]; STATIC uint32_t _outgoing2[BLE_GATTS_VAR_ATTR_LEN_MAX / 4]; @@ -64,8 +67,8 @@ STATIC bleio_characteristic_buffer_obj_t _rx_buffer; STATIC bool _enabled; void supervisor_start_bluetooth_serial(void) { - supervisor_ble_serial_service_uuid.base.type = &bleio_uuid_type; - common_hal_bleio_uuid_construct(&supervisor_ble_serial_service_uuid, 0x0001, nordic_uart_base_uuid); + supervisor_ble_circuitpython_service_uuid.base.type = &bleio_uuid_type; + common_hal_bleio_uuid_construct(&supervisor_ble_circuitpython_service_uuid, 0x0001, circuitpython_base_uuid); // We know we'll only be N characteristics so we can statically allocate it. characteristic_list.base.type = &mp_type_list; @@ -74,50 +77,72 @@ void supervisor_start_bluetooth_serial(void) { characteristic_list.items = characteristic_list_items; mp_seq_clear(characteristic_list.items, 0, characteristic_list.alloc, sizeof(*characteristic_list.items)); - supervisor_ble_serial_service.base.type = &bleio_service_type; - _common_hal_bleio_service_construct(&supervisor_ble_serial_service, &supervisor_ble_serial_service_uuid, false /* is secondary */, &characteristic_list); + supervisor_ble_circuitpython_service.base.type = &bleio_service_type; + _common_hal_bleio_service_construct(&supervisor_ble_circuitpython_service, &supervisor_ble_circuitpython_service_uuid, false /* is secondary */, &characteristic_list); // RX - supervisor_ble_rx_uuid.base.type = &bleio_uuid_type; - common_hal_bleio_uuid_construct(&supervisor_ble_rx_uuid, 0x0002, nordic_uart_base_uuid); - common_hal_bleio_characteristic_construct(&supervisor_ble_rx_characteristic, - &supervisor_ble_serial_service, + supervisor_ble_circuitpython_rx_uuid.base.type = &bleio_uuid_type; + common_hal_bleio_uuid_construct(&supervisor_ble_circuitpython_rx_uuid, 0x0002, circuitpython_base_uuid); + common_hal_bleio_characteristic_construct(&supervisor_ble_circuitpython_rx_characteristic, + &supervisor_ble_circuitpython_service, 0, // handle (for remote only) - &supervisor_ble_rx_uuid, + &supervisor_ble_circuitpython_rx_uuid, CHAR_PROP_WRITE | CHAR_PROP_WRITE_NO_RESPONSE, SECURITY_MODE_NO_ACCESS, SECURITY_MODE_ENC_NO_MITM, BLE_GATTS_VAR_ATTR_LEN_MAX, // max length false, // fixed length NULL, // no initial value - "CircuitPython Serial"); + NULL); // TX - supervisor_ble_tx_uuid.base.type = &bleio_uuid_type; - common_hal_bleio_uuid_construct(&supervisor_ble_tx_uuid, 0x0003, nordic_uart_base_uuid); - common_hal_bleio_characteristic_construct(&supervisor_ble_tx_characteristic, - &supervisor_ble_serial_service, + supervisor_ble_circuitpython_tx_uuid.base.type = &bleio_uuid_type; + common_hal_bleio_uuid_construct(&supervisor_ble_circuitpython_tx_uuid, 0x0003, circuitpython_base_uuid); + common_hal_bleio_characteristic_construct(&supervisor_ble_circuitpython_tx_characteristic, + &supervisor_ble_circuitpython_service, 0, // handle (for remote only) - &supervisor_ble_tx_uuid, + &supervisor_ble_circuitpython_tx_uuid, CHAR_PROP_NOTIFY, SECURITY_MODE_ENC_NO_MITM, SECURITY_MODE_NO_ACCESS, BLE_GATTS_VAR_ATTR_LEN_MAX, // max length false, // fixed length NULL, // no initial value - "CircuitPython Serial"); + NULL); + + // Version number + const char *version = MICROPY_GIT_TAG; + mp_buffer_info_t bufinfo; + bufinfo.buf = (uint8_t *)version; + bufinfo.len = strlen(version); + + supervisor_ble_circuitpython_version_uuid.base.type = &bleio_uuid_type; + common_hal_bleio_uuid_construct(&supervisor_ble_circuitpython_version_uuid, 0x0100, circuitpython_base_uuid); + common_hal_bleio_characteristic_construct(&supervisor_ble_circuitpython_version_characteristic, + &supervisor_ble_circuitpython_service, + 0, // handle (for remote only) + &supervisor_ble_circuitpython_version_uuid, + CHAR_PROP_READ, + SECURITY_MODE_OPEN, + SECURITY_MODE_NO_ACCESS, + bufinfo.len, // max length + true, // fixed length + NULL, // no initial value + NULL); // no description + + common_hal_bleio_characteristic_set_value(&supervisor_ble_circuitpython_version_characteristic, &bufinfo); // Use a PacketBuffer to transmit so that we glom characters to transmit // together and save BLE overhead. _common_hal_bleio_packet_buffer_construct( - &_tx_packet_buffer, &supervisor_ble_tx_characteristic, + &_tx_packet_buffer, &supervisor_ble_circuitpython_tx_characteristic, NULL, 0, _outgoing1, _outgoing2, BLE_GATTS_VAR_ATTR_LEN_MAX, &tx_static_handler_entry); // Use a CharacteristicBuffer for rx so we can read a single character at a time. _common_hal_bleio_characteristic_buffer_construct(&_rx_buffer, - &supervisor_ble_rx_characteristic, + &supervisor_ble_circuitpython_rx_characteristic, 0.1f, (uint8_t *)_incoming, sizeof(_incoming) * sizeof(uint32_t), &rx_static_handler_entry); @@ -166,7 +191,7 @@ void ble_serial_write(const char *text, size_t len) { } size_t sent = 0; while (sent < len) { - uint16_t packet_size = MIN(len, (size_t)common_hal_bleio_packet_buffer_get_outgoing_packet_length(&_tx_packet_buffer)); + uint16_t packet_size = MIN(len - sent, (size_t)common_hal_bleio_packet_buffer_get_outgoing_packet_length(&_tx_packet_buffer)); mp_int_t written = common_hal_bleio_packet_buffer_write(&_tx_packet_buffer, (const uint8_t *)text + sent, packet_size, NULL, 0); // Error, so we drop characters to transmit. if (written < 0) { diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index 6ee6c7386a..9cd4f18960 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -123,6 +123,7 @@ void supervisor_stop_terminal(void) { free_memory(tilegrid_tiles); tilegrid_tiles = NULL; supervisor_terminal_text_grid.tiles = NULL; + supervisor_terminal.tilegrid = NULL; } #endif } diff --git a/supervisor/shared/memory.c b/supervisor/shared/memory.c index 04f2f571db..cf7dbf7ed7 100644 --- a/supervisor/shared/memory.c +++ b/supervisor/shared/memory.c @@ -34,12 +34,9 @@ enum { CIRCUITPY_SUPERVISOR_IMMOVABLE_ALLOC_COUNT = + 0 // stack + heap - 2 - // next_code_allocation - + 1 - // prev_traceback_allocation - + 1 + + 2 #if INTERNAL_FLASH_FILESYSTEM == 0 + 1 @@ -59,6 +56,10 @@ enum { CIRCUITPY_SUPERVISOR_MOVABLE_ALLOC_COUNT = 0 + // next_code_allocation + + 1 + // prev_traceback_allocation + + 1 #if CIRCUITPY_DISPLAYIO #if CIRCUITPY_TERMINALIO + 1 diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 2e78ef4924..646467ce39 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -66,6 +66,9 @@ safe_mode_t wait_for_safe_mode_reset(void) { reset_reason != RESET_REASON_SOFTWARE) { return NO_SAFE_MODE; } + #ifdef CIRCUITPY_SKIP_SAFE_MODE_WAIT + return NO_SAFE_MODE; + #endif port_set_saved_word(SAFE_MODE_DATA_GUARD | (MANUAL_SAFE_MODE << 8)); // Wait for a while to allow for reset. diff --git a/supervisor/shared/status_leds.c b/supervisor/shared/status_leds.c index d57aba1973..92c9578051 100644 --- a/supervisor/shared/status_leds.c +++ b/supervisor/shared/status_leds.c @@ -26,6 +26,8 @@ #include "supervisor/shared/status_leds.h" +#include + #include "mphalport.h" #include "shared-bindings/microcontroller/Pin.h" #include "supervisor/shared/tick.h" @@ -39,16 +41,25 @@ static digitalio_digitalinout_obj_t _status_power; #ifdef MICROPY_HW_NEOPIXEL uint8_t rgb_status_brightness = 63; - #include "shared-bindings/digitalio/DigitalInOut.h" - #include "shared-bindings/neopixel_write/__init__.h" -static uint8_t status_neopixel_color[3]; +#include "shared-bindings/digitalio/DigitalInOut.h" +#include "shared-bindings/neopixel_write/__init__.h" + +#ifndef MICROPY_HW_NEOPIXEL_COUNT +#define MICROPY_HW_NEOPIXEL_COUNT (1) +#endif + +static uint8_t status_neopixel_color[3 * MICROPY_HW_NEOPIXEL_COUNT]; static digitalio_digitalinout_obj_t status_neopixel; #elif defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) uint8_t rgb_status_brightness = 50; - #define APA102_BUFFER_LENGTH 12 -static uint8_t status_apa102_color[APA102_BUFFER_LENGTH] = {0, 0, 0, 0, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0xff}; +#ifndef MICROPY_HW_APA102_COUNT +#define MICROPY_HW_APA102_COUNT (1) +#endif + + #define APA102_BUFFER_LENGTH (4 + 4 * MICROPY_HW_APA102_COUNT + 4) +static uint8_t status_apa102_color[APA102_BUFFER_LENGTH]; #if CIRCUITPY_BITBANG_APA102 #include "shared-bindings/bitbangio/SPI.h" @@ -96,6 +107,11 @@ uint16_t status_rgb_color[3] = { digitalio_digitalinout_obj_t single_color_led; uint8_t rgb_status_brightness = 0xff; + +#ifndef MICROPY_HW_LED_STATUS_INVERTED +#define MICROPY_HW_LED_STATUS_INVERTED (0) +#endif + #endif #if CIRCUITPY_DIGITALIO && (defined(MICROPY_HW_LED_RX) || defined(MICROPY_HW_LED_TX)) @@ -132,6 +148,8 @@ void status_led_init() { common_hal_digitalio_digitalinout_construct(&status_neopixel, MICROPY_HW_NEOPIXEL); common_hal_digitalio_digitalinout_switch_to_output(&status_neopixel, false, DRIVE_MODE_PUSH_PULL); #elif defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) + // Set every byte to 0xff except the start 4 bytes that make up the header. + memset(status_apa102_color + 4, 0xff, APA102_BUFFER_LENGTH - 4); #if CIRCUITPY_BITBANG_APA102 shared_module_bitbangio_spi_construct(&status_apa102, MICROPY_HW_APA102_SCK, @@ -184,7 +202,8 @@ void status_led_init() { #elif defined(MICROPY_HW_LED_STATUS) common_hal_digitalio_digitalinout_construct(&single_color_led, MICROPY_HW_LED_STATUS); - common_hal_digitalio_digitalinout_switch_to_output(&single_color_led, true, DRIVE_MODE_PUSH_PULL); + common_hal_digitalio_digitalinout_switch_to_output( + &single_color_led, MICROPY_HW_LED_STATUS_INVERTED == 0, DRIVE_MODE_PUSH_PULL); #endif #if CIRCUITPY_DIGITALIO && CIRCUITPY_STATUS_LED @@ -240,15 +259,20 @@ void new_status_color(uint32_t rgb) { #endif #ifdef MICROPY_HW_NEOPIXEL - status_neopixel_color[0] = (rgb_adjusted >> 8) & 0xff; - status_neopixel_color[1] = (rgb_adjusted >> 16) & 0xff; - status_neopixel_color[2] = rgb_adjusted & 0xff; - common_hal_neopixel_write(&status_neopixel, status_neopixel_color, 3); + for (size_t i = 0; i < MICROPY_HW_NEOPIXEL_COUNT; i++) { + status_neopixel_color[3 * i + 0] = (rgb_adjusted >> 8) & 0xff; + status_neopixel_color[3 * i + 1] = (rgb_adjusted >> 16) & 0xff; + status_neopixel_color[3 * i + 2] = rgb_adjusted & 0xff; + } + common_hal_neopixel_write(&status_neopixel, status_neopixel_color, 3 * MICROPY_HW_NEOPIXEL_COUNT); #elif defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK) - status_apa102_color[5] = rgb_adjusted & 0xff; - status_apa102_color[6] = (rgb_adjusted >> 8) & 0xff; - status_apa102_color[7] = (rgb_adjusted >> 16) & 0xff; + for (size_t i = 0; i < MICROPY_HW_APA102_COUNT; i++) { + // Skip 4 + offset to skip the header bytes too. + status_apa102_color[4 * i + 4 + 1] = rgb_adjusted & 0xff; + status_apa102_color[4 * i + 4 + 2] = (rgb_adjusted >> 8) & 0xff; + status_apa102_color[4 * i + 4 + 3] = (rgb_adjusted >> 16) & 0xff; + } #if CIRCUITPY_BITBANG_APA102 shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, APA102_BUFFER_LENGTH); @@ -275,7 +299,8 @@ void new_status_color(uint32_t rgb) { common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_g, status_rgb_color[1]); common_hal_pwmio_pwmout_set_duty_cycle(&rgb_status_b, status_rgb_color[2]); #elif CIRCUITPY_DIGITALIO && defined(MICROPY_HW_LED_STATUS) - common_hal_digitalio_digitalinout_set_value(&single_color_led, rgb_adjusted > 0); + common_hal_digitalio_digitalinout_set_value( + &single_color_led, (rgb_adjusted > 0) ^ MICROPY_HW_LED_STATUS_INVERTED); #endif } diff --git a/supervisor/shared/tick.c b/supervisor/shared/tick.c index f755df2596..397151ccc8 100644 --- a/supervisor/shared/tick.c +++ b/supervisor/shared/tick.c @@ -40,10 +40,6 @@ #include "shared-module/displayio/__init__.h" #endif -#if CIRCUITPY_GAMEPAD -#include "shared-module/gamepad/__init__.h" -#endif - #if CIRCUITPY_GAMEPADSHIFT #include "shared-module/gamepadshift/__init__.h" #endif @@ -102,9 +98,6 @@ void supervisor_tick(void) { #ifdef CIRCUITPY_GAMEPAD_TICKS if (!(port_get_raw_ticks(NULL) & CIRCUITPY_GAMEPAD_TICKS)) { - #if CIRCUITPY_GAMEPAD - gamepad_tick(); - #endif #if CIRCUITPY_GAMEPADSHIFT gamepadshift_tick(); #endif @@ -134,12 +127,12 @@ void PLACE_IN_ITCM(supervisor_run_background_tasks_if_tick)() { background_callback_run_all(); } -void mp_hal_delay_ms(mp_uint_t delay) { +void mp_hal_delay_ms(mp_uint_t delay_ms) { uint64_t start_tick = port_get_raw_ticks(NULL); // Adjust the delay to ticks vs ms. - delay = delay * 1024 / 1000; - uint64_t end_tick = start_tick + delay; - int64_t remaining = delay; + uint64_t delay_ticks = (delay_ms * (uint64_t)1024) / 1000; + uint64_t end_tick = start_tick + delay_ticks; + int64_t remaining = delay_ticks; // Loop until we've waited long enough or we've been CTRL-Ced by autoreload // or the user. diff --git a/supervisor/shared/translate.c b/supervisor/shared/translate.c index 7afbd43e21..a14fa5c728 100644 --- a/supervisor/shared/translate.c +++ b/supervisor/shared/translate.c @@ -35,12 +35,25 @@ #endif #include "py/misc.h" +#include "py/mpprint.h" #include "supervisor/serial.h" void serial_write_compressed(const compressed_string_t *compressed) { - char decompressed[decompress_length(compressed)]; - decompress(compressed, decompressed); - serial_write(decompressed); + mp_printf(MP_PYTHON_PRINTER, "%S", compressed); +} + +STATIC void get_word(int n, const mchar_t **pos, const mchar_t **end) { + int len = minlen; + int i = 0; + *pos = words; + while (wlencount[i] <= n) { + n -= wlencount[i]; + *pos += len * wlencount[i]; + i++; + len++; + } + *pos += len * n; + *end = *pos + len; } STATIC int put_utf8(char *buf, int u) { @@ -49,16 +62,14 @@ STATIC int put_utf8(char *buf, int u) { return 1; } else if (word_start <= u && u <= word_end) { uint n = (u - word_start); - size_t pos = 0; - if (n > 0) { - pos = wends[n - 1] + (n * 2); - } + const mchar_t *pos, *end; + get_word(n, &pos, &end); int ret = 0; // note that at present, entries in the words table are // guaranteed not to represent words themselves, so this adds // at most 1 level of recursive call - for (; pos < wends[n] + (n + 1) * 2; pos++) { - int len = put_utf8(buf, words[pos]); + for (; pos < end; pos++) { + int len = put_utf8(buf, *pos); buf += len; ret += len; } diff --git a/supervisor/shared/translate.h b/supervisor/shared/translate.h index 3096fc3e80..da58e1eb78 100644 --- a/supervisor/shared/translate.h +++ b/supervisor/shared/translate.h @@ -50,11 +50,14 @@ // are computed with a heuristic based on frequent substrings of 2 to // 9 code points. These are called "words" but are not, grammatically // speaking, words. They're just spans of code points that frequently -// occur together. +// occur together. They are ordered shortest to longest. // // - dictionary entries are non-overlapping, and the _ending_ index of each -// entry is stored in an array. Since the index given is the ending -// index, the array is called "wends". +// entry is stored in an array. A count of words of each length, from +// minlen to maxlen, is given in the array called wlencount. From +// this small array, the start and end of the N'th word can be +// calculated by an efficient, small loop. (A bit of time is traded +// to reduce the size of this table indicating lengths) // // The "data" / "tail" construct is so that the struct's last member is a // "flexible array". However, the _only_ member is not permitted to be @@ -66,7 +69,7 @@ // flexible array}, but is also future-proofed against strings with // UTF-8 length above 256, with a savings of about 1.375 bytes per // string. -typedef struct { +typedef struct compressed_string { uint8_t data; const uint8_t tail[]; } compressed_string_t; diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index 9a276aa6cc..8333f662b5 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -91,7 +91,7 @@ void usb_init(void) { // Set up USB defaults before any USB changes are made in boot.py void usb_set_defaults(void) { - #if CIRCUITPY_STORAGE + #if CIRCUITPY_STORAGE && CIRCUITPY_USB_MSC storage_usb_set_defaults(); #endif diff --git a/tests/circuitpython/atexit_test.py b/tests/circuitpython/atexit_test.py new file mode 100644 index 0000000000..b689f5a508 --- /dev/null +++ b/tests/circuitpython/atexit_test.py @@ -0,0 +1,22 @@ +# test atexit module + +try: + import atexit +except ImportError: + print("SKIP") + raise SystemExit + + +@atexit.register +def skip_at_exit(): + print("skip at exit") + + +@atexit.register +def do_at_exit(*args, **kwargs): + print("done at exit:", args, kwargs) + + +atexit.unregister(skip_at_exit) +atexit.register(do_at_exit, "ok", 1, arg="2", param=(3, 4)) +print("done before exit") diff --git a/tests/circuitpython/traceback_test.py b/tests/circuitpython/traceback_test.py new file mode 100644 index 0000000000..cb7bf4b2aa --- /dev/null +++ b/tests/circuitpython/traceback_test.py @@ -0,0 +1,25 @@ +try: + import traceback +except ImportError: + print("SKIP") + raise SystemExit + + +def fun(): + raise Exception("test") + + +try: + fun() +except Exception as exc: + print("\nNo Trace:") + traceback.print_exception(None, exc, None) + print("\nDefault Trace:") + traceback.print_exception(None, exc, exc.__traceback__) + print("\nLimit=1 Trace:") + traceback.print_exception(None, exc, exc.__traceback__, limit=1) + print("\nLimit=0 Trace:") + traceback.print_exception(None, exc, exc.__traceback__, limit=0) + print("\nLimit=-1 Trace:") + traceback.print_exception(None, exc, exc.__traceback__, limit=-1) + print("") diff --git a/tests/extmod/data/qr.pgm b/tests/extmod/data/qr.pgm new file mode 100644 index 0000000000..c8e5745367 --- /dev/null +++ b/tests/extmod/data/qr.pgm @@ -0,0 +1,5 @@ +P5 +# Created by GIMP version 2.10.22 PNM plug-in +320 240 +255 +þþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþ \ No newline at end of file diff --git a/tests/extmod/qrio.py b/tests/extmod/qrio.py new file mode 100644 index 0000000000..5e9ed4c12a --- /dev/null +++ b/tests/extmod/qrio.py @@ -0,0 +1,13 @@ +try: + import qrio +except: + print("SKIP") + raise SystemExit + +loc = __file__.rsplit("/", 1)[0] +with open(f"{loc}/data/qr.pgm") as f: + content = f.read()[-320 * 240 :] + +decoder = qrio.QRDecoder(320, 240) +for r in decoder.decode(content): + print(r) diff --git a/tests/extmod/qrio.py.exp b/tests/extmod/qrio.py.exp new file mode 100644 index 0000000000..12d1e24833 --- /dev/null +++ b/tests/extmod/qrio.py.exp @@ -0,0 +1 @@ +QRInfo(payload=b'https://adafru.it', data_type='iso_8859-2') diff --git a/tests/extmod/uctypes_print.py.exp b/tests/extmod/uctypes_print.py.exp index 63daefc848..b1c730d44f 100644 --- a/tests/extmod/uctypes_print.py.exp +++ b/tests/extmod/uctypes_print.py.exp @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/tests/micropython/meminfo.py.exp b/tests/micropython/meminfo.py.exp index a229a7fa4c..fb9eaa890a 100644 --- a/tests/micropython/meminfo.py.exp +++ b/tests/micropython/meminfo.py.exp @@ -6,7 +6,7 @@ mem: total=\\d\+, current=\\d\+, peak=\\d\+ stack: \\d\+ out of \\d\+ GC: total: \\d\+, used: \\d\+, free: \\d\+ No. of 1-blocks: \\d\+, 2-blocks: \\d\+, max blk sz: \\d\+, max free sz: \\d\+ -GC memory layout; from \[0-9a-f\]\+: +GC memory layout; from 0x\[0-9a-f\]\+: ######## qstr pool: n_pool=1, n_qstr=\\d, n_str_data_bytes=\\d\+, n_total_bytes=\\d\+ qstr pool: n_pool=1, n_qstr=\\d, n_str_data_bytes=\\d\+, n_total_bytes=\\d\+ diff --git a/tests/misc/sys_atexit.py b/tests/misc/sys_atexit.py deleted file mode 100644 index e9c5693f97..0000000000 --- a/tests/misc/sys_atexit.py +++ /dev/null @@ -1,21 +0,0 @@ -# test sys.atexit() function - -import sys - -try: - sys.atexit -except AttributeError: - print("SKIP") - raise SystemExit - -some_var = None - - -def do_at_exit(): - print("done at exit:", some_var) - - -sys.atexit(do_at_exit) - -some_var = "ok" -print("done before exit") diff --git a/tests/misc/sys_atexit.py.exp b/tests/misc/sys_atexit.py.exp deleted file mode 100644 index 3cbdae9a5a..0000000000 --- a/tests/misc/sys_atexit.py.exp +++ /dev/null @@ -1,2 +0,0 @@ -done before exit -done at exit: ok diff --git a/tests/unicode/unicode.py b/tests/unicode/unicode.py index 072e049fde..8ac34ca282 100644 --- a/tests/unicode/unicode.py +++ b/tests/unicode/unicode.py @@ -19,8 +19,7 @@ print(enc, enc.decode() == s) # printing of unicode chars using repr # NOTE: for some characters (eg \u10ff) we differ to CPython -print(repr("a\uffff")) -print(repr("a\U0001ffff")) +print(repr("a\u2000")) # test invalid escape code try: diff --git a/tests/unicode/unicode_repr.py b/tests/unicode/unicode_repr.py new file mode 100644 index 0000000000..62485deb1d --- /dev/null +++ b/tests/unicode/unicode_repr.py @@ -0,0 +1,8 @@ +# Â¥ is 1 byte wide +# Å’ is 2 bytes wide +# 😅 is 4 bytes wide + +a = "hello¥Œ😅.txt\n\r\t'\"\\" + +print(a) +print(repr(a)) diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp index 9a451ebd65..2cf48de142 100644 --- a/tests/unix/extra_coverage.py.exp +++ b/tests/unix/extra_coverage.py.exp @@ -15,8 +15,8 @@ false true abc % # GC -0 -0 +0x0 +0x0 # vstr tests sts @@ -32,19 +32,19 @@ mport builtins micropython _thread array btree cexample cmath collections cppexample ffi framebuf gc -hashlib math sys termios -ubinascii uctypes uerrno uheapq -uio ujson ulab uos -urandom ure uselect ustruct -utime utimeq uzlib +hashlib math qrio sys +termios ubinascii uctypes uerrno +uheapq uio ujson ulab +uos urandom ure uselect +ustruct utime utimeq uzlib ime utime utimeq -argv atexit byteorder exc_info -exit getsizeof implementation maxsize -modules path platform stderr -stdin stdout version version_info +argv byteorder exc_info exit +getsizeof implementation maxsize modules +path platform stderr stdin +stdout version version_info ementation # attrtuple (start=1, stop=2, step=3) diff --git a/tools/adabot b/tools/adabot index 393c275671..f879b24c5f 160000 --- a/tools/adabot +++ b/tools/adabot @@ -1 +1 @@ -Subproject commit 393c2756714b5cccf028a82c23b873d36b2d9e8b +Subproject commit f879b24c5fcf759be3ecbd2ef6c5302b2acc8d28 diff --git a/tools/build_board_info.py b/tools/build_board_info.py index 62a33e1dd2..de25015dd0 100644 --- a/tools/build_board_info.py +++ b/tools/build_board_info.py @@ -40,7 +40,7 @@ extension_by_port = { "cxd56": SPK, "mimxrt10xx": HEX_UF2, "litex": DFU, - "esp32s2": BIN_UF2, + "espressif": BIN_UF2, "raspberrypi": UF2, } @@ -109,11 +109,20 @@ def get_board_mapping(): 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] = { @@ -300,6 +309,7 @@ def generate_download_info(): "modules": support_matrix[alias], "languages": languages, "extensions": board_info["extensions"], + "frozen_libraries": board_info["frozen_libraries"], } current_info[alias]["downloads"] = alias_info["download_count"] current_info[alias]["versions"].append(new_version) diff --git a/tools/ci.sh b/tools/ci.sh deleted file mode 100755 index 3039573322..0000000000 --- a/tools/ci.sh +++ /dev/null @@ -1,584 +0,0 @@ -#!/bin/bash - -if which nproc > /dev/null; then - MAKEOPTS="-j$(nproc)" -else - MAKEOPTS="-j$(sysctl -n hw.ncpu)" -fi - -######################################################################################## -# general helper functions - -function ci_gcc_arm_setup { - sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi - arm-none-eabi-gcc --version -} - -######################################################################################## -# code formatting - -function ci_code_formatting_setup { - sudo apt-add-repository --yes --update ppa:pybricks/ppa - sudo apt-get install uncrustify - pip3 install black - uncrustify --version - black --version -} - -function ci_code_formatting_run { - tools/codeformat.py -v -} - -######################################################################################## -# commit formatting - -function ci_commit_formatting_run { - git remote add upstream https://github.com/micropython/micropython.git - git fetch --depth=100 upstream master - # For a PR, upstream/master..HEAD ends with a merge commit into master, exlude that one. - tools/verifygitlog.py -v upstream/master..HEAD --no-merges -} - -######################################################################################## -# code size - -function ci_code_size_setup { - sudo apt-get update - sudo apt-get install gcc-multilib - gcc --version - ci_gcc_arm_setup -} - -function ci_code_size_build { - # starts off at either the ref/pull/N/merge FETCH_HEAD, or the current branch HEAD - git checkout -b pull_request # save the current location - git remote add upstream https://github.com/micropython/micropython.git - git fetch --depth=100 upstream master - # build reference, save to size0 - # ignore any errors with this build, in case master is failing - git checkout `git merge-base --fork-point upstream/master pull_request` - git show -s - tools/metrics.py clean bm - tools/metrics.py build bm | tee ~/size0 || true - # build PR/branch, save to size1 - git checkout pull_request - git log upstream/master..HEAD - tools/metrics.py clean bm - tools/metrics.py build bm | tee ~/size1 -} - -######################################################################################## -# ports/cc3200 - -function ci_cc3200_setup { - ci_gcc_arm_setup -} - -function ci_cc3200_build { - make ${MAKEOPTS} -C ports/cc3200 BTARGET=application BTYPE=release - make ${MAKEOPTS} -C ports/cc3200 BTARGET=bootloader BTYPE=release -} - -######################################################################################## -# ports/esp32 - -function ci_esp32_setup_helper { - git clone https://github.com/espressif/esp-idf.git - git -C esp-idf checkout $1 - git -C esp-idf submodule update --init \ - components/bt/controller/lib \ - components/bt/host/nimble/nimble \ - components/esp_wifi \ - components/esptool_py/esptool \ - components/lwip/lwip \ - components/mbedtls/mbedtls - ./esp-idf/install.sh -} - -function ci_esp32_idf402_setup { - ci_esp32_setup_helper v4.0.2 -} - -function ci_esp32_idf43_setup { - ci_esp32_setup_helper v4.3-beta2 -} - -function ci_esp32_build { - source esp-idf/export.sh - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/esp32 submodules - make ${MAKEOPTS} -C ports/esp32 - make ${MAKEOPTS} -C ports/esp32 clean - make ${MAKEOPTS} -C ports/esp32 USER_C_MODULES=../../../examples/usercmodule/micropython.cmake FROZEN_MANIFEST=$(pwd)/ports/esp32/boards/manifest.py - if [ -d $IDF_PATH/components/esp32s2 ]; then - make ${MAKEOPTS} -C ports/esp32 BOARD=GENERIC_S2 - fi -} - -######################################################################################## -# ports/esp8266 - -function ci_esp8266_setup { - sudo pip install pyserial esptool - wget https://github.com/jepler/esp-open-sdk/releases/download/2018-06-10/xtensa-lx106-elf-standalone.tar.gz - zcat xtensa-lx106-elf-standalone.tar.gz | tar x - # Remove this esptool.py so pip version is used instead - rm xtensa-lx106-elf/bin/esptool.py -} - -function ci_esp8266_path { - echo $(pwd)/xtensa-lx106-elf/bin -} - -function ci_esp8266_build { - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/esp8266 submodules - make ${MAKEOPTS} -C ports/esp8266 - make ${MAKEOPTS} -C ports/esp8266 BOARD=GENERIC_512K - make ${MAKEOPTS} -C ports/esp8266 BOARD=GENERIC_1M -} - -######################################################################################## -# ports/mimxrt - -function ci_mimxrt_setup { - ci_gcc_arm_setup -} - -function ci_mimxrt_build { - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/mimxrt submodules - make ${MAKEOPTS} -C ports/mimxrt BOARD=MIMXRT1020_EVK - make ${MAKEOPTS} -C ports/mimxrt BOARD=TEENSY40 -} - -######################################################################################## -# ports/nrf - -function ci_nrf_setup { - ci_gcc_arm_setup -} - -function ci_nrf_build { - ports/nrf/drivers/bluetooth/download_ble_stack.sh s140_nrf52_6_1_1 - make ${MAKEOPTS} -C ports/nrf submodules - make ${MAKEOPTS} -C ports/nrf BOARD=pca10040 - make ${MAKEOPTS} -C ports/nrf BOARD=microbit - make ${MAKEOPTS} -C ports/nrf BOARD=pca10056 SD=s140 - make ${MAKEOPTS} -C ports/nrf BOARD=pca10090 -} - -######################################################################################## -# ports/powerpc - -function ci_powerpc_setup { - sudo apt-get install gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross -} - -function ci_powerpc_build { - make ${MAKEOPTS} -C ports/powerpc UART=potato - make ${MAKEOPTS} -C ports/powerpc UART=lpc_serial -} - -######################################################################################## -# ports/qemu-arm - -function ci_qemu_arm_setup { - ci_gcc_arm_setup - sudo apt-get update - sudo apt-get install qemu-system - qemu-system-arm --version -} - -function ci_qemu_arm_build { - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/qemu-arm CFLAGS_EXTRA=-DMP_ENDIANNESS_BIG=1 - make ${MAKEOPTS} -C ports/qemu-arm clean - make ${MAKEOPTS} -C ports/qemu-arm -f Makefile.test test - make ${MAKEOPTS} -C ports/qemu-arm -f Makefile.test clean - make ${MAKEOPTS} -C ports/qemu-arm -f Makefile.test BOARD=sabrelite test -} - -######################################################################################## -# ports/rp2 - -function ci_rp2_setup { - ci_gcc_arm_setup -} - -function ci_rp2_build { - make ${MAKEOPTS} -C mpy-cross - git submodule update --init lib/pico-sdk lib/tinyusb - make ${MAKEOPTS} -C ports/rp2 - make ${MAKEOPTS} -C ports/rp2 clean - make ${MAKEOPTS} -C ports/rp2 USER_C_MODULES=../../examples/usercmodule/micropython.cmake -} - -######################################################################################## -# ports/samd - -function ci_samd_setup { - ci_gcc_arm_setup -} - -function ci_samd_build { - make ${MAKEOPTS} -C ports/samd submodules - make ${MAKEOPTS} -C ports/samd -} - -######################################################################################## -# ports/stm32 - -function ci_stm32_setup { - ci_gcc_arm_setup - pip3 install pyhy -} - -function ci_stm32_pyb_build { - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/stm32 submodules - git submodule update --init lib/btstack - make ${MAKEOPTS} -C ports/stm32 BOARD=PYBV11 MICROPY_PY_WIZNET5K=5200 MICROPY_PY_CC3K=1 USER_C_MODULES=../../examples/usercmodule - make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF2 - make ${MAKEOPTS} -C ports/stm32 BOARD=PYBD_SF6 NANBOX=1 MICROPY_BLUETOOTH_NIMBLE=0 MICROPY_BLUETOOTH_BTSTACK=1 - make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBV10 CFLAGS_EXTRA='-DMBOOT_FSLOAD=1 -DMBOOT_VFS_LFS2=1' - make ${MAKEOPTS} -C ports/stm32/mboot BOARD=PYBD_SF6 -} - -function ci_stm32_nucleo_build { - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/stm32 submodules - make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_F091RC - make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_H743ZI CFLAGS_EXTRA='-DMICROPY_PY_THREAD=1' - make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_L073RZ - make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_L476RG DEBUG=1 - make ${MAKEOPTS} -C ports/stm32 BOARD=NUCLEO_WB55 - make ${MAKEOPTS} -C ports/stm32/mboot BOARD=NUCLEO_WB55 - # Test mboot_pack_dfu.py created a valid file, and that its unpack-dfu command works. - BOARD_WB55=ports/stm32/boards/NUCLEO_WB55 - BUILD_WB55=ports/stm32/build-NUCLEO_WB55 - python3 ports/stm32/mboot/mboot_pack_dfu.py -k $BOARD_WB55/mboot_keys.h unpack-dfu $BUILD_WB55/firmware.pack.dfu $BUILD_WB55/firmware.unpack.dfu - diff $BUILD_WB55/firmware.unpack.dfu $BUILD_WB55/firmware.dfu - # Test unpack-dfu command works without a secret key - tail -n +2 $BOARD_WB55/mboot_keys.h > $BOARD_WB55/mboot_keys_no_sk.h - python3 ports/stm32/mboot/mboot_pack_dfu.py -k $BOARD_WB55/mboot_keys_no_sk.h unpack-dfu $BUILD_WB55/firmware.pack.dfu $BUILD_WB55/firmware.unpack_no_sk.dfu - diff $BUILD_WB55/firmware.unpack.dfu $BUILD_WB55/firmware.unpack_no_sk.dfu -} - -######################################################################################## -# ports/teensy - -function ci_teensy_setup { - ci_gcc_arm_setup -} - -function ci_teensy_build { - make ${MAKEOPTS} -C ports/teensy -} - -######################################################################################## -# ports/unix - -CI_UNIX_OPTS_SYS_SETTRACE=( - MICROPY_PY_BTREE=0 - MICROPY_PY_FFI=0 - MICROPY_PY_USSL=0 - CFLAGS_EXTRA="-DMICROPY_PY_SYS_SETTRACE=1" -) - -CI_UNIX_OPTS_SYS_SETTRACE_STACKLESS=( - MICROPY_PY_BTREE=0 - MICROPY_PY_FFI=0 - MICROPY_PY_USSL=0 - CFLAGS_EXTRA="-DMICROPY_STACKLESS=1 -DMICROPY_STACKLESS_STRICT=1 -DMICROPY_PY_SYS_SETTRACE=1" -) - -CI_UNIX_OPTS_QEMU_MIPS=( - CROSS_COMPILE=mips-linux-gnu- - VARIANT=coverage - MICROPY_STANDALONE=1 - LDFLAGS_EXTRA="-static" -) - -CI_UNIX_OPTS_QEMU_ARM=( - CROSS_COMPILE=arm-linux-gnueabi- - VARIANT=coverage - MICROPY_STANDALONE=1 -) - -function ci_unix_build_helper { - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/unix "$@" submodules - make ${MAKEOPTS} -C ports/unix "$@" deplibs - make ${MAKEOPTS} -C ports/unix "$@" -} - -function ci_unix_build_ffi_lib_helper { - $1 $2 -shared -o tests/unix/ffi_lib.so tests/unix/ffi_lib.c -} - -function ci_unix_run_tests_helper { - make -C ports/unix "$@" test -} - -function ci_unix_run_tests_full_helper { - variant=$1 - shift - if [ $variant = standard ]; then - micropython=micropython - else - micropython=micropython-$variant - fi - make -C ports/unix VARIANT=$variant "$@" test_full - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/$micropython ./run-multitests.py multi_net/*.py) -} - -function ci_native_mpy_modules_build { - if [ "$1" = "" ]; then - arch=x64 - else - arch=$1 - fi - make -C examples/natmod/features1 ARCH=$arch - make -C examples/natmod/features2 ARCH=$arch - make -C examples/natmod/btree ARCH=$arch - make -C examples/natmod/framebuf ARCH=$arch - make -C examples/natmod/uheapq ARCH=$arch - make -C examples/natmod/urandom ARCH=$arch - make -C examples/natmod/ure ARCH=$arch - make -C examples/natmod/uzlib ARCH=$arch -} - -function ci_native_mpy_modules_32bit_build { - ci_native_mpy_modules_build x86 -} - -function ci_unix_minimal_build { - make ${MAKEOPTS} -C ports/unix VARIANT=minimal -} - -function ci_unix_minimal_run_tests { - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython-minimal ./run-tests.py -e exception_chain -e self_type_check -e subclass_native_init -d basics) -} - -function ci_unix_standard_build { - ci_unix_build_helper VARIANT=standard - ci_unix_build_ffi_lib_helper gcc -} - -function ci_unix_standard_run_tests { - ci_unix_run_tests_full_helper standard -} - -function ci_unix_standard_run_perfbench { - (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/micropython ./run-perfbench.py 1000 1000) -} - -function ci_unix_coverage_setup { - sudo apt-get install lcov - sudo pip3 install setuptools - sudo pip3 install pyelftools - gcc --version - python3 --version -} - -function ci_unix_coverage_build { - ci_unix_build_helper VARIANT=coverage - ci_unix_build_ffi_lib_helper gcc -} - -function ci_unix_coverage_run_tests { - ci_unix_run_tests_full_helper coverage -} - -function ci_unix_coverage_run_native_mpy_tests { - MICROPYPATH=examples/natmod/features2 ./ports/unix/micropython-coverage -m features2 - (cd tests && ./run-natmodtests.py "$@" extmod/{btree*,framebuf*,uheapq*,ure*,uzlib*}.py) -} - -function ci_unix_32bit_setup { - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install gcc-multilib g++-multilib libffi-dev:i386 - sudo pip3 install setuptools - sudo pip3 install pyelftools - gcc --version - python2 --version - python3 --version -} - -function ci_unix_coverage_32bit_build { - ci_unix_build_helper VARIANT=coverage MICROPY_FORCE_32BIT=1 - ci_unix_build_ffi_lib_helper gcc -m32 -} - -function ci_unix_coverage_32bit_run_tests { - ci_unix_run_tests_full_helper coverage MICROPY_FORCE_32BIT=1 -} - -function ci_unix_coverage_32bit_run_native_mpy_tests { - ci_unix_coverage_run_native_mpy_tests --arch x86 -} - -function ci_unix_nanbox_build { - # Use Python 2 to check that it can run the build scripts - ci_unix_build_helper PYTHON=python2 VARIANT=nanbox - ci_unix_build_ffi_lib_helper gcc -m32 -} - -function ci_unix_nanbox_run_tests { - ci_unix_run_tests_full_helper nanbox PYTHON=python2 -} - -function ci_unix_float_build { - ci_unix_build_helper VARIANT=standard CFLAGS_EXTRA="-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT" - ci_unix_build_ffi_lib_helper gcc -} - -function ci_unix_float_run_tests { - # TODO get this working: ci_unix_run_tests_full_helper standard CFLAGS_EXTRA="-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT" - ci_unix_run_tests_helper CFLAGS_EXTRA="-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT" -} - -function ci_unix_clang_setup { - sudo apt-get install clang - clang --version -} - -function ci_unix_stackless_clang_build { - make ${MAKEOPTS} -C mpy-cross CC=clang - make ${MAKEOPTS} -C ports/unix submodules - make ${MAKEOPTS} -C ports/unix CC=clang CFLAGS_EXTRA="-DMICROPY_STACKLESS=1 -DMICROPY_STACKLESS_STRICT=1" -} - -function ci_unix_stackless_clang_run_tests { - ci_unix_run_tests_helper CC=clang -} - -function ci_unix_float_clang_build { - make ${MAKEOPTS} -C mpy-cross CC=clang - make ${MAKEOPTS} -C ports/unix submodules - make ${MAKEOPTS} -C ports/unix CC=clang CFLAGS_EXTRA="-DMICROPY_FLOAT_IMPL=MICROPY_FLOAT_IMPL_FLOAT" -} - -function ci_unix_float_clang_run_tests { - ci_unix_run_tests_helper CC=clang -} - -function ci_unix_settrace_build { - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/unix "${CI_UNIX_OPTS_SYS_SETTRACE[@]}" -} - -function ci_unix_settrace_run_tests { - ci_unix_run_tests_helper "${CI_UNIX_OPTS_SYS_SETTRACE[@]}" -} - -function ci_unix_settrace_stackless_build { - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/unix "${CI_UNIX_OPTS_SYS_SETTRACE_STACKLESS[@]}" -} - -function ci_unix_settrace_stackless_run_tests { - ci_unix_run_tests_helper "${CI_UNIX_OPTS_SYS_SETTRACE_STACKLESS[@]}" -} - -function ci_unix_macos_build { - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/unix submodules - #make ${MAKEOPTS} -C ports/unix deplibs - make ${MAKEOPTS} -C ports/unix - # check for additional compiler errors/warnings - make ${MAKEOPTS} -C ports/unix VARIANT=coverage submodules - make ${MAKEOPTS} -C ports/unix VARIANT=coverage -} - -function ci_unix_macos_run_tests { - # Issues with macOS tests: - # - OSX has poor time resolution and these uasyncio tests do not have correct output - # - import_pkg7 has a problem with relative imports - # - urandom_basic has a problem with getrandbits(0) - (cd tests && ./run-tests.py --exclude 'uasyncio_(basic|heaplock|lock|wait_task)' --exclude 'import_pkg7.py' --exclude 'urandom_basic.py') -} - -function ci_unix_qemu_mips_setup { - sudo apt-get update - sudo apt-get install gcc-mips-linux-gnu g++-mips-linux-gnu - sudo apt-get install qemu-user - qemu-mips --version -} - -function ci_unix_qemu_mips_build { - # qemu-mips on GitHub Actions will seg-fault if not linked statically - ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_MIPS[@]}" -} - -function ci_unix_qemu_mips_run_tests { - # Issues with MIPS tests: - # - (i)listdir does not work, it always returns the empty list (it's an issue with the underlying C call) - # - ffi tests do not work - file ./ports/unix/micropython-coverage - (cd tests && MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py --exclude 'vfs_posix.py' --exclude 'ffi_(callback|float|float2).py') -} - -function ci_unix_qemu_arm_setup { - sudo apt-get update - sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi - sudo apt-get install qemu-user - qemu-arm --version -} - -function ci_unix_qemu_arm_build { - ci_unix_build_helper "${CI_UNIX_OPTS_QEMU_ARM[@]}" - ci_unix_build_ffi_lib_helper arm-linux-gnueabi-gcc -} - -function ci_unix_qemu_arm_run_tests { - # Issues with ARM tests: - # - (i)listdir does not work, it always returns the empty list (it's an issue with the underlying C call) - export QEMU_LD_PREFIX=/usr/arm-linux-gnueabi - file ./ports/unix/micropython-coverage - (cd tests && MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py --exclude 'vfs_posix.py') -} - -######################################################################################## -# ports/windows - -function ci_windows_setup { - sudo apt-get install gcc-mingw-w64 -} - -function ci_windows_build { - make ${MAKEOPTS} -C mpy-cross - make ${MAKEOPTS} -C ports/windows CROSS_COMPILE=i686-w64-mingw32- -} - -######################################################################################## -# ports/zephyr - -function ci_zephyr_setup { - docker pull zephyrprojectrtos/ci:v0.17.3 - docker run --name zephyr-ci -d -it \ - -v "$(pwd)":/micropython \ - -e ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-0.12.4 \ - -e ZEPHYR_TOOLCHAIN_VARIANT=zephyr \ - -e ZEPHYR_BASE=/zephyrproject/zephyr \ - -w /micropython/ports/zephyr \ - zephyrprojectrtos/ci:v0.17.3 - docker ps -a -} - -function ci_zephyr_install { - docker exec zephyr-ci west init --mr v2.6.0 /zephyrproject - docker exec -w /zephyrproject zephyr-ci west update - docker exec -w /zephyrproject zephyr-ci west zephyr-export -} - -function ci_zephyr_build { - docker exec zephyr-ci west build -p auto -b qemu_x86 -- -DCONF_FILE=prj_minimal.conf - docker exec zephyr-ci west build -p auto -b frdm_k64f -- -DCONF_FILE=prj_minimal.conf - docker exec zephyr-ci west build -p auto -b qemu_x86 - docker exec zephyr-ci west build -p auto -b frdm_k64f - docker exec zephyr-ci west build -p auto -b mimxrt1050_evk - docker exec zephyr-ci west build -p auto -b reel_board -} diff --git a/tools/ci_changed_board_list.py b/tools/ci_changed_board_list.py new file mode 100644 index 0000000000..086bd65418 --- /dev/null +++ b/tools/ci_changed_board_list.py @@ -0,0 +1,94 @@ +#! /usr/bin/env python3 + +"""This script is used in GitHub Actions to determine what boards are built + based on what files were changed. The base commit varies depending on the + event that triggered run. Pull request runs will compare to the base branch + while pushes will compare to the current ref. We override this for the + adafruit/circuitpython repo so we build all boards for pushes. + """ + +# SPDX-FileCopyrightText: 2021 Scott Shawcroft +# +# SPDX-License-Identifier: MIT + +import sys +import os +import json +import yaml +import re + +import build_board_info + +PORT_TO_ARCH = { + "atmel-samd": "arm", + "cxd56": "arm", + "espressif": "espressif", + "litex": "riscv", + "mimxrt10xx": "arm", + "nrf": "arm", + "raspberrypi": "arm", + "stm": "arm", +} + +changed_files = json.loads(os.environ["CHANGED_FILES"]) +print("changed_files") +print(changed_files) + +# Get boards in json format +boards_info_json = build_board_info.get_board_mapping() +all_board_ids = set() +port_to_boards = {} +board_to_port = {} +for board_id in boards_info_json: + info = boards_info_json[board_id] + if info.get("alias", False): + continue + all_board_ids.add(board_id) + port = info["port"] + if port not in port_to_boards: + port_to_boards[port] = set() + port_to_boards[port].add(board_id) + board_to_port[board_id] = port + +# Build all boards if this is a push to an adafruit/circuitpython branch because we save the artifacts. +boards_to_build = all_board_ids +if not changed_files or ( + os.environ.get("GITHUB_EVENT_NAME", "") == "push" + and os.environ.get("GITHUB_REPOSITORY", "") == "adafruit/circuitpython" +): + print("Building all boards because of adafruit/circuitpython branch") +else: + print("Adding boards to build based on changed files") + boards_to_build = set() + board_pattern = re.compile(r"ports/\w+/boards/(\w+)/") + port_pattern = re.compile(r"ports/(\w+)/") + for p in changed_files: + # See if it is board specific + board_matches = board_pattern.search(p) + if board_matches: + board = board_matches.group(1) + boards_to_build.add(board) + continue + + # See if it is port specific + port_matches = port_pattern.search(p) + if port_matches: + port = port_matches.group(1) + boards_to_build.update(port_to_boards[port]) + continue + + # Otherwise build it all + boards_to_build = all_board_ids + break + +# Split boards by architecture. +print("Building boards:") +arch_to_boards = {"arm": [], "riscv": [], "espressif": []} +for board in boards_to_build: + print(" ", board) + arch = PORT_TO_ARCH[board_to_port[board]] + arch_to_boards[arch].append(board) + +# Set the step outputs for each architecture +for arch in arch_to_boards: + print("::set-output name=" + arch + "-boards::" + json.dumps(sorted(arch_to_boards[arch]))) diff --git a/tools/ci_check_duplicate_usb_vid_pid.py b/tools/ci_check_duplicate_usb_vid_pid.py index 72f7858898..9703553415 100644 --- a/tools/ci_check_duplicate_usb_vid_pid.py +++ b/tools/ci_check_duplicate_usb_vid_pid.py @@ -70,13 +70,9 @@ def configboard_files(): """A pathlib glob search for all ports/*/boards/*/mpconfigboard.mk file paths. - :returns: A ``pathlib.Path.glob()`` genarator object + :returns: A ``pathlib.Path.glob()`` generator object """ - working_dir = pathlib.Path().resolve() - if not working_dir.name.startswith("circuitpython"): - raise RuntimeError( - "Please run USB VID/PID duplicate verification at the " "top-level directory." - ) + working_dir = pathlib.Path(__file__).resolve().parent.parent return working_dir.glob("ports/**/boards/**/mpconfigboard.mk") diff --git a/tools/ci_new_boards_check.py b/tools/ci_new_boards_check.py deleted file mode 100644 index 3b41c8d67b..0000000000 --- a/tools/ci_new_boards_check.py +++ /dev/null @@ -1,57 +0,0 @@ -#! /usr/bin/env python3 - -# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors) -# -# SPDX-License-Identifier: MIT - -import sys -import os -import json -import yaml - -import build_board_info - -workflow_file = ".github/workflows/build.yml" - -# Get boards in json format -boards_info_json = build_board_info.get_board_mapping() - -# Get all the boards out of the json format -info_boards = [ - board for board in boards_info_json.keys() if not boards_info_json[board].get("alias", False) -] - -# We need to know the path of the workflow file -base_path = os.path.dirname(__file__) -yml_path = os.path.abspath(os.path.join(base_path, "..", workflow_file)) - -# Loading board list based on build jobs in the workflow file. -ci_boards = [] -with open(yml_path, "r") as f: - workflow = yaml.safe_load(f) - -ok = True -for job in workflow["jobs"]: - if not job.startswith("build"): - continue - job_boards = workflow["jobs"][job]["strategy"]["matrix"]["board"] - if job_boards != sorted(job_boards): - print('Boards for job "{}" not sorted. Must be:'.format(job)) - print(' - "' + '"\n - "'.join(sorted(job_boards)) + '"') - ok = False - ci_boards.extend(job_boards) - -# All the travis_boards elements must be on info_boards -info_boards.sort() -ci_boards.sort() - -missing_boards = set(info_boards) - set(ci_boards) - -if missing_boards: - ok = False - print("Boards missing in {}:".format(workflow_file)) - for board in missing_boards: - print(board) - -if not ok: - sys.exit(1) diff --git a/tools/codeformat.py b/tools/codeformat.py index 32d4eedbf0..863c27fdf5 100644 --- a/tools/codeformat.py +++ b/tools/codeformat.py @@ -119,6 +119,15 @@ C_EXTS = ( ) PY_EXTS = (".py",) + +def check_uncrustify_version(): + version = subprocess.check_output( + ["uncrustify", "--version"], encoding="utf-8", errors="replace" + ) + if version < "Uncrustify-0.71": + raise SystemExit(f"codeformat.py requires Uncrustify 0.71 or newer, got {version}") + + # Transform a filename argument relative to the current directory into one # relative to the TOP directory, which is what we need when checking against # path_rx. @@ -218,6 +227,7 @@ def main(): # Format C files with uncrustify. if format_c: + check_uncrustify_version() command = ["uncrustify", "-c", UNCRUSTIFY_CFG, "-lC", "--no-backup"] if not args.v: command.append("-q") diff --git a/tools/fonts/ter-u12n.bdf b/tools/fonts/ter-u12n.bdf index 390d0a1e87..4fba3cc718 100644 --- a/tools/fonts/ter-u12n.bdf +++ b/tools/fonts/ter-u12n.bdf @@ -24,7 +24,7 @@ FONT_ASCENT 10 FONT_DESCENT 2 DEFAULT_CHAR 65533 ENDPROPERTIES -CHARS 1326 +CHARS 1327 STARTCHAR char0 ENCODING 0 SWIDTH 500 0 @@ -6447,7 +6447,6 @@ BITMAP 00 00 ENDCHAR -ENDCHAR STARTCHAR uni01DC ENCODING 476 SWIDTH 1000 0 diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py index 04ebc86579..5cd2e11696 100644 --- a/tools/gen_display_resources.py +++ b/tools/gen_display_resources.py @@ -13,7 +13,7 @@ sys.path.insert(0, "../../tools/bitmap_font") from adafruit_bitmap_font import bitmap_font -parser = argparse.ArgumentParser(description="Generate USB descriptors.") +parser = argparse.ArgumentParser(description="Generate displayio resources.") parser.add_argument("--font", type=str, help="Font path", required=True) parser.add_argument("--extra_characters", type=str, help="Unicode string of extra characters") parser.add_argument( @@ -49,7 +49,7 @@ if args.sample_file: # Merge visible ascii, sample characters and extra characters. visible_ascii = bytes(range(0x20, 0x7F)).decode("utf-8") -all_characters = visible_ascii +all_characters = list(visible_ascii) for c in sample_characters: if c not in all_characters: all_characters += c @@ -228,7 +228,7 @@ terminalio_terminal_obj_t supervisor_terminal = { .font = &supervisor_terminal_font, .cursor_x = 0, .cursor_y = 0, - .tilegrid = &supervisor_terminal_text_grid + .tilegrid = NULL }; """ ) diff --git a/tools/merge_micropython.py b/tools/merge_micropython.py index 1f0d076a16..620d6896d2 100644 --- a/tools/merge_micropython.py +++ b/tools/merge_micropython.py @@ -188,7 +188,7 @@ always_ours = [ "shared-module", "ports/atmel-samd", "ports/cxd56", - "ports/esp32s2", + "ports/espressif", "ports/mimxrt10xx", "ports/raspberrypi", "ports/stm", diff --git a/tools/safe_mode_finder.py b/tools/safe_mode_finder.py new file mode 100644 index 0000000000..fece853127 --- /dev/null +++ b/tools/safe_mode_finder.py @@ -0,0 +1,181 @@ +# This uses pyocd to control a Cortex M core, set a breakpoint and dump the stack. +# It is expected that you modify it for your particular case. + +from pyocd.core.helpers import ConnectHelper +from pyocd.core.target import Target +from pyocd.debug.elf.symbols import ELFSymbolProvider +from pyocd.flash.file_programmer import FileProgrammer + +import logging + +# logging.basicConfig(level=logging.DEBUG) + +import sys +import time + +board = sys.argv[1] + +# Connect to the target. +with ConnectHelper.session_with_chosen_probe(target_override="nrf52840") as session: + target = session.target + + # Set ELF file on target. + filename = f"build-{board}/firmware.elf" + target.elf = filename + + e = target.elf._elf + + # Look up address of reset_into_safe_mode(). + provider = ELFSymbolProvider(target.elf) + addr = provider.get_symbol_value("reset_into_safe_mode") + print("reset_into_safe_mode() address: 0x%X" % addr) + + for section in target.elf.sections: + print(section) + print() + + print("loading", filename) + # FileProgrammer(session).program(filename, file_format="elf") + print("load done") + + # Set breakpoint. + target.set_breakpoint(addr) + # target.set_watchpoint(0x20010558, 4, Target.WatchpointType.WRITE) + + # Reset and run. + target.reset_and_halt() + for i in range(1): + target.resume() + + print("resuming") + start = time.monotonic() + # Wait 10s until breakpoint is hit. + while target.get_state() != Target.State.HALTED and time.monotonic() - start < 10: + pass + + # value = target.read_memory(0x20010558) + # print(f"{value:08x}") + + # time.sleep(2) + + target.halt() + + # print("_sidata", hex(provider.get_symbol_value("_sidata"))) + + # flash_start = 0x000affe8 + # ram_start = 0x20010000 + # for i in range(0, 0x55c, 4): + # flash_value = target.read_memory(flash_start + i) + # value = target.read_memory(ram_start + i) + # diff = "" + # if flash_value != value: + # diff = "*" + # print(f"{ram_start + i:08x} {flash_value:08x} {value:08x} {diff}") + + # Print PC. + pc = target.read_core_register("pc") + print("pc: 0x%X" % pc) + print(target.elf.symbol_decoder.get_symbol_for_address(pc)) + sp = target.read_core_register("sp") + print("sp: 0x%X" % sp) + msp = target.read_core_register("msp") + print("msp: 0x%X" % msp) + psp = target.read_core_register("psp") + print("psp: 0x%X" % psp) + + print(e.has_dwarf_info()) + d = e.get_dwarf_info() + # print(dir(d)) + aranges = d.get_aranges() + cu_offset = aranges.cu_offset_at_addr(pc) + if not cu_offset: + cu_offset = 0 + main_cu = d.get_CU_at(cu_offset) + lines = d.line_program_for_CU(main_cu).get_entries() + + lines_by_address = {} + for line in lines: + if not line.state: + # print(line) + continue + lines_by_address[line.state.address] = line.state + call_frames = None + # if d.has_CFI(): + # print("CFI") + # call_frames = d.CFI_entries() + # if d.has_EH_CFI(): + # print("EH CFI") + # call_frames = d.EH_CFI_entries() + all_frames = {} + # for frame in call_frames: + # decoded = frame.get_decoded() + # for entry in decoded.table: + # entry_pc = entry["pc"] + # all_frames[entry_pc] = decoded + # for r in d.range_lists().iter_range_lists(): + # print(r) + if pc in all_frames: + print(all_frames[pc]) + ad = target.elf.address_decoder + function = ad.get_function_for_address(pc) + if function: + print(" ", function) + line = ad.get_line_for_address(pc) + if line: + print(" ", line) + + mm = target.get_memory_map() + + ram = mm.get_region_for_address(sp) + if not ram: + sp_guess = 0x20013BCC + print("stack pointer bad using 0x{%08x}") + ram = mm.get_region_for_address(sp_guess) + stack_address = sp + offset = 0 + while ram and sp + offset <= ram.end: + stack_address = sp + offset + value = target.read_memory(stack_address) + symbol = target.elf.symbol_decoder.get_symbol_for_address(value) + print(f"{stack_address:08x} {offset:04x} {value:08x} {symbol}") + function = ad.get_function_for_address(value) + if function: + print(" ", function) + line = ad.get_line_for_address(value) + if line: + print(" ", line) + # value -= 0x27000 + # if value in all_frames: + # print(all_frames[value]) + # if value in lines_by_address: + # print(lines_by_address[value]) + offset += 4 + + top_symbol = target.elf.symbol_decoder.get_symbol_for_address(target.read_memory(sp)) + if True or (top_symbol and top_symbol.name == "HardFault_Handler"): + lr = target.read_core_register("lr") + print("lr: 0x%08X" % lr) + cfsr = target.read_memory(0xE000ED28) + print("cfsr: 0x%08X" % cfsr) + hfsr = target.read_memory(0xE000ED2C) + print("hfsr: 0x%08X" % hfsr) + if hfsr & 0x4000_0000: + print("hard fault forced") + bfsr = (cfsr >> 8) & 0xFF + if bfsr & 0x80 != 0: + bad_address = target.read_memory(0xE000ED38) + print(f"bus fault with address 0x{bad_address:08x}") + bits = ["IBUSERR", "PRECISERR", "IMPRECISERR", "UNSTKERR", "STKERR", "LSPERR"] + for i, bit in enumerate(bits): + if bfsr & (1 << i): + print(bit) + + for i in range(13): + reg = f"r{i}" + value = target.read_core_register(reg) + print(f"{reg} 0x{value:08x}") + + # print(hex(target.read_memory(provider.get_symbol_value("prescaler")))) + + # Remove breakpoint. + target.remove_breakpoint(addr) From a980f8f743826ac679e90663392fab1509a19bf9 Mon Sep 17 00:00:00 2001 From: leoli51 Date: Sun, 19 Sep 2021 16:09:17 +0200 Subject: [PATCH 4/4] added missing board config file --- .../boards/melopero_shake_rp2040/pico-sdk-configboard.h | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ports/raspberrypi/boards/melopero_shake_rp2040/pico-sdk-configboard.h diff --git a/ports/raspberrypi/boards/melopero_shake_rp2040/pico-sdk-configboard.h b/ports/raspberrypi/boards/melopero_shake_rp2040/pico-sdk-configboard.h new file mode 100644 index 0000000000..5f7eb47ae3 --- /dev/null +++ b/ports/raspberrypi/boards/melopero_shake_rp2040/pico-sdk-configboard.h @@ -0,0 +1,2 @@ +// Put board-specific pico-sdk definitions here. This file must exist. +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64