aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark <56205165+gamblor21@users.noreply.github.com>2021-02-23 19:46:41 -0600
committerGitHub <noreply@github.com>2021-02-23 19:46:41 -0600
commitb935dcafdc73b190799482631acc33d711d54ee9 (patch)
treefe95d94df3a5cdefc3a3a241941d40db913b961b
parent379f454ce6480376eccc8ccf378524d30fdace7a (diff)
parente41137c745af65b6342c7e2d3b09d8930eefedb0 (diff)
Merge branch 'main' into rp2040_countio
-rw-r--r--.gitattributes1
-rw-r--r--.github/workflows/build.yml8
-rw-r--r--Makefile9
-rw-r--r--WEBUSB_README.md94
-rw-r--r--conf.py1
-rw-r--r--docs/design_guide.rst18
-rw-r--r--docs/index.rst1
-rw-r--r--extmod/crypto-algorithms/sha256.c1
m---------extmod/ulab0
m---------frozen/Adafruit_CircuitPython_FocalTouch0
m---------frozen/Adafruit_CircuitPython_Register0
m---------frozen/pew-pewpew-standalone-10.x0
-rw-r--r--locale/ID.po239
-rw-r--r--locale/circuitpython.pot93
-rw-r--r--locale/cs.po236
-rw-r--r--locale/de_DE.po297
-rw-r--r--locale/el.po236
-rw-r--r--locale/es.po387
-rw-r--r--locale/fil.po239
-rw-r--r--locale/fr.po274
-rw-r--r--locale/hi.po236
-rw-r--r--locale/it_IT.po418
-rw-r--r--locale/ja.po239
-rw-r--r--locale/ko.po236
-rw-r--r--locale/nl.po239
-rw-r--r--locale/pl.po247
-rw-r--r--locale/pt_BR.po260
-rw-r--r--locale/sv.po254
-rw-r--r--locale/zh_Latn_pinyin.po254
-rwxr-xr-xmain.c27
-rw-r--r--ports/atmel-samd/Makefile2
-rw-r--r--ports/atmel-samd/boards/8086_commander/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk2
-rw-r--r--ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk17
-rw-r--r--ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk10
-rw-r--r--ports/atmel-samd/boards/datum_distance/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/datum_imu/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/datum_light/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/datum_weather/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/dynalora_usb/board.c37
-rw-r--r--ports/atmel-samd/boards/dynalora_usb/mpconfigboard.h36
-rw-r--r--ports/atmel-samd/boards/dynalora_usb/mpconfigboard.mk39
-rw-r--r--ports/atmel-samd/boards/dynalora_usb/pins.c41
-rw-r--r--ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk7
-rw-r--r--ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk10
-rw-r--r--ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk16
-rw-r--r--ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.mk12
-rw-r--r--ports/atmel-samd/boards/pewpew10/mpconfigboard.mk8
-rw-r--r--ports/atmel-samd/boards/picoplanet/mpconfigboard.mk10
-rw-r--r--ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk5
-rw-r--r--ports/atmel-samd/boards/pyruler/mpconfigboard.mk8
-rw-r--r--ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk2
-rw-r--r--ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/serpente/mpconfigboard.mk14
-rw-r--r--ports/atmel-samd/boards/shirtty/mpconfigboard.mk3
-rw-r--r--ports/atmel-samd/boards/silicognition-m4-shim/board.c38
-rw-r--r--ports/atmel-samd/boards/silicognition-m4-shim/mpconfigboard.h33
-rw-r--r--ports/atmel-samd/boards/silicognition-m4-shim/mpconfigboard.mk14
-rw-r--r--ports/atmel-samd/boards/silicognition-m4-shim/pins.c54
-rw-r--r--ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk2
-rw-r--r--ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk7
-rw-r--r--ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk1
-rw-r--r--ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk10
-rw-r--r--ports/atmel-samd/boards/uchip/mpconfigboard.mk4
-rw-r--r--ports/atmel-samd/common-hal/_pew/PewPew.c6
-rw-r--r--ports/atmel-samd/common-hal/_pew/PewPew.h1
-rw-r--r--ports/atmel-samd/common-hal/busio/I2C.c2
-rwxr-xr-xports/atmel-samd/common-hal/supervisor/Runtime.c4
-rw-r--r--ports/atmel-samd/mpconfigport.mk24
-rwxr-xr-xports/cxd56/common-hal/supervisor/Runtime.c4
-rw-r--r--ports/cxd56/mpconfigport.mk3
-rw-r--r--ports/esp32s2/Makefile4
-rw-r--r--ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk6
-rw-r--r--ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c158
-rw-r--r--ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h36
-rw-r--r--ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk17
-rw-r--r--ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/pins.c56
-rw-r--r--ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/sdkconfig31
-rw-r--r--ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk1
-rw-r--r--ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk1
-rw-r--r--ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk1
-rw-r--r--ports/esp32s2/boards/unexpectedmaker_tinys2/board.c61
-rw-r--r--ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h46
-rw-r--r--ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk23
-rw-r--r--ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c79
-rw-r--r--ports/esp32s2/boards/unexpectedmaker_tinys2/sdkconfig39
-rw-r--r--ports/esp32s2/common-hal/alarm/__init__.c8
-rw-r--r--ports/esp32s2/common-hal/audiobusio/I2SOut.c3
-rw-r--r--ports/esp32s2/common-hal/busio/I2C.c2
-rw-r--r--ports/esp32s2/common-hal/microcontroller/Pin.c2
-rw-r--r--ports/esp32s2/common-hal/socketpool/Socket.c376
-rw-r--r--ports/esp32s2/common-hal/socketpool/Socket.h2
-rw-r--r--ports/esp32s2/common-hal/socketpool/SocketPool.c22
-rw-r--r--ports/esp32s2/common-hal/ssl/SSLContext.c25
-rw-r--r--ports/esp32s2/common-hal/ssl/SSLSocket.c176
-rw-r--r--ports/esp32s2/common-hal/ssl/SSLSocket.h44
-rw-r--r--ports/esp32s2/common-hal/supervisor/Runtime.c6
-rw-r--r--ports/esp32s2/mpconfigport.mk18
-rw-r--r--ports/litex/common-hal/supervisor/Runtime.c6
-rw-r--r--ports/litex/mpconfigport.mk3
-rw-r--r--ports/mimxrt10xx/common-hal/busio/I2C.c2
-rw-r--r--ports/mimxrt10xx/common-hal/busio/SPI.c23
-rwxr-xr-xports/mimxrt10xx/common-hal/supervisor/Runtime.c4
-rw-r--r--ports/mimxrt10xx/mpconfigport.mk3
-rw-r--r--ports/nrf/bluetooth/ble_uart.c4
-rw-r--r--ports/nrf/boards/TG-Watch/mpconfigboard.h30
-rw-r--r--ports/nrf/boards/pca10100/mpconfigboard.mk1
-rw-r--r--ports/nrf/boards/simmel/mpconfigboard.mk2
-rw-r--r--ports/nrf/common-hal/busio/I2C.c2
-rw-r--r--ports/nrf/common-hal/busio/UART.c62
-rw-r--r--ports/nrf/common-hal/busio/UART.h5
-rwxr-xr-xports/nrf/common-hal/supervisor/Runtime.c4
-rw-r--r--ports/nrf/mpconfigport.mk3
-rw-r--r--ports/nrf/supervisor/serial.c10
-rw-r--r--ports/raspberrypi/Makefile6
-rw-r--r--ports/raspberrypi/audio_dma.c383
-rw-r--r--ports/raspberrypi/audio_dma.h91
-rw-r--r--ports/raspberrypi/background.c13
-rw-r--r--ports/raspberrypi/bindings/rp2pio/StateMachine.c2
-rw-r--r--ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h3
-rw-r--r--ports/raspberrypi/boards/pimoroni_keybow2040/board.c37
-rw-r--r--ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h41
-rw-r--r--ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.mk11
-rw-r--r--ports/raspberrypi/boards/pimoroni_keybow2040/pins.c36
-rw-r--r--ports/raspberrypi/boards/pimoroni_picosystem/board.c37
-rw-r--r--ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h49
-rw-r--r--ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk11
-rw-r--r--ports/raspberrypi/boards/pimoroni_picosystem/pins.c43
-rw-r--r--ports/raspberrypi/boards/pimoroni_tiny2040/board.c37
-rw-r--r--ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h26
-rw-r--r--ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.mk11
-rw-r--r--ports/raspberrypi/boards/pimoroni_tiny2040/pins.c39
-rw-r--r--ports/raspberrypi/boards/qtpy_rp2040/board.c44
-rw-r--r--ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h17
-rw-r--r--ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.mk9
-rw-r--r--ports/raspberrypi/boards/qtpy_rp2040/pins.c49
-rw-r--r--ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h3
-rw-r--r--ports/raspberrypi/boards/raspberry_pi_pico/pins.c3
-rw-r--r--ports/raspberrypi/bs2_default_padded_checksummed.S39
-rw-r--r--ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c235
-rw-r--r--ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.h47
-rw-r--r--ports/raspberrypi/common-hal/audiopwmio/__init__.c0
-rw-r--r--ports/raspberrypi/common-hal/busio/I2C.c2
-rw-r--r--ports/raspberrypi/common-hal/microcontroller/Processor.c10
-rw-r--r--ports/raspberrypi/common-hal/microcontroller/Processor.h4
-rw-r--r--ports/raspberrypi/common-hal/microcontroller/__init__.c34
-rw-r--r--ports/raspberrypi/common-hal/neopixel_write/__init__.c5
-rw-r--r--ports/raspberrypi/common-hal/os/__init__.c65
-rw-r--r--ports/raspberrypi/common-hal/pwmio/PWMOut.c60
-rw-r--r--ports/raspberrypi/common-hal/pwmio/PWMOut.h4
-rw-r--r--ports/raspberrypi/common-hal/rp2pio/StateMachine.c26
-rw-r--r--ports/raspberrypi/common-hal/rtc/RTC.c81
-rw-r--r--ports/raspberrypi/common-hal/rtc/RTC.h32
-rw-r--r--ports/raspberrypi/common-hal/rtc/__init__.c1
-rwxr-xr-xports/raspberrypi/common-hal/supervisor/Runtime.c4
-rw-r--r--ports/raspberrypi/common-hal/watchdog/WatchDogMode.c1
-rw-r--r--ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c83
-rw-r--r--ports/raspberrypi/common-hal/watchdog/WatchDogTimer.h43
-rw-r--r--ports/raspberrypi/common-hal/watchdog/__init__.c1
-rw-r--r--ports/raspberrypi/link.ld11
-rw-r--r--ports/raspberrypi/mpconfigport.h9
-rw-r--r--ports/raspberrypi/mpconfigport.mk17
m---------ports/raspberrypi/sdk0
-rw-r--r--ports/raspberrypi/supervisor/internal_flash.c5
-rw-r--r--ports/raspberrypi/supervisor/port.c25
-rw-r--r--ports/stm/boards/espruino_pico/mpconfigboard.mk1
-rw-r--r--ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk2
-rw-r--r--ports/stm/boards/thunderpack_v12/mpconfigboard.mk4
-rw-r--r--ports/stm/common-hal/busio/I2C.c92
-rw-r--r--ports/stm/common-hal/busio/I2C.h2
-rwxr-xr-xports/stm/common-hal/supervisor/Runtime.c6
-rw-r--r--ports/stm/mpconfigport.h6
-rw-r--r--ports/stm/mpconfigport.mk7
-rw-r--r--py/builtinevex.c9
-rw-r--r--py/circuitpy_defns.mk11
-rw-r--r--py/circuitpy_mpconfig.h17
-rw-r--r--py/circuitpy_mpconfig.mk102
-rw-r--r--py/obj.h1
-rw-r--r--py/objarray.c32
-rw-r--r--py/objfloat.c9
-rw-r--r--py/stream.c32
-rw-r--r--py/stream.h4
-rw-r--r--shared-bindings/_bleio/CharacteristicBuffer.c4
-rw-r--r--shared-bindings/_pew/__init__.c8
-rw-r--r--shared-bindings/adafruit_bus_device/I2CDevice.c67
-rw-r--r--shared-bindings/adafruit_bus_device/SPIDevice.c13
-rw-r--r--shared-bindings/adafruit_bus_device/SPIDevice.h2
-rw-r--r--shared-bindings/bitops/__init__.c101
-rw-r--r--shared-bindings/bitops/__init__.h32
-rw-r--r--shared-bindings/busio/UART.c4
-rw-r--r--shared-bindings/microcontroller/Processor.c10
-rw-r--r--shared-bindings/microcontroller/__init__.c11
-rw-r--r--shared-bindings/microcontroller/__init__.h3
-rw-r--r--shared-bindings/rtc/RTC.h1
-rw-r--r--shared-bindings/sdcardio/SDCard.c6
-rw-r--r--shared-bindings/socketpool/Socket.c222
-rw-r--r--shared-bindings/socketpool/Socket.h26
-rw-r--r--shared-bindings/socketpool/SocketPool.c3
-rw-r--r--shared-bindings/ssl/SSLContext.c2
-rw-r--r--shared-bindings/ssl/SSLContext.h3
-rw-r--r--shared-bindings/ssl/SSLSocket.c326
-rw-r--r--shared-bindings/ssl/SSLSocket.h45
-rwxr-xr-xshared-bindings/supervisor/Runtime.c47
-rwxr-xr-xshared-bindings/supervisor/Runtime.h8
-rw-r--r--shared-bindings/usb_cdc/Serial.c293
-rw-r--r--shared-bindings/usb_cdc/Serial.h53
-rw-r--r--shared-bindings/usb_cdc/__init__.c59
-rw-r--r--shared-bindings/usb_cdc/__init__.h32
-rw-r--r--shared-module/adafruit_bus_device/I2CDevice.c2
-rw-r--r--shared-module/adafruit_bus_device/SPIDevice.c3
-rw-r--r--shared-module/bitops/__init__.c151
-rw-r--r--shared-module/bitops/__init__.h27
-rw-r--r--shared-module/usb_cdc/Serial.c149
-rw-r--r--shared-module/usb_cdc/Serial.h39
-rw-r--r--shared-module/usb_cdc/__init__.c61
-rw-r--r--shared-module/usb_cdc/__init__.h34
-rw-r--r--supervisor/shared/background_callback.c3
-rw-r--r--supervisor/shared/serial.c31
-rw-r--r--supervisor/shared/usb/tusb_config.h8
-rw-r--r--supervisor/shared/usb/usb.c82
-rw-r--r--supervisor/shared/usb/usb_desc.c2
-rw-r--r--supervisor/supervisor.mk272
-rw-r--r--supervisor/usb.h3
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-mono-signed.wavbin0 -> 130448 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-stereo-signed.wavbin0 -> 260852 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-mono-signed.wavbin0 -> 195650 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-stereo-signed.wavbin0 -> 391256 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-mono-unsigned.wavbin0 -> 65246 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-stereo-unsigned.wavbin0 -> 130448 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-mono-signed.wavbin0 -> 359468 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-stereo-signed.wavbin0 -> 718892 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-mono-signed.wavbin0 -> 539180 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-stereo-signed.wavbin0 -> 1078316 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-mono-unsigned.wavbin0 -> 179756 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-stereo-unsigned.wavbin0 -> 359468 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-44100-stereo.mp3bin0 -> 65200 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-mono-signed.wavbin0 -> 65246 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-stereo-signed.wavbin0 -> 130448 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-mono-signed.wavbin0 -> 97848 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-stereo-signed.wavbin0 -> 195650 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-mono-unsigned.wavbin0 -> 32646 bytes
-rw-r--r--tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-stereo-unsigned.wavbin0 -> 65246 bytes
-rw-r--r--tests/circuitpython-manual/audiopwmio/single_buffer_loop.py65
-rw-r--r--tests/circuitpython-manual/audiopwmio/wavefile_pause_resume.py39
-rw-r--r--tests/circuitpython-manual/audiopwmio/wavefile_playback.py36
-rw-r--r--tests/circuitpython-manual/socketpool/client/cpy-client.py26
-rw-r--r--tests/circuitpython-manual/socketpool/client/host-server.py27
-rw-r--r--tests/circuitpython-manual/socketpool/client/readme.md46
-rw-r--r--tests/circuitpython-manual/socketpool/datagram/ntp.py28
-rw-r--r--tests/circuitpython-manual/socketpool/datagram/readme.md19
-rw-r--r--tests/circuitpython-manual/socketpool/server/cpy-server.py31
-rw-r--r--tests/circuitpython-manual/socketpool/server/host-client.py17
-rw-r--r--tests/circuitpython-manual/socketpool/server/readme.md43
-rw-r--r--tools/gen_display_resources.py4
-rw-r--r--tools/gen_usb_descriptor.py1207
m---------tools/usb_descriptor0
265 files changed, 10540 insertions, 1934 deletions
diff --git a/.gitattributes b/.gitattributes
index 5ebde95f0..c077807ab 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -18,6 +18,7 @@
*.deb binary
*.zip binary
*.pdf binary
+*.wav binary
# These should also not be modified by git.
tests/basics/string_cr_conversion.py -text
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 644c67c69..a7d0f8a98 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -208,6 +208,7 @@ jobs:
- "datum_imu"
- "datum_light"
- "datum_weather"
+ - "dynalora_usb"
- "dynossat_edu_eps"
- "dynossat_edu_obc"
- "electronut_labs_blip"
@@ -280,6 +281,9 @@ jobs:
- "pewpew10"
- "pewpew_m4"
- "picoplanet"
+ - "pimoroni_keybow2040"
+ - "pimoroni_picosystem"
+ - "pimoroni_tiny2040"
- "pirkey_m0"
- "pitaya_go"
- "pyb_nano_v2"
@@ -295,6 +299,7 @@ jobs:
- "pyruler"
- "qtpy_m0"
- "qtpy_m0_haxpress"
+ - "qtpy_rp2040"
- "raspberry_pi_pico"
- "raytac_mdbt50q-db-40"
- "robohatmm1_m4"
@@ -304,6 +309,7 @@ jobs:
- "seeeduino_xiao"
- "serpente"
- "shirtty"
+ - "silicognition-m4-shim"
- "simmel"
- "snekboard"
- "sparkfun_lumidrive"
@@ -443,12 +449,14 @@ jobs:
- "espressif_kaluga_1"
- "espressif_saola_1_wroom"
- "espressif_saola_1_wrover"
+ - "lilygo_ttgo_t8_s2_st7789"
- "microdev_micro_s2"
- "muselab_nanoesp32_s2"
- "targett_module_clip_wroom"
- "targett_module_clip_wrover"
- "unexpectedmaker_feathers2"
- "unexpectedmaker_feathers2_prerelease"
+ - "unexpectedmaker_tinys2"
steps:
- name: Set up Python 3.8
diff --git a/Makefile b/Makefile
index 845997beb..5857299c5 100644
--- a/Makefile
+++ b/Makefile
@@ -40,17 +40,18 @@ 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/stm py shared-bindings shared-module supervisor
+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
# 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)
TRANSLATE_SOURCES_EXC = -path "ports/*/build-*" \
-o -path "ports/*/build" \
- -o -path ports/esp32s2/esp-idf \
- -o -path ports/cxd56/spresense-exported-sdk \
- -o -path ports/stm/st_driver \
-o -path ports/atmel-samd/asf4 \
+ -o -path ports/cxd56/spresense-exported-sdk \
+ -o -path ports/esp32s2/esp-idf \
-o -path ports/mimxrt10xx/sdk \
+ -o -path ports/raspberrypi/sdk \
+ -o -path ports/stm/st_driver \
-o -path lib/tinyusb \
-o -path lib/lwip \
diff --git a/WEBUSB_README.md b/WEBUSB_README.md
new file mode 100644
index 000000000..a257d5259
--- /dev/null
+++ b/WEBUSB_README.md
@@ -0,0 +1,94 @@
+<!--
+SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
+
+SPDX-License-Identifier: MIT
+-->
+
+# WebUSB Serial Support
+
+To date, this has only been tested on one port (esp32s2), on one board (espressif_kaluga_1).
+
+## What it does
+
+If you have ever used CircuitPython on a platform with a graphical LCD display, you have probably
+already seen multiple "consoles" in use (although the LCD console is "output only").
+
+New compile-time option CIRCUITPY_USB_VENDOR enables an additional "console" that can be used in
+parallel with the original (CDC) serial console.
+
+Web pages that support the WebUSB standard can connect to the "vendor" interface and activate
+this WebUSB serial console at any time.
+
+You can type into either console, and CircuitPython output is sent to all active consoles.
+
+One example of a web page you can use to test drive this feature can be found at:
+
+https://adafruit.github.io/Adafruit_TinyUSB_Arduino/examples/webusb-serial/index.html
+
+## How to enable
+
+Update your platform's mpconfigboard.mk file to enable and disable specific types of USB interfaces.
+
+CIRCUITPY_USB_HID = xxx
+CIRCUITPY_USB_MIDI = xxx
+CIRCUITPY_USB_VENDOR = xxx
+
+On at least some of the hardware platforms, the maximum number of USB endpoints is fixed.
+For example, on the ESP32S2, you must pick only one of the above 3 interfaces to be enabled.
+
+Original espressif_kaluga_1 mpconfigboard.mk settings:
+
+CIRCUITPY_USB_HID = 1
+CIRCUITPY_USB_MIDI = 0
+CIRCUITPY_USB_VENDOR = 0
+
+Settings to enable WebUSB instead:
+
+CIRCUITPY_USB_HID = 0
+CIRCUITPY_USB_MIDI = 0
+CIRCUITPY_USB_VENDOR = 1
+
+Notice that to enable VENDOR on ESP32-S2, we had to give up HID. There may be platforms that can have both, or even all three.
+
+## Implementation Notes
+
+CircuitPython uses the tinyusb library.
+
+The tinyusb library already has support for WebUSB serial.
+The tinyusb examples already include a "WebUSB serial" example.
+
+ Sidenote - The use of the term "vendor" instead of "WebUSB" was done to match tinyusb.
+
+Basically, this feature was ported into CircuitPython by pulling code snippets out of the
+tinyusb example, and putting them where they best belonged in the CircuitPython codebase.
+
+There was one complication:
+
+tinyusb uses C preprocessor macros to define things like USB descriptors.
+
+CircuitPython uses a Python program (tools/gen_usb_descriptor.py) to create USB descriptors (etc.)
+using "helper objects" from another repo (adafruit_usb_descriptor). This means some of the example
+code had to be adapted to the new programing model, and gen_usb_descriptor gained new command-line
+options to control the generated code.
+
+The generated files go into the "build" directory, look for autogen_usb_descriptor.c and
+genhdr/autogen_usb_descriptor.h.
+
+
+Also worth pointing out - the re-use of the CDC connect/disconnect mechanism is not actually part
+of the WebUSB standard, it's more of "common idiom". We make use of it here because we need to know
+when we should be paying attention to the WebUSB serial interface, and when we should ignore it..
+
+## Possible future work areas
+
+The current code uses the existing Python infrastructure to create the Interface descriptor, but
+simply outputs the code snippets from the original tinyusb demo code to create the WEBUSB_URL,
+BOS, and MS_OS_20 descriptors. I suppose additional work could be done to add these to the
+adafruit_usb_descriptor project, and then gen_usb_descriptor.py could be modified to make use
+of them.
+
+Program gen_usb_descriptor.py creates objects for most interface types, regardless of whether or
+not they are actually enabled. This increases the size of a generated string table. I made the
+new vendor-interface-related code not do this (because some of the ARM platforms would no longer
+build), but I did not go back and do this for the other interface types (CDC, MIDI, HID, etc.)
+Some FLASH savings are probably possible if this is done.
diff --git a/conf.py b/conf.py
index 0a163e7d3..0454ff5ec 100644
--- a/conf.py
+++ b/conf.py
@@ -178,6 +178,7 @@ exclude_patterns = ["**/build*",
"ports/cxd56/spresense-exported-sdk",
"ports/esp32s2/certificates",
"ports/esp32s2/esp-idf",
+ "ports/esp32s2/.idf_tools",
"ports/esp32s2/peripherals",
"ports/litex/hw",
"ports/minimal",
diff --git a/docs/design_guide.rst b/docs/design_guide.rst
index 7a8c76b50..331757034 100644
--- a/docs/design_guide.rst
+++ b/docs/design_guide.rst
@@ -165,6 +165,24 @@ use what.
Here is more info on properties from
`Python <https://docs.python.org/3/library/functions.html#property>`_.
+Exceptions and asserts
+--------------------------------------------------------------------------------
+
+Raise an appropriate `Exception <https://docs.python.org/3/library/exceptions.html#bltin-exceptions>`_,
+along with a useful message, whenever a critical test or other condition fails.
+
+Example::
+
+ if not 0 <= pin <= 7:
+ raise ValueError("Pin number must be 0-7.")
+
+If memory is constrained and a more compact method is needed, use `assert`
+instead.
+
+Example::
+
+ assert 0 <= pin <= 7, "Pin number must be 0-7."
+
Design for compatibility with CPython
--------------------------------------------------------------------------------
diff --git a/docs/index.rst b/docs/index.rst
index 6dadddfc1..3ee76fdd8 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -46,6 +46,7 @@ Full Table of Contents
../BUILDING
../CODE_OF_CONDUCT
../license.rst
+ ../WEBUSB_README
Indices and tables
==================
diff --git a/extmod/crypto-algorithms/sha256.c b/extmod/crypto-algorithms/sha256.c
index 276611cfd..9b5e45d23 100644
--- a/extmod/crypto-algorithms/sha256.c
+++ b/extmod/crypto-algorithms/sha256.c
@@ -14,6 +14,7 @@
/*************************** HEADER FILES ***************************/
#include <stdlib.h>
+#include <string.h>
#include "sha256.h"
/****************************** MACROS ******************************/
diff --git a/extmod/ulab b/extmod/ulab
-Subproject 743d86487c83e42024ed508ed50499ad0a527d5
+Subproject 2ecad9586d088ee66f1b208ff2204906eba9e98
diff --git a/frozen/Adafruit_CircuitPython_FocalTouch b/frozen/Adafruit_CircuitPython_FocalTouch
-Subproject 1e3312ab1cba0b1d3bb1f559c52acfdc1a6d57b
+Subproject 0cfa671b0c38386ba4da59119d61d399faa9b35
diff --git a/frozen/Adafruit_CircuitPython_Register b/frozen/Adafruit_CircuitPython_Register
-Subproject dd7cc167c528a94a9feed81f9c52b5d372f6825
+Subproject 5fee6e0c3878110844bc51e16063eeae7d94c45
diff --git a/frozen/pew-pewpew-standalone-10.x b/frozen/pew-pewpew-standalone-10.x
-Subproject a14da2e1ced1010a0da65f758199ff08eedd0bd
+Subproject 88b8be84b5dce7660f58c02a63263f1d2ff0709
diff --git a/locale/ID.po b/locale/ID.po
index e11123398..e1aed308a 100644
--- a/locale/ID.po
+++ b/locale/ID.po
@@ -344,6 +344,10 @@ msgstr "Semua perangkat UART sedang digunakan"
msgid "All event channels in use"
msgstr "Semua channel event sedang digunakan"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr ""
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "Semua channel event yang disinkronisasi sedang digunakan"
@@ -364,6 +368,7 @@ msgstr "Semua timer untuk pin ini sedang digunakan"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Semua timer sedang digunakan"
@@ -392,6 +397,7 @@ msgstr "AnalogIn tidak didukung pada pin yang diberikan"
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "fungsionalitas AnalogOut tidak didukung"
@@ -593,6 +599,7 @@ msgstr "Tidak dapat menghapus nilai"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "Tidak bisa mendapatkan pull pada saat mode output"
@@ -636,6 +643,10 @@ msgstr ""
"Tidak dapat melakukan reset ke bootloader karena tidak ada bootloader yang "
"terisi"
+#: ports/esp32s2/common-hal/socketpool/Socket.c
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "Tidak dapat menetapkan nilai saat arah input."
@@ -878,11 +889,12 @@ msgstr "Channel EXTINT sedang digunakan"
msgid "Error in regex"
msgstr "Error pada regex"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -936,7 +948,7 @@ msgstr "FFT didefinisikan hanya untuk ndarrays"
msgid "FFT is implemented for linear arrays only"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr ""
@@ -1064,6 +1076,10 @@ msgstr "operasi I/O pada file tertutup"
msgid "I2C Init Error"
msgstr "Gagal Inisialisasi I2C"
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr ""
@@ -1089,10 +1105,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr "Ukuran penyangga salah"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1101,6 +1126,31 @@ msgstr ""
msgid "Input/output error"
msgstr "Kesalahan input/output"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr "Otentikasi tidak cukup"
@@ -1152,7 +1202,7 @@ msgstr "Pin DAC yang diberikan tidak valid"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr "Frekuensi PWM tidak valid"
@@ -1246,6 +1296,8 @@ msgstr "Pin untuk channel kanan tidak valid"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "Pin-pin tidak valid"
@@ -1274,7 +1326,7 @@ msgstr "security_mode tidak valid"
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1282,10 +1334,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr "Suara tidak valid"
@@ -1302,10 +1350,6 @@ msgstr "File wave tidak valid"
msgid "Invalid word/bit length"
msgstr "Panjang kata/bit tidak valid"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr "Panjang kunci harus 16, 24, atau 32 byte"
@@ -1367,6 +1411,36 @@ msgstr "Penundaan mulai mikrofon harus dalam kisaran 0,0 hingga 1,0"
msgid "Missing MISO or MOSI Pin"
msgstr "Tidak menemukan Pin MISO atau MOSI"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr "Harus berupa subclass %q."
@@ -1399,9 +1473,14 @@ msgstr "Tidak ada DAC (Digital Analog Converter) di dalam chip"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "tidak ada channel DMA ditemukan"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1420,14 +1499,14 @@ msgstr "Tidak ada Pin MOSI"
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Tidak ada pin TX"
@@ -1484,6 +1563,16 @@ msgstr "Tidak ada lagi penghitung waktu yang tersedia pada pin ini."
msgid "No network with that ssid"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr "Tidak ada pull-down pada pin; 1Mohm direkomendasikan"
@@ -1541,6 +1630,10 @@ msgstr "Parity ganjil tidak didukung"
msgid "Only 8 or 16 bit mono with "
msgstr "Hanya 8 atau 16 bit mono dengan "
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
@@ -1594,10 +1687,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "Sampel berlebihan harus kelipatan 8."
@@ -1619,6 +1717,7 @@ msgstr ""
"konstruksi."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr "ParallelBus belum didukung"
@@ -1631,11 +1730,20 @@ msgstr ""
msgid "Permission denied"
msgstr "Izin ditolak"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "Pin tidak mempunya kemampuan untuk ADC (Analog Digital Converter)"
@@ -1664,6 +1772,10 @@ msgstr ""
"ideal. Jika ini tidak dapat dihindari, berikan allow_inefficient=True ke "
"konstruktor"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr "Tambahkan module apapun pada filesystem\n"
@@ -1699,10 +1811,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "Pull tidak digunakan saat arah output."
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "Kesalahan DeInit RNG"
@@ -1711,6 +1847,10 @@ msgstr "Kesalahan DeInit RNG"
msgid "RNG Init Error"
msgstr "Kesalahan Init RNG"
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1718,6 +1858,7 @@ msgstr "Pembalikan RS485 ditentukan saat tidak dalam mode RS485"
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "Kalibrasi RTC tidak didukung pada board ini"
@@ -1726,7 +1867,7 @@ msgid "RTC is not supported on this board"
msgstr "RTC tidak didukung di board ini"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr "RTS/CTS/RS485 Belum didukung pada perangkat ini"
@@ -1784,11 +1925,6 @@ msgstr ""
msgid "SD card CSD format not supported"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDA atau SCL membutuhkan pull up"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1807,6 +1943,10 @@ msgstr "Kesalahan Init SPI"
msgid "SPI Re-initialization error"
msgstr "Kesalahan Inisialisasi ulang SPI"
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "Tingkat sampel harus positif"
@@ -1837,6 +1977,14 @@ msgstr "Serializer sedang digunakan"
msgid "Server side context cannot have hostname"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
@@ -1868,6 +2016,14 @@ msgstr "Memisahkan dengan menggunakan sub-captures"
msgid "Stack size must be at least 256"
msgstr "Ukuran stack minimal harus 256"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "Aliran tidak menemukan metode readinto() atau write()."
@@ -2009,6 +2165,10 @@ msgstr "Kesalahan Init UART"
msgid "UART Re-init error"
msgstr "Kesalahan Re-init UART"
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr "Kesalahan penulisan UART"
@@ -2035,6 +2195,7 @@ msgstr "Nilai UUID bukan str, int atau byte buffer"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr "Tidak dapat mengalokasikan buffer untuk signed conversion"
@@ -2072,7 +2233,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr "Tipe urf nrfx tak sesuai"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2115,7 +2276,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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"
@@ -2167,6 +2329,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr "PERINGATAN: Nama file kode anda mempunyai dua ekstensi\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2379,7 +2542,7 @@ msgstr ""
msgid "buffer too small"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -3225,6 +3388,10 @@ msgstr ""
msgid "memory allocation failed, heap is locked"
msgstr ""
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr "modul tidak ditemukan"
@@ -3540,6 +3707,10 @@ msgstr "Muncul dari PulseIn yang kosong"
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr ""
@@ -3556,6 +3727,7 @@ msgstr ""
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3573,6 +3745,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "antrian meluap (overflow)"
@@ -3776,6 +3956,7 @@ msgstr ""
#: ports/esp32s2/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"
msgstr ""
@@ -3987,6 +4168,11 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
@@ -4059,6 +4245,9 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
+#~ msgid "SDA or SCL needs a pull up"
+#~ msgstr "SDA atau SCL membutuhkan pull up"
+
#~ msgid "%d address pins and %d rgb pins indicate a height of %d, not %d"
#~ msgstr "pin alamat %d dan pin rgb %d menunjukkan tinggi %d, bukan %d"
diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot
index 4fd6e9929..e5ed6149a 100644
--- a/locale/circuitpython.pot
+++ b/locale/circuitpython.pot
@@ -363,6 +363,7 @@ msgstr ""
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr ""
@@ -630,6 +631,10 @@ msgstr ""
msgid "Cannot reset into bootloader because no bootloader is present."
msgstr ""
+#: ports/esp32s2/common-hal/socketpool/Socket.c
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr ""
@@ -866,7 +871,7 @@ msgstr ""
msgid "Error in regex"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
@@ -925,7 +930,7 @@ msgstr ""
msgid "FFT is implemented for linear arrays only"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr ""
@@ -1088,6 +1093,11 @@ msgstr ""
msgid "Initialization failed due to lack of memory"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1296,7 +1306,7 @@ msgstr ""
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1304,10 +1314,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr ""
@@ -1324,10 +1330,6 @@ msgstr ""
msgid "Invalid word/bit length"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr ""
@@ -1451,9 +1453,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1540,6 +1547,12 @@ msgstr ""
msgid "No out in program"
msgstr ""
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr ""
@@ -1648,10 +1661,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr ""
@@ -1671,6 +1689,7 @@ msgid ""
msgstr ""
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr ""
@@ -1726,6 +1745,10 @@ msgid ""
"constructor"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr ""
@@ -1785,6 +1808,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr ""
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""
@@ -1793,6 +1820,10 @@ msgstr ""
msgid "RNG Init Error"
msgstr ""
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1800,6 +1831,7 @@ msgstr ""
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr ""
@@ -1808,7 +1840,7 @@ msgid "RTC is not supported on this board"
msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr ""
@@ -1865,12 +1897,6 @@ msgstr ""
msgid "SD card CSD format not supported"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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 "SDA or SCL needs a pull up"
-msgstr ""
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1962,6 +1988,14 @@ msgstr ""
msgid "Stack size must be at least 256"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr ""
@@ -2125,6 +2159,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr ""
@@ -2162,7 +2197,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2255,6 +2290,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr ""
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2460,7 +2496,7 @@ msgstr ""
msgid "buffer too small"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -3306,6 +3342,10 @@ msgstr ""
msgid "memory allocation failed, heap is locked"
msgstr ""
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr ""
@@ -3620,6 +3660,10 @@ msgstr ""
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr ""
@@ -3636,6 +3680,7 @@ msgstr ""
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3864,6 +3909,7 @@ msgstr ""
#: ports/esp32s2/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"
msgstr ""
@@ -4074,6 +4120,11 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
diff --git a/locale/cs.po b/locale/cs.po
index 9181d1f70..c6d537fcc 100644
--- a/locale/cs.po
+++ b/locale/cs.po
@@ -342,6 +342,10 @@ msgstr ""
msgid "All event channels in use"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr ""
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr ""
@@ -362,6 +366,7 @@ msgstr ""
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr ""
@@ -390,6 +395,7 @@ msgstr ""
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr ""
@@ -589,6 +595,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr ""
@@ -626,6 +633,10 @@ msgstr ""
msgid "Cannot reset into bootloader because no bootloader is present."
msgstr ""
+#: ports/esp32s2/common-hal/socketpool/Socket.c
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr ""
@@ -862,11 +873,12 @@ msgstr ""
msgid "Error in regex"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -920,7 +932,7 @@ msgstr ""
msgid "FFT is implemented for linear arrays only"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr ""
@@ -1048,6 +1060,10 @@ msgstr ""
msgid "I2C Init Error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr ""
@@ -1071,10 +1087,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1083,6 +1108,31 @@ msgstr ""
msgid "Input/output error"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr ""
@@ -1134,7 +1184,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr ""
@@ -1228,6 +1278,8 @@ msgstr ""
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr ""
@@ -1256,7 +1308,7 @@ msgstr ""
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1264,10 +1316,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr ""
@@ -1284,10 +1332,6 @@ msgstr ""
msgid "Invalid word/bit length"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr ""
@@ -1349,6 +1393,36 @@ msgstr ""
msgid "Missing MISO or MOSI Pin"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr ""
@@ -1381,9 +1455,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1402,14 +1481,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr ""
@@ -1466,6 +1545,16 @@ msgstr ""
msgid "No network with that ssid"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr ""
@@ -1521,6 +1610,10 @@ msgstr ""
msgid "Only 8 or 16 bit mono with "
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
@@ -1570,10 +1663,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr ""
@@ -1593,6 +1691,7 @@ msgid ""
msgstr ""
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr ""
@@ -1605,11 +1704,20 @@ msgstr ""
msgid "Permission denied"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr ""
@@ -1635,6 +1743,10 @@ msgid ""
"constructor"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr ""
@@ -1670,10 +1782,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr ""
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""
@@ -1682,6 +1818,10 @@ msgstr ""
msgid "RNG Init Error"
msgstr ""
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1689,6 +1829,7 @@ msgstr ""
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr ""
@@ -1697,7 +1838,7 @@ msgid "RTC is not supported on this board"
msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr ""
@@ -1754,11 +1895,6 @@ msgstr ""
msgid "SD card CSD format not supported"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr ""
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1777,6 +1913,10 @@ msgstr ""
msgid "SPI Re-initialization error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr ""
@@ -1807,6 +1947,14 @@ msgstr ""
msgid "Server side context cannot have hostname"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
@@ -1838,6 +1986,14 @@ msgstr ""
msgid "Stack size must be at least 256"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr ""
@@ -1971,6 +2127,10 @@ msgstr ""
msgid "UART Re-init error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr ""
@@ -1997,6 +2157,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr ""
@@ -2034,7 +2195,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2075,7 +2236,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c
msgid "Unsupported baudrate"
msgstr ""
@@ -2126,6 +2288,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr ""
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2331,7 +2494,7 @@ msgstr ""
msgid "buffer too small"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -3177,6 +3340,10 @@ msgstr ""
msgid "memory allocation failed, heap is locked"
msgstr ""
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr ""
@@ -3491,6 +3658,10 @@ msgstr ""
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr ""
@@ -3507,6 +3678,7 @@ msgstr ""
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3524,6 +3696,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr ""
@@ -3727,6 +3907,7 @@ msgstr ""
#: ports/esp32s2/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"
msgstr ""
@@ -3937,6 +4118,11 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
diff --git a/locale/de_DE.po b/locale/de_DE.po
index 8d8f2d521..dfb60ca4e 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-01-07 18:01+0000\n"
-"Last-Translator: Dennis Schweer <dennis.schweer@ruhr-uni-bochum.de>\n"
+"PO-Revision-Date: 2021-02-05 15:41+0000\n"
+"Last-Translator: Jeff Epler <jepler@gmail.com>\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.4.1-dev\n"
+"X-Generator: Weblate 4.5-dev\n"
#: main.c
msgid ""
@@ -120,7 +120,8 @@ msgstr "%q sollte ein integer sein"
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
-msgstr "%q() nimmt %d Argumente ohne Keyword an, aber es wurden %d angegeben"
+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
#, c-format
@@ -235,7 +236,7 @@ msgstr "'await' außerhalb einer Funktion"
#: py/compile.c
msgid "'await', 'async for' or 'async with' outside async function"
-msgstr ""
+msgstr "'await', 'async for' oder 'async with' außerhalb einer async Funktion"
#: py/compile.c
msgid "'break' outside loop"
@@ -267,7 +268,7 @@ msgstr "'return' außerhalb einer Funktion"
#: py/compile.c
msgid "'yield from' inside async function"
-msgstr ""
+msgstr "'yield from' innerhalb einer async Funktion"
#: py/compile.c
msgid "'yield' outside function"
@@ -313,7 +314,7 @@ msgstr "Adresstyp außerhalb des zulässigen Bereichs"
#: ports/esp32s2/common-hal/canio/CAN.c
msgid "All CAN peripherals are in use"
-msgstr ""
+msgstr "Alle CAN Schnittstellen sind in Benutzung"
#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
@@ -329,7 +330,7 @@ msgstr "Alle PCNT Einheiten sind in Benutzung"
#: ports/esp32s2/common-hal/canio/Listener.c
#: ports/stm/common-hal/canio/Listener.c
msgid "All RX FIFOs in use"
-msgstr ""
+msgstr "Alle RX FIFOs sind in Benutzung"
#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c
msgid "All SPI peripherals are in use"
@@ -343,6 +344,10 @@ msgstr "Alle UART-Peripheriegeräte sind in Benutzung"
msgid "All event channels in use"
msgstr "Alle event Kanäle werden benutzt"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr ""
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "Alle sync event Kanäle werden benutzt"
@@ -363,6 +368,7 @@ msgstr "Alle timer für diesen Pin werden bereits benutzt"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Alle timer werden benutzt"
@@ -391,6 +397,7 @@ msgstr "AnalogIn ist an diesem Pin nicht unterstützt"
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "AnalogOut-Funktion wird nicht unterstützt"
@@ -536,7 +543,7 @@ msgstr "Puffer zu groß und kann nicht reserviert werden"
#: shared-bindings/_bleio/PacketBuffer.c
#, c-format
msgid "Buffer too short by %d bytes"
-msgstr "Buffer um %d Bytes zu kurz"
+msgstr "Puffer um %d Bytes zu kurz"
#: ports/atmel-samd/common-hal/displayio/ParallelBus.c
#: ports/esp32s2/common-hal/displayio/ParallelBus.c
@@ -594,6 +601,7 @@ msgstr "Kann Werte nicht löschen"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "Pull up im Ausgabemodus nicht möglich"
@@ -632,6 +640,10 @@ msgstr "Kann '/' nicht remounten when USB aktiv ist."
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
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "Der Wert kann nicht gesetzt werden, wenn die Richtung input ist."
@@ -685,7 +697,7 @@ msgstr ""
#: supervisor/shared/safe_mode.c
msgid "CircuitPython was unable to allocate the heap.\n"
-msgstr ""
+msgstr "CircuitPython war es nicht möglich heap-Speicher zu allozieren.\n"
#: shared-module/bitbangio/SPI.c
msgid "Clock pin init failed."
@@ -763,7 +775,7 @@ msgstr "PWM konnte nicht neu gestartet werden"
#: ports/esp32s2/common-hal/neopixel_write/__init__.c
msgid "Could not retrieve clock"
-msgstr ""
+msgstr "Clock konnte nicht ermittelt werden"
#: shared-bindings/_bleio/Adapter.c
msgid "Could not set address"
@@ -801,7 +813,7 @@ msgstr "Absturz in den HardFault_Handler."
#: ports/stm/common-hal/analogio/AnalogOut.c
msgid "DAC Channel Init Error"
-msgstr "DAC Kanal Intialisierungs Fehler"
+msgstr "DAC Kanal Initialisierungsfehler"
#: ports/stm/common-hal/analogio/AnalogOut.c
msgid "DAC Device Init Error"
@@ -874,11 +886,12 @@ msgstr "EXTINT Kanal ist schon in Benutzung"
msgid "Error in regex"
msgstr "Fehler in regex"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -933,7 +946,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/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr "SSL Handshake fehlgeschlagen"
@@ -966,7 +979,7 @@ msgstr "Zuweisung des Wifi Speichers ist fehlgeschlagen"
#: ports/esp32s2/common-hal/wifi/ScannedNetworks.c
msgid "Failed to allocate wifi scan memory"
-msgstr ""
+msgstr "Zuweisung des Wifi Scan Speichers ist fehlgeschlagen"
#: ports/nrf/common-hal/_bleio/Adapter.c
msgid "Failed to connect: internal error"
@@ -982,7 +995,7 @@ msgstr "Wifi Initialisierung ist fehlgeschlagen"
#: shared-module/audiomp3/MP3Decoder.c
msgid "Failed to parse MP3 file"
-msgstr "Parsen der MP3 Datei fehlgeschlagen"
+msgstr "MP3-Datei konnte nicht analysiert werden"
#: ports/nrf/sd_mutex.c
#, c-format
@@ -1005,7 +1018,7 @@ msgstr "Filter zu komplex"
#: ports/esp32s2/common-hal/dualbank/__init__.c
msgid "Firmware image is invalid"
-msgstr ""
+msgstr "Firmware Image ist ungültig"
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Format not supported"
@@ -1063,6 +1076,10 @@ msgstr "Lese/Schreibe-operation an geschlossener Datei"
msgid "I2C Init Error"
msgstr "I2C-Init-Fehler"
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr "I2SOut nicht verfügbar"
@@ -1088,10 +1105,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr "Inkorrekte Puffergröße"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr "Initialisierung aufgrund von Speichermangel fehlgeschlagen"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1100,6 +1126,31 @@ msgstr ""
msgid "Input/output error"
msgstr "Eingabe-/Ausgabefehler"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr "Unzureichende Authentifizierung"
@@ -1151,7 +1202,7 @@ msgstr "Ungültiger DAC-Pin angegeben"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr "Ungültige PWM Frequenz"
@@ -1245,6 +1296,8 @@ msgstr "Ungültiger Pin für rechten Kanal"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "Ungültige Pins"
@@ -1273,7 +1326,7 @@ msgstr "Ungültiger security_mode"
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1281,10 +1334,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr "Ungültige Stimme"
@@ -1301,10 +1350,6 @@ msgstr "Ungültige wave Datei"
msgid "Invalid word/bit length"
msgstr "Ungültige Wort- / Bitlänge"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr "Der Schlüssel muss 16, 24 oder 32 Byte lang sein"
@@ -1368,6 +1413,36 @@ msgstr ""
msgid "Missing MISO or MOSI Pin"
msgstr "Fehlender MISO- oder MOSI-Pin"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr "Muss eine %q Unterklasse sein."
@@ -1400,9 +1475,14 @@ msgstr "Kein DAC im Chip vorhanden"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "Kein DMA Kanal gefunden"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1421,14 +1501,14 @@ msgstr "Kein MOSI Pin"
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Kein TX Pin"
@@ -1485,6 +1565,16 @@ msgstr "An diesem Pin sind keine Timer mehr verfügbar."
msgid "No network with that ssid"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr "Kein Pulldown Widerstand am Pin; 1Mohm wird vorgeschlagen"
@@ -1542,6 +1632,10 @@ 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/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
@@ -1595,10 +1689,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "Oversample muss ein Vielfaches von 8 sein."
@@ -1618,6 +1717,7 @@ msgid ""
msgstr "Die PWM-Frequenz ist nicht schreibbar wenn variable_Frequenz = False."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr "ParallelBus wird noch nicht unterstützt"
@@ -1630,11 +1730,20 @@ msgstr ""
msgid "Permission denied"
msgstr "Zugang verweigert"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "Pin hat keine ADC Funktionalität"
@@ -1663,6 +1772,10 @@ msgstr ""
"Bytes verbraucht. Wenn dies nicht vermieden werden kann, übergeben Sie "
"allow_inefficient = True an den Konstruktor"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr "und alle Module im Dateisystem \n"
@@ -1698,10 +1811,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "Pull wird nicht verwendet, wenn die Richtung output ist."
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "RNG DeInit-Fehler"
@@ -1710,6 +1847,10 @@ msgstr "RNG DeInit-Fehler"
msgid "RNG Init Error"
msgstr "RNG Init Fehler"
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1717,6 +1858,7 @@ msgstr "RS485-Inversion angegeben, wenn nicht im RS485-Modus"
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "Die RTC-Kalibrierung wird auf diesem Board nicht unterstützt"
@@ -1725,7 +1867,7 @@ msgid "RTC is not supported on this board"
msgstr "Eine RTC wird auf diesem Board nicht unterstützt"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr "RTS / CTS / RS485 Wird von diesem Gerät noch nicht unterstützt"
@@ -1782,11 +1924,6 @@ msgstr ""
msgid "SD card CSD format not supported"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDA oder SCL brauchen pull up"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1805,6 +1942,10 @@ msgstr "SPI-Init-Fehler"
msgid "SPI Re-initialization error"
msgstr "SPI-Neuinitialisierungsfehler"
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "Abtastrate muss positiv sein"
@@ -1835,6 +1976,14 @@ msgstr "Serializer wird benutzt"
msgid "Server side context cannot have hostname"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
@@ -1866,6 +2015,14 @@ msgstr "Splitting mit sub-captures"
msgid "Stack size must be at least 256"
msgstr "Die Stackgröße sollte mindestens 256 sein"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "Stream fehlt readinto() oder write() Methode."
@@ -2013,6 +2170,10 @@ msgstr "UART Init Fehler"
msgid "UART Re-init error"
msgstr "UART Re-Init-Fehler"
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr "UART-Schreibfehler"
@@ -2039,6 +2200,7 @@ msgstr "Der UUID-Wert ist kein str-, int- oder Byte-Puffer"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr "Konnte keine Buffer für Vorzeichenumwandlung allozieren"
@@ -2076,7 +2238,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr "Unerwarteter nrfx uuid-Typ"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2121,7 +2283,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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"
@@ -2173,6 +2336,7 @@ msgstr ""
"WARNUNG: Der Dateiname deines Programms hat zwei Dateityperweiterungen\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2388,7 +2552,7 @@ msgstr "Puffersegmente müssen gleich lang sein"
msgid "buffer too small"
msgstr "Der Puffer ist zu klein"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -2769,7 +2933,7 @@ msgstr "erwarte tuple/list"
#: py/modthread.c
msgid "expecting a dict for keyword args"
-msgstr "erwarte ein dict als Keyword-Argumente"
+msgstr "erwarte ein dict als Schlüsselwort-Argumente"
#: py/compile.c
msgid "expecting an assembler instruction"
@@ -2789,11 +2953,11 @@ msgstr ""
#: py/argcheck.c
msgid "extra keyword arguments given"
-msgstr "Es wurden zusätzliche Keyword-Argumente angegeben"
+msgstr "Es wurden zusätzliche Schlüsselwort-Argumente angegeben"
#: py/argcheck.c
msgid "extra positional arguments given"
-msgstr "Es wurden zusätzliche Argumente ohne Keyword angegeben"
+msgstr "Es wurden zusätzliche Argumente ohne Schlüsselwort angegeben"
#: py/parse.c
msgid "f-string expression part cannot include a '#'"
@@ -2874,7 +3038,7 @@ msgstr "voll"
#: py/argcheck.c
msgid "function does not take keyword arguments"
-msgstr "Funktion akzeptiert keine Keyword-Argumente"
+msgstr "Funktion akzeptiert keine Schlüsselwort-Argumente"
#: py/argcheck.c
#, c-format
@@ -2896,26 +3060,27 @@ msgstr ""
#: py/argcheck.c
#, c-format
msgid "function missing %d required positional arguments"
-msgstr "Funktion vermisst %d benötigte Argumente ohne Keyword"
+msgstr "Funktion vermisst %d benötigte Argumente ohne Schlüsselwort"
#: py/bc.c
msgid "function missing keyword-only argument"
-msgstr "Funktion vermisst Keyword-only-Argument"
+msgstr "Funktion vermisst Nur-Schlüsselwort-Argument"
#: py/bc.c
msgid "function missing required keyword argument '%q'"
-msgstr "Funktion vermisst benötigtes Keyword-Argumente '%q'"
+msgstr "Funktion vermisst benötigtes Schlüsselwort-Argumente '%q'"
#: py/bc.c
#, c-format
msgid "function missing required positional argument #%d"
-msgstr "Funktion vermisst benötigtes Argumente ohne Keyword #%d"
+msgstr "Funktion vermisst benötigtes Argumente ohne Schlüsselwort #%d"
#: py/argcheck.c py/bc.c py/objnamedtuple.c shared-bindings/time/__init__.c
#, c-format
msgid "function takes %d positional arguments but %d were given"
msgstr ""
-"Funktion nimmt %d Argumente ohne Keyword an, aber es wurden %d angegeben"
+"Funktion nimmt %d Argumente ohne Schlüsselwort an, aber es wurden %d "
+"angegeben"
#: shared-bindings/time/__init__.c
msgid "function takes exactly 9 arguments"
@@ -3145,8 +3310,8 @@ msgstr ""
#: py/argcheck.c
msgid "keyword argument(s) not yet implemented - use normal args instead"
msgstr ""
-"Keyword-Argument(e) noch nicht implementiert - verwenden Sie stattdessen "
-"normale Argumente"
+"Schlüsselwort-Argument(e) noch nicht implementiert - verwenden Sie "
+"stattdessen normale Argumente"
#: py/bc.c
msgid "keywords must be strings"
@@ -3253,6 +3418,10 @@ msgstr "Speicherzuordnung fehlgeschlagen, Zuweisung von %u Bytes"
msgid "memory allocation failed, heap is locked"
msgstr "Speicherzuweisung fehlgeschlagen, der Heap ist gesperrt"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr "Modul nicht gefunden"
@@ -3571,6 +3740,10 @@ msgstr "pop von einem leeren PulseIn"
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "pow() drittes Argument darf nicht 0 sein"
@@ -3587,6 +3760,7 @@ msgstr "pow () mit 3 Argumenten erfordert Integer"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3604,6 +3778,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "Warteschlangenüberlauf"
@@ -3810,6 +3992,7 @@ msgstr "time.struct_time() nimmt eine 9-Sequenz an"
#: ports/esp32s2/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"
msgstr "Das Zeitlimit hat den maximal zulässigen Wert überschritten"
@@ -3926,11 +4109,11 @@ msgstr ""
#: py/bc.c
msgid "unexpected keyword argument"
-msgstr "unerwartetes Keyword-Argument"
+msgstr "unerwartetes Schlüsselwort-Argument"
#: py/bc.c py/objnamedtuple.c
msgid "unexpected keyword argument '%q'"
-msgstr "unerwartetes Keyword-Argument '%q'"
+msgstr "unerwartetes Schlüsselwort-Argument '%q'"
#: py/lexer.c
msgid "unicode name escapes"
@@ -4024,6 +4207,11 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
@@ -4096,6 +4284,9 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
+#~ msgid "SDA or SCL needs a pull up"
+#~ msgstr "SDA oder SCL brauchen pull up"
+
#~ msgid "%d address pins and %d rgb pins indicate a height of %d, not %d"
#~ msgstr ""
#~ "%d Adress-Pins und %d rgb-Pins zeigen eine Höhe von %d, nicht von %d"
diff --git a/locale/el.po b/locale/el.po
index 04b63261e..b088a7645 100644
--- a/locale/el.po
+++ b/locale/el.po
@@ -339,6 +339,10 @@ msgstr ""
msgid "All event channels in use"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr ""
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr ""
@@ -359,6 +363,7 @@ msgstr ""
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr ""
@@ -387,6 +392,7 @@ msgstr ""
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr ""
@@ -586,6 +592,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr ""
@@ -623,6 +630,10 @@ msgstr ""
msgid "Cannot reset into bootloader because no bootloader is present."
msgstr ""
+#: ports/esp32s2/common-hal/socketpool/Socket.c
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr ""
@@ -859,11 +870,12 @@ msgstr ""
msgid "Error in regex"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -917,7 +929,7 @@ msgstr ""
msgid "FFT is implemented for linear arrays only"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr ""
@@ -1045,6 +1057,10 @@ msgstr ""
msgid "I2C Init Error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr ""
@@ -1068,10 +1084,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1080,6 +1105,31 @@ msgstr ""
msgid "Input/output error"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr ""
@@ -1131,7 +1181,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr ""
@@ -1225,6 +1275,8 @@ msgstr ""
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr ""
@@ -1253,7 +1305,7 @@ msgstr ""
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1261,10 +1313,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr ""
@@ -1281,10 +1329,6 @@ msgstr ""
msgid "Invalid word/bit length"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr ""
@@ -1346,6 +1390,36 @@ msgstr ""
msgid "Missing MISO or MOSI Pin"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr ""
@@ -1378,9 +1452,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1399,14 +1478,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr ""
@@ -1463,6 +1542,16 @@ msgstr ""
msgid "No network with that ssid"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr ""
@@ -1518,6 +1607,10 @@ msgstr ""
msgid "Only 8 or 16 bit mono with "
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
@@ -1567,10 +1660,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr ""
@@ -1590,6 +1688,7 @@ msgid ""
msgstr ""
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr ""
@@ -1602,11 +1701,20 @@ msgstr ""
msgid "Permission denied"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr ""
@@ -1632,6 +1740,10 @@ msgid ""
"constructor"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr ""
@@ -1667,10 +1779,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr ""
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""
@@ -1679,6 +1815,10 @@ msgstr ""
msgid "RNG Init Error"
msgstr ""
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1686,6 +1826,7 @@ msgstr ""
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr ""
@@ -1694,7 +1835,7 @@ msgid "RTC is not supported on this board"
msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr ""
@@ -1751,11 +1892,6 @@ msgstr ""
msgid "SD card CSD format not supported"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr ""
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1774,6 +1910,10 @@ msgstr ""
msgid "SPI Re-initialization error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr ""
@@ -1804,6 +1944,14 @@ msgstr ""
msgid "Server side context cannot have hostname"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
@@ -1835,6 +1983,14 @@ msgstr ""
msgid "Stack size must be at least 256"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr ""
@@ -1968,6 +2124,10 @@ msgstr ""
msgid "UART Re-init error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr ""
@@ -1994,6 +2154,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr ""
@@ -2031,7 +2192,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2072,7 +2233,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c
msgid "Unsupported baudrate"
msgstr ""
@@ -2123,6 +2285,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr ""
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2328,7 +2491,7 @@ msgstr ""
msgid "buffer too small"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -3174,6 +3337,10 @@ msgstr ""
msgid "memory allocation failed, heap is locked"
msgstr ""
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr ""
@@ -3488,6 +3655,10 @@ msgstr ""
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr ""
@@ -3504,6 +3675,7 @@ msgstr ""
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3521,6 +3693,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr ""
@@ -3724,6 +3904,7 @@ msgstr ""
#: ports/esp32s2/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"
msgstr ""
@@ -3934,6 +4115,11 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
diff --git a/locale/es.po b/locale/es.po
index 29b238768..c5e199719 100644
--- a/locale/es.po
+++ b/locale/es.po
@@ -8,27 +8,31 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
-"PO-Revision-Date: 2020-12-30 22:25+0000\n"
-"Last-Translator: Hugo Dahl <hugo@code-jedi.com>\n"
+"PO-Revision-Date: 2021-02-21 22:27+0000\n"
+"Last-Translator: Jose David M <jquintana202020@gmail.com>\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.4.1-dev\n"
+"X-Generator: Weblate 4.5\n"
#: main.c
msgid ""
"\n"
"Code done running.\n"
msgstr ""
+"\n"
+"El código terminó de ejecutar.\n"
#: main.c
msgid ""
"\n"
"Code stopped by auto-reload.\n"
msgstr ""
+"\n"
+"El código fue detenido por el auto-reiniciado.\n"
#: supervisor/shared/safe_mode.c
msgid ""
@@ -50,7 +54,7 @@ msgstr " Archivo \"%q\", línea %d"
#: py/builtinhelp.c
msgid " is of type %q\n"
-msgstr ""
+msgstr " es de tipo %q\n"
#: main.c
msgid " output:\n"
@@ -66,6 +70,8 @@ msgstr "%%c requiere int o char"
msgid ""
"%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d"
msgstr ""
+"%d pines de dirección, %d pines rgb y %d tiles indican una altura de %d, y "
+"no de %d"
#: ports/atmel-samd/common-hal/sdioio/SDCard.c
msgid "%q failure: %d"
@@ -126,7 +132,7 @@ msgstr "%q() toma %d argumentos posicionales pero %d fueron dados"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
#, c-format
msgid "%s error 0x%x"
-msgstr ""
+msgstr "%s error 0x%x"
#: py/argcheck.c
msgid "'%q' argument required"
@@ -292,7 +298,7 @@ msgstr "pow() con 3 argumentos no soportado"
#: shared-module/msgpack/__init__.c
msgid "64 bit types"
-msgstr ""
+msgstr "tipos de 64 bit"
#: ports/atmel-samd/common-hal/countio/Counter.c
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
@@ -344,6 +350,10 @@ msgstr "Todos los periféricos UART están siendo usados"
msgid "All event channels in use"
msgstr "Todos los canales de eventos estan siendo usados"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr "Todas las máquinas de estado en uso"
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr ""
@@ -366,6 +376,7 @@ msgstr "Todos los timers para este pin están siendo utilizados"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Todos los timers en uso"
@@ -394,6 +405,7 @@ msgstr "El pin proporcionado no soporta AnalogIn"
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "Funcionalidad AnalogOut no soportada"
@@ -562,7 +574,7 @@ msgstr "Los bloques CBC deben ser múltiplos de 16 bytes"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "CRC or checksum was invalid"
-msgstr ""
+msgstr "CRC o suma de comprobación inválida"
#: py/objtype.c
msgid "Call super().__init__() before accessing native object."
@@ -570,15 +582,17 @@ msgstr "Llame a super().__ init __() antes de acceder al objeto nativo."
#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c
msgid "Can only alarm on RTC IO from deep sleep."
-msgstr ""
+msgstr "Solo puede alertar en RTC IO de deep sleep."
#: ports/esp32s2/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
msgid "Can only alarm on two low pins from deep sleep."
-msgstr ""
+msgstr "Solo puede alerta en dos low pines viniendo de deep sleep."
#: ports/nrf/common-hal/_bleio/Characteristic.c
msgid "Can't set CCCD on local Characteristic"
@@ -597,6 +611,7 @@ msgstr "No se puede eliminar valores"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "No puede ser pull mientras este en modo de salida"
@@ -616,7 +631,7 @@ msgstr "No se puede tener ambos canales en el mismo pin"
#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c
msgid "Cannot pull on input-only pin."
-msgstr ""
+msgstr "No puede hacer pull en un pin de entrada sola."
#: shared-module/bitbangio/SPI.c
msgid "Cannot read without MISO pin."
@@ -636,6 +651,10 @@ msgstr "No se puede volver a montar '/' cuando el USB esta activo."
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
+msgid "Cannot set socket options"
+msgstr "No se pueden definir opciones para enchufe"
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "No se puede asignar un valor cuando la dirección es input."
@@ -663,7 +682,7 @@ msgstr "No puede variar la frecuencia en un temporizador que ya está en uso"
#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c
msgid "Cannot wake on pin edge. Only level."
-msgstr ""
+msgstr "No puede despertar en pin edge, solo en nivel."
#: shared-module/bitbangio/SPI.c
msgid "Cannot write without MOSI pin."
@@ -820,7 +839,7 @@ msgstr "El pin Data 0 debe estar alineado a bytes"
#: ports/esp32s2/common-hal/displayio/ParallelBus.c
msgid "Data 0 pin must be byte aligned."
-msgstr ""
+msgstr "El pin de datos 0 debe ser alineado a byte."
#: shared-module/audiocore/WaveFile.c
msgid "Data chunk must follow fmt chunk"
@@ -876,11 +895,12 @@ msgstr "El canal EXTINT ya está siendo utilizado"
msgid "Error in regex"
msgstr "Error en regex"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
-msgstr ""
+msgstr "Error: fallo al vincular"
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -915,7 +935,7 @@ msgstr "Se esperaba una dirección"
#: shared-bindings/alarm/__init__.c
msgid "Expected an alarm"
-msgstr ""
+msgstr "Un objecto alarm era esperado"
#: shared-module/_pixelbuf/PixelBuf.c
#, c-format
@@ -934,7 +954,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/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr "Fallo en saludo SSL"
@@ -1006,7 +1026,7 @@ msgstr "Filtros muy complejos"
#: ports/esp32s2/common-hal/dualbank/__init__.c
msgid "Firmware image is invalid"
-msgstr ""
+msgstr "La imagen de firmware es inválida"
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Format not supported"
@@ -1029,7 +1049,7 @@ msgstr "La función requiere lock"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Generic Failure"
-msgstr ""
+msgstr "Fallo Genérico"
#: shared-bindings/displayio/Display.c
#: shared-bindings/displayio/EPaperDisplay.c
@@ -1063,13 +1083,17 @@ msgstr "Operación I/O en archivo cerrado"
msgid "I2C Init Error"
msgstr "I2C Error de inicio"
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr "Dispositivo I2C en uso"
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr "I2SOut no disponible"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "IOs 0, 2 & 4 do not support internal pullup in sleep"
-msgstr ""
+msgstr "IOs 0, 2 y 4 no soportan pullup interno durante sleep"
#: shared-bindings/aesio/aes.c
#, c-format
@@ -1088,10 +1112,21 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr "Tamaño incorrecto del buffer"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr "Tamaño del programa Init invalido"
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr "Inicializacion fallida por falta de memoria"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+"La longitud del buffer de entrada(%d) debe ser un múltiplo del conteo de la "
+"tira (%d)"
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr "La entrada está durando mucho tiempo"
@@ -1100,6 +1135,31 @@ msgstr "La entrada está durando mucho tiempo"
msgid "Input/output error"
msgstr "error Input/output"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d jumps on pin"
+msgstr "La instruction %d salta en pin"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts in more bits than pin count"
+msgstr "La instruccion %d mueve mas bits que la cuenta del pin"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr "La instruccion %d mueve mas bits que la cuenta del pin"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr "La instrucción %d usa un pin extra"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr "La instrucción %d espera una entrada fuera del conteo"
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr "Autenticación insuficiente"
@@ -1151,13 +1211,13 @@ msgstr "Pin suministrado inválido para DAC"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/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
msgid "Invalid Pin"
-msgstr ""
+msgstr "Pin inválido"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
@@ -1245,6 +1305,8 @@ msgstr "Pin inválido para canal derecho"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "pines inválidos"
@@ -1271,19 +1333,15 @@ msgstr "'security_mode' no válido"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Invalid size"
-msgstr ""
+msgstr "Tamaño incorrecto"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
-msgstr ""
+msgstr "socket invalido para TLS"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Invalid state"
-msgstr ""
-
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
+msgstr "Estado invalido"
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
@@ -1301,10 +1359,6 @@ msgstr "Archivo wave inválido"
msgid "Invalid word/bit length"
msgstr "Tamaño no válido de palabra/bit"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr "La llave debe tener 16, 24 o 32 bytes de longitud"
@@ -1331,7 +1385,7 @@ msgstr "Length no deberia ser negativa"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "MAC address was invalid"
-msgstr ""
+msgstr "La dirección MAC es incorrecta"
#: shared-module/bitbangio/SPI.c
msgid "MISO pin init failed."
@@ -1366,6 +1420,40 @@ msgstr "Micrófono demora de inicio debe estar en el rango 0.0 a 1.0"
msgid "Missing MISO or MOSI Pin"
msgstr "Falta el pin MISO o MOSI"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr "first-in-pin no encontrado. La instrucción %d lee el/los pin(es)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr "first_in_pin no encontrado. La instrucción %d desplaza de los pin(es)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+"first_in_pin no encontrado. La instrucción %d espera basada en este pin"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+"first_in_pin no encontrado. La instrucción %d mueve hacia afuera hacia el/"
+"los pin(es)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr "first_in_pin no encontrado. La instrucción %d escribe pin(es)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+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)"
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr "Debe de ser una subclase de %q."
@@ -1398,13 +1486,18 @@ msgstr "El chip no tiene DAC"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "No se encontró el canal DMA"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr "timer por establecedor de paso DMA no encontrado"
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
-msgstr ""
+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
@@ -1419,14 +1512,14 @@ msgstr "Sin pin MOSI"
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Sin pin TX"
@@ -1483,6 +1576,16 @@ msgstr "No hay más temporizadores disponibles en este pin."
msgid "No network with that ssid"
msgstr "No hay una red con ese ssid"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+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/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "No pull up found on SDA or SCL; check your wiring"
+msgstr "No se encontró pull up en SDA or SCL; verifique su cableado"
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr "No hay pulldown en el pin; 1Mohm recomendado"
@@ -1540,6 +1643,10 @@ msgstr "Paridad impar no soportada"
msgid "Only 8 or 16 bit mono with "
msgstr "Solo mono de 8 ó 16 bit con "
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr "Solamente IN/OUT hasta 8 esta soportado"
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr "Solo hay capacidad para direcciones IPv4"
@@ -1567,11 +1674,11 @@ msgstr ""
#: ports/esp32s2/common-hal/alarm/touch/TouchAlarm.c
msgid "Only one TouchAlarm can be set in deep sleep."
-msgstr ""
+msgstr "Solamente una TouchAlarm puede ser configurada durante deep sleep."
#: ports/esp32s2/common-hal/alarm/time/TimeAlarm.c
msgid "Only one alarm.time alarm can be set."
-msgstr ""
+msgstr "Solamente una alarm.time puede ser configurada."
#: shared-module/displayio/ColorConverter.c
msgid "Only one color can be transparent at a time"
@@ -1583,27 +1690,32 @@ msgstr "Solo se aceptan enteros crudos para ip"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Operation or feature not supported"
-msgstr ""
+msgstr "Operación no característica no soportada"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Operation timed out"
-msgstr ""
+msgstr "Tiempo de espera agotado"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Out of memory"
-msgstr ""
+msgstr "Memoria agotada"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr "Se acabaron los enchufes"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr "buffer de salida debe ser de por lo menos %d bytes"
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "El sobremuestreo debe ser un múltiplo de 8."
#: shared-bindings/audiobusio/PDMIn.c
msgid "PDMIn not available"
-msgstr ""
+msgstr "PDMIn no esta disponible"
#: shared-bindings/pwmio/PWMOut.c
msgid ""
@@ -1618,23 +1730,33 @@ msgstr ""
"construcción."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/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
msgid "Peripheral in use"
-msgstr ""
+msgstr "Periférico en uso"
#: py/moduerrno.c
msgid "Permission denied"
msgstr "Permiso denegado"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr "El total de pines debe ser por lo menos 1"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr "Total de pines demasiado grande"
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "Pin no tiene capacidad ADC"
@@ -1663,6 +1785,10 @@ msgstr ""
"ideales. Si esto no se puede evitar, pase allow_inefficient=True al "
"constructor"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr "Los pines deben compartir la división PWM"
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr "Además de cualquier módulo en el sistema de archivos\n"
@@ -1697,15 +1823,42 @@ msgstr "El prefijo del buffer debe estar en el heap"
#: main.c
msgid "Press any key to enter the REPL. Use CTRL-D to reload.\n"
msgstr ""
+"Presiona cualquier tecla para entrar al REPL. Usa CTRL-D para recargar.\n"
#: main.c
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+"Pretendiendo ir a deep sleep hasta la alarma, CTRL-C or una escritura de "
+"archivo\n"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr "El programa hace un IN sin cargar ISR"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr "El programa hace OUT sin cargar OSR"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr "El programa debe contener por lo menos una instrucción de 16 bits."
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr "El tamaño del programa no es correcto"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr "Programa demasiado grande"
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "Pull no se usa cuando la dirección es output."
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr "El modo RAISE no esta implementado"
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "Error de desinicialización de RNG"
@@ -1714,6 +1867,10 @@ msgstr "Error de desinicialización de RNG"
msgid "RNG Init Error"
msgstr "Error de inicialización de RNG"
+#: ports/nrf/common-hal/busio/UART.c
+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/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1721,6 +1878,7 @@ 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/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "Calibración de RTC no es soportada en esta placa"
@@ -1729,7 +1887,7 @@ msgid "RTC is not supported on this board"
msgstr "RTC no soportado en esta placa"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr "Sin capacidad de RTS/CTS/RS485 para este dispositivo"
@@ -1752,7 +1910,7 @@ msgstr "Objeto de solo-lectura"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Received response was invalid"
-msgstr ""
+msgstr "La respuesta recibida es invalida"
#: shared-bindings/displayio/EPaperDisplay.c
msgid "Refresh too soon"
@@ -1768,7 +1926,7 @@ msgstr "El modo AES solicitado no es compatible"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Requested resource not found"
-msgstr ""
+msgstr "Recurso solicitado no encontrado"
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
msgid "Right channel unsupported"
@@ -1786,11 +1944,6 @@ msgstr "¡Corriendo en modo seguro! "
msgid "SD card CSD format not supported"
msgstr "Sin capacidad para formato CSD para tarjeta SD"
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDA o SCL necesitan una pull up"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1809,6 +1962,10 @@ msgstr "Error de inicio de SPI"
msgid "SPI Re-initialization error"
msgstr "Error de reinicialización de SPI"
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr "Periférico SPI en uso"
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "Sample rate debe ser positivo"
@@ -1839,6 +1996,14 @@ msgstr "Serializer está siendo utilizado"
msgid "Server side context cannot have hostname"
msgstr "El contexto del lado del servidor no puede tener un hostname"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr "La suma de pines configurados debe estar entre 1 y 5"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr "El conteo de pines de Side set debe estar entre 1 y 5"
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr "Sin capacidades para el tamaño"
@@ -1870,6 +2035,14 @@ msgstr "Dividiendo con sub-capturas"
msgid "Stack size must be at least 256"
msgstr "El tamaño de la pila debe ser de al menos 256"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr "Estéreo izquierdo debe estar en el canal PWM A"
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr "Estéreo derecho debe estar en el canal PWM B"
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "A Stream le falta el método readinto() o write()."
@@ -1880,7 +2053,7 @@ msgstr "Suministre al menos un pin UART"
#: shared-bindings/alarm/time/TimeAlarm.c
msgid "Supply one of monotonic_time or epoch_time"
-msgstr ""
+msgstr "Suministre monotonic_time o epoch_time"
#: shared-bindings/gnss/GNSS.c
msgid "System entry must be gnss.SatelliteSystem"
@@ -1956,7 +2129,7 @@ msgstr "Ancho del Tile debe dividir exactamente el ancho de mapa de bits"
#: shared-bindings/alarm/time/TimeAlarm.c
msgid "Time is in the past."
-msgstr ""
+msgstr "Tiempo suministrado esta en el pasado."
#: ports/nrf/common-hal/_bleio/Adapter.c
#, c-format
@@ -2017,6 +2190,10 @@ msgstr "Error de inicialización de UART"
msgid "UART Re-init error"
msgstr "Error de reinicialización de UART"
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr "UART no esta soportado todavia"
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr "Error de escritura UART"
@@ -2043,6 +2220,7 @@ msgstr "UUID valor no es un str, int o byte buffer"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr "No se pudieron asignar buffers para la conversión con signo"
@@ -2074,13 +2252,13 @@ msgstr "Imposible escribir en nvm."
#: shared-bindings/alarm/SleepMemory.c
msgid "Unable to write to sleep_memory."
-msgstr ""
+msgstr "Imposible de escribir en sleep_memory."
#: ports/nrf/common-hal/_bleio/UUID.c
msgid "Unexpected nrfx uuid type"
msgstr "Tipo de uuid nrfx inesperado"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/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"
@@ -2088,7 +2266,7 @@ msgstr "Error no manejado de ESP TLS %d %d %x %d"
#: shared-bindings/wifi/Radio.c
#, c-format
msgid "Unknown failure %d"
-msgstr ""
+msgstr "Fallo desconocido %d"
#: ports/nrf/common-hal/_bleio/__init__.c
#, c-format
@@ -2123,7 +2301,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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"
@@ -2145,7 +2324,7 @@ msgstr "valor pull no soportado."
#: ports/esp32s2/common-hal/dualbank/__init__.c
msgid "Update Failed"
-msgstr ""
+msgstr "La actualización fallo"
#: ports/nrf/common-hal/_bleio/Characteristic.c
#: ports/nrf/common-hal/_bleio/Descriptor.c
@@ -2159,7 +2338,7 @@ msgstr "Tamaño de valor > max_length"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Version was invalid"
-msgstr ""
+msgstr "La versión era invalida"
#: py/emitnative.c
msgid "Viper functions don't currently support more than 4 arguments"
@@ -2174,6 +2353,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr "ADVERTENCIA: El nombre de archivo de tu código tiene dos extensiones\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
"WatchDogTimer no se puede desinicializar luego de definirse en modo RESET"
@@ -2218,7 +2398,7 @@ msgstr "La clave de WiFi debe ser entre 8 y 63 caracteres"
#: main.c
msgid "Woken up by alarm.\n"
-msgstr ""
+msgstr "Despertado por la alarma.\n"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Writes not supported on Characteristic"
@@ -2365,7 +2545,7 @@ msgstr "la rama no está dentro del rango"
#: extmod/ulab/code/ulab_create.c
msgid "buffer is smaller than requested size"
-msgstr ""
+msgstr "El buffer es mas pequeño que el requerido"
#: shared-bindings/audiocore/RawSample.c
msgid "buffer must be a bytes-like object"
@@ -2373,7 +2553,7 @@ msgstr "buffer debe de ser un objeto bytes-like"
#: extmod/ulab/code/ulab_create.c
msgid "buffer size must be a multiple of element size"
-msgstr ""
+msgstr "El tamaño del buffer debe ser un múltiplo del tamaño del elemento"
#: shared-module/struct/__init__.c
msgid "buffer size must match format"
@@ -2388,7 +2568,7 @@ msgstr "Las secciones del buffer necesitan tener longitud igual"
msgid "buffer too small"
msgstr "buffer demasiado pequeño"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr "búfer muy pequeño para los bytes solicitados"
@@ -2587,7 +2767,7 @@ msgstr "circulo solo puede ser registrado con un pariente"
#: shared-bindings/msgpack/ExtType.c
msgid "code outside range 0~127"
-msgstr ""
+msgstr "código fuera del rango 0~127"
#: shared-bindings/displayio/Palette.c
msgid "color buffer must be 3 bytes (RGB) or 4 bytes (RGB + pad byte)"
@@ -2663,7 +2843,7 @@ msgstr "los datos deben ser de igual tamaño"
#: extmod/ulab/code/ndarray.c
msgid "data type not understood"
-msgstr ""
+msgstr "tipo de dato no comprendido"
#: py/parsenum.c
msgid "decimal numbers not supported"
@@ -2675,7 +2855,7 @@ msgstr "'except' por defecto deberia estar de último"
#: shared-bindings/msgpack/__init__.c
msgid "default is not a function"
-msgstr ""
+msgstr "default no es una función"
#: shared-bindings/audiobusio/PDMIn.c
msgid ""
@@ -2735,7 +2915,7 @@ msgstr "end_x debe ser un int"
#: shared-bindings/alarm/time/TimeAlarm.c
msgid "epoch_time not supported on this board"
-msgstr ""
+msgstr "epoch_time no esta soportado en esta tarjeta"
#: ports/nrf/common-hal/busio/UART.c
#, c-format
@@ -2780,7 +2960,7 @@ msgstr "esperando la clave:valor para dict"
#: shared-bindings/msgpack/__init__.c
msgid "ext_hook is not a function"
-msgstr ""
+msgstr "ext_hook no es una función"
#: py/argcheck.c
msgid "extra keyword arguments given"
@@ -2986,7 +3166,7 @@ msgstr "Formas de entrada y salida no son compactibles"
#: extmod/ulab/code/ulab_create.c
msgid "input argument must be an integer, a tuple, or a list"
-msgstr ""
+msgstr "argumento de entrada debe ser un entero, una tupla o una lista"
#: extmod/ulab/code/fft/fft.c
msgid "input array length must be power of 2"
@@ -3112,7 +3292,7 @@ msgstr "sintaxis inválida para número"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "io must be rtc io"
-msgstr ""
+msgstr "io debe ser rtc io"
#: py/objtype.c
msgid "issubclass() arg 1 must be a class"
@@ -3213,7 +3393,7 @@ msgstr "max_length debe ser 0-%d cuando fixed_length es %s"
#: shared-bindings/_bleio/Characteristic.c shared-bindings/_bleio/Descriptor.c
msgid "max_length must be >= 0"
-msgstr ""
+msgstr "max_length debe ser >= 0"
#: extmod/ulab/code/ndarray.c
msgid "maximum number of dimensions is 4"
@@ -3233,7 +3413,7 @@ msgstr "maxiter debe ser > 0"
#: extmod/ulab/code/numerical/numerical.c
msgid "median argument must be an ndarray"
-msgstr ""
+msgstr "argumento median debe ser una matriz ndarray"
#: py/runtime.c
#, c-format
@@ -3244,6 +3424,11 @@ msgstr "la asignación de memoria falló, asignando %u bytes"
msgid "memory allocation failed, heap is locked"
msgstr "la asignación de memoria falló, el heap está bloqueado"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+"memoryview: la longitud no es un múltiplo del tamaño del elemento (itemsize)"
+
#: py/builtinimport.c
msgid "module not found"
msgstr "módulo no encontrado"
@@ -3319,7 +3504,7 @@ msgstr "no se ha encontrado ningún enlace para nonlocal"
#: shared-module/msgpack/__init__.c
msgid "no default packer"
-msgstr ""
+msgstr "no hay empaquetador por defecto"
#: py/builtinimport.c
msgid "no module named '%q'"
@@ -3362,11 +3547,11 @@ msgstr ""
#: ports/nrf/common-hal/_bleio/Adapter.c
msgid "non-zero timeout must be > 0.01"
-msgstr ""
+msgstr "el tiempo de espera non-zero deber ser > 0.01"
#: shared-bindings/_bleio/Adapter.c
msgid "non-zero timeout must be >= interval"
-msgstr ""
+msgstr "el tiempo de espera non-zero debe ser >= intervalo"
#: extmod/ulab/code/linalg/linalg.c
msgid "norm is defined for 1D and 2D arrays"
@@ -3391,7 +3576,7 @@ msgstr "el número de puntos debe ser al menos 2"
#: py/builtinhelp.c
msgid "object "
-msgstr ""
+msgstr "objecto "
#: py/obj.c
msgid "object '%q' is not a tuple or list"
@@ -3447,11 +3632,11 @@ msgstr "offset es demasiado grande"
#: shared-bindings/dualbank/__init__.c
msgid "offset must be >= 0"
-msgstr ""
+msgstr "offset debe ser >= 0"
#: extmod/ulab/code/ulab_create.c
msgid "offset must be non-negative and no greater than buffer length"
-msgstr ""
+msgstr "offset debe ser non-negative y no mayo que la longitud del buffer"
#: py/objstr.c py/objstrunicode.c
msgid "offset out of bounds"
@@ -3561,6 +3746,10 @@ msgstr "pop de un PulseIn vacío"
msgid "pop from empty %q"
msgstr "pop desde %q vacía"
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr "port debe ser be >= 0"
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "el 3er argumento de pow() no puede ser 0"
@@ -3577,6 +3766,7 @@ msgstr "pow() con 3 argumentos requiere enteros"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3594,6 +3784,14 @@ msgstr "presionando botón de arranque al inicio.\n"
msgid "pressing both buttons at start up.\n"
msgstr "presionando ambos botones al inicio.\n"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr "pull_threshold debe esta entre 1 y 32"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr "push_threshold debe esta entre 1 y 32"
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "desbordamiento de cola(queue)"
@@ -3671,7 +3869,7 @@ msgstr "forma tiene que ser una tupla"
#: shared-module/msgpack/__init__.c
msgid "short read"
-msgstr ""
+msgstr "lectura corta"
#: py/objstr.c
msgid "sign not allowed in string format specifier"
@@ -3791,7 +3989,7 @@ msgstr "limite debe ser en el rango 0-65536"
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "tile must be greater than zero"
-msgstr ""
+msgstr "tile debe sera mas grande que cero"
#: shared-bindings/time/__init__.c
msgid "time.struct_time() takes a 9-sequence"
@@ -3799,6 +3997,7 @@ msgstr "time.struct_time() toma un sequencio 9"
#: ports/esp32s2/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"
msgstr ""
"la duración de tiempo de espera ha excedido la capacidad máxima del valor"
@@ -3809,7 +4008,7 @@ msgstr "el tiempo de espera debe ser 0.0-100.0 segundos"
#: ports/nrf/common-hal/_bleio/Adapter.c
msgid "timeout must be < 655.35 secs"
-msgstr ""
+msgstr "timeout debe ser < 655.35 segundos"
#: shared-bindings/_bleio/CharacteristicBuffer.c
msgid "timeout must be >= 0.0"
@@ -3837,7 +4036,7 @@ msgstr "demasiados argumentos provistos con el formato dado"
#: extmod/ulab/code/ulab_create.c
msgid "too many dimensions"
-msgstr ""
+msgstr "demasiadas dimensiones"
#: extmod/ulab/code/ndarray.c
msgid "too many indices"
@@ -3850,7 +4049,7 @@ msgstr "demasiados valores para descomprimir (%d esperado)"
#: extmod/ulab/code/approx/approx.c
msgid "trapz is defined for 1D arrays"
-msgstr ""
+msgstr "trapz esta definido para matrices 1D"
#: extmod/ulab/code/approx/approx.c
msgid "trapz is defined for 1D arrays of equal length"
@@ -3858,7 +4057,7 @@ msgstr "trapz está definido para arreglos 1D de igual tamaño"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "trigger level must be 0 or 1"
-msgstr ""
+msgstr "nivel de accionamiento debe ser 0 o 1"
#: py/obj.c
msgid "tuple/list has wrong length"
@@ -4000,7 +4199,7 @@ msgstr "los vectores deben tener el mismo tamaño"
#: ports/esp32s2/common-hal/alarm/pin/__init__.c
msgid "wakeup conflict"
-msgstr ""
+msgstr "conflicto de wakeup"
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "watchdog not initialized"
@@ -4010,13 +4209,18 @@ msgstr "watchdog no inicializado"
msgid "watchdog timeout must be greater than 0"
msgstr "el tiempo de espera del perro guardián debe ser mayor a 0"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr "ancho debe estar entre 2 y 8 (inclusivamente), no %d"
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr "el ancho debe ser mayor que cero"
#: ports/esp32s2/common-hal/wifi/Radio.c
msgid "wifi is not enabled"
-msgstr ""
+msgstr "wifi no esta habilitado"
#: shared-bindings/_bleio/Adapter.c
msgid "window must be <= interval"
@@ -4056,7 +4260,7 @@ msgstr "valor x fuera de límites"
#: ports/esp32s2/common-hal/audiobusio/__init__.c
msgid "xTaskCreate failed"
-msgstr ""
+msgstr "fallo en xTaskCreate"
#: shared-bindings/displayio/Shape.c
msgid "y should be an int"
@@ -4082,6 +4286,9 @@ 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 "SDA or SCL needs a pull up"
+#~ msgstr "SDA o SCL necesitan una pull up"
+
#~ msgid "%d address pins and %d rgb pins indicate a height of %d, not %d"
#~ msgstr ""
#~ "%d pines de dirección y %d pines rgb indican una altura de %d, no de %d"
diff --git a/locale/fil.po b/locale/fil.po
index 2fdcd2f04..1eecc49dc 100644
--- a/locale/fil.po
+++ b/locale/fil.po
@@ -342,6 +342,10 @@ msgstr "Lahat ng I2C peripherals ginagamit"
msgid "All event channels in use"
msgstr "Lahat ng event channels ginagamit"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr ""
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "Lahat ng sync event channels ay ginagamit"
@@ -362,6 +366,7 @@ msgstr "Lahat ng timers para sa pin na ito ay ginagamit"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Lahat ng timer ginagamit"
@@ -390,6 +395,7 @@ msgstr ""
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "Hindi supportado ang AnalogOut"
@@ -592,6 +598,7 @@ msgstr "Hindi mabura ang values"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "Hindi makakakuha ng pull habang nasa output mode"
@@ -630,6 +637,10 @@ msgstr "Hindi ma-remount '/' kapag aktibo ang USB."
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
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "Hindi ma i-set ang value kapag ang direksyon ay input."
@@ -870,11 +881,12 @@ msgstr "Ginagamit na ang EXTINT channel"
msgid "Error in regex"
msgstr "May pagkakamali sa REGEX"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -930,7 +942,7 @@ msgstr ""
msgid "FFT is implemented for linear arrays only"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr ""
@@ -1058,6 +1070,10 @@ msgstr "I/O operasyon sa saradong file"
msgid "I2C Init Error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr ""
@@ -1083,10 +1099,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1095,6 +1120,31 @@ msgstr ""
msgid "Input/output error"
msgstr "May mali sa Input/Output"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr ""
@@ -1146,7 +1196,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr "Mali ang PWM frequency"
@@ -1240,6 +1290,8 @@ msgstr "Mali ang pin para sa kanang channel"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "Mali ang pins"
@@ -1268,7 +1320,7 @@ msgstr ""
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1276,10 +1328,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr ""
@@ -1296,10 +1344,6 @@ msgstr "May hindi tama sa wave file"
msgid "Invalid word/bit length"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr ""
@@ -1361,6 +1405,36 @@ msgstr "Ang delay ng startup ng mikropono ay dapat na nasa 0.0 hanggang 1.0"
msgid "Missing MISO or MOSI Pin"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr ""
@@ -1393,9 +1467,14 @@ msgstr "Walang DAC sa chip"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "Walang DMA channel na mahanap"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1414,14 +1493,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Walang TX pin"
@@ -1478,6 +1557,16 @@ msgstr ""
msgid "No network with that ssid"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr ""
@@ -1536,6 +1625,10 @@ 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/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
@@ -1585,10 +1678,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "Oversample ay dapat multiple ng 8."
@@ -1609,6 +1707,7 @@ msgstr ""
"PWM frequency hindi writable kapag variable_frequency ay False sa pag buo."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr ""
@@ -1621,11 +1720,20 @@ msgstr ""
msgid "Permission denied"
msgstr "Walang pahintulot"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "Ang pin ay walang kakayahan sa ADC"
@@ -1651,6 +1759,10 @@ msgid ""
"constructor"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr "Kasama ang kung ano pang modules na sa filesystem\n"
@@ -1686,10 +1798,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "Pull hindi ginagamit kapag ang direksyon ay output."
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""
@@ -1698,6 +1834,10 @@ msgstr ""
msgid "RNG Init Error"
msgstr ""
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1705,6 +1845,7 @@ msgstr ""
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "RTC calibration ay hindi supportado ng board na ito"
@@ -1713,7 +1854,7 @@ msgid "RTC is not supported on this board"
msgstr "Hindi supportado ang RTC sa board na ito"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr ""
@@ -1771,11 +1912,6 @@ msgstr ""
msgid "SD card CSD format not supported"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "Kailangan ng pull up resistors ang SDA o SCL"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1794,6 +1930,10 @@ msgstr ""
msgid "SPI Re-initialization error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "Sample rate ay dapat positibo"
@@ -1824,6 +1964,14 @@ msgstr "Serializer ginagamit"
msgid "Server side context cannot have hostname"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
@@ -1855,6 +2003,14 @@ msgstr "Binibiyak gamit ang sub-captures"
msgid "Stack size must be at least 256"
msgstr "Ang laki ng stack ay dapat na hindi bababa sa 256"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "Stream kulang ng readinto() o write() method."
@@ -1988,6 +2144,10 @@ msgstr ""
msgid "UART Re-init error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr ""
@@ -2014,6 +2174,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr "Hindi ma-allocate ang buffers para sa naka-sign na conversion"
@@ -2052,7 +2213,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr "hindi inaasahang indent"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2093,7 +2254,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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"
@@ -2147,6 +2309,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr "BABALA: Ang pangalan ng file ay may dalawang extension\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2359,7 +2522,7 @@ msgstr "aarehas na haba dapat ang buffer slices"
msgid "buffer too small"
msgstr "masyadong maliit ang buffer"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -3221,6 +3384,10 @@ msgstr "nabigo ang paglalaan ng memorya, paglalaan ng %u bytes"
msgid "memory allocation failed, heap is locked"
msgstr "abigo ang paglalaan ng memorya, ang heap ay naka-lock"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr "module hindi nakita"
@@ -3537,6 +3704,10 @@ msgstr "pop mula sa walang laman na PulseIn"
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "pow() 3rd argument ay hindi maaring 0"
@@ -3553,6 +3724,7 @@ msgstr "pow() na may 3 argumento kailangan ng integers"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3570,6 +3742,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "puno na ang pila (overflow)"
@@ -3776,6 +3956,7 @@ msgstr "time.struct_time() kumukuha ng 9-sequence"
#: ports/esp32s2/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"
msgstr ""
@@ -3987,6 +4168,11 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
@@ -4061,6 +4247,9 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
+#~ msgid "SDA or SCL needs a pull up"
+#~ msgstr "Kailangan ng pull up resistors ang SDA o SCL"
+
#~ msgid "tuple index out of range"
#~ msgstr "indeks ng tuple wala sa sakop"
diff --git a/locale/fr.po b/locale/fr.po
index 1842d6d3e..a53d8658e 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-01-17 12:55+0000\n"
+"PO-Revision-Date: 2021-02-21 22:27+0000\n"
"Last-Translator: Hugo Dahl <hugo@code-jedi.com>\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.5-dev\n"
+"X-Generator: Weblate 4.5\n"
#: main.c
msgid ""
@@ -54,7 +54,7 @@ msgstr " Fichier \"%q\", ligne %d"
#: py/builtinhelp.c
msgid " is of type %q\n"
-msgstr ""
+msgstr " est de type %q\n"
#: main.c
msgid " output:\n"
@@ -70,6 +70,8 @@ msgstr "%%c nécessite un chiffre entier 'int' ou un caractère 'char'"
msgid ""
"%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d"
msgstr ""
+"%d broches d'adresse, %d broches RGB et %d pour tile indique une hauteur de "
+"%d, et non %d"
#: ports/atmel-samd/common-hal/sdioio/SDCard.c
msgid "%q failure: %d"
@@ -348,6 +350,10 @@ msgstr "Tous les périphériques UART sont utilisés"
msgid "All event channels in use"
msgstr "Tous les canaux d'événements sont utilisés"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr "Tous les automates finis sont utilisés"
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "Tous les canaux d'événements sync (sync event channels) sont utilisés"
@@ -368,6 +374,7 @@ msgstr "Tous les minuteurs pour cette broche sont utilisés"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Tous les minuteurs sont utilisés"
@@ -396,6 +403,7 @@ msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée"
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "Fonctionnalité AnalogOut non supportée"
@@ -606,6 +614,7 @@ msgstr "Impossible de supprimer les valeurs"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "Ne peut être tiré ('pull') en mode sortie ('output')"
@@ -646,6 +655,10 @@ 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
+msgid "Cannot set socket options"
+msgstr "Ne peut définir les options de socket"
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr ""
@@ -832,7 +845,7 @@ msgstr "La broche 'Data 0' doit être aligné sur l'octet"
#: ports/esp32s2/common-hal/displayio/ParallelBus.c
msgid "Data 0 pin must be byte aligned."
-msgstr ""
+msgstr "La broche Data 0 doit être aligné sur l'octet."
#: shared-module/audiocore/WaveFile.c
msgid "Data chunk must follow fmt chunk"
@@ -889,11 +902,12 @@ msgstr "Canal EXTINT déjà utilisé"
msgid "Error in regex"
msgstr "Erreur dans l'expression régulière"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
-msgstr ""
+msgstr "Erreur : Impossible de lier"
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -948,7 +962,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 tableaux linéaires"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr "Échec du handshake SSL"
@@ -1078,6 +1092,10 @@ msgstr "Opération d'E/S sur un fichier fermé"
msgid "I2C Init Error"
msgstr "Erreur d'initialisation I2C"
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr "périphérique I2C utilisé"
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr "I2SOut n'est pas disponible"
@@ -1103,10 +1121,21 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr "Taille de tampon incorrecte"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr "Taille du programme d'initialisation non valide"
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr "Échec d'initialisation par manque de mémoire"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+"La taille (%d) du tampon d'entrée doit être un multiple du nombre (%d) de "
+"brins"
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr "L'entrée prend trop de temps"
@@ -1115,6 +1144,35 @@ msgstr "L'entrée prend trop de temps"
msgid "Input/output error"
msgstr "Erreur d'entrée/sortie"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d jumps on pin"
+msgstr "Instruction %d saute sur la broche"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts in more bits than pin count"
+msgstr ""
+"Instruction %d décale vers l'intérieur de plus de bits que le nombre de "
+"broches"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+"instruction %d décale vers l'extérieur de plus de bits que le nombre de "
+"broches"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr "instruction %d utilise des broches supplémentaires"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr "instruction %d attend sur une entrée hors du compte"
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr "Authentification insuffisante"
@@ -1166,7 +1224,7 @@ msgstr "Broche DAC non valide fournie"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/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"
@@ -1260,6 +1318,8 @@ msgstr "Broche invalide pour le canal droit"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "Broches invalides"
@@ -1288,18 +1348,14 @@ msgstr "'security_mode' invalide"
msgid "Invalid size"
msgstr "Taille invalide"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
-msgstr ""
+msgstr "Socket non valide pour TLS"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "Invalid state"
msgstr "État invalide"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr "Voix invalide"
@@ -1316,10 +1372,6 @@ msgstr "Fichier WAVE invalide"
msgid "Invalid word/bit length"
msgstr "Longueur de mot / bit invalide"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr "La clé doit comporter 16, 24 ou 32 octets"
@@ -1381,6 +1433,37 @@ msgstr "Le délais au démarrage du micro doit être entre 0.0 et 1.0"
msgid "Missing MISO or MOSI Pin"
msgstr "Broche MISO ou MOSI manquante"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr "first_in_pin manquant. Instruction %d lit une/des broche(s)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr "first_in_pin manquant. Instruction %d est déplacée par la/les broche(s)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr "first_in_pin manquant. L'instruction %d attends dépends de la broche"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+"first_out_pin manquant. Instruction %d est déplacée par la/les broche(s)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr "first_out_pin manquant. Instruction %d écrit un/des broche(s)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr "first_set_pin manquant. L'instruction %d règle la/les broche(s)"
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr "Doit être une sous-classe de %q."
@@ -1413,9 +1496,14 @@ msgstr "Pas de DAC sur la puce"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "Aucun canal DMA trouvé"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr "Aucun minuteur de rythme DMA trouvé"
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1434,14 +1522,14 @@ msgstr "Pas de broche MOSI"
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Pas de broche TX"
@@ -1498,6 +1586,16 @@ msgstr "Plus de minuteurs disponibles sur cette broche."
msgid "No network with that ssid"
msgstr "Aucun réseau avec ce ssid"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+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/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "No pull up found on SDA or SCL; check your wiring"
+msgstr "Aucun pull up trouvé sur SDA ou SCL; vérifiez votre cablage"
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr "Pas de pulldown sur la broche ; 1Mohm recommandé"
@@ -1555,6 +1653,10 @@ msgstr "Parité impaire non supportée"
msgid "Only 8 or 16 bit mono with "
msgstr "Uniquement 8 ou 16 bit mono avec "
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr "Seulement des IN/OUT jusqu'à 8 est supporté"
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr "Seulement les adresses IPv4 sont supportées"
@@ -1608,10 +1710,15 @@ msgstr "Timeout de l'opération"
msgid "Out of memory"
msgstr "Hors de mémoire"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr "Plus de sockets"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr "Tampon de sortie doit être au moins %d octets"
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "Le sur-échantillonage doit être un multiple de 8."
@@ -1635,6 +1742,7 @@ msgstr ""
"à la construction."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr "ParallelBus pas encore supporté"
@@ -1647,11 +1755,20 @@ msgstr "Périphérique en utilisation"
msgid "Permission denied"
msgstr "Permission refusée"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr "Nombre de broches doit être au moins 1"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr "Nombre de broches trop élevé"
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "La broche 'pin' ne supporte pas les capacitées ADC"
@@ -1680,6 +1797,10 @@ msgstr ""
"octets idéal. Si cela ne peut pas être évité, transmettez allow_inefficient "
"= True au constructeur"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr "Les broches doivent partager la tranche PWM"
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr "Ainsi que tout autres modules présents sur le système de fichiers\n"
@@ -1722,10 +1843,34 @@ msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
"Feinte de someil profond jusqu'à l'alarme, CTRL-C ou écriture au fichier.\n"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr "Le programme fait des entrées sans charger d'ISR"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr "Le programme fait des sorties sans charger d'OSR"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr "Le programme doit contenir au moins une instruction de 16 bits."
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr "Taille du programme invalide"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr "Programme trop grand"
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'."
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr "Mode RAISE n'est pas implémenté"
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "Erreur de désinitiation du RNG (RNG DeInit)"
@@ -1734,6 +1879,10 @@ msgstr "Erreur de désinitiation du RNG (RNG DeInit)"
msgid "RNG Init Error"
msgstr "Erreur d'initialisation du RNG (RNG Init)"
+#: ports/nrf/common-hal/busio/UART.c
+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/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1741,6 +1890,7 @@ 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/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "La calibration du RTC non supportée sur cette carte"
@@ -1749,7 +1899,7 @@ msgid "RTC is not supported on this board"
msgstr "RTC non supporté sur cette carte"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr "RTS / CTS / RS485 Pas encore supporté sur cet appareil"
@@ -1806,11 +1956,6 @@ msgstr "Exécution en mode sécurisé! "
msgid "SD card CSD format not supported"
msgstr "Le format de carte SD CSD n'est pas supporté"
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1829,6 +1974,10 @@ msgstr "Erreur d'initialisation SPI"
msgid "SPI Re-initialization error"
msgstr "Erreur de réinitialisation SPI"
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr "Périphérique SPI utilisé"
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "Le taux d'échantillonage doit être positif"
@@ -1859,6 +2008,14 @@ msgstr "Sérialiseur en cours d'utilisation"
msgid "Server side context cannot have hostname"
msgstr "Un contexte niveau serveur ne peut avoir de hostname"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr "Nombre de broches configurées doit être entre 1 et 5"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr "Nombre de broches Side configurées doit être entre 1 et 5"
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr "Taille n'est pas supportée"
@@ -1890,6 +2047,14 @@ msgstr "Fractionnement avec des sous-captures"
msgid "Stack size must be at least 256"
msgstr "La pile doit être au moins de 256"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr "Canal stéréo gauche doit être sur le canal PWM A"
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr "Canal stéréo droit doit être sur le canal PWM B"
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "Il manque une méthode readinto() ou write() au flux."
@@ -2035,6 +2200,10 @@ msgstr "Erreur d'initialisation UART"
msgid "UART Re-init error"
msgstr "Erreur de réinitialisation UART"
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr "UART n'est pas encore supporté"
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr "Erreur d'écriture UART"
@@ -2064,6 +2233,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr "Impossible d'allouer des tampons pour une conversion signée"
@@ -2101,7 +2271,7 @@ msgstr "Écriture impossible vers sleep_memory."
msgid "Unexpected nrfx uuid type"
msgstr "Type inattendu pour l'uuid nrfx"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/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"
@@ -2145,7 +2315,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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é"
@@ -2197,6 +2368,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr "ATTENTION : le nom de fichier de votre code a deux extensions\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
"WatchDogTimer ne peut pas être désinitialisé une fois que le mode est réglé "
@@ -2411,7 +2583,7 @@ msgstr "les tranches de tampon doivent être de longueurs égales"
msgid "buffer too small"
msgstr "tampon trop petit"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr "tampon trop petit pour le nombre d'octets demandé"
@@ -3277,6 +3449,10 @@ msgstr "l'allocation de mémoire a échoué en allouant %u octets"
msgid "memory allocation failed, heap is locked"
msgstr "l'allocation de mémoire a échoué, le tas est vérrouillé"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr "memoryview: length n'est pas un multiple de itemsize"
+
#: py/builtinimport.c
msgid "module not found"
msgstr "module introuvable"
@@ -3423,7 +3599,7 @@ msgstr "le nombre de points doit être d'au moins 2"
#: py/builtinhelp.c
msgid "object "
-msgstr ""
+msgstr "objet "
#: py/obj.c
msgid "object '%q' is not a tuple or list"
@@ -3596,6 +3772,10 @@ msgstr "'pop' d'une entrée PulseIn vide"
msgid "pop from empty %q"
msgstr "pop sur %q vide"
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr "port doit être >= 0"
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "le 3e argument de pow() ne peut être 0"
@@ -3612,6 +3792,7 @@ msgstr "pow() avec 3 arguments nécessite des entiers"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3629,6 +3810,14 @@ msgstr "bouton boot appuyé lors du démarrage.\n"
msgid "pressing both buttons at start up.\n"
msgstr "les deux boutons appuyés lors du démarrage.\n"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr "pull_threshold doit être entre 1 et 32"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr "push_threshold doit être entre 1 et 32"
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "dépassement de file"
@@ -3827,7 +4016,7 @@ msgstr "le seuil doit être dans la portée 0-65536"
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "tile must be greater than zero"
-msgstr ""
+msgstr "tile doit être plus que zéro"
#: shared-bindings/time/__init__.c
msgid "time.struct_time() takes a 9-sequence"
@@ -3835,6 +4024,7 @@ msgstr "time.struct_time() prend une séquence de longueur 9"
#: ports/esp32s2/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"
msgstr "le délai d'expiration a dépassé la valeur maximale prise en charge"
@@ -4045,13 +4235,18 @@ msgstr "chien de garde (watchdog) non initialisé"
msgid "watchdog timeout must be greater than 0"
msgstr "watchdog timeout doit être supérieur à 0"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr "width doit être entre 2 et 8 (inclusivement), non %d"
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
-msgstr "width doit être plus grand que zero"
+msgstr "width doit être plus que zero"
#: ports/esp32s2/common-hal/wifi/Radio.c
msgid "wifi is not enabled"
-msgstr ""
+msgstr "wifi n’est pas activé"
#: shared-bindings/_bleio/Adapter.c
msgid "window must be <= interval"
@@ -4117,6 +4312,15 @@ 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 "SDA or SCL needs a pull up"
+#~ msgstr "SDA ou SCL a besoin d'une résistance de tirage ('pull up')"
+
+#~ msgid "Invalid use of TLS Socket"
+#~ msgstr "Utilisation incorrecte de socket TLS"
+
+#~ msgid "Issue setting SO_REUSEADDR"
+#~ msgstr "Problème en activant SO_REUSEADDR"
+
#~ msgid "%d address pins and %d rgb pins indicate a height of %d, not %d"
#~ msgstr ""
#~ "Les broches d'adresse %d et les broches RVB %d indiquent une hauteur de "
diff --git a/locale/hi.po b/locale/hi.po
index 88c82d4b8..3d8100697 100644
--- a/locale/hi.po
+++ b/locale/hi.po
@@ -339,6 +339,10 @@ msgstr ""
msgid "All event channels in use"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr ""
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr ""
@@ -359,6 +363,7 @@ msgstr ""
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr ""
@@ -387,6 +392,7 @@ msgstr ""
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr ""
@@ -586,6 +592,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr ""
@@ -623,6 +630,10 @@ msgstr ""
msgid "Cannot reset into bootloader because no bootloader is present."
msgstr ""
+#: ports/esp32s2/common-hal/socketpool/Socket.c
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr ""
@@ -859,11 +870,12 @@ msgstr ""
msgid "Error in regex"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -917,7 +929,7 @@ msgstr ""
msgid "FFT is implemented for linear arrays only"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr ""
@@ -1045,6 +1057,10 @@ msgstr ""
msgid "I2C Init Error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr ""
@@ -1068,10 +1084,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1080,6 +1105,31 @@ msgstr ""
msgid "Input/output error"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr ""
@@ -1131,7 +1181,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr ""
@@ -1225,6 +1275,8 @@ msgstr ""
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr ""
@@ -1253,7 +1305,7 @@ msgstr ""
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1261,10 +1313,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr ""
@@ -1281,10 +1329,6 @@ msgstr ""
msgid "Invalid word/bit length"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr ""
@@ -1346,6 +1390,36 @@ msgstr ""
msgid "Missing MISO or MOSI Pin"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr ""
@@ -1378,9 +1452,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1399,14 +1478,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr ""
@@ -1463,6 +1542,16 @@ msgstr ""
msgid "No network with that ssid"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr ""
@@ -1518,6 +1607,10 @@ msgstr ""
msgid "Only 8 or 16 bit mono with "
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
@@ -1567,10 +1660,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr ""
@@ -1590,6 +1688,7 @@ msgid ""
msgstr ""
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr ""
@@ -1602,11 +1701,20 @@ msgstr ""
msgid "Permission denied"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr ""
@@ -1632,6 +1740,10 @@ msgid ""
"constructor"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr ""
@@ -1667,10 +1779,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr ""
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""
@@ -1679,6 +1815,10 @@ msgstr ""
msgid "RNG Init Error"
msgstr ""
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1686,6 +1826,7 @@ msgstr ""
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr ""
@@ -1694,7 +1835,7 @@ msgid "RTC is not supported on this board"
msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr ""
@@ -1751,11 +1892,6 @@ msgstr ""
msgid "SD card CSD format not supported"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr ""
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1774,6 +1910,10 @@ msgstr ""
msgid "SPI Re-initialization error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr ""
@@ -1804,6 +1944,14 @@ msgstr ""
msgid "Server side context cannot have hostname"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
@@ -1835,6 +1983,14 @@ msgstr ""
msgid "Stack size must be at least 256"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr ""
@@ -1968,6 +2124,10 @@ msgstr ""
msgid "UART Re-init error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr ""
@@ -1994,6 +2154,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr ""
@@ -2031,7 +2192,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2072,7 +2233,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c
msgid "Unsupported baudrate"
msgstr ""
@@ -2123,6 +2285,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr ""
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2328,7 +2491,7 @@ msgstr ""
msgid "buffer too small"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -3174,6 +3337,10 @@ msgstr ""
msgid "memory allocation failed, heap is locked"
msgstr ""
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr ""
@@ -3488,6 +3655,10 @@ msgstr ""
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr ""
@@ -3504,6 +3675,7 @@ msgstr ""
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3521,6 +3693,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr ""
@@ -3724,6 +3904,7 @@ msgstr ""
#: ports/esp32s2/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"
msgstr ""
@@ -3934,6 +4115,11 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
diff --git a/locale/it_IT.po b/locale/it_IT.po
index b380b2fae..0153dc889 100644
--- a/locale/it_IT.po
+++ b/locale/it_IT.po
@@ -7,25 +7,31 @@ 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: 2018-10-02 16:27+0200\n"
-"Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n"
+"PO-Revision-Date: 2021-02-18 15:50+0000\n"
+"Last-Translator: Luca De Filippo <luca.defilippo@translationcommons.org>\n"
"Language-Team: \n"
"Language: it_IT\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.5\n"
#: main.c
msgid ""
"\n"
"Code done running.\n"
msgstr ""
+"\n"
+"Caricamento codice pronto.\n"
#: main.c
msgid ""
"\n"
"Code stopped by auto-reload.\n"
msgstr ""
+"\n"
+"Codice fermato dall'auto-ricarica.\n"
#: supervisor/shared/safe_mode.c
msgid ""
@@ -33,6 +39,9 @@ msgid ""
"Please file an issue with the contents of your CIRCUITPY drive at \n"
"https://github.com/adafruit/circuitpython/issues\n"
msgstr ""
+"\n"
+"Per favore, segnala il problema con il contenuto del tuo CIRCUITPY a\n"
+"https://github.com/adafruit/circuitpython/issues\n"
#: py/obj.c
msgid " File \"%q\""
@@ -44,7 +53,7 @@ msgstr " File \"%q\", riga %d"
#: py/builtinhelp.c
msgid " is of type %q\n"
-msgstr ""
+msgstr " è di tipo %q\n"
#: main.c
msgid " output:\n"
@@ -60,10 +69,11 @@ msgstr "%%c necessita di int o char"
msgid ""
"%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d"
msgstr ""
+"%d pin indirizzo, %d pin rgb e %d tessere indicano l'altezza di %d, non %d"
#: ports/atmel-samd/common-hal/sdioio/SDCard.c
msgid "%q failure: %d"
-msgstr ""
+msgstr "%q fallito: %d"
#: shared-bindings/microcontroller/Pin.c
msgid "%q in use"
@@ -79,15 +89,15 @@ msgstr "indice %q fuori intervallo"
#: py/obj.c
msgid "%q indices must be integers, not %q"
-msgstr ""
+msgstr "%q gli indici devono essere interi, non %q"
#: shared-bindings/vectorio/Polygon.c
msgid "%q list must be a list"
-msgstr ""
+msgstr "lista %q deve essere una lista"
#: shared-bindings/memorymonitor/AllocationAlarm.c
msgid "%q must be >= 0"
-msgstr ""
+msgstr "%q deve essere >= 0"
#: shared-bindings/_bleio/CharacteristicBuffer.c
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
@@ -100,20 +110,19 @@ msgstr "slice del buffer devono essere della stessa lunghezza"
#: shared-module/vectorio/Polygon.c
msgid "%q must be a tuple of length 2"
-msgstr ""
+msgstr "%q deve essere una tupla di lunghezza 2"
#: shared-bindings/canio/Match.c
msgid "%q out of range"
-msgstr ""
+msgstr "%q oltre il limite"
#: ports/atmel-samd/common-hal/microcontroller/Pin.c
msgid "%q pin invalid"
-msgstr ""
+msgstr "%q pin non valido"
#: shared-bindings/fontio/BuiltinFont.c
-#, fuzzy
msgid "%q should be an int"
-msgstr "y dovrebbe essere un int"
+msgstr "%q dovrebbe essere un int"
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
@@ -122,7 +131,7 @@ msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
#, c-format
msgid "%s error 0x%x"
-msgstr ""
+msgstr "%s errore 0x%x"
#: py/argcheck.c
msgid "'%q' argument required"
@@ -130,93 +139,93 @@ msgstr "'%q' argomento richiesto"
#: py/runtime.c
msgid "'%q' object cannot assign attribute '%q'"
-msgstr ""
+msgstr "L'oggetto '%q' non può assegnare l'attributo '%q'"
#: py/proto.c
msgid "'%q' object does not support '%q'"
-msgstr ""
+msgstr "L'oggetto '%q' non supporta '%q'"
#: py/obj.c
msgid "'%q' object does not support item assignment"
-msgstr ""
+msgstr "L'oggetto '%q' non supporta l'assegnazione dell'elemento"
#: py/obj.c
msgid "'%q' object does not support item deletion"
-msgstr ""
+msgstr "L'oggetto '%q' non supporta la rimozione dell'elemento"
#: py/runtime.c
msgid "'%q' object has no attribute '%q'"
-msgstr ""
+msgstr "L'oggetto '%q' non ha attributi '%q'"
#: py/runtime.c
msgid "'%q' object is not an iterator"
-msgstr ""
+msgstr "L'oggetto '%q' non è un iteratore"
#: py/objtype.c py/runtime.c
msgid "'%q' object is not callable"
-msgstr ""
+msgstr "L'oggetto '%q' non è richiamabile"
#: py/runtime.c
msgid "'%q' object is not iterable"
-msgstr ""
+msgstr "L'oggetto '%q' non è iterabile"
#: py/obj.c
msgid "'%q' object is not subscriptable"
-msgstr ""
+msgstr "l'oggetto '%q' non è riscrivibile"
#: py/emitinlinethumb.c py/emitinlinextensa.c
#, c-format
msgid "'%s' expects a label"
-msgstr "'%s' aspetta una etichetta"
+msgstr "'%s' richiede una etichetta"
#: py/emitinlinethumb.c py/emitinlinextensa.c
#, c-format
msgid "'%s' expects a register"
-msgstr "'%s' aspetta un registro"
+msgstr "'%s' richiede un registro"
#: py/emitinlinethumb.c
-#, fuzzy, c-format
+#, c-format
msgid "'%s' expects a special register"
-msgstr "'%s' aspetta un registro"
+msgstr "'%s' richiede un registro speciale"
#: py/emitinlinethumb.c
-#, fuzzy, c-format
+#, c-format
msgid "'%s' expects an FPU register"
-msgstr "'%s' aspetta un registro"
+msgstr "'%s' richiede un registro FPU"
#: py/emitinlinethumb.c
-#, fuzzy, c-format
+#, c-format
msgid "'%s' expects an address of the form [a, b]"
-msgstr "'%s' aspetta un registro"
+msgstr "'%s' richiede un indirizzo dal modulo [a, b]"
#: py/emitinlinethumb.c py/emitinlinextensa.c
#, c-format
msgid "'%s' expects an integer"
-msgstr "'%s' aspetta un intero"
+msgstr "'%s' richiede un valore intero"
#: py/emitinlinethumb.c
-#, fuzzy, c-format
+#, c-format
msgid "'%s' expects at most r%d"
-msgstr "'%s' aspetta un registro"
+msgstr "'%s' richiede almeno r%d"
#: py/emitinlinethumb.c
-#, fuzzy, c-format
+#, c-format
msgid "'%s' expects {r0, r1, ...}"
-msgstr "'%s' aspetta un registro"
+msgstr "'%s' richiede {r0, r1, ...}"
#: py/emitinlinextensa.c
-#, fuzzy, c-format
+#, c-format
msgid "'%s' integer %d is not within range %d..%d"
-msgstr "intero '%s' non è nell'intervallo %d..%d"
+msgstr "Valore intero '%s' %d non è nell'intervallo %d..%d"
#: py/emitinlinethumb.c
-#, fuzzy, c-format
+#, c-format
msgid "'%s' integer 0x%x does not fit in mask 0x%x"
-msgstr "intero '%s' non è nell'intervallo %d..%d"
+msgstr "Valore intero '%s' 0x%x non rientra nella maschera 0x%x"
#: py/objstr.c
msgid "'=' alignment not allowed in string format specifier"
-msgstr "aligniamento '=' non è permesso per il specificatore formato string"
+msgstr "Allineamento'=' non è permesso per lo specificatore formato stringa"
#: shared-module/struct/__init__.c
msgid "'S' and 'O' are not supported format types"
@@ -233,22 +242,23 @@ msgstr "'await' al di fuori della funzione"
#: py/compile.c
msgid "'await', 'async for' or 'async with' outside async function"
msgstr ""
+"'await', 'async for' o 'async with' fuori della funzione sincronizzazione"
#: py/compile.c
msgid "'break' outside loop"
-msgstr "'break' al di fuori del ciclo"
+msgstr "'break' fuori del ciclo"
#: py/compile.c
msgid "'continue' outside loop"
-msgstr "'continue' al di fuori del ciclo"
+msgstr "'continue' fuori del ciclo"
#: py/objgenerator.c
msgid "'coroutine' object is not an iterator"
-msgstr ""
+msgstr "L'oggetto 'coroutine' non è un iteratore"
#: py/compile.c
msgid "'data' requires at least 2 arguments"
-msgstr "'data' richiede almeno 2 argomento"
+msgstr "'data' richiede almeno 2 argomenti"
#: py/compile.c
msgid "'data' requires integer arguments"
@@ -264,7 +274,7 @@ msgstr "'return' al di fuori della funzione"
#: py/compile.c
msgid "'yield from' inside async function"
-msgstr ""
+msgstr "'yield from' è nella funzione sincronizzazione"
#: py/compile.c
msgid "'yield' outside function"
@@ -288,29 +298,29 @@ msgstr "pow() con tre argmomenti non supportata"
#: shared-module/msgpack/__init__.c
msgid "64 bit types"
-msgstr ""
+msgstr "Tipo 64 bits"
#: ports/atmel-samd/common-hal/countio/Counter.c
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
msgid "A hardware interrupt channel is already in use"
-msgstr "Un canale di interrupt hardware è già in uso"
+msgstr "Un canale di interruzione hardware è già in uso"
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
msgid "ADC2 is being used by WiFi"
-msgstr ""
+msgstr "ADC2 sta usando il WiFi"
#: shared-bindings/_bleio/Address.c shared-bindings/ipaddress/IPv4Address.c
-#, fuzzy, c-format
+#, c-format
msgid "Address must be %d bytes long"
-msgstr "la palette deve essere lunga 32 byte"
+msgstr "L'indirizzo deve essere lungo %d byte"
#: shared-bindings/_bleio/Address.c
msgid "Address type out of range"
-msgstr ""
+msgstr "Tipo di indirizzo fuori intervallo"
#: ports/esp32s2/common-hal/canio/CAN.c
msgid "All CAN peripherals are in use"
-msgstr ""
+msgstr "Tutte le periferiche CAN sono in uso"
#: ports/esp32s2/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
@@ -320,13 +330,13 @@ msgstr "Tutte le periferiche I2C sono in uso"
#: ports/esp32s2/common-hal/frequencyio/FrequencyIn.c
#: ports/esp32s2/common-hal/rotaryio/IncrementalEncoder.c
msgid "All PCNT units in use"
-msgstr ""
+msgstr "Tutte le unità PCNT sono in uso"
#: ports/atmel-samd/common-hal/canio/Listener.c
#: ports/esp32s2/common-hal/canio/Listener.c
#: ports/stm/common-hal/canio/Listener.c
msgid "All RX FIFOs in use"
-msgstr ""
+msgstr "Tutte le RX FIFO sono in uso"
#: ports/esp32s2/common-hal/busio/SPI.c ports/nrf/common-hal/busio/SPI.c
msgid "All SPI peripherals are in use"
@@ -341,6 +351,10 @@ msgstr "Tutte le periferiche I2C sono in uso"
msgid "All event channels in use"
msgstr "Tutti i canali eventi utilizati"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr "Tutte le state machines sono in uso"
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "Tutti i canali di eventi sincronizzati in uso"
@@ -361,6 +375,7 @@ msgstr "Tutti i timer per questo pin sono in uso"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Tutti i timer utilizzati"
@@ -371,16 +386,16 @@ msgstr ""
#: ports/atmel-samd/common-hal/canio/Listener.c
msgid "Already have all-matches listener"
-msgstr ""
+msgstr "Già in possesso di tutti i listener abbinati"
#: shared-module/memorymonitor/AllocationAlarm.c
#: shared-module/memorymonitor/AllocationSize.c
msgid "Already running"
-msgstr ""
+msgstr "Già in funzione"
#: ports/esp32s2/common-hal/wifi/Radio.c
msgid "Already scanning for wifi networks"
-msgstr ""
+msgstr "Già in ricerca di collegamenti WiFi"
#: ports/cxd56/common-hal/analogio/AnalogIn.c
msgid "AnalogIn not supported on given pin"
@@ -389,6 +404,7 @@ msgstr ""
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "funzionalità AnalogOut non supportata"
@@ -411,24 +427,24 @@ msgstr "Array deve avere mezzoparole (typo 'H')"
#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c
msgid "Array values should be single bytes."
-msgstr "Valori di Array dovrebbero essere bytes singulari"
+msgstr "I valori dell'Array dovrebbero essere bytes singoli."
#: shared-bindings/microcontroller/Pin.c
msgid "At most %d %q may be specified (not %d)"
-msgstr ""
+msgstr "Almeno %d %q devono essere specificati (non %d)"
#: shared-module/memorymonitor/AllocationAlarm.c
#, c-format
msgid "Attempt to allocate %d blocks"
-msgstr ""
+msgstr "Provo ad allocare %d blocchi"
#: supervisor/shared/safe_mode.c
msgid "Attempted heap allocation when MicroPython VM not running."
-msgstr ""
+msgstr "Provo l'allocazione quando MicroPython VM non è attivo."
#: shared-bindings/wifi/Radio.c
msgid "Authentication failure"
-msgstr ""
+msgstr "Autenticazione Fallita"
#: main.c
msgid "Auto-reload is off.\n"
@@ -449,7 +465,7 @@ msgstr ""
#: shared-module/displayio/Display.c
#: shared-module/framebufferio/FramebufferDisplay.c
msgid "Below minimum frame rate"
-msgstr ""
+msgstr "Al di sotto del frame rate minimo"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
msgid "Bit clock and word select must share a clock unit"
@@ -459,15 +475,15 @@ msgstr ""
#: shared-bindings/rgbmatrix/RGBMatrix.c
#, c-format
msgid "Bit depth must be from 1 to 6 inclusive, not %d"
-msgstr ""
+msgstr "La profondità dei bit deve essere inclusiva da 1 a 6, non %d"
#: shared-bindings/audiobusio/PDMIn.c
msgid "Bit depth must be multiple of 8."
-msgstr "La profondità di bit deve essere multipla di 8."
+msgstr "La profondità di bit deve essere un multiplo di 8."
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "Both RX and TX required for flow control"
-msgstr ""
+msgstr "Sia RX che TX richiedono il controllo del flow"
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
msgid "Both pins must support hardware interrupts"
@@ -477,21 +493,21 @@ msgstr "Entrambi i pin devono supportare gli interrupt hardware"
#: shared-bindings/framebufferio/FramebufferDisplay.c
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "Brightness must be 0-1.0"
-msgstr ""
+msgstr "La luminosità deve essere tra 0-1.0"
#: shared-bindings/supervisor/__init__.c
msgid "Brightness must be between 0 and 255"
-msgstr "La luminosità deve essere compreso tra 0 e 255"
+msgstr "La luminosità deve essere compresa tra 0 e 255"
#: shared-bindings/displayio/Display.c
#: shared-bindings/framebufferio/FramebufferDisplay.c
msgid "Brightness not adjustable"
-msgstr "Illiminazione non è regolabile"
+msgstr "Luminosità non è regolabile"
#: shared-bindings/_bleio/UUID.c
#, c-format
msgid "Buffer + offset too small %d %d %d"
-msgstr ""
+msgstr "Buffer + offset troppo piccolo %d %d %d"
#: shared-module/usb_hid/Device.c
#, c-format
@@ -501,26 +517,26 @@ msgstr "Buffer di lunghezza non valida. Dovrebbe essere di %d bytes."
#: shared-bindings/displayio/Display.c
#: shared-bindings/framebufferio/FramebufferDisplay.c
msgid "Buffer is not a bytearray."
-msgstr ""
+msgstr "Buffer non è un array di bites."
#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c
#: shared-bindings/framebufferio/FramebufferDisplay.c
msgid "Buffer is too small"
-msgstr ""
+msgstr "Buffer troppo piccolo"
#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
#, c-format
msgid "Buffer length %d too big. It must be less than %d"
-msgstr ""
+msgstr "Lunghezza Buffer %d troppo grande. Deve essere meno di %d"
#: ports/atmel-samd/common-hal/sdioio/SDCard.c
#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c
msgid "Buffer length must be a multiple of 512"
-msgstr ""
+msgstr "La lunghezza del buffer deve essere un multiplo di 512"
#: ports/stm/common-hal/sdioio/SDCard.c
msgid "Buffer must be a multiple of 512 bytes"
-msgstr ""
+msgstr "Il buffer deve essere un multiplo di 512 bytes"
#: shared-bindings/bitbangio/I2C.c shared-bindings/busio/I2C.c
msgid "Buffer must be at least length 1"
@@ -528,40 +544,39 @@ msgstr "Il buffer deve essere lungo almeno 1"
#: ports/nrf/common-hal/_bleio/PacketBuffer.c
msgid "Buffer too large and unable to allocate"
-msgstr ""
+msgstr "Buffer troppo grande ed impossibile allocare"
#: shared-bindings/_bleio/PacketBuffer.c
#, c-format
msgid "Buffer too short by %d bytes"
-msgstr ""
+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
-#, fuzzy, c-format
+#, c-format
msgid "Bus pin %d is already in use"
-msgstr "DAC già in uso"
+msgstr "Bus pin %d è già in uso"
#: shared-bindings/_bleio/UUID.c
-#, fuzzy
msgid "Byte buffer must be 16 bytes."
-msgstr "i buffer devono essere della stessa lunghezza"
+msgstr "I buffer byte devono essere di almeno 16 bytes."
#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c
msgid "Bytes must be between 0 and 255."
-msgstr "I byte devono essere compresi tra 0 e 255"
+msgstr "I byte devono essere compresi tra 0 e 255."
#: shared-bindings/aesio/aes.c
msgid "CBC blocks must be multiples of 16 bytes"
-msgstr ""
+msgstr "I blocchi CBC devono essere multipli di 16 bytes"
#: ports/esp32s2/bindings/espidf/__init__.c ports/esp32s2/esp_error.c
msgid "CRC or checksum was invalid"
-msgstr ""
+msgstr "CRC o controllo totale è risultato non valido"
#: py/objtype.c
msgid "Call super().__init__() before accessing native object."
-msgstr ""
+msgstr "Chiama super().__init__() prima di accedere ad un oggetto nativo."
#: ports/esp32s2/common-hal/alarm/pin/PinAlarm.c
msgid "Can only alarm on RTC IO from deep sleep."
@@ -592,6 +607,7 @@ msgstr "Impossibile cancellare valori"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "non si può tirare quando nella modalita output"
@@ -631,6 +647,10 @@ 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
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "non si può impostare un valore quando direzione è input"
@@ -870,11 +890,12 @@ msgstr "Canale EXTINT già in uso"
msgid "Error in regex"
msgstr "Errore nella regex"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -930,7 +951,7 @@ msgstr ""
msgid "FFT is implemented for linear arrays only"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr ""
@@ -1058,6 +1079,10 @@ msgstr "operazione I/O su file chiuso"
msgid "I2C Init Error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr ""
@@ -1083,10 +1108,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1095,6 +1129,31 @@ msgstr ""
msgid "Input/output error"
msgstr "Errore input/output"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr ""
@@ -1146,7 +1205,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr "Frequenza PWM non valida"
@@ -1242,6 +1301,8 @@ msgstr "Pin non valido per il canale destro"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "Pin non validi"
@@ -1270,7 +1331,7 @@ msgstr ""
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1278,10 +1339,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr ""
@@ -1299,10 +1356,6 @@ msgstr "File wave non valido"
msgid "Invalid word/bit length"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr ""
@@ -1365,6 +1418,36 @@ msgstr ""
msgid "Missing MISO or MOSI Pin"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr ""
@@ -1397,9 +1480,14 @@ msgstr "Nessun DAC sul chip"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "Nessun canale DMA trovato"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1418,14 +1506,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Nessun pin TX"
@@ -1482,6 +1570,16 @@ msgstr ""
msgid "No network with that ssid"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr ""
@@ -1541,6 +1639,10 @@ msgstr "operazione I2C non supportata"
msgid "Only 8 or 16 bit mono with "
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
@@ -1590,10 +1692,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "L'oversampling deve essere multiplo di 8."
@@ -1618,6 +1725,7 @@ msgstr ""
"impostato nel costruttore a False."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr ""
@@ -1630,11 +1738,20 @@ msgstr ""
msgid "Permission denied"
msgstr "Permesso negato"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "Il pin non ha capacità di ADC"
@@ -1660,6 +1777,10 @@ msgid ""
"constructor"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
#, fuzzy
msgid "Plus any modules on the filesystem\n"
@@ -1696,10 +1817,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr ""
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""
@@ -1708,6 +1853,10 @@ msgstr ""
msgid "RNG Init Error"
msgstr ""
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1715,6 +1864,7 @@ msgstr ""
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "calibrazione RTC non supportata su questa scheda"
@@ -1723,7 +1873,7 @@ msgid "RTC is not supported on this board"
msgstr "RTC non supportato su questa scheda"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr ""
@@ -1781,11 +1931,6 @@ msgstr ""
msgid "SD card CSD format not supported"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDA o SCL necessitano un pull-up"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1804,6 +1949,10 @@ msgstr ""
msgid "SPI Re-initialization error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
#, fuzzy
msgid "Sample rate must be positive"
@@ -1836,6 +1985,14 @@ msgstr "Serializer in uso"
msgid "Server side context cannot have hostname"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
@@ -1867,6 +2024,14 @@ msgstr "Suddivisione con sotto-catture"
msgid "Stack size must be at least 256"
msgstr "La dimensione dello stack deve essere almeno 256"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "Metodi mancanti readinto() o write() allo stream."
@@ -2000,6 +2165,10 @@ msgstr ""
msgid "UART Re-init error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr ""
@@ -2026,6 +2195,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr "Ipossibilitato ad allocare buffer per la conversione con segno"
@@ -2064,7 +2234,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr "indentazione inaspettata"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2105,7 +2275,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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"
@@ -2157,6 +2328,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr "ATTENZIONE: Il nome del sorgente ha due estensioni\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2365,7 +2537,7 @@ msgstr "slice del buffer devono essere della stessa lunghezza"
msgid "buffer too small"
msgstr "buffer troppo piccolo"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -3224,6 +3396,10 @@ msgstr "allocazione di memoria fallita, allocando %u byte"
msgid "memory allocation failed, heap is locked"
msgstr "allocazione di memoria fallita, l'heap è bloccato"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr "modulo non trovato"
@@ -3545,6 +3721,10 @@ msgstr "pop sun un PulseIn vuoto"
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "il terzo argomento di pow() non può essere 0"
@@ -3561,6 +3741,7 @@ msgstr "pow() con 3 argomenti richiede interi"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3578,6 +3759,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "overflow della coda"
@@ -3784,6 +3973,7 @@ msgstr ""
#: ports/esp32s2/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"
msgstr ""
@@ -3995,6 +4185,11 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
@@ -4069,6 +4264,9 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
+#~ msgid "SDA or SCL needs a pull up"
+#~ msgstr "SDA o SCL necessitano un pull-up"
+
#~ msgid "tuple index out of range"
#~ msgstr "indice della tupla fuori intervallo"
diff --git a/locale/ja.po b/locale/ja.po
index bae5704a1..2616789f4 100644
--- a/locale/ja.po
+++ b/locale/ja.po
@@ -344,6 +344,10 @@ msgstr "全てのUART周辺機器が使用中"
msgid "All event channels in use"
msgstr "全てのイベントチャネルが使用中"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr ""
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "全ての同期イベントチャネルが使用中"
@@ -364,6 +368,7 @@ msgstr "このピン用の全てのタイマが使用中"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "全てのタイマーが使用中"
@@ -392,6 +397,7 @@ msgstr "指定のピンはAnalogInに対応していません"
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "AnalogOut機能に対応していません"
@@ -595,6 +601,7 @@ msgstr "値を削除できません"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "出力モード時はpullを取得できません"
@@ -632,6 +639,10 @@ msgstr "USBがアクティブの時に'/'を再マウントできません"
msgid "Cannot reset into bootloader because no bootloader is present."
msgstr "ブートローダが存在しないためブートローダへとリセットできません"
+#: ports/esp32s2/common-hal/socketpool/Socket.c
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "方向がinputのときは値を設定できません"
@@ -870,11 +881,12 @@ msgstr "EXTINTチャネルはすでに使用されています"
msgid "Error in regex"
msgstr "正規表現にエラーがあります"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -928,7 +940,7 @@ msgstr "FFTはndarrayでのみ使えます"
msgid "FFT is implemented for linear arrays only"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr ""
@@ -1056,6 +1068,10 @@ msgstr "閉じられたファイルへのI/O操作"
msgid "I2C Init Error"
msgstr "I2C初期化エラー"
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr "I2SOutが利用できません"
@@ -1081,10 +1097,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr "バッファサイズが正しくありません"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1093,6 +1118,31 @@ msgstr ""
msgid "Input/output error"
msgstr "入力/出力エラー"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr "認証が不十分"
@@ -1144,7 +1194,7 @@ msgstr "不正なDACピンが与えられました"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr "無効なPWM周波数"
@@ -1238,6 +1288,8 @@ msgstr "右チャネルのピンが不正"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "ピンが不正"
@@ -1266,7 +1318,7 @@ msgstr "不正なsecurity_mode"
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1274,10 +1326,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr "不正なボイス"
@@ -1294,10 +1342,6 @@ msgstr "不正なwaveファイル"
msgid "Invalid word/bit length"
msgstr "不正なワード/ビット長"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr "Keyの長さは、16, 24, 32バイトのいずれかでなければなりません"
@@ -1359,6 +1403,36 @@ msgstr "マイクのスタートアップディレイは 0.0 から 1.0 の間
msgid "Missing MISO or MOSI Pin"
msgstr "MISOまたはMOSIピンがありません"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr "%q のサブクラスでなければなりません"
@@ -1391,9 +1465,14 @@ msgstr "チップにDACがありません"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "DMAチャネルが見つかりません"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1412,14 +1491,14 @@ msgstr "MOSIピンがありません"
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "TXピンがありません"
@@ -1476,6 +1555,16 @@ msgstr "このピンには使えるタイマーがもうありません"
msgid "No network with that ssid"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr "ピンにプルダウンがありません。1Mオーム推奨"
@@ -1533,6 +1622,10 @@ msgstr "奇数パリティには対応していません"
msgid "Only 8 or 16 bit mono with "
msgstr "8または16ビットの "
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
@@ -1582,10 +1675,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "オーバーサンプルは8の倍数でなければなりません"
@@ -1606,6 +1704,7 @@ msgid ""
msgstr "PWM周波数は生成時のvariable_frequencyがFalseのとき書き換え不可"
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr "ParallelBusにはまだ対応していません"
@@ -1618,11 +1717,20 @@ msgstr ""
msgid "Permission denied"
msgstr "パーミッション拒否"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "ピンにADCの能力がありません"
@@ -1648,6 +1756,10 @@ msgid ""
"constructor"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr ""
@@ -1683,10 +1795,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "方向がoutputのときpullは使われません"
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "RNG解体エラー"
@@ -1695,6 +1831,10 @@ msgstr "RNG解体エラー"
msgid "RNG Init Error"
msgstr "乱数生成器の初期化エラー"
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1702,6 +1842,7 @@ msgstr ""
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "このボードはRTCのキャリブレーションに非対応"
@@ -1710,7 +1851,7 @@ msgid "RTC is not supported on this board"
msgstr "このボードはRTCに対応していません"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr "RTS/CTS/RS485はこのデバイスでは未対応"
@@ -1767,11 +1908,6 @@ msgstr "セーフモードで実行中! "
msgid "SD card CSD format not supported"
msgstr "SDカードのCSDフォーマットは非対応"
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDAとSCLにプルアップが必要"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1790,6 +1926,10 @@ msgstr "SPI初期化エラー"
msgid "SPI Re-initialization error"
msgstr "SPI再初期化エラー"
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "サンプルレートは正数でなければなりません"
@@ -1820,6 +1960,14 @@ msgstr "シリアライザは使用中"
msgid "Server side context cannot have hostname"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr "サイズは対応していません"
@@ -1851,6 +1999,14 @@ msgstr ""
msgid "Stack size must be at least 256"
msgstr "スタックサイズは少なくとも256以上でなければなりません"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "ストリームにreadinto()またはwrite()メソッドがありません"
@@ -1990,6 +2146,10 @@ msgstr "UARTの初期化エラー"
msgid "UART Re-init error"
msgstr "UARTの再初期化エラー"
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr "UART書き込みエラー"
@@ -2017,6 +2177,7 @@ msgstr "UUIDの値がstr, int, bufferのいずれでもありません"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr ""
@@ -2054,7 +2215,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr "想定されていないnrfx UUID型"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2095,7 +2256,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c
msgid "Unsupported baudrate"
msgstr "非対応のbaudrate"
@@ -2146,6 +2308,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr ""
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2351,7 +2514,7 @@ msgstr "バッファのスライスは同じ長さでなければなりません
msgid "buffer too small"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -3202,6 +3365,10 @@ msgstr ""
msgid "memory allocation failed, heap is locked"
msgstr "メモリ確保に失敗。ヒープがロックされています"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr "モジュールが見つかりません"
@@ -3518,6 +3685,10 @@ msgstr ""
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "pow()の3つ目の引数は0にできません"
@@ -3534,6 +3705,7 @@ msgstr "pow()の第3引数には整数が必要"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3551,6 +3723,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "キューがオーバーフローしました"
@@ -3755,6 +3935,7 @@ msgstr "time.struct_time()は9要素のシーケンスを受け取ります"
#: ports/esp32s2/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"
msgstr "タイムアウト長は対応する最大値を超えています"
@@ -3965,6 +4146,11 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr "watchdogのtimeoutは0以上でなければなりません"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
@@ -4037,6 +4223,9 @@ msgstr "ziはfloat値でなければなりません"
msgid "zi must be of shape (n_section, 2)"
msgstr ""
+#~ msgid "SDA or SCL needs a pull up"
+#~ msgstr "SDAとSCLにプルアップが必要"
+
#~ msgid ""
#~ "\n"
#~ "Code done running. Waiting for reload.\n"
diff --git a/locale/ko.po b/locale/ko.po
index c284971af..26810f87e 100644
--- a/locale/ko.po
+++ b/locale/ko.po
@@ -340,6 +340,10 @@ msgstr "사용중인 모든 UART주변 기기"
msgid "All event channels in use"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr ""
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr ""
@@ -360,6 +364,7 @@ msgstr "핀의 모든 타이머가 사용 중입니다"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "모든 타이머가 사용 중입니다"
@@ -388,6 +393,7 @@ msgstr ""
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr ""
@@ -589,6 +595,7 @@ msgstr "값을 삭제할 수 없습니다"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr ""
@@ -626,6 +633,10 @@ msgstr ""
msgid "Cannot reset into bootloader because no bootloader is present."
msgstr ""
+#: ports/esp32s2/common-hal/socketpool/Socket.c
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr ""
@@ -862,11 +873,12 @@ msgstr ""
msgid "Error in regex"
msgstr "Regex에 오류가 있습니다."
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -920,7 +932,7 @@ msgstr ""
msgid "FFT is implemented for linear arrays only"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr ""
@@ -1048,6 +1060,10 @@ msgstr ""
msgid "I2C Init Error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr ""
@@ -1071,10 +1087,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1083,6 +1108,31 @@ msgstr ""
msgid "Input/output error"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr ""
@@ -1134,7 +1184,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr ""
@@ -1228,6 +1278,8 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "핀이 유효하지 않습니다"
@@ -1256,7 +1308,7 @@ msgstr ""
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1264,10 +1316,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr ""
@@ -1284,10 +1332,6 @@ msgstr ""
msgid "Invalid word/bit length"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr ""
@@ -1349,6 +1393,36 @@ msgstr ""
msgid "Missing MISO or MOSI Pin"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr ""
@@ -1381,9 +1455,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1402,14 +1481,14 @@ msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr ""
@@ -1466,6 +1545,16 @@ msgstr ""
msgid "No network with that ssid"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr ""
@@ -1521,6 +1610,10 @@ msgstr ""
msgid "Only 8 or 16 bit mono with "
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
@@ -1570,10 +1663,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr ""
@@ -1593,6 +1691,7 @@ msgid ""
msgstr ""
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr ""
@@ -1605,11 +1704,20 @@ msgstr ""
msgid "Permission denied"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr ""
@@ -1635,6 +1743,10 @@ msgid ""
"constructor"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr ""
@@ -1670,10 +1782,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr ""
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""
@@ -1682,6 +1818,10 @@ msgstr ""
msgid "RNG Init Error"
msgstr ""
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1689,6 +1829,7 @@ msgstr ""
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr ""
@@ -1697,7 +1838,7 @@ msgid "RTC is not supported on this board"
msgstr ""
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr ""
@@ -1754,11 +1895,6 @@ msgstr ""
msgid "SD card CSD format not supported"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr ""
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1777,6 +1913,10 @@ msgstr ""
msgid "SPI Re-initialization error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr ""
@@ -1807,6 +1947,14 @@ msgstr ""
msgid "Server side context cannot have hostname"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
@@ -1838,6 +1986,14 @@ msgstr ""
msgid "Stack size must be at least 256"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr ""
@@ -1971,6 +2127,10 @@ msgstr ""
msgid "UART Re-init error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr ""
@@ -1998,6 +2158,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr ""
@@ -2035,7 +2196,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2076,7 +2237,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/I2C.c ports/stm/common-hal/busio/I2C.c
msgid "Unsupported baudrate"
msgstr ""
@@ -2127,6 +2289,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr ""
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2332,7 +2495,7 @@ msgstr ""
msgid "buffer too small"
msgstr ""
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -3178,6 +3341,10 @@ msgstr ""
msgid "memory allocation failed, heap is locked"
msgstr ""
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr ""
@@ -3492,6 +3659,10 @@ msgstr ""
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr ""
@@ -3508,6 +3679,7 @@ msgstr ""
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3525,6 +3697,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr ""
@@ -3728,6 +3908,7 @@ msgstr ""
#: ports/esp32s2/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"
msgstr ""
@@ -3938,6 +4119,11 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr ""
diff --git a/locale/nl.po b/locale/nl.po
index 2829bd9e8..463a70da2 100644
--- a/locale/nl.po
+++ b/locale/nl.po
@@ -342,6 +342,10 @@ msgstr "Alle UART peripherals zijn in gebruik"
msgid "All event channels in use"
msgstr "Alle event kanalen zijn in gebruik"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr ""
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "Alle sync event kanalen zijn in gebruik"
@@ -362,6 +366,7 @@ msgstr "Alle timers voor deze pin zijn in gebruik"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Alle timers zijn in gebruik"
@@ -390,6 +395,7 @@ msgstr "AnalogIn niet ondersteund door gegeven pin"
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "AnalogOut functionaliteit niet ondersteund"
@@ -591,6 +597,7 @@ msgstr "Kan waardes niet verwijderen"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "get pull kan niet gedurende output mode"
@@ -630,6 +637,10 @@ 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
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "Kan de waarde niet toewijzen als de richting input is."
@@ -870,11 +881,12 @@ msgstr "EXTINT kanaal al in gebruik"
msgid "Error in regex"
msgstr "Fout in regex"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -928,7 +940,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/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr "SSL handdruk mislukt"
@@ -1057,6 +1069,10 @@ msgstr "I/O actie op gesloten bestand"
msgid "I2C Init Error"
msgstr "I2C Init Fout"
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr "I2SOut is niet beschikbaar"
@@ -1082,10 +1098,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr "Incorrecte buffer grootte"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr "De initialisatie is mislukt vanwege een gebrek aan geheugen"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr "Invoer duurt te lang"
@@ -1094,6 +1119,31 @@ msgstr "Invoer duurt te lang"
msgid "Input/output error"
msgstr "Input/Output fout"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr "Onvoldoende authenticatie"
@@ -1145,7 +1195,7 @@ msgstr "Ongeldige DAC pin opgegeven"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr "Ongeldige PWM frequentie"
@@ -1239,6 +1289,8 @@ msgstr "Ongeldige pin voor rechter kanaal"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "Ongeldige pinnen"
@@ -1267,7 +1319,7 @@ msgstr "Ongeldige security_mode"
msgid "Invalid size"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1275,10 +1327,6 @@ msgstr ""
msgid "Invalid state"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr "Ongeldige stem"
@@ -1295,10 +1343,6 @@ msgstr "Ongeldig wave bestand"
msgid "Invalid word/bit length"
msgstr "Ongeldig woord/bit lengte"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr "Sleutel moet 16, 24, of 32 bytes lang zijn"
@@ -1360,6 +1404,36 @@ msgstr "Microfoon opstart vertraging moet in bereik van 0.0 tot 1.0 zijn"
msgid "Missing MISO or MOSI Pin"
msgstr "Ontbrekende MISO of MOSI Pin"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr "%q moet een subklasse zijn."
@@ -1392,9 +1466,14 @@ msgstr "Geen DAC op de chip"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "Geen DMA kanaal gevonden"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1413,14 +1492,14 @@ msgstr "Geen MOSI pin"
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Geen TX pin"
@@ -1477,6 +1556,16 @@ msgstr "Geen timers meer beschikbaar op deze pin."
msgid "No network with that ssid"
msgstr "Geen netwerk met dat SSID gevonden"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr "Geen pulldown op pin; 1MOhm aangeraden"
@@ -1534,6 +1623,10 @@ msgstr "Oneven pariteit is niet ondersteund"
msgid "Only 8 or 16 bit mono with "
msgstr "Alleen 8 of 16 bit mono met "
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr "Alleen IPv4 adressen worden ondersteund"
@@ -1587,10 +1680,15 @@ msgstr ""
msgid "Out of memory"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr "Geen sockets meer beschikbaar"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "Oversample moet een meervoud van 8 zijn."
@@ -1613,6 +1711,7 @@ msgstr ""
"tijdens constructie."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr "ParallelBus nog niet ondersteund"
@@ -1625,11 +1724,20 @@ msgstr ""
msgid "Permission denied"
msgstr "Toegang geweigerd"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "Pin heeft geen ADC mogelijkheden"
@@ -1658,6 +1766,10 @@ msgstr ""
"gebruikt. Als dit niet kan worden vermeden, geef dan het argument "
"allow_inefficient=True aan de constructor"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr "En iedere module in het bestandssysteem\n"
@@ -1699,10 +1811,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "Pull niet gebruikt wanneer de richting output is."
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "RNG DeInit Fout"
@@ -1711,6 +1847,10 @@ msgstr "RNG DeInit Fout"
msgid "RNG Init Error"
msgstr "RNG Init Fout"
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1718,6 +1858,7 @@ msgstr "RS485 inversie gespecificeerd terwijl niet in RS485 modus"
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "RTC calibratie niet ondersteund door dit board"
@@ -1726,7 +1867,7 @@ msgid "RTC is not supported on this board"
msgstr "RTC is niet ondersteund door dit board"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr "RTS/CTS/RS485 Nog niet ondersteund door dit apparaat"
@@ -1783,11 +1924,6 @@ msgstr "Veilige modus wordt uitgevoerd! "
msgid "SD card CSD format not supported"
msgstr "SD kaart CSD formaat niet ondersteund"
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDA of SCL hebben een pullup nodig"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1806,6 +1942,10 @@ msgstr "SPI Init Fout"
msgid "SPI Re-initialization error"
msgstr "SPI Herinitialisatie Fout"
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "Sample rate moet positief zijn"
@@ -1836,6 +1976,14 @@ msgstr "Serializer in gebruik"
msgid "Server side context cannot have hostname"
msgstr "Context aan de serverkant kan geen hostnaam hebben"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr "Afmeting niet ondersteund"
@@ -1867,6 +2015,14 @@ msgstr "Splitting met sub-captures"
msgid "Stack size must be at least 256"
msgstr "Stack grootte moet op zijn minst 256 zijn"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "Stream mist readinto() of write() methode."
@@ -2010,6 +2166,10 @@ msgstr "UART Init Fout"
msgid "UART Re-init error"
msgstr "UART Re-init Fout"
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr "UART schrijf fout"
@@ -2036,6 +2196,7 @@ msgstr "UUID waarde is geen str, int, of byte buffer"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr "Niet in staat buffers voor gesigneerde conversie te alloceren"
@@ -2073,7 +2234,7 @@ msgstr "Kan niet naar sleep_memory schrijven."
msgid "Unexpected nrfx uuid type"
msgstr "Onverwacht mrfx uuid type"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/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"
@@ -2116,7 +2277,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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"
@@ -2167,6 +2329,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr "WAARSCHUWING: De bestandsnaam van de code heeft twee extensies\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
"WatchDogTimer kan niet worden gedeïnitialiseerd zodra de modus in ingesteld "
@@ -2381,7 +2544,7 @@ msgstr "buffer slices moeten van gelijke grootte zijn"
msgid "buffer too small"
msgstr "buffer te klein"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr "buffer te klein voor gevraagde bytes"
@@ -3235,6 +3398,10 @@ msgstr "geheugentoewijzing mislukt, %u bytes worden toegewezen"
msgid "memory allocation failed, heap is locked"
msgstr "geheugentoewijzing mislukt, heap is vergrendeld"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr "module niet gevonden"
@@ -3550,6 +3717,10 @@ msgstr "pop van een lege PulseIn"
msgid "pop from empty %q"
msgstr "pop van een lege %q"
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "derde argument van pow() mag geen 0 zijn"
@@ -3566,6 +3737,7 @@ msgstr "pow() met 3 argumenten vereist integers"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3583,6 +3755,14 @@ msgstr "druk bootknop in bij opstarten.\n"
msgid "pressing both buttons at start up.\n"
msgstr "druk beide knoppen in bij opstarten.\n"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "wachtrij overloop"
@@ -3788,6 +3968,7 @@ msgstr "time.struct_time() accepteert een 9-rij"
#: ports/esp32s2/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"
msgstr "time-outduur is groter dan de ondersteunde maximale waarde"
@@ -3998,6 +4179,11 @@ msgstr "watchdog niet geïnitialiseerd"
msgid "watchdog timeout must be greater than 0"
msgstr "watchdog time-out moet groter zijn dan 0"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr "breedte moet groter dan nul zijn"
@@ -4070,6 +4256,9 @@ 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 "SDA or SCL needs a pull up"
+#~ msgstr "SDA of SCL hebben een pullup nodig"
+
#~ msgid "%d address pins and %d rgb pins indicate a height of %d, not %d"
#~ msgstr "%d adres pins en %d RGB pins geven een hoogte van %d aan, niet %d"
diff --git a/locale/pl.po b/locale/pl.po
index 0c03a0ee0..bf914aefb 100644
--- a/locale/pl.po
+++ b/locale/pl.po
@@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
-"PO-Revision-Date: 2021-01-27 01:31+0000\n"
+"PO-Revision-Date: 2021-02-10 21:50+0000\n"
"Last-Translator: Maciej Stankiewicz <tawezik@gmail.com>\n"
"Language-Team: pl\n"
"Language: pl\n"
@@ -344,6 +344,10 @@ msgstr "Wszystkie peryferia UART w użyciu"
msgid "All event channels in use"
msgstr "Wszystkie kanały zdarzeń w użyciu"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr ""
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "Wszystkie kanały zdarzeń synchronizacji w użyciu"
@@ -364,6 +368,7 @@ msgstr "Wszystkie timery tej nóżki w użyciu"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Wszystkie timery w użyciu"
@@ -392,6 +397,7 @@ msgstr "AnalogIn nie jest obsługiwany na danym pinie"
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "AnalogOut jest niewspierane"
@@ -593,6 +599,7 @@ msgstr "Nie można usunąć"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "Nie ma podciągnięcia w trybie wyjścia"
@@ -630,6 +637,10 @@ msgstr "Nie można przemontować '/' gdy USB działa."
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
+msgid "Cannot set socket options"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "Nie można ustawić wartości w trybie wejścia."
@@ -870,11 +881,12 @@ msgstr "Kanał EXTINT w użyciu"
msgid "Error in regex"
msgstr "Błąd w regex"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr ""
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -928,7 +940,7 @@ msgstr ""
msgid "FFT is implemented for linear arrays only"
msgstr ""
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr ""
@@ -1056,6 +1068,10 @@ msgstr "Operacja I/O na zamkniętym pliku"
msgid "I2C Init Error"
msgstr "Błąd inicjalizacji I2C"
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr ""
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr "I2SOut niedostępne"
@@ -1081,10 +1097,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr "Niewłaściwa wielkość bufora"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr ""
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr "Inicjalizacja nie powiodła się z powodu braku pamięci"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr ""
@@ -1093,6 +1118,31 @@ msgstr ""
msgid "Input/output error"
msgstr "Błąd I/O"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "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"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr ""
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr "Niewystarczające uwierzytelnienie"
@@ -1144,7 +1194,7 @@ msgstr ""
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/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"
@@ -1238,6 +1288,8 @@ msgstr "Zła nóżka dla prawego kanału"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "Złe nóżki"
@@ -1266,7 +1318,7 @@ msgstr "Nieprawidłowy security_mode"
msgid "Invalid size"
msgstr "Nieprawidłowy rozmiar"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr ""
@@ -1274,10 +1326,6 @@ msgstr ""
msgid "Invalid state"
msgstr "Nieprawidłowy stan"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr ""
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr ""
@@ -1294,10 +1342,6 @@ msgstr "Zły plik wave"
msgid "Invalid word/bit length"
msgstr "Niepoprawna długość słowa/bitu"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr ""
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr "Klucz musi mieć długość 16, 24 lub 32 bajtów"
@@ -1360,6 +1404,36 @@ msgstr "Opóźnienie włączenia mikrofonu musi być w zakresie od 0.0 do 1.0"
msgid "Missing MISO or MOSI Pin"
msgstr "Brak pinu MISO lub MOSI"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr ""
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr ""
@@ -1392,9 +1466,14 @@ msgstr "Brak DAC"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "Nie znaleziono kanału DMA"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1413,14 +1492,14 @@ msgstr "Brak pinu MOSI"
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Brak nóżki TX"
@@ -1477,6 +1556,16 @@ msgstr ""
msgid "No network with that ssid"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "No out in program"
+msgstr ""
+
+#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/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"
+msgstr ""
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr ""
@@ -1532,6 +1621,10 @@ msgstr "Nieparzysta parzystość nie jest wspierana"
msgid "Only 8 or 16 bit mono with "
msgstr "Tylko 8 lub 16 bitów mono z "
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr ""
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr ""
@@ -1581,10 +1674,15 @@ msgstr ""
msgid "Out of memory"
msgstr "Brak pamięci"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "Nadpróbkowanie musi być wielokrotnością 8."
@@ -1604,6 +1702,7 @@ msgid ""
msgstr "Nie można zmienić częstotliwości PWM gdy variable_frequency=False."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr "ParallelBus nie jest jeszcze obsługiwany"
@@ -1616,11 +1715,20 @@ msgstr ""
msgid "Permission denied"
msgstr "Odmowa dostępu"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr ""
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "Nóżka nie obsługuje ADC"
@@ -1646,6 +1754,10 @@ msgid ""
"constructor"
msgstr ""
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr "Oraz moduły w systemie plików\n"
@@ -1681,10 +1793,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr ""
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr ""
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "Podciągnięcie nieużywane w trybie wyjścia."
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr ""
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""
@@ -1693,6 +1829,10 @@ msgstr ""
msgid "RNG Init Error"
msgstr ""
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr ""
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1700,6 +1840,7 @@ msgstr ""
#: ports/cxd56/common-hal/rtc/RTC.c ports/esp32s2/common-hal/rtc/RTC.c
#: ports/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "Brak obsługi kalibracji RTC"
@@ -1708,7 +1849,7 @@ msgid "RTC is not supported on this board"
msgstr "Brak obsługi RTC"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr ""
@@ -1765,11 +1906,6 @@ msgstr ""
msgid "SD card CSD format not supported"
msgstr ""
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDA lub SCL wymagają podciągnięcia"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1788,6 +1924,10 @@ msgstr "Błąd inicjowania SPI"
msgid "SPI Re-initialization error"
msgstr "Błąd ponownej inicjalizacji SPI"
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr ""
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "Częstotliwość próbkowania musi być dodatnia"
@@ -1818,6 +1958,14 @@ msgstr "Serializator w użyciu"
msgid "Server side context cannot have hostname"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr ""
@@ -1849,6 +1997,14 @@ msgstr "Podział z podgrupami"
msgid "Stack size must be at least 256"
msgstr "Stos musi mieć co najmniej 256 bajtów"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "Strumień nie ma metod readinto() lub write()."
@@ -1982,6 +2138,10 @@ msgstr ""
msgid "UART Re-init error"
msgstr ""
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr ""
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr "Błąd zapisu UART"
@@ -2008,6 +2168,7 @@ msgstr "UUID nie jest typu str, int lub bytes"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr "Nie udała się alokacja buforów do konwersji ze znakiem"
@@ -2045,7 +2206,7 @@ msgstr ""
msgid "Unexpected nrfx uuid type"
msgstr "Nieoczekiwany typ nrfx uuid"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
#, c-format
msgid "Unhandled ESP TLS error %d %d %x %d"
msgstr ""
@@ -2086,7 +2247,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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"
@@ -2137,6 +2299,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr "UWAGA: Nazwa pliku ma dwa rozszerzenia\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
@@ -2348,7 +2511,7 @@ msgstr "fragmenty bufora muszą mieć tę samą długość"
msgid "buffer too small"
msgstr "zbyt mały bufor"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr ""
@@ -3195,6 +3358,10 @@ msgstr "alokacja pamięci nie powiodła się, alokowano %u bajtów"
msgid "memory allocation failed, heap is locked"
msgstr "alokacja pamięci nie powiodła się, sterta zablokowana"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr "brak modułu"
@@ -3510,6 +3677,10 @@ msgstr "pop z pustego PulseIn"
msgid "pop from empty %q"
msgstr ""
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr ""
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "trzeci argument pow() nie może być 0"
@@ -3526,6 +3697,7 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3543,6 +3715,14 @@ msgstr ""
msgid "pressing both buttons at start up.\n"
msgstr ""
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr ""
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr ""
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "przepełnienie kolejki"
@@ -3747,6 +3927,7 @@ msgstr "time.struct_time() wymaga 9-elementowej sekwencji"
#: ports/esp32s2/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"
msgstr ""
@@ -3957,9 +4138,14 @@ msgstr ""
msgid "watchdog timeout must be greater than 0"
msgstr ""
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
-msgstr ""
+msgstr "szerokość musi być większa niż zero"
#: ports/esp32s2/common-hal/wifi/Radio.c
msgid "wifi is not enabled"
@@ -3979,7 +4165,7 @@ msgstr ""
#: extmod/ulab/code/vector/vectorise.c
msgid "wrong input type"
-msgstr ""
+msgstr "nieprawidłowy typ wejścia"
#: extmod/ulab/code/ulab_create.c py/objstr.c
msgid "wrong number of arguments"
@@ -3995,7 +4181,7 @@ msgstr "zły typ operandu"
#: extmod/ulab/code/vector/vectorise.c
msgid "wrong output type"
-msgstr ""
+msgstr "nieprawidłowy typ wyjścia"
#: shared-module/displayio/Shape.c
msgid "x value out of bounds"
@@ -4029,6 +4215,9 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
+#~ msgid "SDA or SCL needs a pull up"
+#~ msgstr "SDA lub SCL wymagają podciągnięcia"
+
#~ msgid "tuple index out of range"
#~ msgstr "indeks krotki poza zakresem"
diff --git a/locale/pt_BR.po b/locale/pt_BR.po
index 3e397a0ed..c283cdda8 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-01-22 15:30+0000\n"
+"PO-Revision-Date: 2021-02-21 22:27+0000\n"
"Last-Translator: Wellington Terumi Uemura <wellingtonuemura@gmail.com>\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.5-dev\n"
+"X-Generator: Weblate 4.5\n"
#: main.c
msgid ""
@@ -68,6 +68,8 @@ msgstr "%%c requer int ou char"
msgid ""
"%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d"
msgstr ""
+"%d pinos de endereço, %d pinos rgb e %d blocos indicam uma altura com %d, "
+"não %d"
#: ports/atmel-samd/common-hal/sdioio/SDCard.c
msgid "%q failure: %d"
@@ -350,6 +352,10 @@ msgstr "Todos os periféricos UART estão em uso"
msgid "All event channels in use"
msgstr "Todos os canais de eventos em uso"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr "O estado de todas as máquinas em uso"
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "Todos os canais dos eventos de sincronização em uso"
@@ -370,6 +376,7 @@ msgstr "Todos os temporizadores para este pino estão em uso"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Todos os temporizadores em uso"
@@ -398,6 +405,7 @@ msgstr "O AnalogIn não é compatível no pino informado"
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "Funcionalidade AnalogOut não suportada"
@@ -606,6 +614,7 @@ msgstr "Não é possível excluir valores"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "Não é possível obter (pull) enquanto estiver no modo saída"
@@ -646,6 +655,10 @@ 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
+msgid "Cannot set socket options"
+msgstr "Não foi possível definir as opções do socket"
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "Não é possível definir o valor quando a direção é inserida."
@@ -830,7 +843,7 @@ msgstr "O pino de dados 0 deve ser alinhado por bytes"
#: ports/esp32s2/common-hal/displayio/ParallelBus.c
msgid "Data 0 pin must be byte aligned."
-msgstr ""
+msgstr "O pino de dados 0 deve ser alinhado por bytes."
#: shared-module/audiocore/WaveFile.c
msgid "Data chunk must follow fmt chunk"
@@ -886,11 +899,12 @@ msgstr "Canal EXTINT em uso"
msgid "Error in regex"
msgstr "Erro no regex"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr "Erro: Falha na vinculação"
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -944,7 +958,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/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr "Houve uma falha no handshake do SSL"
@@ -1073,6 +1087,10 @@ msgstr "Operação I/O no arquivo fechado"
msgid "I2C Init Error"
msgstr "Erro de inicialização do I2C"
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr "Periférico I2C em uso"
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr "O I2SOut não está disponível"
@@ -1098,10 +1116,21 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr "O tamanho do buffer está incorreto"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr "O tamanho do programa Init é inválido"
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr "A inicialização falhou devido à falta de memória"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+"O comprimento do buffer de entrada (%d) deve ser um múltiplo da contagem dos "
+"fios (%d)"
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr "A entrada está demorando demais"
@@ -1110,6 +1139,31 @@ msgstr "A entrada está demorando demais"
msgid "Input/output error"
msgstr "Erro de entrada/saída"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d jumps on pin"
+msgstr "A instrução %d salta no pino"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts in more bits than pin count"
+msgstr "A instrução %d muda com mais bits do que a quantidade dos pinos"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr "A instrução %d desloca mais bits do que a quantidade dos pinos"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr "A instrução %d usa um pino extra"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr "A instrução %d aguarda a entrada de fora da contagem"
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr "Autenticação insuficiente"
@@ -1161,7 +1215,7 @@ msgstr "O pino DAC informado é inválido"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/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"
@@ -1255,6 +1309,8 @@ msgstr "Pino inválido para canal direito"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "Pinos inválidos"
@@ -1283,7 +1339,7 @@ msgstr "O Security_mode é inválido"
msgid "Invalid size"
msgstr "Tamanho inválido"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr "Soquete inválido para o TLS"
@@ -1291,10 +1347,6 @@ msgstr "Soquete inválido para o TLS"
msgid "Invalid state"
msgstr "Estado inválido"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr "Uso inválido do soquete TLS"
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr "A voz é inválida"
@@ -1311,10 +1363,6 @@ msgstr "Aqruivo de ondas inválido"
msgid "Invalid word/bit length"
msgstr "O comprimento do bit/palavra são inválidos"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr "Problema na configuração do SO_REUSEADDR"
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr "A chave deve ter 16, 24 ou 32 bytes de comprimento"
@@ -1376,6 +1424,36 @@ msgstr "O atraso na inicialização do microfone deve estar entre 0,0 e 1,0"
msgid "Missing MISO or MOSI Pin"
msgstr "O pino MISO ou MOSI está ausente"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr "Faltando first_in_pin. A instrução %d lê pinos(s)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr "Faltando first_in_pin. A instrução %d muda a partir do(s) pino(s)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr "Faltando first_in_pin. A instrução %d aguarda com base no pino"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr "Faltando first_out_pin. A instrução %d muda para o(s) pinos(s)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr "Faltando first_out_pin. A instrução %d escreve nos pinos(s)"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr "Faltando first_set_pin. A instrução %d define os pinos(s)"
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr "Deve ser uma subclasse %q."
@@ -1408,9 +1486,14 @@ msgstr "Nenhum DAC no chip"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "Nenhum canal DMA foi encontrado"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr "Nenhum temporizador DMA foi encontrado"
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1429,14 +1512,14 @@ msgstr "Nenhum pino MOSI"
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Nenhum pino TX"
@@ -1493,6 +1576,18 @@ msgstr "Não há mais temporizadores disponíveis neste pino."
msgid "No network with that ssid"
msgstr "Não há rede com este ssid"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+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/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "No pull up found on SDA or SCL; check your wiring"
+msgstr ""
+"Nenhum pull up foi encontrado no SDA ou no SCL; verifique o fio das suas "
+"conexões"
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr "Não há pulldown no pino; É recomendável utilizar um resistor de 1M ohm"
@@ -1549,6 +1644,10 @@ 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/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr "Somente IN/OUT de até 8 suportados"
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr "Somente os endereços IPv4 são suportados"
@@ -1602,10 +1701,15 @@ msgstr "A operação expirou"
msgid "Out of memory"
msgstr "Sem memória"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr "Sem soquetes"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr "O buffer de saída deve ter ao menos %d bytes"
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "A superamostragem deve ser um múltiplo de 8."
@@ -1629,6 +1733,7 @@ msgstr ""
"na construção."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/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"
@@ -1641,11 +1746,20 @@ msgstr "O periférico está em uso"
msgid "Permission denied"
msgstr "Permissão negada"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr "A contagem dos pinos deve ser com pelo menos 1"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr "A contagem dos pinos é muito grande"
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "O pino não tem recursos de ADC"
@@ -1674,6 +1788,10 @@ msgstr ""
"ideal. Caso isso não possa ser evitado, passe allow_inefficient=True ao "
"construtor"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr "Os pinos devem compartilhar a fatia do PWM"
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr "Além de quaisquer módulos no sistema de arquivos\n"
@@ -1718,10 +1836,34 @@ msgstr ""
"Tentando entrar no deep sleep até o alarme, pressione CTRL-C ou grave o "
"arquivo.\n"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr "O programa faz IN sem carregar o ISR"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr "O programa faz OUT sem carregar o OSR"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr "O programa deve conter pelo menos uma instrução com 16 bits."
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr "O tamanho do programa é inválido"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr "O programa é muito grande"
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "O Pull não foi usado quando a direção for gerada."
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr "O modo RAISE não foi implementado"
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "Erro DeInit RNG"
@@ -1730,6 +1872,10 @@ msgstr "Erro DeInit RNG"
msgid "RNG Init Error"
msgstr "Houve um erro na inicialização do RNG"
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr "Ainda não há suporte para o RS485 neste dispositivo"
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1737,6 +1883,7 @@ 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/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "A calibração RTC não é suportada nesta placa"
@@ -1745,7 +1892,7 @@ msgid "RTC is not supported on this board"
msgstr "O RTC não é suportado nesta placa"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr "RTS/CTS/RS485 Ainda não é compatível neste dispositivo"
@@ -1802,11 +1949,6 @@ msgstr "Executando no modo de segurança! "
msgid "SD card CSD format not supported"
msgstr "O formato CSD do Cartão SD não é compatível"
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDA ou SCL precisa de um pull up"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1825,6 +1967,10 @@ msgstr "Houve um erro na inicialização SPI"
msgid "SPI Re-initialization error"
msgstr "Houve um erro na reinicialização SPI"
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr "O periférico SPI está em uso"
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "A taxa de amostragem deve ser positiva"
@@ -1855,6 +2001,15 @@ msgstr "Serializer em uso"
msgid "Server side context cannot have hostname"
msgstr "O contexto do lado do servidor não pode ter nome de host"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr "A definição da contagem dos pinos deve estar entre 1 e 5"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr ""
+"A definição da contagem dos pinos do conjunto lateral deve estar entre 1 e 5"
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr "O tamanho não é suportado"
@@ -1886,6 +2041,14 @@ msgstr "Divisão com sub-capturas"
msgid "Stack size must be at least 256"
msgstr "O tamanho da pilha deve ser pelo menos 256"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr "O estéreo à esquerda deve estar no canal PWM A"
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr "O estéreo à direita deve estar no canal PWM B"
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "Transmita o método ausente readinto() ou write()."
@@ -2033,6 +2196,10 @@ msgstr "Houve um erro na inicialização do UART"
msgid "UART Re-init error"
msgstr "Houve um erro na reinicialização do UART"
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr "O UART ainda não é suportado"
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr "Houve um erro na gravação UART"
@@ -2059,6 +2226,7 @@ msgstr "O valor UUID não é um buffer str, int ou byte"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr "Não é possível alocar buffers para conversão assinada"
@@ -2096,7 +2264,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/socketpool/Socket.c
+#: ports/esp32s2/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"
@@ -2139,7 +2307,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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"
@@ -2190,6 +2359,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr "AVISO: Seu arquivo de código tem duas extensões\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr ""
"O WatchDogTimer não pode ser não-inicializado uma vez que o modo é definido "
@@ -2405,7 +2575,7 @@ msgstr "as fatias do buffer devem ter o mesmo comprimento"
msgid "buffer too small"
msgstr "o buffer é muito pequeno"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr "o buffer é pequeno demais para os bytes requisitados"
@@ -3266,6 +3436,10 @@ msgstr ""
"falha na alocação de memória, a área de alocação dinâmica de variáveis "
"(heap) está bloqueada"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr "memoryview: o comprimento não é um múltiplo do tamanho dos itens"
+
#: py/builtinimport.c
msgid "module not found"
msgstr "o módulo não foi encontrado"
@@ -3585,6 +3759,10 @@ msgstr "pop a partir de um PulseIn vazio"
msgid "pop from empty %q"
msgstr "pop a partir do %q vazio"
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr "a porta deve ser > = 0"
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "O terceiro argumento pow() não pode ser 0"
@@ -3601,6 +3779,7 @@ msgstr "o pow() com 3 argumentos requer números inteiros"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3618,6 +3797,14 @@ msgstr "pressionando o botão de boot na inicialização.\n"
msgid "pressing both buttons at start up.\n"
msgstr "pressionando ambos os botões durante a inicialização.\n"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr "O pull_threshold deve ser entre 1 e 32"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr "O pull_threshold deve ser entre 1 e 32"
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "estouro de fila"
@@ -3815,7 +4002,7 @@ msgstr "Limite deve estar no alcance de 0-65536"
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "tile must be greater than zero"
-msgstr ""
+msgstr "o bloco deve ser maior que zero"
#: shared-bindings/time/__init__.c
msgid "time.struct_time() takes a 9-sequence"
@@ -3823,6 +4010,7 @@ msgstr "time.struct_time() leva uma sequência com 9"
#: ports/esp32s2/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"
msgstr "a duração do tempo limite excedeu o valor máximo suportado"
@@ -4033,6 +4221,11 @@ msgstr "o watchdog não foi inicializado"
msgid "watchdog timeout must be greater than 0"
msgstr "o tempo limite do watchdog deve ser maior que 0"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr "a largura deve ser entre 2 a 8 (inclusive), não %d"
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr "a largura deve ser maior que zero"
@@ -4105,6 +4298,15 @@ 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 "SDA or SCL needs a pull up"
+#~ msgstr "SDA ou SCL precisa de um pull up"
+
+#~ msgid "Invalid use of TLS Socket"
+#~ msgstr "Uso inválido do soquete TLS"
+
+#~ msgid "Issue setting SO_REUSEADDR"
+#~ msgstr "Problema na configuração do SO_REUSEADDR"
+
#~ msgid "%d address pins and %d rgb pins indicate a height of %d, not %d"
#~ msgstr ""
#~ "%d endereços dos pinos e %d pinos rgb indicam uma altura do %d, não %d"
diff --git a/locale/sv.po b/locale/sv.po
index 3aa0dcc1e..7b82d7a7f 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-01-25 19:32+0000\n"
+"PO-Revision-Date: 2021-02-21 22:27+0000\n"
"Last-Translator: Jonny Bergdahl <jonny@bergdahl.it>\n"
"Language-Team: LANGUAGE <LL@li.org>\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.5-dev\n"
+"X-Generator: Weblate 4.5\n"
#: main.c
msgid ""
@@ -68,6 +68,7 @@ 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"
#: ports/atmel-samd/common-hal/sdioio/SDCard.c
msgid "%q failure: %d"
@@ -346,6 +347,10 @@ msgstr "Alla UART-kringutrustning används"
msgid "All event channels in use"
msgstr "Alla händelsekanaler används"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr "Alla tillståndsmaskiner används"
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "Alla händelsekanaler används"
@@ -366,6 +371,7 @@ msgstr "Alla timers för denna pinne är i bruk"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Alla timers används"
@@ -394,6 +400,7 @@ msgstr "AnalogIn stöds inte på angiven pinne"
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "AnalogOut-funktionalitet stöds inte"
@@ -596,6 +603,7 @@ msgstr "Kan inte radera värden"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "Kan inte ange pull i output-läge"
@@ -635,6 +643,10 @@ 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
+msgid "Cannot set socket options"
+msgstr "Det går inte att ange socketalternativ"
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "Kan inte sätta värde när riktning är input."
@@ -819,7 +831,7 @@ msgstr "Datapinne 0 måste vara bytejusterad"
#: ports/esp32s2/common-hal/displayio/ParallelBus.c
msgid "Data 0 pin must be byte aligned."
-msgstr ""
+msgstr "Datapinne 0 måste vara byte-justerad."
#: shared-module/audiocore/WaveFile.c
msgid "Data chunk must follow fmt chunk"
@@ -875,11 +887,12 @@ msgstr "EXTINT-kanalen används redan"
msgid "Error in regex"
msgstr "Fel i regex"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr "Fel: Bind misslyckades"
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -933,7 +946,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/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr "Misslyckad SSL-handskakning"
@@ -1061,6 +1074,10 @@ msgstr "I/O-operation på stängd fil"
msgid "I2C Init Error"
msgstr "I2C init-fel"
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr "I2C-enhet används redan"
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr "I2SOut är inte tillgängligt"
@@ -1086,10 +1103,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr "Fel buffertstorlek"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr "Storlek på init-program ogiltigt"
+
#: ports/esp32s2/common-hal/watchdog/WatchDogTimer.c
msgid "Initialization failed due to lack of memory"
msgstr "Initieringen misslyckades på grund av minnesbrist"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr "indatabuffertlängd (%d) måste vara en multipel av antal strand (%d)"
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr "Indata tar för lång tid"
@@ -1098,6 +1124,31 @@ msgstr "Indata tar för lång tid"
msgid "Input/output error"
msgstr "Indata-/utdatafel"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d jumps on pin"
+msgstr "Instruktion %d hoppar på pinne"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts in more bits than pin count"
+msgstr "Instruktion %d skiftar fler bitar än antalet pinnar"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr "Instruktion %d skiftar fler bitar än antal pinnar"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr "Instruktion %d använder extra pinne"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr "Instruktion %d väntar på inmatning utanför intervallet"
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr "Otillräcklig autentisering"
@@ -1149,7 +1200,7 @@ msgstr "Ogiltig DAC-pinne angiven"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/pwmio/PWMOut.c
+#: ports/raspberrypi/common-hal/pwmio/PWMOut.c shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr "Ogiltig PWM-frekvens"
@@ -1243,6 +1294,8 @@ msgstr "Ogiltig pinne för höger kanal"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "Ogiltiga pinnar"
@@ -1271,7 +1324,7 @@ msgstr "Ogiltigt säkerhetsläge"
msgid "Invalid size"
msgstr "Ogiltig storlek"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr "Ogiltig socket för TLS"
@@ -1279,10 +1332,6 @@ msgstr "Ogiltig socket för TLS"
msgid "Invalid state"
msgstr "Ogiltigt tillstånd"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr "Ogiltig användning av TLS Socket"
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr "Ogiltig kanal"
@@ -1299,10 +1348,6 @@ msgstr "Ogiltig wave-fil"
msgid "Invalid word/bit length"
msgstr "Ogiltig word-/bitlängd"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr "Misslyckades att sätta SO_REUSEADDR"
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr "Nyckeln måste vara 16, 24 eller 32 byte lång"
@@ -1365,6 +1410,36 @@ msgstr ""
msgid "Missing MISO or MOSI Pin"
msgstr "MISO- eller MOSI-pinne saknas"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr "Saknad first_in_pin. Instruktion %d läser pinnar"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr "Saknad first_in_pin. Instruktion %d skiftar in från pinnar"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr "Saknad first_in_pin. Instruktion %d väntar baserat på pinne"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr "Saknad first_out_pin. Instruktion %d skiftar ut till pinnar"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr "Saknad first_out_pin. Instruktion %d skriver till pinnar"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_set_pin. Instruction %d sets pin(s)"
+msgstr "Saknad first_set_pin. Instruktion %d sätter pinnar"
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr "Måste vara en %q-subklass."
@@ -1397,9 +1472,14 @@ msgstr "Ingen DAC på chipet"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "Ingen DMA-kanal hittades"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr "Ingen DMA pacing timer hittades"
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1418,14 +1498,14 @@ msgstr "Ingen MOSI-pinne"
#: ports/atmel-samd/common-hal/busio/UART.c
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Ingen TX-pinne"
@@ -1482,6 +1562,16 @@ msgstr "Inga fler timers tillgängliga på denna pinne."
msgid "No network with that ssid"
msgstr "Inget nätverk med sådant ssid"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+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/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "No pull up found on SDA or SCL; check your wiring"
+msgstr "Ingen pull-up hittades på SDA eller SCL; kontrollera inkopplingen"
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr "Ingen pulldown på pinnen; 1Mohm rekommenderas"
@@ -1539,6 +1629,10 @@ msgstr "Udda paritet stöds inte"
msgid "Only 8 or 16 bit mono with "
msgstr "Endast 8 eller 16 bitars mono med "
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr "Endast IN/OUT på upp till 8 stöds"
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr "Endast IPv4-adresser stöds"
@@ -1591,10 +1685,15 @@ msgstr "Åtgärden orsakade timeout"
msgid "Out of memory"
msgstr "Slut på minne"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr "Slut på sockets"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr "Utdatabuffert måste vara minst %d byte"
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "Översampling måste vara multipel av 8."
@@ -1616,6 +1715,7 @@ msgstr ""
"skapandet."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr "ParallelBus stöds ännu inte"
@@ -1628,11 +1728,20 @@ msgstr "Periferi i bruk"
msgid "Permission denied"
msgstr "Åtkomst nekad"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr "Antalet pinnar måste vara minst 1"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr "Antal pinnar för stort"
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "Pinnen har inte ADC-funktionalitet"
@@ -1661,6 +1770,10 @@ msgstr ""
"%d byte. Om detta inte kan undvikas, skicka allow_inefficient=True till "
"konstruktorn"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr "Pinnar måste dela PWM-segment"
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr "Plus eventuella moduler i filsystemet\n"
@@ -1702,10 +1815,34 @@ msgstr ""
msgid "Pretending to deep sleep until alarm, CTRL-C or file write.\n"
msgstr "Fingerar djup sömn tills larm, Ctrl-C eller filskrivning.\n"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr "Program gör IN utan att ladda ISR"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr "Program gör OUT utan att läsa in OSR"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr "Programmet måste innehålla minst en 16-bitars instruktion."
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr "Programstorlek ogiltig"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr "Programmet är för stort"
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "Pull används inte när riktningen är output."
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr "RAISE-läge är inte implementerat"
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "RNG DeInit-fel"
@@ -1714,6 +1851,10 @@ msgstr "RNG DeInit-fel"
msgid "RNG Init Error"
msgstr "RNG Init-fel"
+#: ports/nrf/common-hal/busio/UART.c
+msgid "RS485 Not yet supported on this device"
+msgstr "RS485 stöds ännu inte på den här enheten"
+
#: ports/esp32s2/common-hal/busio/UART.c
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1721,6 +1862,7 @@ 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/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "RTC-kalibrering stöds inte av detta kort"
@@ -1729,7 +1871,7 @@ msgid "RTC is not supported on this board"
msgstr "RTC stöds inte av detta kort"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr "RTS/CTS/RS485 Stöds ännu inte på den här enheten"
@@ -1786,11 +1928,6 @@ msgstr "Kör i säkert läge! "
msgid "SD card CSD format not supported"
msgstr "SD-kort CSD-format stöds inte"
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDA eller SCL behöver en pullup"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1809,6 +1946,10 @@ msgstr "SPI Init-fel"
msgid "SPI Re-initialization error"
msgstr "SPI reinitialiseringsfel"
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr "SPI-enhet används redan"
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "Samplingsfrekvensen måste vara positiv"
@@ -1839,6 +1980,14 @@ msgstr "Serializern används redan"
msgid "Server side context cannot have hostname"
msgstr "Serversidans kontext kan inte ha värdnamn"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr "Inställt antal pinnar måste vara mellan 1 och 5"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr "Sido-setets antal pinnar måste vara mellan 1 och 5"
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr "Storleken stöds inte"
@@ -1870,6 +2019,14 @@ msgstr "Splitting med sub-captures"
msgid "Stack size must be at least 256"
msgstr "Stackstorleken måste vara minst 256"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr "Vänster stereokanal måste använda PWM kanal A"
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr "Höger stereokanal måste använda PWM kanal B"
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "Stream saknar readinto() eller write() metod."
@@ -2013,6 +2170,10 @@ msgstr "UART Init-fel"
msgid "UART Re-init error"
msgstr "UART reinit-fel"
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr "UART stöds ännu inte"
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr "UART skrivfel"
@@ -2039,6 +2200,7 @@ msgstr "UUID-värdet är inte str, int eller byte-buffert"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Unable to allocate buffers for signed conversion"
msgstr "Det går inte att allokera buffert för signerad konvertering"
@@ -2076,7 +2238,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/socketpool/Socket.c
+#: ports/esp32s2/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"
@@ -2119,7 +2281,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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"
@@ -2170,6 +2333,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr "VARNING: Ditt filnamn för kod har två tillägg\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr "WatchDogTimer kan inte avinitialiseras när läget är inställt på RESET"
@@ -2381,7 +2545,7 @@ msgstr "buffertsegmenten måste vara lika långa"
msgid "buffer too small"
msgstr "buffert för liten"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr "buffert för liten för begärd längd"
@@ -3235,6 +3399,10 @@ msgstr "minnesallokering misslyckades, allokerar %u byte"
msgid "memory allocation failed, heap is locked"
msgstr "minnesallokeringen misslyckades, heapen är låst"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr "memoryview: längden är inte en multipel av itemsize"
+
#: py/builtinimport.c
msgid "module not found"
msgstr "modulen hittades inte"
@@ -3550,6 +3718,10 @@ msgstr "pop från en tom PulseIn"
msgid "pop from empty %q"
msgstr "pop från tom %q"
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr "port måste vara >= 0"
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "pow() 3: e argument kan inte vara 0"
@@ -3566,6 +3738,7 @@ msgstr "pow() med 3 argument kräver heltal"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3583,6 +3756,14 @@ msgstr "trycka på startknappen vid start.\n"
msgid "pressing both buttons at start up.\n"
msgstr "trycka båda knapparna vid uppstart.\n"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr "pull_threshold måste vara mellan 1 och 32"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr "push_threshold måste vara mellan 1 och 32"
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "köstorlek överskreds"
@@ -3780,7 +3961,7 @@ msgstr "tröskelvärdet måste ligga i intervallet 0-65536"
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "tile must be greater than zero"
-msgstr ""
+msgstr "tile måste vara större än noll"
#: shared-bindings/time/__init__.c
msgid "time.struct_time() takes a 9-sequence"
@@ -3788,6 +3969,7 @@ msgstr "time.struct_time() kräver en 9-sekvens"
#: ports/esp32s2/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"
msgstr "timeout-längd överskred det maximala värde som stöds"
@@ -3998,6 +4180,11 @@ msgstr "watchdog är inte initierad"
msgid "watchdog timeout must be greater than 0"
msgstr "watchdog timeout måste vara större än 0"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr "width måste vara mellan 2 och 8, inte %d"
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr "width måste vara större än noll"
@@ -4070,6 +4257,15 @@ 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 "SDA or SCL needs a pull up"
+#~ msgstr "SDA eller SCL behöver en pullup"
+
+#~ msgid "Invalid use of TLS Socket"
+#~ msgstr "Ogiltig användning av TLS Socket"
+
+#~ msgid "Issue setting SO_REUSEADDR"
+#~ msgstr "Misslyckades att sätta SO_REUSEADDR"
+
#~ msgid "%d address pins and %d rgb pins indicate a height of %d, not %d"
#~ msgstr "%d adresspinnar och %d RGB-pinnar indikerar en höjd av %d, inte %d"
diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po
index 07e461bf8..5a0838000 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-01-25 19:32+0000\n"
+"PO-Revision-Date: 2021-02-09 14:03+0000\n"
"Last-Translator: hexthat <hexthat@gmail.com>\n"
"Language-Team: Chinese Hanyu Pinyin\n"
"Language: zh_Latn_pinyin\n"
@@ -69,6 +69,8 @@ msgstr "%%c xūyào zhěngshù huò char"
msgid ""
"%d address pins, %d rgb pins and %d tiles indicate a height of %d, not %d"
msgstr ""
+"%d de zhǐ yǐn jiǎo , %d rgb yǐn jiǎo hé %d qiē piàn biǎo shì %d de gāo dù, "
+"ér bù shì %d"
#: ports/atmel-samd/common-hal/sdioio/SDCard.c
msgid "%q failure: %d"
@@ -347,6 +349,10 @@ msgstr "Suǒyǒu UART wàiwéi zhèngzài shǐyòng"
msgid "All event channels in use"
msgstr "Suǒyǒu shǐyòng de shìjiàn píndào"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "All state machines in use"
+msgstr "suǒ yǒu zhèng zài shǐ yòng de zhuàng tài jī"
+
#: ports/atmel-samd/audio_dma.c ports/atmel-samd/common-hal/audiobusio/PDMIn.c
msgid "All sync event channels in use"
msgstr "Suǒyǒu tóngbù shìjiàn píndào shǐyòng"
@@ -367,6 +373,7 @@ msgstr "Cǐ yǐn jiǎo de suǒyǒu jìshí qì zhèngzài shǐyòng"
#: ports/esp32s2/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
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr "Suǒyǒu jìshí qì shǐyòng"
@@ -395,6 +402,7 @@ msgstr "Gěi dìng de yǐn jiǎo bù zhīchí AnalogIn"
#: ports/cxd56/common-hal/analogio/AnalogOut.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogOut.c
#: ports/nrf/common-hal/analogio/AnalogOut.c
+#: ports/raspberrypi/common-hal/analogio/AnalogOut.c
msgid "AnalogOut functionality not supported"
msgstr "Bù zhīchí AnalogOut gōngnéng"
@@ -598,6 +606,7 @@ msgstr "Wúfǎ shānchú zhí"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
#: ports/nrf/common-hal/digitalio/DigitalInOut.c
+#: ports/raspberrypi/common-hal/digitalio/DigitalInOut.c
msgid "Cannot get pull while in output mode"
msgstr "Zài shūchū móshì xià wúfǎ huòqǔ lādòng"
@@ -635,6 +644,10 @@ msgstr "USB jīhuó shí wúfǎ chóngxīn bǎng ding '/'."
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
+msgid "Cannot set socket options"
+msgstr "wú fǎ shè zhì tào jiē zì xuǎn xiàng"
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Cannot set value when direction is input."
msgstr "Dāng fāngxiàng xiàng nèi shí, bùnéng shèzhì gāi zhí."
@@ -817,7 +830,7 @@ msgstr "Shùjù 0 de yǐn jiǎo bìxū shì zì jié duìqí"
#: ports/esp32s2/common-hal/displayio/ParallelBus.c
msgid "Data 0 pin must be byte aligned."
-msgstr ""
+msgstr "shù jù 0 yǐn jiǎo bì xū àn zì jié duì qí."
#: shared-module/audiocore/WaveFile.c
msgid "Data chunk must follow fmt chunk"
@@ -873,11 +886,12 @@ msgstr "EXTINT píndào yǐjīng shǐyòng"
msgid "Error in regex"
msgstr "Zhèngzé biǎodá shì cuòwù"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "Error: Failure to bind"
msgstr "cuò wù: bǎng dìng shī bài"
-#: py/enum.c shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c py/enum.c
+#: shared-bindings/_bleio/__init__.c shared-bindings/aesio/aes.c
#: shared-bindings/busio/SPI.c shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
@@ -931,7 +945,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/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLSocket.c
msgid "Failed SSL handshake"
msgstr "SSL wòshǒu shībài"
@@ -1059,6 +1073,10 @@ msgstr "Wénjiàn shàng de I/ O cāozuò"
msgid "I2C Init Error"
msgstr "I2C chūshǐhuà cuòwù"
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "I2C peripheral in use"
+msgstr "I2C wài shè zhèng zài shǐ yòng zhōng"
+
#: shared-bindings/audiobusio/I2SOut.c
msgid "I2SOut not available"
msgstr "I2SOut bù kě yòng"
@@ -1084,10 +1102,19 @@ msgstr ""
msgid "Incorrect buffer size"
msgstr "Huǎnchōng qū dàxiǎo bù zhèngquè"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Init program size invalid"
+msgstr "Init chéng xù dà xiǎo wú xiào"
+
#: ports/esp32s2/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"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Input buffer length (%d) must be a multiple of the strand count (%d)"
+msgstr ""
+
#: ports/atmel-samd/common-hal/pulseio/PulseIn.c
msgid "Input taking too long"
msgstr "Shūrù shíjiānguò zhǎng"
@@ -1096,6 +1123,31 @@ msgstr "Shūrù shíjiānguò zhǎng"
msgid "Input/output error"
msgstr "Shūrù/shūchū cuòwù"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d jumps on pin"
+msgstr "zhǐ lìng %d zài yǐn jiǎo shàng tiào zhuǎn"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts in more bits than pin count"
+msgstr "zhǐ lìng %d yí wèi chāo guò yǐn jiǎo jì shù"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d shifts out more bits than pin count"
+msgstr "zhǐ lìng %d yí chū de wèi bǐ yǐn jiǎo shù duō"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d uses extra pin"
+msgstr "zhǐ lìng %d shǐ yòng é wài de yǐn jiǎo"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Instruction %d waits on input outside of count"
+msgstr "zhǐ lìng %d děng dài jì shù zhī wài de shū rù"
+
#: ports/nrf/common-hal/_bleio/__init__.c
msgid "Insufficient authentication"
msgstr "Rènzhèng bùzú"
@@ -1147,7 +1199,7 @@ msgstr "Tí gōng liǎo wúxiào de DAC yǐn jiǎo"
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
-#: shared-bindings/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ǜ"
@@ -1241,6 +1293,8 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào"
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c
#: ports/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/SPI.c
msgid "Invalid pins"
msgstr "Wúxiào de yǐn jiǎo"
@@ -1269,7 +1323,7 @@ msgstr "Ānquán móshì wúxiào"
msgid "Invalid size"
msgstr "dà xiǎo wú xiào"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/ssl/SSLContext.c
msgid "Invalid socket for TLS"
msgstr "TLS de chā zuò wú xiào"
@@ -1277,10 +1331,6 @@ msgstr "TLS de chā zuò wú xiào"
msgid "Invalid state"
msgstr "wú xiào zhuàng tài"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Invalid use of TLS Socket"
-msgstr "TLS tào jiē zì de wú xiào shǐ yòng"
-
#: shared-bindings/audiomixer/Mixer.c
msgid "Invalid voice"
msgstr "Yǔyīn wúxiào"
@@ -1297,10 +1347,6 @@ msgstr "Wúxiào de làng làngcháo wénjiàn"
msgid "Invalid word/bit length"
msgstr "Wúxiào de zì/wèi chángdù"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
-msgid "Issue setting SO_REUSEADDR"
-msgstr "wèn tí shè zhì SO_REUSEADDR"
-
#: shared-bindings/aesio/aes.c
msgid "Key must be 16, 24, or 32 bytes long"
msgstr "mì yào bì xū wéi 16, 24 huò 32 zì jié cháng"
@@ -1362,6 +1408,37 @@ msgstr "Màikèfēng qǐdòng yánchí bìxū zài 0.0 Dào 1.0 De fànwéi nèi
msgid "Missing MISO or MOSI Pin"
msgstr "Quēshǎo MISO huò MOSI yǐn jiǎo"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d reads pin(s)"
+msgstr "shǒu xiān zài yǐn jiǎo zhōng quē shī. zhǐ lìng %d dú qǔ yǐn jiǎo"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d shifts in from pin(s)"
+msgstr "shǒu xiān zài yǐn jiǎo zhōng quē shī. zhǐ lìng %d cóng yǐn jiǎo yí wèi"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_in_pin. Instruction %d waits based on pin"
+msgstr ""
+"shǒu xiān zài yǐn jiǎo zhōng quē shī. jī yú yǐn jiǎo de zhǐ lìng %d děng dài"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d shifts out to pin(s)"
+msgstr "xiān lòu chū yǐn jiǎo. zhǐ lìng %d yí chū dào yǐn jiǎo"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+msgid "Missing first_out_pin. Instruction %d writes pin(s)"
+msgstr "xiān lòu chū yǐn jiǎo. zhǐ lìng %d xiě rù yǐn jiǎo"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+#, c-format
+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"
+
#: shared-bindings/displayio/Group.c
msgid "Must be a %q subclass."
msgstr "Bìxū shì %q zi lèi."
@@ -1394,9 +1471,14 @@ msgstr "Méiyǒu DAC zài xīnpiàn shàng de"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "No DMA channel found"
msgstr "Wèi zhǎodào DMA píndào"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "No DMA pacing timer found"
+msgstr ""
+
#: shared-module/adafruit_bus_device/I2CDevice.c
#, c-format
msgid "No I2C device at address: %x"
@@ -1415,14 +1497,14 @@ 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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/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/mimxrt10xx/common-hal/busio/UART.c ports/nrf/common-hal/busio/UART.c
-#: ports/stm/common-hal/busio/UART.c
+#: ports/raspberrypi/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
msgid "No TX pin"
msgstr "Wèi zhǎodào TX yǐn jiǎo"
@@ -1479,6 +1561,16 @@ msgstr "Gāi yǐn jiǎo shàng méiyǒu kěyòng de dìngshí qì."
msgid "No network with that ssid"
msgstr "Méiyǒu wǎngluò yǔ gāi ssid"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+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/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
+#: ports/raspberrypi/common-hal/busio/I2C.c
+msgid "No pull up found on SDA or SCL; check your wiring"
+msgstr "zài SDA huò SCL shàng wèi zhǎo dào shàng lā; jiǎn chá nín de xiàn lù"
+
#: shared-module/touchio/TouchIn.c
msgid "No pulldown on pin; 1Mohm recommended"
msgstr "Yǐn jiǎo shàng méiyǒu xiàlā; 1Mohm tuījiàn"
@@ -1535,6 +1627,10 @@ 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/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Only IN/OUT of up to 8 supported"
+msgstr "jǐn zhī chí zuì duō 8 gè IN/OUT"
+
#: ports/esp32s2/common-hal/wifi/__init__.c
msgid "Only IPv4 addresses supported"
msgstr "Jǐn zhīchí IPv4 dìzhǐ"
@@ -1588,10 +1684,15 @@ msgstr "cāo zuò yǐ fēn shí"
msgid "Out of memory"
msgstr "nèi cún bù zú"
-#: ports/esp32s2/common-hal/socketpool/Socket.c
+#: ports/esp32s2/common-hal/socketpool/SocketPool.c
msgid "Out of sockets"
msgstr "tào jiē zì wài"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "Output buffer must be at least %d bytes"
+msgstr ""
+
#: shared-bindings/audiobusio/PDMIn.c
msgid "Oversample must be multiple of 8."
msgstr "Guò cǎiyàng bìxū shì 8 de bèishù."
@@ -1612,6 +1713,7 @@ msgid ""
msgstr "Dāng biànliàng_pínlǜ shì False zài jiànzhú shí PWM pínlǜ bùkě xiě."
#: ports/mimxrt10xx/common-hal/displayio/ParallelBus.c
+#: ports/raspberrypi/common-hal/displayio/ParallelBus.c
#: ports/stm/common-hal/displayio/ParallelBus.c
msgid "ParallelBus not yet supported"
msgstr "Shàng bù zhīchí ParallelBus"
@@ -1624,11 +1726,20 @@ msgstr "shǐ yòng zhōng de wài shè"
msgid "Permission denied"
msgstr "Quánxiàn bèi jùjué"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Pin count must be at least 1"
+msgstr "yǐn jiǎo jì shù bì xū zhì shǎo wéi 1"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Pin count too large"
+msgstr "yǐn jiǎo jì shù tài dà"
+
#: ports/atmel-samd/common-hal/analogio/AnalogIn.c
#: ports/cxd56/common-hal/analogio/AnalogIn.c
#: ports/esp32s2/common-hal/analogio/AnalogIn.c
#: ports/mimxrt10xx/common-hal/analogio/AnalogIn.c
#: ports/nrf/common-hal/analogio/AnalogIn.c
+#: ports/raspberrypi/common-hal/analogio/AnalogIn.c
#: ports/stm/common-hal/analogio/AnalogIn.c
msgid "Pin does not have ADC capabilities"
msgstr "Pin méiyǒu ADC nénglì"
@@ -1657,6 +1768,10 @@ msgstr ""
"duōzì jié. Rúguǒ wúfǎ bìmiǎn, qǐng jiāng allow_inefficient = True chuándì "
"gěigòuzào hánshù"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Pins must share PWM slice"
+msgstr ""
+
#: py/builtinhelp.c
msgid "Plus any modules on the filesystem\n"
msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n"
@@ -1695,10 +1810,34 @@ msgstr ""
"jiǎ zhuāng shēn dù shuì mián , zhí dào bào jǐng , CTRL-C huò wén jiàn xiě "
"rù .\n"
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does IN without loading ISR"
+msgstr "chéng xù zài bù jiā zǎi ISR de qíng kuàng xià wán chéng"
+
+#: ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+msgid "Program does OUT without loading OSR"
+msgstr "chéng xù zài bù jiā zǎi Osr de qíng kuàng xià zhí xíng OUT"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program must contain at least one 16-bit instruction."
+msgstr "chéng xù bì xū zhì shǎo bāo hán yí gè 16 wèi zhǐ lìng ."
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program size invalid"
+msgstr "chéng xù dà xiǎo wú xiào"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Program too large"
+msgstr "chéng xù tài dà"
+
#: shared-bindings/digitalio/DigitalInOut.c
msgid "Pull not used when direction is output."
msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng."
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
+msgid "RAISE mode is not implemented"
+msgstr "wèi shí xiàn tí shēng mó shì"
+
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "RNG qǔxiāo chūshǐhuà cuòwù"
@@ -1707,6 +1846,10 @@ msgstr "RNG qǔxiāo chūshǐhuà cuòwù"
msgid "RNG Init Error"
msgstr "RNG chūshǐhuà cuòwù"
+#: ports/nrf/common-hal/busio/UART.c
+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/mimxrt10xx/common-hal/busio/UART.c
msgid "RS485 inversion specified when not in RS485 mode"
@@ -1714,6 +1857,7 @@ 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/mimxrt10xx/common-hal/rtc/RTC.c ports/nrf/common-hal/rtc/RTC.c
+#: ports/raspberrypi/common-hal/rtc/RTC.c
msgid "RTC calibration is not supported on this board"
msgstr "Cǐ bǎn bù zhīchí RTC jiàozhǔn"
@@ -1722,7 +1866,7 @@ msgid "RTC is not supported on this board"
msgstr "Cǐ bǎn bù zhīchí RTC"
#: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c
-#: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c
+#: ports/stm/common-hal/busio/UART.c
msgid "RTS/CTS/RS485 Not yet supported on this device"
msgstr "RTS/CTS/RS485 gāi shèbèi shàng bù zhīchí"
@@ -1779,11 +1923,6 @@ msgstr "Zài ānquán móshì xià yùnxíng! "
msgid "SD card CSD format not supported"
msgstr "Bù zhīchí SD kǎ CSD géshì"
-#: ports/atmel-samd/common-hal/busio/I2C.c ports/esp32s2/common-hal/busio/I2C.c
-#: ports/mimxrt10xx/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
-msgid "SDA or SCL needs a pull up"
-msgstr "SDA huò SCL xūyào lādòng"
-
#: ports/stm/common-hal/sdioio/SDCard.c
#, c-format
msgid "SDIO GetCardInfo Error %d"
@@ -1802,6 +1941,10 @@ msgstr "SPI chūshǐhuà cuòwù"
msgid "SPI Re-initialization error"
msgstr "SPI chóngxīn chūshǐhuà cuòwù"
+#: ports/raspberrypi/common-hal/busio/SPI.c
+msgid "SPI peripheral in use"
+msgstr "SPI wài shè zhèng zài shǐ yòng zhōng"
+
#: shared-bindings/audiomixer/Mixer.c
msgid "Sample rate must be positive"
msgstr "Cǎiyàng lǜ bìxū wèi zhèng shù"
@@ -1832,6 +1975,14 @@ msgstr "Xùliè huà yǐjīng shǐyòngguò"
msgid "Server side context cannot have hostname"
msgstr "Fúwùqì duān shàngxiàwén bùnéng jùyǒu zhǔjī míng"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Set pin count must be between 1 and 5"
+msgstr "shè zhì yǐn jiǎo shù bì xū jiè yú 1 hé 5 zhī jiān"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "Side set pin count must be between 1 and 5"
+msgstr "cè miàn shè zhì yǐn jiǎo shù bì xū jiè yú 1 hé 5 zhī jiān"
+
#: ports/cxd56/common-hal/camera/Camera.c
msgid "Size not supported"
msgstr "bù zhī chí dà xiǎo"
@@ -1863,6 +2014,14 @@ msgstr "Yǔ zi bǔhuò fēnliè"
msgid "Stack size must be at least 256"
msgstr "Duīzhàn dàxiǎo bìxū zhìshǎo 256"
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo left must be on PWM channel A"
+msgstr ""
+
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
+msgid "Stereo right must be on PWM channel B"
+msgstr ""
+
#: shared-bindings/multiterminal/__init__.c
msgid "Stream missing readinto() or write() method."
msgstr "Liú quēshǎo readinto() huò write() fāngfǎ."
@@ -2005,6 +2164,10 @@ msgstr "UART chūshǐhuà cuòwù"
msgid "UART Re-init error"
msgstr "UART chóngxīn chūshǐhuà cuòwù"
+#: ports/raspberrypi/common-hal/busio/UART.c
+msgid "UART not yet supported"
+msgstr "UART shàng wèi shòu zhī chí"
+
#: ports/stm/common-hal/busio/UART.c
msgid "UART write error"
msgstr "UART xiě cuòwù"
@@ -2031,6 +2194,7 @@ msgstr "UUID zhí bùshì str,int huò zì jié huǎnchōng qū"
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
+#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
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"
@@ -2068,7 +2232,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/socketpool/Socket.c
+#: ports/esp32s2/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"
@@ -2111,7 +2275,8 @@ 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/stm/common-hal/busio/I2C.c
+#: ports/esp32s2/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"
@@ -2162,6 +2327,7 @@ msgid "WARNING: Your code filename has two extensions\n"
msgstr "Jǐnggào: Nǐ de dàimǎ wénjiàn míng yǒu liǎng gè kuòzhǎn míng\n"
#: ports/nrf/common-hal/watchdog/WatchDogTimer.c
+#: ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
msgid "WatchDogTimer cannot be deinitialized once mode is set to RESET"
msgstr "Yīdàn jiāng móshì shèzhì wèi RESET, jiù wúfǎ chūshǐhuà WatchDog Timer"
@@ -2374,7 +2540,7 @@ msgstr "huǎnchōng qū qiēpiàn bìxū chángdù xiāngděng"
msgid "buffer too small"
msgstr "huǎnchōng qū tài xiǎo"
-#: shared-bindings/socketpool/Socket.c
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
msgid "buffer too small for requested bytes"
msgstr "huǎn chōng qū tài xiǎo, duì yú qǐng qiú de zì jié"
@@ -3227,6 +3393,10 @@ msgstr "nèicún fēnpèi shībài, fēnpèi %u zì jié"
msgid "memory allocation failed, heap is locked"
msgstr "jìyì tǐ fēnpèi shībài, duī bèi suǒdìng"
+#: py/objarray.c
+msgid "memoryview: length is not a multiple of itemsize"
+msgstr ""
+
#: py/builtinimport.c
msgid "module not found"
msgstr "zhǎo bù dào mókuài"
@@ -3541,6 +3711,10 @@ msgstr "cóng kōng mài chōng tán chū"
msgid "pop from empty %q"
msgstr "cóng kōng %q dànchū"
+#: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c
+msgid "port must be >= 0"
+msgstr "duān kǒu bì xū wéi >= 0"
+
#: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0"
msgstr "pow() 3 cān shǔ bùnéng wéi 0"
@@ -3557,6 +3731,7 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù"
#: 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/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.h
#: ports/esp32s2/boards/muselab_nanoesp32_s2/mpconfigboard.h
#: ports/esp32s2/boards/targett_module_clip_wroom/mpconfigboard.h
@@ -3574,6 +3749,14 @@ msgstr "Zài qǐdòng shí àn qǐdòng ànniǔ.\n"
msgid "pressing both buttons at start up.\n"
msgstr "zài qǐdòng shí tóngshí àn xià liǎng gè ànniǔ.\n"
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "pull_threshold must be between 1 and 32"
+msgstr "lā lì yù zhí bì xū jiè yú 1 hé 32 zhī jiān"
+
+#: ports/raspberrypi/bindings/rp2pio/StateMachine.c
+msgid "push_threshold must be between 1 and 32"
+msgstr "tuī sòng yù zhí bì xū jiè yú 1 hé 32 zhī jiān"
+
#: extmod/modutimeq.c
msgid "queue overflow"
msgstr "duìliè yìchū"
@@ -3771,7 +3954,7 @@ msgstr "yùzhí bìxū zài fànwéi 0-65536"
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "tile must be greater than zero"
-msgstr ""
+msgstr "cí tiē bì xū dà yú líng"
#: shared-bindings/time/__init__.c
msgid "time.struct_time() takes a 9-sequence"
@@ -3779,6 +3962,7 @@ msgstr "time.struct_time() xūyào 9 xùliè"
#: ports/esp32s2/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"
msgstr "chāoshí shíjiān chāoguò zuìdà zhīchí zhí"
@@ -3989,6 +4173,11 @@ msgstr "wèi chū shǐ huà jiān shì qì"
msgid "watchdog timeout must be greater than 0"
msgstr "kān mén gǒu chāoshí bìxū dàyú 0"
+#: shared-bindings/bitops/__init__.c
+#, c-format
+msgid "width must be from 2 to 8 (inclusive), not %d"
+msgstr ""
+
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "width must be greater than zero"
msgstr "kuāndù bìxū dàyú líng"
@@ -4061,6 +4250,15 @@ 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 "SDA or SCL needs a pull up"
+#~ msgstr "SDA huò SCL xūyào lādòng"
+
+#~ msgid "Invalid use of TLS Socket"
+#~ msgstr "TLS tào jiē zì de wú xiào shǐ yòng"
+
+#~ msgid "Issue setting SO_REUSEADDR"
+#~ msgstr "wèn tí shè zhì SO_REUSEADDR"
+
#~ msgid "%d address pins and %d rgb pins indicate a height of %d, not %d"
#~ msgstr ""
#~ "%d dìzhǐ yǐn jiǎo hé %d rgb yǐn jiǎo jiāng gāodù biǎoshì wèi %d, ér bùshì "
diff --git a/main.c b/main.c
index d9cdcca1d..7df6e293a 100755
--- a/main.c
+++ b/main.c
@@ -69,6 +69,19 @@
#include "shared-bindings/alarm/__init__.h"
#endif
+#if CIRCUITPY_BLEIO
+#include "shared-bindings/_bleio/__init__.h"
+#include "supervisor/shared/bluetooth.h"
+#endif
+
+#if CIRCUITPY_BOARD
+#include "shared-module/board/__init__.h"
+#endif
+
+#if CIRCUITPY_CANIO
+#include "common-hal/canio/CAN.h"
+#endif
+
#if CIRCUITPY_DISPLAYIO
#include "shared-module/displayio/__init__.h"
#endif
@@ -81,17 +94,8 @@
#include "shared-module/network/__init__.h"
#endif
-#if CIRCUITPY_BOARD
-#include "shared-module/board/__init__.h"
-#endif
-
-#if CIRCUITPY_BLEIO
-#include "shared-bindings/_bleio/__init__.h"
-#include "supervisor/shared/bluetooth.h"
-#endif
-
-#if CIRCUITPY_CANIO
-#include "common-hal/canio/CAN.h"
+#if CIRCUITPY_USB_CDC
+#include "shared-module/usb_cdc/__init__.h"
#endif
#if CIRCUITPY_WIFI
@@ -184,6 +188,7 @@ STATIC void stop_mp(void) {
#endif
background_callback_reset();
+ usb_background();
gc_deinit();
}
diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile
index 58c1c0d60..48724af0c 100644
--- a/ports/atmel-samd/Makefile
+++ b/ports/atmel-samd/Makefile
@@ -122,7 +122,7 @@ CFLAGS += -ftree-vrp
$(echo PERIPHERALS_CHIP_FAMILY=$(PERIPHERALS_CHIP_FAMILY))
#Debugging/Optimization
ifeq ($(DEBUG), 1)
- CFLAGS += -ggdb3 -Og
+ CFLAGS += -ggdb3 -Og -Os
# You may want to disable -flto if it interferes with debugging.
CFLAGS += -flto -flto-partition=none
# You may want to enable these flags to make setting breakpoints easier.
diff --git a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk
index f976dfe78..295d7b2ae 100644
--- a/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/8086_commander/mpconfigboard.mk
@@ -15,8 +15,7 @@ CIRCUITPY_FULL_BUILD = 0
CIRCUITPY_USB_MIDI = 0
SUPEROPT_GC = 0
-
-CFLAGS_INLINE_LIMIT = 60
+SUPEROPT_VM = 0
CIRCUITPY_GAMEPAD = 1
CIRCUITPY_BUSDEVICE = 1
diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk
index 36d463697..1fd96b0ae 100644
--- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk
@@ -9,5 +9,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
+
SUPEROPT_GC = 0
SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk
index 20307fc05..fabe52ce2 100644
--- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk
@@ -12,4 +12,3 @@ CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
SUPEROPT_VM = 0
-CFLAGS_INLINE_LIMIT = 40
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 07b1b9800..c16c53e6d 100644
--- a/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/arduino_nano_33_iot/mpconfigboard.mk
@@ -11,5 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk
index a5722c9ad..697ec02c3 100644
--- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk
@@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk
index 6a2c89619..ec037837e 100644
--- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk
@@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk
index ae0b6837c..6d240686d 100644
--- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk
@@ -22,7 +22,7 @@ CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
SUPEROPT_GC = 0
-CFLAGS_INLINE_LIMIT = 40
+SUPEROPT_VM = 0
# Include these Python libraries in firmware.
diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk
index aace5c0cb..2a97636de 100644
--- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk
@@ -25,25 +25,10 @@ CIRCUITPY_RTC = 0
CIRCUITPY_VECTORIO = 0
SUPEROPT_GC = 0
-CFLAGS_INLINE_LIMIT = 55
+SUPEROPT_VM = 0
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_CircuitPlayground
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), ja)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 15
-endif
-ifeq ($(TRANSLATION), zh_Latn_pinyin)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
-ifeq ($(TRANSLATION), de_DE)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-SUPEROPT_VM = 0
-endif
diff --git a/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk b/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk
index 861a0a5f7..3799d7ef7 100644
--- a/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/cp_sapling_m0/mpconfigboard.mk
@@ -11,14 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), zh_Latn_pinyin)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
-ifeq ($(TRANSLATION), de_DE)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
SUPEROPT_VM = 0
-endif
diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk
index ae05d32f2..22b55f6fd 100644
--- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk
@@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk
index 6fd05f403..7e9918291 100644
--- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk
@@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk
index d42a7869d..5916f23b3 100644
--- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk
@@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk
index d92cbc71b..1065fb50a 100644
--- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk
@@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/dynalora_usb/board.c b/ports/atmel-samd/boards/dynalora_usb/board.c
new file mode 100644
index 000000000..84960e73c
--- /dev/null
+++ b/ports/atmel-samd/boards/dynalora_usb/board.c
@@ -0,0 +1,37 @@
+/*
+ * 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/atmel-samd/boards/dynalora_usb/mpconfigboard.h b/ports/atmel-samd/boards/dynalora_usb/mpconfigboard.h
new file mode 100644
index 000000000..12359ce8f
--- /dev/null
+++ b/ports/atmel-samd/boards/dynalora_usb/mpconfigboard.h
@@ -0,0 +1,36 @@
+#define MICROPY_HW_BOARD_NAME "DynaLoRa_USB"
+#define MICROPY_HW_MCU_NAME "samd21e18"
+
+#define MICROPY_HW_LED_STATUS (&pin_PA27)
+#define MICROPY_HW_NEOPIXEL (&pin_PA19)
+
+#define SPI_FLASH_MOSI_PIN &pin_PA04
+#define SPI_FLASH_MISO_PIN &pin_PA05
+#define SPI_FLASH_SCK_PIN &pin_PA07
+#define SPI_FLASH_CS_PIN &pin_PA06
+
+// These are pins not to reset.
+#define MICROPY_PORT_A (0)
+#define MICROPY_PORT_B (0)
+#define MICROPY_PORT_C (0)
+
+#define DEFAULT_I2C_BUS_SCL (&pin_PA01)
+#define DEFAULT_I2C_BUS_SDA (&pin_PA00)
+
+#define DEFAULT_SPI_BUS_SCK (&pin_PA17)
+#define DEFAULT_SPI_BUS_MOSI (&pin_PA16)
+#define DEFAULT_SPI_BUS_MISO (&pin_PA18)
+
+#define DEFAULT_UART_BUS_RX (&pin_PA00)
+#define DEFAULT_UART_BUS_TX (&pin_PA01)
+
+// USB is always used internally so skip the pin objects for it.
+#define IGNORE_PIN_PA23 1
+#define IGNORE_PIN_PA24 1
+
+// Not connected
+#define IGNORE_PIN_PA08 1
+#define IGNORE_PIN_PA14 1
+#define IGNORE_PIN_PA21 1
+#define IGNORE_PIN_PA22 1
+#define IGNORE_PIN_PA28 1
diff --git a/ports/atmel-samd/boards/dynalora_usb/mpconfigboard.mk b/ports/atmel-samd/boards/dynalora_usb/mpconfigboard.mk
new file mode 100644
index 000000000..ac14e7395
--- /dev/null
+++ b/ports/atmel-samd/boards/dynalora_usb/mpconfigboard.mk
@@ -0,0 +1,39 @@
+USB_VID = 0x04D8
+USB_PID = 0xEA2A
+USB_PRODUCT = "DynaLoRa_USB"
+USB_MANUFACTURER = "BHDynamics"
+
+CHIP_VARIANT = SAMD21E18A
+CHIP_FAMILY = samd21
+
+SPI_FLASH_FILESYSTEM = 1
+EXTERNAL_FLASH_DEVICE_COUNT = 1
+EXTERNAL_FLASH_DEVICES = GD25Q32C
+LONGINT_IMPL = MPZ
+
+CIRCUITPY_AUDIOBUSIO = 0
+CIRCUITPY_FREQUENCYIO = 0
+CIRCUITPY_GAMEPAD = 0
+CIRCUITPY_DISPLAYIO = 0
+CIRCUITPY_FULL_BUILD = 0
+
+SUPEROPT_GC = 0
+
+CFLAGS_BOARD = --param max-inline-insns-auto=15
+ifeq ($(TRANSLATION), zh_Latn_pinyin)
+RELEASE_NEEDS_CLEAN_BUILD = 1
+CFLAGS_INLINE_LIMIT = 35
+endif
+ifeq ($(TRANSLATION), ja)
+RELEASE_NEEDS_CLEAN_BUILD = 1
+CFLAGS_INLINE_LIMIT = 35
+endif
+ifeq ($(TRANSLATION), de_DE)
+RELEASE_NEEDS_CLEAN_BUILD = 1
+CFLAGS_INLINE_LIMIT = 35
+SUPEROPT_VM = 0
+endif
+
+FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
+FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_RFM9x
+FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD
diff --git a/ports/atmel-samd/boards/dynalora_usb/pins.c b/ports/atmel-samd/boards/dynalora_usb/pins.c
new file mode 100644
index 000000000..25f498543
--- /dev/null
+++ b/ports/atmel-samd/boards/dynalora_usb/pins.c
@@ -0,0 +1,41 @@
+#include "shared-bindings/board/__init__.h"
+
+STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
+ { 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) },
+ { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA30) },
+ { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA31) },
+
+ { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA00) },
+ { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) },
+ { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA02) },
+
+ { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA16) },
+ { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA18) },
+ { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) },
+ { MP_ROM_QSTR(MP_QSTR_RADIO_CS), MP_ROM_PTR(&pin_PA11) },
+ { MP_ROM_QSTR(MP_QSTR_RADIO_INT), MP_ROM_PTR(&pin_PA09) },
+ { MP_ROM_QSTR(MP_QSTR_RADIO_RESET), MP_ROM_PTR(&pin_PA10) },
+
+ { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PA03) },
+
+ { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA01) },
+ { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA00) },
+
+ { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA01) },
+ { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA00) },
+
+ { MP_ROM_QSTR(MP_QSTR_MOSI1), MP_ROM_PTR(&pin_PA00) },
+ { MP_ROM_QSTR(MP_QSTR_MISO1), MP_ROM_PTR(&pin_PA02) },
+ { MP_ROM_QSTR(MP_QSTR_SCK1), MP_ROM_PTR(&pin_PA01) },
+
+ { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA27) },
+ { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA19) },
+ { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PA15) },
+
+ { 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);
diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk
index e45b5aae3..ffe76d930 100644
--- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk
@@ -12,3 +12,4 @@ CIRCUITPY_FULL_BUILD = 0
CIRCUITPY_RTC = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk
index 69ebdfc23..183a80ffa 100644
--- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk
@@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk
index c040eb430..52fcaec02 100644
--- a/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/fluff_m0/mpconfigboard.mk
@@ -11,9 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), zh_Latn_pinyin)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk
index e1c0f4b9a..9d086c8f5 100644
--- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk
@@ -11,14 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), zh_Latn_pinyin)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
-ifeq ($(TRANSLATION), de_DE)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
SUPEROPT_VM = 0
-endif
diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk
index 2b211abd4..6950378d5 100644
--- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk
@@ -25,22 +25,8 @@ CIRCUITPY_VECTORIO = 0
CFLAGS_INLINE_LIMIT = 55
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_LIS3DH
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), ja)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
-ifeq ($(TRANSLATION), zh_Latn_pinyin)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
-ifeq ($(TRANSLATION), de_DE)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-SUPEROPT_VM = 0
-endif
diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk
index 09804bc4e..3882e780e 100644
--- a/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk
@@ -12,3 +12,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk
index 193a0cf99..4ae1d8741 100644
--- a/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/ndgarage_ndbit6_v2/mpconfigboard.mk
@@ -12,3 +12,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.mk
index ab8065a9c..8607385d2 100644
--- a/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/neopixel_trinkey_m0/mpconfigboard.mk
@@ -9,8 +9,6 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
-SUPEROPT_GC = 0
-
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
@@ -28,16 +26,8 @@ CIRCUITPY_USB_MIDI = 1
CIRCUITPY_TOUCHIO = 1
CIRCUITPY_FULL_BUILD = 0
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), zh_Latn_pinyin)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
-ifeq ($(TRANSLATION), de_DE)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
+SUPEROPT_GC = 0
SUPEROPT_VM = 0
-endif
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk
index fadcc2144..8b2ac7ff7 100644
--- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk
@@ -20,12 +20,6 @@ CIRCUITPY_SAMD = 0
CIRCUITPY_USB_MIDI = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
FROZEN_MPY_DIRS += $(TOP)/frozen/pew-pewpew-standalone-10.x
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), de_DE)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-SUPEROPT_VM = 0
-endif
diff --git a/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk b/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk
index da97b90cc..e93155374 100644
--- a/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/picoplanet/mpconfigboard.mk
@@ -11,14 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), zh_Latn_pinyin)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
-ifeq ($(TRANSLATION), de_DE)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
SUPEROPT_VM = 0
-endif
diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk
index 8b7066ac7..b8ae77921 100644
--- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk
@@ -21,12 +21,11 @@ CIRCUITPY_SAMD = 0
CIRCUITPY_USB_MIDI = 1
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_FULL_BUILD = 0
-# Make more room.
+
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
# Include these Python libraries in firmware.
# FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_IRRemote
-
-CFLAGS_BOARD = --param max-inline-insns-auto=12
diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk
index 4484b4ed9..1a73ade94 100644
--- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk
@@ -11,10 +11,6 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_RTC = 0
-SUPEROPT_GC = 0
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), zh_Latn_pinyin)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
+SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk b/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk
index e100e2da6..c214006ea 100644
--- a/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/qtpy_m0/mpconfigboard.mk
@@ -12,5 +12,3 @@ CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
SUPEROPT_VM = 0
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
diff --git a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk
index bedec87f4..6bbd84235 100644
--- a/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk
@@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/serpente/mpconfigboard.mk b/ports/atmel-samd/boards/serpente/mpconfigboard.mk
index 09036875f..1f2c83316 100644
--- a/ports/atmel-samd/boards/serpente/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/serpente/mpconfigboard.mk
@@ -17,18 +17,4 @@ CIRCUITPY_GAMEPAD = 0
CIRCUITPY_BUSDEVICE = 0
SUPEROPT_GC = 0
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), zh_Latn_pinyin)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
-ifeq ($(TRANSLATION), ja)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
-ifeq ($(TRANSLATION), de_DE)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
SUPEROPT_VM = 0
-endif
diff --git a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk
index 0b56e9ae0..70fe44723 100644
--- a/ports/atmel-samd/boards/shirtty/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/shirtty/mpconfigboard.mk
@@ -13,5 +13,4 @@ CIRCUITPY_I2CPERIPHERAL = 1
CIRCUITPY_TOUCHIO = 0
SUPEROPT_GC = 0
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/silicognition-m4-shim/board.c b/ports/atmel-samd/boards/silicognition-m4-shim/board.c
new file mode 100644
index 000000000..5fca974e9
--- /dev/null
+++ b/ports/atmel-samd/boards/silicognition-m4-shim/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"
+#include "mpconfigboard.h"
+
+void board_init(void) {
+}
+
+bool board_requests_safe_mode(void) {
+ return false;
+}
+
+void reset_board(void) {
+}
diff --git a/ports/atmel-samd/boards/silicognition-m4-shim/mpconfigboard.h b/ports/atmel-samd/boards/silicognition-m4-shim/mpconfigboard.h
new file mode 100644
index 000000000..5028679ed
--- /dev/null
+++ b/ports/atmel-samd/boards/silicognition-m4-shim/mpconfigboard.h
@@ -0,0 +1,33 @@
+#define MICROPY_HW_BOARD_NAME "Silicognition LLC M4-Shim"
+#define MICROPY_HW_MCU_NAME "samd51j19"
+
+#define CIRCUITPY_MCU_FAMILY samd51
+
+// Rev E
+
+#define MICROPY_HW_LED_STATUS (&pin_PA23)
+#define MICROPY_HW_NEOPIXEL (&pin_PB03)
+
+// These are pins not to reset.
+// QSPI Data pins
+#define MICROPY_PORT_A (PORT_PA08 | PORT_PA09 | PORT_PA10 | PORT_PA11)
+// QSPI CS, QSPI SCK and NeoPixel pin
+#define MICROPY_PORT_B (PORT_PB03 | PORT_PB10 | PORT_PB11)
+#define MICROPY_PORT_C (0)
+#define MICROPY_PORT_D (0)
+
+#define BOARD_HAS_CRYSTAL 1
+
+#define DEFAULT_I2C_BUS_SCL (&pin_PA13)
+#define DEFAULT_I2C_BUS_SDA (&pin_PA12)
+
+#define DEFAULT_SPI_BUS_SCK (&pin_PA17)
+#define DEFAULT_SPI_BUS_MOSI (&pin_PB23)
+#define DEFAULT_SPI_BUS_MISO (&pin_PB22)
+
+#define DEFAULT_UART_BUS_RX (&pin_PB17)
+#define DEFAULT_UART_BUS_TX (&pin_PB16)
+
+// USB is always used internally so skip the pin objects for it.
+#define IGNORE_PIN_PA24 1
+#define IGNORE_PIN_PA25 1
diff --git a/ports/atmel-samd/boards/silicognition-m4-shim/mpconfigboard.mk b/ports/atmel-samd/boards/silicognition-m4-shim/mpconfigboard.mk
new file mode 100644
index 000000000..bf88cd52d
--- /dev/null
+++ b/ports/atmel-samd/boards/silicognition-m4-shim/mpconfigboard.mk
@@ -0,0 +1,14 @@
+USB_VID = 0x1209
+USB_PID = 0xF500
+USB_PRODUCT = "M4-Shim"
+USB_MANUFACTURER = "Silicognition LLC"
+
+CHIP_VARIANT = SAMD51J19A
+CHIP_FAMILY = samd51
+
+QSPI_FLASH_FILESYSTEM = 1
+EXTERNAL_FLASH_DEVICE_COUNT = 1
+EXTERNAL_FLASH_DEVICES = GD25Q16C
+LONGINT_IMPL = MPZ
+
+CIRCUITPY_VECTORIO = 1
diff --git a/ports/atmel-samd/boards/silicognition-m4-shim/pins.c b/ports/atmel-samd/boards/silicognition-m4-shim/pins.c
new file mode 100644
index 000000000..b7afd044e
--- /dev/null
+++ b/ports/atmel-samd/boards/silicognition-m4-shim/pins.c
@@ -0,0 +1,54 @@
+#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_PA02) },
+ { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PA02) },
+
+ { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA05) },
+ { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PA05) },
+
+ { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB08) },
+ { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_PB08) },
+
+ { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PB09) },
+ { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PB09) },
+
+ { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA04) },
+ { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PA04) },
+
+ { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA06) },
+ { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_PA06) },
+
+ { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA17) },
+ { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_PA17) },
+
+ { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB23) },
+ { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_PB23) },
+
+ { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB22) },
+ { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_PB22) },
+
+ { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PB17) },
+ { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PB17) },
+
+ { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PB16) },
+ { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PB16) },
+
+ { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA12) },
+ { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA13) },
+ { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA14) },
+ { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA16) },
+ { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA18) },
+ { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA19) },
+ { 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_NEOPIXEL), MP_ROM_PTR(&pin_PB03) },
+
+ { 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);
diff --git a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk
index 22e2059a9..435ee87fd 100644
--- a/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/sparkfun_qwiic_micro_no_flash/mpconfigboard.mk
@@ -10,4 +10,6 @@ INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
+
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk
index 3104be0a0..bafcc02a2 100644
--- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk
@@ -10,10 +10,5 @@ INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
-ifeq ($(TRANSLATION),de_DE)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-SUPEROPT_VM = 0
-endif
-
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk
index 9460d0009..aef38661b 100644
--- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk
@@ -11,3 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk
index 735d42297..6595fa164 100644
--- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk
@@ -11,14 +11,4 @@ LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
-
-CFLAGS_BOARD = --param max-inline-insns-auto=15
-ifeq ($(TRANSLATION), zh_Latn_pinyin)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
-endif
-ifeq ($(TRANSLATION), de_DE)
-RELEASE_NEEDS_CLEAN_BUILD = 1
-CFLAGS_INLINE_LIMIT = 35
SUPEROPT_VM = 0
-endif
diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk
index d08690a15..d6ba805b1 100644
--- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk
+++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk
@@ -10,7 +10,5 @@ INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
-# Always use aggressive inlining
-CFLAGS_INLINE_LIMIT = 45
-
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
diff --git a/ports/atmel-samd/common-hal/_pew/PewPew.c b/ports/atmel-samd/common-hal/_pew/PewPew.c
index cfdfe75d8..1e7561ac8 100644
--- a/ports/atmel-samd/common-hal/_pew/PewPew.c
+++ b/ports/atmel-samd/common-hal/_pew/PewPew.c
@@ -40,6 +40,7 @@
static uint8_t pewpew_tc_index = 0xff;
+static volatile uint16_t pewpew_ticks = 0;
void pewpew_interrupt_handler(uint8_t index) {
@@ -52,6 +53,7 @@ void pewpew_interrupt_handler(uint8_t index) {
}
pew_tick();
+ ++pewpew_ticks;
// Clear the interrupt bit.
tc->COUNT16.INTFLAG.reg = TC_INTFLAG_MC0;
@@ -123,3 +125,7 @@ void pew_reset(void) {
}
MP_STATE_VM(pew_singleton) = NULL;
}
+
+uint16_t pew_get_ticks() {
+ return pewpew_ticks;
+}
diff --git a/ports/atmel-samd/common-hal/_pew/PewPew.h b/ports/atmel-samd/common-hal/_pew/PewPew.h
index da1cae0a2..a9c3b6626 100644
--- a/ports/atmel-samd/common-hal/_pew/PewPew.h
+++ b/ports/atmel-samd/common-hal/_pew/PewPew.h
@@ -44,5 +44,6 @@ typedef struct {
void pew_init(void);
void pewpew_interrupt_handler(uint8_t index);
void pew_reset(void);
+uint16_t pew_get_ticks(void);
#endif // MICROPY_INCLUDED_PEW_PEWPEW_H
diff --git a/ports/atmel-samd/common-hal/busio/I2C.c b/ports/atmel-samd/common-hal/busio/I2C.c
index ffe74a274..2551f7bf1 100644
--- a/ports/atmel-samd/common-hal/busio/I2C.c
+++ b/ports/atmel-samd/common-hal/busio/I2C.c
@@ -97,7 +97,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
if (!gpio_get_pin_level(sda->number) || !gpio_get_pin_level(scl->number)) {
reset_pin_number(sda->number);
reset_pin_number(scl->number);
- mp_raise_RuntimeError(translate("SDA or SCL needs a pull up"));
+ mp_raise_RuntimeError(translate("No pull up found on SDA or SCL; check your wiring"));
}
#endif
diff --git a/ports/atmel-samd/common-hal/supervisor/Runtime.c b/ports/atmel-samd/common-hal/supervisor/Runtime.c
index 6be38f216..974f26cec 100755
--- a/ports/atmel-samd/common-hal/supervisor/Runtime.c
+++ b/ports/atmel-samd/common-hal/supervisor/Runtime.c
@@ -28,10 +28,10 @@
#include "shared-bindings/supervisor/Runtime.h"
#include "supervisor/serial.h"
-bool common_hal_get_serial_connected(void) {
+bool common_hal_supervisor_runtime_get_serial_connected(void) {
return (bool) serial_connected();
}
-bool common_hal_get_serial_bytes_available(void) {
+bool common_hal_supervisor_runtime_get_serial_bytes_available(void) {
return (bool) serial_bytes_available();
}
diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk
index fb9cdf2e6..c77bf83f1 100644
--- a/ports/atmel-samd/mpconfigport.mk
+++ b/ports/atmel-samd/mpconfigport.mk
@@ -18,7 +18,16 @@ ifeq ($(LONGINT_IMPL),LONGLONG)
MPY_TOOL_LONGINT_IMPL = -mlongint-impl=longlong
endif
+INTERNAL_LIBM = 1
+
+USB_SERIAL_NUMBER_LENGTH = 32
+
+# Number of USB endpoint pairs.
+USB_NUM_EP = 8
+
+######################################################################
# Put samd21-only choices here.
+
ifeq ($(CHIP_FAMILY),samd21)
# The ?='s allow overriding in mpconfigboard.mk.
@@ -39,8 +48,8 @@ CIRCUITPY_SDCARDIO ?= 0
# Not enough RAM for framebuffers
CIRCUITPY_FRAMEBUFFERIO ?= 0
-# SAMD21 needs separate endpoint pairs for MSC BULK IN and BULK OUT, otherwise it's erratic.
-USB_MSC_EP_NUM_OUT = 1
+# Not enough room in 192kB or 256kB builds for secondary CDC.
+CIRCUITPY_USB_CDC ?= 0
CIRCUITPY_ULAB = 0
@@ -55,9 +64,13 @@ CIRCUITPY_TERMINALIO = 0
endif
endif # samd21
+######################################################################
+######################################################################
# Put samd51-only choices here.
+
ifeq ($(CHIP_FAMILY),samd51)
+
# No native touchio on SAMD51.
CIRCUITPY_TOUCHIO_USE_NATIVE = 0
@@ -70,9 +83,4 @@ CIRCUITPY_RGBMATRIX ?= $(CIRCUITPY_FULL_BUILD)
CIRCUITPY_FRAMEBUFFERIO ?= $(CIRCUITPY_FULL_BUILD)
endif # samd51
-
-INTERNAL_LIBM = 1
-
-USB_SERIAL_NUMBER_LENGTH = 32
-
-USB_NUM_EP = 8
+######################################################################
diff --git a/ports/cxd56/common-hal/supervisor/Runtime.c b/ports/cxd56/common-hal/supervisor/Runtime.c
index a0d9e70ab..eeeb1430f 100755
--- a/ports/cxd56/common-hal/supervisor/Runtime.c
+++ b/ports/cxd56/common-hal/supervisor/Runtime.c
@@ -27,10 +27,10 @@
#include "shared-bindings/supervisor/Runtime.h"
#include "supervisor/serial.h"
-bool common_hal_get_serial_connected(void) {
+bool common_hal_supervisor_runtime_get_serial_connected(void) {
return (bool) serial_connected();
}
-bool common_hal_get_serial_bytes_available(void) {
+bool common_hal_supervisor_runtime_get_serial_bytes_available(void) {
return (bool) serial_bytes_available();
}
diff --git a/ports/cxd56/mpconfigport.mk b/ports/cxd56/mpconfigport.mk
index e1ffc79d0..33a993ad9 100644
--- a/ports/cxd56/mpconfigport.mk
+++ b/ports/cxd56/mpconfigport.mk
@@ -7,6 +7,9 @@ USB_CDC_EP_NUM_DATA_IN = 1
USB_MSC_EP_NUM_OUT = 5
USB_MSC_EP_NUM_IN = 4
+# Number of USB endpoint pairs.
+USB_NUM_EP = 6
+
MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz
CIRCUITPY_AUDIOBUSIO = 0
diff --git a/ports/esp32s2/Makefile b/ports/esp32s2/Makefile
index aac934782..b4ff0612b 100644
--- a/ports/esp32s2/Makefile
+++ b/ports/esp32s2/Makefile
@@ -164,7 +164,9 @@ LIBS += -lm
endif
# TinyUSB defines
-CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32S2 -DCFG_TUSB_OS=OPT_OS_FREERTOS -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024 -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128
+CFLAGS += -DCFG_TUSB_MCU=OPT_MCU_ESP32S2 -DCFG_TUSB_OS=OPT_OS_FREERTOS -DCFG_TUD_CDC_RX_BUFSIZE=1024 -DCFG_TUD_CDC_TX_BUFSIZE=1024
+CFLAGS += -DCFG_TUD_MSC_BUFSIZE=4096 -DCFG_TUD_MIDI_RX_BUFSIZE=128 -DCFG_TUD_MIDI_TX_BUFSIZE=128
+CFLAGS += -DCFG_TUD_VENDOR_RX_BUFSIZE=128 -DCFG_TUD_VENDOR_TX_BUFSIZE=128
######################################
diff --git a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk
index 2dce03881..52c63cb9c 100644
--- a/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk
+++ b/ports/esp32s2/boards/espressif_kaluga_1/mpconfigboard.mk
@@ -14,4 +14,10 @@ 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/lilygo_ttgo_t8_s2_st7789/board.c b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c
new file mode 100644
index 000000000..4aa7b3b24
--- /dev/null
+++ b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/board.c
@@ -0,0 +1,158 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "supervisor/board.h"
+#include "mpconfigboard.h"
+#include "shared-bindings/microcontroller/Pin.h"
+#include "shared-module/displayio/__init__.h"
+#include "shared-module/displayio/mipi_constants.h"
+
+#define DELAY 0x80
+
+// display init sequence according to LilyGO example app
+uint8_t display_init_sequence[] = {
+ // sw reset
+ 0x01, 0 | DELAY, 150,
+ // sleep out
+ 0x11, 0 | DELAY, 255,
+ // normal display mode on
+ 0x13, 0,
+ // display and color format settings
+ 0x36, 1, 0x08,
+ 0xB6, 2, 0x0A, 0x82,
+ 0x3A, 1 | DELAY, 0x55, 10,
+ // ST7789V frame rate setting
+ 0xB2, 5, 0x0C, 0x0C, 0x00, 0x33, 0x33,
+ // voltages: VGH / VGL
+ 0xB7, 1, 0x35,
+ // ST7789V power setting
+ 0xBB, 1, 0x28,
+ 0xC0, 1, 0x0C,
+ 0xC2, 2, 0x01, 0xFF,
+ 0xC3, 1, 0x10,
+ 0xC4, 1, 0x20,
+ 0xC6, 1, 0x0F,
+ 0xD0, 2, 0xA4, 0xA1,
+ // ST7789V gamma setting
+ 0xE0, 14, 0xD0, 0x00, 0x02, 0x07, 0x0A, 0x28, 0x32, 0x44, 0x42, 0x06, 0x0E, 0x12, 0x14, 0x17,
+ 0xE1, 14, 0xD0, 0x00, 0x02, 0x07, 0x0A, 0x28, 0x31, 0x54, 0x47, 0x0E, 0x1C, 0x17, 0x1B, 0x1E,
+ 0x21, 0,
+ // display on
+ 0x29, 0 | DELAY, 255,
+ };
+
+static void display_init(void) {
+ busio_spi_obj_t* spi = &displays[0].fourwire_bus.inline_bus;
+
+ common_hal_busio_spi_construct(
+ spi,
+ &pin_GPIO36, // CLK
+ &pin_GPIO35, // 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_GPIO37, // DC
+ &pin_GPIO34, // CS
+ &pin_GPIO38, // RST
+ 40000000, // baudrate
+ 0, // polarity
+ 0 // phase
+ );
+
+ displayio_display_obj_t* display = &displays[0].display;
+ display->base.type = &displayio_display_type;
+
+ // workaround as board_init() is called before reset_port() in main.c
+ pwmout_reset();
+
+ common_hal_displayio_display_construct(
+ display,
+ bus,
+ 240, // width (after rotation)
+ 135, // height (after rotation)
+ 52, // column start
+ 40, // row start
+ 90, // rotation
+ 16, // color depth
+ false, // grayscale
+ false, // pixels in a byte share a row. Only valid for depths < 8
+ 1, // bytes per cell. Only valid for depths < 8
+ false, // reverse_pixels_in_byte. Only valid for depths < 8
+ true, // reverse_pixels_in_word
+ MIPI_COMMAND_SET_COLUMN_ADDRESS, // set column command
+ MIPI_COMMAND_SET_PAGE_ADDRESS, // set row command
+ MIPI_COMMAND_WRITE_MEMORY_START, // write memory command
+ 0x37, // set vertical scroll command
+ display_init_sequence,
+ sizeof(display_init_sequence),
+ &pin_GPIO33, // backlight pin
+ NO_BRIGHTNESS_COMMAND,
+ 1.0f, // brightness (ignored)
+ false, // auto_brightness
+ false, // single_byte_bounds
+ false, // data_as_commands
+ true, // auto_refresh
+ 60, // native_frames_per_second
+ true, // backlight_on_high
+ false // SH1107_addressing
+ );
+
+ common_hal_never_reset_pin(&pin_GPIO33); // backlight pin
+}
+
+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 */
+
+ // Display
+ display_init();
+}
+
+bool board_requests_safe_mode(void) {
+ return false;
+}
+
+void reset_board(void) {
+
+}
+
+void board_deinit(void) {
+}
diff --git a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
new file mode 100644
index 000000000..c9020c200
--- /dev/null
+++ b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
@@ -0,0 +1,36 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+//Micropython setup
+
+#define MICROPY_HW_BOARD_NAME "LILYGO TTGO T8 ESP32-S2 w/Display"
+#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/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk
new file mode 100644
index 000000000..79b45fd92
--- /dev/null
+++ b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.mk
@@ -0,0 +1,17 @@
+USB_VID = 0x303a
+USB_PID = 0x8007
+USB_PRODUCT = "TTGO T8 ESP32-S2"
+USB_MANUFACTURER = "LILYGO"
+
+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/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/pins.c b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/pins.c
new file mode 100644
index 000000000..a30c6797a
--- /dev/null
+++ b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/pins.c
@@ -0,0 +1,56 @@
+#include "shared-bindings/board/__init__.h"
+#include "shared-module/displayio/__init__.h"
+
+STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
+ { MP_ROM_QSTR(MP_QSTR_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) },
+
+ { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) },
+ { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) },
+ { MP_ROM_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO17) },
+ { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO18) },
+
+ // SD Card
+ { MP_ROM_QSTR(MP_QSTR_SD_MISO), MP_ROM_PTR(&pin_GPIO13) },
+ { MP_ROM_QSTR(MP_QSTR_SD_MOSI), MP_ROM_PTR(&pin_GPIO11) },
+ { MP_ROM_QSTR(MP_QSTR_SD_CLK), MP_ROM_PTR(&pin_GPIO12) },
+ { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO10) },
+
+ // 1.14 inch LCD ST7789
+ { MP_ROM_QSTR(MP_QSTR_LCD_MOSI), MP_ROM_PTR(&pin_GPIO35) },
+ { MP_ROM_QSTR(MP_QSTR_LCD_CLK), MP_ROM_PTR(&pin_GPIO36) },
+ { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO34) },
+ { MP_ROM_QSTR(MP_QSTR_LCD_RST), MP_ROM_PTR(&pin_GPIO38) },
+ { MP_ROM_QSTR(MP_QSTR_LCD_BCKL), MP_ROM_PTR(&pin_GPIO33) },
+ { MP_ROM_QSTR(MP_QSTR_LCD_D_C), MP_ROM_PTR(&pin_GPIO37) },
+ { MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display) },
+
+ // Peripheral Power control
+ { MP_ROM_QSTR(MP_QSTR_PE_POWER), MP_ROM_PTR(&pin_GPIO14) },
+};
+MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);
diff --git a/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/sdkconfig b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/sdkconfig
new file mode 100644
index 000000000..ce6fe832b
--- /dev/null
+++ b/ports/esp32s2/boards/lilygo_ttgo_t8_s2_st7789/sdkconfig
@@ -0,0 +1,31 @@
+CONFIG_ESP32S2_SPIRAM_SUPPORT=y
+
+#
+# SPI RAM config
+#
+CONFIG_SPIRAM_TYPE_ESPPSRAM64=y
+CONFIG_SPIRAM_SIZE=8388608
+
+#
+# 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_SPIWP_SD3_PIN=28
+CONFIG_SPIRAM_SPEED_40M=y
+CONFIG_SPIRAM=y
+CONFIG_SPIRAM_BOOT_INIT=y
+CONFIG_SPIRAM_USE_MALLOC=y
+CONFIG_SPIRAM_MEMTEST=y
+CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
+CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768
+# end of SPI RAM config
+
+#
+# LWIP
+#
+CONFIG_LWIP_LOCAL_HOSTNAME="TTGO-T8-ESP32-S2"
+CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y
+# end of LWIP
diff --git a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk
index 515617095..783e7ad4c 100644
--- a/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk
+++ b/ports/esp32s2/boards/microdev_micro_s2/mpconfigboard.mk
@@ -2,7 +2,6 @@ USB_VID = 0x239A
USB_PID = 0x80C6
USB_PRODUCT = "microS2"
USB_MANUFACTURER = "microDev"
-USB_DEVICES = "CDC,MSC,HID"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk
index 9857c0761..d045cc214 100644
--- a/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk
+++ b/ports/esp32s2/boards/unexpectedmaker_feathers2/mpconfigboard.mk
@@ -2,7 +2,6 @@ USB_VID = 0x239A
USB_PID = 0x80AC
USB_PRODUCT = "FeatherS2"
USB_MANUFACTURER = "UnexpectedMaker"
-USB_DEVICES = "CDC,MSC,HID"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
diff --git a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk
index 9857c0761..d045cc214 100644
--- a/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk
+++ b/ports/esp32s2/boards/unexpectedmaker_feathers2_prerelease/mpconfigboard.mk
@@ -2,7 +2,6 @@ USB_VID = 0x239A
USB_PID = 0x80AC
USB_PRODUCT = "FeatherS2"
USB_MANUFACTURER = "UnexpectedMaker"
-USB_DEVICES = "CDC,MSC,HID"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/board.c b/ports/esp32s2/boards/unexpectedmaker_tinys2/board.c
new file mode 100644
index 000000000..d8fd3a0a2
--- /dev/null
+++ b/ports/esp32s2/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/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h
new file mode 100644
index 000000000..85f252328
--- /dev/null
+++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.h
@@ -0,0 +1,46 @@
+/*
+ * 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 "TinyS2"
+#define MICROPY_HW_MCU_NAME "ESP32S2"
+
+#define MICROPY_HW_NEOPIXEL (&pin_GPIO1)
+#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/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk b/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk
new file mode 100644
index 000000000..aa022e186
--- /dev/null
+++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/mpconfigboard.mk
@@ -0,0 +1,23 @@
+USB_VID = 0x303A
+USB_PID = 0x8002
+USB_PRODUCT = "TinyS2"
+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_MODULE=wroom
+
+CIRCUITPY_BITBANG_NEOPIXEL = 1
+
+# Include these Python libraries in firmware.
+# FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
+FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c b/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c
new file mode 100644
index 000000000..8ca7d9864
--- /dev/null
+++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/pins.c
@@ -0,0 +1,79 @@
+#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_D4), MP_ROM_PTR(&pin_GPIO0) },
+
+ { 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_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_IO7), MP_ROM_PTR(&pin_GPIO7) },
+ // { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) },
+ // { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO7) },
+
+ { 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_IO4), MP_ROM_PTR(&pin_GPIO4) },
+
+
+ { 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_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_D23), MP_ROM_PTR(&pin_GPIO37) },
+
+ { MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) },
+ // { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) },
+ // { MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37) },
+
+ { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) },
+ { MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
+ // { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) },
+
+ { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9) },
+ { MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
+ // { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO9) },
+
+
+ { MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },
+ // { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO38) },
+
+ { MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },
+ // { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO33) },
+
+ { 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_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_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO2) },
+ { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO1) },
+
+ { 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);
diff --git a/ports/esp32s2/boards/unexpectedmaker_tinys2/sdkconfig b/ports/esp32s2/boards/unexpectedmaker_tinys2/sdkconfig
new file mode 100644
index 000000000..91447cdc2
--- /dev/null
+++ b/ports/esp32s2/boards/unexpectedmaker_tinys2/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="UMTinyS2"
+# end of LWIP
diff --git a/ports/esp32s2/common-hal/alarm/__init__.c b/ports/esp32s2/common-hal/alarm/__init__.c
index 1cec5d4ae..be435e210 100644
--- a/ports/esp32s2/common-hal/alarm/__init__.c
+++ b/ports/esp32s2/common-hal/alarm/__init__.c
@@ -150,6 +150,14 @@ void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *ala
void NORETURN alarm_enter_deep_sleep(void) {
alarm_pin_pinalarm_prepare_for_deep_sleep();
alarm_touch_touchalarm_prepare_for_deep_sleep();
+
+ // Disable brownout detection, which appears to be triggered sometimes when
+ // waking from deep sleep.
+ // See https://www.esp32.com/viewtopic.php?f=13&t=19208#p71084
+ // and https://github.com/adafruit/circuitpython/issues/4025#issuecomment-771027606
+ // TODO: We can remove this workaround when ESP-IDF handles this.
+ CLEAR_PERI_REG_MASK(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_RST_ENA);
+
// The ESP-IDF caches the deep sleep settings and applies them before sleep.
// We don't need to worry about resetting them in the interim.
esp_deep_sleep_start();
diff --git a/ports/esp32s2/common-hal/audiobusio/I2SOut.c b/ports/esp32s2/common-hal/audiobusio/I2SOut.c
index 86322be86..eb9b6f8e1 100644
--- a/ports/esp32s2/common-hal/audiobusio/I2SOut.c
+++ b/ports/esp32s2/common-hal/audiobusio/I2SOut.c
@@ -63,6 +63,9 @@ void common_hal_audiobusio_i2sout_construct(audiobusio_i2sout_obj_t* self,
self->bit_clock = bit_clock;
self->word_select = word_select;
self->data = data;
+ claim_pin(bit_clock);
+ claim_pin(word_select);
+ claim_pin(data);
}
bool common_hal_audiobusio_i2sout_deinited(audiobusio_i2sout_obj_t* self) {
diff --git a/ports/esp32s2/common-hal/busio/I2C.c b/ports/esp32s2/common-hal/busio/I2C.c
index 772262d0a..8372eb8c3 100644
--- a/ports/esp32s2/common-hal/busio/I2C.c
+++ b/ports/esp32s2/common-hal/busio/I2C.c
@@ -85,7 +85,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
if (gpio_get_level(sda->number) == 0 || gpio_get_level(scl->number) == 0) {
reset_pin_number(sda->number);
reset_pin_number(scl->number);
- mp_raise_RuntimeError(translate("SDA or SCL needs a pull up"));
+ mp_raise_RuntimeError(translate("No pull up found on SDA or SCL; check your wiring"));
}
#endif
diff --git a/ports/esp32s2/common-hal/microcontroller/Pin.c b/ports/esp32s2/common-hal/microcontroller/Pin.c
index fca89ce8e..ff6d0ed35 100644
--- a/ports/esp32s2/common-hal/microcontroller/Pin.c
+++ b/ports/esp32s2/common-hal/microcontroller/Pin.c
@@ -134,7 +134,7 @@ bool pin_number_is_free(gpio_num_t pin_number) {
uint8_t offset = pin_number / 32;
uint32_t mask = 1 << (pin_number % 32);
- return (never_reset_pins[offset] & mask) == 0 && (in_use[offset] & mask) == 0;
+ return (in_use[offset] & mask) == 0;
}
bool common_hal_mcu_pin_is_free(const mcu_pin_obj_t *pin) {
diff --git a/ports/esp32s2/common-hal/socketpool/Socket.c b/ports/esp32s2/common-hal/socketpool/Socket.c
index 69ef41c6e..5f93807bb 100644
--- a/ports/esp32s2/common-hal/socketpool/Socket.c
+++ b/ports/esp32s2/common-hal/socketpool/Socket.c
@@ -3,7 +3,6 @@
*
* The MIT License (MIT)
*
- * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
* Copyright (c) 2020 Lucian Copeland for Adafruit Industries
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -38,16 +37,15 @@
#include "components/lwip/lwip/src/include/lwip/sys.h"
#include "components/lwip/lwip/src/include/lwip/netdb.h"
-STATIC socketpool_socket_obj_t * open_socket_handles[CONFIG_LWIP_MAX_SOCKETS]; // 4 on the wrover/wroom
+STATIC socketpool_socket_obj_t * open_socket_handles[CONFIG_LWIP_MAX_SOCKETS];
void socket_reset(void) {
for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_handles); i++) {
if (open_socket_handles[i]) {
if (open_socket_handles[i]->num > 0) {
+ // Close automatically clears socket handle
common_hal_socketpool_socket_close(open_socket_handles[i]);
- open_socket_handles[i] = NULL;
} else {
- // accidentally got a TCP socket in here, or something.
open_socket_handles[i] = NULL;
}
}
@@ -64,83 +62,24 @@ bool register_open_socket(socketpool_socket_obj_t* self) {
return false;
}
-STATIC void _lazy_init_LWIP(socketpool_socket_obj_t* self) {
- if (self->num != -1) {
- return; //safe to call on existing socket
- }
- if (self->tls != NULL) {
- mp_raise_RuntimeError(translate("Invalid use of TLS Socket"));
- }
- int socknum = -1;
- socknum = lwip_socket(self->family, self->type, self->ipproto);
- if (socknum < 0 || !register_open_socket(self)) {
- mp_raise_RuntimeError(translate("Out of sockets"));
- }
- self->num = socknum;
- lwip_fcntl(socknum, F_SETFL, O_NONBLOCK);
-}
-
-STATIC void _lazy_init_TLS(socketpool_socket_obj_t* self) {
- if (self->type != SOCK_STREAM || self->num != -1) {
- mp_raise_RuntimeError(translate("Invalid socket for TLS"));
- }
- esp_tls_t* tls_handle = esp_tls_init();
- if (tls_handle == NULL) {
- mp_raise_espidf_MemoryError();
- }
- self->tls = tls_handle;
-}
-
-void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_uint_t timeout_ms) {
- self->timeout_ms = timeout_ms;
-}
-
-bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t* self,
- const char* host, size_t hostlen, uint8_t port) {
- _lazy_init_LWIP(self);
-
- struct sockaddr_in bind_addr;
- bind_addr.sin_addr.s_addr = inet_addr(host);
- bind_addr.sin_family = AF_INET;
- bind_addr.sin_port = htons(port);
-
- int opt = 1;
- int err = lwip_setsockopt(self->num, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
- if (err != 0) {
- mp_raise_RuntimeError(translate("Issue setting SO_REUSEADDR"));
- }
- int result = lwip_bind(self->num, (struct sockaddr *)&bind_addr, sizeof(bind_addr)) == 0;
- return result;
-}
-
-bool common_hal_socketpool_socket_listen(socketpool_socket_obj_t* self, int backlog) {
- return lwip_listen(self->num, backlog) == 0;
-}
-
socketpool_socket_obj_t* common_hal_socketpool_socket_accept(socketpool_socket_obj_t* self,
- uint8_t* ip, uint *port) {
+ uint8_t* ip, uint32_t *port) {
struct sockaddr_in accept_addr;
socklen_t socklen = sizeof(accept_addr);
int newsoc = -1;
bool timed_out = false;
uint64_t start_ticks = supervisor_ticks_ms64();
- if (self->timeout_ms != (uint)-1) {
- mp_printf(&mp_plat_print, "will timeout");
- } else {
- mp_printf(&mp_plat_print, "won't timeout");
- }
-
// Allow timeouts and interrupts
while (newsoc == -1 &&
!timed_out &&
!mp_hal_is_interrupted()) {
- if (self->timeout_ms != (uint)-1) {
+ if (self->timeout_ms != (uint)-1 && self->timeout_ms != 0) {
timed_out = supervisor_ticks_ms64() - start_ticks >= self->timeout_ms;
}
RUN_BACKGROUND_TASKS;
newsoc = lwip_accept(self->num, (struct sockaddr *)&accept_addr, &socklen);
- // In non-blocking mode, fail instead of looping
+ // In non-blocking mode, fail instead of timing out
if (newsoc == -1 && self->timeout_ms == 0) {
mp_raise_OSError(MP_EAGAIN);
}
@@ -159,9 +98,8 @@ socketpool_socket_obj_t* common_hal_socketpool_socket_accept(socketpool_socket_o
socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t);
sock->base.type = &socketpool_socket_type;
sock->num = newsoc;
- sock->tls = NULL;
- sock->ssl_context = NULL;
sock->pool = self->pool;
+ sock->connected = true;
if (!register_open_socket(sock)) {
mp_raise_OSError(MP_EBADF);
@@ -175,182 +113,97 @@ socketpool_socket_obj_t* common_hal_socketpool_socket_accept(socketpool_socket_o
}
}
-bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self,
- const char* host, mp_uint_t hostlen, mp_int_t port) {
- // For simplicity we use esp_tls for all TCP connections. If it's not SSL, ssl_context will be
- // NULL and should still work. This makes regular TCP connections more memory expensive but TLS
- // should become more and more common. Therefore, we optimize for the TLS case.
-
- // Todo: move to SSL Wrapper and add lwip_connect()
- _lazy_init_TLS(self);
+bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t* self,
+ const char* host, size_t hostlen, uint32_t port) {
+ struct sockaddr_in bind_addr;
+ bind_addr.sin_addr.s_addr = inet_addr(host);
+ bind_addr.sin_family = AF_INET;
+ bind_addr.sin_port = htons(port);
- esp_tls_cfg_t* tls_config = NULL;
- if (self->ssl_context != NULL) {
- tls_config = &self->ssl_context->ssl_config;
- }
- int result = esp_tls_conn_new_sync(host, hostlen, port, tls_config, self->tls);
- self->connected = result >= 0;
- if (result < 0) {
- int esp_tls_code;
- int flags;
- esp_err_t err = esp_tls_get_and_clear_last_error(self->tls->error_handle, &esp_tls_code, &flags);
-
- if (err == ESP_ERR_MBEDTLS_SSL_SETUP_FAILED) {
- mp_raise_espidf_MemoryError();
- } else if (ESP_ERR_MBEDTLS_SSL_HANDSHAKE_FAILED) {
- mp_raise_OSError_msg_varg(translate("Failed SSL handshake"));
- } else {
- mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d %d %x %d"), esp_tls_code, flags, err, result);
- }
- } else {
- // Connection successful, set the timeout on the underlying socket. We can't rely on the IDF
- // to do it because the config structure is only used for TLS connections. Generally, we
- // shouldn't hit this timeout because we try to only read available data. However, there is
- // always a chance that we try to read something that is used internally.
- int fd;
- esp_tls_get_conn_sockfd(self->tls, &fd);
- struct timeval tv;
- tv.tv_sec = 2 * 60; // Two minutes
- tv.tv_usec = 0;
- setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
- setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
+ int opt = 1;
+ int err = lwip_setsockopt(self->num, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
+ if (err != 0) {
+ mp_raise_RuntimeError(translate("Cannot set socket options"));
}
-
- return self->connected;
-}
-
-bool common_hal_socketpool_socket_get_connected(socketpool_socket_obj_t* self) {
- return self->connected;
+ int result = lwip_bind(self->num, (struct sockaddr *)&bind_addr, sizeof(bind_addr)) == 0;
+ return result;
}
-mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len) {
- int sent = -1;
- if (self->num != -1) {
- // LWIP Socket
- // TODO: deal with potential failure/add timeout?
- sent = lwip_send(self->num, buf, len, 0);
- } else if (self->tls != NULL) {
- // TLS Socket
- sent = esp_tls_conn_write(self->tls, buf, len);
- }
-
- if (sent < 0) {
- mp_raise_OSError(MP_ENOTCONN);
+void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) {
+ self->connected = false;
+ if (self->num >= 0) {
+ lwip_shutdown(self->num, 0);
+ lwip_close(self->num);
+ self->num = -1;
}
- return sent;
-}
-
-mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len) {
- int received = 0;
- bool timed_out = false;
-
- if (self->num != -1) {
- // LWIP Socket
- uint64_t start_ticks = supervisor_ticks_ms64();
- received = -1;
- while (received == -1 &&
- !timed_out &&
- !mp_hal_is_interrupted()) {
- if (self->timeout_ms != (uint)-1) {
- timed_out = supervisor_ticks_ms64() - start_ticks >= self->timeout_ms;
- }
- RUN_BACKGROUND_TASKS;
- received = lwip_recv(self->num, (void*) buf, len - 1, 0);
-
- // In non-blocking mode, fail instead of looping
- if (received == -1 && self->timeout_ms == 0) {
- mp_raise_OSError(MP_EAGAIN);
- }
- }
- } else if (self->tls != NULL) {
- // TLS Socket
- int status = 0;
- uint64_t start_ticks = supervisor_ticks_ms64();
- int sockfd;
- esp_err_t err = esp_tls_get_conn_sockfd(self->tls, &sockfd);
- if (err != ESP_OK) {
- mp_raise_OSError(MP_EBADF);
- }
- while (received == 0 &&
- status >= 0 &&
- !timed_out &&
- !mp_hal_is_interrupted()) {
- if (self->timeout_ms != (uint)-1) {
- timed_out = self->timeout_ms == 0 || supervisor_ticks_ms64() - start_ticks >= self->timeout_ms;
- }
- RUN_BACKGROUND_TASKS;
- size_t available = esp_tls_get_bytes_avail(self->tls);
- if (available == 0) {
- // This reads the raw socket buffer and is used for non-TLS connections
- // and between encrypted TLS blocks.
- status = lwip_ioctl(sockfd, FIONREAD, &available);
- }
- size_t remaining = len - received;
- if (available > remaining) {
- available = remaining;
- }
- if (available > 0) {
- status = esp_tls_conn_read(self->tls, (void*) buf + received, available);
- if (status == 0) {
- // Reading zero when something is available indicates a closed
- // connection. (The available bytes could have been TLS internal.)
- break;
- }
- if (status > 0) {
- received += status;
- }
- }
+ // Remove socket record
+ for (size_t i = 0; i < MP_ARRAY_SIZE(open_socket_handles); i++) {
+ if (open_socket_handles[i] == self) {
+ open_socket_handles[i] = NULL;
}
- } else {
- // Socket does not have a valid descriptor of either type
- mp_raise_OSError(MP_EBADF);
}
-
- if (timed_out) {
- mp_raise_OSError(ETIMEDOUT);
- }
- return received;
}
-mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t* self,
- const char* host, size_t hostlen, uint8_t port, const uint8_t* buf, mp_uint_t len) {
-
- _lazy_init_LWIP(self);
-
- // Get the IP address string
+bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self,
+ const char* host, size_t hostlen, uint32_t port) {
const struct addrinfo hints = {
.ai_family = AF_INET,
.ai_socktype = SOCK_STREAM,
};
- struct addrinfo *result;
- int error = lwip_getaddrinfo(host, NULL, &hints, &result);
- if (error != 0 || result == NULL) {
- return 0;
+ struct addrinfo *result_i;
+ int error = lwip_getaddrinfo(host, NULL, &hints, &result_i);
+ if (error != 0 || result_i == NULL) {
+ mp_raise_OSError(EHOSTUNREACH);
}
// Set parameters
struct sockaddr_in dest_addr;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
- dest_addr.sin_addr.s_addr = ((struct sockaddr_in *)result->ai_addr)->sin_addr.s_addr;
+ dest_addr.sin_addr.s_addr = ((struct sockaddr_in *)result_i->ai_addr)->sin_addr.s_addr;
#pragma GCC diagnostic pop
- freeaddrinfo(result);
+ freeaddrinfo(result_i);
dest_addr.sin_family = AF_INET;
dest_addr.sin_port = htons(port);
- int bytes_sent = lwip_sendto(self->num, buf, len, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
- if (bytes_sent < 0) {
- mp_raise_BrokenPipeError();
- return 0;
+ // Replace above with function call -----
+
+ // Switch to blocking mode for this one call
+ int opts;
+ opts = lwip_fcntl(self->num,F_GETFL,0);
+ opts = opts & (~O_NONBLOCK);
+ lwip_fcntl(self->num, F_SETFL, opts);
+
+ int result = -1;
+ result = lwip_connect(self->num, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr_in));
+
+ // Switch back once complete
+ opts = opts | O_NONBLOCK;
+ lwip_fcntl(self->num, F_SETFL, opts);
+
+ if (result >= 0) {
+ self->connected = true;
+ return true;
+ } else {
+ mp_raise_OSError(errno);
}
- return bytes_sent;
}
-mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* self,
- uint8_t* buf, mp_uint_t len, uint8_t* ip, uint *port) {
+bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self) {
+ return self->num < 0;
+}
+
+bool common_hal_socketpool_socket_get_connected(socketpool_socket_obj_t* self) {
+ return self->connected;
+}
- _lazy_init_LWIP(self);
+bool common_hal_socketpool_socket_listen(socketpool_socket_obj_t* self, int backlog) {
+ return lwip_listen(self->num, backlog) == 0;
+}
+
+mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* self,
+ uint8_t* buf, uint32_t len, uint8_t* ip, uint *port) {
struct sockaddr_in source_addr;
socklen_t socklen = sizeof(source_addr);
@@ -362,7 +215,7 @@ mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* se
while (received == -1 &&
!timed_out &&
!mp_hal_is_interrupted()) {
- if (self->timeout_ms != (uint)-1) {
+ if (self->timeout_ms != (uint)-1 && self->timeout_ms != 0) {
timed_out = supervisor_ticks_ms64() - start_ticks >= self->timeout_ms;
}
RUN_BACKGROUND_TASKS;
@@ -389,24 +242,87 @@ mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* se
return received;
}
-void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self) {
- self->connected = false;
- if (self->tls != NULL) {
- esp_tls_conn_destroy(self->tls);
- self->tls = NULL;
+mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, uint32_t len) {
+ int received = 0;
+ bool timed_out = false;
+
+ if (self->num != -1) {
+ // LWIP Socket
+ uint64_t start_ticks = supervisor_ticks_ms64();
+ received = -1;
+ while (received == -1 &&
+ !timed_out &&
+ !mp_hal_is_interrupted()) {
+ if (self->timeout_ms != (uint)-1 && self->timeout_ms != 0) {
+ timed_out = supervisor_ticks_ms64() - start_ticks >= self->timeout_ms;
+ }
+ RUN_BACKGROUND_TASKS;
+ received = lwip_recv(self->num, (void*) buf, len, 0);
+
+ // In non-blocking mode, fail instead of looping
+ if (received == -1 && self->timeout_ms == 0) {
+ mp_raise_OSError(MP_EAGAIN);
+ }
+ }
+ } else {
+ mp_raise_OSError(MP_EBADF);
}
- if (self->num >= 0) {
- lwip_shutdown(self->num, 0);
- lwip_close(self->num);
- self->num = -1;
+
+ if (timed_out) {
+ mp_raise_OSError(ETIMEDOUT);
}
+ return received;
}
-bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self) {
- return self->tls == NULL && self->num < 0;
+mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, uint32_t len) {
+ int sent = -1;
+ if (self->num != -1) {
+ // LWIP Socket
+ // TODO: deal with potential failure/add timeout?
+ sent = lwip_send(self->num, buf, len, 0);
+ } else {
+ mp_raise_OSError(MP_EBADF);
+ }
+
+ if (sent < 0) {
+ mp_raise_OSError(errno);
+ }
+ return sent;
}
+mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t* self,
+ const char* host, size_t hostlen, uint32_t port, const uint8_t* buf, uint32_t len) {
-mp_uint_t common_hal_socketpool_socket_get_hash(socketpool_socket_obj_t* self) {
- return self->num;
+ // Set parameters
+ const struct addrinfo hints = {
+ .ai_family = AF_INET,
+ .ai_socktype = SOCK_STREAM,
+ };
+ struct addrinfo *result_i;
+ int error = lwip_getaddrinfo(host, NULL, &hints, &result_i);
+ if (error != 0 || result_i == NULL) {
+ mp_raise_OSError(EHOSTUNREACH);
+ }
+
+ // Set parameters
+ struct sockaddr_in dest_addr;
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wcast-align"
+ dest_addr.sin_addr.s_addr = ((struct sockaddr_in *)result_i->ai_addr)->sin_addr.s_addr;
+ #pragma GCC diagnostic pop
+ freeaddrinfo(result_i);
+
+ dest_addr.sin_family = AF_INET;
+ dest_addr.sin_port = htons(port);
+
+ int bytes_sent = lwip_sendto(self->num, buf, len, 0, (struct sockaddr *)&dest_addr, sizeof(dest_addr));
+ if (bytes_sent < 0) {
+ mp_raise_BrokenPipeError();
+ return 0;
+ }
+ return bytes_sent;
+}
+
+void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, uint32_t timeout_ms) {
+ self->timeout_ms = timeout_ms;
}
diff --git a/ports/esp32s2/common-hal/socketpool/Socket.h b/ports/esp32s2/common-hal/socketpool/Socket.h
index 4e6cfa5ef..b86f5597c 100644
--- a/ports/esp32s2/common-hal/socketpool/Socket.h
+++ b/ports/esp32s2/common-hal/socketpool/Socket.h
@@ -41,8 +41,6 @@ typedef struct {
int family;
int ipproto;
bool connected;
- esp_tls_t* tls;
- ssl_sslcontext_obj_t* ssl_context;
socketpool_socketpool_obj_t* pool;
mp_uint_t timeout_ms;
} socketpool_socket_obj_t;
diff --git a/ports/esp32s2/common-hal/socketpool/SocketPool.c b/ports/esp32s2/common-hal/socketpool/SocketPool.c
index 5821728ce..fbd6dca7a 100644
--- a/ports/esp32s2/common-hal/socketpool/SocketPool.c
+++ b/ports/esp32s2/common-hal/socketpool/SocketPool.c
@@ -25,6 +25,7 @@
*/
#include "shared-bindings/socketpool/SocketPool.h"
+#include "common-hal/socketpool/Socket.h"
#include "py/runtime.h"
#include "shared-bindings/wifi/__init__.h"
@@ -65,22 +66,23 @@ socketpool_socket_obj_t* common_hal_socketpool_socket(socketpool_socketpool_obj_
mp_raise_NotImplementedError(translate("Only IPv4 sockets supported"));
}
- // Consider LWIP and MbedTLS "variant" sockets to be incompatible (for now)
- // The variant of the socket is determined by whether the socket is wrapped
- // by SSL. If no TLS handle is set in sslcontext_wrap_socket, the first call
- // of bind() or connect() will create a LWIP socket with a corresponding
- // socketnum.
- // TODO: move MbedTLS to its own duplicate Socket or Server API, maybe?
socketpool_socket_obj_t *sock = m_new_obj_with_finaliser(socketpool_socket_obj_t);
sock->base.type = &socketpool_socket_type;
- sock->num = -1;
sock->type = socket_type;
sock->family = addr_family;
sock->ipproto = ipproto;
-
- sock->tls = NULL;
- sock->ssl_context = NULL;
sock->pool = self;
+ sock->timeout_ms = (uint)-1;
+
+ // Create LWIP socket
+ int socknum = -1;
+ socknum = lwip_socket(sock->family, sock->type, sock->ipproto);
+ if (socknum < 0 || !register_open_socket(sock)) {
+ mp_raise_RuntimeError(translate("Out of sockets"));
+ }
+ sock->num = socknum;
+ // Sockets should be nonblocking in most cases
+ lwip_fcntl(socknum, F_SETFL, O_NONBLOCK);
return sock;
}
diff --git a/ports/esp32s2/common-hal/ssl/SSLContext.c b/ports/esp32s2/common-hal/ssl/SSLContext.c
index e24fd338b..afc3ecce2 100644
--- a/ports/esp32s2/common-hal/ssl/SSLContext.c
+++ b/ports/esp32s2/common-hal/ssl/SSLContext.c
@@ -25,6 +25,9 @@
*/
#include "shared-bindings/ssl/SSLContext.h"
+#include "shared-bindings/ssl/SSLSocket.h"
+
+#include "bindings/espidf/__init__.h"
#include "py/runtime.h"
@@ -32,10 +35,26 @@ void common_hal_ssl_sslcontext_construct(ssl_sslcontext_obj_t* self) {
}
-socketpool_socket_obj_t* common_hal_ssl_sslcontext_wrap_socket(ssl_sslcontext_obj_t* self,
+ssl_sslsocket_obj_t* common_hal_ssl_sslcontext_wrap_socket(ssl_sslcontext_obj_t* self,
socketpool_socket_obj_t* socket, bool server_side, const char* server_hostname) {
- socket->ssl_context = self;
+ if (socket->type != SOCK_STREAM) {
+ mp_raise_RuntimeError(translate("Invalid socket for TLS"));
+ }
+
+ ssl_sslsocket_obj_t *sock = m_new_obj_with_finaliser(ssl_sslsocket_obj_t);
+ sock->base.type = &ssl_sslsocket_type;
+ sock->ssl_context = self;
+ sock->sock = socket;
+
+ esp_tls_t* tls_handle = esp_tls_init();
+ if (tls_handle == NULL) {
+ mp_raise_espidf_MemoryError();
+ }
+ sock->tls = tls_handle;
+
+ // TODO: do something with the original socket? Don't call a close on the internal LWIP.
+
// Should we store server hostname on the socket in case connect is called with an ip?
- return socket;
+ return sock;
}
diff --git a/ports/esp32s2/common-hal/ssl/SSLSocket.c b/ports/esp32s2/common-hal/ssl/SSLSocket.c
new file mode 100644
index 000000000..10c29108c
--- /dev/null
+++ b/ports/esp32s2/common-hal/ssl/SSLSocket.c
@@ -0,0 +1,176 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
+ * Copyright (c) 2021 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/ssl/SSLSocket.h"
+#include "shared-bindings/socketpool/Socket.h"
+#include "shared-bindings/ssl/SSLContext.h"
+
+#include "bindings/espidf/__init__.h"
+#include "lib/utils/interrupt_char.h"
+#include "py/mperrno.h"
+#include "py/runtime.h"
+#include "supervisor/shared/tick.h"
+
+ssl_sslsocket_obj_t* common_hal_ssl_sslsocket_accept(ssl_sslsocket_obj_t* self,
+ uint8_t* ip, uint32_t *port) {
+ socketpool_socket_obj_t * sock = common_hal_socketpool_socket_accept(self->sock, ip, port);
+ ssl_sslsocket_obj_t * sslsock = common_hal_ssl_sslcontext_wrap_socket(self->ssl_context, sock, false, NULL);
+ return sslsock;
+}
+
+bool common_hal_ssl_sslsocket_bind(ssl_sslsocket_obj_t* self,
+ const char* host, size_t hostlen, uint32_t port) {
+ return common_hal_socketpool_socket_bind(self->sock, host, hostlen, port);
+}
+
+void common_hal_ssl_sslsocket_close(ssl_sslsocket_obj_t* self) {
+ common_hal_socketpool_socket_close(self->sock);
+ esp_tls_conn_destroy(self->tls);
+ self->tls = NULL;
+}
+
+bool common_hal_ssl_sslsocket_connect(ssl_sslsocket_obj_t* self,
+ const char* host, size_t hostlen, uint32_t port) {
+ esp_tls_cfg_t* tls_config = NULL;
+ tls_config = &self->ssl_context->ssl_config;
+ int result = esp_tls_conn_new_sync(host, hostlen, port, tls_config, self->tls);
+ self->sock->connected = result >= 0;
+ if (result < 0) {
+ int esp_tls_code;
+ int flags;
+ esp_err_t err = esp_tls_get_and_clear_last_error(self->tls->error_handle, &esp_tls_code, &flags);
+
+ if (err == ESP_ERR_MBEDTLS_SSL_SETUP_FAILED) {
+ mp_raise_espidf_MemoryError();
+ } else if (ESP_ERR_MBEDTLS_SSL_HANDSHAKE_FAILED) {
+ mp_raise_OSError_msg_varg(translate("Failed SSL handshake"));
+ } else {
+ mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d %d %x %d"), esp_tls_code, flags, err, result);
+ }
+ } else {
+ // Connection successful, set the timeout on the underlying socket. We can't rely on the IDF
+ // to do it because the config structure is only used for TLS connections. Generally, we
+ // shouldn't hit this timeout because we try to only read available data. However, there is
+ // always a chance that we try to read something that is used internally.
+ int fd;
+ esp_tls_get_conn_sockfd(self->tls, &fd);
+ struct timeval tv;
+ tv.tv_sec = 2 * 60; // Two minutes
+ tv.tv_usec = 0;
+ setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
+ setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
+ }
+
+ return self->sock->connected;
+}
+
+bool common_hal_ssl_sslsocket_get_closed(ssl_sslsocket_obj_t* self) {
+ return self->tls == NULL && self->sock->num < 0;
+}
+
+bool common_hal_ssl_sslsocket_get_connected(ssl_sslsocket_obj_t* self) {
+ return self->sock->connected;
+}
+
+bool common_hal_ssl_sslsocket_listen(ssl_sslsocket_obj_t* self, int backlog) {
+ return common_hal_socketpool_socket_listen(self->sock, backlog);
+}
+
+mp_uint_t common_hal_ssl_sslsocket_recv_into(ssl_sslsocket_obj_t* self, const uint8_t* buf, uint32_t len) {
+ int received = 0;
+ bool timed_out = false;
+ int status = 0;
+ uint64_t start_ticks = supervisor_ticks_ms64();
+ int sockfd;
+ esp_err_t err = esp_tls_get_conn_sockfd(self->tls, &sockfd);
+ if (err != ESP_OK) {
+ mp_raise_OSError(MP_EBADF);
+ }
+ while (received == 0 &&
+ status >= 0 &&
+ !timed_out &&
+ !mp_hal_is_interrupted()) {
+ if (self->sock->timeout_ms != (uint)-1 && self->sock->timeout_ms != 0) {
+ timed_out = self->sock->timeout_ms == 0 || supervisor_ticks_ms64() - start_ticks >= self->sock->timeout_ms;
+ }
+ RUN_BACKGROUND_TASKS;
+ size_t available = esp_tls_get_bytes_avail(self->tls);
+ if (available == 0) {
+ // This reads the raw socket buffer and is used for non-TLS connections
+ // and between encrypted TLS blocks.
+ status = lwip_ioctl(sockfd, FIONREAD, &available);
+ }
+ size_t remaining = len - received;
+ if (available > remaining) {
+ available = remaining;
+ }
+ if (available > 0) {
+ status = esp_tls_conn_read(self->tls, (void*) buf + received, available);
+ if (status == 0) {
+ // Reading zero when something is available indicates a closed
+ // connection. (The available bytes could have been TLS internal.)
+ break;
+ }
+ if (status > 0) {
+ received += status;
+ }
+ }
+ // In non-blocking mode, fail instead of timing out
+ if (received==0 && self->sock->timeout_ms == 0) {
+ mp_raise_OSError(MP_EAGAIN);
+ }
+ }
+
+ if (timed_out) {
+ mp_raise_OSError(ETIMEDOUT);
+ }
+ return received;
+}
+
+mp_uint_t common_hal_ssl_sslsocket_send(ssl_sslsocket_obj_t* self, const uint8_t* buf, uint32_t len) {
+ int sent = -1;
+ sent = esp_tls_conn_write(self->tls, buf, len);
+
+ if (sent < 0) {
+ int esp_tls_code;
+ int flags;
+ esp_err_t err = esp_tls_get_and_clear_last_error(self->tls->error_handle, &esp_tls_code, &flags);
+
+ if (err == ESP_ERR_MBEDTLS_SSL_SETUP_FAILED) {
+ mp_raise_espidf_MemoryError();
+ } else if (ESP_ERR_MBEDTLS_SSL_HANDSHAKE_FAILED) {
+ mp_raise_OSError_msg_varg(translate("Failed SSL handshake"));
+ } else {
+ mp_raise_OSError_msg_varg(translate("Unhandled ESP TLS error %d %d %x %d"), esp_tls_code, flags, err, sent);
+ }
+ }
+ return sent;
+}
+
+void common_hal_ssl_sslsocket_settimeout(ssl_sslsocket_obj_t* self, uint32_t timeout_ms) {
+ self->sock->timeout_ms = timeout_ms;
+}
diff --git a/ports/esp32s2/common-hal/ssl/SSLSocket.h b/ports/esp32s2/common-hal/ssl/SSLSocket.h
new file mode 100644
index 000000000..e9e5bff06
--- /dev/null
+++ b/ports/esp32s2/common-hal/ssl/SSLSocket.h
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 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_ESP32S2_COMMON_HAL_SSL_SSLSOCKET_H
+#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSLSOCKET_H
+
+#include "py/obj.h"
+
+#include "common-hal/ssl/SSLContext.h"
+#include "common-hal/socketpool/Socket.h"
+
+#include "components/esp-tls/esp_tls.h"
+
+typedef struct {
+ mp_obj_base_t base;
+ socketpool_socket_obj_t * sock;
+ esp_tls_t* tls;
+ ssl_sslcontext_obj_t* ssl_context;
+} ssl_sslsocket_obj_t;
+
+#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_SSL_SSLSOCKET_H
diff --git a/ports/esp32s2/common-hal/supervisor/Runtime.c b/ports/esp32s2/common-hal/supervisor/Runtime.c
index ea663f897..974f26cec 100644
--- a/ports/esp32s2/common-hal/supervisor/Runtime.c
+++ b/ports/esp32s2/common-hal/supervisor/Runtime.c
@@ -28,10 +28,10 @@
#include "shared-bindings/supervisor/Runtime.h"
#include "supervisor/serial.h"
-bool common_hal_get_serial_connected(void) {
+bool common_hal_supervisor_runtime_get_serial_connected(void) {
return (bool) serial_connected();
}
-bool common_hal_get_serial_bytes_available(void) {
- return (bool) serial_bytes_available();
+bool common_hal_supervisor_runtime_get_serial_bytes_available(void) {
+ return (bool) serial_bytes_available();
}
diff --git a/ports/esp32s2/mpconfigport.mk b/ports/esp32s2/mpconfigport.mk
index 562c60998..5073d8812 100644
--- a/ports/esp32s2/mpconfigport.mk
+++ b/ports/esp32s2/mpconfigport.mk
@@ -28,18 +28,18 @@ CIRCUITPY_FREQUENCYIO = 1
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_ROTARYIO = 1
CIRCUITPY_NVM = 1
+CIRCUITPY_PS2IO ?= 1
+CIRCUITPY_TOUCHIO_USE_NATIVE ?= 1
# We don't have enough endpoints to include MIDI.
-CIRCUITPY_USB_MIDI = 0
+CIRCUITPY_USB_MIDI ?= 0
+CIRCUITPY_USB_HID ?= 1
+# We have borrowed the VENDOR nomenclature from tinyusb. VENDOR AKA WEBUSB
+CIRCUITPY_USB_VENDOR ?= 0
CIRCUITPY_WIFI = 1
CIRCUITPY_WATCHDOG ?= 1
-CIRCUITPY_ESPIDF = 1
-
-ifndef CIRCUITPY_PS2IO
-CIRCUITPY_PS2IO = 1
-endif
-ifndef CIRCUITPY_TOUCHIO_USE_NATIVE
-CIRCUITPY_TOUCHIO_USE_NATIVE = 1
-endif
+CIRCUITPY_ESPIDF = 1
CIRCUITPY_MODULE ?= none
+
+USB_NUM_EP = 5
diff --git a/ports/litex/common-hal/supervisor/Runtime.c b/ports/litex/common-hal/supervisor/Runtime.c
index ea663f897..974f26cec 100644
--- a/ports/litex/common-hal/supervisor/Runtime.c
+++ b/ports/litex/common-hal/supervisor/Runtime.c
@@ -28,10 +28,10 @@
#include "shared-bindings/supervisor/Runtime.h"
#include "supervisor/serial.h"
-bool common_hal_get_serial_connected(void) {
+bool common_hal_supervisor_runtime_get_serial_connected(void) {
return (bool) serial_connected();
}
-bool common_hal_get_serial_bytes_available(void) {
- return (bool) serial_bytes_available();
+bool common_hal_supervisor_runtime_get_serial_bytes_available(void) {
+ return (bool) serial_bytes_available();
}
diff --git a/ports/litex/mpconfigport.mk b/ports/litex/mpconfigport.mk
index 003fb5c2c..af6a94e64 100644
--- a/ports/litex/mpconfigport.mk
+++ b/ports/litex/mpconfigport.mk
@@ -6,6 +6,9 @@ MPY_TOOL_LONGINT_IMPL = -mlongint-impl=mpz
# Internal math library is substantially smaller than toolchain one
INTERNAL_LIBM = 1
+# Number of USB endpoint pairs.
+USB_NUM_EP = 16
+
# Chip supplied serial number, in bytes
USB_SERIAL_NUMBER_LENGTH = 30
diff --git a/ports/mimxrt10xx/common-hal/busio/I2C.c b/ports/mimxrt10xx/common-hal/busio/I2C.c
index aaa2549a8..c8daddc4b 100644
--- a/ports/mimxrt10xx/common-hal/busio/I2C.c
+++ b/ports/mimxrt10xx/common-hal/busio/I2C.c
@@ -110,7 +110,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
if( !GPIO_PinRead(sda->gpio, sda->number) || !GPIO_PinRead(scl->gpio, scl->number)) {
common_hal_reset_pin(sda);
common_hal_reset_pin(scl);
- mp_raise_RuntimeError(translate("SDA or SCL needs a pull up"));
+ mp_raise_RuntimeError(translate("No pull up found on SDA or SCL; check your wiring"));
}
#endif
diff --git a/ports/mimxrt10xx/common-hal/busio/SPI.c b/ports/mimxrt10xx/common-hal/busio/SPI.c
index ce7cbea7e..00d8d9867 100644
--- a/ports/mimxrt10xx/common-hal/busio/SPI.c
+++ b/ports/mimxrt10xx/common-hal/busio/SPI.c
@@ -38,6 +38,8 @@
#define LPSPI_MASTER_CLK_FREQ (CLOCK_GetFreq(kCLOCK_Usb1PllPfd0Clk) / (CLOCK_GetDiv(kCLOCK_LpspiDiv) + 1))
+#define MAX_SPI_BUSY_RETRIES 100
+
//arrays use 0 based numbering: SPI1 is stored at index 0
#define MAX_SPI 4
STATIC bool reserved_spi[MAX_SPI];
@@ -289,7 +291,12 @@ bool common_hal_busio_spi_write(busio_spi_obj_t *self,
xfer.dataSize = len;
xfer.configFlags = kLPSPI_MasterPcs0;
- const status_t status = LPSPI_MasterTransferBlocking(self->spi, &xfer);
+ status_t status;
+ int retries = MAX_SPI_BUSY_RETRIES;
+ do {
+ status = LPSPI_MasterTransferBlocking(self->spi, &xfer);
+ } while (status == kStatus_LPSPI_Busy && --retries > 0);
+
if (status != kStatus_Success)
printf("%s: status %ld\r\n", __func__, status);
@@ -311,7 +318,12 @@ bool common_hal_busio_spi_read(busio_spi_obj_t *self,
xfer.rxData = data;
xfer.dataSize = len;
- const status_t status = LPSPI_MasterTransferBlocking(self->spi, &xfer);
+ status_t status;
+ int retries = MAX_SPI_BUSY_RETRIES;
+ do {
+ status = LPSPI_MasterTransferBlocking(self->spi, &xfer);
+ } while (status == kStatus_LPSPI_Busy && --retries > 0);
+
if (status != kStatus_Success)
printf("%s: status %ld\r\n", __func__, status);
@@ -333,7 +345,12 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self, const uint8_t *data_ou
xfer.rxData = data_in;
xfer.dataSize = len;
- const status_t status = LPSPI_MasterTransferBlocking(self->spi, &xfer);
+ status_t status;
+ int retries = MAX_SPI_BUSY_RETRIES;
+ do {
+ status = LPSPI_MasterTransferBlocking(self->spi, &xfer);
+ } while (status == kStatus_LPSPI_Busy && --retries > 0);
+
if (status != kStatus_Success)
printf("%s: status %ld\r\n", __func__, status);
diff --git a/ports/mimxrt10xx/common-hal/supervisor/Runtime.c b/ports/mimxrt10xx/common-hal/supervisor/Runtime.c
index 6be38f216..974f26cec 100755
--- a/ports/mimxrt10xx/common-hal/supervisor/Runtime.c
+++ b/ports/mimxrt10xx/common-hal/supervisor/Runtime.c
@@ -28,10 +28,10 @@
#include "shared-bindings/supervisor/Runtime.h"
#include "supervisor/serial.h"
-bool common_hal_get_serial_connected(void) {
+bool common_hal_supervisor_runtime_get_serial_connected(void) {
return (bool) serial_connected();
}
-bool common_hal_get_serial_bytes_available(void) {
+bool common_hal_supervisor_runtime_get_serial_bytes_available(void) {
return (bool) serial_bytes_available();
}
diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk
index b4cc9586a..de594b14b 100644
--- a/ports/mimxrt10xx/mpconfigport.mk
+++ b/ports/mimxrt10xx/mpconfigport.mk
@@ -17,6 +17,9 @@ INTERNAL_LIBM = 1
USB_SERIAL_NUMBER_LENGTH = 32
USB_HIGHSPEED = 1
+# Number of USB endpoint pairs.
+USB_NUM_EP = 8
+
INTERNAL_FLASH_FILESYSTEM = 1
CIRCUITPY_AUDIOIO = 0
diff --git a/ports/nrf/bluetooth/ble_uart.c b/ports/nrf/bluetooth/ble_uart.c
index 1e7a319bd..1b87b82d1 100644
--- a/ports/nrf/bluetooth/ble_uart.c
+++ b/ports/nrf/bluetooth/ble_uart.c
@@ -40,7 +40,7 @@
#include "shared-bindings/_bleio/Service.h"
#include "shared-bindings/_bleio/UUID.h"
-#if CIRCUITPY_SERIAL_BLE
+#if CIRCUITPY_REPL_BLE
static const char default_name[] = "CP-REPL"; // max 8 chars or uuid won't fit in adv data
static const char NUS_UUID[] = "6e400001-b5a3-f393-e0a9-e50e24dcca9e";
@@ -190,4 +190,4 @@ void mp_hal_stdout_tx_strn(const char *str, size_t len) {
}
}
-#endif // CIRCUITPY_SERIAL_BLE
+#endif // CIRCUITPY_REPL_BLE
diff --git a/ports/nrf/boards/TG-Watch/mpconfigboard.h b/ports/nrf/boards/TG-Watch/mpconfigboard.h
index 07a607b3d..1377c921e 100644
--- a/ports/nrf/boards/TG-Watch/mpconfigboard.h
+++ b/ports/nrf/boards/TG-Watch/mpconfigboard.h
@@ -30,27 +30,27 @@
#define MICROPY_HW_BOARD_NAME "TG-Watch"
#define MICROPY_HW_MCU_NAME "nRF52840"
-#define MICROPY_HW_NEOPIXEL (&pin_P0_16)
-#define MICROPY_HW_LED_STATUS (&pin_P1_15)
-
-// TG-Gui requires a deeper call stack than normal CircuitPython
+// TG-Gui requires a deeper call stack than normal CircuitPython, this is intentional overkill
#define CIRCUITPY_PYSTACK_SIZE 8192 // 1536 is the normal size, (32 bytes/frame * 48 frames)
-#define BOARD_HAS_CRYSTAL 0
+
+// the board has a 32mhz crystal but NOT a 32khz one
+#define BOARD_HAS_32KHZ_XTAL 0
+#define BOARD_HAS_CRYSTAL 1
#if QSPI_FLASH_FILESYSTEM
-#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 17)
-#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 22)
-#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 23)
-#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 21)
-#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19)
-#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 20)
+ #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 17)
+ #define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 22)
+ #define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 23)
+ #define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 21)
+ #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_P0_17
-#define SPI_FLASH_MISO_PIN &pin_P0_22
-#define SPI_FLASH_SCK_PIN &pin_P0_19
-#define SPI_FLASH_CS_PIN &pin_P0_20
+ #define SPI_FLASH_MOSI_PIN &pin_P0_17
+ #define SPI_FLASH_MISO_PIN &pin_P0_22
+ #define SPI_FLASH_SCK_PIN &pin_P0_19
+ #define SPI_FLASH_CS_PIN &pin_P0_20
#endif
#define DEFAULT_I2C_BUS_SCL (&pin_P0_11)
diff --git a/ports/nrf/boards/pca10100/mpconfigboard.mk b/ports/nrf/boards/pca10100/mpconfigboard.mk
index c8cba2877..fbb9987c2 100644
--- a/ports/nrf/boards/pca10100/mpconfigboard.mk
+++ b/ports/nrf/boards/pca10100/mpconfigboard.mk
@@ -29,6 +29,7 @@ CIRCUITPY_BUSDEVICE = 0
MICROPY_PY_ASYNC_AWAIT = 0
SUPEROPT_GC = 0
+SUPEROPT_VM = 0
# Override optimization to keep binary small
OPTIMIZATION_FLAGS = -Os
diff --git a/ports/nrf/boards/simmel/mpconfigboard.mk b/ports/nrf/boards/simmel/mpconfigboard.mk
index 032caac40..52743d340 100644
--- a/ports/nrf/boards/simmel/mpconfigboard.mk
+++ b/ports/nrf/boards/simmel/mpconfigboard.mk
@@ -29,6 +29,8 @@ CIRCUITPY_RTC = 1
CIRCUITPY_SDCARDIO = 0
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_ULAB = 0
+CIRCUITPY_USB_CDC = 0
+CIRCUITPY_USB_MIDI = 0
CIRCUITPY_WATCHDOG = 1
# Enable micropython.native
diff --git a/ports/nrf/common-hal/busio/I2C.c b/ports/nrf/common-hal/busio/I2C.c
index 37cb192df..654fa857f 100644
--- a/ports/nrf/common-hal/busio/I2C.c
+++ b/ports/nrf/common-hal/busio/I2C.c
@@ -131,7 +131,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t *
if (!nrf_gpio_pin_read(sda->number) || !nrf_gpio_pin_read(scl->number)) {
reset_pin_number(sda->number);
reset_pin_number(scl->number);
- mp_raise_RuntimeError(translate("SDA or SCL needs a pull up"));
+ mp_raise_RuntimeError(translate("No pull up found on SDA or SCL; check your wiring"));
}
#endif
diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c
index 012ebc3b5..6ecf7e0ba 100644
--- a/ports/nrf/common-hal/busio/UART.c
+++ b/ports/nrf/common-hal/busio/UART.c
@@ -36,6 +36,7 @@
#include "supervisor/shared/translate.h"
#include "nrfx_uarte.h"
+#include "nrf_gpio.h"
#include <string.h>
// expression to examine, and return value in case of failing
@@ -98,10 +99,16 @@ static void uart_callback_irq (const nrfx_uarte_event_t * event, void * context)
switch ( event->type ) {
case NRFX_UARTE_EVT_RX_DONE:
- ringbuf_put_n(&self->ringbuf, event->data.rxtx.p_data, event->data.rxtx.bytes);
+ if (ringbuf_num_empty(&self->ringbuf) >= event->data.rxtx.bytes) {
+ ringbuf_put_n(&self->ringbuf, event->data.rxtx.p_data, event->data.rxtx.bytes);
+ // keep receiving
+ (void) nrfx_uarte_rx(self->uarte, &self->rx_char, 1);
+ } else {
+ // receive buffer full, suspend
+ self->rx_paused = true;
+ nrf_gpio_pin_write(self->rts_pin_number, true);
+ }
- // keep receiving
- (void) nrfx_uarte_rx(self->uarte, &self->rx_char, 1);
break;
case NRFX_UARTE_EVT_TX_DONE:
@@ -137,8 +144,8 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
mp_float_t timeout, uint16_t receiver_buffer_size, byte* receiver_buffer,
bool sigint_enabled) {
- if ((rts != NULL) || (cts != NULL) || (rs485_dir != NULL) || (rs485_invert)) {
- mp_raise_ValueError(translate("RTS/CTS/RS485 Not yet supported on this device"));
+ if ((rs485_dir != NULL) || (rs485_invert)) {
+ mp_raise_ValueError(translate("RS485 Not yet supported on this device"));
}
// Find a free UART peripheral.
@@ -166,16 +173,18 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
mp_raise_ValueError(translate("Odd parity is not supported"));
}
+ bool hwfc = rts != NULL || cts != NULL;
+
nrfx_uarte_config_t config = {
.pseltxd = (tx == NULL) ? NRF_UARTE_PSEL_DISCONNECTED : tx->number,
.pselrxd = (rx == NULL) ? NRF_UARTE_PSEL_DISCONNECTED : rx->number,
- .pselcts = NRF_UARTE_PSEL_DISCONNECTED,
- .pselrts = NRF_UARTE_PSEL_DISCONNECTED,
+ .pselcts = (cts == NULL) ? NRF_UARTE_PSEL_DISCONNECTED : cts->number,
+ .pselrts = (rts == NULL) ? NRF_UARTE_PSEL_DISCONNECTED : rts->number,
.p_context = self,
.baudrate = get_nrf_baud(baudrate),
.interrupt_priority = 7,
.hal_cfg = {
- .hwfc = NRF_UARTE_HWFC_DISABLED,
+ .hwfc = hwfc ? NRF_UARTE_HWFC_ENABLED : NRF_UARTE_HWFC_DISABLED,
.parity = (parity == BUSIO_UART_PARITY_NONE) ? NRF_UARTE_PARITY_EXCLUDED : NRF_UARTE_PARITY_INCLUDED
}
};
@@ -207,9 +216,25 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
self->tx_pin_number = NO_PIN;
}
+ if ( rts != NULL ) {
+ self->rts_pin_number = rts->number;
+ claim_pin(rts);
+ } else {
+ self->rts_pin_number = NO_PIN;
+ }
+
+ if ( cts != NULL ) {
+ self->cts_pin_number = cts->number;
+ claim_pin(cts);
+ } else {
+ self->cts_pin_number = NO_PIN;
+ }
+
self->baudrate = baudrate;
self->timeout_ms = timeout * 1000;
+ self->rx_paused = false;
+
// Initial wait for incoming byte
_VERIFY_ERR(nrfx_uarte_rx(self->uarte, &self->rx_char, 1));
}
@@ -223,8 +248,12 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) {
nrfx_uarte_uninit(self->uarte);
reset_pin_number(self->tx_pin_number);
reset_pin_number(self->rx_pin_number);
+ reset_pin_number(self->rts_pin_number);
+ reset_pin_number(self->cts_pin_number);
self->tx_pin_number = NO_PIN;
self->rx_pin_number = NO_PIN;
+ self->rts_pin_number = NO_PIN;
+ self->cts_pin_number = NO_PIN;
ringbuf_free(&self->ringbuf);
}
}
@@ -237,6 +266,13 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t
uint64_t start_ticks = supervisor_ticks_ms64();
+ // check removed to reduce code size
+ /*
+ if (len > ringbuf_capacity(&self->ringbuf)) {
+ mp_raise_ValueError(translate("Reading >receiver_buffer_size bytes is not supported"));
+ }
+ */
+
// Wait for all bytes received or timeout
while ( (ringbuf_num_filled(&self->ringbuf) < len) && (supervisor_ticks_ms64() - start_ticks < self->timeout_ms) ) {
RUN_BACKGROUND_TASKS;
@@ -252,6 +288,16 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t
// Copy as much received data as available, up to len bytes.
size_t rx_bytes = ringbuf_get_n(&self->ringbuf, data, len);
+ // restart reader, if stopped
+ if (self->rx_paused) {
+ // the character that did not fit in ringbuf is in rx_char
+ ringbuf_put_n(&self->ringbuf, &self->rx_char, 1);
+ // keep receiving
+ (void) nrfx_uarte_rx(self->uarte, &self->rx_char, 1);
+ nrf_gpio_pin_write(self->rts_pin_number, false);
+ self->rx_paused = false;
+ }
+
NVIC_EnableIRQ(nrfx_get_irq_number(self->uarte->p_reg));
return rx_bytes;
diff --git a/ports/nrf/common-hal/busio/UART.h b/ports/nrf/common-hal/busio/UART.h
index a25116291..2eaf58440 100644
--- a/ports/nrf/common-hal/busio/UART.h
+++ b/ports/nrf/common-hal/busio/UART.h
@@ -42,10 +42,13 @@ typedef struct {
uint32_t timeout_ms;
ringbuf_t ringbuf;
- uint8_t rx_char; // EasyDMA buf
+ uint8_t rx_char; // EasyDMA buf
+ bool rx_paused; // set by irq if no space in rbuf
uint8_t tx_pin_number;
uint8_t rx_pin_number;
+ uint8_t cts_pin_number;
+ uint8_t rts_pin_number;
} busio_uart_obj_t;
void uart_reset(void);
diff --git a/ports/nrf/common-hal/supervisor/Runtime.c b/ports/nrf/common-hal/supervisor/Runtime.c
index ea663f897..a24e86cdf 100755
--- a/ports/nrf/common-hal/supervisor/Runtime.c
+++ b/ports/nrf/common-hal/supervisor/Runtime.c
@@ -28,10 +28,10 @@
#include "shared-bindings/supervisor/Runtime.h"
#include "supervisor/serial.h"
-bool common_hal_get_serial_connected(void) {
+bool common_hal_supervisor_runtime_get_serial_connected(void) {
return (bool) serial_connected();
}
-bool common_hal_get_serial_bytes_available(void) {
+bool common_hal_supervisor_runtime_get_serial_bytes_available(void) {
return (bool) serial_bytes_available();
}
diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk
index 9560064fb..83924ff79 100644
--- a/ports/nrf/mpconfigport.mk
+++ b/ports/nrf/mpconfigport.mk
@@ -11,6 +11,9 @@ INTERNAL_LIBM = 1
USB_SERIAL_NUMBER_LENGTH = 16
+# Number of USB endpoint pairs.
+USB_NUM_EP = 8
+
# All nRF ports have longints.
LONGINT_IMPL = MPZ
diff --git a/ports/nrf/supervisor/serial.c b/ports/nrf/supervisor/serial.c
index b19e9267c..2c2c0116f 100644
--- a/ports/nrf/supervisor/serial.c
+++ b/ports/nrf/supervisor/serial.c
@@ -28,15 +28,15 @@
#include "supervisor/serial.h"
-#if CIRCUITPY_SERIAL_BLE
+#if CIRCUITPY_REPL_BLE
#include "ble_uart.h"
-#elif CIRCUITPY_SERIAL_UART
+#elif CIRCUITPY_REPL_UART
#include <string.h>
#include "nrf_gpio.h"
#include "nrfx_uarte.h"
#endif
-#if CIRCUITPY_SERIAL_BLE
+#if CIRCUITPY_REPL_BLE
void serial_init(void) {
ble_uart_init();
@@ -58,7 +58,7 @@ void serial_write(const char *text) {
ble_uart_stdout_tx_str(text);
}
-#elif CIRCUITPY_SERIAL_UART
+#elif CIRCUITPY_REPL_UART
uint8_t serial_received_char;
nrfx_uarte_t serial_instance = NRFX_UARTE_INSTANCE(0);
@@ -124,4 +124,4 @@ void serial_write_substring(const char *text, uint32_t len) {
}
}
-#endif // CIRCUITPY_SERIAL_UART
+#endif // CIRCUITPY_REPL_UART
diff --git a/ports/raspberrypi/Makefile b/ports/raspberrypi/Makefile
index a604acb47..f5e65f256 100644
--- a/ports/raspberrypi/Makefile
+++ b/ports/raspberrypi/Makefile
@@ -84,6 +84,7 @@ INC += -I. \
-isystem sdk/src/rp2_common/hardware_pio/include/ \
-isystem sdk/src/rp2_common/hardware_pll/include/ \
-isystem sdk/src/rp2_common/hardware_resets/include/ \
+ -isystem sdk/src/rp2_common/hardware_rtc/include/ \
-isystem sdk/src/rp2_common/hardware_spi/include/ \
-isystem sdk/src/rp2_common/hardware_sync/include/ \
-isystem sdk/src/rp2_common/hardware_timer/include/ \
@@ -98,6 +99,7 @@ INC += -I. \
-isystem sdk/src/rp2_common/pico_platform/include/ \
-isystem sdk/src/rp2_common/pico_runtime/printf/include/ \
-isystem sdk/src/rp2_common/pico_bootrom/include/ \
+ -isystem sdk/src/rp2_common/pico_unique_id/include/ \
-Isdk_config \
-I../../lib/tinyusb/src \
-I../../supervisor/shared/usb \
@@ -166,6 +168,7 @@ SRC_SDK := \
src/rp2_common/hardware_irq/irq.c \
src/rp2_common/hardware_pio/pio.c \
src/rp2_common/hardware_pll/pll.c \
+ src/rp2_common/hardware_rtc/rtc.c \
src/rp2_common/hardware_spi/spi.c \
src/rp2_common/hardware_sync/sync.c \
src/rp2_common/hardware_timer/timer.c \
@@ -182,6 +185,7 @@ SRC_SDK := \
src/rp2_common/pico_printf/printf.c \
src/rp2_common/pico_runtime/runtime.c \
src/rp2_common/pico_stdio/stdio.c \
+ src/rp2_common/pico_unique_id/unique_id.c \
SRC_SDK := $(addprefix sdk/, $(SRC_SDK))
@@ -192,8 +196,10 @@ SRC_C += \
bindings/rp2pio/__init__.c \
common-hal/rp2pio/StateMachine.c \
common-hal/rp2pio/__init__.c \
+ audio_dma.c \
background.c \
peripherals/pins.c \
+ extmod/crypto-algorithms/sha256.c \
fatfs_port.c \
lib/libc/string0.c \
lib/mp-readline/readline.c \
diff --git a/ports/raspberrypi/audio_dma.c b/ports/raspberrypi/audio_dma.c
new file mode 100644
index 000000000..96317984d
--- /dev/null
+++ b/ports/raspberrypi/audio_dma.c
@@ -0,0 +1,383 @@
+/*
+ * 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 "audio_dma.h"
+
+#include "shared-bindings/audiocore/RawSample.h"
+#include "shared-bindings/audiocore/WaveFile.h"
+#include "supervisor/background_callback.h"
+
+#include "py/mpstate.h"
+#include "py/runtime.h"
+
+#include "src/rp2_common/hardware_irq/include/hardware/irq.h"
+
+#if CIRCUITPY_AUDIOPWMIO || CIRCUITPY_AUDIOBUSIO
+
+#define AUDIO_DMA_CHANNEL_COUNT NUM_DMA_CHANNELS
+
+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;
+ }
+ #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;
+ }
+ } 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;
+ }
+ } 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;
+ }
+ }
+ } else {
+ *output_buffer = buffer;
+ *output_buffer_length = buffer_length;
+ }
+ #pragma GCC diagnostic pop
+ dma->first_buffer_free = !dma->first_buffer_free;
+}
+
+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;
+
+ uint8_t* output_buffer;
+ uint32_t output_buffer_length;
+ audioio_get_buffer_result_t get_buffer_result;
+ uint8_t* buffer;
+ uint32_t buffer_length;
+ get_buffer_result = audiosample_get_buffer(dma->sample,
+ dma->single_channel, dma->audio_channel, &buffer, &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);
+
+ // 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;
+ }
+
+ 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, 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);
+ }
+ }
+}
+
+// Playback should be shutdown before calling this.
+audio_dma_result audio_dma_setup_playback(audio_dma_t* dma,
+ mp_obj_t sample,
+ bool loop,
+ bool single_channel,
+ uint8_t audio_channel,
+ bool output_signed,
+ uint8_t output_resolution,
+ uint32_t output_register_address,
+ uint8_t dma_trigger_source) {
+ // Use two DMA channels to because the DMA can't wrap to itself without the
+ // buffer being power of two aligned.
+ dma->channel[0] = dma_claim_unused_channel(false);
+ dma->channel[1] = dma_claim_unused_channel(false);
+ if (dma->channel[0] == NUM_DMA_CHANNELS || dma->channel[1] == NUM_DMA_CHANNELS) {
+ if (dma->channel[0] < NUM_DMA_CHANNELS) {
+ dma_channel_unclaim(dma->channel[0]);
+ }
+ return AUDIO_DMA_DMA_BUSY;
+ }
+
+ dma->sample = sample;
+ dma->loop = loop;
+ dma->single_channel = single_channel;
+ dma->audio_channel = audio_channel;
+ dma->signed_to_unsigned = false;
+ 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);
+ audiosample_reset_buffer(sample, single_channel, audio_channel);
+
+ bool single_buffer;
+ bool samples_signed;
+ uint32_t max_buffer_length;
+ audiosample_get_buffer_structure(sample, single_channel, &single_buffer, &samples_signed,
+ &max_buffer_length, &dma->sample_spacing);
+
+ // Check to see if we have to scale the resolution up.
+ if (dma->sample_resolution <= 8 && dma->output_resolution > 8) {
+ max_buffer_length *= 2;
+ }
+ if (output_signed != samples_signed ||
+ 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) {
+ 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;
+ }
+
+ if (output_resolution > 8) {
+ dma->output_size = 2;
+ } else {
+ dma->output_size = 1;
+ }
+ // Transfer both channels at once.
+ if (!single_channel && audiosample_channel_count(sample) == 2) {
+ dma->output_size *= 2;
+ }
+
+ enum dma_channel_transfer_size dma_size = DMA_SIZE_8;
+ if (dma->output_size == 2) {
+ dma_size = DMA_SIZE_16;
+ } else if (dma->output_size == 4) {
+ dma_size = DMA_SIZE_32;
+ }
+
+ for (size_t i = 0; i < 2; i++) {
+ dma_channel_config c = dma_channel_get_default_config(dma->channel[i]);
+ channel_config_set_transfer_data_size(&c, dma_size);
+ 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 */);
+ }
+
+ // We keep the audio_dma_t for internal use and the sample as a root pointer because it
+ // contains the audiodma structure.
+ MP_STATE_PORT(playing_audio)[dma->channel[0]] = dma;
+ MP_STATE_PORT(playing_audio)[dma->channel[1]] = dma;
+
+ // Load the first two blocks up front.
+ audio_dma_load_next_block(dma);
+ if (!single_buffer) {
+ audio_dma_load_next_block(dma);
+ }
+
+ // Special case the DMA for a single buffer. It's commonly used for a single wave length of sound
+ // and may be short. Therefore, we use DMA chaining to loop quickly without involving interrupts.
+ // On the RP2040 we chain by having a second DMA writing to the config registers of the first.
+ // Read and write addresses change with DMA so we need to reset the read address back to the
+ // start of the sample.
+ if (single_buffer) {
+ dma_channel_config c = dma_channel_get_default_config(dma->channel[1]);
+ channel_config_set_transfer_data_size(&c, DMA_SIZE_32);
+ channel_config_set_dreq(&c, 0x3f); // dma as fast as possible
+ channel_config_set_read_increment(&c, false);
+ channel_config_set_write_increment(&c, false);
+ 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
+ 1, // transaction count
+ false); // trigger
+ } else {
+ // Enable our DMA channels on DMA0 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_channel_start(dma->channel[0]);
+
+ return AUDIO_DMA_OK;
+}
+
+void audio_dma_stop(audio_dma_t* dma) {
+ // Disable our interrupts.
+ dma_hw->inte0 &= ~((1 << dma->channel[0]) | (1 << dma->channel[1]));
+ irq_set_mask_enabled(1 << DMA_IRQ_0, false);
+
+ // Run any remaining audio tasks because we remove ourselves from
+ // playing_audio.
+ RUN_BACKGROUND_TASKS;
+
+ for (size_t i = 0; i < 2; i++) {
+ size_t channel = dma->channel[i];
+
+ if (dma_channel_is_busy(channel)) {
+ dma_channel_abort(channel);
+ }
+ dma_channel_unclaim(channel);
+ MP_STATE_PORT(playing_audio)[channel] = NULL;
+ dma->channel[i] = NUM_DMA_CHANNELS;
+ }
+
+ // Hold onto our buffers.
+}
+
+// To pause we simply stop the DMA. It is the responsibility of the output peripheral
+// to hold the previous value.
+void audio_dma_pause(audio_dma_t* dma) {
+ dma_hw->ch[dma->channel[0]].al1_ctrl &= ~DMA_CH0_CTRL_TRIG_EN_BITS;
+ dma_hw->ch[dma->channel[1]].al1_ctrl &= ~DMA_CH0_CTRL_TRIG_EN_BITS;
+}
+
+void audio_dma_resume(audio_dma_t* dma) {
+ // Always re-enable the non-busy channel first so it's ready to continue when the busy channel
+ // finishes and chains to it. (An interrupt could make the time between enables long.)
+ size_t first = 0;
+ size_t second = 1;
+ if (dma_channel_is_busy(dma->channel[0])) {
+ first = 1;
+ second = 0;
+ }
+ dma_hw->ch[dma->channel[first]].al1_ctrl |= DMA_CH0_CTRL_TRIG_EN_BITS;
+ dma_hw->ch[dma->channel[second]].al1_ctrl |= DMA_CH0_CTRL_TRIG_EN_BITS;
+}
+
+bool audio_dma_get_paused(audio_dma_t* dma) {
+ if (dma->channel[0] >= AUDIO_DMA_CHANNEL_COUNT) {
+ return false;
+ }
+ uint32_t control = dma_hw->ch[dma->channel[0]].ctrl_trig;
+
+ return (control & DMA_CH0_CTRL_TRIG_EN_BITS) == 0;
+}
+
+void audio_dma_init(audio_dma_t* dma) {
+ dma->first_buffer = NULL;
+ dma->second_buffer = NULL;
+}
+
+void audio_dma_deinit(audio_dma_t* dma) {
+ m_free(dma->first_buffer);
+ dma->first_buffer = NULL;
+
+ m_free(dma->second_buffer);
+ dma->second_buffer = 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])) {
+ audio_dma_stop(dma);
+ return false;
+ }
+
+ return true;
+}
+
+// WARN(tannewt): DO NOT print from here, or anything it calls. Printing calls
+// background tasks such as this and causes a stack overflow.
+STATIC void dma_callback_fun(void *arg) {
+ audio_dma_t* dma = arg;
+ if (dma == NULL) {
+ return;
+ }
+
+ audio_dma_load_next_block(dma);
+}
+
+void isr_dma_0(void) {
+ for (size_t i = 0; i < NUM_DMA_CHANNELS; i++) {
+ uint32_t mask = 1 << i;
+ if ((dma_hw->intr & mask) != 0 && MP_STATE_PORT(playing_audio)[i] != NULL) {
+ audio_dma_t* dma = MP_STATE_PORT(playing_audio)[i];
+ background_callback_add(&dma->callback, dma_callback_fun, (void*)dma);
+ dma_hw->ints0 = mask;
+ }
+ }
+}
+
+#endif
diff --git a/ports/raspberrypi/audio_dma.h b/ports/raspberrypi/audio_dma.h
new file mode 100644
index 000000000..1f739ff73
--- /dev/null
+++ b/ports/raspberrypi/audio_dma.h
@@ -0,0 +1,91 @@
+/*
+ * 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.
+ */
+
+#ifndef MICROPY_INCLUDED_RASPBERRYPI_AUDIO_DMA_OUT_H
+#define MICROPY_INCLUDED_RASPBERRYPI_AUDIO_DMA_OUT_H
+
+#include "py/obj.h"
+#include "supervisor/background_callback.h"
+
+#include "src/rp2_common/hardware_dma/include/hardware/dma.h"
+
+typedef struct {
+ mp_obj_t sample;
+ uint8_t channel[2];
+ uint8_t audio_channel;
+ uint8_t output_size;
+ uint8_t sample_spacing;
+ bool loop;
+ bool single_channel;
+ 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;
+} audio_dma_t;
+
+typedef enum {
+ AUDIO_DMA_OK,
+ AUDIO_DMA_DMA_BUSY,
+ AUDIO_DMA_MEMORY_ERROR,
+} audio_dma_result;
+
+
+void audio_dma_init(audio_dma_t* dma);
+void audio_dma_deinit(audio_dma_t* dma);
+void audio_dma_reset(void);
+
+// This sets everything up but doesn't start the timer.
+// Sample is the python object for the sample to play.
+// loop is true if we should loop the sample.
+// single_channel is true if we only output a single channel. When false, all channels will be
+// output.
+// audio_channel is the index of the channel to dma. single_channel must be false in this case.
+// output_signed is true if the dma'd data should be signed. False and it will be unsigned.
+// output_register_address is the address to copy data to.
+// dma_trigger_source is the DMA trigger source which cause another copy
+audio_dma_result audio_dma_setup_playback(audio_dma_t* dma,
+ mp_obj_t sample,
+ bool loop,
+ bool single_channel,
+ uint8_t audio_channel,
+ bool output_signed,
+ uint8_t output_resolution,
+ uint32_t output_register_address,
+ uint8_t dma_trigger_source);
+
+void audio_dma_stop(audio_dma_t* dma);
+bool audio_dma_get_playing(audio_dma_t* dma);
+void audio_dma_pause(audio_dma_t* dma);
+void audio_dma_resume(audio_dma_t* dma);
+bool audio_dma_get_paused(audio_dma_t* dma);
+
+#endif // MICROPY_INCLUDED_RASPBERRYPI_AUDIO_DMA_OUT_H
diff --git a/ports/raspberrypi/background.c b/ports/raspberrypi/background.c
index c85b83b41..52f2e4fb4 100644
--- a/ports/raspberrypi/background.c
+++ b/ports/raspberrypi/background.c
@@ -25,20 +25,11 @@
*/
#include "background.h"
-#include "supervisor/filesystem.h"
-#include "supervisor/shared/tick.h"
-#include "supervisor/usb.h"
-
#include "py/runtime.h"
-#include "shared-module/network/__init__.h"
-#include "supervisor/shared/stack.h"
#include "supervisor/port.h"
-#if CIRCUITPY_DISPLAYIO
-#include "shared-module/displayio/__init__.h"
-#endif
-
void port_start_background_task(void) {}
void port_finish_background_task(void) {}
-void port_background_task(void) {}
+void port_background_task(void) {
+}
diff --git a/ports/raspberrypi/bindings/rp2pio/StateMachine.c b/ports/raspberrypi/bindings/rp2pio/StateMachine.c
index 0f6f84a56..34633949e 100644
--- a/ports/raspberrypi/bindings/rp2pio/StateMachine.c
+++ b/ports/raspberrypi/bindings/rp2pio/StateMachine.c
@@ -189,7 +189,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
if (bufinfo.len % 2 != 0) {
mp_raise_ValueError(translate("Program size invalid"));
}
- if (bufinfo.len > 32) {
+ if (bufinfo.len > 64) {
mp_raise_ValueError(translate("Program too large"));
}
diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h
index 6a2d063d7..f491a7769 100644
--- a/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h
+++ b/ports/raspberrypi/boards/adafruit_feather_rp2040/mpconfigboard.h
@@ -12,3 +12,6 @@
// #define DEFAULT_UART_BUS_RX (&pin_PA11)
// #define DEFAULT_UART_BUS_TX (&pin_PA10)
+
+// Flash chip is GD25Q32 connected over QSPI
+#define TOTAL_FLASH_SIZE (4 * 1024 * 1024)
diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/board.c b/ports/raspberrypi/boards/pimoroni_keybow2040/board.c
new file mode 100644
index 000000000..67486d4c2
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_keybow2040/board.c
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "supervisor/board.h"
+
+void board_init(void) {
+}
+
+bool board_requests_safe_mode(void) {
+ return false;
+}
+
+void reset_board(void) {
+}
diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h
new file mode 100644
index 000000000..234be27c2
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.h
@@ -0,0 +1,41 @@
+#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)
+
+#define TOTAL_FLASH_SIZE (2 * 1024 * 1024)
+
+// 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/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.mk
new file mode 100644
index 000000000..cf7429431
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_keybow2040/mpconfigboard.mk
@@ -0,0 +1,11 @@
+USB_VID = 0x16D0
+USB_PID = 0x08C6
+USB_PRODUCT = "Keybow 2040"
+USB_MANUFACTURER = "Pimoroni"
+
+CHIP_VARIANT = RP2040
+CHIP_FAMILY = rp2
+
+INTERNAL_FLASH_FILESYSTEM = 1
+
+CIRCUITPY__EVE = 1
diff --git a/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c b/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c
new file mode 100644
index 000000000..c4cdb7b29
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_keybow2040/pins.c
@@ -0,0 +1,36 @@
+#include "shared-bindings/board/__init__.h"
+
+STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
+ { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) },
+ { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) },
+
+ { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) },
+ { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) },
+
+ { MP_ROM_QSTR(MP_QSTR_INT), MP_ROM_PTR(&pin_GPIO3) },
+ { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO4) },
+ { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO5) },
+
+ { MP_ROM_QSTR(MP_QSTR_SW0), MP_ROM_PTR(&pin_GPIO21) },
+ { MP_ROM_QSTR(MP_QSTR_SW1), MP_ROM_PTR(&pin_GPIO20) },
+ { MP_ROM_QSTR(MP_QSTR_SW2), MP_ROM_PTR(&pin_GPIO19) },
+ { MP_ROM_QSTR(MP_QSTR_SW3), MP_ROM_PTR(&pin_GPIO18) },
+ { MP_ROM_QSTR(MP_QSTR_SW4), MP_ROM_PTR(&pin_GPIO17) },
+ { MP_ROM_QSTR(MP_QSTR_SW5), MP_ROM_PTR(&pin_GPIO16) },
+ { MP_ROM_QSTR(MP_QSTR_SW6), MP_ROM_PTR(&pin_GPIO15) },
+ { MP_ROM_QSTR(MP_QSTR_SW7), MP_ROM_PTR(&pin_GPIO14) },
+ { MP_ROM_QSTR(MP_QSTR_SW8), MP_ROM_PTR(&pin_GPIO13) },
+ { MP_ROM_QSTR(MP_QSTR_SW9), MP_ROM_PTR(&pin_GPIO12) },
+ { MP_ROM_QSTR(MP_QSTR_SW10), MP_ROM_PTR(&pin_GPIO11) },
+ { MP_ROM_QSTR(MP_QSTR_SW11), MP_ROM_PTR(&pin_GPIO10) },
+ { MP_ROM_QSTR(MP_QSTR_SW12), MP_ROM_PTR(&pin_GPIO9) },
+ { MP_ROM_QSTR(MP_QSTR_SW13), MP_ROM_PTR(&pin_GPIO8) },
+ { MP_ROM_QSTR(MP_QSTR_SW14), MP_ROM_PTR(&pin_GPIO7) },
+ { MP_ROM_QSTR(MP_QSTR_SW15), MP_ROM_PTR(&pin_GPIO6) },
+
+ { MP_ROM_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO23) },
+
+ { 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);
diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/board.c b/ports/raspberrypi/boards/pimoroni_picosystem/board.c
new file mode 100644
index 000000000..67486d4c2
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_picosystem/board.c
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "supervisor/board.h"
+
+void board_init(void) {
+}
+
+bool board_requests_safe_mode(void) {
+ return false;
+}
+
+void reset_board(void) {
+}
diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h
new file mode 100644
index 000000000..a1395f17d
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.h
@@ -0,0 +1,49 @@
+#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 MICROPY_HW_LED_G (&pin_GPIO13)
+#define MICROPY_HW_LED_R (&pin_GPIO14)
+#define MICROPY_HW_LED_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)
+
+#define TOTAL_FLASH_SIZE (16 * 1024 * 1024)
+
+// 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/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk
new file mode 100644
index 000000000..c9d22549b
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_picosystem/mpconfigboard.mk
@@ -0,0 +1,11 @@
+USB_VID = 0x16D0
+USB_PID = 0x08C8
+USB_PRODUCT = "PicoSystem"
+USB_MANUFACTURER = "Pimoroni"
+
+CHIP_VARIANT = RP2040
+CHIP_FAMILY = rp2
+
+INTERNAL_FLASH_FILESYSTEM = 1
+
+CIRCUITPY__EVE = 1
diff --git a/ports/raspberrypi/boards/pimoroni_picosystem/pins.c b/ports/raspberrypi/boards/pimoroni_picosystem/pins.c
new file mode 100644
index 000000000..30aafacba
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_picosystem/pins.c
@@ -0,0 +1,43 @@
+#include "shared-bindings/board/__init__.h"
+
+STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
+ { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) },
+ { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) },
+
+ { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) },
+ { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) },
+
+ { MP_ROM_QSTR(MP_QSTR_VBUS_DETECT), MP_ROM_PTR(&pin_GPIO2) },
+
+ { MP_ROM_QSTR(MP_QSTR_LCD_RESET), MP_ROM_PTR(&pin_GPIO4) },
+ { MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO5) },
+ { MP_ROM_QSTR(MP_QSTR_LCD_SCLK), MP_ROM_PTR(&pin_GPIO6) },
+ { MP_ROM_QSTR(MP_QSTR_LCD_MOSI), MP_ROM_PTR(&pin_GPIO7) },
+ { MP_ROM_QSTR(MP_QSTR_LCD_VSYNC), MP_ROM_PTR(&pin_GPIO8) },
+ { MP_ROM_QSTR(MP_QSTR_LCD_DC), MP_ROM_PTR(&pin_GPIO9) },
+
+ { MP_ROM_QSTR(MP_QSTR_AUDIO), MP_ROM_PTR(&pin_GPIO11) },
+ { MP_ROM_QSTR(MP_QSTR_BACKLIGHT), MP_ROM_PTR(&pin_GPIO12) },
+
+ { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_GPIO13) },
+ { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_GPIO14) },
+ { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_GPIO15) },
+
+ { MP_ROM_QSTR(MP_QSTR_SW_Y), MP_ROM_PTR(&pin_GPIO16) },
+ { MP_ROM_QSTR(MP_QSTR_SW_X), MP_ROM_PTR(&pin_GPIO17) },
+ { MP_ROM_QSTR(MP_QSTR_SW_A), MP_ROM_PTR(&pin_GPIO18) },
+ { MP_ROM_QSTR(MP_QSTR_SW_B), MP_ROM_PTR(&pin_GPIO19) },
+
+ { MP_ROM_QSTR(MP_QSTR_SW_DOWN), MP_ROM_PTR(&pin_GPIO20) },
+ { MP_ROM_QSTR(MP_QSTR_SW_RIGHT), MP_ROM_PTR(&pin_GPIO21) },
+ { MP_ROM_QSTR(MP_QSTR_SW_LEFT), MP_ROM_PTR(&pin_GPIO22) },
+ { MP_ROM_QSTR(MP_QSTR_SW_UP), MP_ROM_PTR(&pin_GPIO23) },
+
+ { MP_ROM_QSTR(MP_QSTR_CHARGE_STAT), MP_ROM_PTR(&pin_GPIO24) },
+
+ { MP_ROM_QSTR(MP_QSTR_BAT_SENSE), MP_ROM_PTR(&pin_GPIO26) },
+
+ { 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);
diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/board.c b/ports/raspberrypi/boards/pimoroni_tiny2040/board.c
new file mode 100644
index 000000000..67486d4c2
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_tiny2040/board.c
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "supervisor/board.h"
+
+void board_init(void) {
+}
+
+bool board_requests_safe_mode(void) {
+ return false;
+}
+
+void reset_board(void) {
+}
diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h
new file mode 100644
index 000000000..965dd0e04
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.h
@@ -0,0 +1,26 @@
+#define MICROPY_HW_BOARD_NAME "Pimoroni Tiny 2040"
+#define MICROPY_HW_MCU_NAME "rp2040"
+
+#define MICROPY_HW_LED_R (&pin_GPIO18)
+#define MICROPY_HW_LED_G (&pin_GPIO19)
+#define MICROPY_HW_LED_B (&pin_GPIO20)
+
+#define MICROPY_HW_USER_SW (&pin_GPIO23)
+
+#define TOTAL_FLASH_SIZE (8 * 1024 * 1024)
+
+// 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/mpconfigboard.mk b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.mk
new file mode 100644
index 000000000..75fe36a29
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_tiny2040/mpconfigboard.mk
@@ -0,0 +1,11 @@
+USB_VID = 0x16D0
+USB_PID = 0x08C7
+USB_PRODUCT = "Tiny 2040"
+USB_MANUFACTURER = "Pimoroni"
+
+CHIP_VARIANT = RP2040
+CHIP_FAMILY = rp2
+
+INTERNAL_FLASH_FILESYSTEM = 1
+
+CIRCUITPY__EVE = 1
diff --git a/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c b/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c
new file mode 100644
index 000000000..de79ee732
--- /dev/null
+++ b/ports/raspberrypi/boards/pimoroni_tiny2040/pins.c
@@ -0,0 +1,39 @@
+#include "shared-bindings/board/__init__.h"
+
+STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
+ { MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) },
+ { MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) },
+ { MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) },
+ { MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) },
+ { MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) },
+ { MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) },
+ { MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) },
+ { MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) },
+
+ { MP_ROM_QSTR(MP_QSTR_LED_R), MP_ROM_PTR(&pin_GPIO18) },
+ { MP_ROM_QSTR(MP_QSTR_LED_G), MP_ROM_PTR(&pin_GPIO19) },
+ { MP_ROM_QSTR(MP_QSTR_LED_B), MP_ROM_PTR(&pin_GPIO20) },
+
+ { MP_ROM_QSTR(MP_QSTR_USER_SW), MP_ROM_PTR(&pin_GPIO23) },
+
+ { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) },
+ { 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_A1), MP_ROM_PTR(&pin_GPIO27) },
+ { 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_A2), MP_ROM_PTR(&pin_GPIO28) },
+ { 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_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);
diff --git a/ports/raspberrypi/boards/qtpy_rp2040/board.c b/ports/raspberrypi/boards/qtpy_rp2040/board.c
new file mode 100644
index 000000000..332145ab8
--- /dev/null
+++ b/ports/raspberrypi/boards/qtpy_rp2040/board.c
@@ -0,0 +1,44 @@
+/*
+ * 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"
+
+void board_init(void) {
+ common_hal_never_reset_pin(&pin_GPIO11);
+ gpio_init(11);
+ gpio_set_dir(11, GPIO_OUT);
+ gpio_put(11, true);
+}
+
+bool board_requests_safe_mode(void) {
+ return false;
+}
+
+void reset_board(void) {
+}
diff --git a/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h
new file mode 100644
index 000000000..3f4778457
--- /dev/null
+++ b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.h
@@ -0,0 +1,17 @@
+#define MICROPY_HW_BOARD_NAME "Adafruit QTPy RP2040"
+#define MICROPY_HW_MCU_NAME "rp2040"
+
+#define MICROPY_HW_NEOPIXEL (&pin_GPIO12)
+
+#define DEFAULT_I2C_BUS_SCL (&pin_GPIO25)
+#define DEFAULT_I2C_BUS_SDA (&pin_GPIO24)
+
+#define DEFAULT_SPI_BUS_SCK (&pin_GPIO6)
+#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO3)
+#define DEFAULT_SPI_BUS_MISO (&pin_GPIO4)
+
+// #define DEFAULT_UART_BUS_RX (&pin_PA11)
+// #define DEFAULT_UART_BUS_TX (&pin_PA10)
+
+// Flash chip is GD25Q32 connected over QSPI
+#define TOTAL_FLASH_SIZE (4 * 1024 * 1024)
diff --git a/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.mk b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.mk
new file mode 100644
index 000000000..5e454e312
--- /dev/null
+++ b/ports/raspberrypi/boards/qtpy_rp2040/mpconfigboard.mk
@@ -0,0 +1,9 @@
+USB_VID = 0x239A
+USB_PID = 0x80F8
+USB_PRODUCT = "QT Py RP2040"
+USB_MANUFACTURER = "Adafruit"
+
+CHIP_VARIANT = RP2040
+CHIP_FAMILY = rp2
+
+INTERNAL_FLASH_FILESYSTEM = 1
diff --git a/ports/raspberrypi/boards/qtpy_rp2040/pins.c b/ports/raspberrypi/boards/qtpy_rp2040/pins.c
new file mode 100644
index 000000000..e0ebd0032
--- /dev/null
+++ b/ports/raspberrypi/boards/qtpy_rp2040/pins.c
@@ -0,0 +1,49 @@
+#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_GPIO29) },
+ { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO29) },
+
+ { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO28) },
+ { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO28) },
+
+ { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO27) },
+ { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO27) },
+
+ { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO26) },
+ { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO27) },
+
+ { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO24) },
+ { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO24) },
+
+ { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO25) },
+ { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO25) },
+
+ { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO20) },
+ { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO20) },
+
+ { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO9) },
+ { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO9) },
+
+ { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO6) },
+ { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO6) },
+
+ { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO4) },
+ { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO4) },
+
+ { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO3) },
+ { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO3) },
+
+ { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO12) },
+ { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO11) },
+
+
+ { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO22) },
+ { MP_ROM_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO23) },
+
+
+ { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
+ { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
+};
+MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);
diff --git a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h
index 4b0a22028..a506fec49 100644
--- a/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h
+++ b/ports/raspberrypi/boards/raspberry_pi_pico/mpconfigboard.h
@@ -13,3 +13,6 @@
// #define DEFAULT_UART_BUS_RX (&pin_PA11)
// #define DEFAULT_UART_BUS_TX (&pin_PA10)
+
+// Flash chip is W25Q16JVUXIQ connected over QSPI
+#define TOTAL_FLASH_SIZE (2 * 1024 * 1024)
diff --git a/ports/raspberrypi/boards/raspberry_pi_pico/pins.c b/ports/raspberrypi/boards/raspberry_pi_pico/pins.c
index 913676ad2..e1927bc80 100644
--- a/ports/raspberrypi/boards/raspberry_pi_pico/pins.c
+++ b/ports/raspberrypi/boards/raspberry_pi_pico/pins.c
@@ -24,6 +24,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) },
+ { MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) },
{ MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) },
{ MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) },
@@ -35,5 +36,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) },
+ { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) },
+ { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);
diff --git a/ports/raspberrypi/bs2_default_padded_checksummed.S b/ports/raspberrypi/bs2_default_padded_checksummed.S
index d77f4867c..6b7074e3b 100644
--- a/ports/raspberrypi/bs2_default_padded_checksummed.S
+++ b/ports/raspberrypi/bs2_default_padded_checksummed.S
@@ -1,20 +1,23 @@
-// Padded and checksummed version of: /Users/graham/dev/mu/pico_sdk/cmake-build-debug-mu/src/rp2_common/boot_stage2/bs2_default.bin
+// Padded and checksummed version of: /home/pi/pico/pico-examples/build/pico-sdk/src/rp2_common/boot_stage2/bs2_default.bin
-.section .boot2, "a"
+.cpu cortex-m0plus
+.thumb
-.byte 0x00, 0xb5, 0x2f, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
-.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2b, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
-.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x28, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
-.byte 0x00, 0xf0, 0x3e, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
-.byte 0x2e, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
-.byte 0x26, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x29, 0xf8, 0x01, 0x21
-.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x18, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
-.byte 0x17, 0x49, 0x18, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
-.byte 0x19, 0x66, 0x00, 0xf0, 0x0c, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x13, 0x49, 0x11, 0x48, 0x01, 0x60
-.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd1, 0x10, 0x48, 0x00, 0x47, 0x03, 0xb5
-.byte 0x99, 0x6a, 0x04, 0x20, 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd
-.byte 0x02, 0xb5, 0x18, 0x66, 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd
-.byte 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00
-.byte 0x21, 0x22, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x01, 0x01, 0x00, 0x10
-.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x27, 0x2a, 0x60
+.section .boot2, "ax"
+
+.byte 0x00, 0xb5, 0x32, 0x4b, 0x21, 0x20, 0x58, 0x60, 0x98, 0x68, 0x02, 0x21, 0x88, 0x43, 0x98, 0x60
+.byte 0xd8, 0x60, 0x18, 0x61, 0x58, 0x61, 0x2e, 0x4b, 0x00, 0x21, 0x99, 0x60, 0x02, 0x21, 0x59, 0x61
+.byte 0x01, 0x21, 0xf0, 0x22, 0x99, 0x50, 0x2b, 0x49, 0x19, 0x60, 0x01, 0x21, 0x99, 0x60, 0x35, 0x20
+.byte 0x00, 0xf0, 0x44, 0xf8, 0x02, 0x22, 0x90, 0x42, 0x14, 0xd0, 0x06, 0x21, 0x19, 0x66, 0x00, 0xf0
+.byte 0x34, 0xf8, 0x19, 0x6e, 0x01, 0x21, 0x19, 0x66, 0x00, 0x20, 0x18, 0x66, 0x1a, 0x66, 0x00, 0xf0
+.byte 0x2c, 0xf8, 0x19, 0x6e, 0x19, 0x6e, 0x19, 0x6e, 0x05, 0x20, 0x00, 0xf0, 0x2f, 0xf8, 0x01, 0x21
+.byte 0x08, 0x42, 0xf9, 0xd1, 0x00, 0x21, 0x99, 0x60, 0x1b, 0x49, 0x19, 0x60, 0x00, 0x21, 0x59, 0x60
+.byte 0x1a, 0x49, 0x1b, 0x48, 0x01, 0x60, 0x01, 0x21, 0x99, 0x60, 0xeb, 0x21, 0x19, 0x66, 0xa0, 0x21
+.byte 0x19, 0x66, 0x00, 0xf0, 0x12, 0xf8, 0x00, 0x21, 0x99, 0x60, 0x16, 0x49, 0x14, 0x48, 0x01, 0x60
+.byte 0x01, 0x21, 0x99, 0x60, 0x01, 0xbc, 0x00, 0x28, 0x00, 0xd0, 0x00, 0x47, 0x12, 0x48, 0x13, 0x49
+.byte 0x08, 0x60, 0x03, 0xc8, 0x80, 0xf3, 0x08, 0x88, 0x08, 0x47, 0x03, 0xb5, 0x99, 0x6a, 0x04, 0x20
+.byte 0x01, 0x42, 0xfb, 0xd0, 0x01, 0x20, 0x01, 0x42, 0xf8, 0xd1, 0x03, 0xbd, 0x02, 0xb5, 0x18, 0x66
+.byte 0x18, 0x66, 0xff, 0xf7, 0xf2, 0xff, 0x18, 0x6e, 0x18, 0x6e, 0x02, 0xbd, 0x00, 0x00, 0x02, 0x40
+.byte 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0x5f, 0x00, 0x21, 0x22, 0x00, 0x00
+.byte 0xf4, 0x00, 0x00, 0x18, 0x22, 0x20, 0x00, 0xa0, 0x00, 0x01, 0x00, 0x10, 0x08, 0xed, 0x00, 0xe0
+.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xb2, 0x4e, 0x7a
diff --git a/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c b/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
new file mode 100644
index 000000000..57605a1fb
--- /dev/null
+++ b/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
@@ -0,0 +1,235 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2019 Jeff Epler for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "common-hal/audiopwmio/PWMAudioOut.h"
+
+#include <stdint.h>
+#include <string.h>
+
+#include "extmod/vfs_fat.h"
+#include "py/gc.h"
+#include "py/mperrno.h"
+#include "py/runtime.h"
+#include "shared-bindings/pwmio/PWMOut.h"
+#include "shared-bindings/audiopwmio/PWMAudioOut.h"
+#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"
+#include "src/rp2_common/hardware_pwm/include/hardware/pwm.h"
+
+#define NUM_DMA_TIMERS 4
+
+void audiopwmout_reset() {
+ for (size_t i = 0; i < NUM_DMA_TIMERS; i++) {
+ dma_hw->timer[i] = 0;
+ }
+}
+
+// Caller validates that pins are free.
+void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t* self,
+ const mcu_pin_obj_t* left_channel, const mcu_pin_obj_t* right_channel, uint16_t quiescent_value) {
+ if (left_channel != NULL && right_channel != NULL) {
+ if (pwm_gpio_to_slice_num(left_channel->number) != pwm_gpio_to_slice_num(right_channel->number)) {
+ mp_raise_ValueError(translate("Pins must share PWM slice"));
+ }
+ if (pwm_gpio_to_channel(left_channel->number) != 0) {
+ mp_raise_ValueError(translate("Stereo left must be on PWM channel A"));
+ }
+ if (pwm_gpio_to_channel(right_channel->number) != 1) {
+ mp_raise_ValueError(translate("Stereo right must be on PWM channel B"));
+ }
+ }
+
+ // Typically pwmout doesn't let us change frequency with two objects on the
+ // same PWM slice. However, we have private access to it so we can do what
+ // we want. ;-) We mark ourselves variable only if we're a mono output to
+ // prevent other PWM use on the other channel. If stereo, we say fixed
+ // frequency so we can allocate with ourselves.
+ bool mono = right_channel == NULL;
+
+ // We don't actually know our frequency yet so just pick one that shouldn't
+ // match anyone else. (We'll only know the frequency once we play something
+ // back.)
+ uint32_t frequency = 12500;
+
+ // Make sure the PWMOut's are "deinited" by default.
+ self->left_pwm.pin = NULL;
+ self->right_pwm.pin = NULL;
+
+ pwmout_result_t result = common_hal_pwmio_pwmout_construct(&self->left_pwm,
+ left_channel, 0, frequency, mono);
+ if (result == PWMOUT_OK && right_channel != NULL) {
+ result = common_hal_pwmio_pwmout_construct(&self->right_pwm,
+ right_channel, 0, frequency, false);
+ if (result != PWMOUT_OK) {
+ common_hal_pwmio_pwmout_deinit(&self->left_pwm);
+ }
+ }
+ if (result != PWMOUT_OK) {
+ mp_raise_RuntimeError(translate("All timers in use"));
+ }
+
+ claim_pin(left_channel);
+ if (right_channel != NULL) {
+ claim_pin(right_channel);
+ }
+
+ audio_dma_init(&self->dma);
+
+ self->quiescent_value = quiescent_value;
+}
+
+bool common_hal_audiopwmio_pwmaudioout_deinited(audiopwmio_pwmaudioout_obj_t* self) {
+ return common_hal_pwmio_pwmout_deinited(&self->left_pwm);
+}
+
+void common_hal_audiopwmio_pwmaudioout_deinit(audiopwmio_pwmaudioout_obj_t* self) {
+ if (common_hal_audiopwmio_pwmaudioout_deinited(self)) {
+ return;
+ }
+ if (common_hal_audiopwmio_pwmaudioout_get_playing(self)) {
+ common_hal_audiopwmio_pwmaudioout_stop(self);
+ }
+
+ // TODO: ramp the pwm down from quiescent value to 0
+ common_hal_pwmio_pwmout_deinit(&self->left_pwm);
+ common_hal_pwmio_pwmout_deinit(&self->right_pwm);
+
+ audio_dma_deinit(&self->dma);
+}
+
+void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t* self, mp_obj_t sample, bool loop) {
+ if (common_hal_audiopwmio_pwmaudioout_get_playing(self)) {
+ common_hal_audiopwmio_pwmaudioout_stop(self);
+ }
+
+ // TODO: Share pacing timers based on frequency.
+ size_t pacing_timer = NUM_DMA_TIMERS;
+ for (size_t i = 0; i < NUM_DMA_TIMERS; i++) {
+ if (dma_hw->timer[i] == 0) {
+ pacing_timer = i;
+ }
+ break;
+ }
+ if (pacing_timer == NUM_DMA_TIMERS) {
+ mp_raise_RuntimeError(translate("No DMA pacing timer found"));
+ }
+ uint32_t tx_register = (uint32_t) &pwm_hw->slice[self->left_pwm.slice].cc;
+ if (common_hal_pwmio_pwmout_deinited(&self->right_pwm)) {
+ // Shift the destination if we are outputting to the second PWM channel.
+ tx_register += self->left_pwm.channel * sizeof(uint16_t);
+ }
+
+ pwmio_pwmout_set_top(&self->left_pwm, 1023);
+
+ audio_dma_result result = audio_dma_setup_playback(
+ &self->dma,
+ sample,
+ loop,
+ false, // single channel
+ 0, // audio channel
+ false, // output signed
+ 10,
+ (uint32_t) tx_register, // output register
+ 0x3b + pacing_timer); // data request line
+
+ if (result == AUDIO_DMA_DMA_BUSY) {
+ // common_hal_audiobusio_i2sout_stop(self);
+ mp_raise_RuntimeError(translate("No DMA channel found"));
+ } else if (result == AUDIO_DMA_MEMORY_ERROR) {
+ // common_hal_audiobusio_i2sout_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) {
+ dma_hw->timer[self->pacing_timer] = 0;
+ self->pacing_timer = NUM_DMA_TIMERS;
+
+ audio_dma_stop(&self->dma);
+}
+
+bool common_hal_audiopwmio_pwmaudioout_get_playing(audiopwmio_pwmaudioout_obj_t* self) {
+ bool playing = audio_dma_get_playing(&self->dma);
+ if (!playing && self->pacing_timer < NUM_DMA_TIMERS) {
+ dma_hw->timer[self->pacing_timer] = 0;
+ self->pacing_timer = NUM_DMA_TIMERS;
+ }
+ return playing;
+}
+
+void common_hal_audiopwmio_pwmaudioout_pause(audiopwmio_pwmaudioout_obj_t* self) {
+ audio_dma_pause(&self->dma);
+}
+
+void common_hal_audiopwmio_pwmaudioout_resume(audiopwmio_pwmaudioout_obj_t* self) {
+ audio_dma_resume(&self->dma);
+}
+
+bool common_hal_audiopwmio_pwmaudioout_get_paused(audiopwmio_pwmaudioout_obj_t* self) {
+ return audio_dma_get_paused(&self->dma);
+}
diff --git a/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.h b/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.h
new file mode 100644
index 000000000..2b43b8354
--- /dev/null
+++ b/ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.h
@@ -0,0 +1,47 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2019 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.
+ */
+
+#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_AUDIOPWMIO_PWMAUDIOOUT_H
+#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_AUDIOPWMIO_PWMAUDIOOUT_H
+
+#include "common-hal/pwmio/PWMOut.h"
+
+#include "audio_dma.h"
+
+typedef struct {
+ mp_obj_base_t base;
+ pwmio_pwmout_obj_t left_pwm;
+ pwmio_pwmout_obj_t right_pwm;
+ audio_dma_t dma;
+ uint16_t quiescent_value;
+ uint8_t pacing_timer;
+} audiopwmio_pwmaudioout_obj_t;
+
+void audiopwmout_reset(void);
+
+void audiopwmout_background(void);
+
+#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_AUDIOPWMIO_PWMAUDIOOUT_H
diff --git a/ports/raspberrypi/common-hal/audiopwmio/__init__.c b/ports/raspberrypi/common-hal/audiopwmio/__init__.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/ports/raspberrypi/common-hal/audiopwmio/__init__.c
diff --git a/ports/raspberrypi/common-hal/busio/I2C.c b/ports/raspberrypi/common-hal/busio/I2C.c
index fa49e375e..26a7f3807 100644
--- a/ports/raspberrypi/common-hal/busio/I2C.c
+++ b/ports/raspberrypi/common-hal/busio/I2C.c
@@ -90,7 +90,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
if (!gpio_get(sda->number) || !gpio_get(scl->number)) {
reset_pin_number(sda->number);
reset_pin_number(scl->number);
- mp_raise_RuntimeError(translate("SDA or SCL needs a pull up"));
+ mp_raise_RuntimeError(translate("No pull up found on SDA or SCL; check your wiring"));
}
#endif
diff --git a/ports/raspberrypi/common-hal/microcontroller/Processor.c b/ports/raspberrypi/common-hal/microcontroller/Processor.c
index 0ad3a51e2..e22286ca3 100644
--- a/ports/raspberrypi/common-hal/microcontroller/Processor.c
+++ b/ports/raspberrypi/common-hal/microcontroller/Processor.c
@@ -25,6 +25,7 @@
*/
#include <math.h>
+#include <string.h>
#include "py/mphal.h"
#include "common-hal/microcontroller/Processor.h"
@@ -53,12 +54,9 @@ uint32_t common_hal_mcu_processor_get_frequency(void) {
}
void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
- // TODO: get the unique id from the flash. The chip itself doesn't have one.
- // for (int i=0; i<4; i++) {
- // for (int k=0; k<4; k++) {
- // raw_id[4 * i + k] = (*(id_addresses[i]) >> k * 8) & 0xff;
- // }
- // }
+ pico_unique_board_id_t retrieved_id;
+ pico_get_unique_board_id(&retrieved_id);
+ memcpy(raw_id, retrieved_id.id, COMMON_HAL_MCU_PROCESSOR_UID_LENGTH);
}
mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) {
diff --git a/ports/raspberrypi/common-hal/microcontroller/Processor.h b/ports/raspberrypi/common-hal/microcontroller/Processor.h
index b7c86e850..afb43f9bd 100644
--- a/ports/raspberrypi/common-hal/microcontroller/Processor.h
+++ b/ports/raspberrypi/common-hal/microcontroller/Processor.h
@@ -27,7 +27,9 @@
#ifndef MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H
-#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 16
+#include "src/rp2_common/pico_unique_id/include/pico/unique_id.h"
+
+#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH PICO_UNIQUE_BOARD_ID_SIZE_BYTES
#include "py/obj.h"
diff --git a/ports/raspberrypi/common-hal/microcontroller/__init__.c b/ports/raspberrypi/common-hal/microcontroller/__init__.c
index e454ffa1b..bfea8b2d9 100644
--- a/ports/raspberrypi/common-hal/microcontroller/__init__.c
+++ b/ports/raspberrypi/common-hal/microcontroller/__init__.c
@@ -35,12 +35,16 @@
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "shared-bindings/microcontroller/Processor.h"
+#include "supervisor/filesystem.h"
+#include "supervisor/port.h"
#include "supervisor/shared/safe_mode.h"
#include "supervisor/shared/translate.h"
#include "src/rp2040/hardware_structs/include/hardware/structs/sio.h"
#include "src/rp2_common/hardware_sync/include/hardware/sync.h"
+#include "hardware/watchdog.h"
+
void common_hal_mcu_delay_us(uint32_t delay) {
mp_hal_delay_us(delay);
}
@@ -66,8 +70,11 @@ void common_hal_mcu_enable_interrupts(void) {
asm volatile ("cpsie i" : : : "memory");
}
+static bool next_reset_to_bootloader = false;
+
void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
if (runmode == RUNMODE_BOOTLOADER) {
+ next_reset_to_bootloader = true;
} else {
}
if (runmode == RUNMODE_SAFE_MODE) {
@@ -76,10 +83,17 @@ void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
}
void common_hal_mcu_reset(void) {
+ filesystem_flush();
+ if (next_reset_to_bootloader) {
+ reset_to_bootloader();
+ } else {
+ reset_cpu();
+ }
}
// The singleton microcontroller.Processor object, bound to microcontroller.cpu
// It currently only has properties, and no state.
+#if CIRCUITPY_PROCESSOR_COUNT > 1
static const mcu_processor_obj_t processor0 = {
.base = {
.type = &mcu_processor_type,
@@ -92,7 +106,7 @@ static const mcu_processor_obj_t processor1 = {
},
};
-const mp_rom_obj_tuple_t common_hal_mcu_processor_obj = {
+const mp_rom_obj_tuple_t common_hal_multi_processor_obj = {
{&mp_type_tuple},
CIRCUITPY_PROCESSOR_COUNT,
{
@@ -100,6 +114,13 @@ const mp_rom_obj_tuple_t common_hal_mcu_processor_obj = {
MP_ROM_PTR(&processor1)
}
};
+#endif
+
+const mcu_processor_obj_t common_hal_mcu_processor_obj = {
+ .base = {
+ .type = &mcu_processor_type,
+ },
+};
#if CIRCUITPY_NVM && CIRCUITPY_INTERNAL_NVM_SIZE > 0
// The singleton nvm.ByteArray object.
@@ -112,6 +133,17 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = {
};
#endif
+#if CIRCUITPY_WATCHDOG
+// The singleton watchdog.WatchDogTimer object.
+watchdog_watchdogtimer_obj_t common_hal_mcu_watchdogtimer_obj = {
+ .base = {
+ .type = &watchdog_watchdogtimer_type,
+ },
+ .timeout = 0.0f,
+ .mode = WATCHDOGMODE_NONE,
+};
+#endif
+
// This maps MCU pin names to pin objects.
const mp_rom_map_elem_t mcu_pin_global_dict_table[TOTAL_GPIO_COUNT] = {
{ MP_ROM_QSTR(MP_QSTR_GPIO0), MP_ROM_PTR(&pin_GPIO0) },
diff --git a/ports/raspberrypi/common-hal/neopixel_write/__init__.c b/ports/raspberrypi/common-hal/neopixel_write/__init__.c
index 10462b5a3..561d438e2 100644
--- a/ports/raspberrypi/common-hal/neopixel_write/__init__.c
+++ b/ports/raspberrypi/common-hal/neopixel_write/__init__.c
@@ -29,6 +29,7 @@
#include "bindings/rp2pio/StateMachine.h"
#include "common-hal/rp2pio/StateMachine.h"
#include "shared-bindings/microcontroller/__init__.h"
+#include "shared-bindings/digitalio/DigitalInOut.h"
#include "supervisor/port.h"
@@ -89,7 +90,11 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
// Use a private deinit of the state machine that doesn't reset the pin.
rp2pio_statemachine_deinit(&state_machine, true);
+
+ // Reset the pin and release it from the PIO
gpio_init(digitalinout->pin->number);
+ common_hal_digitalio_digitalinout_switch_to_output((digitalio_digitalinout_obj_t*)digitalinout, false, DRIVE_MODE_PUSH_PULL);
+
// Update the next start.
next_start_raw_ticks = port_get_raw_ticks(NULL) + 1;
}
diff --git a/ports/raspberrypi/common-hal/os/__init__.c b/ports/raspberrypi/common-hal/os/__init__.c
index dcbd06e93..0df7653d3 100644
--- a/ports/raspberrypi/common-hal/os/__init__.c
+++ b/ports/raspberrypi/common-hal/os/__init__.c
@@ -30,6 +30,11 @@
#include "py/objtuple.h"
#include "py/qstr.h"
+#include "extmod/crypto-algorithms/sha256.h"
+
+#include "hardware/structs/rosc.h"
+
+#include <string.h>
STATIC const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
@@ -57,6 +62,64 @@ mp_obj_t common_hal_os_uname(void) {
return (mp_obj_t)&os_uname_info_obj;
}
+// NIST Special Publication 800-90B (draft) recommends several extractors,
+// including the SHA hash family and states that if the amount of entropy input
+// is twice the number of bits output from them, that output can be considered
+// essentially fully random. If every RANDOM_SAFETY_MARGIN bits from
+// `rosc_hw->randombit` have at least 1 bit of entropy, then this criterion is met.
+//
+// This works by seeding the `random_state` with plenty of random bits (SHA256
+// as entropy harvesting function), then using that state it as a counter input
+// (SHA256 as a CSPRNG), re-seeding at least every 256 blocks (8kB).
+//
+// In practice, `PractRand` doesn't detect any gross problems with the output
+// random numbers on samples of 1 to 8 megabytes, no matter the setting of
+// RANDOM_SAFETY_MARGIN. (it does detect "unusual" results from time to time,
+// as it will with any RNG)
+#define RANDOM_SAFETY_MARGIN (4)
+
+static BYTE random_state[SHA256_BLOCK_SIZE];
+static void seed_random_bits(BYTE out[SHA256_BLOCK_SIZE]) {
+ CRYAL_SHA256_CTX context;
+ sha256_init(&context);
+ for (int i=0; i<2*RANDOM_SAFETY_MARGIN; i++) {
+ for(int j=0; j<SHA256_BLOCK_SIZE; j++) {
+ out[j] = rosc_hw->randombit & 1;
+ for(int k=0; k<8; k++) {
+ out[j] = (out[j] << 1) ^ (rosc_hw->randombit & 1);
+ }
+ }
+ sha256_update(&context, out, SHA256_BLOCK_SIZE);
+ }
+ sha256_final(&context, out);
+}
+
+static void get_random_bits(BYTE out[SHA256_BLOCK_SIZE]) {
+ if (!random_state[0]++) {
+ seed_random_bits(random_state);
+ }
+ CRYAL_SHA256_CTX context;
+ sha256_init(&context);
+ sha256_update(&context, random_state, SHA256_BLOCK_SIZE);
+ sha256_final(&context, out);
+}
+
bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) {
- return false;
+#define ROSC_POWER_SAVE (1) // assume ROSC is not necessarily active all the time
+#if ROSC_POWER_SAVE
+ uint32_t old_rosc_ctrl = rosc_hw->ctrl;
+ rosc_hw->ctrl = (old_rosc_ctrl & ~ROSC_CTRL_ENABLE_BITS) | (ROSC_CTRL_ENABLE_VALUE_ENABLE << 12);
+#endif
+ while (length) {
+ size_t n = MIN(length, SHA256_BLOCK_SIZE);
+ BYTE sha_buf[SHA256_BLOCK_SIZE];
+ get_random_bits(sha_buf);
+ memcpy(buffer, sha_buf, n);
+ buffer += n;
+ length -= n;
+ }
+#if ROSC_POWER_SAVE
+ rosc_hw->ctrl = old_rosc_ctrl;
+#endif
+ return true;
}
diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.c b/ports/raspberrypi/common-hal/pwmio/PWMOut.c
index 567ec5ef5..00b461880 100644
--- a/ports/raspberrypi/common-hal/pwmio/PWMOut.c
+++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.c
@@ -39,12 +39,24 @@
#include "src/rp2_common/hardware_pwm/include/hardware/pwm.h"
uint32_t target_slice_frequencies[NUM_PWM_SLICES];
-uint32_t slice_fixed_frequency;
+uint32_t slice_variable_frequency;
#define CHANNELS_PER_SLICE 2
static uint32_t channel_use;
static uint32_t never_reset_channel;
+// Per the RP2040 datasheet:
+//
+// "A CC value of 0 will produce a 0% output, i.e. the output signal
+// is always low. A CC value of TOP + 1 (i.e. equal to the period, in
+// non-phase-correct mode) will produce a 100% output. For example, if
+// TOP is programmed to 254, the counter will have a period of 255
+// cycles, and CC values in the range of 0 to 255 inclusive will
+// produce duty cycles in the range 0% to 100% inclusive."
+//
+// So 65534 should be the maximum top value, and we'll set CC to be TOP+1 as appropriate.
+#define MAX_TOP 65534
+
static uint32_t _mask(uint8_t slice, uint8_t channel) {
return 1 << (slice * CHANNELS_PER_SLICE + channel);
}
@@ -76,7 +88,7 @@ void pwmout_reset(void) {
}
pwm_set_enabled(slice, false);
target_slice_frequencies[slice] = 0;
- slice_fixed_frequency &= ~(1 << slice);
+ slice_variable_frequency &= ~(1 << slice);
}
}
@@ -107,8 +119,8 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
if (variable_frequency) {
return PWMOUT_ALL_TIMERS_ON_PIN_IN_USE;
}
- // If the other user wants to change frequency then we can't share either.
- if ((slice_fixed_frequency & (1 << slice)) != 0) {
+ // If the other user wants a variable frequency then we can't share either.
+ if ((slice_variable_frequency & (1 << slice)) != 0) {
return PWMOUT_ALL_TIMERS_ON_PIN_IN_USE;
}
// If we're both fixed frequency but we don't match target frequencies then we can't share.
@@ -118,9 +130,10 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
}
self->slice = slice;
self->channel = channel;
+
channel_use |= channel_use_mask;
- if (!variable_frequency) {
- slice_fixed_frequency |= 1 << slice;
+ if (variable_frequency) {
+ slice_variable_frequency |= 1 << slice;
}
if (target_slice_frequencies[slice] != frequency) {
@@ -153,7 +166,7 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) {
uint32_t slice_mask = ((1 << CHANNELS_PER_SLICE) - 1) << (self->slice * CHANNELS_PER_SLICE + self->channel);
if ((channel_use & slice_mask) == 0) {
target_slice_frequencies[self->slice] = 0;
- slice_fixed_frequency &= ~(1 << self->slice);
+ slice_variable_frequency &= ~(1 << self->slice);
pwm_set_enabled(self->slice, false);
}
@@ -163,14 +176,30 @@ void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) {
extern void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) {
self->duty_cycle = duty;
- uint16_t actual_duty = duty * self->top / ((1 << 16) - 1);
- pwm_set_chan_level(self->slice, self->channel, actual_duty);
+ // Do arithmetic in 32 bits to prevent overflow.
+ uint16_t compare_count;
+ if (duty == 65535) {
+ // Ensure that 100% duty cycle is 100% full on and not rounded down,
+ // but do MIN() to keep value in range, just in case.
+ compare_count = MIN(UINT16_MAX, (uint32_t) self->top + 1);
+ } else {
+ compare_count= ((uint32_t) duty * self->top + MAX_TOP / 2) / MAX_TOP;
+ }
+ // 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);
}
uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) {
return self->duty_cycle;
}
+void pwmio_pwmout_set_top(pwmio_pwmout_obj_t* self, uint16_t top) {
+ self->actual_frequency = common_hal_mcu_processor_get_frequency() / top;
+ self->top = top;
+ pwm_set_clkdiv_int_frac(self->slice, 1, 0);
+ pwm_set_wrap(self->slice, self->top);
+}
+
void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency) {
if (frequency == 0 || frequency > (common_hal_mcu_processor_get_frequency() / 2)) {
mp_raise_ValueError(translate("Invalid PWM frequency"));
@@ -179,7 +208,7 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t fr
target_slice_frequencies[self->slice] = frequency;
// For low frequencies use the divider to give us full resolution duty_cycle.
- if (frequency < (common_hal_mcu_processor_get_frequency() / (1 << 16))) {
+ if (frequency <= (common_hal_mcu_processor_get_frequency() / (1 << 16))) {
// Compute the divisor. It's an 8 bit integer and 4 bit fraction. Therefore,
// we compute everything * 16 for the fractional part.
// This is 1 << 12 because 4 bits are the * 16.
@@ -193,16 +222,17 @@ void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t fr
if (div16 >= (1 << 12)) {
div16 = (1 << 12) - 1;
}
- self->actual_frequency = frequency16 / div16;
- self->top = 1 << 16;
+ self->actual_frequency = (frequency16 + (div16 / 2)) / div16;
+ self->top = MAX_TOP;
pwm_set_clkdiv_int_frac(self->slice, div16 / 16, div16 % 16);
- pwm_set_wrap(self->slice, self->top - 1);
+ pwm_set_wrap(self->slice, self->top);
} else {
uint32_t top = common_hal_mcu_processor_get_frequency() / frequency;
self->actual_frequency = common_hal_mcu_processor_get_frequency() / top;
- self->top = top;
+ self->top = MIN(MAX_TOP, top);
pwm_set_clkdiv_int_frac(self->slice, 1, 0);
- pwm_set_wrap(self->slice, self->top - 1);
+ // Set TOP register. For 100% duty cycle, CC must be set to TOP+1.
+ pwm_set_wrap(self->slice, self->top);
}
common_hal_pwmio_pwmout_set_duty_cycle(self, self->duty_cycle);
}
diff --git a/ports/raspberrypi/common-hal/pwmio/PWMOut.h b/ports/raspberrypi/common-hal/pwmio/PWMOut.h
index 50f84777b..0070e188b 100644
--- a/ports/raspberrypi/common-hal/pwmio/PWMOut.h
+++ b/ports/raspberrypi/common-hal/pwmio/PWMOut.h
@@ -39,9 +39,11 @@ typedef struct {
bool variable_frequency;
uint16_t duty_cycle;
uint32_t actual_frequency;
- uint32_t top;
+ uint16_t top;
} pwmio_pwmout_obj_t;
void pwmout_reset(void);
+// Private API for AudioPWMOut.
+void pwmio_pwmout_set_top(pwmio_pwmout_obj_t* self, uint16_t top);
#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PWMIO_PWMOUT_H
diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c
index 6510410b0..90c48130e 100644
--- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c
@@ -546,15 +546,23 @@ static bool _transfer(rp2pio_statemachine_obj_t *self,
size_t tx_remaining = out_len;
while (rx_remaining || tx_remaining) {
- if (tx_remaining && !pio_sm_is_tx_fifo_full(self->pio, self->state_machine)) {
- *tx_destination = *data_out;
- data_out++;
- --tx_remaining;
- }
- if (rx_remaining && !pio_sm_is_rx_fifo_empty(self->pio, self->state_machine)) {
- *data_in = (uint8_t) *rx_source;
- data_in++;
- --rx_remaining;
+ for (int i=0; i<32; i++) {
+ bool did_transfer = false;
+ if (tx_remaining && !pio_sm_is_tx_fifo_full(self->pio, self->state_machine)) {
+ *tx_destination = *data_out;
+ data_out++;
+ --tx_remaining;
+ did_transfer = true;
+ }
+ if (rx_remaining && !pio_sm_is_rx_fifo_empty(self->pio, self->state_machine)) {
+ *data_in = (uint8_t) *rx_source;
+ data_in++;
+ --rx_remaining;
+ did_transfer = true;
+ }
+ if (!did_transfer) {
+ break;
+ }
}
RUN_BACKGROUND_TASKS;
if (mp_hal_is_interrupted()) {
diff --git a/ports/raspberrypi/common-hal/rtc/RTC.c b/ports/raspberrypi/common-hal/rtc/RTC.c
new file mode 100644
index 000000000..89c23fc19
--- /dev/null
+++ b/ports/raspberrypi/common-hal/rtc/RTC.c
@@ -0,0 +1,81 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright 2020 microDev
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#include "shared-bindings/rtc/RTC.h"
+
+#include <sys/time.h>
+
+#include "py/runtime.h"
+#include "src/rp2_common/hardware_rtc/include/hardware/rtc.h"
+
+void common_hal_rtc_init(void) {
+ rtc_init();
+}
+
+void common_hal_rtc_get_time(timeutils_struct_time_t *tm) {
+ datetime_t t;
+ rtc_get_datetime(&t);
+
+ tm->tm_year = t.year;
+ tm->tm_mon = t.month;
+ tm->tm_mday = t.day;
+ tm->tm_wday = t.dotw;
+ tm->tm_hour = t.hour;
+ tm->tm_min = t.min;
+ tm->tm_sec = t.sec;
+
+ if (tm->tm_wday == 0) {
+ tm->tm_wday = 6;
+ } else {
+ tm->tm_wday-=1;
+ }
+}
+
+void common_hal_rtc_set_time(timeutils_struct_time_t *tm) {
+ if (tm->tm_wday == 6) {
+ tm->tm_wday = 0;
+ } else {
+ tm->tm_wday+=1;
+ }
+
+ datetime_t t = {
+ .year = tm->tm_year,
+ .month = tm->tm_mon,
+ .day = tm->tm_mday,
+ .dotw = tm->tm_wday,
+ .hour = tm->tm_hour,
+ .min = tm->tm_min,
+ .sec = tm->tm_sec
+ };
+ rtc_set_datetime(&t);
+}
+
+int common_hal_rtc_get_calibration(void) {
+ return 0;
+}
+
+void common_hal_rtc_set_calibration(int calibration) {
+ mp_raise_NotImplementedError(translate("RTC calibration is not supported on this board"));
+}
diff --git a/ports/raspberrypi/common-hal/rtc/RTC.h b/ports/raspberrypi/common-hal/rtc/RTC.h
new file mode 100644
index 000000000..426a4ec7a
--- /dev/null
+++ b/ports/raspberrypi/common-hal/rtc/RTC.h
@@ -0,0 +1,32 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020 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_RASPBERRYPI_COMMON_HAL_RTC_RTC_H
+#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_RTC_RTC_H
+
+extern void common_hal_rtc_init(void);
+
+#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_RTC_RTC_H
diff --git a/ports/raspberrypi/common-hal/rtc/__init__.c b/ports/raspberrypi/common-hal/rtc/__init__.c
new file mode 100644
index 000000000..f5e6b6bdd
--- /dev/null
+++ b/ports/raspberrypi/common-hal/rtc/__init__.c
@@ -0,0 +1 @@
+// No RTC module functions
diff --git a/ports/raspberrypi/common-hal/supervisor/Runtime.c b/ports/raspberrypi/common-hal/supervisor/Runtime.c
index 6be38f216..974f26cec 100755
--- a/ports/raspberrypi/common-hal/supervisor/Runtime.c
+++ b/ports/raspberrypi/common-hal/supervisor/Runtime.c
@@ -28,10 +28,10 @@
#include "shared-bindings/supervisor/Runtime.h"
#include "supervisor/serial.h"
-bool common_hal_get_serial_connected(void) {
+bool common_hal_supervisor_runtime_get_serial_connected(void) {
return (bool) serial_connected();
}
-bool common_hal_get_serial_bytes_available(void) {
+bool common_hal_supervisor_runtime_get_serial_bytes_available(void) {
return (bool) serial_bytes_available();
}
diff --git a/ports/raspberrypi/common-hal/watchdog/WatchDogMode.c b/ports/raspberrypi/common-hal/watchdog/WatchDogMode.c
new file mode 100644
index 000000000..fc4e0e008
--- /dev/null
+++ b/ports/raspberrypi/common-hal/watchdog/WatchDogMode.c
@@ -0,0 +1 @@
+// No watchdog module functions.
diff --git a/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c b/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
new file mode 100644
index 000000000..f23ccda77
--- /dev/null
+++ b/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.c
@@ -0,0 +1,83 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020 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 "common-hal/watchdog/WatchDogTimer.h"
+
+#include "shared-bindings/watchdog/__init__.h"
+#include "shared-bindings/microcontroller/__init__.h"
+
+#include "src/rp2_common/hardware_watchdog/include/hardware/watchdog.h"
+
+void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) {
+ watchdog_update();
+}
+
+void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) {
+ if (self->mode == WATCHDOGMODE_RESET) {
+ mp_raise_RuntimeError(translate("WatchDogTimer cannot be deinitialized once mode is set to RESET"));
+ } else {
+ self->mode = WATCHDOGMODE_NONE;
+ }
+}
+
+/*
+void watchdog_reset(void) {
+ common_hal_watchdog_deinit(&common_hal_mcu_watchdogtimer_obj);
+}
+*/
+
+mp_float_t common_hal_watchdog_get_timeout(watchdog_watchdogtimer_obj_t *self) {
+ return self->timeout;
+}
+
+void common_hal_watchdog_set_timeout(watchdog_watchdogtimer_obj_t *self, mp_float_t new_timeout) {
+ // max timeout is 8.388607 sec
+ // this is rounded down to 8.388 sec
+ uint64_t timeout = new_timeout * 1000;
+ if (timeout > 8388) {
+ mp_raise_ValueError(translate("timeout duration exceeded the maximum supported value"));
+ }
+ if ((uint16_t)self->timeout != timeout) {
+ watchdog_enable(timeout, false);
+ self->timeout = new_timeout;
+ }
+}
+
+watchdog_watchdogmode_t common_hal_watchdog_get_mode(watchdog_watchdogtimer_obj_t *self) {
+ return self->mode;
+}
+
+void common_hal_watchdog_set_mode(watchdog_watchdogtimer_obj_t *self, watchdog_watchdogmode_t new_mode) {
+ if (self->mode != new_mode) {
+ if (new_mode == WATCHDOGMODE_RAISE) {
+ mp_raise_NotImplementedError(translate("RAISE mode is not implemented"));
+ } else if (new_mode == WATCHDOGMODE_NONE) {
+ common_hal_watchdog_deinit(self);
+ }
+ self->mode = new_mode;
+ }
+}
diff --git a/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.h b/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.h
new file mode 100644
index 000000000..ec1e2f659
--- /dev/null
+++ b/ports/raspberrypi/common-hal/watchdog/WatchDogTimer.h
@@ -0,0 +1,43 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020 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_RASPBERRYPI_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H
+#define MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H
+
+#include "py/obj.h"
+#include "shared-bindings/watchdog/WatchDogMode.h"
+#include "shared-bindings/watchdog/WatchDogTimer.h"
+
+struct _watchdog_watchdogtimer_obj_t {
+ mp_obj_base_t base;
+ mp_float_t timeout;
+ watchdog_watchdogmode_t mode;
+};
+
+// This needs to be called in order to disable the watchdog
+// void watchdog_reset(void);
+
+#endif // MICROPY_INCLUDED_RASPBERRYPI_COMMON_HAL_WATCHDOG_WATCHDOGTIMER_H
diff --git a/ports/raspberrypi/common-hal/watchdog/__init__.c b/ports/raspberrypi/common-hal/watchdog/__init__.c
new file mode 100644
index 000000000..fc4e0e008
--- /dev/null
+++ b/ports/raspberrypi/common-hal/watchdog/__init__.c
@@ -0,0 +1 @@
+// No watchdog module functions.
diff --git a/ports/raspberrypi/link.ld b/ports/raspberrypi/link.ld
index d642fd680..b83299dee 100644
--- a/ports/raspberrypi/link.ld
+++ b/ports/raspberrypi/link.ld
@@ -59,12 +59,11 @@ SECTIONS
*/
.text : {
- __reset_start = .;
- KEEP (*(.reset))
- . = ALIGN(256);
- __reset_end = .;
- ASSERT(__reset_end - __reset_start == 256, "ERROR: reset section should only be 256 bytes");
+ __logical_binary_start = .;
KEEP (*(.vectors))
+ KEEP (*(.binary_info_header))
+ __binary_info_header_end = .;
+ KEEP (*(.reset))
/* TODO revisit this now memset/memcpy/float in ROM */
/* bit of a hack right now to exclude all floating point and time critical (e.g. memset, memcpy) code from
* FLASH ... we will include any thing excluded here in .data below by default */
@@ -246,5 +245,7 @@ SECTIONS
/* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed")
+
+ ASSERT( __binary_info_header_end - __logical_binary_start <= 256, "Binary info must be in first 256 bytes of the binary")
/* todo assert on extra code */
}
diff --git a/ports/raspberrypi/mpconfigport.h b/ports/raspberrypi/mpconfigport.h
index b1165a3ba..eb0754e38 100644
--- a/ports/raspberrypi/mpconfigport.h
+++ b/ports/raspberrypi/mpconfigport.h
@@ -27,6 +27,8 @@
#ifndef __INCLUDED_MPCONFIGPORT_H
#define __INCLUDED_MPCONFIGPORT_H
+#include "src/rp2040/hardware_regs/include/hardware/platform_defs.h"
+
#define MICROPY_PY_SYS_PLATFORM "RP2040"
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
@@ -40,10 +42,9 @@
// This also includes mpconfigboard.h.
#include "py/circuitpy_mpconfig.h"
-//#include "peripherals/samd/dma.h"
-
#define MICROPY_PORT_ROOT_POINTERS \
- CIRCUITPY_COMMON_ROOT_POINTERS \
- mp_obj_t counting;
+ mp_obj_t counting; \
+ mp_obj_t playing_audio[NUM_DMA_CHANNELS]; \
+ CIRCUITPY_COMMON_ROOT_POINTERS;
#endif // __INCLUDED_MPCONFIGPORT_H
diff --git a/ports/raspberrypi/mpconfigport.mk b/ports/raspberrypi/mpconfigport.mk
index 15e17cd6f..dc0c85b68 100644
--- a/ports/raspberrypi/mpconfigport.mk
+++ b/ports/raspberrypi/mpconfigport.mk
@@ -24,23 +24,30 @@ CIRCUITPY_NEOPIXEL_WRITE = 0
endif
CIRCUITPY_FULL_BUILD = 1
+CIRCUITPY_BITOPS = 1
CIRCUITPY_PWMIO = 1
# Things that need to be implemented.
-CIRCUITPY_AUDIOBUSIO = 0 # Use PIO interally for I2S
-CIRCUITPY_AUDIOMP3 = 0
CIRCUITPY_FREQUENCYIO = 0 # Use PWM interally
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_NVM = 0
CIRCUITPY_PULSEIO = 0 # Use PIO interally
CIRCUITPY_ROTARYIO = 0 # Use PIO interally
-CIRCUITPY_RTC = 0
+CIRCUITPY_WATCHDOG = 1
-# Things that are unsupported by the hardware.
+# Audio via PWM
CIRCUITPY_AUDIOIO = 0
+CIRCUITPY_AUDIOBUSIO ?= 0 # add this later
+CIRCUITPY_AUDIOCORE ?= 1
+CIRCUITPY_AUDIOPWMIO ?= 1
+
+# These libraries require Cortex M4+ for fancy math instructions.
+CIRCUITPY_AUDIOMIXER ?= 0
+CIRCUITPY_AUDIOMP3 ?= 0
INTERNAL_LIBM = 1
-USB_SERIAL_NUMBER_LENGTH = 32
+USB_SERIAL_NUMBER_LENGTH = 16
+# Number of USB endpoint pairs.
USB_NUM_EP = 8
diff --git a/ports/raspberrypi/sdk b/ports/raspberrypi/sdk
-Subproject 26653ea81e340cacee55025d110c3e014a252a8
+Subproject 55346c953012ef5b32f392fea3b42814db8df2a
diff --git a/ports/raspberrypi/supervisor/internal_flash.c b/ports/raspberrypi/supervisor/internal_flash.c
index d333830de..e8ee5cf1a 100644
--- a/ports/raspberrypi/supervisor/internal_flash.c
+++ b/ports/raspberrypi/supervisor/internal_flash.c
@@ -44,10 +44,7 @@
#include "src/rp2_common/hardware_flash/include/hardware/flash.h"
#include "src/common/pico_binary_info/include/pico/binary_info.h"
-#define RESERVED_FLASH 1 * 1024 * 1024
-
-// TODO: Parameterize flash size based on the configured flash.
-#define TOTAL_FLASH_SIZE 2 * 1024 * 1024
+#define RESERVED_FLASH (1 * 1024 * 1024)
// TODO: Split the caching out of supervisor/shared/external_flash so we can use it.
#define SECTOR_SIZE 4096
diff --git a/ports/raspberrypi/supervisor/port.c b/ports/raspberrypi/supervisor/port.c
index b2f73c7b4..36d2e8275 100644
--- a/ports/raspberrypi/supervisor/port.c
+++ b/ports/raspberrypi/supervisor/port.c
@@ -32,6 +32,7 @@
#include "bindings/rp2pio/StateMachine.h"
#include "genhdr/mpversion.h"
+#include "shared-bindings/audiopwmio/PWMAudioOut.h"
#include "shared-bindings/busio/I2C.h"
#include "shared-bindings/busio/SPI.h"
#include "shared-bindings/microcontroller/__init__.h"
@@ -52,6 +53,8 @@
#include "tusb.h"
+#include "pico/bootrom.h"
+#include "hardware/watchdog.h"
extern volatile bool mp_msc_enabled;
@@ -94,25 +97,37 @@ void reset_port(void) {
reset_spi();
#endif
+ #if CIRCUITPY_PWMIO
+ pwmout_reset();
+ #endif
+
#if CIRCUITPY_RP2PIO
reset_rp2pio_statemachine();
#endif
- #if CIRCUITPY_PWMIO
- pwmout_reset();
+ #if CIRCUITPY_RTC
+ rtc_reset();
+ #endif
+
+ #if CIRCUITPY_AUDIOPWMIO
+ audiopwmout_reset();
#endif
reset_all_pins();
}
void reset_to_bootloader(void) {
- // reset();
+ reset_usb_boot(0, 0);
while (true) {}
}
void reset_cpu(void) {
- // reset();
- while (true) {}
+ watchdog_reboot(0, SRAM_END, 0);
+ watchdog_start_tick(12);
+
+ while (true) {
+ __wfi();
+ }
}
bool port_has_fixed_stack(void) {
diff --git a/ports/stm/boards/espruino_pico/mpconfigboard.mk b/ports/stm/boards/espruino_pico/mpconfigboard.mk
index 81c3772e7..6d45769f2 100644
--- a/ports/stm/boards/espruino_pico/mpconfigboard.mk
+++ b/ports/stm/boards/espruino_pico/mpconfigboard.mk
@@ -21,5 +21,6 @@ LD_FILE = boards/STM32F401xd_fs.ld
# meantime
CIRCUITPY_ULAB = 0
CIRCUITPY_BUSDEVICE = 0
+CIRCUITPY_FRAMEBUFFERIO = 0
SUPEROPT_GC = 0
diff --git a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk
index c99eb1a00..28874f9c6 100644
--- a/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk
+++ b/ports/stm/boards/stm32f412zg_discovery/mpconfigboard.mk
@@ -16,5 +16,3 @@ MCU_PACKAGE = LQFP144
LD_COMMON = boards/common_default.ld
LD_FILE = boards/STM32F412_fs.ld
-
-CIRCUITPY_USB_HID = 1
diff --git a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk
index a2e1da101..4436f04b7 100644
--- a/ports/stm/boards/thunderpack_v12/mpconfigboard.mk
+++ b/ports/stm/boards/thunderpack_v12/mpconfigboard.mk
@@ -2,7 +2,9 @@ USB_VID = 0x239A
USB_PID = 0x8071
USB_PRODUCT = "Thunderpack STM32F411"
USB_MANUFACTURER = "Jeremy Gillick"
-USB_DEVICES = "CDC,MSC"
+
+# Turn off HID devices
+CIRCUITPY_USB_HID = 0
LONGINT_IMPL = NONE
diff --git a/ports/stm/common-hal/busio/I2C.c b/ports/stm/common-hal/busio/I2C.c
index de69da211..7726b5e87 100644
--- a/ports/stm/common-hal/busio/I2C.c
+++ b/ports/stm/common-hal/busio/I2C.c
@@ -61,6 +61,7 @@ STATIC bool never_reset_i2c[MAX_I2C];
#define ALL_CLOCKS 0xFF
STATIC void i2c_clock_enable(uint8_t mask);
STATIC void i2c_clock_disable(uint8_t mask);
+STATIC void i2c_assign_irq(busio_i2c_obj_t *self, I2C_TypeDef * I2Cx);
void i2c_reset(void) {
uint16_t never_reset_mask = 0x00;
@@ -136,6 +137,10 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
i2c_clock_enable(1 << (self->sda->periph_index - 1));
reserved_i2c[self->sda->periph_index - 1] = true;
+ // Create root pointer and assign IRQ
+ MP_STATE_PORT(cpy_i2c_obj_all)[self->sda->periph_index - 1] = self;
+ i2c_assign_irq(self, I2Cx);
+
// Handle the HAL handle differences
#if (CPY_STM32H7 || CPY_STM32F7)
if (frequency == 400000) {
@@ -163,6 +168,13 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
}
common_hal_mcu_pin_claim(sda);
common_hal_mcu_pin_claim(scl);
+
+ self->frame_in_prog = false;
+
+ //start the receive interrupt chain
+ HAL_NVIC_DisableIRQ(self->irq); //prevent handle lock contention
+ HAL_NVIC_SetPriority(self->irq, 1, 0);
+ HAL_NVIC_EnableIRQ(self->irq);
}
void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) {
@@ -229,15 +241,46 @@ void common_hal_busio_i2c_unlock(busio_i2c_obj_t *self) {
uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr,
const uint8_t *data, size_t len, bool transmit_stop_bit) {
- HAL_StatusTypeDef result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1),
+ HAL_StatusTypeDef result;
+ if (!transmit_stop_bit) {
+ uint32_t xfer_opt;
+ if (!self->frame_in_prog) {
+ xfer_opt = I2C_FIRST_FRAME;
+ } else {
+ // handle rare possibility of multiple restart writes in a row
+ xfer_opt = I2C_NEXT_FRAME;
+ }
+ result = HAL_I2C_Master_Seq_Transmit_IT(&(self->handle),
+ (uint16_t)(addr << 1), (uint8_t *)data,
+ (uint16_t)len, xfer_opt);
+ while (HAL_I2C_GetState(&(self->handle)) != HAL_I2C_STATE_READY)
+ {
+ RUN_BACKGROUND_TASKS;
+ }
+ self->frame_in_prog = true;
+ } else {
+ result = HAL_I2C_Master_Transmit(&(self->handle), (uint16_t)(addr << 1),
(uint8_t *)data, (uint16_t)len, 500);
+ }
return result == HAL_OK ? 0 : MP_EIO;
}
uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr,
uint8_t *data, size_t len) {
- return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500)
+ if (!self->frame_in_prog) {
+ return HAL_I2C_Master_Receive(&(self->handle), (uint16_t)(addr<<1), data, (uint16_t)len, 500)
== HAL_OK ? 0 : MP_EIO;
+ } else {
+ HAL_StatusTypeDef result = HAL_I2C_Master_Seq_Receive_IT(&(self->handle),
+ (uint16_t)(addr << 1), (uint8_t *)data,
+ (uint16_t)len, I2C_LAST_FRAME);
+ while (HAL_I2C_GetState(&(self->handle)) != HAL_I2C_STATE_READY)
+ {
+ RUN_BACKGROUND_TASKS;
+ }
+ self->frame_in_prog = false;
+ return result;
+ }
}
STATIC void i2c_clock_enable(uint8_t mask) {
@@ -294,3 +337,48 @@ STATIC void i2c_clock_disable(uint8_t mask) {
}
#endif
}
+
+STATIC void i2c_assign_irq(busio_i2c_obj_t *self, I2C_TypeDef * I2Cx) {
+ #ifdef I2C1
+ if (I2Cx == I2C1) {
+ self->irq = I2C1_EV_IRQn;
+ }
+ #endif
+ #ifdef I2C2
+ if (I2Cx == I2C2) {
+ self->irq = I2C2_EV_IRQn;
+ }
+ #endif
+ #ifdef I2C3
+ if (I2Cx == I2C3) {
+ self->irq = I2C3_EV_IRQn;
+ }
+ #endif
+ #ifdef I2C4
+ if (I2Cx == I2C4) {
+ self->irq = I2C4_EV_IRQn;
+ }
+ #endif
+}
+
+STATIC void call_hal_irq(int i2c_num) {
+ //Create casted context pointer
+ busio_i2c_obj_t * context = (busio_i2c_obj_t*)MP_STATE_PORT(cpy_i2c_obj_all)[i2c_num - 1];
+ if (context != NULL) {
+ HAL_NVIC_ClearPendingIRQ(context->irq);
+ HAL_I2C_EV_IRQHandler(&context->handle);
+ }
+}
+
+void I2C1_EV_IRQHandler(void) {
+ call_hal_irq(1);
+}
+void I2C2_EV_IRQHandler(void) {
+ call_hal_irq(2);
+}
+void I2C3_EV_IRQHandler(void) {
+ call_hal_irq(3);
+}
+void I2C4_EV_IRQHandler(void) {
+ call_hal_irq(4);
+}
diff --git a/ports/stm/common-hal/busio/I2C.h b/ports/stm/common-hal/busio/I2C.h
index 5ca2854eb..687e6a8c4 100644
--- a/ports/stm/common-hal/busio/I2C.h
+++ b/ports/stm/common-hal/busio/I2C.h
@@ -37,6 +37,8 @@
typedef struct {
mp_obj_base_t base;
I2C_HandleTypeDef handle;
+ IRQn_Type irq;
+ bool frame_in_prog;
bool has_lock;
const mcu_periph_obj_t *scl;
const mcu_periph_obj_t *sda;
diff --git a/ports/stm/common-hal/supervisor/Runtime.c b/ports/stm/common-hal/supervisor/Runtime.c
index ea663f897..974f26cec 100755
--- a/ports/stm/common-hal/supervisor/Runtime.c
+++ b/ports/stm/common-hal/supervisor/Runtime.c
@@ -28,10 +28,10 @@
#include "shared-bindings/supervisor/Runtime.h"
#include "supervisor/serial.h"
-bool common_hal_get_serial_connected(void) {
+bool common_hal_supervisor_runtime_get_serial_connected(void) {
return (bool) serial_connected();
}
-bool common_hal_get_serial_bytes_available(void) {
- return (bool) serial_bytes_available();
+bool common_hal_supervisor_runtime_get_serial_bytes_available(void) {
+ return (bool) serial_bytes_available();
}
diff --git a/ports/stm/mpconfigport.h b/ports/stm/mpconfigport.h
index 7cdab04f6..3f64e6565 100644
--- a/ports/stm/mpconfigport.h
+++ b/ports/stm/mpconfigport.h
@@ -52,10 +52,14 @@ extern uint8_t _ld_default_stack_size;
#define BOARD_NO_VBUS_SENSE (0)
#endif
-#define MAX_UART 10 //how many UART are implemented
+// Peripheral implementation counts
+#define MAX_UART 10
+#define MAX_I2C 4
+#define MAX_SPI 6
#define MICROPY_PORT_ROOT_POINTERS \
void *cpy_uart_obj_all[MAX_UART]; \
+ void *cpy_i2c_obj_all[MAX_I2C]; \
CIRCUITPY_COMMON_ROOT_POINTERS
#endif // __INCLUDED_MPCONFIGPORT_H
diff --git a/ports/stm/mpconfigport.mk b/ports/stm/mpconfigport.mk
index bcecaa517..fe257fc50 100644
--- a/ports/stm/mpconfigport.mk
+++ b/ports/stm/mpconfigport.mk
@@ -8,6 +8,7 @@ ifeq ($(MCU_VARIANT),STM32F405xx)
CIRCUITPY_FRAMEBUFFERIO ?= 1
CIRCUITPY_RGBMATRIX ?= 1
CIRCUITPY_SDIOIO ?= 1
+ # Number of USB endpoint pairs.
USB_NUM_EP = 4
endif
@@ -23,6 +24,8 @@ ifeq ($(MCU_SERIES),F4)
CIRCUITPY_RTC ?= 0
CIRCUITPY_USB_MIDI ?= 0
CIRCUITPY_USB_HID ?= 0
+
+ USB_NUM_EP = 4
endif
ifeq ($(MCU_SERIES),H7)
@@ -40,6 +43,8 @@ ifeq ($(MCU_SERIES),H7)
CIRCUITPY_RTC ?= 0
CIRCUITPY_USB_HID ?= 0
CIRCUITPY_USB_MIDI ?= 0
+
+ USB_NUM_EP = 9
endif
ifeq ($(MCU_SERIES),F7)
@@ -56,4 +61,6 @@ ifeq ($(MCU_SERIES),F7)
CIRCUITPY_RTC ?= 0
CIRCUITPY_USB_HID ?= 0
CIRCUITPY_USB_MIDI ?= 0
+
+ USB_NUM_EP = 6
endif
diff --git a/py/builtinevex.c b/py/builtinevex.c
index ade12d39d..cff57c413 100644
--- a/py/builtinevex.c
+++ b/py/builtinevex.c
@@ -132,17 +132,18 @@ STATIC mp_obj_t eval_exec_helper(size_t n_args, const mp_obj_t *args, mp_parse_i
}
#endif
- size_t str_len;
- const char *str = mp_obj_str_get_data(args[0], &str_len);
+ // Extract the source code.
+ mp_buffer_info_t bufinfo;
+ mp_get_buffer_raise(args[0], &bufinfo, MP_BUFFER_READ);
// create the lexer
// MP_PARSE_SINGLE_INPUT is used to indicate a file input
mp_lexer_t *lex;
if (MICROPY_PY_BUILTINS_EXECFILE && parse_input_kind == MP_PARSE_SINGLE_INPUT) {
- lex = mp_lexer_new_from_file(str);
+ lex = mp_lexer_new_from_file(bufinfo.buf);
parse_input_kind = MP_PARSE_FILE_INPUT;
} else {
- lex = mp_lexer_new_from_str_len(MP_QSTR__lt_string_gt_, str, str_len, 0);
+ lex = mp_lexer_new_from_str_len(MP_QSTR__lt_string_gt_, bufinfo.buf, bufinfo.len, 0);
}
return mp_parse_compile_execute(lex, parse_input_kind, globals, locals);
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk
index 3ce7c0117..943c99f93 100644
--- a/py/circuitpy_defns.mk
+++ b/py/circuitpy_defns.mk
@@ -139,6 +139,9 @@ endif
ifeq ($(CIRCUITPY_BITBANG_APA102),1)
SRC_PATTERNS += bitbangio/SPI%
endif
+ifeq ($(CIRCUITPY_BITOPS),1)
+SRC_PATTERNS += bitops/%
+endif
ifeq ($(CIRCUITPY_BLEIO),1)
SRC_PATTERNS += _bleio/%
endif
@@ -286,12 +289,18 @@ endif
ifeq ($(CIRCUITPY_UHEAP),1)
SRC_PATTERNS += uheap/%
endif
+ifeq ($(CIRCUITPY_USB_CDC),1)
+SRC_PATTERNS += usb_cdc/%
+endif
ifeq ($(CIRCUITPY_USB_HID),1)
SRC_PATTERNS += usb_hid/%
endif
ifeq ($(CIRCUITPY_USB_MIDI),1)
SRC_PATTERNS += usb_midi/%
endif
+ifeq ($(CIRCUITPY_USB_VENDOR),1)
+SRC_PATTERNS += usb_vendor/%
+endif
ifeq ($(CIRCUITPY_USTACK),1)
SRC_PATTERNS += ustack/%
endif
@@ -388,6 +397,7 @@ SRC_COMMON_HAL_ALL = \
socketpool/Socket.c \
ssl/__init__.c \
ssl/SSLContext.c \
+ ssl/SSLSocket.c \
supervisor/Runtime.c \
supervisor/__init__.c \
watchdog/WatchDogMode.c \
@@ -462,6 +472,7 @@ SRC_SHARED_MODULE_ALL = \
bitbangio/OneWire.c \
bitbangio/SPI.c \
bitbangio/__init__.c \
+ bitops/__init__.c \
board/__init__.c \
adafruit_bus_device/__init__.c \
adafruit_bus_device/I2CDevice.c \
diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h
index ee23c7156..cbe668289 100644
--- a/py/circuitpy_mpconfig.h
+++ b/py/circuitpy_mpconfig.h
@@ -306,6 +306,14 @@ extern const struct _mp_obj_module_t bitbangio_module;
#define BITBANGIO_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;
@@ -736,6 +744,13 @@ extern const struct _mp_obj_module_t uheap_module;
#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 },
@@ -820,6 +835,7 @@ extern const struct _mp_obj_module_t msgpack_module;
AUDIOPWMIO_MODULE \
BINASCII_MODULE \
BITBANGIO_MODULE \
+ BITOPS_MODULE \
BLEIO_MODULE \
BOARD_MODULE \
BUSDEVICE_MODULE \
@@ -875,6 +891,7 @@ extern const struct _mp_obj_module_t msgpack_module;
SUPERVISOR_MODULE \
TOUCHIO_MODULE \
UHEAP_MODULE \
+ USB_CDC_MODULE \
USB_HID_MODULE \
USB_MIDI_MODULE \
USTACK_MODULE \
diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk
index b8fe73eea..ad6386636 100644
--- a/py/circuitpy_mpconfig.mk
+++ b/py/circuitpy_mpconfig.mk
@@ -89,9 +89,15 @@ CFLAGS += -DCIRCUITPY_AUDIOMP3=$(CIRCUITPY_AUDIOMP3)
CIRCUITPY_BINASCII ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_BINASCII=$(CIRCUITPY_BINASCII)
+CIRCUITPY_BITBANG_APA102 ?= 0
+CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102)
+
CIRCUITPY_BITBANGIO ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_BITBANGIO=$(CIRCUITPY_BITBANGIO)
+CIRCUITPY_BITOPS ?= 0
+CFLAGS += -DCIRCUITPY_BITOPS=$(CIRCUITPY_BITOPS)
+
# _bleio can be supported on most any board via HCI
CIRCUITPY_BLEIO_HCI ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_BLEIO_HCI=$(CIRCUITPY_BLEIO_HCI)
@@ -100,6 +106,9 @@ CFLAGS += -DCIRCUITPY_BLEIO_HCI=$(CIRCUITPY_BLEIO_HCI)
CIRCUITPY_BLEIO ?= $(CIRCUITPY_BLEIO_HCI)
CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO)
+CIRCUITPY_BLE_FILE_SERVICE ?= 0
+CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE)
+
CIRCUITPY_BOARD ?= 1
CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD)
@@ -127,6 +136,13 @@ CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO)
CIRCUITPY_DISPLAYIO ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_DISPLAYIO=$(CIRCUITPY_DISPLAYIO)
+CIRCUITPY_DUALBANK ?= 0
+CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK)
+
+# Enabled micropython.native decorator (experimental)
+CIRCUITPY_ENABLE_MPY_NATIVE ?= 0
+CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE)
+
CIRCUITPY_ERRNO ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_ERRNO=$(CIRCUITPY_ERRNO)
@@ -179,6 +195,9 @@ CFLAGS += -DCIRCUITPY_MEMORYMONITOR=$(CIRCUITPY_MEMORYMONITOR)
CIRCUITPY_MICROCONTROLLER ?= 1
CFLAGS += -DCIRCUITPY_MICROCONTROLLER=$(CIRCUITPY_MICROCONTROLLER)
+CIRCUITPY_MSGPACK ?= $(CIRCUITPY_FULL_BUILD)
+CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK)
+
CIRCUITPY_NEOPIXEL_WRITE ?= 1
CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE)
@@ -192,8 +211,8 @@ CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM)
CIRCUITPY_OS ?= 1
CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS)
-CIRCUITPY_DUALBANK ?= 0
-CFLAGS += -DCIRCUITPY_DUALBANK=$(CIRCUITPY_DUALBANK)
+CIRCUITPY_PEW ?= 0
+CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW)
CIRCUITPY_PIXELBUF ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_PIXELBUF=$(CIRCUITPY_PIXELBUF)
@@ -216,6 +235,20 @@ CFLAGS += -DCIRCUITPY_RANDOM=$(CIRCUITPY_RANDOM)
CIRCUITPY_RE ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_RE=$(CIRCUITPY_RE)
+CIRCUITPY_REPL_BLE ?= 0
+CFLAGS += -DCIRCUITPY_REPL_BLE=$(CIRCUITPY_REPL_BLE)
+
+CIRCUITPY_REPL_UART ?= 0
+CFLAGS += -DCIRCUITPY_REPL_UART=$(CIRCUITPY_REPL_UART)
+
+CIRCUITPY_REPL_USB ?= 1
+CFLAGS += -DCIRCUITPY_REPL_USB=$(CIRCUITPY_REPL_USB)
+
+# Should busio.I2C() check for pullups?
+# Some boards in combination with certain peripherals may not want this.
+CIRCUITPY_REQUIRE_I2C_PULLUPS ?= 1
+CFLAGS += -DCIRCUITPY_REQUIRE_I2C_PULLUPS=$(CIRCUITPY_REQUIRE_I2C_PULLUPS)
+
# CIRCUITPY_RP2PIO is handled in the raspberrypi tree.
# Only for rp2 chips.
# Assume not a rp2 build.
@@ -282,39 +315,53 @@ CFLAGS += -DCIRCUITPY_TOUCHIO=$(CIRCUITPY_TOUCHIO)
CIRCUITPY_UHEAP ?= 0
CFLAGS += -DCIRCUITPY_UHEAP=$(CIRCUITPY_UHEAP)
+# Secondary CDC is usually available if there are at least 8 endpoints.
+CIRCUITPY_USB_CDC ?= $(shell expr $(USB_NUM_EP) '>=' 8)
+CFLAGS += -DCIRCUITPY_USB_CDC=$(CIRCUITPY_USB_CDC)
+
CIRCUITPY_USB_HID ?= 1
CFLAGS += -DCIRCUITPY_USB_HID=$(CIRCUITPY_USB_HID)
-CIRCUITPY_USB_MIDI ?= 1
-CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI)
+CIRCUITPY_USB_HID_CONSUMER ?= 1
+CFLAGS += -DCIRCUITPY_USB_HID_CONSUMER=$(CIRCUITPY_USB_HID_CONSUMER)
-CIRCUITPY_PEW ?= 0
-CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW)
+CIRCUITPY_USB_HID_DIGITIZER ?= 0
+CFLAGS += -DCIRCUITPY_USB_HID_DIGITIZER=$(CIRCUITPY_USB_HID_DIGITIZER)
-# For debugging.
-CIRCUITPY_USTACK ?= 0
-CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK)
+CIRCUITPY_USB_HID_GAMEPAD ?= 1
+CFLAGS += -DCIRCUITPY_USB_HID_GAMEPAD=$(CIRCUITPY_USB_HID_GAMEPAD)
-# Non-module conditionals
+CIRCUITPY_USB_HID_KEYBOARD ?= 1
+CFLAGS += -DCIRCUITPY_USB_HID_KEYBOARD=$(CIRCUITPY_USB_HID_KEYBOARD)
-CIRCUITPY_BITBANG_APA102 ?= 0
-CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102)
+CIRCUITPY_USB_HID_MOUSE ?= 1
+CFLAGS += -DCIRCUITPY_USB_HID_MOUSE=$(CIRCUITPY_USB_HID_MOUSE)
-# Should busio.I2C() check for pullups?
-# Some boards in combination with certain peripherals may not want this.
-CIRCUITPY_REQUIRE_I2C_PULLUPS ?= 1
-CFLAGS += -DCIRCUITPY_REQUIRE_I2C_PULLUPS=$(CIRCUITPY_REQUIRE_I2C_PULLUPS)
+CIRCUITPY_USB_HID_SYS_CONTROL ?= 0
+CFLAGS += -DCIRCUITPY_USB_HID_SYS_CONTROL=$(CIRCUITPY_USB_HID_SYS_CONTROL)
-# REPL over BLE
-CIRCUITPY_SERIAL_BLE ?= 0
-CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE)
+CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD ?= 0
+CFLAGS += -DCIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD=$(CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD)
-CIRCUITPY_BLE_FILE_SERVICE ?= 0
-CFLAGS += -DCIRCUITPY_BLE_FILE_SERVICE=$(CIRCUITPY_BLE_FILE_SERVICE)
+CIRCUITPY_USB_MIDI ?= 1
+CFLAGS += -DCIRCUITPY_USB_MIDI=$(CIRCUITPY_USB_MIDI)
+
+CIRCUITPY_USB_MSC ?= 1
+CFLAGS += -DCIRCUITPY_USB_MSC=$(CIRCUITPY_USB_MSC)
+
+# Defaulting this to OFF initially because it has only been tested on a
+# limited number of platforms, and the other platforms do not have this
+# setting in their mpconfigport.mk and/or mpconfigboard.mk files yet.
+CIRCUITPY_USB_VENDOR ?= 0
+CFLAGS += -DCIRCUITPY_USB_VENDOR=$(CIRCUITPY_USB_VENDOR)
+
+ifndef USB_NUM_EP
+$(error "USB_NUM_EP (number of USB endpoint pairs)must be defined")
+endif
-# REPL over UART
-CIRCUITPY_SERIAL_UART ?= 0
-CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART)
+# For debugging.
+CIRCUITPY_USTACK ?= 0
+CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK)
# ulab numerics library
CIRCUITPY_ULAB ?= $(CIRCUITPY_FULL_BUILD)
@@ -326,10 +373,3 @@ CFLAGS += -DCIRCUITPY_WATCHDOG=$(CIRCUITPY_WATCHDOG)
CIRCUITPY_WIFI ?= 0
CFLAGS += -DCIRCUITPY_WIFI=$(CIRCUITPY_WIFI)
-
-# Enabled micropython.native decorator (experimental)
-CIRCUITPY_ENABLE_MPY_NATIVE ?= 0
-CFLAGS += -DCIRCUITPY_ENABLE_MPY_NATIVE=$(CIRCUITPY_ENABLE_MPY_NATIVE)
-
-CIRCUITPY_MSGPACK ?= $(CIRCUITPY_FULL_BUILD)
-CFLAGS += -DCIRCUITPY_MSGPACK=$(CIRCUITPY_MSGPACK)
diff --git a/py/obj.h b/py/obj.h
index 066562cc4..c3ab63b5c 100644
--- a/py/obj.h
+++ b/py/obj.h
@@ -684,6 +684,7 @@ mp_obj_t mp_obj_new_bytearray_by_ref(size_t n, void *items);
mp_obj_t mp_obj_new_int_from_float(mp_float_t val);
mp_obj_t mp_obj_new_complex(mp_float_t real, mp_float_t imag);
extern mp_float_t uint64_to_float(uint64_t ui64);
+extern uint64_t float_to_uint64(float f);
#endif
mp_obj_t mp_obj_new_exception(const mp_obj_type_t *exc_type);
mp_obj_t mp_obj_new_exception_arg1(const mp_obj_type_t *exc_type, mp_obj_t arg);
diff --git a/py/objarray.c b/py/objarray.c
index e0b4cbd55..9640f596a 100644
--- a/py/objarray.c
+++ b/py/objarray.c
@@ -238,6 +238,26 @@ STATIC mp_obj_t memoryview_make_new(const mp_obj_type_t *type_in, size_t n_args,
return MP_OBJ_FROM_PTR(self);
}
+
+#if MICROPY_CPYTHON_COMPAT
+STATIC mp_obj_t memoryview_cast(const mp_obj_t self_in, const mp_obj_t typecode_in) {
+ mp_obj_array_t *self = MP_OBJ_TO_PTR(self_in);
+ const char *typecode = mp_obj_str_get_str(typecode_in);
+ size_t element_size = mp_binary_get_size('@', typecode[0], NULL);
+ size_t bytelen = self->len * mp_binary_get_size('@', self->typecode & ~MP_OBJ_ARRAY_TYPECODE_FLAG_RW, NULL);
+ if (bytelen % element_size != 0) {
+ mp_raise_TypeError(translate("memoryview: length is not a multiple of itemsize"));
+ }
+ mp_obj_array_t *result = MP_OBJ_TO_PTR(mp_obj_new_memoryview(*typecode, bytelen / element_size, self->items));
+
+ // test if the object can be written to
+ if (self->typecode & MP_OBJ_ARRAY_TYPECODE_FLAG_RW) {
+ result->typecode |= MP_OBJ_ARRAY_TYPECODE_FLAG_RW; // indicate writable buffer
+ }
+ return MP_OBJ_FROM_PTR(result);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(memoryview_cast_obj, memoryview_cast);
+#endif
#endif
STATIC mp_obj_t array_unary_op(mp_unary_op_t op, mp_obj_t o_in) {
@@ -691,6 +711,15 @@ const mp_obj_type_t mp_type_bytearray = {
#endif
#if MICROPY_PY_BUILTINS_MEMORYVIEW
+
+#if MICROPY_CPYTHON_COMPAT
+STATIC const mp_rom_map_elem_t memoryview_locals_dict_table[] = {
+ { MP_ROM_QSTR(MP_QSTR_cast), MP_ROM_PTR(&memoryview_cast_obj) },
+};
+
+STATIC MP_DEFINE_CONST_DICT(memoryview_locals_dict, memoryview_locals_dict_table);
+#endif
+
const mp_obj_type_t mp_type_memoryview = {
{ &mp_type_type },
.name = MP_QSTR_memoryview,
@@ -700,6 +729,9 @@ const mp_obj_type_t mp_type_memoryview = {
.binary_op = array_binary_op,
.subscr = array_subscr,
.buffer_p = { .get_buffer = array_get_buffer },
+#if MICROPY_CPYTHON_COMPAT
+ .locals_dict = (mp_obj_dict_t*)&memoryview_locals_dict,
+#endif
};
#endif
diff --git a/py/objfloat.c b/py/objfloat.c
index 80f10e816..329a8b90e 100644
--- a/py/objfloat.c
+++ b/py/objfloat.c
@@ -340,6 +340,15 @@ mp_float_t uint64_to_float(uint64_t ui64) {
return (mp_float_t) ((uint32_t) (ui64 >> 32) * 4294967296.0f + (uint32_t) (ui64 & 0xffffffff));
}
+// Convert a uint64_t to a 32-bit float to a uint64_t without invoking extra math routines.
+// which are large.
+// Assume f >= 0.
+uint64_t float_to_uint64(float f) {
+ // 4294967296 = 2^32
+ const uint32_t upper_half = (uint32_t) (f / 4294967296.0f);
+ const uint32_t lower_half = (uint32_t) f;
+ return (((uint64_t) upper_half) << 32) + lower_half;
+}
#pragma GCC diagnostic pop
#endif // MICROPY_PY_BUILTINS_FLOAT
diff --git a/py/stream.c b/py/stream.c
index ae702bb1b..0813c1d7f 100644
--- a/py/stream.c
+++ b/py/stream.c
@@ -99,14 +99,22 @@ const mp_stream_p_t *mp_get_stream_raise(mp_obj_t self_in, int flags) {
STATIC mp_obj_t stream_read_generic(size_t n_args, const mp_obj_t *args, byte flags) {
// What to do if sz < -1? Python docs don't specify this case.
- // CPython does a readall, but here we silently let negatives through,
- // and they will cause a MemoryError.
+ // CPython does a readall, let's do the same.
mp_int_t sz;
- if (n_args == 1 || args[1] == mp_const_none || ((sz = mp_obj_get_int(args[1])) == -1)) {
- return stream_readall(args[0]);
- }
-
const mp_stream_p_t *stream_p = mp_get_stream(args[0]);
+ if (stream_p->pyserial_read_compatibility) {
+ // Pyserial defaults to sz=1 if not specified.
+ if (n_args == 1) {
+ sz = 1;
+ } else {
+ // Pyserial treats negative size as 0.
+ sz = MAX(0, mp_obj_get_int(args[1]));
+ }
+ } else {
+ if (n_args == 1 || args[1] == mp_const_none || (sz = mp_obj_get_int(args[1])) <= -1) {
+ return stream_readall(args[0]);
+ }
+ }
#if MICROPY_PY_BUILTINS_STR_UNICODE
if (stream_p->is_text) {
@@ -284,7 +292,7 @@ STATIC mp_obj_t stream_readinto(size_t n_args, const mp_obj_t *args) {
// https://docs.python.org/3/library/socket.html#socket.socket.recv_into
mp_uint_t len = bufinfo.len;
if (n_args > 2) {
- if (mp_get_stream(args[0])->pyserial_compatibility) {
+ if (mp_get_stream(args[0])->pyserial_readinto_compatibility) {
mp_raise_ValueError(translate("length argument not allowed for this type"));
}
len = mp_obj_get_int(args[2]);
@@ -297,7 +305,10 @@ STATIC mp_obj_t stream_readinto(size_t n_args, const mp_obj_t *args) {
mp_uint_t out_sz = mp_stream_read_exactly(args[0], bufinfo.buf, len, &error);
if (error != 0) {
if (mp_is_nonblocking_error(error)) {
- return mp_const_none;
+ // pyserial readinto never returns None, just 0.
+ return mp_get_stream(args[0])->pyserial_dont_return_none_compatibility
+ ? MP_OBJ_NEW_SMALL_INT(0)
+ : mp_const_none;
}
mp_raise_OSError(error);
} else {
@@ -323,7 +334,10 @@ STATIC mp_obj_t stream_readall(mp_obj_t self_in) {
// If we read nothing, return None, just like read().
// Otherwise, return data read so far.
if (total_size == 0) {
- return mp_const_none;
+ // pyserial read() never returns None, just b''.
+ return stream_p->pyserial_dont_return_none_compatibility
+ ? mp_const_empty_bytes
+ : mp_const_none;
}
break;
}
diff --git a/py/stream.h b/py/stream.h
index be6b23d40..c05dcfc50 100644
--- a/py/stream.h
+++ b/py/stream.h
@@ -72,7 +72,9 @@ typedef struct _mp_stream_p_t {
mp_uint_t (*write)(mp_obj_t obj, const void *buf, mp_uint_t size, int *errcode);
mp_uint_t (*ioctl)(mp_obj_t obj, mp_uint_t request, uintptr_t arg, int *errcode);
mp_uint_t is_text : 1; // default is bytes, set this for text stream
- bool pyserial_compatibility: 1; // adjust API to match pyserial more closely
+ bool pyserial_readinto_compatibility: 1; // Disallow size parameter in readinto()
+ bool pyserial_read_compatibility: 1; // Disallow omitting read(size) size parameter
+ bool pyserial_dont_return_none_compatibility: 1; // Don't return None for read() or readinto()
} mp_stream_p_t;
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(mp_stream_read_obj);
diff --git a/shared-bindings/_bleio/CharacteristicBuffer.c b/shared-bindings/_bleio/CharacteristicBuffer.c
index 4d6c836c1..333b275ff 100644
--- a/shared-bindings/_bleio/CharacteristicBuffer.c
+++ b/shared-bindings/_bleio/CharacteristicBuffer.c
@@ -231,8 +231,8 @@ STATIC const mp_stream_p_t characteristic_buffer_stream_p = {
.write = bleio_characteristic_buffer_write,
.ioctl = bleio_characteristic_buffer_ioctl,
.is_text = false,
- // Match PySerial when possible, such as disallowing optional length argument for .readinto()
- .pyserial_compatibility = true,
+ // Disallow readinto() size parameter.
+ .pyserial_readinto_compatibility = true,
};
diff --git a/shared-bindings/_pew/__init__.c b/shared-bindings/_pew/__init__.c
index 498beaf1c..912d267c4 100644
--- a/shared-bindings/_pew/__init__.c
+++ b/shared-bindings/_pew/__init__.c
@@ -29,6 +29,7 @@
#include "PewPew.h"
#include "common-hal/_pew/PewPew.h"
+
STATIC mp_obj_t get_pressed(void) {
pew_obj_t *pew = MP_STATE_VM(pew_singleton);
if (!pew) {
@@ -41,12 +42,19 @@ STATIC mp_obj_t get_pressed(void) {
STATIC MP_DEFINE_CONST_FUN_OBJ_0(get_pressed_obj, get_pressed);
+STATIC mp_obj_t get_ticks(void) {
+ return mp_obj_new_int(pew_get_ticks());
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_0(get_ticks_obj, get_ticks);
+
+
//| """LED matrix driver"""
//|
STATIC const mp_rom_map_elem_t pew_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__pew) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_PewPew), MP_ROM_PTR(&pewpew_type)},
{ MP_OBJ_NEW_QSTR(MP_QSTR_get_pressed), MP_ROM_PTR(&get_pressed_obj)},
+ { MP_OBJ_NEW_QSTR(MP_QSTR_get_ticks), MP_ROM_PTR(&get_ticks_obj)},
};
STATIC MP_DEFINE_CONST_DICT(pew_module_globals,
pew_module_globals_table);
diff --git a/shared-bindings/adafruit_bus_device/I2CDevice.c b/shared-bindings/adafruit_bus_device/I2CDevice.c
index 15e8cc706..e6ec8c147 100644
--- a/shared-bindings/adafruit_bus_device/I2CDevice.c
+++ b/shared-bindings/adafruit_bus_device/I2CDevice.c
@@ -35,6 +35,7 @@
#include "lib/utils/buffer_helper.h"
#include "lib/utils/context_manager_helpers.h"
#include "py/runtime.h"
+#include "py/smallint.h"
#include "supervisor/shared/translate.h"
@@ -132,15 +133,20 @@ STATIC mp_obj_t adafruit_bus_device_i2cdevice_readinto(size_t n_args, const mp_o
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
mp_obj_t dest[8];
+ uint8_t num_kws = 1;
+
mp_load_method(self->i2c, MP_QSTR_readfrom_into, dest);
- dest[2] = mp_obj_new_int_from_ull(self->device_address);
+ dest[2] = MP_OBJ_NEW_SMALL_INT(self->device_address);
dest[3] = args[ARG_buffer].u_obj;
//dest[4] = mp_obj_new_str("start", 5);
dest[4] = MP_OBJ_NEW_QSTR(MP_QSTR_start);
- dest[5] = mp_obj_new_int(args[ARG_start].u_int);
- dest[6] = MP_OBJ_NEW_QSTR(MP_QSTR_end);
- dest[7] = mp_obj_new_int(args[ARG_end].u_int);
- mp_call_method_n_kw(2, 2, dest);
+ dest[5] = MP_OBJ_NEW_SMALL_INT(args[ARG_start].u_int);
+ if (args[ARG_end].u_int != INT_MAX) {
+ dest[6] = MP_OBJ_NEW_QSTR(MP_QSTR_end);
+ dest[7] = MP_OBJ_NEW_SMALL_INT(args[ARG_end].u_int);
+ num_kws++;
+ }
+ mp_call_method_n_kw(2, num_kws, dest);
return mp_const_none;
}
@@ -170,14 +176,20 @@ STATIC mp_obj_t adafruit_bus_device_i2cdevice_write(size_t n_args, const mp_obj_
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
mp_obj_t dest[8];
+ uint8_t num_kws = 1;
+
mp_load_method(self->i2c, MP_QSTR_writeto, dest);
- dest[2] = mp_obj_new_int_from_ull(self->device_address);
+ dest[2] = MP_OBJ_NEW_SMALL_INT(self->device_address);
dest[3] = args[ARG_buffer].u_obj;
dest[4] = MP_OBJ_NEW_QSTR(MP_QSTR_start);
- dest[5] = mp_obj_new_int(args[ARG_start].u_int);
- dest[6] = MP_OBJ_NEW_QSTR(MP_QSTR_end);
- dest[7] = mp_obj_new_int(args[ARG_end].u_int);
- mp_call_method_n_kw(2, 2, dest);
+ dest[5] = MP_OBJ_NEW_SMALL_INT(args[ARG_start].u_int);
+ if (args[ARG_end].u_int != INT_MAX) {
+ dest[6] = MP_OBJ_NEW_QSTR(MP_QSTR_end);
+ dest[7] = MP_OBJ_NEW_SMALL_INT(args[ARG_end].u_int);
+ num_kws++;
+ }
+
+ mp_call_method_n_kw(2, num_kws, dest);
return mp_const_none;
}
@@ -221,20 +233,29 @@ STATIC mp_obj_t adafruit_bus_device_i2cdevice_write_then_readinto(size_t n_args,
mp_arg_parse_all(n_args - 1, pos_args + 1, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
mp_obj_t dest[13];
+ uint8_t num_kws = 2;
+ uint8_t index = 2;
+
mp_load_method(self->i2c, MP_QSTR_writeto_then_readfrom, dest);
- dest[2] = mp_obj_new_int_from_ull(self->device_address);
- dest[3] = args[ARG_out_buffer].u_obj;
- dest[4] = args[ARG_in_buffer].u_obj;
- dest[5] = MP_OBJ_NEW_QSTR(MP_QSTR_out_start);
- dest[6] = mp_obj_new_int(args[ARG_out_start].u_int);
- dest[7] = MP_OBJ_NEW_QSTR(MP_QSTR_out_end);
- dest[8] = mp_obj_new_int(args[ARG_out_end].u_int);
- dest[9] = MP_OBJ_NEW_QSTR(MP_QSTR_in_start);
- dest[10] = mp_obj_new_int(args[ARG_in_start].u_int);
- dest[11] = MP_OBJ_NEW_QSTR(MP_QSTR_in_end);
- dest[12] = mp_obj_new_int(args[ARG_in_end].u_int);
-
- mp_call_method_n_kw(3, 4, dest);
+ dest[index++] = MP_OBJ_NEW_SMALL_INT(self->device_address);
+ dest[index++] = args[ARG_out_buffer].u_obj;
+ dest[index++] = args[ARG_in_buffer].u_obj;
+ dest[index++] = MP_OBJ_NEW_QSTR(MP_QSTR_out_start);
+ dest[index++] = MP_OBJ_NEW_SMALL_INT(args[ARG_out_start].u_int);
+ if (args[ARG_out_end].u_int != INT_MAX) {
+ dest[index++] = MP_OBJ_NEW_QSTR(MP_QSTR_out_end);
+ dest[index++] = MP_OBJ_NEW_SMALL_INT(args[ARG_out_end].u_int);
+ num_kws++;
+ }
+ dest[index++] = MP_OBJ_NEW_QSTR(MP_QSTR_in_start);
+ dest[index++] = MP_OBJ_NEW_SMALL_INT(args[ARG_in_start].u_int);
+ if (args[ARG_in_end].u_int != INT_MAX) {
+ dest[index++] = MP_OBJ_NEW_QSTR(MP_QSTR_in_end);
+ dest[index++] = MP_OBJ_NEW_SMALL_INT(args[ARG_in_end].u_int);
+ num_kws++;
+ }
+
+ mp_call_method_n_kw(3, num_kws, dest);
return mp_const_none;
}
diff --git a/shared-bindings/adafruit_bus_device/SPIDevice.c b/shared-bindings/adafruit_bus_device/SPIDevice.c
index e127e39b8..74fa28e4d 100644
--- a/shared-bindings/adafruit_bus_device/SPIDevice.c
+++ b/shared-bindings/adafruit_bus_device/SPIDevice.c
@@ -100,13 +100,22 @@ STATIC mp_obj_t adafruit_bus_device_spidevice_make_new(const mp_obj_type_t *type
return (mp_obj_t)self;
}
+//| def __enter__(self) -> busio.SPI:
+//| """Starts a SPI transaction by configuring the SPI and asserting chip select."""
+//| ...
+//|
STATIC mp_obj_t adafruit_bus_device_spidevice_obj___enter__(mp_obj_t self_in) {
adafruit_bus_device_spidevice_obj_t *self = MP_OBJ_TO_PTR(self_in);
- common_hal_adafruit_bus_device_spidevice_enter(self);
- return self->spi;
+ return common_hal_adafruit_bus_device_spidevice_enter(self);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(adafruit_bus_device_spidevice___enter___obj, adafruit_bus_device_spidevice_obj___enter__);
+
+//| def __exit__(self) -> None:
+//| """Ends a SPI transaction by deasserting chip select. See
+//| :ref:`lifetime-and-contextmanagers` for more info."""
+//| ...
+//|
STATIC mp_obj_t adafruit_bus_device_spidevice_obj___exit__(size_t n_args, const mp_obj_t *args) {
common_hal_adafruit_bus_device_spidevice_exit(MP_OBJ_TO_PTR(args[0]));
return mp_const_none;
diff --git a/shared-bindings/adafruit_bus_device/SPIDevice.h b/shared-bindings/adafruit_bus_device/SPIDevice.h
index 5596b157f..997e22a6b 100644
--- a/shared-bindings/adafruit_bus_device/SPIDevice.h
+++ b/shared-bindings/adafruit_bus_device/SPIDevice.h
@@ -44,7 +44,7 @@ extern const mp_obj_type_t adafruit_bus_device_spidevice_type;
// Initializes the hardware peripheral.
extern void common_hal_adafruit_bus_device_spidevice_construct(adafruit_bus_device_spidevice_obj_t *self, busio_spi_obj_t *spi, digitalio_digitalinout_obj_t *cs,
uint32_t baudrate, uint8_t polarity, uint8_t phase, uint8_t extra_clocks);
-extern void common_hal_adafruit_bus_device_spidevice_enter(adafruit_bus_device_spidevice_obj_t *self);
+extern mp_obj_t common_hal_adafruit_bus_device_spidevice_enter(adafruit_bus_device_spidevice_obj_t *self);
extern void common_hal_adafruit_bus_device_spidevice_exit(adafruit_bus_device_spidevice_obj_t *self);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_BUSDEVICE_SPIDEVICE_H
diff --git a/shared-bindings/bitops/__init__.c b/shared-bindings/bitops/__init__.c
new file mode 100644
index 000000000..3c567b8ed
--- /dev/null
+++ b/shared-bindings/bitops/__init__.c
@@ -0,0 +1,101 @@
+/*
+ * This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython
+ *
+ * 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 "py/obj.h"
+#include "py/runtime.h"
+
+#include "shared-bindings/bitops/__init__.h"
+
+//| """Routines for low-level manipulation of binary data"""
+//|
+//|
+
+//| def bit_transpose(input: ReadableBuffer, output: WriteableBuffer, width:int = 8) -> WriteableBuffer:
+//| """"Transpose" a buffer by assembling each output byte with bits taken from each of ``width`` different input bytes.
+//|
+//| This can be useful to convert a sequence of pixel values into a single
+//| stream of bytes suitable for sending via a parallel conversion method.
+//|
+//| The number of bytes in the input buffer must be a multiple of the width,
+//| and the width can be any value from 2 to 8. If the width is fewer than 8,
+//| then the remaining (less significant) bits of the output are set to zero.
+//|
+//| Let ``stride = len(input)//width``. Then the first byte is made out of the
+//| most significant bits of ``[input[0], input[stride], input[2*stride], ...]``.
+//| The second byte is made out of the second bits, and so on until the 8th output
+//| byte which is made of the first bits of ``input[1], input[1+stride,
+//| input[2*stride], ...]``.
+//|
+//| The required output buffer size is ``len(input) * 8 // width``.
+//|
+//| Returns the output buffer."""
+//| ...
+
+STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
+ enum { ARG_input, ARG_output, ARG_width };
+ static const mp_arg_t allowed_args[] = {
+ { MP_QSTR_input, MP_ARG_OBJ | MP_ARG_REQUIRED },
+ { MP_QSTR_output, MP_ARG_OBJ | MP_ARG_REQUIRED },
+ { MP_QSTR_width, MP_ARG_INT, { .u_int = 8 } },
+ };
+ mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
+ mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
+
+ int width = args[ARG_width].u_int;
+ if (width < 2 || width > 8) {
+ mp_raise_ValueError_varg(translate("width must be from 2 to 8 (inclusive), not %d"), width);
+ }
+
+ mp_buffer_info_t input_bufinfo;
+ mp_get_buffer_raise(args[ARG_input].u_obj, &input_bufinfo, MP_BUFFER_READ);
+ int inlen = input_bufinfo.len;
+ if (inlen % width != 0) {
+ mp_raise_ValueError_varg(translate("Input buffer length (%d) must be a multiple of the strand count (%d)"), inlen, width);
+ }
+
+ mp_buffer_info_t output_bufinfo;
+ mp_get_buffer_raise(args[ARG_output].u_obj, &output_bufinfo, MP_BUFFER_WRITE);
+ int avail = output_bufinfo.len;
+ int outlen = 8 * (inlen / width);
+ if (avail < outlen) {
+ mp_raise_ValueError_varg(translate("Output buffer must be at least %d bytes"), outlen);
+ }
+ common_hal_bitops_bit_transpose(output_bufinfo.buf, input_bufinfo.buf, inlen, width);
+ return args[ARG_output].u_obj;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bitops_bit_transpose_obj, 1, bit_transpose);
+
+STATIC const mp_rom_map_elem_t bitops_module_globals_table[] = {
+ { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_bitops) },
+ { MP_ROM_QSTR(MP_QSTR_bit_transpose), MP_ROM_PTR(&bitops_bit_transpose_obj) },
+};
+
+STATIC MP_DEFINE_CONST_DICT(bitops_module_globals, bitops_module_globals_table);
+
+const mp_obj_module_t bitops_module = {
+ .base = { &mp_type_module },
+ .globals = (mp_obj_dict_t*)&bitops_module_globals,
+};
diff --git a/shared-bindings/bitops/__init__.h b/shared-bindings/bitops/__init__.h
new file mode 100644
index 000000000..6654cac5e
--- /dev/null
+++ b/shared-bindings/bitops/__init__.h
@@ -0,0 +1,32 @@
+/*
+ * This file is part of the Circuit Python 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.
+ */
+
+#pragma once
+
+#include <stdint.h>
+#include <stdlib.h>
+
+void common_hal_bitops_bit_transpose(uint8_t *result, const uint8_t *src, size_t inlen, size_t num_strands);
diff --git a/shared-bindings/busio/UART.c b/shared-bindings/busio/UART.c
index bf0b7e721..f48109fde 100644
--- a/shared-bindings/busio/UART.c
+++ b/shared-bindings/busio/UART.c
@@ -415,8 +415,8 @@ STATIC const mp_stream_p_t uart_stream_p = {
.write = busio_uart_write,
.ioctl = busio_uart_ioctl,
.is_text = false,
- // Match PySerial when possible, such as disallowing optional length argument for .readinto()
- .pyserial_compatibility = true,
+ // Disallow optional length argument for .readinto()
+ .pyserial_readinto_compatibility = true,
};
const mp_obj_type_t busio_uart_type = {
diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c
index 90cc02fe3..67001c831 100644
--- a/shared-bindings/microcontroller/Processor.c
+++ b/shared-bindings/microcontroller/Processor.c
@@ -41,7 +41,15 @@
//|
//| import microcontroller
//| print(microcontroller.cpu.frequency)
-//| print(microcontroller.cpu.temperature)"""
+//| print(microcontroller.cpu.temperature)
+//|
+//| Note that on chips with more than one cpu (such as the RP2040)
+//| microcontroller.cpu will return the value for CPU 0.
+//| To get values from other CPUs use microcontroller.cpus indexed by
+//| the number of the desired cpu. i.e.
+//|
+//| print(microcontroller.cpus[0].temperature)
+//| print(microcontroller.cpus[1].frequency)"""
//|
//| def __init__(self) -> None:
diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c
index 035587c30..dba66fa4f 100644
--- a/shared-bindings/microcontroller/__init__.c
+++ b/shared-bindings/microcontroller/__init__.c
@@ -53,7 +53,13 @@
//| cpu: Processor
//| """CPU information and control, such as ``cpu.temperature`` and ``cpu.frequency``
//| (clock frequency).
-//| This object is the sole instance of `microcontroller.Processor`."""
+//| This object is an instance of `microcontroller.Processor`."""
+//|
+
+//| cpus: Processor
+//| """CPU information and control, such as ``cpus[0].temperature`` and ``cpus[1].frequency``
+//| (clock frequency) on chips with more than 1 cpu. The index selects which cpu.
+//| This object is an instance of `microcontroller.Processor`."""
//|
//| def delay_us(delay: int) -> None:
@@ -155,6 +161,9 @@ const mp_obj_module_t mcu_pin_module = {
STATIC const mp_rom_map_elem_t mcu_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_microcontroller) },
{ MP_ROM_QSTR(MP_QSTR_cpu), MP_ROM_PTR(&common_hal_mcu_processor_obj) },
+#if CIRCUITPY_PROCESSOR_COUNT > 1
+ { MP_ROM_QSTR(MP_QSTR_cpus), MP_ROM_PTR(&common_hal_multi_processor_obj) },
+#endif
{ MP_ROM_QSTR(MP_QSTR_delay_us), MP_ROM_PTR(&mcu_delay_us_obj) },
{ MP_ROM_QSTR(MP_QSTR_disable_interrupts), MP_ROM_PTR(&mcu_disable_interrupts_obj) },
{ MP_ROM_QSTR(MP_QSTR_enable_interrupts), MP_ROM_PTR(&mcu_enable_interrupts_obj) },
diff --git a/shared-bindings/microcontroller/__init__.h b/shared-bindings/microcontroller/__init__.h
index 39d3e718b..733127d56 100644
--- a/shared-bindings/microcontroller/__init__.h
+++ b/shared-bindings/microcontroller/__init__.h
@@ -48,7 +48,8 @@ extern const mp_obj_dict_t mcu_pin_globals;
#if CIRCUITPY_PROCESSOR_COUNT == 1
extern const mcu_processor_obj_t common_hal_mcu_processor_obj;
#elif CIRCUITPY_PROCESSOR_COUNT > 1
-extern const mp_rom_obj_tuple_t common_hal_mcu_processor_obj;
+extern const mcu_processor_obj_t common_hal_mcu_processor_obj;
+extern const mp_rom_obj_tuple_t common_hal_multi_processor_obj;
#else
#error "Invalid processor count"
#endif
diff --git a/shared-bindings/rtc/RTC.h b/shared-bindings/rtc/RTC.h
index 76510bd72..02bf54f50 100644
--- a/shared-bindings/rtc/RTC.h
+++ b/shared-bindings/rtc/RTC.h
@@ -30,6 +30,7 @@
#include <stdint.h>
#include <stdbool.h>
+#include "py/obj.h"
#include "lib/timeutils/timeutils.h"
extern void common_hal_rtc_get_time(timeutils_struct_time_t *tm);
diff --git a/shared-bindings/sdcardio/SDCard.c b/shared-bindings/sdcardio/SDCard.c
index 975f8b095..35d6c1497 100644
--- a/shared-bindings/sdcardio/SDCard.c
+++ b/shared-bindings/sdcardio/SDCard.c
@@ -55,6 +55,12 @@
//| Data transfers use the specified baurate (rounded down to one that is supported by
//| the microcontroller)
//|
+//| .. important::
+//| If the same SPI bus is shared with other peripherals, it is important that
+//| the SD card be initialized before accessing any other peripheral on the bus.
+//| Failure to do so can prevent the SD card from being recognized until it is
+//| powered off or re-inserted.
+//|
//| Example usage:
//|
//| .. code-block:: python
diff --git a/shared-bindings/socketpool/Socket.c b/shared-bindings/socketpool/Socket.c
index 007417340..da827798c 100644
--- a/shared-bindings/socketpool/Socket.c
+++ b/shared-bindings/socketpool/Socket.c
@@ -3,8 +3,8 @@
*
* The MIT License (MIT)
*
- * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George
- * 2018 Nick Moore for Adafruit Industries
+ * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
+ * Copyright (c) 2021 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
@@ -64,6 +64,25 @@ STATIC mp_obj_t socketpool_socket___exit__(size_t n_args, const mp_obj_t *args)
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket___exit___obj, 4, 4, socketpool_socket___exit__);
+//| def accept(self) -> Tuple[Socket, Tuple[str, int]]:
+//| """Accept a connection on a listening socket of type SOCK_STREAM,
+//| creating a new socket of type SOCK_STREAM.
+//| Returns a tuple of (new_socket, remote_address)"""
+//|
+STATIC mp_obj_t socketpool_socket_accept(mp_obj_t self_in) {
+ socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ uint8_t ip[4];
+ uint32_t port;
+
+ socketpool_socket_obj_t * sock = common_hal_socketpool_socket_accept(self, ip, &port);
+
+ mp_obj_t tuple_contents[2];
+ tuple_contents[0] = MP_OBJ_FROM_PTR(sock);
+ tuple_contents[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG);
+ return mp_obj_new_tuple(2, tuple_contents);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_accept_obj, socketpool_socket_accept);
+
//| def bind(self, address: Tuple[str, int]) -> None:
//| """Bind a socket to an address
//|
@@ -79,8 +98,11 @@ STATIC mp_obj_t socketpool_socket_bind(mp_obj_t self_in, mp_obj_t addr_in) {
size_t hostlen;
const char* host = mp_obj_str_get_data(addr_items[0], &hostlen);
mp_int_t port = mp_obj_get_int(addr_items[1]);
+ if (port < 0) {
+ mp_raise_ValueError(translate("port must be >= 0"));
+ }
- bool ok = common_hal_socketpool_socket_bind(self, host, hostlen, port);
+ bool ok = common_hal_socketpool_socket_bind(self, host, hostlen, (uint32_t)port);
if (!ok) {
mp_raise_ValueError(translate("Error: Failure to bind"));
}
@@ -89,41 +111,6 @@ STATIC mp_obj_t socketpool_socket_bind(mp_obj_t self_in, mp_obj_t addr_in) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_bind_obj, socketpool_socket_bind);
-//| def listen(self, backlog: int) -> None:
-//| """Set socket to listen for incoming connections
-//|
-//| :param ~int backlog: length of backlog queue for waiting connetions"""
-//| ...
-//|
-STATIC mp_obj_t socketpool_socket_listen(mp_obj_t self_in, mp_obj_t backlog_in) {
- socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in);
-
- int backlog = mp_obj_get_int(backlog_in);
-
- common_hal_socketpool_socket_listen(self, backlog);
- return mp_const_none;
-}
-STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_listen_obj, socketpool_socket_listen);
-
-//| def accept(self) -> Tuple[Socket, Tuple[str, int]]:
-//| """Accept a connection on a listening socket of type SOCK_STREAM,
-//| creating a new socket of type SOCK_STREAM.
-//| Returns a tuple of (new_socket, remote_address)"""
-//|
-STATIC mp_obj_t socketpool_socket_accept(mp_obj_t self_in) {
- socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in);
- uint8_t ip[4];
- uint port;
-
- socketpool_socket_obj_t * sock = common_hal_socketpool_socket_accept(self, ip, &port);
-
- mp_obj_t tuple_contents[2];
- tuple_contents[0] = MP_OBJ_FROM_PTR(sock);
- tuple_contents[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG);
- return mp_obj_new_tuple(2, tuple_contents);
-}
-STATIC MP_DEFINE_CONST_FUN_OBJ_1(socketpool_socket_accept_obj, socketpool_socket_accept);
-
//| def close(self) -> None:
//| """Closes this Socket and makes its resources available to its SocketPool."""
//|
@@ -149,8 +136,11 @@ STATIC mp_obj_t socketpool_socket_connect(mp_obj_t self_in, mp_obj_t addr_in) {
size_t hostlen;
const char* host = mp_obj_str_get_data(addr_items[0], &hostlen);
mp_int_t port = mp_obj_get_int(addr_items[1]);
+ if (port < 0) {
+ mp_raise_ValueError(translate("port must be >= 0"));
+ }
- bool ok = common_hal_socketpool_socket_connect(self, host, hostlen, port);
+ bool ok = common_hal_socketpool_socket_connect(self, host, hostlen, (uint32_t)port);
if (!ok) {
mp_raise_OSError(0);
}
@@ -159,31 +149,47 @@ STATIC mp_obj_t socketpool_socket_connect(mp_obj_t self_in, mp_obj_t addr_in) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_connect_obj, socketpool_socket_connect);
-//| def send(self, bytes: ReadableBuffer) -> int:
-//| """Send some bytes to the connected remote address.
-//| Suits sockets of type SOCK_STREAM
+//| def listen(self, backlog: int) -> None:
+//| """Set socket to listen for incoming connections
//|
-//| :param ~bytes bytes: some bytes to send"""
+//| :param ~int backlog: length of backlog queue for waiting connetions"""
//| ...
//|
-STATIC mp_obj_t socketpool_socket_send(mp_obj_t self_in, mp_obj_t buf_in) {
+STATIC mp_obj_t socketpool_socket_listen(mp_obj_t self_in, mp_obj_t backlog_in) {
+ socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+
+ int backlog = mp_obj_get_int(backlog_in);
+
+ common_hal_socketpool_socket_listen(self, backlog);
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_listen_obj, socketpool_socket_listen);
+
+//| def recvfrom_into(self, buffer: WriteableBuffer) -> Tuple[int, Tuple[str, int]]:
+//| """Reads some bytes from a remote address.
+//|
+//| Returns a tuple containing
+//| * the number of bytes received into the given buffer
+//| * a remote_address, which is a tuple of ip address and port number
+//|
+//| :param object buffer: buffer to read into"""
+//| ...
+//|
+STATIC mp_obj_t socketpool_socket_recvfrom_into(mp_obj_t self_in, mp_obj_t data_in) {
socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in);
- if (common_hal_socketpool_socket_get_closed(self)) {
- // Bad file number.
- mp_raise_OSError(MP_EBADF);
- }
- if (!common_hal_socketpool_socket_get_connected(self)) {
- mp_raise_BrokenPipeError();
- }
mp_buffer_info_t bufinfo;
- mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ);
- mp_int_t ret = common_hal_socketpool_socket_send(self, bufinfo.buf, bufinfo.len);
- if (ret == -1) {
- mp_raise_BrokenPipeError();
- }
- return mp_obj_new_int_from_uint(ret);
+ mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_WRITE);
+
+ byte ip[4];
+ mp_uint_t port;
+ mp_int_t ret = common_hal_socketpool_socket_recvfrom_into(self,
+ (byte*)bufinfo.buf, bufinfo.len, ip, &port);
+ mp_obj_t tuple_contents[2];
+ tuple_contents[0] = mp_obj_new_int_from_uint(ret);
+ tuple_contents[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG);
+ return mp_obj_new_tuple(2, tuple_contents);
}
-STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_send_obj, socketpool_socket_send);
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_recvfrom_into_obj, socketpool_socket_recvfrom_into);
//| def recv_into(self, buffer: WriteableBuffer, bufsize: int) -> int:
//| """Reads some bytes from the connected remote address, writing
@@ -199,7 +205,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_send_obj, socketpool_socket_s
//| :param int bufsize: optionally, a maximum number of bytes to read."""
//| ...
//|
-
STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args) {
socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]);
if (common_hal_socketpool_socket_get_closed(self)) {
@@ -232,6 +237,32 @@ STATIC mp_obj_t socketpool_socket_recv_into(size_t n_args, const mp_obj_t *args)
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_recv_into_obj, 2, 3, socketpool_socket_recv_into);
+//| def send(self, bytes: ReadableBuffer) -> int:
+//| """Send some bytes to the connected remote address.
+//| Suits sockets of type SOCK_STREAM
+//|
+//| :param ~bytes bytes: some bytes to send"""
+//| ...
+//|
+STATIC mp_obj_t socketpool_socket_send(mp_obj_t self_in, mp_obj_t buf_in) {
+ socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ if (common_hal_socketpool_socket_get_closed(self)) {
+ // Bad file number.
+ mp_raise_OSError(MP_EBADF);
+ }
+ if (!common_hal_socketpool_socket_get_connected(self)) {
+ mp_raise_BrokenPipeError();
+ }
+ mp_buffer_info_t bufinfo;
+ mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ);
+ mp_int_t ret = common_hal_socketpool_socket_send(self, bufinfo.buf, bufinfo.len);
+ if (ret == -1) {
+ mp_raise_BrokenPipeError();
+ }
+ return mp_obj_new_int_from_uint(ret);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_send_obj, socketpool_socket_send);
+
//| def sendto(self, bytes: ReadableBuffer, address: Tuple[str, int]) -> int:
//| """Send some bytes to a specific address.
//| Suits sockets of type SOCK_DGRAM
@@ -240,7 +271,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_recv_into_obj, 2, 3
//| :param ~tuple address: tuple of (remote_address, remote_port)"""
//| ...
//|
-
STATIC mp_obj_t socketpool_socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_obj_t addr_in) {
socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in);
@@ -254,8 +284,11 @@ STATIC mp_obj_t socketpool_socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_
size_t hostlen;
const char* host = mp_obj_str_get_data(addr_items[0], &hostlen);
mp_int_t port = mp_obj_get_int(addr_items[1]);
+ if (port < 0) {
+ mp_raise_ValueError(translate("port must be >= 0"));
+ }
- mp_int_t ret = common_hal_socketpool_socket_sendto(self, host, hostlen, port, bufinfo.buf, bufinfo.len);
+ mp_int_t ret = common_hal_socketpool_socket_sendto(self, host, hostlen, (uint32_t)port, bufinfo.buf, bufinfo.len);
if (!ret) {
mp_raise_OSError(0);
}
@@ -264,37 +297,28 @@ STATIC mp_obj_t socketpool_socket_sendto(mp_obj_t self_in, mp_obj_t data_in, mp_
}
STATIC MP_DEFINE_CONST_FUN_OBJ_3(socketpool_socket_sendto_obj, socketpool_socket_sendto);
-//| def recvfrom_into(self, buffer: WriteableBuffer) -> Tuple[int, Tuple[str, int]]:
-//| """Reads some bytes from a remote address.
-//|
-//| Returns a tuple containing
-//| * the number of bytes received into the given buffer
-//| * a remote_address, which is a tuple of ip address and port number
+//| def setblocking(self, flag: bool) -> Optional[int]:
+//| """Set the blocking behaviour of this socket.
//|
-//| :param object buffer: buffer to read into"""
+//| :param ~bool flag: False means non-blocking, True means block indefinitely."""
//| ...
//|
-STATIC mp_obj_t socketpool_socket_recvfrom_into(mp_obj_t self_in, mp_obj_t data_in) {
+// method socket.setblocking(flag)
+STATIC mp_obj_t socketpool_socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) {
socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in);
- mp_buffer_info_t bufinfo;
- mp_get_buffer_raise(data_in, &bufinfo, MP_BUFFER_WRITE);
-
- byte ip[4];
- mp_uint_t port;
- mp_int_t ret = common_hal_socketpool_socket_recvfrom_into(self,
- (byte*)bufinfo.buf, bufinfo.len, ip, &port);
- mp_obj_t tuple_contents[2];
- tuple_contents[0] = mp_obj_new_int_from_uint(ret);
- tuple_contents[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG);
- return mp_obj_new_tuple(2, tuple_contents);
+ if (mp_obj_is_true(blocking)) {
+ common_hal_socketpool_socket_settimeout(self, -1);
+ } else {
+ common_hal_socketpool_socket_settimeout(self, 0);
+ }
+ return mp_const_none;
}
-STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_recvfrom_into_obj, socketpool_socket_recvfrom_into);
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_setblocking_obj, socketpool_socket_setblocking);
// //| def setsockopt(self, level: int, optname: int, value: int) -> None:
// //| """Sets socket options"""
// //| ...
// //|
-
// STATIC mp_obj_t socketpool_socket_setsockopt(size_t n_args, const mp_obj_t *args) {
// // mod_network_socket_obj_t *self = MP_OBJ_TO_PTR(args[0]);
@@ -324,13 +348,13 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_recvfrom_into_obj, socketpool
// }
// STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socketpool_socket_setsockopt_obj, 4, 4, socketpool_socket_setsockopt);
+
//| def settimeout(self, value: int) -> None:
//| """Set the timeout value for this socket.
//|
//| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely."""
//| ...
//|
-
STATIC mp_obj_t socketpool_socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) {
socketpool_socket_obj_t *self = MP_OBJ_TO_PTR(self_in);
mp_uint_t timeout_ms;
@@ -348,24 +372,6 @@ STATIC mp_obj_t socketpool_socket_settimeout(mp_obj_t self_in, mp_obj_t timeout_
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_settimeout_obj, socketpool_socket_settimeout);
-// //| def setblocking(self, flag: bool) -> Optional[int]:
-// //| """Set the blocking behaviour of this socket.
-// //|
-// //| :param ~bool flag: False means non-blocking, True means block indefinitely."""
-// //| ...
-// //|
-
-// // method socket.setblocking(flag)
-// STATIC mp_obj_t socketpool_socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) {
-// // if (mp_obj_is_true(blocking)) {
-// // return socket_settimeout(self_in, mp_const_none);
-// // } else {
-// // return socket_settimeout(self_in, MP_OBJ_NEW_SMALL_INT(0));
-// // }
-// return mp_const_none;
-// }
-// STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_setblocking_obj, socketpool_socket_setblocking);
-
//| def __hash__(self) -> int:
//| """Returns a hash for the Socket."""
//| ...
@@ -373,7 +379,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(socketpool_socket_settimeout_obj, socketpool_so
STATIC mp_obj_t socketpool_socket_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
switch (op) {
case MP_UNARY_OP_HASH: {
- return MP_OBJ_NEW_SMALL_INT(common_hal_socketpool_socket_get_hash(MP_OBJ_TO_PTR(self_in)));
+ return mp_obj_id(self_in);
}
default:
return MP_OBJ_NULL; // op not supported
@@ -384,19 +390,19 @@ STATIC const mp_rom_map_elem_t socketpool_socket_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) },
{ MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&socketpool_socket___exit___obj) },
{ MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&socketpool_socket_close_obj) },
- { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&socketpool_socket_close_obj) },
- { MP_ROM_QSTR(MP_QSTR_bind), MP_ROM_PTR(&socketpool_socket_bind_obj) },
- { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&socketpool_socket_listen_obj) },
{ MP_ROM_QSTR(MP_QSTR_accept), MP_ROM_PTR(&socketpool_socket_accept_obj) },
+ { MP_ROM_QSTR(MP_QSTR_bind), MP_ROM_PTR(&socketpool_socket_bind_obj) },
+ { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&socketpool_socket_close_obj) },
{ MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&socketpool_socket_connect_obj) },
- { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&socketpool_socket_send_obj) },
- { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&socketpool_socket_sendto_obj) },
+ { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&socketpool_socket_listen_obj) },
{ MP_ROM_QSTR(MP_QSTR_recvfrom_into), MP_ROM_PTR(&socketpool_socket_recvfrom_into_obj) },
{ MP_ROM_QSTR(MP_QSTR_recv_into), MP_ROM_PTR(&socketpool_socket_recv_into_obj) },
+ { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&socketpool_socket_send_obj) },
+ { MP_ROM_QSTR(MP_QSTR_sendto), MP_ROM_PTR(&socketpool_socket_sendto_obj) },
+ { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&socketpool_socket_setblocking_obj) },
// { MP_ROM_QSTR(MP_QSTR_setsockopt), MP_ROM_PTR(&socketpool_socket_setsockopt_obj) },
{ MP_ROM_QSTR(MP_QSTR_settimeout), MP_ROM_PTR(&socketpool_socket_settimeout_obj) },
- // { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&socketpool_socket_setblocking_obj) },
};
STATIC MP_DEFINE_CONST_DICT(socketpool_socket_locals_dict, socketpool_socket_locals_dict_table);
diff --git a/shared-bindings/socketpool/Socket.h b/shared-bindings/socketpool/Socket.h
index b5dceb50f..27173c8b3 100644
--- a/shared-bindings/socketpool/Socket.h
+++ b/shared-bindings/socketpool/Socket.h
@@ -31,22 +31,20 @@
extern const mp_obj_type_t socketpool_socket_type;
-void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, mp_uint_t timeout_ms);
-
-bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t* self, const char* host, size_t hostlen, uint8_t port);
-bool common_hal_socketpool_socket_listen(socketpool_socket_obj_t* self, int backlog);
-socketpool_socket_obj_t * common_hal_socketpool_socket_accept(socketpool_socket_obj_t* self, uint8_t* ip, uint *port);
-
-bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const char* host, size_t hostlen, mp_int_t port);
-mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len);
-mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, mp_uint_t len);
-mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t* self,
- const char* host, size_t hostlen, uint8_t port, const uint8_t* buf, mp_uint_t len);
-mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* self,
- uint8_t* buf, mp_uint_t len, uint8_t* ip, uint *port);
+socketpool_socket_obj_t * common_hal_socketpool_socket_accept(socketpool_socket_obj_t* self, uint8_t* ip, uint32_t *port);
+bool common_hal_socketpool_socket_bind(socketpool_socket_obj_t* self, const char* host, size_t hostlen, uint32_t port);
void common_hal_socketpool_socket_close(socketpool_socket_obj_t* self);
+bool common_hal_socketpool_socket_connect(socketpool_socket_obj_t* self, const char* host, size_t hostlen, uint32_t port);
bool common_hal_socketpool_socket_get_closed(socketpool_socket_obj_t* self);
bool common_hal_socketpool_socket_get_connected(socketpool_socket_obj_t* self);
-mp_uint_t common_hal_socketpool_socket_get_hash(socketpool_socket_obj_t* self);
+mp_uint_t common_hal_socketpool_socket_get_timeout(socketpool_socket_obj_t* self);
+bool common_hal_socketpool_socket_listen(socketpool_socket_obj_t* self, int backlog);
+mp_uint_t common_hal_socketpool_socket_recvfrom_into(socketpool_socket_obj_t* self,
+ uint8_t* buf, uint32_t len, uint8_t* ip, uint32_t *port);
+mp_uint_t common_hal_socketpool_socket_recv_into(socketpool_socket_obj_t* self, const uint8_t* buf, uint32_t len);
+mp_uint_t common_hal_socketpool_socket_send(socketpool_socket_obj_t* self, const uint8_t* buf, uint32_t len);
+mp_uint_t common_hal_socketpool_socket_sendto(socketpool_socket_obj_t* self,
+ const char* host, size_t hostlen, uint32_t port, const uint8_t* buf, uint32_t len);
+void common_hal_socketpool_socket_settimeout(socketpool_socket_obj_t* self, uint32_t timeout_ms);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SOCKETPOOL_SOCKET_H
diff --git a/shared-bindings/socketpool/SocketPool.c b/shared-bindings/socketpool/SocketPool.c
index 8f4069faa..6ff6d5f98 100644
--- a/shared-bindings/socketpool/SocketPool.c
+++ b/shared-bindings/socketpool/SocketPool.c
@@ -3,8 +3,7 @@
*
* The MIT License (MIT)
*
- * SPDX-FileCopyrightText: Copyright (c) 2014 Damien P. George
- * 2018 Nick Moore for Adafruit Industries
+ * 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
diff --git a/shared-bindings/ssl/SSLContext.c b/shared-bindings/ssl/SSLContext.c
index 9d4df7261..44e9e6bbf 100644
--- a/shared-bindings/ssl/SSLContext.c
+++ b/shared-bindings/ssl/SSLContext.c
@@ -51,7 +51,7 @@ STATIC mp_obj_t ssl_sslcontext_make_new(const mp_obj_type_t *type, size_t n_args
return MP_OBJ_FROM_PTR(s);
}
-//| def wrap_socket(sock: socketpool.Socket, *, server_side: bool = False, server_hostname: Optional[str] = None) -> socketpool.Socket:
+//| def wrap_socket(sock: socketpool.Socket, *, server_side: bool = False, server_hostname: Optional[str] = None) -> ssl.SSLSocket:
//| """Wraps the socket into a socket-compatible class that handles SSL negotiation.
//| The socket must be of type SOCK_STREAM."""
//| ...
diff --git a/shared-bindings/ssl/SSLContext.h b/shared-bindings/ssl/SSLContext.h
index f7f985af7..ad4d7e6a8 100644
--- a/shared-bindings/ssl/SSLContext.h
+++ b/shared-bindings/ssl/SSLContext.h
@@ -30,12 +30,13 @@
#include "common-hal/ssl/SSLContext.h"
#include "shared-bindings/socketpool/Socket.h"
+#include "shared-bindings/ssl/SSLSocket.h"
extern const mp_obj_type_t ssl_sslcontext_type;
void common_hal_ssl_sslcontext_construct(ssl_sslcontext_obj_t* self);
-socketpool_socket_obj_t* common_hal_ssl_sslcontext_wrap_socket(ssl_sslcontext_obj_t* self,
+ssl_sslsocket_obj_t* common_hal_ssl_sslcontext_wrap_socket(ssl_sslcontext_obj_t* self,
socketpool_socket_obj_t* sock, bool server_side, const char* server_hostname);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SSL_SSLCONTEXT_H
diff --git a/shared-bindings/ssl/SSLSocket.c b/shared-bindings/ssl/SSLSocket.c
new file mode 100644
index 000000000..0daa930ef
--- /dev/null
+++ b/shared-bindings/ssl/SSLSocket.c
@@ -0,0 +1,326 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 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/ssl/SSLSocket.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include "lib/utils/context_manager_helpers.h"
+#include "py/objtuple.h"
+#include "py/objlist.h"
+#include "py/runtime.h"
+#include "py/mperrno.h"
+
+#include "lib/netutils/netutils.h"
+
+//| class SSLSocket:
+//| """Implements TLS security on a subset of `socketpool.Socket` functions. Cannot be created
+//| directly. Instead, call `wrap_socket` on an existing socket object.
+//|
+//| Provides a subset of CPython's `ssl.SSLSocket` API. It only implements the versions of
+//| recv that do not allocate bytes objects."""
+//|
+
+//| def __enter__(self) -> SSLSocket:
+//| """No-op used by Context Managers."""
+//| ...
+//|
+// Provided by context manager helper.
+
+//| def __exit__(self) -> None:
+//| """Automatically closes the Socket when exiting a context. See
+//| :ref:`lifetime-and-contextmanagers` for more info."""
+//| ...
+//|
+STATIC mp_obj_t ssl_sslsocket___exit__(size_t n_args, const mp_obj_t *args) {
+ (void)n_args;
+ common_hal_ssl_sslsocket_close(args[0]);
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ssl_sslsocket___exit___obj, 4, 4, ssl_sslsocket___exit__);
+
+//| def accept(self) -> Tuple[SSLSocket, Tuple[str, int]]:
+//| """Accept a connection on a listening socket of type SOCK_STREAM,
+//| creating a new socket of type SOCK_STREAM.
+//| Returns a tuple of (new_socket, remote_address)"""
+//|
+STATIC mp_obj_t ssl_sslsocket_accept(mp_obj_t self_in) {
+ ssl_sslsocket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ uint8_t ip[4];
+ uint32_t port;
+
+ ssl_sslsocket_obj_t * sslsock = common_hal_ssl_sslsocket_accept(self, ip, &port);
+
+ mp_obj_t tuple_contents[2];
+ tuple_contents[0] = MP_OBJ_FROM_PTR(sslsock);
+ tuple_contents[1] = netutils_format_inet_addr(ip, port, NETUTILS_BIG);
+ return mp_obj_new_tuple(2, tuple_contents);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_1(ssl_sslsocket_accept_obj, ssl_sslsocket_accept);
+
+//| def bind(self, address: Tuple[str, int]) -> None:
+//| """Bind a socket to an address
+//|
+//| :param ~tuple address: tuple of (remote_address, remote_port)"""
+//| ...
+//|
+STATIC mp_obj_t ssl_sslsocket_bind(mp_obj_t self_in, mp_obj_t addr_in) {
+ ssl_sslsocket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+
+ mp_obj_t *addr_items;
+ mp_obj_get_array_fixed_n(addr_in, 2, &addr_items);
+
+ size_t hostlen;
+ const char* host = mp_obj_str_get_data(addr_items[0], &hostlen);
+ mp_int_t port = mp_obj_get_int(addr_items[1]);
+ if (port < 0) {
+ mp_raise_ValueError(translate("port must be >= 0"));
+ }
+
+ bool ok = common_hal_ssl_sslsocket_bind(self, host, hostlen, (uint32_t)port);
+ if (!ok) {
+ mp_raise_ValueError(translate("Error: Failure to bind"));
+ }
+
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(ssl_sslsocket_bind_obj, ssl_sslsocket_bind);
+
+//| def close(self) -> None:
+//| """Closes this Socket"""
+//|
+STATIC mp_obj_t ssl_sslsocket_close(mp_obj_t self_in) {
+ ssl_sslsocket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ common_hal_ssl_sslsocket_close(self);
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_1(ssl_sslsocket_close_obj, ssl_sslsocket_close);
+
+//| def connect(self, address: Tuple[str, int]) -> None:
+//| """Connect a socket to a remote address
+//|
+//| :param ~tuple address: tuple of (remote_address, remote_port)"""
+//| ...
+//|
+STATIC mp_obj_t ssl_sslsocket_connect(mp_obj_t self_in, mp_obj_t addr_in) {
+ ssl_sslsocket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+
+ mp_obj_t *addr_items;
+ mp_obj_get_array_fixed_n(addr_in, 2, &addr_items);
+
+ size_t hostlen;
+ const char* host = mp_obj_str_get_data(addr_items[0], &hostlen);
+ mp_int_t port = mp_obj_get_int(addr_items[1]);
+ if (port < 0) {
+ mp_raise_ValueError(translate("port must be >= 0"));
+ }
+
+ bool ok = common_hal_ssl_sslsocket_connect(self, host, hostlen, (uint32_t)port);
+ if (!ok) {
+ mp_raise_OSError(0);
+ }
+
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(ssl_sslsocket_connect_obj, ssl_sslsocket_connect);
+
+//| def listen(self, backlog: int) -> None:
+//| """Set socket to listen for incoming connections
+//|
+//| :param ~int backlog: length of backlog queue for waiting connetions"""
+//| ...
+//|
+STATIC mp_obj_t ssl_sslsocket_listen(mp_obj_t self_in, mp_obj_t backlog_in) {
+ ssl_sslsocket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+
+ int backlog = mp_obj_get_int(backlog_in);
+
+ common_hal_ssl_sslsocket_listen(self, backlog);
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(ssl_sslsocket_listen_obj, ssl_sslsocket_listen);
+
+//| def recv_into(self, buffer: WriteableBuffer, bufsize: int) -> int:
+//| """Reads some bytes from the connected remote address, writing
+//| into the provided buffer. If bufsize <= len(buffer) is given,
+//| a maximum of bufsize bytes will be read into the buffer. If no
+//| valid value is given for bufsize, the default is the length of
+//| the given buffer.
+//|
+//| Suits sockets of type SOCK_STREAM
+//| Returns an int of number of bytes read.
+//|
+//| :param bytearray buffer: buffer to receive into
+//| :param int bufsize: optionally, a maximum number of bytes to read."""
+//| ...
+//|
+STATIC mp_obj_t ssl_sslsocket_recv_into(size_t n_args, const mp_obj_t *args) {
+ ssl_sslsocket_obj_t *self = MP_OBJ_TO_PTR(args[0]);
+ if (common_hal_ssl_sslsocket_get_closed(self)) {
+ // Bad file number.
+ mp_raise_OSError(MP_EBADF);
+ }
+ // if (!common_hal_ssl_sslsocket_get_connected(self)) {
+ // // not connected
+ // mp_raise_OSError(MP_ENOTCONN);
+ // }
+ mp_buffer_info_t bufinfo;
+ mp_get_buffer_raise(args[1], &bufinfo, MP_BUFFER_WRITE);
+ mp_int_t len = bufinfo.len;
+ if (n_args == 3) {
+ mp_int_t given_len = mp_obj_get_int(args[2]);
+ if (given_len > len) {
+ mp_raise_ValueError(translate("buffer too small for requested bytes"));
+ }
+ if (given_len > 0 && given_len < len) {
+ len = given_len;
+ }
+ }
+
+ if (len == 0) {
+ return MP_OBJ_NEW_SMALL_INT(0);
+ }
+
+ mp_int_t ret = common_hal_ssl_sslsocket_recv_into(self, (byte*)bufinfo.buf, len);
+ return mp_obj_new_int_from_uint(ret);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ssl_sslsocket_recv_into_obj, 2, 3, ssl_sslsocket_recv_into);
+
+//| def send(self, bytes: ReadableBuffer) -> int:
+//| """Send some bytes to the connected remote address.
+//| Suits sockets of type SOCK_STREAM
+//|
+//| :param ~bytes bytes: some bytes to send"""
+//| ...
+//|
+STATIC mp_obj_t ssl_sslsocket_send(mp_obj_t self_in, mp_obj_t buf_in) {
+ ssl_sslsocket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ if (common_hal_ssl_sslsocket_get_closed(self)) {
+ // Bad file number.
+ mp_raise_OSError(MP_EBADF);
+ }
+ if (!common_hal_ssl_sslsocket_get_connected(self)) {
+ mp_raise_BrokenPipeError();
+ }
+ mp_buffer_info_t bufinfo;
+ mp_get_buffer_raise(buf_in, &bufinfo, MP_BUFFER_READ);
+ mp_int_t ret = common_hal_ssl_sslsocket_send(self, bufinfo.buf, bufinfo.len);
+ if (ret == -1) {
+ mp_raise_BrokenPipeError();
+ }
+ return mp_obj_new_int_from_uint(ret);
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(ssl_sslsocket_send_obj, ssl_sslsocket_send);
+
+// //| def setsockopt(self, level: int, optname: int, value: int) -> None:
+// //| """Sets socket options"""
+// //| ...
+// //|
+// STATIC mp_obj_t ssl_sslsocket_setsockopt(size_t n_args, const mp_obj_t *args) {
+// }
+// STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(ssl_sslsocket_setsockopt_obj, 4, 4, ssl_sslsocket_setsockopt);
+
+//| def settimeout(self, value: int) -> None:
+//| """Set the timeout value for this socket.
+//|
+//| :param ~int value: timeout in seconds. 0 means non-blocking. None means block indefinitely."""
+//| ...
+//|
+STATIC mp_obj_t ssl_sslsocket_settimeout(mp_obj_t self_in, mp_obj_t timeout_in) {
+ ssl_sslsocket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ mp_uint_t timeout_ms;
+ if (timeout_in == mp_const_none) {
+ timeout_ms = -1;
+ } else {
+ #if MICROPY_PY_BUILTINS_FLOAT
+ timeout_ms = 1000 * mp_obj_get_float(timeout_in);
+ #else
+ timeout_ms = 1000 * mp_obj_get_int(timeout_in);
+ #endif
+ }
+ common_hal_ssl_sslsocket_settimeout(self, timeout_ms);
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(ssl_sslsocket_settimeout_obj, ssl_sslsocket_settimeout);
+
+//| def setblocking(self, flag: bool) -> Optional[int]:
+//| """Set the blocking behaviour of this socket.
+//|
+//| :param ~bool flag: False means non-blocking, True means block indefinitely."""
+//| ...
+//|
+// method socket.setblocking(flag)
+STATIC mp_obj_t ssl_sslsocket_setblocking(mp_obj_t self_in, mp_obj_t blocking) {
+ ssl_sslsocket_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ if (mp_obj_is_true(blocking)) {
+ common_hal_ssl_sslsocket_settimeout(self, -1);
+ } else {
+ common_hal_ssl_sslsocket_settimeout(self, 0);
+ }
+ return mp_const_none;
+}
+STATIC MP_DEFINE_CONST_FUN_OBJ_2(ssl_sslsocket_setblocking_obj, ssl_sslsocket_setblocking);
+
+//| def __hash__(self) -> int:
+//| """Returns a hash for the Socket."""
+//| ...
+//|
+STATIC mp_obj_t ssl_sslsocket_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
+ switch (op) {
+ case MP_UNARY_OP_HASH: {
+ return mp_obj_id(self_in);
+ }
+ default:
+ return MP_OBJ_NULL; // op not supported
+ }
+}
+
+STATIC const mp_rom_map_elem_t ssl_sslsocket_locals_dict_table[] = {
+ { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) },
+ { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&ssl_sslsocket___exit___obj) },
+ { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&ssl_sslsocket_close_obj) },
+
+ { MP_ROM_QSTR(MP_QSTR_accept), MP_ROM_PTR(&ssl_sslsocket_accept_obj) },
+ { MP_ROM_QSTR(MP_QSTR_bind), MP_ROM_PTR(&ssl_sslsocket_bind_obj) },
+ { MP_ROM_QSTR(MP_QSTR_close), MP_ROM_PTR(&ssl_sslsocket_close_obj) },
+ { MP_ROM_QSTR(MP_QSTR_connect), MP_ROM_PTR(&ssl_sslsocket_connect_obj) },
+ { MP_ROM_QSTR(MP_QSTR_listen), MP_ROM_PTR(&ssl_sslsocket_listen_obj) },
+ { MP_ROM_QSTR(MP_QSTR_recv_into), MP_ROM_PTR(&ssl_sslsocket_recv_into_obj) },
+ { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&ssl_sslsocket_send_obj) },
+ { MP_ROM_QSTR(MP_QSTR_setblocking), MP_ROM_PTR(&ssl_sslsocket_setblocking_obj) },
+ // { MP_ROM_QSTR(MP_QSTR_setsockopt), MP_ROM_PTR(&ssl_sslsocket_setsockopt_obj) },
+ { MP_ROM_QSTR(MP_QSTR_settimeout), MP_ROM_PTR(&ssl_sslsocket_settimeout_obj) },
+};
+
+STATIC MP_DEFINE_CONST_DICT(ssl_sslsocket_locals_dict, ssl_sslsocket_locals_dict_table);
+
+const mp_obj_type_t ssl_sslsocket_type = {
+ { &mp_type_type },
+ .name = MP_QSTR_SSLSocket,
+ .locals_dict = (mp_obj_dict_t*)&ssl_sslsocket_locals_dict,
+ .unary_op = ssl_sslsocket_unary_op,
+};
diff --git a/shared-bindings/ssl/SSLSocket.h b/shared-bindings/ssl/SSLSocket.h
new file mode 100644
index 000000000..d117e5dca
--- /dev/null
+++ b/shared-bindings/ssl/SSLSocket.h
@@ -0,0 +1,45 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020 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_SHARED_BINDINGS_SSL_SSLSOCKET_H
+#define MICROPY_INCLUDED_SHARED_BINDINGS_SSL_SSLSOCKET_H
+
+#include "common-hal/ssl/SSLSocket.h"
+
+extern const mp_obj_type_t ssl_sslsocket_type;
+
+ssl_sslsocket_obj_t * common_hal_ssl_sslsocket_accept(ssl_sslsocket_obj_t* self, uint8_t* ip, uint32_t *port);
+bool common_hal_ssl_sslsocket_bind(ssl_sslsocket_obj_t* self, const char* host, size_t hostlen, uint32_t port);
+void common_hal_ssl_sslsocket_close(ssl_sslsocket_obj_t* self);
+bool common_hal_ssl_sslsocket_connect(ssl_sslsocket_obj_t* self, const char* host, size_t hostlen, uint32_t port);
+bool common_hal_ssl_sslsocket_get_closed(ssl_sslsocket_obj_t* self);
+bool common_hal_ssl_sslsocket_get_connected(ssl_sslsocket_obj_t* self);
+bool common_hal_ssl_sslsocket_listen(ssl_sslsocket_obj_t* self, int backlog);
+mp_uint_t common_hal_ssl_sslsocket_recv_into(ssl_sslsocket_obj_t* self, const uint8_t* buf, uint32_t len);
+mp_uint_t common_hal_ssl_sslsocket_send(ssl_sslsocket_obj_t* self, const uint8_t* buf, uint32_t len);
+void common_hal_ssl_sslsocket_settimeout(ssl_sslsocket_obj_t* self, uint32_t timeout_ms);
+
+#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SSL_SSLSOCKET_H
diff --git a/shared-bindings/supervisor/Runtime.c b/shared-bindings/supervisor/Runtime.c
index 8e0259a3b..283c8a1d6 100755
--- a/shared-bindings/supervisor/Runtime.c
+++ b/shared-bindings/supervisor/Runtime.c
@@ -55,59 +55,46 @@ STATIC supervisor_run_reason_t _run_reason;
//| serial_connected: bool
//| """Returns the USB serial communication status (read-only)."""
//|
-
-STATIC mp_obj_t supervisor_get_serial_connected(mp_obj_t self){
- if (!common_hal_get_serial_connected()) {
- return mp_const_false;
- }
- else {
- return mp_const_true;
- }
+STATIC mp_obj_t supervisor_runtime_get_serial_connected(mp_obj_t self){
+ return mp_obj_new_bool(common_hal_supervisor_runtime_get_serial_connected());
}
-MP_DEFINE_CONST_FUN_OBJ_1(supervisor_get_serial_connected_obj, supervisor_get_serial_connected);
+MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial_connected_obj, supervisor_runtime_get_serial_connected);
-const mp_obj_property_t supervisor_serial_connected_obj = {
+const mp_obj_property_t supervisor_runtime_serial_connected_obj = {
.base.type = &mp_type_property,
- .proxy = {(mp_obj_t)&supervisor_get_serial_connected_obj,
+ .proxy = {(mp_obj_t)&supervisor_runtime_get_serial_connected_obj,
(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&mp_const_none_obj},
};
-
//| serial_bytes_available: int
//| """Returns the whether any bytes are available to read
//| on the USB serial input. Allows for polling to see whether
//| to call the built-in input() or wait. (read-only)"""
//|
-STATIC mp_obj_t supervisor_get_serial_bytes_available(mp_obj_t self){
- if (!common_hal_get_serial_bytes_available()) {
- return mp_const_false;
- }
- else {
- return mp_const_true;
- }
+STATIC mp_obj_t supervisor_runtime_get_serial_bytes_available(mp_obj_t self){
+ return mp_obj_new_bool(common_hal_supervisor_runtime_get_serial_bytes_available());
}
-MP_DEFINE_CONST_FUN_OBJ_1(supervisor_get_serial_bytes_available_obj, supervisor_get_serial_bytes_available);
+MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_serial_bytes_available_obj, supervisor_runtime_get_serial_bytes_available);
-const mp_obj_property_t supervisor_serial_bytes_available_obj = {
+const mp_obj_property_t supervisor_runtime_serial_bytes_available_obj = {
.base.type = &mp_type_property,
- .proxy = {(mp_obj_t)&supervisor_get_serial_bytes_available_obj,
+ .proxy = {(mp_obj_t)&supervisor_runtime_get_serial_bytes_available_obj,
(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&mp_const_none_obj},
};
-
//| run_reason: RunReason
//| """Returns why CircuitPython started running this particular time."""
//|
-STATIC mp_obj_t supervisor_get_run_reason(mp_obj_t self) {
+STATIC mp_obj_t supervisor_runtime_get_run_reason(mp_obj_t self) {
return cp_enum_find(&supervisor_run_reason_type, _run_reason);
}
-MP_DEFINE_CONST_FUN_OBJ_1(supervisor_get_run_reason_obj, supervisor_get_run_reason);
+MP_DEFINE_CONST_FUN_OBJ_1(supervisor_runtime_get_run_reason_obj, supervisor_runtime_get_run_reason);
-const mp_obj_property_t supervisor_run_reason_obj = {
+const mp_obj_property_t supervisor_runtime_run_reason_obj = {
.base.type = &mp_type_property,
- .proxy = {(mp_obj_t)&supervisor_get_run_reason_obj,
+ .proxy = {(mp_obj_t)&supervisor_runtime_get_run_reason_obj,
(mp_obj_t)&mp_const_none_obj,
(mp_obj_t)&mp_const_none_obj},
};
@@ -117,9 +104,9 @@ void supervisor_set_run_reason(supervisor_run_reason_t run_reason) {
}
STATIC const mp_rom_map_elem_t supervisor_runtime_locals_dict_table[] = {
- { MP_ROM_QSTR(MP_QSTR_serial_connected), MP_ROM_PTR(&supervisor_serial_connected_obj) },
- { MP_ROM_QSTR(MP_QSTR_serial_bytes_available), MP_ROM_PTR(&supervisor_serial_bytes_available_obj) },
- { MP_ROM_QSTR(MP_QSTR_run_reason), MP_ROM_PTR(&supervisor_run_reason_obj) },
+ { MP_ROM_QSTR(MP_QSTR_serial_connected), MP_ROM_PTR(&supervisor_runtime_serial_connected_obj) },
+ { MP_ROM_QSTR(MP_QSTR_serial_bytes_available), MP_ROM_PTR(&supervisor_runtime_serial_bytes_available_obj) },
+ { MP_ROM_QSTR(MP_QSTR_run_reason), MP_ROM_PTR(&supervisor_runtime_run_reason_obj) },
};
STATIC MP_DEFINE_CONST_DICT(supervisor_runtime_locals_dict, supervisor_runtime_locals_dict_table);
diff --git a/shared-bindings/supervisor/Runtime.h b/shared-bindings/supervisor/Runtime.h
index 51ed7604d..6874ac744 100755
--- a/shared-bindings/supervisor/Runtime.h
+++ b/shared-bindings/supervisor/Runtime.h
@@ -36,12 +36,12 @@ extern const mp_obj_type_t supervisor_runtime_type;
void supervisor_set_run_reason(supervisor_run_reason_t run_reason);
-bool common_hal_get_serial_connected(void);
+bool common_hal_supervisor_runtime_get_serial_connected(void);
-bool common_hal_get_serial_bytes_available(void);
+bool common_hal_supervisor_runtime_get_serial_bytes_available(void);
//TODO: placeholders for future functions
-//bool common_hal_get_repl_active(void);
-//bool common_hal_get_usb_enumerated(void);
+//bool common_hal_get_supervisor_runtime_repl_active(void);
+//bool common_hal_get_supervisor_runtime_usb_enumerated(void);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_SUPERVISOR_RUNTIME_H
diff --git a/shared-bindings/usb_cdc/Serial.c b/shared-bindings/usb_cdc/Serial.c
new file mode 100644
index 000000000..c813dce5b
--- /dev/null
+++ b/shared-bindings/usb_cdc/Serial.c
@@ -0,0 +1,293 @@
+/*
+ * This file is part of the Micro Python project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Dan Halbert for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * 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 <stdint.h>
+
+#include "shared-bindings/usb_cdc/Serial.h"
+#include "shared-bindings/util.h"
+
+#include "py/ioctl.h"
+#include "py/objproperty.h"
+#include "py/runtime.h"
+#include "py/stream.h"
+#include "supervisor/shared/translate.h"
+
+//| class Serial:
+//| """Receives cdc commands over USB"""
+//|
+//| def __init__(self) -> None:
+//| """You cannot create an instance of `usb_cdc.Serial`.
+//|
+//| Serial objects are pre-constructed for each CDC device in the USB
+//| descriptor and added to the ``usb_cdc.ports`` tuple."""
+//| ...
+//|
+
+//| def read(self, size: int = 1) -> bytes:
+//| """Read at most ``size`` bytes. If ``size`` exceeds the internal buffer size
+//| only the bytes in the buffer will be read. If `timeout` is > 0 or ``None``,
+//| and fewer than ``size`` bytes are available, keep waiting until the timeout
+//| expires or ``size`` bytes are available.
+//|
+//| :return: Data read
+//| :rtype: bytes"""
+//| ...
+//|
+//| def readinto(self, buf: WriteableBuffer) -> int:
+//| """Read bytes into the ``buf``. If ``nbytes`` is specified then read at most
+//| that many bytes, subject to `timeout`. Otherwise, read at most ``len(buf)`` bytes.
+//|
+//| :return: number of bytes read and stored into ``buf``
+//| :rtype: bytes"""
+//| ...
+//|
+//| def write(self, buf: ReadableBuffer) -> int:
+//| """Write as many bytes as possible from the buffer of bytes.
+//|
+//| :return: the number of bytes written
+//| :rtype: int"""
+//| ...
+//|
+//| def flush(self) -> None:
+//| """Force out any unwritten bytes, waiting until they are written."""
+//| ...
+//|
+
+// These three methods are used by the shared stream methods.
+STATIC mp_uint_t usb_cdc_serial_read_stream(mp_obj_t self_in, void *buf_in, mp_uint_t size, int *errcode) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ byte *buf = buf_in;
+
+ // make sure we want at least 1 char
+ if (size == 0) {
+ return 0;
+ }
+
+ return common_hal_usb_cdc_serial_read(self, buf, size, errcode);
+}
+
+STATIC mp_uint_t usb_cdc_serial_write_stream(mp_obj_t self_in, const void *buf_in, mp_uint_t size, int *errcode) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ const byte *buf = buf_in;
+
+ return common_hal_usb_cdc_serial_write(self, buf, size, errcode);
+}
+
+STATIC mp_uint_t usb_cdc_serial_ioctl_stream(mp_obj_t self_in, mp_uint_t request, mp_uint_t arg, int *errcode) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ mp_uint_t ret = 0;
+ switch (request) {
+ case MP_IOCTL_POLL: {
+ mp_uint_t flags = arg;
+ ret = 0;
+ if ((flags & MP_IOCTL_POLL_RD) && common_hal_usb_cdc_serial_get_in_waiting(self) > 0) {
+ ret |= MP_IOCTL_POLL_RD;
+ }
+ if ((flags & MP_IOCTL_POLL_WR) && common_hal_usb_cdc_serial_get_out_waiting(self) == 0) {
+ ret |= MP_IOCTL_POLL_WR;
+ }
+ break;
+ }
+
+ case MP_STREAM_FLUSH:
+ common_hal_usb_cdc_serial_flush(self);
+ break;
+
+ default:
+ *errcode = MP_EINVAL;
+ ret = MP_STREAM_ERROR;
+ }
+ return ret;
+}
+
+//| connected: bool
+//| """True if this Serial is connected to a host. (read-only)"""
+//|
+STATIC mp_obj_t usb_cdc_serial_get_connected(mp_obj_t self_in) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ return mp_obj_new_bool(common_hal_usb_cdc_serial_get_connected(self));
+}
+MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_connected_obj, usb_cdc_serial_get_connected);
+
+const mp_obj_property_t usb_cdc_serial_connected_obj = {
+ .base.type = &mp_type_property,
+ .proxy = {(mp_obj_t)&usb_cdc_serial_get_connected_obj,
+ (mp_obj_t)&mp_const_none_obj,
+ (mp_obj_t)&mp_const_none_obj},
+};
+
+//| in_waiting: int
+//| """Returns the number of bytes waiting to be read on the USB serial input. (read-only)"""
+//|
+STATIC mp_obj_t usb_cdc_serial_get_in_waiting(mp_obj_t self_in) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ return mp_obj_new_int(common_hal_usb_cdc_serial_get_in_waiting(self));
+}
+MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_in_waiting_obj, usb_cdc_serial_get_in_waiting);
+
+const mp_obj_property_t usb_cdc_serial_in_waiting_obj = {
+ .base.type = &mp_type_property,
+ .proxy = {(mp_obj_t)&usb_cdc_serial_get_in_waiting_obj,
+ (mp_obj_t)&mp_const_none_obj,
+ (mp_obj_t)&mp_const_none_obj},
+};
+
+//| out_waiting: int
+//| """Returns the number of bytes waiting to be written on the USB serial output. (read-only)"""
+//|
+STATIC mp_obj_t usb_cdc_serial_get_out_waiting(mp_obj_t self_in) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ return mp_obj_new_int(common_hal_usb_cdc_serial_get_out_waiting(self));
+}
+MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_out_waiting_obj, usb_cdc_serial_get_out_waiting);
+
+const mp_obj_property_t usb_cdc_serial_out_waiting_obj = {
+ .base.type = &mp_type_property,
+ .proxy = {(mp_obj_t)&usb_cdc_serial_get_out_waiting_obj,
+ (mp_obj_t)&mp_const_none_obj,
+ (mp_obj_t)&mp_const_none_obj},
+};
+
+//| def reset_input_buffer(self) -> None:
+//| """Clears any unread bytes."""
+//| ...
+//|
+STATIC mp_obj_t usb_cdc_serial_reset_input_buffer(mp_obj_t self_in) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ common_hal_usb_cdc_serial_reset_input_buffer(self);
+ return mp_const_none;
+}
+MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_reset_input_buffer_obj, usb_cdc_serial_reset_input_buffer);
+
+//| def reset_output_buffer(self) -> None:
+//| """Clears any unwritten bytes."""
+//| ...
+//|
+STATIC mp_obj_t usb_cdc_serial_reset_output_buffer(mp_obj_t self_in) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ common_hal_usb_cdc_serial_reset_output_buffer(self);
+ return mp_const_none;
+}
+MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_reset_output_buffer_obj, usb_cdc_serial_reset_output_buffer);
+
+//| timeout: Optional[float]
+//| """The initial value of `timeout` is ``None``. If ``None``, wait indefinitely to satisfy
+//| the conditions of a read operation. If 0, do not wait. If > 0, wait only ``timeout`` seconds."""
+//|
+STATIC mp_obj_t usb_cdc_serial_get_timeout(mp_obj_t self_in) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ mp_float_t timeout = common_hal_usb_cdc_serial_get_timeout(self);
+ return (timeout < 0.0f) ? mp_const_none : mp_obj_new_float(self->timeout);
+}
+MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_timeout_obj, usb_cdc_serial_get_timeout);
+
+STATIC mp_obj_t usb_cdc_serial_set_timeout(mp_obj_t self_in, mp_obj_t timeout_in) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ common_hal_usb_cdc_serial_set_timeout(self,
+ timeout_in == mp_const_none ? -1.0f : mp_obj_get_float(timeout_in));
+ return mp_const_none;
+}
+MP_DEFINE_CONST_FUN_OBJ_2(usb_cdc_serial_set_timeout_obj, usb_cdc_serial_set_timeout);
+
+const mp_obj_property_t usb_cdc_serial_timeout_obj = {
+ .base.type = &mp_type_property,
+ .proxy = {(mp_obj_t)&usb_cdc_serial_get_timeout_obj,
+ (mp_obj_t)&usb_cdc_serial_set_timeout_obj,
+ (mp_obj_t)&mp_const_none_obj},
+};
+
+//| write_timeout: Optional[float]
+//| """The initial value of `write_timeout` is ``None``. If ``None``, wait indefinitely to finish
+//| writing all the bytes passed to ``write()``.If 0, do not wait.
+//| If > 0, wait only ``write_timeout`` seconds."""
+//|
+STATIC mp_obj_t usb_cdc_serial_get_write_timeout(mp_obj_t self_in) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ mp_float_t write_timeout = common_hal_usb_cdc_serial_get_write_timeout(self);
+ return (write_timeout < 0.0f) ? mp_const_none : mp_obj_new_float(self->write_timeout);
+}
+MP_DEFINE_CONST_FUN_OBJ_1(usb_cdc_serial_get_write_timeout_obj, usb_cdc_serial_get_write_timeout);
+
+STATIC mp_obj_t usb_cdc_serial_set_write_timeout(mp_obj_t self_in, mp_obj_t write_timeout_in) {
+ usb_cdc_serial_obj_t *self = MP_OBJ_TO_PTR(self_in);
+ common_hal_usb_cdc_serial_set_write_timeout(self,
+ write_timeout_in == mp_const_none ? -1.0f : mp_obj_get_float(write_timeout_in));
+ return mp_const_none;
+}
+MP_DEFINE_CONST_FUN_OBJ_2(usb_cdc_serial_set_write_timeout_obj, usb_cdc_serial_set_write_timeout);
+
+const mp_obj_property_t usb_cdc_serial_write_timeout_obj = {
+ .base.type = &mp_type_property,
+ .proxy = {(mp_obj_t)&usb_cdc_serial_get_write_timeout_obj,
+ (mp_obj_t)&usb_cdc_serial_set_write_timeout_obj,
+ (mp_obj_t)&mp_const_none_obj},
+};
+
+
+STATIC const mp_rom_map_elem_t usb_cdc_serial_locals_dict_table[] = {
+ // Standard stream methods.
+ { MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&mp_stream_flush_obj) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_read), MP_ROM_PTR(&mp_stream_read_obj) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) },
+ { MP_ROM_QSTR(MP_QSTR_readline), MP_ROM_PTR(&mp_stream_unbuffered_readline_obj)},
+ { MP_ROM_QSTR(MP_QSTR_readlines), MP_ROM_PTR(&mp_stream_unbuffered_readlines_obj)},
+ { MP_OBJ_NEW_QSTR(MP_QSTR_write), MP_ROM_PTR(&mp_stream_write_obj) },
+
+ // Other pyserial-inspired attributes.
+ { MP_OBJ_NEW_QSTR(MP_QSTR_in_waiting), MP_ROM_PTR(&usb_cdc_serial_in_waiting_obj) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_out_waiting), MP_ROM_PTR(&usb_cdc_serial_out_waiting_obj) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_reset_input_buffer), MP_ROM_PTR(&usb_cdc_serial_reset_input_buffer_obj) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_reset_output_buffer), MP_ROM_PTR(&usb_cdc_serial_reset_output_buffer_obj) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_timeout), MP_ROM_PTR(&usb_cdc_serial_timeout_obj) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_write_timeout), MP_ROM_PTR(&usb_cdc_serial_write_timeout_obj) },
+
+ // Not in pyserial protocol.
+ { MP_OBJ_NEW_QSTR(MP_QSTR_connected), MP_ROM_PTR(&usb_cdc_serial_connected_obj) },
+
+
+
+};
+STATIC MP_DEFINE_CONST_DICT(usb_cdc_serial_locals_dict, usb_cdc_serial_locals_dict_table);
+
+STATIC const mp_stream_p_t usb_cdc_serial_stream_p = {
+ MP_PROTO_IMPLEMENT(MP_QSTR_protocol_stream)
+ .read = usb_cdc_serial_read_stream,
+ .write = usb_cdc_serial_write_stream,
+ .ioctl = usb_cdc_serial_ioctl_stream,
+ .is_text = false,
+ .pyserial_read_compatibility = true,
+ .pyserial_readinto_compatibility = true,
+ .pyserial_dont_return_none_compatibility = true,
+};
+
+const mp_obj_type_t usb_cdc_serial_type = {
+ { &mp_type_type },
+ .name = MP_QSTR_Serial,
+ .getiter = mp_identity_getiter,
+ .iternext = mp_stream_unbuffered_iter,
+ .protocol = &usb_cdc_serial_stream_p,
+ .locals_dict = (mp_obj_dict_t*)&usb_cdc_serial_locals_dict,
+};
diff --git a/shared-bindings/usb_cdc/Serial.h b/shared-bindings/usb_cdc/Serial.h
new file mode 100644
index 000000000..cdf5c3a91
--- /dev/null
+++ b/shared-bindings/usb_cdc/Serial.h
@@ -0,0 +1,53 @@
+/*
+ * This file is part of the Micro Python project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Dan Halbert for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * 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_USB_CDC_SERIAL_H
+#define MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC_SERIAL_H
+
+#include "shared-module/usb_cdc/Serial.h"
+
+extern const mp_obj_type_t usb_cdc_serial_type;
+
+extern size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, size_t len, int *errcode);
+extern size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode);
+
+extern uint32_t common_hal_usb_cdc_serial_get_in_waiting(usb_cdc_serial_obj_t *self);
+extern uint32_t common_hal_usb_cdc_serial_get_out_waiting(usb_cdc_serial_obj_t *self);
+
+extern void common_hal_usb_cdc_serial_reset_input_buffer(usb_cdc_serial_obj_t *self);
+extern uint32_t common_hal_usb_cdc_serial_reset_output_buffer(usb_cdc_serial_obj_t *self);
+
+extern uint32_t common_hal_usb_cdc_serial_flush(usb_cdc_serial_obj_t *self);
+
+extern bool common_hal_usb_cdc_serial_get_connected(usb_cdc_serial_obj_t *self);
+
+extern mp_float_t common_hal_usb_cdc_serial_get_timeout(usb_cdc_serial_obj_t *self);
+extern void common_hal_usb_cdc_serial_set_timeout(usb_cdc_serial_obj_t *self, mp_float_t timeout);
+
+extern mp_float_t common_hal_usb_cdc_serial_get_write_timeout(usb_cdc_serial_obj_t *self);
+extern void common_hal_usb_cdc_serial_set_write_timeout(usb_cdc_serial_obj_t *self, mp_float_t write_timeout);
+
+#endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC_SERIAL_H
diff --git a/shared-bindings/usb_cdc/__init__.c b/shared-bindings/usb_cdc/__init__.c
new file mode 100644
index 000000000..eb9c25e00
--- /dev/null
+++ b/shared-bindings/usb_cdc/__init__.c
@@ -0,0 +1,59 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Dan Halbertfor 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 <stdint.h>
+
+#include "py/obj.h"
+#include "py/runtime.h"
+
+#include "shared-bindings/usb_cdc/__init__.h"
+#include "shared-bindings/usb_cdc/Serial.h"
+
+#include "py/runtime.h"
+
+//| """USB CDC Serial streams
+//|
+//| The `usb_cdc` module allows access to USB CDC (serial) communications."""
+//|
+//| serials: Tuple[Serial, ...]
+//| """Tuple of all CDC streams. Each item is a `Serial`.
+//| ``serials[0]`` is the USB REPL connection.
+//| ``serials[1]`` is a second USB serial connection, unconnected to the REPL.
+//| """
+//|
+
+static const mp_map_elem_t usb_cdc_module_globals_table[] = {
+ { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_usb_cdc) },
+ { MP_ROM_QSTR(MP_QSTR_Serial), MP_OBJ_FROM_PTR(&usb_cdc_serial_type) },
+ { MP_ROM_QSTR(MP_QSTR_serials), MP_OBJ_FROM_PTR(&usb_cdc_serials_tuple) },
+};
+
+static MP_DEFINE_CONST_DICT(usb_cdc_module_globals, usb_cdc_module_globals_table);
+
+const mp_obj_module_t usb_cdc_module = {
+ .base = { &mp_type_module },
+ .globals = (mp_obj_dict_t*)&usb_cdc_module_globals,
+};
diff --git a/shared-bindings/usb_cdc/__init__.h b/shared-bindings/usb_cdc/__init__.h
new file mode 100644
index 000000000..e81d243e6
--- /dev/null
+++ b/shared-bindings/usb_cdc/__init__.h
@@ -0,0 +1,32 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Dan Halbert for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * 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_USB_CDC___INIT___H
+#define MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC___INIT___H
+
+#include "shared-module/usb_cdc/__init__.h"
+
+#endif // MICROPY_INCLUDED_SHARED_BINDINGS_USB_CDC___INIT___H
diff --git a/shared-module/adafruit_bus_device/I2CDevice.c b/shared-module/adafruit_bus_device/I2CDevice.c
index 792ab7183..6d80cf599 100644
--- a/shared-module/adafruit_bus_device/I2CDevice.c
+++ b/shared-module/adafruit_bus_device/I2CDevice.c
@@ -71,7 +71,7 @@ void common_hal_adafruit_bus_device_i2cdevice_probe_for_device(adafruit_bus_devi
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
mp_load_method(self->i2c, MP_QSTR_writeto, dest);
- dest[2] = mp_obj_new_int_from_ull(self->device_address);
+ dest[2] = MP_OBJ_NEW_SMALL_INT(self->device_address);
dest[3] = write_buffer;
mp_call_method_n_kw(2, 0, dest);
nlr_pop();
diff --git a/shared-module/adafruit_bus_device/SPIDevice.c b/shared-module/adafruit_bus_device/SPIDevice.c
index e489fc7c0..65649026a 100644
--- a/shared-module/adafruit_bus_device/SPIDevice.c
+++ b/shared-module/adafruit_bus_device/SPIDevice.c
@@ -41,7 +41,7 @@ void common_hal_adafruit_bus_device_spidevice_construct(adafruit_bus_device_spid
self->chip_select = cs;
}
-void common_hal_adafruit_bus_device_spidevice_enter(adafruit_bus_device_spidevice_obj_t *self) {
+mp_obj_t common_hal_adafruit_bus_device_spidevice_enter(adafruit_bus_device_spidevice_obj_t *self) {
bool success = false;
while (!success) {
success = common_hal_busio_spi_try_lock(self->spi);
@@ -54,6 +54,7 @@ void common_hal_adafruit_bus_device_spidevice_enter(adafruit_bus_device_spidevic
if (self->chip_select != MP_OBJ_NULL) {
common_hal_digitalio_digitalinout_set_value(MP_OBJ_TO_PTR(self->chip_select), false);
}
+ return self->spi;
}
void common_hal_adafruit_bus_device_spidevice_exit(adafruit_bus_device_spidevice_obj_t *self) {
diff --git a/shared-module/bitops/__init__.c b/shared-module/bitops/__init__.c
new file mode 100644
index 000000000..cf0ac7bd1
--- /dev/null
+++ b/shared-module/bitops/__init__.c
@@ -0,0 +1,151 @@
+/*
+ * This file is part of the Circuit Python project, https://github.com/adafruit/circuitpython
+ *
+ * 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 "shared-bindings/bitops/__init__.h"
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifdef __GNUC__
+#define FALLTHROUGH __attribute__((fallthrough))
+#else
+#define FALLTHROUGH ((void)0) /* FALLTHROUGH */
+#endif
+
+// adapted from "Hacker's Delight" - Figure 7-2 Transposing an 8x8-bit matrix
+// basic idea is:
+// > First, treat the 8x8-bit matrix as 16 2x2-bit matrices, and transpose each
+// > of the 16 2x2-bit matrices. Second, treat the matrix as four 2x2 submatrices
+// > whose elements are 2x2-bit matrices and transpose each of the four 2x2
+// > submatrices. Finally, treat the matrix as a 2x2 matrix whose elements are
+// > 4x4-bit matrices, and transpose the 2x2 matrix. These transformations are
+// > illustrated below.
+// We want a different definition of bit/byte order, deal with strides differently, etc.
+// so the code is heavily re-worked compared to the original.
+static void transpose_var(uint32_t *result, const uint8_t *src, int src_stride, int num_strands) {
+ uint32_t x = 0, y = 0, t;
+
+ src += (num_strands-1) * src_stride;
+
+ switch(num_strands) {
+ case 7:
+ x |= *src << 16;
+ src -= src_stride;
+ FALLTHROUGH;
+ case 6:
+ x |= *src << 8;
+ src -= src_stride;
+ FALLTHROUGH;
+ case 5:
+ x |= *src;
+ src -= src_stride;
+ FALLTHROUGH;
+ case 4:
+ y |= *src << 24;
+ src -= src_stride;
+ FALLTHROUGH;
+ case 3:
+ y |= *src << 16;
+ src -= src_stride;
+ FALLTHROUGH;
+ case 2:
+ y |= *src << 8;
+ src -= src_stride;
+ y |= *src;
+ }
+
+ t = (x ^ (x >> 7)) & 0x00AA00AA; x = x ^ t ^ (t << 7);
+ t = (y ^ (y >> 7)) & 0x00AA00AA; y = y ^ t ^ (t << 7);
+
+ t = (x ^ (x >>14)) & 0x0000CCCC; x = x ^ t ^ (t <<14);
+ t = (y ^ (y >>14)) & 0x0000CCCC; y = y ^ t ^ (t <<14);
+
+ t = (x & 0xF0F0F0F0) | ((y >> 4) & 0x0F0F0F0F);
+ y = ((x << 4) & 0xF0F0F0F0) | (y & 0x0F0F0F0F);
+ x = t;
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ x = __builtin_bswap32(x);
+ y = __builtin_bswap32(y);
+#endif
+ result[0] = x;
+ result[1] = y;
+}
+
+static void transpose_8(uint32_t *result, const uint8_t *src, int src_stride) {
+ uint32_t x, y, t;
+
+ y = *src; src += src_stride;
+ y |= (*src << 8); src += src_stride;
+ y |= (*src << 16); src += src_stride;
+ y |= (*src << 24); src += src_stride;
+ x = *src; src += src_stride;
+ x |= (*src << 8); src += src_stride;
+ x |= (*src << 16); src += src_stride;
+ x |= (*src << 24); src += src_stride;
+
+ t = (x ^ (x >> 7)) & 0x00AA00AA; x = x ^ t ^ (t << 7);
+ t = (y ^ (y >> 7)) & 0x00AA00AA; y = y ^ t ^ (t << 7);
+
+ t = (x ^ (x >>14)) & 0x0000CCCC; x = x ^ t ^ (t <<14);
+ t = (y ^ (y >>14)) & 0x0000CCCC; y = y ^ t ^ (t <<14);
+
+ t = (x & 0xF0F0F0F0) | ((y >> 4) & 0x0F0F0F0F);
+ y = ((x << 4) & 0xF0F0F0F0) | (y & 0x0F0F0F0F);
+ x = t;
+
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ x = __builtin_bswap32(x);
+ y = __builtin_bswap32(y);
+#endif
+ result[0] = x;
+ result[1] = y;
+}
+
+static void bit_transpose_8(uint32_t *result, const uint8_t *src, size_t src_stride, size_t n) {
+ for(size_t i=0; i<n; i++) {
+ transpose_8(result, src, src_stride);
+ result += 2;
+ src += 1;
+ }
+}
+
+static void bit_transpose_var(uint32_t *result, const uint8_t *src, size_t src_stride, size_t n, int num_strands) {
+ for(size_t i=0; i<n; i++) {
+ transpose_var(result, src, src_stride, num_strands);
+ result += 2;
+ src += 1;
+ }
+}
+
+void common_hal_bitops_bit_transpose(uint8_t *result, const uint8_t *src, size_t inlen, size_t num_strands) {
+ if(num_strands == 8) {
+ bit_transpose_8((uint32_t*)(void*)result, src, inlen/8, inlen/8);
+ } else {
+ bit_transpose_var((uint32_t*)(void*)result, src, inlen/num_strands, inlen/num_strands, num_strands);
+ }
+}
diff --git a/shared-module/bitops/__init__.h b/shared-module/bitops/__init__.h
new file mode 100644
index 000000000..945e48b72
--- /dev/null
+++ b/shared-module/bitops/__init__.h
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the Circuit Python 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.
+ */
+
+#pragma once
diff --git a/shared-module/usb_cdc/Serial.c b/shared-module/usb_cdc/Serial.c
new file mode 100644
index 000000000..b4d8667ca
--- /dev/null
+++ b/shared-module/usb_cdc/Serial.c
@@ -0,0 +1,149 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Dan Halbert for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * 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 "lib/utils/interrupt_char.h"
+#include "shared-module/usb_cdc/Serial.h"
+#include "supervisor/shared/tick.h"
+
+#include "tusb.h"
+
+size_t common_hal_usb_cdc_serial_read(usb_cdc_serial_obj_t *self, uint8_t *data, size_t len, int *errcode) {
+
+ const bool wait_forever = self->timeout < 0.0f;
+ const bool wait_for_timeout = self->timeout > 0.0f;
+
+ // Read up to len bytes immediately.
+ // The number of bytes read will not be larger than what is already in the TinyUSB FIFO.
+ uint32_t total_num_read = tud_cdc_n_read(self->idx, data, len);
+
+ if (wait_forever || wait_for_timeout) {
+ // Read more if we have time.
+ // Use special routine to avoid pulling in uint64-float-compatible math routines.
+ uint64_t timeout_ms = float_to_uint64(self->timeout * 1000); // Junk value if timeout < 0.
+ uint64_t start_ticks = supervisor_ticks_ms64();
+
+ uint32_t num_read = 0;
+ while (total_num_read < len &&
+ (wait_forever || supervisor_ticks_ms64() - start_ticks <= timeout_ms)) {
+
+ // Wait for a bit, and check for ctrl-C.
+ RUN_BACKGROUND_TASKS;
+ if (mp_hal_is_interrupted()) {
+ return 0;
+ }
+
+ // Advance buffer pointer and reduce number of bytes that need to be read.
+ len -= num_read;
+ data += num_read;
+
+ // Try to read another batch of bytes.
+ num_read = tud_cdc_n_read(self->idx, data, len);
+ total_num_read += num_read;
+ }
+ }
+
+ return total_num_read;
+}
+
+size_t common_hal_usb_cdc_serial_write(usb_cdc_serial_obj_t *self, const uint8_t *data, size_t len, int *errcode) {
+ const bool wait_forever = self->write_timeout < 0.0f;
+ const bool wait_for_timeout = self->write_timeout > 0.0f;
+
+ // Write as many bytes as possible immediately.
+ // The number of bytes written at once will not be larger than what can fit in the TinyUSB FIFO.
+ uint32_t total_num_written = tud_cdc_n_write(self->idx, data, len);
+ tud_cdc_n_write_flush(self->idx);
+
+ if (wait_forever || wait_for_timeout) {
+ // Write more if we have time.
+ // Use special routine to avoid pulling in uint64-float-compatible math routines.
+ uint64_t timeout_ms = float_to_uint64(self->write_timeout * 1000); // Junk value if write_timeout < 0.
+ uint64_t start_ticks = supervisor_ticks_ms64();
+
+ uint32_t num_written = 0;
+ while (total_num_written < len &&
+ (wait_forever || supervisor_ticks_ms64() - start_ticks <= timeout_ms)) {
+
+ // Wait for a bit, and check for ctrl-C.
+ RUN_BACKGROUND_TASKS;
+ if (mp_hal_is_interrupted()) {
+ return 0;
+ }
+
+ // Advance buffer pointer and reduce number of bytes that need to be written.
+ len -= num_written;
+ data += num_written;
+
+ // Try to write another batch of bytes.
+ num_written = tud_cdc_n_write(self->idx, data, len);
+ tud_cdc_n_write_flush(self->idx);
+ total_num_written += num_written;
+ }
+ }
+
+ return total_num_written;
+}
+
+uint32_t common_hal_usb_cdc_serial_get_in_waiting(usb_cdc_serial_obj_t *self) {
+ return tud_cdc_n_available(self->idx);
+}
+
+uint32_t common_hal_usb_cdc_serial_get_out_waiting(usb_cdc_serial_obj_t *self) {
+ // Return number of FIFO bytes currently occupied.
+ return CFG_TUD_CDC_TX_BUFSIZE - tud_cdc_n_write_available(self->idx);
+}
+
+void common_hal_usb_cdc_serial_reset_input_buffer(usb_cdc_serial_obj_t *self) {
+ tud_cdc_n_read_flush(self->idx);
+}
+
+uint32_t common_hal_usb_cdc_serial_reset_output_buffer(usb_cdc_serial_obj_t *self) {
+ return tud_cdc_n_write_clear(self->idx);
+}
+
+uint32_t common_hal_usb_cdc_serial_flush(usb_cdc_serial_obj_t *self) {
+ return tud_cdc_n_write_flush(self->idx);
+}
+
+bool common_hal_usb_cdc_serial_get_connected(usb_cdc_serial_obj_t *self) {
+ return tud_cdc_n_connected(self->idx);
+}
+
+mp_float_t common_hal_usb_cdc_serial_get_timeout(usb_cdc_serial_obj_t *self) {
+ return self->timeout;
+}
+
+void common_hal_usb_cdc_serial_set_timeout(usb_cdc_serial_obj_t *self, mp_float_t timeout) {
+ self->timeout = timeout;
+}
+
+mp_float_t common_hal_usb_cdc_serial_get_write_timeout(usb_cdc_serial_obj_t *self) {
+ return self->write_timeout;
+}
+
+void common_hal_usb_cdc_serial_set_write_timeout(usb_cdc_serial_obj_t *self, mp_float_t write_timeout) {
+ self->write_timeout = write_timeout;
+}
diff --git a/shared-module/usb_cdc/Serial.h b/shared-module/usb_cdc/Serial.h
new file mode 100644
index 000000000..ddf78eefa
--- /dev/null
+++ b/shared-module/usb_cdc/Serial.h
@@ -0,0 +1,39 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Dan Halbert for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * 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 SHARED_MODULE_USB_CDC_SERIAL_H
+#define SHARED_MODULE_USB_CDC_SERIAL_H
+
+#include "py/obj.h"
+
+typedef struct {
+ mp_obj_base_t base;
+ mp_float_t timeout; // if negative, wait forever.
+ mp_float_t write_timeout; // if negative, wait forever.
+ uint8_t idx; // which CDC device?
+} usb_cdc_serial_obj_t;
+
+#endif // SHARED_MODULE_USB_CDC_SERIAL_H
diff --git a/shared-module/usb_cdc/__init__.c b/shared-module/usb_cdc/__init__.c
new file mode 100644
index 000000000..fe05cb107
--- /dev/null
+++ b/shared-module/usb_cdc/__init__.c
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Dan Halbert for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * 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 "genhdr/autogen_usb_descriptor.h"
+#include "py/gc.h"
+#include "py/obj.h"
+#include "py/mphal.h"
+#include "py/runtime.h"
+#include "py/objtuple.h"
+#include "shared-bindings/usb_cdc/__init__.h"
+#include "shared-bindings/usb_cdc/Serial.h"
+#include "tusb.h"
+
+#if CFG_TUD_CDC != 2
+#error CFG_TUD_CDC must be exactly 2
+#endif
+
+static usb_cdc_serial_obj_t serial_objs[CFG_TUD_CDC] = {
+ { .base.type = &usb_cdc_serial_type,
+ .timeout = -1.0f,
+ .write_timeout = -1.0f,
+ .idx = 0,
+ }, {
+ .base.type = &usb_cdc_serial_type,
+ .timeout = -1.0f,
+ .write_timeout = -1.0f,
+ .idx = 1,
+ }
+};
+
+const mp_rom_obj_tuple_t usb_cdc_serials_tuple = {
+ .base.type = &mp_type_tuple,
+ .len = CFG_TUD_CDC,
+ .items = {
+ &serial_objs[0],
+ &serial_objs[1],
+ },
+};
diff --git a/shared-module/usb_cdc/__init__.h b/shared-module/usb_cdc/__init__.h
new file mode 100644
index 000000000..9de3eb2fa
--- /dev/null
+++ b/shared-module/usb_cdc/__init__.h
@@ -0,0 +1,34 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2021 Dan Halbert for Adafruit Industries
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * 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 SHARED_MODULE_USB_CDC___INIT___H
+#define SHARED_MODULE_USB_CDC___INIT___H
+
+#include "py/objtuple.h"
+
+extern const mp_rom_obj_tuple_t usb_cdc_serials_tuple;
+
+#endif /* SHARED_MODULE_USB_CDC___INIT___H */
diff --git a/supervisor/shared/background_callback.c b/supervisor/shared/background_callback.c
index 288c9a4df..68a0a9667 100644
--- a/supervisor/shared/background_callback.c
+++ b/supervisor/shared/background_callback.c
@@ -33,7 +33,7 @@
#include "supervisor/shared/tick.h"
#include "shared-bindings/microcontroller/__init__.h"
-STATIC volatile background_callback_t *callback_head, *callback_tail;
+STATIC volatile background_callback_t * volatile callback_head, * volatile callback_tail;
#define CALLBACK_CRITICAL_BEGIN (common_hal_mcu_disable_interrupts())
#define CALLBACK_CRITICAL_END (common_hal_mcu_enable_interrupts())
@@ -50,7 +50,6 @@ void background_callback_add_core(background_callback_t *cb) {
cb->prev = (background_callback_t*)callback_tail;
if (callback_tail) {
callback_tail->next = cb;
- cb->prev = (background_callback_t*)callback_tail;
}
if (!callback_head) {
callback_head = cb;
diff --git a/supervisor/shared/serial.c b/supervisor/shared/serial.c
index 303f89e75..9cc12de51 100644
--- a/supervisor/shared/serial.c
+++ b/supervisor/shared/serial.c
@@ -47,6 +47,10 @@ busio_uart_obj_t debug_uart;
byte buf_array[64];
#endif
+#if CIRCUITPY_USB_VENDOR
+bool tud_vendor_connected(void);
+#endif
+
void serial_early_init(void) {
#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX)
debug_uart.base.type = &busio_uart_type;
@@ -66,6 +70,12 @@ void serial_init(void) {
}
bool serial_connected(void) {
+#if CIRCUITPY_USB_VENDOR
+ if (tud_vendor_connected()) {
+ return true;
+ }
+#endif
+
#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX)
return true;
#else
@@ -74,6 +84,14 @@ bool serial_connected(void) {
}
char serial_read(void) {
+#if CIRCUITPY_USB_VENDOR
+ if (tud_vendor_connected() && tud_vendor_available() > 0) {
+ char tiny_buffer;
+ tud_vendor_read(&tiny_buffer, 1);
+ return tiny_buffer;
+ }
+#endif
+
#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX)
if (tud_cdc_connected() && tud_cdc_available() > 0) {
return (char) tud_cdc_read_char();
@@ -88,13 +106,18 @@ char serial_read(void) {
}
bool serial_bytes_available(void) {
+#if CIRCUITPY_USB_VENDOR
+ if (tud_vendor_connected() && tud_vendor_available() > 0) {
+ return true;
+ }
+#endif
+
#if defined(DEBUG_UART_TX) && defined(DEBUG_UART_RX)
return common_hal_busio_uart_rx_characters_available(&debug_uart) || (tud_cdc_available() > 0);
#else
return tud_cdc_available() > 0;
#endif
}
-
void serial_write_substring(const char* text, uint32_t length) {
if (length == 0) {
return;
@@ -104,6 +127,12 @@ void serial_write_substring(const char* text, uint32_t length) {
common_hal_terminalio_terminal_write(&supervisor_terminal, (const uint8_t*) text, length, &errcode);
#endif
+#if CIRCUITPY_USB_VENDOR
+ if (tud_vendor_connected()) {
+ tud_vendor_write(text, length);
+ }
+#endif
+
uint32_t count = 0;
while (count < length && tud_cdc_connected()) {
count += tud_cdc_write(text + count, length - count);
diff --git a/supervisor/shared/usb/tusb_config.h b/supervisor/shared/usb/tusb_config.h
index 15d9fabaf..bff7bd6b5 100644
--- a/supervisor/shared/usb/tusb_config.h
+++ b/supervisor/shared/usb/tusb_config.h
@@ -61,13 +61,19 @@
// DEVICE CONFIGURATION
//--------------------------------------------------------------------+
-#define CFG_TUD_ENDOINT0_SIZE 64
+#define CFG_TUD_ENDPOINT0_SIZE 64
//------------- CLASS -------------//
+
+// Could be 2 if secondary CDC channel requested.
+#ifndef CFG_TUD_CDC
#define CFG_TUD_CDC 1
+#endif
+
#define CFG_TUD_MSC 1
#define CFG_TUD_HID CIRCUITPY_USB_HID
#define CFG_TUD_MIDI CIRCUITPY_USB_MIDI
+#define CFG_TUD_VENDOR CIRCUITPY_USB_VENDOR
#define CFG_TUD_CUSTOM_CLASS 0
/*------------------------------------------------------------------*/
diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c
index 07c6aee6c..aa35b95e6 100644
--- a/supervisor/shared/usb/usb.c
+++ b/supervisor/shared/usb/usb.c
@@ -26,7 +26,6 @@
#include "py/objstr.h"
#include "shared-bindings/microcontroller/Processor.h"
-#include "shared-module/usb_midi/__init__.h"
#include "supervisor/background_callback.h"
#include "supervisor/port.h"
#include "supervisor/serial.h"
@@ -35,8 +34,25 @@
#include "lib/utils/interrupt_char.h"
#include "lib/mp-readline/readline.h"
+#if CIRCUITPY_USB_MIDI
+#include "shared-module/usb_midi/__init__.h"
+#endif
+
#include "tusb.h"
+#if CIRCUITPY_USB_VENDOR
+#include "genhdr/autogen_usb_descriptor.h"
+
+// The WebUSB support being conditionally added to this file is based on the
+// tinyusb demo examples/device/webusb_serial.
+
+extern const tusb_desc_webusb_url_t desc_webusb_url;
+
+static bool web_serial_connected = false;
+#endif
+
+
+
// Serial number as hex characters. This writes directly to the USB
// descriptor.
extern uint16_t usb_serial_number[1 + COMMON_HAL_MCU_PROCESSOR_UID_LENGTH * 2];
@@ -46,6 +62,7 @@ void load_serial_number(void) {
uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH];
common_hal_mcu_processor_get_uid(raw_id);
+ usb_serial_number[0] = 0x300 | sizeof(usb_serial_number);
for (int i = 0; i < COMMON_HAL_MCU_PROCESSOR_UID_LENGTH; i++) {
for (int j = 0; j < 2; j++) {
uint8_t nibble = (raw_id[i] >> (j * 4)) & 0xf;
@@ -98,9 +115,14 @@ static void usb_background_do(void* unused) {
usb_background();
}
+void usb_background_schedule(void)
+{
+ background_callback_add(&usb_callback, usb_background_do, NULL);
+}
+
void usb_irq_handler(void) {
tud_int_handler(0);
- background_callback_add(&usb_callback, usb_background_do, NULL);
+ usb_background_schedule();
}
//--------------------------------------------------------------------+
@@ -145,6 +167,62 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts) {
}
}
+#if CIRCUITPY_USB_VENDOR
+//--------------------------------------------------------------------+
+// WebUSB use vendor class
+//--------------------------------------------------------------------+
+
+bool tud_vendor_connected(void)
+{
+ return web_serial_connected;
+}
+
+// Invoked when a control transfer occurred on an interface of this class
+// Driver response accordingly to the request and the transfer stage (setup/data/ack)
+// return false to stall control endpoint (e.g unsupported request)
+bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t const * request)
+{
+ // nothing to with DATA & ACK stage
+ if (stage != CONTROL_STAGE_SETUP ) return true;
+
+ switch (request->bRequest)
+ {
+ case VENDOR_REQUEST_WEBUSB:
+ // match vendor request in BOS descriptor
+ // Get landing page url
+ return tud_control_xfer(rhport, request, (void*) &desc_webusb_url, desc_webusb_url.bLength);
+
+ case VENDOR_REQUEST_MICROSOFT:
+ if ( request->wIndex == 7 )
+ {
+ // Get Microsoft OS 2.0 compatible descriptor
+ uint16_t total_len;
+ memcpy(&total_len, desc_ms_os_20+8, 2);
+
+ return tud_control_xfer(rhport, request, (void*) desc_ms_os_20, total_len);
+ } else
+ {
+ return false;
+ }
+
+ case 0x22:
+ // Webserial simulate the CDC_REQUEST_SET_CONTROL_LINE_STATE (0x22) to
+ // connect and disconnect.
+ web_serial_connected = (request->wValue != 0);
+
+ // response with status OK
+ return tud_control_status(rhport, request);
+
+ default:
+ // stall unknown request
+ return false;
+ }
+
+ return true;
+}
+#endif // CIRCUITPY_USB_VENDOR
+
+
#if MICROPY_KBD_EXCEPTION
/**
diff --git a/supervisor/shared/usb/usb_desc.c b/supervisor/shared/usb/usb_desc.c
index 080187ebc..419a70ab3 100644
--- a/supervisor/shared/usb/usb_desc.c
+++ b/supervisor/shared/usb/usb_desc.c
@@ -43,12 +43,14 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index) {
return usb_desc_cfg;
}
+#if CIRCUITPY_USB_HID
// Invoked when received GET HID REPORT DESCRIPTOR
// Application return pointer to descriptor
// Descriptor contents must exist long enough for transfer to complete
uint8_t const * tud_hid_descriptor_report_cb(void) {
return hid_report_descriptor;
}
+#endif
// Invoked when received GET STRING DESCRIPTOR request
// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk
index a59e99e3d..374b7a72b 100644
--- a/supervisor/supervisor.mk
+++ b/supervisor/supervisor.mk
@@ -14,23 +14,15 @@ SRC_SUPERVISOR = \
supervisor/shared/tick.c \
supervisor/shared/translate.c
-ifndef $(NO_USB)
- NO_USB = $(wildcard supervisor/usb.c)
-endif
+NO_USB ?= $(wildcard supervisor/usb.c)
-ifndef INTERNAL_FLASH_FILESYSTEM
-INTERNAL_FLASH_FILESYSTEM = 0
-endif
+INTERNAL_FLASH_FILESYSTEM ?= 0
CFLAGS += -DINTERNAL_FLASH_FILESYSTEM=$(INTERNAL_FLASH_FILESYSTEM)
-ifndef QSPI_FLASH_FILESYSTEM
-QSPI_FLASH_FILESYSTEM = 0
-endif
+QSPI_FLASH_FILESYSTEM ?= 0
CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM)
-ifndef SPI_FLASH_FILESYSTEM
-SPI_FLASH_FILESYSTEM = 0
-endif
+SPI_FLASH_FILESYSTEM ?= 0
CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM)
ifeq ($(CIRCUITPY_BLEIO),1)
@@ -41,141 +33,181 @@ endif
# (Right now INTERNAL_FLASH_FILESYSTEM and (Q)SPI_FLASH_FILESYSTEM are mutually exclusive.
# But that might not be true in the future.)
ifdef EXTERNAL_FLASH_DEVICES
- CFLAGS += -DEXTERNAL_FLASH_DEVICES=$(EXTERNAL_FLASH_DEVICES) \
- -DEXTERNAL_FLASH_DEVICE_COUNT=$(EXTERNAL_FLASH_DEVICE_COUNT)
-
- SRC_SUPERVISOR += supervisor/shared/external_flash/external_flash.c
- ifeq ($(SPI_FLASH_FILESYSTEM),1)
- SRC_SUPERVISOR += supervisor/shared/external_flash/spi_flash.c
- else
- endif
- ifeq ($(QSPI_FLASH_FILESYSTEM),1)
- SRC_SUPERVISOR += supervisor/qspi_flash.c supervisor/shared/external_flash/qspi_flash.c
- endif
+ CFLAGS += -DEXTERNAL_FLASH_DEVICES=$(EXTERNAL_FLASH_DEVICES) \
+ -DEXTERNAL_FLASH_DEVICE_COUNT=$(EXTERNAL_FLASH_DEVICE_COUNT)
+
+ SRC_SUPERVISOR += supervisor/shared/external_flash/external_flash.c
+ ifeq ($(SPI_FLASH_FILESYSTEM),1)
+ SRC_SUPERVISOR += supervisor/shared/external_flash/spi_flash.c
+ endif
+ ifeq ($(QSPI_FLASH_FILESYSTEM),1)
+ SRC_SUPERVISOR += supervisor/qspi_flash.c supervisor/shared/external_flash/qspi_flash.c
+ endif
else
- ifeq ($(DISABLE_FILESYSTEM),1)
- SRC_SUPERVISOR += supervisor/stub/internal_flash.c
- else
- SRC_SUPERVISOR += supervisor/internal_flash.c
- endif
+ ifeq ($(DISABLE_FILESYSTEM),1)
+ SRC_SUPERVISOR += supervisor/stub/internal_flash.c
+ else
+ SRC_SUPERVISOR += supervisor/internal_flash.c
+ endif
endif
ifeq ($(USB),FALSE)
- ifeq ($(wildcard supervisor/serial.c),)
- SRC_SUPERVISOR += supervisor/stub/serial.c
- else
- SRC_SUPERVISOR += supervisor/serial.c
- endif
+ ifeq ($(wildcard supervisor/serial.c),)
+ SRC_SUPERVISOR += supervisor/stub/serial.c
+ else
+ SRC_SUPERVISOR += supervisor/serial.c
+ endif
else
- SRC_SUPERVISOR += \
- lib/tinyusb/src/common/tusb_fifo.c \
- lib/tinyusb/src/device/usbd.c \
- lib/tinyusb/src/device/usbd_control.c \
- lib/tinyusb/src/class/msc/msc_device.c \
- lib/tinyusb/src/class/cdc/cdc_device.c \
- lib/tinyusb/src/tusb.c \
- supervisor/shared/serial.c \
- supervisor/shared/workflow.c \
- supervisor/usb.c \
- supervisor/shared/usb/usb_desc.c \
- supervisor/shared/usb/usb.c \
- supervisor/shared/usb/usb_msc_flash.c \
- $(BUILD)/autogen_usb_descriptor.c
-
- ifeq ($(CIRCUITPY_USB_HID), 1)
- SRC_SUPERVISOR += \
- lib/tinyusb/src/class/hid/hid_device.c \
- shared-bindings/usb_hid/__init__.c \
- shared-bindings/usb_hid/Device.c \
- shared-module/usb_hid/__init__.c \
- shared-module/usb_hid/Device.c
- endif
-
- ifeq ($(CIRCUITPY_USB_MIDI), 1)
- SRC_SUPERVISOR += \
- lib/tinyusb/src/class/midi/midi_device.c \
- shared-bindings/usb_midi/__init__.c \
- shared-bindings/usb_midi/PortIn.c \
- shared-bindings/usb_midi/PortOut.c \
- shared-module/usb_midi/__init__.c \
- shared-module/usb_midi/PortIn.c \
- shared-module/usb_midi/PortOut.c
- endif
-
- CFLAGS += -DUSB_AVAILABLE
+ SRC_SUPERVISOR += \
+ lib/tinyusb/src/class/cdc/cdc_device.c \
+ lib/tinyusb/src/common/tusb_fifo.c \
+ lib/tinyusb/src/device/usbd.c \
+ lib/tinyusb/src/device/usbd_control.c \
+ lib/tinyusb/src/tusb.c \
+ supervisor/shared/serial.c \
+ supervisor/shared/workflow.c \
+ supervisor/usb.c \
+ supervisor/shared/usb/usb_desc.c \
+ supervisor/shared/usb/usb.c \
+ $(BUILD)/autogen_usb_descriptor.c \
+
+ ifeq ($(CIRCUITPY_USB_CDC), 1)
+ SRC_SUPERVISOR += \
+ shared-bindings/usb_cdc/__init__.c \
+ shared-bindings/usb_cdc/Serial.c \
+ shared-module/usb_cdc/__init__.c \
+ shared-module/usb_cdc/Serial.c \
+
+ endif
+
+ ifeq ($(CIRCUITPY_USB_HID), 1)
+ SRC_SUPERVISOR += \
+ lib/tinyusb/src/class/hid/hid_device.c \
+ shared-bindings/usb_hid/__init__.c \
+ shared-bindings/usb_hid/Device.c \
+ shared-module/usb_hid/__init__.c \
+ shared-module/usb_hid/Device.c \
+
+ endif
+
+ ifeq ($(CIRCUITPY_USB_MIDI), 1)
+ SRC_SUPERVISOR += \
+ lib/tinyusb/src/class/midi/midi_device.c \
+ shared-bindings/usb_midi/__init__.c \
+ shared-bindings/usb_midi/PortIn.c \
+ shared-bindings/usb_midi/PortOut.c \
+ shared-module/usb_midi/__init__.c \
+ shared-module/usb_midi/PortIn.c \
+ shared-module/usb_midi/PortOut.c \
+
+ endif
+
+ ifeq ($(CIRCUITPY_USB_MSC), 1)
+ SRC_SUPERVISOR += \
+ lib/tinyusb/src/class/msc/msc_device.c \
+ supervisor/shared/usb/usb_msc_flash.c \
+
+ endif
+
+ ifeq ($(CIRCUITPY_USB_VENDOR), 1)
+ SRC_SUPERVISOR += \
+ lib/tinyusb/src/class/vendor/vendor_device.c \
+
+ endif
+
+ CFLAGS += -DUSB_AVAILABLE
endif
SUPERVISOR_O = $(addprefix $(BUILD)/, $(SRC_SUPERVISOR:.c=.o))
ifeq ($(CIRCUITPY_DISPLAYIO), 1)
- SRC_SUPERVISOR += \
- supervisor/shared/display.c
+ SRC_SUPERVISOR += \
+ supervisor/shared/display.c
- ifeq ($(CIRCUITPY_TERMINALIO), 1)
- SUPERVISOR_O += $(BUILD)/autogen_display_resources.o
- endif
+ ifeq ($(CIRCUITPY_TERMINALIO), 1)
+ SUPERVISOR_O += $(BUILD)/autogen_display_resources.o
+ endif
endif
-ifndef USB_INTERFACE_NAME
-USB_INTERFACE_NAME = "CircuitPython"
+
+USB_INTERFACE_NAME ?= "CircuitPython"
+
+ifneq ($(USB_VID),)
+CFLAGS += -DUSB_VID=$(USB_VID)
+CFLAGS += -DSUB_PID=$(USB_PID)
+CFLAGS += -DUSB_MANUFACTURER=$(USB_MANUFACTURER)
+CFLAGS += -DUSB_PRODUCT=$(USB_PRODUCT)
endif
-USB_DEVICES_COMPUTED := CDC,MSC
-ifeq ($(CIRCUITPY_USB_MIDI),1)
-USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),AUDIO
+# In the following URL, don't include the https:// prefix.
+# It gets added automatically.
+USB_WEBUSB_URL ?= "circuitpython.org"
+
+ifeq ($(CIRCUITPY_REPL_USB),1)
+USB_DEVICES += CDC
endif
+
ifeq ($(CIRCUITPY_USB_HID),1)
-USB_DEVICES_COMPUTED := $(USB_DEVICES_COMPUTED),HID
+USB_DEVICES += HID
endif
-USB_DEVICES ?= "$(USB_DEVICES_COMPUTED)"
-
-ifndef USB_HID_DEVICES
-USB_HID_DEVICES = "KEYBOARD,MOUSE,CONSUMER,GAMEPAD"
+ifeq ($(CIRCUITPY_USB_MIDI),1)
+USB_DEVICES += AUDIO
endif
-
-ifndef USB_HIGHSPEED
-USB_HIGHSPEED = 0
+ifeq ($(CIRCUITPY_USB_MSC),1)
+USB_DEVICES += MSC
endif
-
-ifndef USB_CDC_EP_NUM_NOTIFICATION
-USB_CDC_EP_NUM_NOTIFICATION = 0
+ifeq ($(CIRCUITPY_USB_CDC),1)
+# Inform TinyUSB there are two CDC devices.
+CFLAGS += -DCFG_TUD_CDC=2
+USB_DEVICES += CDC2
endif
-
-ifndef USB_CDC_EP_NUM_DATA_OUT
-USB_CDC_EP_NUM_DATA_OUT = 0
+ifeq ($(CIRCUITPY_USB_VENDOR),1)
+USB_DEVICES += VENDOR
endif
-ifndef USB_CDC_EP_NUM_DATA_IN
-USB_CDC_EP_NUM_DATA_IN = 0
+USB_HID_DEVICES =
+ifeq ($(CIRCUITPY_USB_HID_CONSUMER),1)
+USB_HID_DEVICES += CONSUMER
endif
-
-ifndef USB_MSC_EP_NUM_OUT
-USB_MSC_EP_NUM_OUT = 0
+ifeq ($(CIRCUITPY_USB_HID_DIGITIZER),1)
+USB_HID_DEVICES += DIGITIZER
endif
-
-ifndef USB_MSC_EP_NUM_IN
-USB_MSC_EP_NUM_IN = 0
+ifeq ($(CIRCUITPY_USB_HID_GAMEPAD),1)
+USB_HID_DEVICES += GAMEPAD
endif
-
-ifndef USB_HID_EP_NUM_OUT
-USB_HID_EP_NUM_OUT = 0
+ifeq ($(CIRCUITPY_USB_HID_KEYBOARD),1)
+USB_HID_DEVICES += KEYBOARD
endif
-
-ifndef USB_HID_EP_NUM_IN
-USB_HID_EP_NUM_IN = 0
+ifeq ($(CIRCUITPY_USB_HID_MOUSE),1)
+USB_HID_DEVICES += MOUSE
endif
-
-ifndef USB_MIDI_EP_NUM_OUT
-USB_MIDI_EP_NUM_OUT = 0
+ifeq ($(CIRCUITPY_USB_HID_SYS_CONTROL),1)
+USB_HID_DEVICES += SYS_CONTROL
endif
-
-ifndef USB_MIDI_EP_NUM_IN
-USB_MIDI_EP_NUM_IN = 0
+ifeq ($(CIRCUITPY_USB_HID_XAC_COMPATIBLE_GAMEPAD),1)
+USB_HID_DEVICES += XAC_COMPATIBLE_GAMEPAD
endif
-ifndef USB_NUM_EP
-USB_NUM_EP = 0
+# RAW is not compatible with other HID devices.
+ifeq ($(CIRCUITPY_USB_HID_RAW),1)
+ ifneq ($(CIRCUITPY_USB_HID_DEVICES,)
+ $(error HID RAW must not be combined with other HID devices)
+endif
+USB_HID_DEVICES += MOUSE
endif
+USB_HIGHSPEED ?= 0
+
+USB_CDC_EP_NUM_NOTIFICATION ?= 0
+USB_CDC_EP_NUM_DATA_OUT ?= 0
+USB_CDC_EP_NUM_DATA_IN ?= 0
+USB_MSC_EP_NUM_OUT ?= 0
+USB_MSC_EP_NUM_IN ?= 0
+USB_HID_EP_NUM_OUT ?= 0
+USB_HID_EP_NUM_IN ?= 0
+USB_MIDI_EP_NUM_OUT ?= 0
+USB_MIDI_EP_NUM_IN ?= 0
+USB_NUM_EP ?= 0
+
USB_DESCRIPTOR_ARGS = \
--manufacturer $(USB_MANUFACTURER)\
--product $(USB_PRODUCT)\
@@ -183,8 +215,8 @@ USB_DESCRIPTOR_ARGS = \
--pid $(USB_PID)\
--serial_number_length $(USB_SERIAL_NUMBER_LENGTH)\
--interface_name $(USB_INTERFACE_NAME)\
- --devices $(USB_DEVICES)\
- --hid_devices $(USB_HID_DEVICES)\
+ --devices "$(USB_DEVICES)"\
+ --hid_devices "$(USB_HID_DEVICES)"\
--max_ep $(USB_NUM_EP) \
--cdc_ep_num_notification $(USB_CDC_EP_NUM_NOTIFICATION)\
--cdc_ep_num_data_out $(USB_CDC_EP_NUM_DATA_OUT)\
@@ -198,6 +230,12 @@ USB_DESCRIPTOR_ARGS = \
--output_c_file $(BUILD)/autogen_usb_descriptor.c\
--output_h_file $(BUILD)/genhdr/autogen_usb_descriptor.h
+ifeq ($(CIRCUITPY_USB_VENDOR), 1)
+USB_DESCRIPTOR_ARGS += \
+ --vendor_ep_num_out 0 --vendor_ep_num_in 0 \
+ --webusb_url $(USB_WEBUSB_URL)
+endif
+
ifeq ($(USB_RENUMBER_ENDPOINTS), 0)
USB_DESCRIPTOR_ARGS += --no-renumber_endpoints
endif
diff --git a/supervisor/usb.h b/supervisor/usb.h
index ccb35470c..1c709926a 100644
--- a/supervisor/usb.h
+++ b/supervisor/usb.h
@@ -35,6 +35,9 @@
// it may be necessary to call it directly.
void usb_background(void);
+// Schedule usb background
+void usb_background_schedule(void);
+
// Ports must call this from their particular USB IRQ handler
void usb_irq_handler(void);
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-mono-signed.wav
new file mode 100644
index 000000000..cd3da395b
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-mono-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-stereo-signed.wav
new file mode 100644
index 000000000..c1036475b
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-16bit-stereo-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-mono-signed.wav
new file mode 100644
index 000000000..6aa6afc7a
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-mono-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-stereo-signed.wav
new file mode 100644
index 000000000..c175aaf61
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-24bit-stereo-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-mono-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-mono-unsigned.wav
new file mode 100644
index 000000000..ccf63b9c1
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-mono-unsigned.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-stereo-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-stereo-unsigned.wav
new file mode 100644
index 000000000..63aaa5b29
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-16000-8bit-stereo-unsigned.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-mono-signed.wav
new file mode 100644
index 000000000..147b14b16
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-mono-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-stereo-signed.wav
new file mode 100644
index 000000000..adfe84fb0
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-16bit-stereo-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-mono-signed.wav
new file mode 100644
index 000000000..2c5337045
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-mono-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-stereo-signed.wav
new file mode 100644
index 000000000..a290c6c37
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-24bit-stereo-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-mono-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-mono-unsigned.wav
new file mode 100644
index 000000000..cd1c79280
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-mono-unsigned.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-stereo-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-stereo-unsigned.wav
new file mode 100644
index 000000000..12c48e258
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-8bit-stereo-unsigned.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-stereo.mp3 b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-stereo.mp3
new file mode 100644
index 000000000..fd820e69a
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-44100-stereo.mp3
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-mono-signed.wav
new file mode 100644
index 000000000..a730c2b84
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-mono-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-stereo-signed.wav
new file mode 100644
index 000000000..5038ae8ae
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-16bit-stereo-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-mono-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-mono-signed.wav
new file mode 100644
index 000000000..ac25cddb3
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-mono-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-stereo-signed.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-stereo-signed.wav
new file mode 100644
index 000000000..6fec67431
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-24bit-stereo-signed.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-mono-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-mono-unsigned.wav
new file mode 100644
index 000000000..d5e49b24b
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-mono-unsigned.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-stereo-unsigned.wav b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-stereo-unsigned.wav
new file mode 100644
index 000000000..3df7945aa
--- /dev/null
+++ b/tests/circuitpython-manual/audiocore/jeplayer-splash-8000-8bit-stereo-unsigned.wav
Binary files differ
diff --git a/tests/circuitpython-manual/audiopwmio/single_buffer_loop.py b/tests/circuitpython-manual/audiopwmio/single_buffer_loop.py
new file mode 100644
index 000000000..dfac475b5
--- /dev/null
+++ b/tests/circuitpython-manual/audiopwmio/single_buffer_loop.py
@@ -0,0 +1,65 @@
+import audiocore
+import audiopwmio
+import board
+import digitalio
+import array
+import time
+import math
+
+trigger = digitalio.DigitalInOut(board.D4)
+trigger.switch_to_output(True)
+
+# Generate one period of sine wav.
+length = 8000 // 440
+
+samples = []
+sample_names = [
+"unsigned 8 bit",
+"signed 8 bit",
+"unsigned 16 bit",
+"signed 16 bit"
+]
+
+
+# unsigned 8 bit
+u8 = array.array("B", [0] * length)
+for i in range(length):
+ u8[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 7) + 2 ** 7)
+
+samples.append(audiocore.RawSample(u8, sample_rate=4000))
+
+# signed 8 bit
+s8 = array.array("b", [0] * length)
+for i in range(length):
+ s8[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 7))
+
+samples.append(audiocore.RawSample(s8, sample_rate=16000))
+
+# unsigned 16 bit
+u16 = array.array("H", [0] * length)
+for i in range(length):
+ u16[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15) + 2 ** 15)
+
+samples.append(audiocore.RawSample(u16, sample_rate=8000))
+
+
+# signed 16 bit
+s16 = array.array("h", [0] * length)
+for i in range(length):
+ s16[i] = int(math.sin(math.pi * 2 * i / length) * (2 ** 15))
+
+samples.append(audiocore.RawSample(s16, sample_rate=8000))
+
+
+dac = audiopwmio.PWMAudioOut(board.D13)
+for sample, name in zip(samples, sample_names):
+ print(name)
+ trigger.value = False
+ dac.play(sample, loop=True)
+ time.sleep(1)
+ dac.stop()
+ time.sleep(0.1)
+ trigger.value = True
+ print()
+
+print("done")
diff --git a/tests/circuitpython-manual/audiopwmio/wavefile_pause_resume.py b/tests/circuitpython-manual/audiopwmio/wavefile_pause_resume.py
new file mode 100644
index 000000000..27912d321
--- /dev/null
+++ b/tests/circuitpython-manual/audiopwmio/wavefile_pause_resume.py
@@ -0,0 +1,39 @@
+import audiocore
+import audiopwmio
+import board
+import digitalio
+import time
+import math
+import os
+
+trigger = digitalio.DigitalInOut(board.D4)
+trigger.switch_to_output(True)
+
+sample_prefix = "jeplayer-splash"
+
+samples = []
+for fn in os.listdir("/"):
+ if fn.startswith(sample_prefix):
+ samples.append(fn)
+
+dac = audiopwmio.PWMAudioOut(left_channel=board.D12, right_channel=board.D13)
+for filename in samples:
+ print("playing", filename)
+ with open(filename, "rb") as sample_file:
+ try:
+ sample = audiocore.WaveFile(sample_file)
+ except OSError as e:
+ print(e)
+ continue
+ trigger.value = False
+ dac.play(sample)
+ while dac.playing:
+ time.sleep(0.1)
+ dac.pause()
+ time.sleep(0.1)
+ dac.resume()
+ trigger.value = True
+ time.sleep(0.1)
+ print()
+
+print("done")
diff --git a/tests/circuitpython-manual/audiopwmio/wavefile_playback.py b/tests/circuitpython-manual/audiopwmio/wavefile_playback.py
new file mode 100644
index 000000000..0adbf2b19
--- /dev/null
+++ b/tests/circuitpython-manual/audiopwmio/wavefile_playback.py
@@ -0,0 +1,36 @@
+import audiocore
+import audiopwmio
+import board
+import digitalio
+import time
+import math
+import os
+
+trigger = digitalio.DigitalInOut(board.D4)
+trigger.switch_to_output(True)
+
+sample_prefix = "jeplayer-splash"
+
+samples = []
+for fn in os.listdir("/"):
+ if fn.startswith(sample_prefix):
+ samples.append(fn)
+
+dac = audiopwmio.PWMAudioOut(left_channel=board.D12, right_channel=board.D13)
+for filename in samples:
+ print("playing", filename)
+ with open(filename, "rb") as sample_file:
+ try:
+ sample = audiocore.WaveFile(sample_file)
+ except OSError as e:
+ print(e)
+ continue
+ trigger.value = False
+ dac.play(sample)
+ while dac.playing:
+ time.sleep(1)
+ trigger.value = True
+ time.sleep(0.1)
+ print()
+
+print("done")
diff --git a/tests/circuitpython-manual/socketpool/client/cpy-client.py b/tests/circuitpython-manual/socketpool/client/cpy-client.py
new file mode 100644
index 000000000..dcc742c9f
--- /dev/null
+++ b/tests/circuitpython-manual/socketpool/client/cpy-client.py
@@ -0,0 +1,26 @@
+import wifi
+import socketpool
+import ssl
+import time
+
+TIMEOUT = None
+HOST = '192.168.10.179'
+PORT = 5000
+
+# Connect to wifi
+print("Connecting to wifi")
+wifi.radio.connect("mySSID", "myPASS")
+pool = socketpool.SocketPool(wifi.radio)
+
+print("Creating Socket")
+with pool.socket(pool.AF_INET, pool.SOCK_STREAM) as s:
+ s.settimeout(TIMEOUT)
+
+ print("Connecting")
+ s.connect((HOST, PORT))
+ print("Sending")
+ sent = s.send(b'Hello, world')
+ print("Receiving")
+ buff = bytearray(128)
+ numbytes = s.recv_into(buff)
+print(repr(buff))
diff --git a/tests/circuitpython-manual/socketpool/client/host-server.py b/tests/circuitpython-manual/socketpool/client/host-server.py
new file mode 100644
index 000000000..fd7ceb7f1
--- /dev/null
+++ b/tests/circuitpython-manual/socketpool/client/host-server.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+import socket
+
+TIMEOUT = 10
+HOST = "192.168.10.179"
+PORT = 5000
+
+print("Create Socket")
+with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
+ s.settimeout(TIMEOUT)
+ s.bind((HOST, PORT))
+ s.listen()
+ print("Accepting connections")
+ while True:
+ try:
+ conn, addr = s.accept()
+ break
+ except BlockingIOError:
+ pass
+
+ with conn:
+ s.settimeout(TIMEOUT)
+ print('Connected by', addr)
+ data = conn.recv(128)
+ print("got: " + str(data))
+ conn.sendall(data)
+ print("sent: " + str(data))
diff --git a/tests/circuitpython-manual/socketpool/client/readme.md b/tests/circuitpython-manual/socketpool/client/readme.md
new file mode 100644
index 000000000..45cdf23c8
--- /dev/null
+++ b/tests/circuitpython-manual/socketpool/client/readme.md
@@ -0,0 +1,46 @@
+# Circuitpython as Client
+
+This example demonstrates the use of Socket as a client, accessing a server on a host development machine. This Circuitpython sketch uses the Connect, Send, and Recv_Into methods.
+
+## Prerequisites
+
+Circuitpython V6.2.0 minimum. Neither the host or client sketch has installed module prerequisites.
+
+## Setup
+
+Find a viable IP address for the host machine first and insert it in both sketches as HOST. On mac, this can be done by going to System Preferences/Network and checking the IP address used to connect to the local wireless network. Make sure that both devices are using the same WIFI!
+
+Each sketch can have Timeout values changed. The host sketch usually needs a value above 0, or the recv() will fail. Currently, Circuitpython's Connect function is always blocking, so changing the client timeout will not cause much change in behavior.
+
+Start the Server on the host PC first, within this folder:
+
+```
+python host-server.py
+```
+
+Then, reload the client sketch in Circuitpython.
+
+## Expected Behavior
+
+The example should connect to a server running on the host machine. The client will send a "Hello world" string to the server, which will return it.
+
+Expected client output:
+
+```
+Connecting to wifi
+Creating Socket
+Connecting
+Sending
+Receiving
+bytearray(b'Hello, world')
+```
+
+Expected Server output (IP/port values will vary):
+
+```
+Create Socket
+Accepting connections
+Connected by ('192.168.10.128', 64509)
+got: b'Hello, world'
+sent: b'Hello, world'
+```
diff --git a/tests/circuitpython-manual/socketpool/datagram/ntp.py b/tests/circuitpython-manual/socketpool/datagram/ntp.py
new file mode 100644
index 000000000..31d922858
--- /dev/null
+++ b/tests/circuitpython-manual/socketpool/datagram/ntp.py
@@ -0,0 +1,28 @@
+import wifi
+import socketpool
+import struct
+import time
+
+# connect to wifi
+print("Connecting to Wifi")
+wifi.radio.connect("mySSID", "myPASS")
+pool = socketpool.SocketPool(wifi.radio)
+
+# make socket
+print("Creating socket")
+sock = pool.socket(pool.AF_INET,pool.SOCK_DGRAM)
+
+# Fill packet
+packet = bytearray(48)
+packet[0] = 0b00100011 # Not leap second, NTP version 4, Client mode
+NTP_TO_UNIX_EPOCH = 2208988800 # 1970-01-01 00:00:00
+
+print("Sending packet")
+sock.sendto(packet, ("pool.ntp.org", 123))
+
+size, address = sock.recvfrom_into(packet)
+print("Received packet")
+
+seconds = struct.unpack_from("!I", packet, offset=len(packet) - 8)[0]
+print("Address:", address)
+print("Time:", time.localtime(seconds - NTP_TO_UNIX_EPOCH))
diff --git a/tests/circuitpython-manual/socketpool/datagram/readme.md b/tests/circuitpython-manual/socketpool/datagram/readme.md
new file mode 100644
index 000000000..f63f0abcc
--- /dev/null
+++ b/tests/circuitpython-manual/socketpool/datagram/readme.md
@@ -0,0 +1,19 @@
+# Circuitpython Datagrams
+
+This example demonstrates using UDP (datagrams) with the Socket module, accessing the time from an NTP server using `sendto` and `recvfrom_into`.
+
+## Prerequisites
+
+Circuitpython V6.2.0 minimum.
+
+## Expected behavior
+
+The Circuitpython device will attempt to connect to wifi, and send a request for the time to `pool.ntp.org`. It will then convert the seconds returned into a unix time struct.
+
+Expected output:
+```
+Sending packet
+Received packet
+Address: ('82.197.188.130', 31488)
+Time: struct_time(tm_year=2021, tm_mon=2, tm_mday=11, tm_hour=22, tm_min=22, tm_sec=40, tm_wday=3, tm_yday=42, tm_isdst=-1)
+```
diff --git a/tests/circuitpython-manual/socketpool/server/cpy-server.py b/tests/circuitpython-manual/socketpool/server/cpy-server.py
new file mode 100644
index 000000000..d865156bc
--- /dev/null
+++ b/tests/circuitpython-manual/socketpool/server/cpy-server.py
@@ -0,0 +1,31 @@
+import wifi
+import socketpool
+
+TIMEOUT = None
+
+print("Connecting to Wifi")
+wifi.radio.connect("mySSID", "myPASS")
+
+pool = socketpool.SocketPool(wifi.radio)
+
+print("Finding IP address")
+print(wifi.radio.ipv4_address)
+HOST = str(wifi.radio.ipv4_address)
+PORT = 80 # Port to listen on
+
+print("Creating socket")
+sock = pool.socket(pool.AF_INET,pool.SOCK_STREAM)
+
+sock.bind((HOST, PORT))
+sock.listen(1)
+print("Accepting connections")
+conn, addr = sock.accept()
+with conn:
+ print('Connected by', addr)
+ buff = bytearray(128)
+ print("Receiving")
+ numbytes = conn.recvfrom_into(buff)
+ print(buff[:numbytes[0]])
+ if numbytes:
+ print("Sending")
+ conn.send(buff[:numbytes[0]])
diff --git a/tests/circuitpython-manual/socketpool/server/host-client.py b/tests/circuitpython-manual/socketpool/server/host-client.py
new file mode 100644
index 000000000..b482755d8
--- /dev/null
+++ b/tests/circuitpython-manual/socketpool/server/host-client.py
@@ -0,0 +1,17 @@
+import socket
+
+HOST = '192.168.10.128' # The server's hostname or IP address
+PORT = 80 # The port used by the server
+
+with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
+ s.settimeout(None)
+
+ print("Connecting")
+ s.connect((HOST, PORT))
+
+ print("Sending")
+ s.send(b'Hello, world')
+
+ print("Receiving")
+ data = s.recv(1024)
+ print('Received', repr(data))
diff --git a/tests/circuitpython-manual/socketpool/server/readme.md b/tests/circuitpython-manual/socketpool/server/readme.md
new file mode 100644
index 000000000..26118b8f1
--- /dev/null
+++ b/tests/circuitpython-manual/socketpool/server/readme.md
@@ -0,0 +1,43 @@
+# Circuitpython as Client
+
+This example demonstrates the use of Socket as a server, accessed by a client program on a host development machine. This Circuitpython sketch uses the Bind, Listen, Accept, and recvfrom_into calls.
+
+## Prerequisites
+
+Circuitpython V6.2.0 minimum. Neither the host or client sketch has installed module prerequisites.
+
+## Setup
+
+Make sure that both devices are using the same WIFI! The Circuitpython Server will automatically pick an IP and print it over the CDC monitor. Copy this value into the host client sketch. Start the Server on Circuitpython first, then run the client sketch in this folder:
+
+```
+python host-client.py
+```
+
+Each sketch can have Timeout values changed.
+
+## Expected behavior
+
+The host machine will connect to the server running on the Circuitpython device, and send a "Hello, world" string which is then returned.
+
+Expected client output:
+
+```
+Connecting
+Sending
+Receiving
+Received b'Hello, world'
+```
+
+Expected server output:
+```
+Connecting to Wifi
+Finding IP address
+192.168.10.128
+Creating socket
+Accepting connections
+Connected by ('192.168.10.179', 33274)
+Receiving
+bytearray(b'Hello, world')
+Sending
+```
diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py
index 6657b6a27..141e6ee2a 100644
--- a/tools/gen_display_resources.py
+++ b/tools/gen_display_resources.py
@@ -8,8 +8,8 @@ import os
import struct
import sys
-sys.path.append("bitmap_font")
-sys.path.append("../../tools/bitmap_font")
+sys.path.insert(0, "bitmap_font")
+sys.path.insert(0, "../../tools/bitmap_font")
from adafruit_bitmap_font import bitmap_font
diff --git a/tools/gen_usb_descriptor.py b/tools/gen_usb_descriptor.py
index 672f09c88..b21cfd920 100644
--- a/tools/gen_usb_descriptor.py
+++ b/tools/gen_usb_descriptor.py
@@ -12,60 +12,130 @@ sys.path.append("../../tools/usb_descriptor")
from adafruit_usb_descriptor import audio, audio10, cdc, hid, midi, msc, standard, util
import hid_report_descriptors
-DEFAULT_INTERFACE_NAME = 'CircuitPython'
-ALL_DEVICES='CDC,MSC,AUDIO,HID'
-ALL_DEVICES_SET=frozenset(ALL_DEVICES.split(','))
-DEFAULT_DEVICES='CDC,MSC,AUDIO,HID'
-
-ALL_HID_DEVICES='KEYBOARD,MOUSE,CONSUMER,SYS_CONTROL,GAMEPAD,DIGITIZER,XAC_COMPATIBLE_GAMEPAD,RAW'
-ALL_HID_DEVICES_SET=frozenset(ALL_HID_DEVICES.split(','))
+DEFAULT_INTERFACE_NAME = "CircuitPython"
+ALL_DEVICES = "CDC CDC2 MSC AUDIO HID VENDOR"
+ALL_DEVICES_SET = frozenset(ALL_DEVICES.split())
+DEFAULT_DEVICES = "CDC MSC AUDIO HID"
+
+ALL_HID_DEVICES = (
+ "KEYBOARD MOUSE CONSUMER SYS_CONTROL GAMEPAD DIGITIZER XAC_COMPATIBLE_GAMEPAD RAW"
+)
+ALL_HID_DEVICES_SET = frozenset(ALL_HID_DEVICES.split())
# Digitizer works on Linux but conflicts with mouse, so omit it.
-DEFAULT_HID_DEVICES='KEYBOARD,MOUSE,CONSUMER,GAMEPAD'
-
-parser = argparse.ArgumentParser(description='Generate USB descriptors.')
-parser.add_argument('--highspeed', default=False, action='store_true',
- help='descriptor for highspeed device')
-parser.add_argument('--manufacturer', type=str,
- help='manufacturer of the device')
-parser.add_argument('--product', type=str,
- help='product name of the device')
-parser.add_argument('--vid', type=lambda x: int(x, 16),
- help='vendor id')
-parser.add_argument('--pid', type=lambda x: int(x, 16),
- help='product id')
-parser.add_argument('--serial_number_length', type=int, default=32,
- help='length needed for the serial number in digits')
-parser.add_argument('--devices', type=lambda l: tuple(l.split(',')), default=DEFAULT_DEVICES,
- help='devices to include in descriptor (AUDIO includes MIDI support)')
-parser.add_argument('--hid_devices', type=lambda l: tuple(l.split(',')), default=DEFAULT_HID_DEVICES,
- help='HID devices to include in HID report descriptor')
-parser.add_argument('--interface_name', type=str,
- help='The name/prefix to use in the interface descriptions',
- default=DEFAULT_INTERFACE_NAME)
-parser.add_argument('--no-renumber_endpoints', dest='renumber_endpoints', action='store_false',
- help='use to not renumber endpoint')
-parser.add_argument('--cdc_ep_num_notification', type=int, default=0,
- help='endpoint number of CDC NOTIFICATION')
-parser.add_argument('--cdc_ep_num_data_out', type=int, default=0,
- help='endpoint number of CDC DATA OUT')
-parser.add_argument('--cdc_ep_num_data_in', type=int, default=0,
- help='endpoint number of CDC DATA IN')
-parser.add_argument('--msc_ep_num_out', type=int, default=0,
- help='endpoint number of MSC OUT')
-parser.add_argument('--msc_ep_num_in', type=int, default=0,
- help='endpoint number of MSC IN')
-parser.add_argument('--hid_ep_num_out', type=int, default=0,
- help='endpoint number of HID OUT')
-parser.add_argument('--hid_ep_num_in', type=int, default=0,
- help='endpoint number of HID IN')
-parser.add_argument('--midi_ep_num_out', type=int, default=0,
- help='endpoint number of MIDI OUT')
-parser.add_argument('--midi_ep_num_in', type=int, default=0,
- help='endpoint number of MIDI IN')
-parser.add_argument('--max_ep', type=int, default=0,
- help='total number of endpoints available')
-parser.add_argument('--output_c_file', type=argparse.FileType('w', encoding='UTF-8'), required=True)
-parser.add_argument('--output_h_file', type=argparse.FileType('w', encoding='UTF-8'), required=True)
+DEFAULT_HID_DEVICES = "KEYBOARD MOUSE CONSUMER GAMEPAD"
+
+# In the following URL, don't include the https:// because that prefix gets added automatically
+DEFAULT_WEBUSB_URL = (
+ "circuitpython.org" # In the future, this may become a specific landing page
+)
+
+parser = argparse.ArgumentParser(description="Generate USB descriptors.")
+parser.add_argument(
+ "--highspeed",
+ default=False,
+ action="store_true",
+ help="descriptor for highspeed device",
+)
+parser.add_argument("--manufacturer", type=str, help="manufacturer of the device")
+parser.add_argument("--product", type=str, help="product name of the device")
+parser.add_argument("--vid", type=lambda x: int(x, 16), help="vendor id")
+parser.add_argument("--pid", type=lambda x: int(x, 16), help="product id")
+parser.add_argument(
+ "--serial_number_length",
+ type=int,
+ default=32,
+ help="length needed for the serial number in digits",
+)
+parser.add_argument(
+ "--devices",
+ type=lambda l: tuple(l.split()),
+ default=DEFAULT_DEVICES,
+ help="devices to include in descriptor (AUDIO includes MIDI support)",
+)
+parser.add_argument(
+ "--hid_devices",
+ type=lambda l: tuple(l.split()),
+ default=DEFAULT_HID_DEVICES,
+ help="HID devices to include in HID report descriptor",
+)
+parser.add_argument(
+ "--interface_name",
+ type=str,
+ help="The name/prefix to use in the interface descriptions",
+ default=DEFAULT_INTERFACE_NAME,
+)
+parser.add_argument(
+ "--no-renumber_endpoints",
+ dest="renumber_endpoints",
+ action="store_false",
+ help="use to not renumber endpoint",
+)
+parser.add_argument(
+ "--cdc_ep_num_notification",
+ type=int,
+ default=0,
+ help="endpoint number of CDC NOTIFICATION",
+)
+parser.add_argument(
+ "--cdc2_ep_num_notification",
+ type=int,
+ default=0,
+ help="endpoint number of CDC2 NOTIFICATION",
+)
+parser.add_argument(
+ "--cdc_ep_num_data_out", type=int, default=0, help="endpoint number of CDC DATA OUT"
+)
+parser.add_argument(
+ "--cdc_ep_num_data_in", type=int, default=0, help="endpoint number of CDC DATA IN"
+)
+parser.add_argument(
+ "--cdc2_ep_num_data_out",
+ type=int,
+ default=0,
+ help="endpoint number of CDC2 DATA OUT",
+)
+parser.add_argument(
+ "--cdc2_ep_num_data_in", type=int, default=0, help="endpoint number of CDC2 DATA IN"
+)
+parser.add_argument(
+ "--msc_ep_num_out", type=int, default=0, help="endpoint number of MSC OUT"
+)
+parser.add_argument(
+ "--msc_ep_num_in", type=int, default=0, help="endpoint number of MSC IN"
+)
+parser.add_argument(
+ "--hid_ep_num_out", type=int, default=0, help="endpoint number of HID OUT"
+)
+parser.add_argument(
+ "--hid_ep_num_in", type=int, default=0, help="endpoint number of HID IN"
+)
+parser.add_argument(
+ "--midi_ep_num_out", type=int, default=0, help="endpoint number of MIDI OUT"
+)
+parser.add_argument(
+ "--midi_ep_num_in", type=int, default=0, help="endpoint number of MIDI IN"
+)
+parser.add_argument(
+ "--max_ep", type=int, default=0, help="total number of endpoints available"
+)
+parser.add_argument(
+ "--webusb_url",
+ type=str,
+ help="The URL to include in the WebUSB URL Descriptor",
+ default=DEFAULT_WEBUSB_URL,
+)
+parser.add_argument(
+ "--vendor_ep_num_out", type=int, default=0, help="endpoint number of VENDOR OUT"
+)
+parser.add_argument(
+ "--vendor_ep_num_in", type=int, default=0, help="endpoint number of VENDOR IN"
+)
+parser.add_argument(
+ "--output_c_file", type=argparse.FileType("w", encoding="UTF-8"), required=True
+)
+parser.add_argument(
+ "--output_h_file", type=argparse.FileType("w", encoding="UTF-8"), required=True
+)
args = parser.parse_args()
@@ -77,41 +147,67 @@ unknown_hid_devices = list(frozenset(args.hid_devices) - ALL_HID_DEVICES_SET)
if unknown_hid_devices:
raise ValueError("Unknown HID devices(s)", unknown_hid_devices)
+include_cdc = "CDC" in args.devices
+include_cdc2 = "CDC2" in args.devices
+include_msc = "MSC" in args.devices
+include_hid = "HID" in args.devices
+include_audio = "AUDIO" in args.devices
+include_vendor = "VENDOR" in args.devices
+
+if not include_cdc and include_cdc2:
+ raise ValueError("CDC2 requested without CDC")
+
if not args.renumber_endpoints:
- if 'CDC' in args.devices:
+ if include_cdc:
if args.cdc_ep_num_notification == 0:
raise ValueError("CDC notification endpoint number must not be 0")
- elif args.cdc_ep_num_data_out == 0:
+ if args.cdc_ep_num_data_out == 0:
raise ValueError("CDC data OUT endpoint number must not be 0")
- elif args.cdc_ep_num_data_in == 0:
+ if args.cdc_ep_num_data_in == 0:
raise ValueError("CDC data IN endpoint number must not be 0")
- if 'MSC' in args.devices:
+ if include_cdc2:
+ if args.cdc2_ep_num_notification == 0:
+ raise ValueError("CDC2 notification endpoint number must not be 0")
+ if args.cdc2_ep_num_data_out == 0:
+ raise ValueError("CDC2 data OUT endpoint number must not be 0")
+ if args.cdc2_ep_num_data_in == 0:
+ raise ValueError("CDC2 data IN endpoint number must not be 0")
+
+ if include_msc:
if args.msc_ep_num_out == 0:
raise ValueError("MSC endpoint OUT number must not be 0")
- elif args.msc_ep_num_in == 0:
+ if args.msc_ep_num_in == 0:
raise ValueError("MSC endpoint IN number must not be 0")
- if 'HID' in args.devices:
+ if include_hid:
if args.args.hid_ep_num_out == 0:
raise ValueError("HID endpoint OUT number must not be 0")
- elif args.hid_ep_num_in == 0:
+ if args.hid_ep_num_in == 0:
raise ValueError("HID endpoint IN number must not be 0")
- if 'AUDIO' in args.devices:
+ if include_audio:
if args.args.midi_ep_num_out == 0:
raise ValueError("MIDI endpoint OUT number must not be 0")
- elif args.midi_ep_num_in == 0:
+ if args.midi_ep_num_in == 0:
raise ValueError("MIDI endpoint IN number must not be 0")
+ if include_vendor:
+ if args.vendor_ep_num_out == 0:
+ raise ValueError("VENDOR endpoint OUT number must not be 0")
+ if args.vendor_ep_num_in == 0:
+ raise ValueError("VENDOR endpoint IN number must not be 0")
+
+
class StringIndex:
"""Assign a monotonically increasing index to each unique string. Start with 0."""
+
string_to_index = {}
index_to_variable = {}
strings = []
@classmethod
- def index(cls, string, *, variable_name = None):
+ def index(cls, string, *, variable_name=None):
if string in cls.string_to_index:
idx = cls.string_to_index[string]
if not cls.index_to_variable[idx]:
@@ -129,11 +225,12 @@ class StringIndex:
return cls.strings
-
# langid must be the 0th string descriptor
LANGID_INDEX = StringIndex.index("\u0409", variable_name="language_id")
assert LANGID_INDEX == 0
-SERIAL_NUMBER_INDEX = StringIndex.index("S" * args.serial_number_length, variable_name="usb_serial_number")
+SERIAL_NUMBER_INDEX = StringIndex.index(
+ "S" * args.serial_number_length, variable_name="usb_serial_number"
+)
device = standard.DeviceDescriptor(
description="top",
@@ -141,212 +238,279 @@ device = standard.DeviceDescriptor(
idProduct=args.pid,
iManufacturer=StringIndex.index(args.manufacturer),
iProduct=StringIndex.index(args.product),
- iSerialNumber=SERIAL_NUMBER_INDEX)
+ iSerialNumber=SERIAL_NUMBER_INDEX,
+)
# Interface numbers are interface-set local and endpoints are interface local
# until util.join_interfaces renumbers them.
-cdc_union = cdc.Union(
- description="CDC comm",
- bMasterInterface=0x00, # Adjust this after interfaces are renumbered.
- bSlaveInterface_list=[0x01]) # Adjust this after interfaces are renumbered.
-
-cdc_call_management = cdc.CallManagement(
- description="CDC comm",
- bmCapabilities=0x01,
- bDataInterface=0x01) # Adjust this after interfaces are renumbered.
-
-cdc_comm_interface = standard.InterfaceDescriptor(
- description="CDC comm",
- bInterfaceClass=cdc.CDC_CLASS_COMM, # Communications Device Class
- bInterfaceSubClass=cdc.CDC_SUBCLASS_ACM, # Abstract control model
- bInterfaceProtocol=cdc.CDC_PROTOCOL_NONE,
- iInterface=StringIndex.index("{} CDC control".format(args.interface_name)),
- subdescriptors=[
- cdc.Header(
- description="CDC comm",
- bcdCDC=0x0110),
- cdc_call_management,
- cdc.AbstractControlManagement(
- description="CDC comm",
- bmCapabilities=0x02),
- cdc_union,
- standard.EndpointDescriptor(
- description="CDC comm in",
- bEndpointAddress=args.cdc_ep_num_notification | standard.EndpointDescriptor.DIRECTION_IN,
- bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
- wMaxPacketSize=0x0040,
- bInterval=0x10)
- ])
-
-cdc_data_interface = standard.InterfaceDescriptor(
- description="CDC data",
- bInterfaceClass=cdc.CDC_CLASS_DATA,
- iInterface=StringIndex.index("{} CDC data".format(args.interface_name)),
- subdescriptors=[
- standard.EndpointDescriptor(
- description="CDC data out",
- bEndpointAddress=args.cdc_ep_num_data_out | standard.EndpointDescriptor.DIRECTION_OUT,
- bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
- bInterval=0,
- wMaxPacketSize=512 if args.highspeed else 64),
- standard.EndpointDescriptor(
- description="CDC data in",
- bEndpointAddress=args.cdc_ep_num_data_in | standard.EndpointDescriptor.DIRECTION_IN,
- bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
- bInterval=0,
- wMaxPacketSize=512 if args.highspeed else 64),
- ])
-
-cdc_interfaces = [cdc_comm_interface, cdc_data_interface]
-
-msc_interfaces = [
- standard.InterfaceDescriptor(
- description="MSC",
- bInterfaceClass=msc.MSC_CLASS,
- bInterfaceSubClass=msc.MSC_SUBCLASS_TRANSPARENT,
- bInterfaceProtocol=msc.MSC_PROTOCOL_BULK,
- iInterface=StringIndex.index("{} Mass Storage".format(args.interface_name)),
+
+def make_cdc_union(name):
+ return cdc.Union(
+ description="{} comm".format(name),
+ # Set bMasterInterface and bSlaveInterface_list to proper values after interfaces are renumbered.
+ bMasterInterface=0x00,
+ bSlaveInterface_list=[0x01],
+ )
+
+
+def make_cdc_call_management(name):
+ # Set bDataInterface to proper value after interfaces are renumbered.
+ return cdc.CallManagement(
+ description="{} comm".format(name), bmCapabilities=0x01, bDataInterface=0x01
+ )
+
+
+def make_cdc_comm_interface(
+ name, cdc_union, cdc_call_management, cdc_ep_num_notification
+):
+ return standard.InterfaceDescriptor(
+ description="{} comm".format(name),
+ bInterfaceClass=cdc.CDC_CLASS_COMM, # Communications Device Class
+ bInterfaceSubClass=cdc.CDC_SUBCLASS_ACM, # Abstract control model
+ bInterfaceProtocol=cdc.CDC_PROTOCOL_NONE,
+ iInterface=StringIndex.index("{} {} control".format(args.interface_name, name)),
subdescriptors=[
+ cdc.Header(description="{} comm".format(name), bcdCDC=0x0110),
+ cdc_call_management,
+ cdc.AbstractControlManagement(
+ description="{} comm".format(name), bmCapabilities=0x02
+ ),
+ cdc_union,
standard.EndpointDescriptor(
- description="MSC in",
- bEndpointAddress=args.msc_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN,
+ description="{} comm in".format(name),
+ bEndpointAddress=cdc_ep_num_notification
+ | standard.EndpointDescriptor.DIRECTION_IN,
+ bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
+ wMaxPacketSize=0x0040,
+ bInterval=0x10,
+ ),
+ ],
+ )
+
+
+def make_cdc_data_interface(name, cdc_ep_num_data_in, cdc_ep_num_data_out):
+ return standard.InterfaceDescriptor(
+ description="{} data".format(name),
+ bInterfaceClass=cdc.CDC_CLASS_DATA,
+ iInterface=StringIndex.index("{} {} data".format(args.interface_name, name)),
+ subdescriptors=[
+ standard.EndpointDescriptor(
+ description="{} data out".format(name),
+ bEndpointAddress=cdc_ep_num_data_out
+ | standard.EndpointDescriptor.DIRECTION_OUT,
bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
bInterval=0,
- wMaxPacketSize=512 if args.highspeed else 64),
+ wMaxPacketSize=512 if args.highspeed else 64,
+ ),
standard.EndpointDescriptor(
- description="MSC out",
- bEndpointAddress=(args.msc_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT),
+ description="{} data in".format(name),
+ bEndpointAddress=cdc_ep_num_data_in
+ | standard.EndpointDescriptor.DIRECTION_IN,
bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
bInterval=0,
- wMaxPacketSize=512 if args.highspeed else 64),
- ]
+ wMaxPacketSize=512 if args.highspeed else 64,
+ ),
+ ],
)
-]
-# When there's only one hid_device, it shouldn't have a report id.
-# Otherwise, report ids are assigned sequentially:
-# args.hid_devices[0] has report_id 1
-# args.hid_devices[1] has report_id 2
-# etc.
-report_ids = {}
+if include_cdc:
+ cdc_union = make_cdc_union("CDC")
+ cdc_call_management = make_cdc_call_management("CDC")
+ cdc_comm_interface = make_cdc_comm_interface(
+ "CDC", cdc_union, cdc_call_management, args.cdc_ep_num_notification
+ )
+ cdc_data_interface = make_cdc_data_interface(
+ "CDC", args.cdc_ep_num_data_in, args.cdc_ep_num_data_out
+ )
-if len(args.hid_devices) == 1:
- name = args.hid_devices[0]
- combined_hid_report_descriptor = hid.ReportDescriptor(
- description=name,
- report_descriptor=bytes(hid_report_descriptors.REPORT_DESCRIPTOR_FUNCTIONS[name](0)))
- report_ids[name] = 0
-else:
- report_id = 1
- concatenated_descriptors = bytearray()
- for name in args.hid_devices:
- concatenated_descriptors.extend(
- bytes(hid_report_descriptors.REPORT_DESCRIPTOR_FUNCTIONS[name](report_id)))
- report_ids[name] = report_id
- report_id += 1
- combined_hid_report_descriptor = hid.ReportDescriptor(
- description="MULTIDEVICE",
- report_descriptor=bytes(concatenated_descriptors))
-
-# ASF4 expects keyboard and generic devices to have both in and out endpoints,
-# and will fail (possibly silently) if both are not supplied.
-hid_endpoint_in_descriptor = standard.EndpointDescriptor(
- description="HID in",
- bEndpointAddress=args.hid_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN,
- bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
- bInterval=8)
-
-hid_endpoint_out_descriptor = standard.EndpointDescriptor(
- description="HID out",
- bEndpointAddress=args.hid_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT,
- bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
- bInterval=8)
-
-hid_interfaces = [
- standard.InterfaceDescriptor(
- description="HID Multiple Devices",
- bInterfaceClass=hid.HID_CLASS,
- bInterfaceSubClass=hid.HID_SUBCLASS_NOBOOT,
- bInterfaceProtocol=hid.HID_PROTOCOL_NONE,
- iInterface=StringIndex.index("{} HID".format(args.interface_name)),
- subdescriptors=[
- hid.HIDDescriptor(
- description="HID",
- wDescriptorLength=len(bytes(combined_hid_report_descriptor))),
- hid_endpoint_in_descriptor,
- hid_endpoint_out_descriptor,
- ]
- ),
+ cdc_interfaces = [cdc_comm_interface, cdc_data_interface]
+
+if include_cdc2:
+ cdc2_union = make_cdc_union("CDC2")
+ cdc2_call_management = make_cdc_call_management("CDC2")
+ cdc2_comm_interface = make_cdc_comm_interface(
+ "CDC2", cdc2_union, cdc2_call_management, args.cdc2_ep_num_notification
+ )
+ cdc2_data_interface = make_cdc_data_interface(
+ "CDC2", args.cdc2_ep_num_data_in, args.cdc2_ep_num_data_out
+ )
+
+ cdc2_interfaces = [cdc2_comm_interface, cdc2_data_interface]
+
+if include_msc:
+ msc_interfaces = [
+ standard.InterfaceDescriptor(
+ description="MSC",
+ bInterfaceClass=msc.MSC_CLASS,
+ bInterfaceSubClass=msc.MSC_SUBCLASS_TRANSPARENT,
+ bInterfaceProtocol=msc.MSC_PROTOCOL_BULK,
+ iInterface=StringIndex.index("{} Mass Storage".format(args.interface_name)),
+ subdescriptors=[
+ standard.EndpointDescriptor(
+ description="MSC in",
+ bEndpointAddress=args.msc_ep_num_in
+ | standard.EndpointDescriptor.DIRECTION_IN,
+ bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
+ bInterval=0,
+ wMaxPacketSize=512 if args.highspeed else 64,
+ ),
+ standard.EndpointDescriptor(
+ description="MSC out",
+ bEndpointAddress=(
+ args.msc_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT
+ ),
+ bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
+ bInterval=0,
+ wMaxPacketSize=512 if args.highspeed else 64,
+ ),
+ ],
+ )
]
-# Audio!
-# In and out here are relative to CircuitPython
-
-# USB OUT -> midi_in_jack_emb -> midi_out_jack_ext -> CircuitPython
-midi_in_jack_emb = midi.InJackDescriptor(
- description="MIDI PC -> {}".format(args.interface_name),
- bJackType=midi.JACK_TYPE_EMBEDDED,
- iJack=StringIndex.index("{} usb_midi.ports[0]".format(args.interface_name)))
-midi_out_jack_ext = midi.OutJackDescriptor(
- description="MIDI data out to user code.",
- bJackType=midi.JACK_TYPE_EXTERNAL,
- input_pins=[(midi_in_jack_emb, 1)],
- iJack=0)
-
-# USB IN <- midi_out_jack_emb <- midi_in_jack_ext <- CircuitPython
-midi_in_jack_ext = midi.InJackDescriptor(
- description="MIDI data in from user code.",
- bJackType=midi.JACK_TYPE_EXTERNAL,
- iJack=0)
-midi_out_jack_emb = midi.OutJackDescriptor(
- description="MIDI PC <- {}".format(args.interface_name),
- bJackType=midi.JACK_TYPE_EMBEDDED,
- input_pins=[(midi_in_jack_ext, 1)],
- iJack=StringIndex.index("{} usb_midi.ports[1]".format(args.interface_name)))
-
-
-audio_midi_interface = standard.InterfaceDescriptor(
- description="Midi goodness",
- bInterfaceClass=audio.AUDIO_CLASS_DEVICE,
- bInterfaceSubClass=audio.AUDIO_SUBCLASS_MIDI_STREAMING,
- bInterfaceProtocol=audio.AUDIO_PROTOCOL_V1,
- iInterface=StringIndex.index("{} MIDI".format(args.interface_name)),
- subdescriptors=[
- midi.Header(
- jacks_and_elements=[
- midi_in_jack_emb,
- midi_in_jack_ext,
- midi_out_jack_emb,
- midi_out_jack_ext
+
+if include_hid:
+ # When there's only one hid_device, it shouldn't have a report id.
+ # Otherwise, report ids are assigned sequentially:
+ # args.hid_devices[0] has report_id 1
+ # args.hid_devices[1] has report_id 2
+ # etc.
+
+ report_ids = {}
+
+ if len(args.hid_devices) == 1:
+ name = args.hid_devices[0]
+ combined_hid_report_descriptor = hid.ReportDescriptor(
+ description=name,
+ report_descriptor=bytes(
+ hid_report_descriptors.REPORT_DESCRIPTOR_FUNCTIONS[name](0)
+ ),
+ )
+ report_ids[name] = 0
+ else:
+ report_id = 1
+ concatenated_descriptors = bytearray()
+ for name in args.hid_devices:
+ concatenated_descriptors.extend(
+ bytes(
+ hid_report_descriptors.REPORT_DESCRIPTOR_FUNCTIONS[name](report_id)
+ )
+ )
+ report_ids[name] = report_id
+ report_id += 1
+ combined_hid_report_descriptor = hid.ReportDescriptor(
+ description="MULTIDEVICE", report_descriptor=bytes(concatenated_descriptors)
+ )
+
+ # ASF4 expects keyboard and generic devices to have both in and out endpoints,
+ # and will fail (possibly silently) if both are not supplied.
+ hid_endpoint_in_descriptor = standard.EndpointDescriptor(
+ description="HID in",
+ bEndpointAddress=args.hid_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN,
+ bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
+ bInterval=8,
+ )
+
+ hid_endpoint_out_descriptor = standard.EndpointDescriptor(
+ description="HID out",
+ bEndpointAddress=args.hid_ep_num_out
+ | standard.EndpointDescriptor.DIRECTION_OUT,
+ bmAttributes=standard.EndpointDescriptor.TYPE_INTERRUPT,
+ bInterval=8,
+ )
+
+ hid_interfaces = [
+ standard.InterfaceDescriptor(
+ description="HID Multiple Devices",
+ bInterfaceClass=hid.HID_CLASS,
+ bInterfaceSubClass=hid.HID_SUBCLASS_NOBOOT,
+ bInterfaceProtocol=hid.HID_PROTOCOL_NONE,
+ iInterface=StringIndex.index("{} HID".format(args.interface_name)),
+ subdescriptors=[
+ hid.HIDDescriptor(
+ description="HID",
+ wDescriptorLength=len(bytes(combined_hid_report_descriptor)),
+ ),
+ hid_endpoint_in_descriptor,
+ hid_endpoint_out_descriptor,
],
),
- standard.EndpointDescriptor(
- description="MIDI data out to {}".format(args.interface_name),
- bEndpointAddress=args.midi_ep_num_out | standard.EndpointDescriptor.DIRECTION_OUT,
- bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
- bInterval=0,
- wMaxPacketSize=512 if args.highspeed else 64),
- midi.DataEndpointDescriptor(baAssocJack=[midi_in_jack_emb]),
- standard.EndpointDescriptor(
- description="MIDI data in from {}".format(args.interface_name),
- bEndpointAddress=args.midi_ep_num_in | standard.EndpointDescriptor.DIRECTION_IN,
- bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
- bInterval = 0x0,
- wMaxPacketSize=512 if args.highspeed else 64),
- midi.DataEndpointDescriptor(baAssocJack=[midi_out_jack_emb]),
- ])
-
-cs_ac_interface = audio10.AudioControlInterface(
+ ]
+
+if include_audio:
+ # Audio!
+ # In and out here are relative to CircuitPython
+
+ # USB OUT -> midi_in_jack_emb -> midi_out_jack_ext -> CircuitPython
+ midi_in_jack_emb = midi.InJackDescriptor(
+ description="MIDI PC -> {}".format(args.interface_name),
+ bJackType=midi.JACK_TYPE_EMBEDDED,
+ iJack=StringIndex.index("{} usb_midi.ports[0]".format(args.interface_name)),
+ )
+ midi_out_jack_ext = midi.OutJackDescriptor(
+ description="MIDI data out to user code.",
+ bJackType=midi.JACK_TYPE_EXTERNAL,
+ input_pins=[(midi_in_jack_emb, 1)],
+ iJack=0,
+ )
+
+ # USB IN <- midi_out_jack_emb <- midi_in_jack_ext <- CircuitPython
+ midi_in_jack_ext = midi.InJackDescriptor(
+ description="MIDI data in from user code.",
+ bJackType=midi.JACK_TYPE_EXTERNAL,
+ iJack=0,
+ )
+ midi_out_jack_emb = midi.OutJackDescriptor(
+ description="MIDI PC <- {}".format(args.interface_name),
+ bJackType=midi.JACK_TYPE_EMBEDDED,
+ input_pins=[(midi_in_jack_ext, 1)],
+ iJack=StringIndex.index("{} usb_midi.ports[1]".format(args.interface_name)),
+ )
+
+ audio_midi_interface = standard.InterfaceDescriptor(
+ description="Midi goodness",
+ bInterfaceClass=audio.AUDIO_CLASS_DEVICE,
+ bInterfaceSubClass=audio.AUDIO_SUBCLASS_MIDI_STREAMING,
+ bInterfaceProtocol=audio.AUDIO_PROTOCOL_V1,
+ iInterface=StringIndex.index("{} MIDI".format(args.interface_name)),
+ subdescriptors=[
+ midi.Header(
+ jacks_and_elements=[
+ midi_in_jack_emb,
+ midi_in_jack_ext,
+ midi_out_jack_emb,
+ midi_out_jack_ext,
+ ],
+ ),
+ standard.EndpointDescriptor(
+ description="MIDI data out to {}".format(args.interface_name),
+ bEndpointAddress=args.midi_ep_num_out
+ | standard.EndpointDescriptor.DIRECTION_OUT,
+ bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
+ bInterval=0,
+ wMaxPacketSize=512 if args.highspeed else 64,
+ ),
+ midi.DataEndpointDescriptor(baAssocJack=[midi_in_jack_emb]),
+ standard.EndpointDescriptor(
+ description="MIDI data in from {}".format(args.interface_name),
+ bEndpointAddress=args.midi_ep_num_in
+ | standard.EndpointDescriptor.DIRECTION_IN,
+ bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
+ bInterval=0x0,
+ wMaxPacketSize=512 if args.highspeed else 64,
+ ),
+ midi.DataEndpointDescriptor(baAssocJack=[midi_out_jack_emb]),
+ ],
+ )
+
+ cs_ac_interface = audio10.AudioControlInterface(
description="Empty audio control",
- audio_streaming_interfaces = [],
- midi_streaming_interfaces = [
- audio_midi_interface
- ]
+ audio_streaming_interfaces=[],
+ midi_streaming_interfaces=[audio_midi_interface],
)
-audio_control_interface = standard.InterfaceDescriptor(
+ audio_control_interface = standard.InterfaceDescriptor(
description="All the audio",
bInterfaceClass=audio.AUDIO_CLASS_DEVICE,
bInterfaceSubClass=audio.AUDIO_SUBCLASS_CONTROL,
@@ -354,57 +518,124 @@ audio_control_interface = standard.InterfaceDescriptor(
iInterface=StringIndex.index("{} Audio".format(args.interface_name)),
subdescriptors=[
cs_ac_interface,
- ])
+ ],
+ )
-# Audio streaming interfaces must occur before MIDI ones.
-audio_interfaces = [audio_control_interface] + cs_ac_interface.audio_streaming_interfaces + cs_ac_interface.midi_streaming_interfaces
+ # Audio streaming interfaces must occur before MIDI ones.
+ audio_interfaces = (
+ [audio_control_interface]
+ + cs_ac_interface.audio_streaming_interfaces
+ + cs_ac_interface.midi_streaming_interfaces
+ )
+
+if include_vendor:
+ # Vendor-specific interface, for example WebUSB
+ vendor_endpoint_in_descriptor = standard.EndpointDescriptor(
+ description="VENDOR in",
+ bEndpointAddress=args.vendor_ep_num_in
+ | standard.EndpointDescriptor.DIRECTION_IN,
+ bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
+ bInterval=16,
+ )
+
+ vendor_endpoint_out_descriptor = standard.EndpointDescriptor(
+ description="VENDOR out",
+ bEndpointAddress=args.vendor_ep_num_out
+ | standard.EndpointDescriptor.DIRECTION_OUT,
+ bmAttributes=standard.EndpointDescriptor.TYPE_BULK,
+ bInterval=16,
+ )
+
+ vendor_interface = standard.InterfaceDescriptor(
+ description="VENDOR",
+ bInterfaceClass=0xFF, # Vendor-specific
+ bInterfaceSubClass=0x00,
+ bInterfaceProtocol=0x00,
+ iInterface=StringIndex.index("{} VENDOR".format(args.interface_name)),
+ subdescriptors=[
+ vendor_endpoint_in_descriptor,
+ vendor_endpoint_out_descriptor,
+ ],
+ )
+
+ vendor_interfaces = [vendor_interface]
interfaces_to_join = []
-if 'CDC' in args.devices:
+if include_cdc:
interfaces_to_join.append(cdc_interfaces)
-if 'MSC' in args.devices:
+if include_cdc2:
+ interfaces_to_join.append(cdc2_interfaces)
+
+if include_msc:
interfaces_to_join.append(msc_interfaces)
-if 'HID' in args.devices:
+if include_hid:
interfaces_to_join.append(hid_interfaces)
-if 'AUDIO' in args.devices:
+if include_audio:
interfaces_to_join.append(audio_interfaces)
+if include_vendor:
+ interfaces_to_join.append(vendor_interfaces)
+
# util.join_interfaces() will renumber the endpoints to make them unique across descriptors,
# and renumber the interfaces in order. But we still need to fix up certain
# interface cross-references.
-interfaces = util.join_interfaces(interfaces_to_join, renumber_endpoints=args.renumber_endpoints)
+interfaces = util.join_interfaces(
+ interfaces_to_join, renumber_endpoints=args.renumber_endpoints
+)
if args.max_ep != 0:
for interface in interfaces:
for subdescriptor in interface.subdescriptors:
- endpoint_address = getattr(subdescriptor, 'bEndpointAddress', 0) & 0x7f
+ endpoint_address = getattr(subdescriptor, "bEndpointAddress", 0) & 0x7F
if endpoint_address >= args.max_ep:
- raise ValueError("Endpoint address %d of %s must be less than %d" % (endpoint_address & 0x7f, interface.description, args.max_ep))
+ raise ValueError(
+ "Endpoint address %d of '%s' must be less than %d; you have probably run out of endpoints"
+ % (endpoint_address & 0x7F, interface.description, args.max_ep)
+ )
else:
- print("Unable to check whether maximum number of endpoints is respected", file=sys.stderr)
+ print(
+ "Unable to check whether maximum number of endpoints is respected",
+ file=sys.stderr,
+ )
# Now adjust the CDC interface cross-references.
-cdc_union.bMasterInterface = cdc_comm_interface.bInterfaceNumber
-cdc_union.bSlaveInterface_list = [cdc_data_interface.bInterfaceNumber]
+if include_cdc:
+ cdc_union.bMasterInterface = cdc_comm_interface.bInterfaceNumber
+ cdc_union.bSlaveInterface_list = [cdc_data_interface.bInterfaceNumber]
+
+ cdc_call_management.bDataInterface = cdc_data_interface.bInterfaceNumber
-cdc_call_management.bDataInterface = cdc_data_interface.bInterfaceNumber
+if include_cdc2:
+ cdc2_union.bMasterInterface = cdc2_comm_interface.bInterfaceNumber
+ cdc2_union.bSlaveInterface_list = [cdc2_data_interface.bInterfaceNumber]
-cdc_iad = standard.InterfaceAssociationDescriptor(
- description="CDC IAD",
- bFirstInterface=cdc_comm_interface.bInterfaceNumber,
- bInterfaceCount=len(cdc_interfaces),
- bFunctionClass=cdc.CDC_CLASS_COMM, # Communications Device Class
- bFunctionSubClass=cdc.CDC_SUBCLASS_ACM, # Abstract control model
- bFunctionProtocol=cdc.CDC_PROTOCOL_NONE)
+ cdc2_call_management.bDataInterface = cdc2_data_interface.bInterfaceNumber
+
+
+def make_cdc_iad(cdc_comm_interface, name):
+ return standard.InterfaceAssociationDescriptor(
+ description="{} IAD".format(name),
+ bFirstInterface=cdc_comm_interface.bInterfaceNumber,
+ bInterfaceCount=len(cdc_interfaces),
+ bFunctionClass=cdc.CDC_CLASS_COMM, # Communications Device Class
+ bFunctionSubClass=cdc.CDC_SUBCLASS_ACM, # Abstract control model
+ bFunctionProtocol=cdc.CDC_PROTOCOL_NONE,
+ )
+
+
+if include_cdc:
+ cdc_iad = make_cdc_iad(cdc_comm_interface, "CDC")
+if include_cdc2:
+ cdc2_iad = make_cdc_iad(cdc2_comm_interface, "CDC2")
descriptor_list = []
-if 'CDC' in args.devices:
+if include_cdc:
# Put the CDC IAD just before the CDC interfaces.
# There appears to be a bug in the Windows composite USB driver that requests the
# HID report descriptor with the wrong interface number if the HID interface is not given
@@ -414,68 +645,97 @@ if 'CDC' in args.devices:
descriptor_list.append(cdc_iad)
descriptor_list.extend(cdc_interfaces)
-if 'MSC' in args.devices:
+if include_cdc2:
+ descriptor_list.append(cdc2_iad)
+ descriptor_list.extend(cdc2_interfaces)
+
+if include_msc:
descriptor_list.extend(msc_interfaces)
-if 'HID' in args.devices:
+if include_hid:
descriptor_list.extend(hid_interfaces)
-if 'AUDIO' in args.devices:
+if include_audio:
# Only add the control interface because other audio interfaces are managed by it to ensure the
# correct ordering.
descriptor_list.append(audio_control_interface)
+if include_vendor:
+ descriptor_list.extend(vendor_interfaces)
+
# Finally, build the composite descriptor.
configuration = standard.ConfigurationDescriptor(
description="Composite configuration",
- wTotalLength=(standard.ConfigurationDescriptor.bLength +
- sum([len(bytes(x)) for x in descriptor_list])),
- bNumInterfaces=len(interfaces))
+ wTotalLength=(
+ standard.ConfigurationDescriptor.bLength
+ + sum([len(bytes(x)) for x in descriptor_list])
+ ),
+ bNumInterfaces=len(interfaces),
+)
descriptor_list.insert(0, configuration)
-string_descriptors = [standard.StringDescriptor(string) for string in StringIndex.strings_in_order()]
+string_descriptors = [
+ standard.StringDescriptor(string) for string in StringIndex.strings_in_order()
+]
serial_number_descriptor = string_descriptors[SERIAL_NUMBER_INDEX]
c_file = args.output_c_file
h_file = args.output_h_file
-c_file.write("""\
+c_file.write(
+ """\
#include <stdint.h>
+#include "tusb.h"
#include "py/objtuple.h"
#include "shared-bindings/usb_hid/Device.h"
#include "{H_FILE_NAME}"
-""".format(H_FILE_NAME=h_file.name))
+""".format(
+ H_FILE_NAME=h_file.name
+ )
+)
-c_file.write("""\
+c_file.write(
+ """\
// {DESCRIPTION} : {CLASS}
-""".format(DESCRIPTION=device.description,
- CLASS=device.__class__))
+""".format(
+ DESCRIPTION=device.description, CLASS=device.__class__
+ )
+)
-c_file.write("""\
+c_file.write(
+ """\
const uint8_t usb_desc_dev[] = {
-""")
+"""
+)
for b in bytes(device):
c_file.write("0x{:02x}, ".format(b))
-c_file.write("""\
+c_file.write(
+ """\
};
-""")
+"""
+)
-c_file.write("""\
+c_file.write(
+ """\
const uint8_t usb_desc_cfg[] = {
-""")
+"""
+)
# Write out all the regular descriptors as one long array (that's how ASF4 does it).
descriptor_length = 0
for descriptor in descriptor_list:
- c_file.write("""\
+ c_file.write(
+ """\
// {DESCRIPTION} : {CLASS}
-""".format(DESCRIPTION=descriptor.description,
- CLASS=descriptor.__class__))
+""".format(
+ DESCRIPTION=descriptor.description, CLASS=descriptor.__class__
+ )
+ )
b = bytes(descriptor)
notes = descriptor.notes()
@@ -493,17 +753,22 @@ for descriptor in descriptor_list:
i += length
descriptor_length += len(b)
-c_file.write("""\
+c_file.write(
+ """\
};
-""")
+"""
+)
pointers_to_strings = []
for idx, descriptor in enumerate(string_descriptors):
- c_file.write("""\
+ c_file.write(
+ """\
// {DESCRIPTION} : {CLASS}
-""".format(DESCRIPTION=descriptor.description,
- CLASS=descriptor.__class__))
+""".format(
+ DESCRIPTION=descriptor.description, CLASS=descriptor.__class__
+ )
+ )
b = bytes(descriptor)
notes = descriptor.notes()
@@ -513,45 +778,65 @@ for idx, descriptor in enumerate(string_descriptors):
variable_name = StringIndex.index_to_variable[idx]
if not variable_name:
variable_name = "string_descriptor{}".format(idx)
+ pointers_to_strings.append("{name}".format(name=variable_name))
const = "const "
if variable_name == "usb_serial_number":
- const = ""
- c_file.write("""\
-{const}uint16_t {NAME}[] = {{
-""".format(const=const, NAME=variable_name))
- pointers_to_strings.append("{name}".format(name=variable_name))
- n = 0
- while i < len(b):
- length = b[i]
- for j in range(length // 2):
- c_file.write("0x{:04x}, ".format(b[i + 2*j + 1] << 8 | b[i + 2*j]))
- n += 1
- c_file.write("\n")
- i += length
- c_file.write("""\
-};
-""")
+ length = len(b)
+ c_file.write(" uint16_t {NAME}[{length}];\n".format(NAME=variable_name, length=length//2))
+ else:
+ c_file.write(
+ """\
+ const uint16_t {NAME}[] = {{
+ """.format(
+ const=const, NAME=variable_name
+ )
+ )
+ n = 0
+ while i < len(b):
+ length = b[i]
+ for j in range(length // 2):
+ c_file.write("0x{:04x}, ".format(b[i + 2 * j + 1] << 8 | b[i + 2 * j]))
+ n += 1
+ c_file.write("\n")
+ i += length
+ c_file.write(
+ """\
+ };
+ """
+ )
-c_file.write("""\
+c_file.write(
+ """\
// array of pointer to string descriptors
uint16_t const * const string_desc_arr [] =
{
-""")
-c_file.write(""",\
+"""
+)
+c_file.write(
+ """,\
-""".join(pointers_to_strings))
+""".join(
+ pointers_to_strings
+ )
+)
-c_file.write("""
+c_file.write(
+ """
};
-""")
+"""
+)
c_file.write("\n")
-hid_descriptor_length = len(bytes(combined_hid_report_descriptor))
+if include_hid:
+ hid_descriptor_length = len(bytes(combined_hid_report_descriptor))
+else:
+ hid_descriptor_length = 0
-# Now we values we need for the .h file.
-h_file.write("""\
+# Now the values we need for the .h file.
+h_file.write(
+ """\
#ifndef MICROPY_INCLUDED_AUTOGEN_USB_DESCRIPTOR_H
#define MICROPY_INCLUDED_AUTOGEN_USB_DESCRIPTOR_H
@@ -562,61 +847,124 @@ extern const uint8_t usb_desc_cfg[{configuration_length}];
extern uint16_t usb_serial_number[{serial_number_length}];
extern uint16_t const * const string_desc_arr [{string_descriptor_length}];
-extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}];
-
#define CFG_TUSB_RHPORT0_MODE ({rhport0_mode})
-#define USB_HID_NUM_DEVICES {hid_num_devices}
-
// Vendor name included in Inquiry response, max 8 bytes
#define CFG_TUD_MSC_VENDOR "{msc_vendor}"
// Product name included in Inquiry response, max 16 bytes
#define CFG_TUD_MSC_PRODUCT "{msc_product}"
-"""
-.format(serial_number_length=len(bytes(serial_number_descriptor)) // 2,
+""".format(
+ serial_number_length=len(bytes(serial_number_descriptor)) // 2,
device_length=len(bytes(device)),
configuration_length=descriptor_length,
max_configuration_length=max(hid_descriptor_length, descriptor_length),
string_descriptor_length=len(pointers_to_strings),
- hid_report_descriptor_length=len(bytes(combined_hid_report_descriptor)),
- rhport0_mode='OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED' if args.highspeed else 'OPT_MODE_DEVICE',
- hid_num_devices=len(args.hid_devices),
+ rhport0_mode="OPT_MODE_DEVICE | OPT_MODE_HIGH_SPEED"
+ if args.highspeed
+ else "OPT_MODE_DEVICE",
msc_vendor=args.manufacturer[:8],
- msc_product=args.product[:16]))
+ msc_product=args.product[:16],
+ )
+)
+
+if include_hid:
+ h_file.write(
+ """\
+extern const uint8_t hid_report_descriptor[{hid_report_descriptor_length}];
+
+#define USB_HID_NUM_DEVICES {hid_num_devices}
+""".format(
+ hid_report_descriptor_length=len(bytes(combined_hid_report_descriptor)),
+ hid_num_devices=len(args.hid_devices),
+ )
+ )
+
+if include_vendor:
+ h_file.write(
+ """\
+enum
+{
+ VENDOR_REQUEST_WEBUSB = 1,
+ VENDOR_REQUEST_MICROSOFT = 2
+};
-# Write out the report descriptor and info
-c_file.write("""\
+extern uint8_t const desc_ms_os_20[];
+
+// Currently getting compile-time errors in files like tusb_fifo.c
+// if we try do define this here (TODO figure this out!)
+//extern const tusb_desc_webusb_url_t desc_webusb_url;
+
+"""
+ )
+
+h_file.write(
+ """\
+#endif // MICROPY_INCLUDED_AUTOGEN_USB_DESCRIPTOR_H
+"""
+)
+
+if include_hid:
+ # Write out the report descriptor and info
+ c_file.write(
+ """\
const uint8_t hid_report_descriptor[{HID_DESCRIPTOR_LENGTH}] = {{
-""".format(HID_DESCRIPTOR_LENGTH=hid_descriptor_length))
+""".format(
+ HID_DESCRIPTOR_LENGTH=hid_descriptor_length
+ )
+ )
-for b in bytes(combined_hid_report_descriptor):
- c_file.write("0x{:02x}, ".format(b))
-c_file.write("""\
+ for b in bytes(combined_hid_report_descriptor):
+ c_file.write("0x{:02x}, ".format(b))
+
+ c_file.write(
+ """\
};
-""")
+"""
+ )
-# Write out USB HID report buffer definitions.
-for name in args.hid_devices:
- c_file.write("""\
+ # Write out USB HID report buffer definitions.
+ for name in args.hid_devices:
+ c_file.write(
+ """\
static uint8_t {name}_report_buffer[{report_length}];
-""".format(name=name.lower(), report_length=hid_report_descriptors.HID_DEVICE_DATA[name].report_length))
-
- if hid_report_descriptors.HID_DEVICE_DATA[name].out_report_length > 0:
- c_file.write("""\
+""".format(
+ name=name.lower(),
+ report_length=hid_report_descriptors.HID_DEVICE_DATA[
+ name
+ ].report_length,
+ )
+ )
+
+ if hid_report_descriptors.HID_DEVICE_DATA[name].out_report_length > 0:
+ c_file.write(
+ """\
static uint8_t {name}_out_report_buffer[{report_length}];
-""".format(name=name.lower(), report_length=hid_report_descriptors.HID_DEVICE_DATA[name].out_report_length))
-
-# Write out table of device objects.
-c_file.write("""
+""".format(
+ name=name.lower(),
+ report_length=hid_report_descriptors.HID_DEVICE_DATA[
+ name
+ ].out_report_length,
+ )
+ )
+
+ # Write out table of device objects.
+ c_file.write(
+ """\
usb_hid_device_obj_t usb_hid_devices[] = {
-""")
-for name in args.hid_devices:
- device_data = hid_report_descriptors.HID_DEVICE_DATA[name]
- out_report_buffer = '{}_out_report_buffer'.format(name.lower()) if device_data.out_report_length > 0 else 'NULL'
- c_file.write("""\
+"""
+ )
+ for name in args.hid_devices:
+ device_data = hid_report_descriptors.HID_DEVICE_DATA[name]
+ out_report_buffer = (
+ "{}_out_report_buffer".format(name.lower())
+ if device_data.out_report_length > 0
+ else "NULL"
+ )
+ c_file.write(
+ """\
{{
.base = {{ .type = &usb_hid_device_type }},
.report_buffer = {name}_report_buffer,
@@ -627,34 +975,145 @@ for name in args.hid_devices:
.out_report_buffer = {out_report_buffer},
.out_report_length = {out_report_length},
}},
-""".format(name=name.lower(), report_id=report_ids[name],
- report_length=device_data.report_length,
- usage_page=device_data.usage_page,
- usage=device_data.usage,
- out_report_buffer=out_report_buffer,
- out_report_length=device_data.out_report_length))
-c_file.write("""\
+""".format(
+ name=name.lower(),
+ report_id=report_ids[name],
+ report_length=device_data.report_length,
+ usage_page=device_data.usage_page,
+ usage=device_data.usage,
+ out_report_buffer=out_report_buffer,
+ out_report_length=device_data.out_report_length,
+ )
+ )
+ c_file.write(
+ """\
};
-""")
+"""
+ )
-# Write out tuple of device objects.
-c_file.write("""
+ # Write out tuple of device objects.
+ c_file.write(
+ """
mp_obj_tuple_t common_hal_usb_hid_devices = {{
.base = {{
.type = &mp_type_tuple,
}},
.len = {num_devices},
.items = {{
-""".format(num_devices=len(args.hid_devices)))
-for idx in range(len(args.hid_devices)):
- c_file.write("""\
+""".format(
+ num_devices=len(args.hid_devices)
+ )
+ )
+ for idx in range(len(args.hid_devices)):
+ c_file.write(
+ """\
(mp_obj_t) &usb_hid_devices[{idx}],
-""".format(idx=idx))
-c_file.write("""\
+""".format(
+ idx=idx
+ )
+ )
+ c_file.write(
+ """\
},
};
-""")
+"""
+ )
-h_file.write("""\
-#endif // MICROPY_INCLUDED_AUTOGEN_USB_DESCRIPTOR_H
-""")
+if include_vendor:
+ # Mimic what the tinyusb webusb demo does in its main.c file
+ c_file.write(
+ """
+#define URL "{webusb_url}"
+
+const tusb_desc_webusb_url_t desc_webusb_url =
+{{
+ .bLength = 3 + sizeof(URL) - 1,
+ .bDescriptorType = 3, // WEBUSB URL type
+ .bScheme = 1, // 0: http, 1: https, 255: ""
+ .url = URL
+}};
+
+// These next two hardcoded descriptors were pulled from the usb_descriptor.c file
+// of the tinyusb webusb_serial demo. TODO - this is probably something else to
+// integrate into the adafruit_usb_descriptors project...
+
+//--------------------------------------------------------------------+
+// BOS Descriptor
+//--------------------------------------------------------------------+
+
+/* Microsoft OS 2.0 registry property descriptor
+Per MS requirements https://msdn.microsoft.com/en-us/library/windows/hardware/hh450799(v=vs.85).aspx
+device should create DeviceInterfaceGUIDs. It can be done by driver and
+in case of real PnP solution device should expose MS "Microsoft OS 2.0
+registry property descriptor". Such descriptor can insert any record
+into Windows registry per device/configuration/interface. In our case it
+will insert "DeviceInterfaceGUIDs" multistring property.
+
+GUID is freshly generated and should be OK to use.
+
+https://developers.google.com/web/fundamentals/native-hardware/build-for-webusb/
+(Section Microsoft OS compatibility descriptors)
+*/
+
+#define BOS_TOTAL_LEN (TUD_BOS_DESC_LEN + TUD_BOS_WEBUSB_DESC_LEN + TUD_BOS_MICROSOFT_OS_DESC_LEN)
+
+#define MS_OS_20_DESC_LEN 0xB2
+
+// BOS Descriptor is required for webUSB
+uint8_t const desc_bos[] =
+{{
+ // total length, number of device caps
+ TUD_BOS_DESCRIPTOR(BOS_TOTAL_LEN, 2),
+
+ // Vendor Code, iLandingPage
+ TUD_BOS_WEBUSB_DESCRIPTOR(VENDOR_REQUEST_WEBUSB, 1),
+
+ // Microsoft OS 2.0 descriptor
+ TUD_BOS_MS_OS_20_DESCRIPTOR(MS_OS_20_DESC_LEN, VENDOR_REQUEST_MICROSOFT)
+}};
+
+uint8_t const * tud_descriptor_bos_cb(void)
+{{
+ return desc_bos;
+}}
+
+
+#define ITF_NUM_VENDOR {webusb_interface} // used in this next descriptor
+
+uint8_t const desc_ms_os_20[] =
+{{
+ // Set header: length, type, windows version, total length
+ U16_TO_U8S_LE(0x000A), U16_TO_U8S_LE(MS_OS_20_SET_HEADER_DESCRIPTOR), U32_TO_U8S_LE(0x06030000), U16_TO_U8S_LE(MS_OS_20_DESC_LEN),
+
+ // Configuration subset header: length, type, configuration index, reserved, configuration total length
+ U16_TO_U8S_LE(0x0008), U16_TO_U8S_LE(MS_OS_20_SUBSET_HEADER_CONFIGURATION), 0, 0, U16_TO_U8S_LE(MS_OS_20_DESC_LEN-0x0A),
+
+ // Function Subset header: length, type, first interface, reserved, subset length
+ U16_TO_U8S_LE(0x0008), U16_TO_U8S_LE(MS_OS_20_SUBSET_HEADER_FUNCTION), ITF_NUM_VENDOR, 0, U16_TO_U8S_LE(MS_OS_20_DESC_LEN-0x0A-0x08),
+
+ // MS OS 2.0 Compatible ID descriptor: length, type, compatible ID, sub compatible ID
+ U16_TO_U8S_LE(0x0014), U16_TO_U8S_LE(MS_OS_20_FEATURE_COMPATBLE_ID), 'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // sub-compatible
+
+ // MS OS 2.0 Registry property descriptor: length, type
+ U16_TO_U8S_LE(MS_OS_20_DESC_LEN-0x0A-0x08-0x08-0x14), U16_TO_U8S_LE(MS_OS_20_FEATURE_REG_PROPERTY),
+ U16_TO_U8S_LE(0x0007), U16_TO_U8S_LE(0x002A), // wPropertyDataType, wPropertyNameLength and PropertyName "DeviceInterfaceGUIDs\0" in UTF-16
+ 'D', 0x00, 'e', 0x00, 'v', 0x00, 'i', 0x00, 'c', 0x00, 'e', 0x00, 'I', 0x00, 'n', 0x00, 't', 0x00, 'e', 0x00,
+ 'r', 0x00, 'f', 0x00, 'a', 0x00, 'c', 0x00, 'e', 0x00, 'G', 0x00, 'U', 0x00, 'I', 0x00, 'D', 0x00, 's', 0x00, 0x00, 0x00,
+ U16_TO_U8S_LE(0x0050), // wPropertyDataLength
+ //bPropertyData: “{{975F44D9-0D08-43FD-8B3E-127CA8AFFF9D}}”.
+ '{{', 0x00, '9', 0x00, '7', 0x00, '5', 0x00, 'F', 0x00, '4', 0x00, '4', 0x00, 'D', 0x00, '9', 0x00, '-', 0x00,
+ '0', 0x00, 'D', 0x00, '0', 0x00, '8', 0x00, '-', 0x00, '4', 0x00, '3', 0x00, 'F', 0x00, 'D', 0x00, '-', 0x00,
+ '8', 0x00, 'B', 0x00, '3', 0x00, 'E', 0x00, '-', 0x00, '1', 0x00, '2', 0x00, '7', 0x00, 'C', 0x00, 'A', 0x00,
+ '8', 0x00, 'A', 0x00, 'F', 0x00, 'F', 0x00, 'F', 0x00, '9', 0x00, 'D', 0x00, '}}', 0x00, 0x00, 0x00, 0x00, 0x00
+}};
+
+TU_VERIFY_STATIC(sizeof(desc_ms_os_20) == MS_OS_20_DESC_LEN, "Incorrect size");
+
+// End of section about desc_ms_os_20
+
+""".format(
+ webusb_url=args.webusb_url,
+ webusb_interface=vendor_interface.bInterfaceNumber,
+ )
+ )
diff --git a/tools/usb_descriptor b/tools/usb_descriptor
-Subproject 701cafc50e2e574dccaf7a340eedbd64a0b41a4
+Subproject 2eaa6114b209fe7f0a795eda8d6a7b3b93d76d2