Merge branch 'adafruit-main' into samd-sleep

Resolving circuipthon.pot conflicts with new samd alarm module
This commit is contained in:
Max Holliday 2021-10-09 14:28:49 -07:00
commit 5a83581d28
150 changed files with 5202 additions and 669 deletions

View File

@ -17,8 +17,8 @@ jobs:
- name: Install deps
run: |
sudo apt-add-repository -y -u ppa:pybricks/ppa
sudo apt-get install -y black gettext uncrustify
pip3 install -r requirements-dev.txt
sudo apt-get install -y gettext uncrustify
pip3 install black polib pyyaml
- name: Populate selected submodules
run: git submodule update --init extmod/ulab
- name: Set PY
@ -28,3 +28,12 @@ jobs:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: pre-commit/action@v1.1.0
- name: Make patch
if: failure()
run: git diff > ~/pre-commit.patch
- name: Upload patch
if: failure()
uses: actions/upload-artifact@v2
with:
name: patch
path: ~/pre-commit.patch

View File

@ -235,3 +235,5 @@ const mp_obj_module_t mp_module_ubinascii = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_binascii_globals,
};
MP_REGISTER_MODULE(MP_QSTR_binascii, mp_module_ubinascii, MICROPY_PY_UBINASCII);

View File

@ -375,4 +375,6 @@ const mp_obj_module_t mp_module_ujson = {
.globals = (mp_obj_dict_t *)&mp_module_ujson_globals,
};
MP_REGISTER_MODULE(MP_QSTR_json, mp_module_ujson, MICROPY_PY_UJSON);
#endif // MICROPY_PY_UJSON

View File

@ -469,6 +469,8 @@ const mp_obj_module_t mp_module_ure = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&mp_module_re_globals,
};
MP_REGISTER_MODULE(MP_QSTR_re, mp_module_ure, MICROPY_PY_URE);
#endif
// Source files #include'd here to make sure they're compiled in

@ -1 +1 @@
Subproject commit d0f1c46d7f879cd60562ee69900d619499d4d206
Subproject commit 2c89a329063848bcd7dba6af6fb6c9d6036dd4f2

View File

@ -172,6 +172,10 @@ msgstr "pin %q tidak valid"
msgid "%q should be an int"
msgstr "%q harus berupa int"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() mengambil posisi argumen %d tapi %d yang diberikan"
@ -376,7 +380,9 @@ msgstr "Jenis alamat di luar batas"
msgid "All CAN peripherals are in use"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "Semua perangkat I2C sedang digunakan"
@ -1321,8 +1327,11 @@ msgstr "Frekuensi PWM tidak valid"
msgid "Invalid Pin"
msgstr ""
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Argumen tidak valid"
@ -1370,10 +1379,6 @@ msgstr "File tidak valid"
msgid "Invalid format chunk size"
msgstr "Ukuran potongan format tidak valid"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "Akses memori tidak valid."
@ -1414,6 +1419,7 @@ msgstr "Pin untuk channel kanan tidak valid"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1796,6 +1802,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1920,10 +1930,13 @@ msgstr ""
"konstruktor"
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr "Pin harus berurutan"
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -3976,6 +3989,7 @@ msgstr ""
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -3994,6 +4008,7 @@ msgstr ""
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h

View File

@ -168,6 +168,10 @@ msgstr "Pin %q není platný"
msgid "%q should be an int"
msgstr "%q by měl být int"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() vyžaduje %d pozičních argumentů, ale %d jich bylo zadáno"
@ -372,7 +376,9 @@ msgstr ""
msgid "All CAN peripherals are in use"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr ""
@ -1304,8 +1310,11 @@ msgstr ""
msgid "Invalid Pin"
msgstr ""
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr ""
@ -1353,10 +1362,6 @@ msgstr ""
msgid "Invalid format chunk size"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr ""
@ -1397,6 +1402,7 @@ msgstr ""
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1774,6 +1780,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1893,10 +1903,13 @@ msgid ""
msgstr ""
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr ""
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -3936,6 +3949,7 @@ msgstr ""
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -3954,6 +3968,7 @@ msgstr ""
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h

View File

@ -173,6 +173,10 @@ msgstr "%q Pin ungültig"
msgid "%q should be an int"
msgstr "%q sollte ein integer sein"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr ""
@ -378,7 +382,9 @@ msgstr "Adresstyp außerhalb des zulässigen Bereichs"
msgid "All CAN peripherals are in use"
msgstr "Alle CAN Schnittstellen sind in Benutzung"
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "Alle I2C-Peripheriegeräte sind in Benutzung"
@ -1321,8 +1327,11 @@ msgstr "Ungültige PWM Frequenz"
msgid "Invalid Pin"
msgstr "Ungültiger Pin"
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Ungültiges Argument"
@ -1370,10 +1379,6 @@ msgstr "Ungültige Datei"
msgid "Invalid format chunk size"
msgstr "Ungültige format chunk size"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr "Ungültige Frequenz"
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "Ungültiger Speicherzugriff."
@ -1414,6 +1419,7 @@ msgstr "Ungültiger Pin für rechten Kanal"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1798,6 +1804,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1920,10 +1930,13 @@ msgstr ""
"allow_inefficient = True an den Konstruktor"
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr ""
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -4005,6 +4018,7 @@ msgstr "pow() mit 3 Argumenten erfordert Integer"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -4023,6 +4037,7 @@ msgstr "pow() mit 3 Argumenten erfordert Integer"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h
@ -4564,6 +4579,9 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
#~ msgid "Invalid frequency"
#~ msgstr "Ungültige Frequenz"
#~ msgid "Data 0 pin must be byte aligned."
#~ msgstr "Data 0 Pin muss Byte aligned sein."

View File

@ -165,6 +165,10 @@ msgstr ""
msgid "%q should be an int"
msgstr ""
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr ""
@ -369,7 +373,9 @@ msgstr ""
msgid "All CAN peripherals are in use"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr ""
@ -1301,8 +1307,11 @@ msgstr ""
msgid "Invalid Pin"
msgstr ""
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr ""
@ -1350,10 +1359,6 @@ msgstr ""
msgid "Invalid format chunk size"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr ""
@ -1394,6 +1399,7 @@ msgstr ""
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1771,6 +1777,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1890,10 +1900,13 @@ msgid ""
msgstr ""
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr ""
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -3933,6 +3946,7 @@ msgstr ""
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -3951,6 +3965,7 @@ msgstr ""
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h

View File

@ -174,6 +174,10 @@ msgstr "%q pin invalid"
msgid "%q should be an int"
msgstr "%q should be an int"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() takes %d positional arguments but %d were given"
@ -378,7 +382,9 @@ msgstr "Address type out of range"
msgid "All CAN peripherals are in use"
msgstr "All CAN peripherals are in use"
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "All I2C peripherals are in use"
@ -1316,8 +1322,11 @@ msgstr "Invalid PWM frequency"
msgid "Invalid Pin"
msgstr "Invalid pin"
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Invalid argument"
@ -1365,10 +1374,6 @@ msgstr "Invalid file"
msgid "Invalid format chunk size"
msgstr "Invalid format chunk size"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr "Invalid frequency"
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "Invalid memory access."
@ -1409,6 +1414,7 @@ msgstr "Invalid pin for right channel"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1790,6 +1796,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr "Only one TouchAlarm can be set in deep sleep."
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1914,10 +1924,13 @@ msgstr ""
"constructor"
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr "Pins must be sequential"
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr "Pins must share PWM slice"
@ -3975,6 +3988,7 @@ msgstr "pow() with 3 arguments requires integers"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -3993,6 +4007,7 @@ msgstr "pow() with 3 arguments requires integers"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h
@ -4529,6 +4544,9 @@ msgstr "zi must be of float type"
msgid "zi must be of shape (n_section, 2)"
msgstr "zi must be of shape (n_section, 2)"
#~ msgid "Invalid frequency"
#~ msgstr "Invalid frequency"
#~ msgid "Data 0 pin must be byte aligned."
#~ msgstr "Data 0 pin must be byte aligned."

View File

@ -176,6 +176,10 @@ msgstr "pin inválido %q"
msgid "%q should be an int"
msgstr "%q debe ser un int"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() toma %d argumentos posicionales pero %d fueron dados"
@ -380,7 +384,9 @@ msgstr "Tipo de dirección fuera de rango"
msgid "All CAN peripherals are in use"
msgstr "Todos los periféricos CAN están en uso"
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "Todos los periféricos I2C están siendo usados"
@ -1334,8 +1340,11 @@ msgstr "Frecuencia PWM inválida"
msgid "Invalid Pin"
msgstr "Pin inválido"
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Argumento inválido"
@ -1383,10 +1392,6 @@ msgstr "Archivo inválido"
msgid "Invalid format chunk size"
msgstr "Formato de fragmento de formato no válido"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr "Frecuencia inválida"
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "Acceso a memoria no válido."
@ -1427,6 +1432,7 @@ msgstr "Pin inválido para canal derecho"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1814,6 +1820,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr "Solamente una TouchAlarm puede ser configurada durante deep sleep."
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1938,10 +1948,13 @@ msgstr ""
"constructor"
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr "Los pines deben estar en orden secuencial"
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr "Los pines deben compartir la división PWM"
@ -4022,6 +4035,7 @@ msgstr "pow() con 3 argumentos requiere enteros"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -4040,6 +4054,7 @@ msgstr "pow() con 3 argumentos requiere enteros"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h
@ -4577,6 +4592,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 "Invalid frequency"
#~ msgstr "Frecuencia inválida"
#~ msgid "Data 0 pin must be byte aligned."
#~ msgstr "El pin de datos 0 debe ser alineado a byte."

View File

@ -168,6 +168,10 @@ msgstr ""
msgid "%q should be an int"
msgstr "y ay dapat int"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr ""
@ -373,7 +377,9 @@ msgstr ""
msgid "All CAN peripherals are in use"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "Lahat ng I2C peripherals ginagamit"
@ -1318,8 +1324,11 @@ msgstr "Mali ang PWM frequency"
msgid "Invalid Pin"
msgstr ""
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Maling argumento"
@ -1367,10 +1376,6 @@ msgstr "Mali ang file"
msgid "Invalid format chunk size"
msgstr "Mali ang format ng chunk size"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr ""
@ -1411,6 +1416,7 @@ msgstr "Mali ang pin para sa kanang channel"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1791,6 +1797,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1911,10 +1921,13 @@ msgid ""
msgstr ""
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr ""
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -3982,6 +3995,7 @@ msgstr "pow() na may 3 argumento kailangan ng integers"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -4000,6 +4014,7 @@ msgstr "pow() na may 3 argumento kailangan ng integers"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h

View File

@ -176,6 +176,10 @@ msgstr "broche %q invalide"
msgid "%q should be an int"
msgstr "%q doit être un chiffre entier (int)"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() prend %d paramètres positionnels mais %d ont été donnés"
@ -380,7 +384,9 @@ msgstr "Type d'adresse hors portée"
msgid "All CAN peripherals are in use"
msgstr "Tous les périphériques CAN sont utilisés"
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "Tous les périphériques I2C sont utilisés"
@ -1344,8 +1350,11 @@ msgstr "Fréquence de PWM invalide"
msgid "Invalid Pin"
msgstr "Broche invalide"
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Paramètre invalide"
@ -1393,10 +1402,6 @@ msgstr "Fichier invalide"
msgid "Invalid format chunk size"
msgstr "Taille de bloc de formatage invalide"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr "Fréquence non valide"
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "Accès à la mémoire invalide."
@ -1437,6 +1442,7 @@ msgstr "Broche invalide pour le canal droit"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1822,6 +1828,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr "Seulement une TouchAlarm peu être réglée en someil profond."
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1948,10 +1958,13 @@ msgstr ""
"= True au constructeur"
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr "Les broches doivent être séquentielles"
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr "Les broches doivent partager la tranche PWM"
@ -4033,6 +4046,7 @@ msgstr "pow() avec 3 arguments nécessite des entiers"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -4051,6 +4065,7 @@ msgstr "pow() avec 3 arguments nécessite des entiers"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h
@ -4588,6 +4603,9 @@ 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 "Invalid frequency"
#~ msgstr "Fréquence non valide"
#~ msgid "Data 0 pin must be byte aligned."
#~ msgstr "La broche Data 0 doit être aligné sur l'octet."

View File

@ -165,6 +165,10 @@ msgstr ""
msgid "%q should be an int"
msgstr ""
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr ""
@ -369,7 +373,9 @@ msgstr ""
msgid "All CAN peripherals are in use"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr ""
@ -1301,8 +1307,11 @@ msgstr ""
msgid "Invalid Pin"
msgstr ""
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr ""
@ -1350,10 +1359,6 @@ msgstr ""
msgid "Invalid format chunk size"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr ""
@ -1394,6 +1399,7 @@ msgstr ""
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1771,6 +1777,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1890,10 +1900,13 @@ msgid ""
msgstr ""
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr ""
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -3933,6 +3946,7 @@ msgstr ""
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -3951,6 +3965,7 @@ msgstr ""
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h

View File

@ -175,6 +175,10 @@ msgstr "%q pin non valido"
msgid "%q should be an int"
msgstr "%q dovrebbe essere un int"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d"
@ -380,7 +384,9 @@ msgstr "Tipo di indirizzo fuori intervallo"
msgid "All CAN peripherals are in use"
msgstr "Tutte le periferiche CAN sono in uso"
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "Tutte le periferiche I2C sono in uso"
@ -1325,8 +1331,11 @@ msgstr "Frequenza PWM non valida"
msgid "Invalid Pin"
msgstr ""
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Argomento non valido"
@ -1376,10 +1385,6 @@ msgstr "File non valido"
msgid "Invalid format chunk size"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr ""
@ -1420,6 +1425,7 @@ msgstr "Pin non valido per il canale destro"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1803,6 +1809,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1927,10 +1937,13 @@ msgid ""
msgstr ""
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr ""
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -3998,6 +4011,7 @@ msgstr "pow() con 3 argomenti richiede interi"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -4016,6 +4030,7 @@ msgstr "pow() con 3 argomenti richiede interi"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h

View File

@ -170,6 +170,10 @@ msgstr "%q ピンは無効"
msgid "%q should be an int"
msgstr "%qはint型でなければなりません"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() は %d 個の位置引数を取りますが、%d 個与えられました"
@ -374,7 +378,9 @@ msgstr "address_typeが範囲外"
msgid "All CAN peripherals are in use"
msgstr "全てのCAN周辺機器が使用中"
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "全てのI2C周辺機器が使用中"
@ -1312,8 +1318,11 @@ msgstr "無効なPWM周波数"
msgid "Invalid Pin"
msgstr ""
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "不正な引数"
@ -1361,10 +1370,6 @@ msgstr "不正なファイル"
msgid "Invalid format chunk size"
msgstr "フォーマットチャンクのサイズが不正"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr "不正な周波数"
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "不正なメモリアクセス"
@ -1405,6 +1410,7 @@ msgstr "右チャネルのピンが不正"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1784,6 +1790,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1904,10 +1914,13 @@ msgid ""
msgstr ""
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr ""
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -3955,6 +3968,7 @@ msgstr "pow()の第3引数には整数が必要"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -3973,6 +3987,7 @@ msgstr "pow()の第3引数には整数が必要"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h
@ -4508,6 +4523,9 @@ msgstr "ziはfloat値でなければなりません"
msgid "zi must be of shape (n_section, 2)"
msgstr ""
#~ msgid "Invalid frequency"
#~ msgstr "不正な周波数"
#~ msgid "ParallelBus not yet supported"
#~ msgstr "ParallelBusにはまだ対応していません"

View File

@ -166,6 +166,10 @@ msgstr ""
msgid "%q should be an int"
msgstr "%q 는 정수(int) 여야합니다"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr ""
@ -370,7 +374,9 @@ msgstr ""
msgid "All CAN peripherals are in use"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "사용중인 모든 I2C주변 기기"
@ -1304,8 +1310,11 @@ msgstr ""
msgid "Invalid Pin"
msgstr ""
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr ""
@ -1353,10 +1362,6 @@ msgstr "파일이 유효하지 않습니다"
msgid "Invalid format chunk size"
msgstr "형식 청크 크기가 잘못되었습니다"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr ""
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr ""
@ -1397,6 +1402,7 @@ msgstr "오른쪽 채널 핀이 잘못되었습니다"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1774,6 +1780,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1893,10 +1903,13 @@ msgid ""
msgstr ""
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr ""
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -3937,6 +3950,7 @@ msgstr ""
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -3955,6 +3969,7 @@ msgstr ""
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h

View File

@ -168,6 +168,10 @@ msgstr "%q pin onjuist"
msgid "%q should be an int"
msgstr "%q moet een int zijn"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() verwacht %d positionele argumenten maar kreeg %d"
@ -372,7 +376,9 @@ msgstr "Adres type buiten bereik"
msgid "All CAN peripherals are in use"
msgstr "Alle CAN-peripherals zijn in gebruik"
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "Alle I2C peripherals zijn in gebruik"
@ -1313,8 +1319,11 @@ msgstr "Ongeldige PWM frequentie"
msgid "Invalid Pin"
msgstr "Ongeldige Pin"
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Ongeldig argument"
@ -1362,10 +1371,6 @@ msgstr "Ongeldig bestand"
msgid "Invalid format chunk size"
msgstr "Ongeldig formaat stuk grootte"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr "Onjuiste frequentie"
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "Ongeldig geheugen adres."
@ -1406,6 +1411,7 @@ msgstr "Ongeldige pin voor rechter kanaal"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1789,6 +1795,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1914,10 +1924,13 @@ msgstr ""
"allow_inefficient=True aan de constructor"
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr ""
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -3979,6 +3992,7 @@ msgstr "pow() met 3 argumenten vereist integers"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -3997,6 +4011,7 @@ msgstr "pow() met 3 argumenten vereist integers"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h
@ -4533,6 +4548,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 "Invalid frequency"
#~ msgstr "Onjuiste frequentie"
#~ msgid "ParallelBus not yet supported"
#~ msgstr "ParallelBus nog niet ondersteund"

View File

@ -170,6 +170,10 @@ msgstr "nieprawidłowy pin %q"
msgid "%q should be an int"
msgstr "%q powinno być typu int"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() bierze %d argumentów pozycyjnych, lecz podano %d"
@ -374,7 +378,9 @@ msgstr "Typ adresu poza zakresem"
msgid "All CAN peripherals are in use"
msgstr ""
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "Wszystkie peryferia I2C w użyciu"
@ -1312,8 +1318,11 @@ msgstr "Zła częstotliwość PWM"
msgid "Invalid Pin"
msgstr ""
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Zły argument"
@ -1361,10 +1370,6 @@ msgstr "Zły plik"
msgid "Invalid format chunk size"
msgstr "Zła wielkość fragmentu formatu"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr "Nieprawidłowa częstotliwość"
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "Nieprawidłowy dostęp do pamięci."
@ -1405,6 +1410,7 @@ msgstr "Zła nóżka dla prawego kanału"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1782,6 +1788,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr ""
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1901,10 +1911,13 @@ msgid ""
msgstr ""
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr ""
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr ""
@ -3952,6 +3965,7 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -3970,6 +3984,7 @@ msgstr "trzyargumentowe pow() wymaga liczb całkowitych"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h
@ -4505,6 +4520,9 @@ msgstr ""
msgid "zi must be of shape (n_section, 2)"
msgstr ""
#~ msgid "Invalid frequency"
#~ msgstr "Nieprawidłowa częstotliwość"
#~ msgid "ParallelBus not yet supported"
#~ msgstr "ParallelBus nie jest jeszcze obsługiwany"

View File

@ -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-09-24 01:40+0000\n"
"PO-Revision-Date: 2021-10-08 16:30+0000\n"
"Last-Translator: Wellington Terumi Uemura <wellingtonuemura@gmail.com>\n"
"Language-Team: \n"
"Language: pt_BR\n"
@ -174,6 +174,10 @@ msgstr "%q pino inválido"
msgid "%q should be an int"
msgstr "%q deve ser um int"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr "%q com um relatório com ID de 0 deve ter comprimento 1"
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados"
@ -382,7 +386,9 @@ msgstr "O tipo do endereço está fora do alcance"
msgid "All CAN peripherals are in use"
msgstr "Todos os periféricos CAN estão em uso"
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "Todos os periféricos I2C estão em uso"
@ -1335,8 +1341,11 @@ msgstr "Frequência PWM inválida"
msgid "Invalid Pin"
msgstr "Pino inválido"
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Argumento inválido"
@ -1384,10 +1393,6 @@ msgstr "Arquivo inválido"
msgid "Invalid format chunk size"
msgstr "Tamanho do pedaço de formato inválido"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr "Frequência inválida"
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "O acesso da memória é inválido."
@ -1428,6 +1433,7 @@ msgstr "Pino inválido para canal direito"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1812,6 +1818,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr "Apenas um TouchAlarm pode ser colocado em deep sleep."
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr "Apenas um endereço é permitido"
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1938,10 +1948,13 @@ msgstr ""
"construtor"
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr "Os pinos devem ser sequenciais"
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr "Pinos devem ser pinos GPIO sequenciais"
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr "Os pinos devem compartilhar a fatia do PWM"
@ -4035,6 +4048,7 @@ msgstr "o pow() com 3 argumentos requer números inteiros"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -4053,6 +4067,7 @@ msgstr "o pow() com 3 argumentos requer números inteiros"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h
@ -4589,6 +4604,9 @@ 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 "Invalid frequency"
#~ msgstr "Frequência inválida"
#~ msgid "Data 0 pin must be byte aligned."
#~ msgstr "O pino de dados 0 deve ser alinhado por bytes."

View File

@ -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-09-25 07:37+0000\n"
"PO-Revision-Date: 2021-10-08 16:52+0000\n"
"Last-Translator: Jonny Bergdahl <jonny@bergdahl.it>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: sv\n"
@ -173,6 +173,10 @@ msgstr "Pinne %q ogiltig"
msgid "%q should be an int"
msgstr "%q ska vara en int"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr "%q med report-ID 0 måste ha längd 1"
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "% q() tar %d positionsargument men %d gavs"
@ -377,7 +381,9 @@ msgstr "Adresstyp utanför intervallet"
msgid "All CAN peripherals are in use"
msgstr "All I2C-kringutrustning används"
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "All I2C-kringutrustning används"
@ -1320,8 +1326,11 @@ msgstr "Ogiltig PWM-frekvens"
msgid "Invalid Pin"
msgstr "Ogiltig pinne"
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Ogiltigt argument"
@ -1369,10 +1378,6 @@ msgstr "Felaktig fil"
msgid "Invalid format chunk size"
msgstr "Ogiltig formatsegmentstorlek"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr "Ogiltig frekvens"
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "Ogiltig minnesåtkomst."
@ -1413,6 +1418,7 @@ msgstr "Ogiltig pinne för höger kanal"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1796,6 +1802,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr "Endast ett TouchAlarm kan ställas in för djupsömn."
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr "Endast en adress är tillåten"
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1920,10 +1930,13 @@ msgstr ""
"konstruktorn"
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr "Pinnarna måste vara i sekvens"
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr "Pins måste vara sekventiella GPIO-pinnar"
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr "Pinnar måste dela PWM-segment"
@ -3994,6 +4007,7 @@ msgstr "pow() med 3 argument kräver heltal"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -4012,6 +4026,7 @@ msgstr "pow() med 3 argument kräver heltal"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h
@ -4548,6 +4563,9 @@ 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 "Invalid frequency"
#~ msgstr "Ogiltig frekvens"
#~ msgid "Data 0 pin must be byte aligned."
#~ msgstr "Datapinne 0 måste vara byte-justerad."

View File

@ -175,6 +175,10 @@ msgstr "%q yǐn jiǎo wúxiào"
msgid "%q should be an int"
msgstr "%q yīnggāi shì yīgè int"
#: shared-bindings/usb_hid/Device.c
msgid "%q with a report ID of 0 must be of length 1"
msgstr ""
#: py/bc.c py/objnamedtuple.c
msgid "%q() takes %d positional arguments but %d were given"
msgstr "%q() cǎiyòng %d wèizhì cānshù, dàn gěi chū %d"
@ -379,7 +383,9 @@ msgstr "Dìzhǐ lèixíng chāochū fànwéi"
msgid "All CAN peripherals are in use"
msgstr "suǒ yǒu CAN wài shè dōu zài shǐ yòng zhōng"
#: ports/espressif/common-hal/busio/I2C.c ports/nrf/common-hal/busio/I2C.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/nrf/common-hal/busio/I2C.c
msgid "All I2C peripherals are in use"
msgstr "Suǒyǒu I2C wàiwéi qì zhèngzài shǐyòng"
@ -1323,8 +1329,11 @@ msgstr "Wúxiào de PWM pínlǜ"
msgid "Invalid Pin"
msgstr "wú xiào yǐn jiǎo"
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
#: py/moduerrno.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/espressif/bindings/espidf/__init__.c
#: ports/espressif/common-hal/busio/I2C.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/espressif/esp_error.c py/moduerrno.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid argument"
msgstr "Wúxiào de cānshù"
@ -1372,10 +1381,6 @@ msgstr "Wúxiào de wénjiàn"
msgid "Invalid format chunk size"
msgstr "Géshì kuài dàxiǎo wúxiào"
#: ports/espressif/common-hal/busio/I2C.c
msgid "Invalid frequency"
msgstr "Wúxiào de pínlǜ"
#: supervisor/shared/safe_mode.c
msgid "Invalid memory access."
msgstr "Wúxiào de nèicún fǎngwèn."
@ -1416,6 +1421,7 @@ msgstr "Yòuxián tōngdào yǐn jiǎo wúxiào"
#: ports/espressif/common-hal/busio/SPI.c
#: ports/espressif/common-hal/busio/UART.c
#: ports/espressif/common-hal/canio/CAN.c
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
#: ports/mimxrt10xx/common-hal/busio/I2C.c
#: ports/mimxrt10xx/common-hal/busio/SPI.c ports/nrf/common-hal/busio/I2C.c
#: ports/raspberrypi/common-hal/busio/I2C.c
@ -1799,6 +1805,10 @@ msgstr ""
msgid "Only one TouchAlarm can be set in deep sleep."
msgstr "zhǐ yǒu yí gè chù mō bì kě yǐ shè zhì zài shēn dù shuì mián."
#: ports/espressif/common-hal/i2cperipheral/I2CPeripheral.c
msgid "Only one address is allowed"
msgstr ""
#: ports/espressif/common-hal/alarm/time/TimeAlarm.c
#: ports/nrf/common-hal/alarm/time/TimeAlarm.c
#: ports/raspberrypi/common-hal/alarm/time/TimeAlarm.c
@ -1922,10 +1932,13 @@ msgstr ""
"gěigòuzào hánshù"
#: ports/raspberrypi/common-hal/imagecapture/ParallelImageCapture.c
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential"
msgstr "yǐn jiǎo bì xū shì lián xù de"
#: ports/raspberrypi/common-hal/rotaryio/IncrementalEncoder.c
msgid "Pins must be sequential GPIO pins"
msgstr ""
#: ports/raspberrypi/common-hal/audiopwmio/PWMAudioOut.c
msgid "Pins must share PWM slice"
msgstr "yǐn jiǎo bì xū gòng xiǎng PWM qiē piàn"
@ -3994,6 +4007,7 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù"
#: ports/espressif/boards/adafruit_funhouse/mpconfigboard.h
#: ports/espressif/boards/adafruit_magtag_2.9_grayscale/mpconfigboard.h
#: ports/espressif/boards/adafruit_metro_esp32s2/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp32-c3s/mpconfigboard.h
#: ports/espressif/boards/ai_thinker_esp_12k_nodemcu/mpconfigboard.h
#: ports/espressif/boards/artisense_rd00/mpconfigboard.h
#: ports/espressif/boards/atmegazero_esp32s2/mpconfigboard.h
@ -4012,6 +4026,7 @@ msgstr "pow() yǒu 3 cānshù xūyào zhěngshù"
#: ports/espressif/boards/gravitech_cucumber_rs/mpconfigboard.h
#: ports/espressif/boards/lilygo_ttgo_t8_s2_st7789/mpconfigboard.h
#: ports/espressif/boards/lolin_s2_mini/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_c3/mpconfigboard.h
#: ports/espressif/boards/microdev_micro_s2/mpconfigboard.h
#: ports/espressif/boards/morpheans_morphesp-240/mpconfigboard.h
#: ports/espressif/boards/muselab_nanoesp32_s2_wroom/mpconfigboard.h
@ -4548,6 +4563,9 @@ 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 "Invalid frequency"
#~ msgstr "Wúxiào de pínlǜ"
#~ msgid "Data 0 pin must be byte aligned."
#~ msgstr "shù jù 0 yǐn jiǎo bì xū àn zì jié duì qí."

View File

@ -57,3 +57,5 @@ const mp_obj_module_t samd_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&samd_module_globals,
};
MP_REGISTER_MODULE(MP_QSTR_samd, samd_module, CIRCUITPY_SAMD);

View File

@ -0,0 +1,39 @@
/*
* 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"
#include "hal/include/hal_gpio.h"
void board_init(void) {
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}

View File

@ -0,0 +1,7 @@
#define MICROPY_HW_BOARD_NAME "Seeeduino XIAO KB"
#define MICROPY_HW_MCU_NAME "samd21g18"
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1

View File

@ -0,0 +1,35 @@
USB_VID = 0x2886
USB_PID = 0x802F
# VID & PID Provided by Seeed
USB_PRODUCT = "Seeeduino XIAO KB"
USB_MANUFACTURER = "Seeed"
CHIP_VARIANT = SAMD21G18A
CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_FULL_BUILD = 0
# A number of modules are removed
# Many I/O functions are not available or not used in a keyboard
# CIRCUITPY_ANALOGIO = 1 # Needed for potentiometer input (mouse)
CIRCUITPY_AUDIOCORE = 0
CIRCUITPY_BUSIO = 0 # Needed for I2C, SPI and UART - removed that for keyboards...
CIRCUITPY_PULSEIO = 0
# CIRCUITPY_PWMIO = 1 # only needed for speaker or LED PWM functions. Takes 2314 bytes.
CIRCUITPY_RTC = 0
CIRCUITPY_MATH = 0
#CIRCUITPY_RANDOM = 0
CIRCUITPY_ONEWIREIO = 0
#CIRCUITPY_NEOPIXEL_WRITE = 1 # Needed fo RGB LEDs
#CIRCUITPY_RAINBOWIO = 1 # Needed fo RGB LEDs
# These are used in a keyboard or computer input device.
CIRCUITPY_ROTARYIO = 1
CIRCUITPY_KEYPAD = 1
CIRCUITPY_USB_HID = 1
CIRCUITPY_USB_MIDI = 1
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View File

@ -0,0 +1,38 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_board_id), MP_ROM_PTR(&board_module_id_obj) },
// Analog pins
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_PB08) },
{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_PB09) },
{ MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_PA05) },
{ MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_PA06) },
// Digital pins
{ MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PB08) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PB09) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PA05) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA17) },
// LED pins
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA17) }, // status
{ MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_PA17) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -85,8 +85,8 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t *self,
_pm_enable_bus_clock(PM_BUS_APBC, DAC);
#endif
// SAMD21: This clock should be <= 12 MHz, per datasheet section 47.6.3.
// SAMD51: This clock should be <= 350kHz, per datasheet table 37-6.
// SAMD21: This clock should be <= 350 kHz, per datasheet table 36-7.
// SAMD51: This clock should be <= 12 MHz, per datasheet section 47.6.3.
_gclk_enable_channel(DAC_GCLK_ID, CONF_GCLK_DAC_SRC);
// Don't double init the DAC on the SAMD51 when both outputs are in use. We use the free state

View File

@ -52,7 +52,9 @@ void reset_all_pins(void) {
uint32_t pin_mask[PORT_COUNT] = PORT_OUT_IMPLEMENTED;
// Do not full reset USB lines.
#if CIRCUITPY_USB
pin_mask[0] &= ~(PORT_PA24 | PORT_PA25);
#endif
// Do not reset SWD when a debugger is present.
if (DSU->STATUSB.bit.DBGPRES == 1) {

View File

@ -219,6 +219,7 @@ SRC_C += \
boards/$(BOARD)/pins.c \
modules/$(CIRCUITPY_MODULE).c \
lib/netutils/netutils.c \
peripherals/i2c.c \
peripherals/rmt.c \
peripherals/timer.c \
peripherals/$(IDF_TARGET)/pins.c

View File

@ -208,3 +208,5 @@ void raise_esp_error(esp_err_t err) {
}
mp_raise_msg_varg(exception_type, translate("%s error 0x%x"), group, err);
}
MP_REGISTER_MODULE(MP_QSTR_espidf, espidf_module, CIRCUITPY_ESPIDF);

View File

@ -0,0 +1,56 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 microDev
* Copyright (c) 2021 skieast/Bruce Segal
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "shared-bindings/microcontroller/Pin.h"
void board_init(void) {
// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO20);
common_hal_never_reset_pin(&pin_GPIO21);
#endif
// SPI Flash
common_hal_never_reset_pin(&pin_GPIO11);
common_hal_never_reset_pin(&pin_GPIO12);
common_hal_never_reset_pin(&pin_GPIO13);
common_hal_never_reset_pin(&pin_GPIO14);
common_hal_never_reset_pin(&pin_GPIO15);
common_hal_never_reset_pin(&pin_GPIO16);
common_hal_never_reset_pin(&pin_GPIO17);
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}
void board_deinit(void) {
}

View File

@ -0,0 +1,47 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 microDev
* Copyright (c) 2021 skieast/Bruce Segal
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
// Board setup
#define MICROPY_HW_BOARD_NAME "AITHinker ESP32-C3S_Kit"
#define MICROPY_HW_MCU_NAME "ESP32-C3FN4"
// Status LED
#define MICROPY_HW_LED_STATUS (&pin_GPIO19)
// Default bus pins
#define DEFAULT_UART_BUS_RX (&pin_GPIO20)
#define DEFAULT_UART_BUS_TX (&pin_GPIO21)
// Serial over UART
#define DEBUG_UART_RX DEFAULT_UART_BUS_RX
#define DEBUG_UART_TX DEFAULT_UART_BUS_TX
// For entering safe mode
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9)
// Explanation of how a user got into safe mode
#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n")

View File

@ -0,0 +1,10 @@
CIRCUITPY_CREATOR_ID = 0x70010001
CIRCUITPY_CREATION_ID = 0x00100001
IDF_TARGET = esp32c3
INTERNAL_FLASH_FILESYSTEM = 1
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB

View File

@ -0,0 +1,72 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 microDev
* Copyright (c) 2021 skieast/Bruce Segal
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_ADC), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_LED_YELLOW), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_LED_WHITE), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_LED_GREEN), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_LED_BLUE), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -0,0 +1,5 @@
#
# LWIP
#
CONFIG_LWIP_LOCAL_HOSTNAME="AIThinker-ESP32C3S"
# end of LWIP

View File

@ -0,0 +1,58 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 microDev
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "shared-bindings/microcontroller/Pin.h"
void board_init(void) {
// USB
common_hal_never_reset_pin(&pin_GPIO18);
common_hal_never_reset_pin(&pin_GPIO19);
// Debug UART
#ifdef DEBUG
common_hal_never_reset_pin(&pin_GPIO20);
common_hal_never_reset_pin(&pin_GPIO21);
#endif
// SPI Flash
common_hal_never_reset_pin(&pin_GPIO11);
common_hal_never_reset_pin(&pin_GPIO12);
common_hal_never_reset_pin(&pin_GPIO13);
common_hal_never_reset_pin(&pin_GPIO14);
common_hal_never_reset_pin(&pin_GPIO15);
common_hal_never_reset_pin(&pin_GPIO16);
common_hal_never_reset_pin(&pin_GPIO17);
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}
void board_deinit(void) {
}

View File

@ -0,0 +1,54 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 microDev
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
// Board setup
#define MICROPY_HW_BOARD_NAME "MicroDev microC3"
#define MICROPY_HW_MCU_NAME "ESP32-C3FN4"
// Status LED
#define MICROPY_HW_NEOPIXEL (&pin_GPIO7)
#define MICROPY_HW_NEOPIXEL_COUNT (2)
// Default bus pins
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO4)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO5)
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO1)
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO2)
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO3)
#define DEFAULT_UART_BUS_RX (&pin_GPIO20)
#define DEFAULT_UART_BUS_TX (&pin_GPIO21)
// Serial over UART
#define DEBUG_UART_RX DEFAULT_UART_BUS_RX
#define DEBUG_UART_TX DEFAULT_UART_BUS_TX
// For entering safe mode
#define CIRCUITPY_BOOT_BUTTON (&pin_GPIO9)
// Explanation of how a user got into safe mode
#define BOARD_USER_SAFE_MODE_ACTION translate("pressing boot button at start up.\n")

View File

@ -0,0 +1,10 @@
CIRCUITPY_CREATOR_ID = 0x6d446576
CIRCUITPY_CREATION_ID = 0x006d4333
IDF_TARGET = esp32c3
INTERNAL_FLASH_FILESYSTEM = 1
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=80m
CIRCUITPY_ESP_FLASH_SIZE=4MB

View File

@ -0,0 +1,78 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 microDev
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_MTMS), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_MTDI), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_MTCK), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_MTDO), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -0,0 +1,5 @@
#
# LWIP
#
CONFIG_LWIP_LOCAL_HOSTNAME="MicroDev-microC3"
# end of LWIP

View File

@ -34,26 +34,6 @@
#include "shared-bindings/microcontroller/Pin.h"
#include "supervisor/shared/translate.h"
typedef enum {
STATUS_FREE = 0,
STATUS_IN_USE,
STATUS_NEVER_RESET
} i2c_status_t;
static i2c_status_t i2c_status[I2C_NUM_MAX];
void never_reset_i2c(i2c_port_t num) {
i2c_status[num] = STATUS_NEVER_RESET;
}
void i2c_reset(void) {
for (i2c_port_t num = 0; num < I2C_NUM_MAX; num++) {
if (i2c_status[num] == STATUS_IN_USE) {
i2c_status[num] = STATUS_FREE;
}
}
}
void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda, uint32_t frequency, uint32_t timeout) {
// Pins 45 and 46 are "strapping" pins that impact start up behavior. They usually need to
@ -99,21 +79,16 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
}
self->sda_pin = sda;
self->scl_pin = scl;
self->i2c_num = I2C_NUM_MAX;
for (i2c_port_t num = 0; num < I2C_NUM_MAX; num++) {
if (i2c_status[num] == STATUS_FREE) {
self->i2c_num = num;
}
}
self->i2c_num = peripherals_i2c_get_free_num();
if (self->i2c_num == I2C_NUM_MAX) {
mp_raise_ValueError(translate("All I2C peripherals are in use"));
}
i2c_status[self->i2c_num] = STATUS_IN_USE;
// Delete any previous driver.
i2c_driver_delete(self->i2c_num);
i2c_config_t i2c_conf = {
const i2c_config_t i2c_conf = {
.mode = I2C_MODE_MASTER,
.sda_io_num = self->sda_pin->number,
.scl_io_num = self->scl_pin->number,
@ -129,16 +104,15 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
.clk_speed = frequency,
}
};
if (i2c_param_config(self->i2c_num, &i2c_conf) != ESP_OK) {
mp_raise_ValueError(translate("Invalid frequency"));
}
if (i2c_driver_install(self->i2c_num,
I2C_MODE_MASTER,
0,
0,
0) != ESP_OK) {
mp_raise_OSError(MP_EIO);
// Initialize I2C.
esp_err_t err = peripherals_i2c_init(self->i2c_num, &i2c_conf);
if (err != ESP_OK) {
if (err == ESP_FAIL) {
mp_raise_OSError(MP_EIO);
} else {
mp_raise_ValueError(translate("Invalid argument"));
}
}
claim_pin(sda);
@ -154,14 +128,12 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) {
return;
}
i2c_driver_delete(self->i2c_num);
peripherals_i2c_deinit(self->i2c_num);
common_hal_reset_pin(self->sda_pin);
common_hal_reset_pin(self->scl_pin);
self->sda_pin = NULL;
self->scl_pin = NULL;
i2c_status[self->i2c_num] = STATUS_FREE;
}
bool common_hal_busio_i2c_probe(busio_i2c_obj_t *self, uint8_t addr) {

View File

@ -34,6 +34,8 @@
#include "freertos/semphr.h"
#include "py/obj.h"
#include "peripherals/i2c.h"
typedef struct {
mp_obj_base_t base;
const mcu_pin_obj_t *scl_pin;
@ -43,6 +45,4 @@ typedef struct {
bool has_lock;
} busio_i2c_obj_t;
void i2c_reset(void);
#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_H

View File

@ -0,0 +1,125 @@
/*
* 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 "shared-bindings/i2cperipheral/I2CPeripheral.h"
#include "py/mperrno.h"
#include "py/runtime.h"
#include "common-hal/i2cperipheral/I2CPeripheral.h"
void common_hal_i2cperipheral_i2c_peripheral_construct(i2cperipheral_i2c_peripheral_obj_t *self,
const mcu_pin_obj_t *scl, const mcu_pin_obj_t *sda,
uint8_t *addresses, unsigned int num_addresses, bool smbus) {
// Pins 45 and 46 are "strapping" pins that impact start up behavior. They usually need to
// be pulled-down so pulling them up for I2C is a bad idea. To make this hard, we don't
// support I2C on these pins.
// Also 46 is input-only so it'll never work.
if (scl->number == 45 || scl->number == 46 || sda->number == 45 || sda->number == 46) {
mp_raise_ValueError(translate("Invalid pins"));
}
if (num_addresses > 1) {
mp_raise_ValueError(translate("Only one address is allowed"));
}
self->addresses = addresses;
self->num_addresses = num_addresses;
self->sda_pin = sda;
self->scl_pin = scl;
self->i2c_num = peripherals_i2c_get_free_num();
if (self->i2c_num == I2C_NUM_MAX) {
mp_raise_ValueError(translate("All I2C peripherals are in use"));
}
const i2c_config_t i2c_conf = {
.mode = I2C_MODE_SLAVE,
.sda_io_num = self->sda_pin->number,
.scl_io_num = self->scl_pin->number,
.sda_pullup_en = GPIO_PULLUP_ENABLE,
.scl_pullup_en = GPIO_PULLUP_ENABLE,
.slave.addr_10bit_en = 0,
.slave.slave_addr = self->addresses[0],
};
// Initialize I2C.
esp_err_t err = peripherals_i2c_init(self->i2c_num, &i2c_conf);
if (err != ESP_OK) {
if (err == ESP_FAIL) {
mp_raise_OSError(MP_EIO);
} else {
mp_raise_ValueError(translate("Invalid argument"));
}
}
claim_pin(sda);
claim_pin(scl);
}
bool common_hal_i2cperipheral_i2c_peripheral_deinited(i2cperipheral_i2c_peripheral_obj_t *self) {
return self->sda_pin == NULL;
}
void common_hal_i2cperipheral_i2c_peripheral_deinit(i2cperipheral_i2c_peripheral_obj_t *self) {
if (common_hal_i2cperipheral_i2c_peripheral_deinited(self)) {
return;
}
peripherals_i2c_deinit(self->i2c_num);
common_hal_reset_pin(self->sda_pin);
common_hal_reset_pin(self->scl_pin);
self->sda_pin = NULL;
self->scl_pin = NULL;
}
int common_hal_i2cperipheral_i2c_peripheral_is_addressed(i2cperipheral_i2c_peripheral_obj_t *self,
uint8_t *address, bool *is_read, bool *is_restart) {
*address = self->addresses[0];
*is_read = true;
*is_restart = false;
return 1;
}
int common_hal_i2cperipheral_i2c_peripheral_read_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t *data) {
i2c_slave_read_buffer(self->i2c_num, data, 128, 0);
return 1;
}
int common_hal_i2cperipheral_i2c_peripheral_write_byte(i2cperipheral_i2c_peripheral_obj_t *self, uint8_t data) {
i2c_reset_tx_fifo(self->i2c_num);
i2c_slave_write_buffer(self->i2c_num, &data, 128, 0);
return 1;
}
void common_hal_i2cperipheral_i2c_peripheral_ack(i2cperipheral_i2c_peripheral_obj_t *self, bool ack) {
}
void common_hal_i2cperipheral_i2c_peripheral_close(i2cperipheral_i2c_peripheral_obj_t *self) {
}

View File

@ -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_ESPRESSIF_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H
#define MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H
#include "py/obj.h"
#include "peripherals/i2c.h"
#include "common-hal/microcontroller/Pin.h"
typedef struct {
mp_obj_base_t base;
i2c_port_t i2c_num;
uint8_t *addresses;
uint8_t num_addresses;
const mcu_pin_obj_t *scl_pin;
const mcu_pin_obj_t *sda_pin;
} i2cperipheral_i2c_peripheral_obj_t;
#endif // MICROPY_INCLUDED_ESPRESSIF_COMMON_HAL_BUSIO_I2C_PERIPHERAL_H

View File

@ -0,0 +1 @@
// No i2cperipheral module functions.

View File

@ -25,7 +25,7 @@ CIRCUITPY_DUALBANK ?= 1
CIRCUITPY_FRAMEBUFFERIO ?= 1
CIRCUITPY_FREQUENCYIO ?= 1
CIRCUITPY_IMAGECAPTURE ?= 1
CIRCUITPY_I2CPERIPHERAL ?= 0
CIRCUITPY_I2CPERIPHERAL ?= 1
CIRCUITPY_RGBMATRIX ?= 1
CIRCUITPY_ROTARYIO ?= 1
CIRCUITPY_NVM ?= 1

View File

@ -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 "peripherals/i2c.h"
typedef enum {
STATUS_FREE = 0,
STATUS_IN_USE,
STATUS_NEVER_RESET
} i2c_status_t;
static i2c_status_t i2c_status[I2C_NUM_MAX];
void i2c_reset(void) {
for (i2c_port_t num = 0; num < I2C_NUM_MAX; num++) {
if (i2c_status[num] == STATUS_IN_USE) {
i2c_driver_delete(num);
i2c_status[num] = STATUS_FREE;
}
}
}
void never_reset_i2c(i2c_port_t num) {
i2c_status[num] = STATUS_NEVER_RESET;
}
esp_err_t peripherals_i2c_init(i2c_port_t num, const i2c_config_t *i2c_conf) {
esp_err_t err = i2c_param_config(num, i2c_conf);
if (err != ESP_OK) {
return err;
}
size_t rx_buf_len = 0;
size_t tx_buf_len = 0;
if (i2c_conf->mode == I2C_MODE_SLAVE) {
rx_buf_len = 256;
tx_buf_len = 256;
}
return i2c_driver_install(num, i2c_conf->mode, rx_buf_len, tx_buf_len, 0);
}
void peripherals_i2c_deinit(i2c_port_t num) {
i2c_reset_rx_fifo(num);
i2c_reset_tx_fifo(num);
i2c_driver_delete(num);
i2c_status[num] = STATUS_FREE;
}
i2c_port_t peripherals_i2c_get_free_num(void) {
i2c_port_t i2c_num = I2C_NUM_MAX;
for (i2c_port_t num = 0; num < I2C_NUM_MAX; num++) {
if (i2c_status[num] == STATUS_FREE) {
i2c_num = num;
break;
}
}
if (i2c_num != I2C_NUM_MAX) {
i2c_status[i2c_num] = STATUS_IN_USE;
}
return i2c_num;
}

View File

@ -0,0 +1,38 @@
/*
* 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_ESPRESSIF_PERIPHERALS_I2C_HANDLER_H
#define MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_I2C_HANDLER_H
#include "driver/i2c.h"
extern void i2c_reset(void);
extern void never_reset_i2c(i2c_port_t num);
extern esp_err_t peripherals_i2c_init(i2c_port_t num, const i2c_config_t *i2c_conf);
extern void peripherals_i2c_deinit(i2c_port_t num);
extern i2c_port_t peripherals_i2c_get_free_num(void);
#endif // MICROPY_INCLUDED_ESPRESSIF_PERIPHERALS_I2C_HANDLER_H

View File

@ -36,6 +36,12 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_P0_27) },
{ MP_ROM_QSTR(MP_QSTR_CHARGING), MP_ROM_PTR(&pin_P0_03) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_P0_02) },
{ MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_P0_02) },
{ MP_ROM_QSTR(MP_QSTR_RGB_POWER), MP_ROM_PTR(&pin_P1_04) },
// { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }
};

View File

@ -27,7 +27,7 @@
#include "nrfx/hal/nrf_gpio.h"
#define MICROPY_HW_BOARD_NAME "PCA10100 nRF52833 Dongle"
#define MICROPY_HW_BOARD_NAME "PCA10100 nRF52833 DK"
#define MICROPY_HW_MCU_NAME "nRF52833"
#define MICROPY_HW_LED_STATUS (&pin_P0_13)

View File

@ -58,3 +58,5 @@ const mp_obj_module_t rp2pio_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&rp2pio_module_globals,
};
MP_REGISTER_MODULE(MP_QSTR_rp2pio, rp2pio_module, CIRCUITPY_RP2PIO);

View File

@ -25,8 +25,93 @@
*/
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "shared-bindings/busio/SPI.h"
#include "shared-bindings/displayio/FourWire.h"
#include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h"
#include "supervisor/shared/board.h"
displayio_fourwire_obj_t board_display_obj;
#define DELAY 0x80
uint8_t display_init_sequence[] = {
0x01, 0 | DELAY, 150, // SWRESET
0x36, 1, 0x04, // MADCTL
0x35, 1, 0x00, // TEON
0xB2, 5, 0x0c, 0x0c, 0x00, 0x33, 0x33, // FRMCTR2
0x3A, 1, 0x05, // COLMOD
0xB7, 1, 0x14, // GCTRL
0xBB, 1, 0x37, // VCOMS
0xC0, 1, 0x2c, // LCMCTRL
0xC2, 1, 0x01, // VDVVRHEN
0xC3, 1, 0x12, // VRHS
0xC4, 1, 0x20, // VDVS
0xD0, 2, 0xa4, 0xa1, // PWRCTRL1
0xC6, 1, 0x0f, // FRCTRL2
0xE0, 14, 0xd0, 0x04, 0x0d, 0x11, 0x13, 0x2b, 0x3f, 0x54, 0x4c, 0x18, 0x0d, 0x0b, 0x1f, 0x23, // GMCTRP1
0xE1, 14, 0xd0, 0x04, 0x0c, 0x11, 0x13, 0x2c, 0x3f, 0x44, 0x51, 0x2f, 0x1f, 0x1f, 0x20, 0x23, // GMCTRN1
0x21, 0, // INVON
0x11, 0 | DELAY, 255, // SLPOUT
0x29, 0 | DELAY, 100, // DISPON
0x2a, 4, 0x00, 0, 0x00, 0xfe, // CASET
0x2b, 4, 0x00, 0, 0x00, 0xfe, // RASET
0x2c, 0, // RAMWR
};
void board_init(void) {
busio_spi_obj_t *spi = &displays[0].fourwire_bus.inline_bus;
common_hal_busio_spi_construct(spi, &pin_GPIO6, &pin_GPIO7, NULL);
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_GPIO9, // TFT_DC Command or data
&pin_GPIO5, // TFT_CS Chip select
&pin_GPIO4, // TFT_RST Reset
60000000, // Baudrate
0, // Polarity
0); // Phase
displayio_display_obj_t *display = &displays[0].display;
display->base.type = &displayio_display_type;
common_hal_displayio_display_construct(display,
bus,
240, // Width
240, // Height
0, // column start
0, // row start
0, // rotation
16, // Color depth
false, // Grayscale
false, // pixels in a byte share a row. Only valid for depths < 8
1, // bytes per cell. Only valid for depths < 8
false, // reverse_pixels_in_byte. Only valid for depths < 8
true, // reverse_bytes_in_word
MIPI_COMMAND_SET_COLUMN_ADDRESS, // Set column command
MIPI_COMMAND_SET_PAGE_ADDRESS, // Set row command
MIPI_COMMAND_WRITE_MEMORY_START, // Write memory command
display_init_sequence,
sizeof(display_init_sequence),
&pin_GPIO12, // backlight pin
NO_BRIGHTNESS_COMMAND,
1.0f, // brightness (ignored)
true, // auto_brightness
false, // single_byte_bounds
false, // data_as_commands
true, // auto_refresh
60, // native_frames_per_second
true, // backlight_on_high
false); // SH1107_addressing
}
void board_deinit(void) {
}
bool board_requests_safe_mode(void) {
@ -35,6 +120,3 @@ bool board_requests_safe_mode(void) {
void reset_board(void) {
}
void board_deinit(void) {
}

View File

@ -9,3 +9,10 @@ CHIP_FAMILY = rp2
EXTERNAL_FLASH_DEVICES = "W25Q128JVxQ"
CIRCUITPY__EVE = 1
CIRCUITPY_KEYPAD = 1
CIRCUITPY_STAGE = 1
CIRCUITPY_AUDIOIO = 1
FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/picosystem

View File

@ -1,4 +1,5 @@
#include "shared-bindings/board/__init__.h"
#include "shared-module/displayio/__init__.h"
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
@ -41,5 +42,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
{ MP_ROM_QSTR(MP_QSTR_DISPLAY), MP_ROM_PTR(&displays[0].display)}
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -68,7 +68,7 @@ void common_hal_rotaryio_incrementalencoder_construct(rotaryio_incrementalencode
pins[1] = MP_OBJ_FROM_PTR(pin_a);
self->swapped = false;
if (!common_hal_rp2pio_pins_are_sequential(2, pins)) {
mp_raise_RuntimeError(translate("Pins must be sequential"));
mp_raise_RuntimeError(translate("Pins must be sequential GPIO pins"));
}
}

View File

@ -111,6 +111,7 @@ CFLAGS += -Wno-undef -Wno-shadow -Wno-cast-align $(ADD_CFLAGS)
CFLAGS += -mthumb -mabi=aapcs-linux
# Arm core selection
MCU_FLAGS_L4 = -mcpu=cortex-m4
MCU_FLAGS_F4 = -mcpu=cortex-m4
MCU_FLAGS_F7 = -mcpu=cortex-m7
MCU_FLAGS_H7 = -mcpu=cortex-m7
@ -161,6 +162,13 @@ CFLAGS += \
-DCFG_TUD_MIDI_RX_BUFSIZE=128 \
-DCFG_TUD_MIDI_TX_BUFSIZE=128
ifdef CIRCUITPY_USB_VENDOR
CFLAGS += \
-DCFG_TUD_VENDOR_RX_BUFSIZE=1024 \
-DCFG_TUD_VENDOR_TX_BUFSIZE=1024
endif
SRC_STM32 = $(addprefix $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_,\
hal.c \
hal_adc.c \
@ -207,7 +215,7 @@ endif
# Need this to avoid UART linker problems. TODO: rewrite to use registered callbacks.
# Does not exist for F4 and lower
ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F765xx STM32F767xx STM32F769xx STM32H743xx))
ifeq ($(MCU_VARIANT),$(filter $(MCU_VARIANT),STM32F765xx STM32F767xx STM32F769xx STM32H743xx STM32L4R5xx))
SRC_STM32 += $(HAL_DIR)/Src/stm32$(MCU_SERIES_LOWER)xx_hal_uart_ex.c
endif

View File

@ -0,0 +1,26 @@
/*
GNU linker script for STM32L4R5 with bootloader
*/
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */
FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 4K /* ISR vector. Kind of wasteful. */
FLASH_FIRMWARE (rx) : ORIGIN = 0x08011000, LENGTH = 1024K-128K-64K-4K /* For now, limit to 1MB so that bank switching is still possible. */
FLASH_FS (rw) : ORIGIN = 0x080e0000, LENGTH = 128K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K
}
/* produce a link error if there is not this amount of RAM for these sections */
_minimum_stack_size = 24K;
_minimum_heap_size = 16K;
/* Define the top end of the stack. The stack is full descending so begins just
above last byte of RAM. Note that EABI requires the stack to be 8-byte
aligned for a call. */
_estack = ORIGIN(RAM) + LENGTH(RAM);
/* RAM extents for the garbage collector */
_ram_start = ORIGIN(RAM);
_ram_end = ORIGIN(RAM) + LENGTH(RAM);

View File

@ -0,0 +1,29 @@
/*
GNU linker script for STM32L4R5 with filesystem
*/
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K /* entire flash */
FLASH_ISR (rx) : ORIGIN = 0x08000000, LENGTH = 4K /* ISR vector. Kind of wasteful. */
FLASH_FIRMWARE (rx) : ORIGIN = 0x08001000, LENGTH = 1024K-128K-4K /* For now, limit to 1MB so that bank switching is still possible. */
FLASH_FS (rw) : ORIGIN = 0x080e0000, LENGTH = 128K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K
}
/* produce a link error if there is not this amount of RAM for these sections */
_minimum_stack_size = 24K;
_minimum_heap_size = 16K;
/* Define tho top end of the stack. The stack is full descending so begins just
above last byte of RAM. Note that EABI requires the stack to be 8-byte
aligned for a call. */
_estack = ORIGIN(RAM) + LENGTH(RAM);
/* RAM extents for the garbage collector */
_ram_start = ORIGIN(RAM);
_ram_end = ORIGIN(RAM) + LENGTH(RAM);
/* ensure the firmware is within bounds */
ASSERT ( (ORIGIN(FLASH_FIRMWARE) + LENGTH(FLASH_FIRMWARE)) <= (ORIGIN(FLASH)+LENGTH(FLASH)), "FLASH_FIRMWARE out of bounds" );

View File

@ -0,0 +1,64 @@
/*
* 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"
#include "stm32l4xx.h"
#include "stm32l4r5xx.h"
void initialize_discharge_pin(void) {
/* Initialize the 3V3 discharge to be OFF and the output power to be ON */
__HAL_RCC_GPIOE_CLK_ENABLE();
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
GPIO_InitStruct.Pin = GPIO_PIN_6;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_6, GPIO_PIN_SET);
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pin = GPIO_PIN_4;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_4, GPIO_PIN_SET);
}
void board_init(void) {
// enable the debugger while sleeping. Todo move somewhere more central (kind of generally useful in a debug build)
SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_SLEEP);
// Set tick interrupt priority, default HAL value is intentionally invalid
// Without this, USB does not function.
HAL_InitTick((1UL << __NVIC_PRIO_BITS) - 1UL);
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
initialize_discharge_pin();
}

View File

@ -0,0 +1,66 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 Blues Wireless Contributors.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION 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 "Swan R5"
#define MICROPY_HW_MCU_NAME "STM32L4R5ZIY6"
// todo - not sure why this isn't the default for this port
#define MICROPY_PY_SYS_PLATFORM MICROPY_HW_BOARD_NAME
#define STM32L4R5XX
#define BOARD_SWAN_R5
// The flash size is defined in the STM32L4xx HAL (but not for the F4)
// #define FLASH_SIZE (0x200000)
// #define FLASH_PAGE_SIZE (0x1000)
#define LSE_VALUE ((uint32_t)32768)
#define BOARD_HAS_LOW_SPEED_CRYSTAL (1)
#define BOARD_HAS_HIGH_SPEED_CRYSTAL (0)
// Bootloader only
#ifdef UF2_BOOTLOADER_ENABLED
#define BOARD_VTOR_DEFER (1) // Leave VTOR relocation to bootloader
#endif
#define BOARD_NO_VBUS_SENSE (1)
#define BOARD_NO_USB_OTG_ID_SENSE (1)
#define DEFAULT_I2C_BUS_SCL (&pin_PB06)
#define DEFAULT_I2C_BUS_SDA (&pin_PB07)
#define DEFAULT_SPI_BUS_SS (&pin_PD00)
#define DEFAULT_SPI_BUS_SCK (&pin_PD01)
#define DEFAULT_SPI_BUS_MOSI (&pin_PB15)
#define DEFAULT_SPI_BUS_MISO (&pin_PB14)
#define DEFAULT_UART_BUS_RX (&pin_PA10)
#define DEFAULT_UART_BUS_TX (&pin_PA09)

View File

@ -0,0 +1,73 @@
USB_VID = 0x30A4
USB_PID = 0x02
USB_PRODUCT = "Swan R5"
USB_MANUFACTURER = "Blues Inc."
INTERNAL_FLASH_FILESYSTEM = 1
MCU_SERIES = L4
MCU_VARIANT = STM32L4R5xx
MCU_PACKAGE = WLCSP144
LD_COMMON = boards/common_default.ld
LD_DEFAULT = boards/STM32L4R5_default.ld
# UF2 boot option
LD_BOOT = boards/STM32L4R5_boot.ld
UF2_OFFSET = 0x8010000
# Turn all of the below off while trying to get the thing to run
# These modules are implemented in ports/<port>/common-hal:
# Typically the first module to create
CIRCUITPY_MICROCONTROLLER = 1
CIRCUITPY_ALARM = 1
# Typically the second module to create
CIRCUITPY_DIGITALIO = 1
# Other modules:
CIRCUITPY_OS = 1
CIRCUITPY_STORAGE = 1
CIRCUITPY_USB_MSC = 1
CIRCUITPY_UDB_CDC = 1
CIRCUITPY_USB_VENDOR = 1
CIRCUITPY_NVM = 0
CIRCUITPY_ANALOGIO = 1
CIRCUITPY_BUSIO = 1
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_PULSEIO = 1
CIRCUITPY_PWMIO = 1
CIRCUITPY_AUDIOPWMIO = 1
CIRCUITPY_CANIO = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
# Requires SPI, PulseIO (stub ok):
CIRCUITPY_DISPLAYIO = 0
# These modules are implemented in shared-module/ - they can be included in
# any port once their prerequisites in common-hal are complete.
# Requires DigitalIO:
CIRCUITPY_BITBANGIO = 1
# Requires DigitalIO
CIRCUITPY_GAMEPADSHIFT = 1
# Requires neopixel_write or SPI (dotstar)
CIRCUITPY_PIXELBUF = 0
# Requires OS
CIRCUITPY_RANDOM = 1
# Requires Microcontroller
CIRCUITPY_TOUCHIO = 1
# Requires USB
CIRCUITPY_USB_HID = 0
CIRCUITPY_USB_MIDI = 0
# Does nothing without I2C
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0
# No requirements, but takes extra flash
CIRCUITPY_ULAB = 1
# requires SPI
CIRCUITPY_SDCARDIO = 0
CIRCUITPY_BLEIO_HCI = 0
CIRCUITPY_BLEIO = 0
CIRCUITPY_BUSDEVICE = 0
CIRCUITPY_KEYPAD = 1
CIRCUITPY_RGBMATRIX = 0

View File

@ -0,0 +1,50 @@
#include "py/objtuple.h"
#include "shared-bindings/board/__init__.h"
// Core Feather Pins
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_ENABLE_3V3), MP_ROM_PTR(&pin_PE04) },
{ MP_ROM_QSTR(MP_QSTR_DISCHARGE_3V3), MP_ROM_PTR(&pin_PE06) },
{ MP_ROM_QSTR(MP_QSTR_DISABLE_DISCHARGING), MP_ROM_TRUE },
{ MP_ROM_QSTR(MP_QSTR_ENABLE_DISCHARGING), MP_ROM_FALSE },
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA03) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PA01) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PC03) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PC01) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA00) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON_USR), MP_ROM_PTR(&pin_PC13) },
{ MP_ROM_QSTR(MP_QSTR_SWITCH), MP_ROM_PTR(&pin_PE04) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_PB02) }, // boot button, but looks like it's wired to GND on the schematic
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PE11) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PE09) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_PD15) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA04) }, // DAC1 output also
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PE02) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA05) }, // DAC1 output also
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB07) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB06) },
{ MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA04) }, // D10
{ MP_ROM_QSTR(MP_QSTR_DAC2), MP_ROM_PTR(&pin_PA05) }, // D13
{ MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_PD00) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PD01) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB15) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -0,0 +1,85 @@
import board
import analogio
import digitalio
def test_dac_analog(p_in, p_out):
print(f"Running dac analog test with pin {p_in} as input and {p_out} as output\n")
pin_in = analogio.AnalogIn(p_in)
pin_out = analogio.AnalogOut(p_out)
for v in range(0, 65536, 4096):
pin_out.value = v
print(f"Value {v} read as {pin_in.value}")
pin_in.deinit()
pin_out.deinit()
def test_dac_digital(p_in, p_out):
print(f"Running dac digital test with pin {p_in} as input and {p_out} as output")
pin_in = digitalio.DigitalInOut(p_in)
pin_out = analogio.AnalogOut(p_out)
for v in range(0, 65536, 4096):
pin_out.value = v
print(f"Value {v} read as {pin_in.value}")
pin_in.deinit()
pin_out.deinit()
def test_dual(pair1, pair2):
# verifies that the DACs can be set independently
print(f"Running pair test\n")
pin1_in = analogio.AnalogIn(pair1[0])
pin1_out = analogio.AnalogOut(pair1[1])
pin2_in = analogio.AnalogIn(pair2[0])
pin2_out = analogio.AnalogOut(pair2[1])
for v in range(0, 65536, 4096):
v2 = 65535 - v
pin1_out.value = v
pin2_out.value = v2
print(f"Pair1: Value {v} read as {pin1_in.value}")
print(f"Pair2: Value {v2} read as {pin2_in.value}")
pin1_in.deinit()
pin1_out.deinit()
pin2_in.deinit()
pin2_out.deinit()
def test_analog_hilo(p_in, p_out):
print(f"Running analog hilo test with pin {p_in} as input and {p_out} as output")
pin_in = analogio.AnalogIn(p_in)
pin_out = digitalio.DigitalInOut(p_out)
pin_out.switch_to_output()
for v in (False, True, False, True):
pin_out.value = v
print(f"Value {v} read as {pin_in.value}")
pin_in.deinit()
pin_out.deinit()
def test_pair(pair):
# FIXME: test_analog_hilo works fine alone, but fails when the other dac functions are executed
test_analog_hilo(*pair)
test_dac_analog(*pair)
test_dac_digital(*pair)
def main():
pair1 = (board.A3, board.DAC1)
pair2 = (board.A2, board.DAC2)
print("running DAC1 tests")
test_pair(pair1)
print("running DAC2 tests")
test_pair(pair2)
print("running dual DAC tests")
test_dual(pair1, pair2)
main()

View File

@ -0,0 +1,148 @@
# SPDX-FileCopyrightText: 2018 Shawn Hymel for Adafruit Industries
#
# SPDX-License-Identifier: MIT
print("pins test")
"""
`adafruit_boardtest.boardtest_gpio`
====================================================
Toggles all available GPIO on a board. Verify their operation with an LED,
multimeter, another microcontroller, etc.
Run this script as its own main.py to individually run the test, or compile
with mpy-cross and call from separate test script.
* Author(s): Shawn Hymel for Adafruit Industries
Implementation Notes
--------------------
**Software and Dependencies:**
* Adafruit CircuitPython firmware for the supported boards:
https://github.com/adafruit/circuitpython/releases
"""
import time
import board
import digitalio
import supervisor
__version__ = "0.0.0-auto.0"
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_BoardTest.git"
# Constants
LED_ON_DELAY_TIME = 0.2 # Seconds
LED_OFF_DELAY_TIME = 0.2 # Seconds
LED_PIN_NAMES = ["L", "LED", "RED_LED", "GREEN_LED", "BLUE_LED"]
# Test result strings
PASS = "PASS"
FAIL = "FAIL"
NA = "N/A"
# Determine if given value is a number
def _is_number(val):
try:
float(val)
return True
except ValueError:
return False
# Release pins
def _deinit_pins(gpios):
for g in gpios:
g.deinit()
# Toggle IO pins while waiting for answer
def _toggle_wait(pin_gpios):
timestamp = time.monotonic()
led_state = False
failed = []
for pg in pin_gpios:
(pin, gpio) = pg
print("Is pin %s toggling? [y/n]" % pin)
done = False
while not done:
if led_state:
if time.monotonic() > timestamp + LED_ON_DELAY_TIME:
led_state = False
timestamp = time.monotonic()
else:
if time.monotonic() > timestamp + LED_OFF_DELAY_TIME:
led_state = True
timestamp = time.monotonic()
gpio.value = led_state
if supervisor.runtime.serial_bytes_available:
answer = input()
if bool(answer == "y"):
done = True
elif bool(answer == "n"):
failed += pin
done = True
return failed
def buildPin(pin):
gpio = digitalio.DigitalInOut(pin)
return gpio
def run_test(pins):
"""
Toggles all available GPIO on and off repeatedly.
:param list[str] pins: list of pins to run the test on
:return: tuple(str, list[str]): test result followed by list of pins tested
"""
# Create a list of analog GPIO pins
analog_pins = [p for p in pins if p[0] == "A" and _is_number(p[1])]
# Create a list of digital GPIO
digital_pins = [p for p in pins if p[0] == "D" and _is_number(p[1])]
# Toggle LEDs if we find any
gpio_pins = analog_pins + digital_pins
if gpio_pins:
# Print out the LEDs found
print("GPIO pins found:", end=" ")
for pin in gpio_pins:
print(pin, end=" ")
print("\n")
# Create a list of IO objects for us to toggle
gpios = [buildPin(getattr(board, p)) for p in gpio_pins]
print("built GPIOs")
# Set all IO to output
for gpio in gpios:
gpio.direction = digitalio.Direction.OUTPUT
# Toggle pins while waiting for user to verify LEDs blinking
result = _toggle_wait(zip(gpio_pins, gpios))
# Release pins
_deinit_pins(gpios)
if result:
return FAIL, gpio_pins
return PASS, gpio_pins
# Else (no pins found)
print("No GPIO pins found")
return NA, []
run_test([p for p in dir(board)])

View File

@ -0,0 +1,22 @@
import board
import digitalio
import time
def monitor_button(pin, callback):
with digitalio.DigitalInOut(pin) as button:
newstate = not button.value # state is inverted
state = not newstate # ensure change reported to start with
while callback(newstate, newstate != state):
state = newstate
newstate = button.value
time.sleep(0.01)
def print_changes(state, changed):
if changed:
print(f"button pressed {state}")
return True
monitor_button(board.BUTTON_USR, print_changes)

View File

@ -0,0 +1,35 @@
# Background: I have a Swan R5 board running circuit python
# And I import the "board" module
import board
import digitalio
import supervisor
import time
# Scenario: Enable 3V3 pin defintiion
# Then the symbol "board.ENABLE_3V3" is defined
assert board.ENABLE_3V3 is not None
# Scenario: Discharge 3V3 definition
# Then the symbol "board.DISCHARGE_3V3" is defined
assert board.DISCHARGE_3V3 is not None
# And the symbol "board.DISABLE_DISCHARGING" is defined to be "True"
assert board.DISABLE_DISCHARGING is not None and board.DISABLE_DISCHARGING == True
# And the symbol "board.ENABLE_DISCHARGING" is defined to be "False"
assert board.ENABLE_DISCHARGING is not None and board.ENABLE_DISCHARGING == False
# Scenario: Toggle ENBLE_3V3
# Given I have a LED connected between the 3V3 and GND pins
# And ENABLE_3V3 is configured for output
_3v3 = digitalio.DigitalInOut(board.ENABLE_3V3)
_3v3.direction = digitalio.Direction.OUTPUT
# When I run code to toggle the pin at 0.5Hz
# Then I see the LED switch on and off at 0.5Hz
print("Toggling 3V3. Press a key to stop.")
while not supervisor.runtime.serial_bytes_available:
_3v3.value = True
time.sleep(1.0)
_3v3.value = False
time.sleep(1.0)
print("Toggling stopped.")

View File

@ -0,0 +1,20 @@
import board
import busio
i2c = busio.I2C(board.SCL, board.SDA)
count = 0
# Wait for I2C lock
while not i2c.try_lock():
pass
# Scan for devices on the I2C bus
print("Scanning I2C bus")
for x in i2c.scan():
print(hex(x))
count += 1
print("%d device(s) found on I2C bus" % count)
# Release the I2C bus
i2c.unlock()

View File

@ -0,0 +1,17 @@
import time
import pwmio
def fade(pin):
led = pwmio.PWMOut(pin, frequency=5000, duty_cycle=0)
# LED setup for QT Py M0:
# led = pwmio.PWMOut(board.SCK, frequency=5000, duty_cycle=0)
while True:
for i in range(100):
# PWM LED up and down
if i < 50:
led.duty_cycle = int(i * 2 * 65535 / 100) # Up
else:
led.duty_cycle = 65535 - int((i - 50) * 2 * 65535 / 100) # Down
time.sleep(0.01)

View File

@ -0,0 +1,58 @@
import board
import busio
import digitalio
cs = digitalio.DigitalInOut(board.SS)
cs.direction = digitalio.Direction.OUTPUT
cs.value = True
BME680_SPI_REGISTER = 0x73
BME680_CHIPID_REGISTER = 0xD0
BME680_CHIPID = 0x61
SPI_HERZ = 0x500000
spi = busio.SPI(board.SCK, MISO=board.MISO, MOSI=board.MOSI)
def readByte(addr):
value = -1
while not spi.try_lock():
pass
try:
spi.configure(baudrate=500000, phase=0, polarity=0)
cs.value = False
result = bytearray(1)
result[0] = addr | 0x80
spi.write(result)
spi.readinto(result)
value = result[0]
return value
finally:
spi.unlock()
cs.value = True
def writeByte(addr, value):
while not spi.try_lock():
pass
try:
spi.configure(baudrate=500000, phase=0, polarity=0)
cs.value = False
result = bytearray(2)
result[0] = addr & ~0x80
result[1] = value
spi.write(result)
finally:
spi.unlock()
# put the device in the correct mode to read the ID
reg = readByte(BME680_SPI_REGISTER)
if (reg & 16) != 0:
writeByte(BME680_SPI_REGISTER, reg & ~16)
id = readByte(BME680_CHIPID_REGISTER)
print(f"id is {id}, expected {BME680_CHIPID}")

View File

@ -0,0 +1,37 @@
import board
import busio
import digitalio
import usb_cdc
import time
while not usb_cdc.console.in_waiting:
time.sleep(0.1)
print("USART test")
# For most CircuitPython boards:
led = digitalio.DigitalInOut(board.LED)
# For QT Py M0:
# led = digitalio.DigitalInOut(board.SCK)
led.direction = digitalio.Direction.OUTPUT
uart = busio.UART(board.TX, board.RX, baudrate=9600)
while True:
data = uart.read(32) # read up to 32 bytes
# print(data) # this is a bytearray type
if data is not None:
led.value = True
# convert bytearray to string
data_string = "*".join([chr(b) for b in data])
print(data_string, end="")
led.value = False
if usb_cdc.console.in_waiting:
data = usb_cdc.console.read()
data_string = "*".join([chr(b) for b in data])
print("writing " + data_string)
uart.write(data)

View File

@ -0,0 +1,10 @@
import os
def main():
print("Random number test")
r = os.urandom(32)
print(f"urandom TRNG string is {r}")
main()

View File

@ -0,0 +1,375 @@
/*
* Taken from ST Cube library and modified. See below for original header.
*
* Modifications copyright (c) 2021 Blues Wireless Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
******************************************************************************
* @file system_stm32l4xx.c
* @author MCD Application Team
* @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File
*
* This file provides two functions and one global variable to be called from
* user application:
* - SystemInit(): This function is called at startup just after reset and
* before branch to main program. This call is made inside
* the "startup_stm32l4xx.s" file.
*
* - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
* by the user application to setup the SysTick
* timer or configure other parameters.
*
* - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
* be called whenever the core clock is changed
* during program execution.
*
* After each device reset the MSI (4 MHz) is used as system clock source.
* Then SystemInit() function is called, in "startup_stm32l4xx.s" file, to
* configure the system clock before to branch to main program.
*
* This file configures the system clock as follows:
*=============================================================================
*-----------------------------------------------------------------------------
* System Clock source | MSI
*-----------------------------------------------------------------------------
* SYSCLK(Hz) | 4000000
*-----------------------------------------------------------------------------
* HCLK(Hz) | 4000000
*-----------------------------------------------------------------------------
* AHB Prescaler | 1
*-----------------------------------------------------------------------------
* APB1 Prescaler | 1
*-----------------------------------------------------------------------------
* APB2 Prescaler | 1
*-----------------------------------------------------------------------------
* PLL_M | 1
*-----------------------------------------------------------------------------
* PLL_N | 8
*-----------------------------------------------------------------------------
* PLL_P | 7
*-----------------------------------------------------------------------------
* PLL_Q | 2
*-----------------------------------------------------------------------------
* PLL_R | 2
*-----------------------------------------------------------------------------
* PLLSAI1_P | NA
*-----------------------------------------------------------------------------
* PLLSAI1_Q | NA
*-----------------------------------------------------------------------------
* PLLSAI1_R | NA
*-----------------------------------------------------------------------------
* PLLSAI2_P | NA
*-----------------------------------------------------------------------------
* PLLSAI2_Q | NA
*-----------------------------------------------------------------------------
* PLLSAI2_R | NA
*-----------------------------------------------------------------------------
* Require 48MHz for USB OTG FS, | Disabled
* SDIO and RNG clock |
*-----------------------------------------------------------------------------
*=============================================================================
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under Apache License, Version 2.0,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/Apache-2.0
*
******************************************************************************
*/
/** @addtogroup CMSIS
* @{
*/
/** @addtogroup stm32l4xx_system
* @{
*/
/** @addtogroup STM32L4xx_System_Private_Includes
* @{
*/
#include "stm32l4xx.h"
#include <math.h>
/**
* @}
*/
/** @addtogroup STM32L4xx_System_Private_TypesDefinitions
* @{
*/
/**
* @}
*/
/** @addtogroup STM32L4xx_System_Private_Defines
* @{
*/
#if !defined(HSE_VALUE)
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */
#if !defined(MSI_VALUE)
#define MSI_VALUE 4000000U /*!< Value of the Internal oscillator in Hz*/
#endif /* MSI_VALUE */
#if !defined(HSI_VALUE)
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
#endif /* HSI_VALUE */
/* Note: Following vector table addresses must be defined in line with linker
configuration. */
/*!< Uncomment the following line if you need to relocate the vector table
anywhere in Flash or Sram, else the vector table is kept at the automatic
remap of boot address selected */
/* #define USER_VECT_TAB_ADDRESS */
#if defined(USER_VECT_TAB_ADDRESS)
/*!< Uncomment the following line if you need to relocate your vector Table
in Sram else user remap will be done in Flash. */
/* #define VECT_TAB_SRAM */
#if defined(VECT_TAB_SRAM)
#define VECT_TAB_BASE_ADDRESS SRAM1_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
#else
#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
This value must be a multiple of 0x200. */
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
This value must be a multiple of 0x200. */
#endif /* VECT_TAB_SRAM */
#endif /* USER_VECT_TAB_ADDRESS */
/******************************************************************************/
/**
* @}
*/
/** @addtogroup STM32L4xx_System_Private_Macros
* @{
*/
/**
* @}
*/
/** @addtogroup STM32L4xx_System_Private_Variables
* @{
*/
/* The SystemCoreClock variable is updated in three ways:
1) by calling CMSIS function SystemCoreClockUpdate()
2) by calling HAL API function HAL_RCC_GetHCLKFreq()
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
Note: If you use this function to configure the system clock; then there
is no need to call the 2 first functions listed above, since SystemCoreClock
variable is updated automatically.
*/
uint32_t SystemCoreClock = 4000000U;
const uint8_t AHBPrescTable[16] = {0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U, 6U, 7U, 8U, 9U};
const uint8_t APBPrescTable[8] = {0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U};
const uint32_t MSIRangeTable[12] = {100000U, 200000U, 400000U, 800000U, 1000000U, 2000000U, \
4000000U, 8000000U, 16000000U, 24000000U, 32000000U, 48000000U};
/**
* @}
*/
/** @addtogroup STM32L4xx_System_Private_FunctionPrototypes
* @{
*/
/**
* @}
*/
/** @addtogroup STM32L4xx_System_Private_Functions
* @{
*/
/**
* @brief Setup the microcontroller system.
* @retval None
*/
void SystemInit(void) {
/* FPU settings ------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 20U) | (3UL << 22U)); /* set CP10 and CP11 Full Access */
#endif
/* Reset the RCC clock configuration to the default reset state ------------*/
/* Set MSION bit */
RCC->CR |= RCC_CR_MSION;
/* Reset CFGR register */
RCC->CFGR = 0x00000000U;
/* Reset HSEON, CSSON , HSION, and PLLON bits */
RCC->CR &= 0xEAF6FFFFU;
/* Reset PLLCFGR register */
RCC->PLLCFGR = 0x00001000U;
/* Reset HSEBYP bit */
RCC->CR &= 0xFFFBFFFFU;
/* Disable all interrupts */
RCC->CIER = 0x00000000U;
#if !(BOARD_VTOR_DEFER) // only set VTOR if the bootloader hasn't already
#if defined(USER_VECT_TAB_ADDRESS)
/* Configure the Vector Table location -------------------------------------*/
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET;
#endif
#endif
}
/**
* @brief Update SystemCoreClock variable according to Clock Register Values.
* The SystemCoreClock variable contains the core clock (HCLK), it can
* be used by the user application to setup the SysTick timer or configure
* other parameters.
*
* @note Each time the core clock (HCLK) changes, this function must be called
* to update SystemCoreClock variable value. Otherwise, any configuration
* based on this variable will be incorrect.
*
* @note - The system frequency computed by this function is not the real
* frequency in the chip. It is calculated based on the predefined
* constant and the selected clock source:
*
* - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*)
*
* - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**)
*
* - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***)
*
* - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***)
* or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors.
*
* (*) MSI_VALUE is a constant defined in stm32l4xx_hal.h file (default value
* 4 MHz) but the real value may vary depending on the variations
* in voltage and temperature.
*
* (**) HSI_VALUE is a constant defined in stm32l4xx_hal.h file (default value
* 16 MHz) but the real value may vary depending on the variations
* in voltage and temperature.
*
* (***) HSE_VALUE is a constant defined in stm32l4xx_hal.h file (default value
* 8 MHz), user has to ensure that HSE_VALUE is same as the real
* frequency of the crystal used. Otherwise, this function may
* have wrong result.
*
* - The result of this function could be not correct when using fractional
* value for HSE crystal.
*
* @retval None
*/
void SystemCoreClockUpdate(void) {
uint32_t tmp, msirange, pllvco, pllsource, pllm, pllr;
/* Get MSI Range frequency--------------------------------------------------*/
if ((RCC->CR & RCC_CR_MSIRGSEL) == 0U) { /* MSISRANGE from RCC_CSR applies */
msirange = (RCC->CSR & RCC_CSR_MSISRANGE) >> 8U;
} else { /* MSIRANGE from RCC_CR applies */
msirange = (RCC->CR & RCC_CR_MSIRANGE) >> 4U;
}
/*MSI frequency range in HZ*/
msirange = MSIRangeTable[msirange];
/* Get SYSCLK source -------------------------------------------------------*/
switch (RCC->CFGR & RCC_CFGR_SWS)
{
case 0x00: /* MSI used as system clock source */
SystemCoreClock = msirange;
break;
case 0x04: /* HSI used as system clock source */
SystemCoreClock = HSI_VALUE;
break;
case 0x08: /* HSE used as system clock source */
SystemCoreClock = HSE_VALUE;
break;
case 0x0C: /* PLL used as system clock source */
/* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN
SYSCLK = PLL_VCO / PLLR
*/
pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC);
pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> 4U) + 1U;
switch (pllsource)
{
case 0x02: /* HSI used as PLL clock source */
pllvco = (HSI_VALUE / pllm);
break;
case 0x03: /* HSE used as PLL clock source */
pllvco = (HSE_VALUE / pllm);
break;
default: /* MSI used as PLL clock source */
pllvco = (msirange / pllm);
break;
}
pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 8U);
pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> 25U) + 1U) * 2U;
SystemCoreClock = pllvco / pllr;
break;
default:
SystemCoreClock = msirange;
break;
}
/* Compute HCLK clock frequency --------------------------------------------*/
/* Get HCLK prescaler */
tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4U)];
/* HCLK clock frequency */
SystemCoreClock >>= tmp;
}
/**
* @}
*/
/**
* @}
*/
/**
* @}
*/
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -31,8 +31,17 @@
#include STM32_HAL_H
#define STM_BKPSRAM_SIZE 0x1000
#define STM_BKPSRAM_START BKPSRAM_BASE
#if CPY_STM32L4
#define __HAL_RCC_BKPSRAM_CLK_ENABLE()
#define STM_BKPSRAM_SIZE 0
#define STM_BKPSRAM_START 0
#define HAL_PWREx_EnableBkUpReg()
// backup RAM disabled for now. Will have the backup region at the top of SRAM3 which is retained.
#else
#define STM_BKPSRAM_SIZE 0x1000
#define STM_BKPSRAM_START BKPSRAM_BASE
#endif
STATIC bool initialized = false;

View File

@ -31,10 +31,20 @@
#include "shared-bindings/microcontroller/Pin.h"
#if CPY_STM32L4
#include "stm32l4xx_hal.h"
#include "stm32l4xx_ll_gpio.h"
#include "stm32l4xx_ll_adc.h"
#include "stm32l4xx_ll_bus.h"
#define ADC_SAMPLETIME ADC_SAMPLETIME_24CYCLES_5
#define LL_APB2_GRP1_PERIPH_ADC1 LL_AHB2_GRP1_PERIPH_ADC
#else
#include "stm32f4xx_hal.h"
#include "stm32f4xx_ll_gpio.h"
#include "stm32f4xx_ll_adc.h"
#include "stm32f4xx_ll_bus.h"
#define ADC_SAMPLETIME ADC_SAMPLETIME_15CYCLES
#endif
void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self,
const mcu_pin_obj_t *pin) {
@ -73,6 +83,55 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) {
self->pin = NULL;
}
uint32_t adc_channel(uint32_t channel) {
#if CPY_STM32L4
switch (channel) {
case 0:
return ADC_CHANNEL_0;
case 1:
return ADC_CHANNEL_1;
case 2:
return ADC_CHANNEL_2;
case 3:
return ADC_CHANNEL_3;
case 4:
return ADC_CHANNEL_4;
case 5:
return ADC_CHANNEL_5;
case 6:
return ADC_CHANNEL_6;
case 7:
return ADC_CHANNEL_7;
case 8:
return ADC_CHANNEL_8;
case 9:
return ADC_CHANNEL_9;
case 10:
return ADC_CHANNEL_10;
case 11:
return ADC_CHANNEL_11;
case 12:
return ADC_CHANNEL_12;
case 13:
return ADC_CHANNEL_13;
case 14:
return ADC_CHANNEL_14;
case 15:
return ADC_CHANNEL_15;
case 16:
return ADC_CHANNEL_16;
case 17:
return ADC_CHANNEL_17;
case 18:
return ADC_CHANNEL_18;
default:
return 0;
}
#else
return channel;
#endif
}
uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
// Something else might have used the ADC in a different way,
// so we completely re-initialize it.
@ -80,6 +139,9 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
if (self->pin->adc_unit & 0x01) {
ADCx = ADC1;
#if CPY_STM32L4
__HAL_RCC_ADC_CLK_ENABLE();
#endif
} else if (self->pin->adc_unit == 0x04) {
#ifdef ADC3
ADCx = ADC3;
@ -92,8 +154,8 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
// LL_GPIO_PIN_0
// HAL Implementation
ADC_HandleTypeDef AdcHandle;
ADC_ChannelConfTypeDef sConfig;
ADC_HandleTypeDef AdcHandle = {};
ADC_ChannelConfTypeDef sConfig = {};
AdcHandle.Instance = ADCx;
AdcHandle.Init.ClockPrescaler = ADC_CLOCK_SYNC_PCLK_DIV2;
@ -102,20 +164,42 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
AdcHandle.Init.ContinuousConvMode = DISABLE;
AdcHandle.Init.DiscontinuousConvMode = DISABLE;
AdcHandle.Init.NbrOfDiscConversion = 0;
AdcHandle.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
AdcHandle.Init.ExternalTrigConv = ADC_SOFTWARE_START;
AdcHandle.Init.DataAlign = ADC_DATAALIGN_RIGHT;
AdcHandle.Init.NbrOfConversion = 1;
AdcHandle.Init.DMAContinuousRequests = DISABLE;
AdcHandle.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
HAL_ADC_Init(&AdcHandle);
#ifdef ADC_OVR_DATA_OVERWRITTEN
AdcHandle.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN; /* DR register is overwritten with the last conversion result in case of overrun */
#endif
sConfig.Channel = (uint32_t)self->pin->adc_channel; // ADC_CHANNEL_0 <-normal iteration, not mask
if (HAL_ADC_Init(&AdcHandle) != HAL_OK) {
return 0;
}
sConfig.Channel = adc_channel(self->pin->adc_channel); // ADC_CHANNEL_0 <-normal iteration, not mask
sConfig.Rank = 1;
sConfig.SamplingTime = ADC_SAMPLETIME_15CYCLES; // Taken from micropython
HAL_ADC_ConfigChannel(&AdcHandle, &sConfig);
HAL_ADC_Start(&AdcHandle);
sConfig.SamplingTime = ADC_SAMPLETIME;
#if CPY_STM32L4
sConfig.SingleDiff = ADC_SINGLE_ENDED; /* Single-ended input channel */
sConfig.OffsetNumber = ADC_OFFSET_NONE; /* No offset subtraction */
if (!IS_ADC_CHANNEL(&AdcHandle, sConfig.Channel)) {
return 0;
}
#endif
if (HAL_ADC_ConfigChannel(&AdcHandle, &sConfig) != HAL_OK) {
return 0;
}
#if CPY_STM32L4
if (HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_SINGLE_ENDED) != HAL_OK) {
return 0;
}
#endif
if (HAL_ADC_Start(&AdcHandle) != HAL_OK) {
return 0;
}
HAL_ADC_PollForConversion(&AdcHandle,1);
uint16_t value = (uint16_t)HAL_ADC_GetValue(&AdcHandle);
HAL_ADC_Stop(&AdcHandle);

View File

@ -37,7 +37,14 @@
#include "common-hal/microcontroller/Pin.h"
#include "stm32f4xx_hal.h"
#include STM32_HAL_H
#ifndef __HAL_RCC_DAC_CLK_ENABLE
#define __HAL_RCC_DAC_CLK_ENABLE __HAL_RCC_DAC1_CLK_ENABLE
#endif
#ifndef __HAL_RCC_DAC_CLK_DISABLE
#define __HAL_RCC_DAC_CLK_DISABLE __HAL_RCC_DAC1_CLK_DISABLE
#endif
// DAC is shared between both channels.
#if HAS_DAC

View File

@ -31,7 +31,11 @@
#include "common-hal/microcontroller/Pin.h"
#include "py/obj.h"
#if CPY_STM32L4
#include "stm32l4xx_hal.h"
#else
#include "stm32f4xx_hal.h"
#endif
#include "peripherals/periph.h"
typedef struct {

View File

@ -50,6 +50,13 @@
#ifndef CPY_I2CSTANDARD_TIMINGR
#define CPY_I2CSTANDARD_TIMINGR 0x307075B1
#endif
#elif (CPY_STM32L4)
#ifndef CPY_I2CFAST_TIMINGR
#define CPY_I2CFAST_TIMINGR 0x00B03FDB
#endif
#ifndef CPY_I2CSTANDARD_TIMINGR
#define CPY_I2CSTANDARD_TIMINGR 0x307075B1
#endif
#endif
// Arrays use 0 based numbering: I2C1 is stored at index 0
@ -142,7 +149,7 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
i2c_assign_irq(self, I2Cx);
// Handle the HAL handle differences
#if (CPY_STM32H7 || CPY_STM32F7)
#if (CPY_STM32H7 || CPY_STM32F7 || CPY_STM32L4)
if (frequency == 400000) {
self->handle.Init.Timing = CPY_I2CFAST_TIMINGR;
} else if (frequency == 100000) {

View File

@ -58,7 +58,7 @@ STATIC uint32_t get_busclock(SPI_TypeDef *instance) {
} else {
return HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_SPI6);
}
#elif (CPY_STM32F4 || CPY_STM32F7)
#elif (CPY_STM32F4 || CPY_STM32F7 || CPY_STM32L4)
// SPI2 and 3 are on PCLK1, if they exist.
#ifdef SPI2
if (instance == SPI2) {

View File

@ -33,8 +33,7 @@
#include "common-hal/canio/__init__.h"
#include "shared-module/canio/Message.h"
#include "stm32f4xx_hal.h"
#include "stm32f4xx_hal_can.h"
#include STM32_HAL_H
#define FILTER_BANK_COUNT (28)

View File

@ -37,6 +37,10 @@
#include "stm32f7xx_ll_gpio.h"
#elif (CPY_STM32F4)
#include "stm32f4xx_ll_gpio.h"
#elif (CPY_STM32L4)
#include "stm32l4xx_ll_gpio.h"
#else
#error unknown MCU for DigitalInOut
#endif
void common_hal_digitalio_digitalinout_never_reset(

View File

@ -33,7 +33,7 @@
#if defined(TFBGA216)
GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH, GPIOI, GPIOJ, GPIOK};
#elif defined(LQFP144)
#elif defined(LQFP144) || defined(WLCSP144)
GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG};
#elif defined(LQFP100_f4) || (LQFP100_x7)
GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE};
@ -41,6 +41,8 @@ GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC, GPIOD, GPIOE};
GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC, GPIOD};
#elif defined(UFQFPN48)
GPIO_TypeDef *ports[] = {GPIOA, GPIOB, GPIOC};
#else
#error Unknown package type
#endif

View File

@ -26,8 +26,7 @@
#include "common-hal/nvm/ByteArray.h"
#include "stm32f4xx_hal.h"
#include STM32_HAL_H
#include "supervisor/shared/stack.h"
#include <stdint.h>

View File

@ -62,7 +62,11 @@ STATIC void pulsein_exti_event_handler(uint8_t num) {
uint32_t current_count = tim_handle.Instance->CNT;
// Interrupt register must be cleared manually
#if CPY_STM32L4
EXTI->PR1 = 1 << num;
#else
EXTI->PR = 1 << num;
#endif
pulseio_pulsein_obj_t *self = callback_obj_ref[num];
if (!self) {

View File

@ -386,6 +386,7 @@ void assert_failed(uint8_t *file, uint32_t line);
#define CPY_STM32F4 1
#define CPY_STM32F7 0
#define CPY_STM32H7 0
#define CPY_STM32L4 0
#endif /* __STM32F4xx_HAL_CONF_H */

View File

@ -391,6 +391,8 @@ void assert_failed(uint8_t *file, uint32_t line);
#define CPY_STM32F4 0
#define CPY_STM32F7 1
#define CPY_STM32H7 0
#define CPY_STM32L4 0
#endif /* __STM32F7xx_HAL_CONF_H */

View File

@ -436,6 +436,8 @@ void assert_failed(uint8_t *file, uint32_t line);
#define CPY_STM32F4 0
#define CPY_STM32F7 0
#define CPY_STM32H7 1
#define CPY_STM32L4 0
#endif /* __STM32H7xx_HAL_CONF_H */

View File

@ -0,0 +1,480 @@
/**
******************************************************************************
* @file stm32l4xx_hal_conf.h
* @author MCD Application Team
* @brief HAL configuration template file.
* This file should be copied to the application folder and renamed
* to stm32l4xx_hal_conf.h.
******************************************************************************
* @attention
*
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
* All rights reserved.</center></h2>
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
******************************************************************************
*/
#include "stm32_hal_conf.h"
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef STM32L4xx_HAL_CONF_H
#define STM32L4xx_HAL_CONF_H
#ifdef __cplusplus
extern "C" {
#endif
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* ########################## Module Selection ############################## */
/**
* @brief This is the list of modules to be used in the HAL driver
*/
#define HAL_MODULE_ENABLED
#define HAL_ADC_MODULE_ENABLED
#define HAL_CAN_MODULE_ENABLED
/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
#define HAL_COMP_MODULE_ENABLED
#define HAL_CORTEX_MODULE_ENABLED
#define HAL_CRC_MODULE_ENABLED
#define HAL_CRYP_MODULE_ENABLED
#define HAL_DAC_MODULE_ENABLED
#define HAL_DCMI_MODULE_ENABLED
#define HAL_DFSDM_MODULE_ENABLED
#define HAL_DMA_MODULE_ENABLED
#define HAL_DMA2D_MODULE_ENABLED
#define HAL_DSI_MODULE_ENABLED
#define HAL_EXTI_MODULE_ENABLED
#define HAL_FIREWALL_MODULE_ENABLED
#define HAL_FLASH_MODULE_ENABLED
#define HAL_GFXMMU_MODULE_ENABLED
#define HAL_GPIO_MODULE_ENABLED
#define HAL_HASH_MODULE_ENABLED
#define HAL_HCD_MODULE_ENABLED
#define HAL_I2C_MODULE_ENABLED
#define HAL_IRDA_MODULE_ENABLED
#define HAL_IWDG_MODULE_ENABLED
#define HAL_LCD_MODULE_ENABLED
#define HAL_LPTIM_MODULE_ENABLED
#define HAL_LTDC_MODULE_ENABLED
#define HAL_MMC_MODULE_ENABLED
#define HAL_NAND_MODULE_ENABLED
#define HAL_NOR_MODULE_ENABLED
#define HAL_OPAMP_MODULE_ENABLED
#define HAL_OSPI_MODULE_ENABLED
#define HAL_PCD_MODULE_ENABLED
#define HAL_PWR_MODULE_ENABLED
#define HAL_QSPI_MODULE_ENABLED
#define HAL_RCC_MODULE_ENABLED
#define HAL_RNG_MODULE_ENABLED
#define HAL_RTC_MODULE_ENABLED
#define HAL_SAI_MODULE_ENABLED
#define HAL_SD_MODULE_ENABLED
#define HAL_SMARTCARD_MODULE_ENABLED
#define HAL_SMBUS_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
#define HAL_SRAM_MODULE_ENABLED
#define HAL_SWPMI_MODULE_ENABLED
#define HAL_TIM_MODULE_ENABLED
#define HAL_TSC_MODULE_ENABLED
#define HAL_UART_MODULE_ENABLED
#define HAL_USART_MODULE_ENABLED
#define HAL_WWDG_MODULE_ENABLED
/* ########################## Oscillator Values adaptation ####################*/
/**
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
* This value is used by the RCC HAL module to compute the system frequency
* (when HSE is used as system clock source, directly or through the PLL).
*/
#if !defined(HSE_VALUE)
#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */
#if !defined(HSE_STARTUP_TIMEOUT)
#define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
#endif /* HSE_STARTUP_TIMEOUT */
/**
* @brief Internal Multiple Speed oscillator (MSI) default value.
* This value is the default MSI range value after Reset.
*/
#if !defined(MSI_VALUE)
#define MSI_VALUE 4000000U /*!< Value of the Internal oscillator in Hz*/
#endif /* MSI_VALUE */
/**
* @brief Internal High Speed oscillator (HSI) value.
* This value is used by the RCC HAL module to compute the system frequency
* (when HSI is used as system clock source, directly or through the PLL).
*/
#if !defined(HSI_VALUE)
#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/
#endif /* HSI_VALUE */
/**
* @brief Internal High Speed oscillator (HSI48) value for USB FS, SDMMC and RNG.
* This internal oscillator is mainly dedicated to provide a high precision clock to
* the USB peripheral by means of a special Clock Recovery System (CRS) circuitry.
* When the CRS is not used, the HSI48 RC oscillator runs on it default frequency
* which is subject to manufacturing process variations.
*/
#if !defined(HSI48_VALUE)
#define HSI48_VALUE 48000000U /*!< Value of the Internal High Speed oscillator for USB FS/SDMMC/RNG in Hz.
The real value my vary depending on manufacturing process variations.*/
#endif /* HSI48_VALUE */
/**
* @brief Internal Low Speed oscillator (LSI) value.
*/
#if !defined(LSI_VALUE)
#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
The real value may vary depending on the variations
in voltage and temperature.*/
/**
* @brief External Low Speed oscillator (LSE) value.
* This value is used by the UART, RTC HAL module to compute the system frequency
*/
#if !defined(LSE_VALUE)
#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
#endif /* LSE_VALUE */
#if !defined(LSE_STARTUP_TIMEOUT)
#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
#endif /* HSE_STARTUP_TIMEOUT */
/**
* @brief External clock source for SAI1 peripheral
* This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
* frequency.
*/
#if !defined(EXTERNAL_SAI1_CLOCK_VALUE)
#define EXTERNAL_SAI1_CLOCK_VALUE 48000U /*!< Value of the SAI1 External clock source in Hz*/
#endif /* EXTERNAL_SAI1_CLOCK_VALUE */
/**
* @brief External clock source for SAI2 peripheral
* This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source
* frequency.
*/
#if !defined(EXTERNAL_SAI2_CLOCK_VALUE)
#define EXTERNAL_SAI2_CLOCK_VALUE 48000U /*!< Value of the SAI2 External clock source in Hz*/
#endif /* EXTERNAL_SAI2_CLOCK_VALUE */
/* Tip: To avoid modifying this file each time you need to use different HSE,
=== you can define the HSE value in your toolchain compiler preprocessor. */
/* ########################### System Configuration ######################### */
/**
* @brief This is the HAL system configuration section
*/
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
#define TICK_INT_PRIORITY 0x0FU /*!< tick interrupt priority */
#define USE_RTOS 0U
#define PREFETCH_ENABLE 0U
#define INSTRUCTION_CACHE_ENABLE 1U
#define DATA_CACHE_ENABLE 1U
/* ########################## Assert Selection ############################## */
/**
* @brief Uncomment the line below to expanse the "assert_param" macro in the
* HAL drivers code
*/
/* #define USE_FULL_ASSERT 1U */
/* ################## Register callback feature configuration ############### */
/**
* @brief Set below the peripheral configuration to "1U" to add the support
* of HAL callback registration/deregistration feature for the HAL
* driver(s). This allows user application to provide specific callback
* functions thanks to HAL_PPP_RegisterCallback() rather than overwriting
* the default weak callback functions (see each stm32l4xx_hal_ppp.h file
* for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef
* for each PPP peripheral).
*/
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U
#define USE_HAL_CAN_REGISTER_CALLBACKS 0U
#define USE_HAL_COMP_REGISTER_CALLBACKS 0U
#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U
#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U
#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U
#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U
#define USE_HAL_DSI_REGISTER_CALLBACKS 0U
#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U
#define USE_HAL_HASH_REGISTER_CALLBACKS 0U
#define USE_HAL_HCD_REGISTER_CALLBACKS 0U
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U
#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U
#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U
#define USE_HAL_MMC_REGISTER_CALLBACKS 0U
#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U
#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U
#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U
#define USE_HAL_RNG_REGISTER_CALLBACKS 0U
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U
#define USE_HAL_SAI_REGISTER_CALLBACKS 0U
#define USE_HAL_SD_REGISTER_CALLBACKS 0U
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U
#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U
#define USE_HAL_TSC_REGISTER_CALLBACKS 0U
#define USE_HAL_UART_REGISTER_CALLBACKS 0U
#define USE_HAL_USART_REGISTER_CALLBACKS 0U
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U
/* ################## SPI peripheral configuration ########################## */
/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
* Activated: CRC code is present inside driver
* Deactivated: CRC code cleaned from driver
*/
#define USE_SPI_CRC 1U
/* Includes ------------------------------------------------------------------*/
/**
* @brief Include module's header file
*/
#ifdef HAL_RCC_MODULE_ENABLED
#include "stm32l4xx_hal_rcc.h"
#endif /* HAL_RCC_MODULE_ENABLED */
#ifdef HAL_GPIO_MODULE_ENABLED
#include "stm32l4xx_hal_gpio.h"
#endif /* HAL_GPIO_MODULE_ENABLED */
#ifdef HAL_DMA_MODULE_ENABLED
#include "stm32l4xx_hal_dma.h"
#endif /* HAL_DMA_MODULE_ENABLED */
#ifdef HAL_DFSDM_MODULE_ENABLED
#include "stm32l4xx_hal_dfsdm.h"
#endif /* HAL_DFSDM_MODULE_ENABLED */
#ifdef HAL_CORTEX_MODULE_ENABLED
#include "stm32l4xx_hal_cortex.h"
#endif /* HAL_CORTEX_MODULE_ENABLED */
#ifdef HAL_ADC_MODULE_ENABLED
#include "stm32l4xx_hal_adc.h"
#endif /* HAL_ADC_MODULE_ENABLED */
#ifdef HAL_CAN_MODULE_ENABLED
#include "stm32l4xx_hal_can.h"
#endif /* HAL_CAN_MODULE_ENABLED */
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
#include "Legacy/stm32l4xx_hal_can_legacy.h"
#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
#ifdef HAL_COMP_MODULE_ENABLED
#include "stm32l4xx_hal_comp.h"
#endif /* HAL_COMP_MODULE_ENABLED */
#ifdef HAL_CRC_MODULE_ENABLED
#include "stm32l4xx_hal_crc.h"
#endif /* HAL_CRC_MODULE_ENABLED */
#ifdef HAL_CRYP_MODULE_ENABLED
#include "stm32l4xx_hal_cryp.h"
#endif /* HAL_CRYP_MODULE_ENABLED */
#ifdef HAL_DAC_MODULE_ENABLED
#include "stm32l4xx_hal_dac.h"
#endif /* HAL_DAC_MODULE_ENABLED */
#ifdef HAL_DCMI_MODULE_ENABLED
#include "stm32l4xx_hal_dcmi.h"
#endif /* HAL_DCMI_MODULE_ENABLED */
#ifdef HAL_DMA2D_MODULE_ENABLED
#include "stm32l4xx_hal_dma2d.h"
#endif /* HAL_DMA2D_MODULE_ENABLED */
#ifdef HAL_DSI_MODULE_ENABLED
#include "stm32l4xx_hal_dsi.h"
#endif /* HAL_DSI_MODULE_ENABLED */
#ifdef HAL_EXTI_MODULE_ENABLED
#include "stm32l4xx_hal_exti.h"
#endif /* HAL_EXTI_MODULE_ENABLED */
#ifdef HAL_GFXMMU_MODULE_ENABLED
#include "stm32l4xx_hal_gfxmmu.h"
#endif /* HAL_GFXMMU_MODULE_ENABLED */
#ifdef HAL_FIREWALL_MODULE_ENABLED
#include "stm32l4xx_hal_firewall.h"
#endif /* HAL_FIREWALL_MODULE_ENABLED */
#ifdef HAL_FLASH_MODULE_ENABLED
#include "stm32l4xx_hal_flash.h"
#endif /* HAL_FLASH_MODULE_ENABLED */
#ifdef HAL_HASH_MODULE_ENABLED
#include "stm32l4xx_hal_hash.h"
#endif /* HAL_HASH_MODULE_ENABLED */
#ifdef HAL_HCD_MODULE_ENABLED
#include "stm32l4xx_hal_hcd.h"
#endif /* HAL_HCD_MODULE_ENABLED */
#ifdef HAL_I2C_MODULE_ENABLED
#include "stm32l4xx_hal_i2c.h"
#endif /* HAL_I2C_MODULE_ENABLED */
#ifdef HAL_IRDA_MODULE_ENABLED
#include "stm32l4xx_hal_irda.h"
#endif /* HAL_IRDA_MODULE_ENABLED */
#ifdef HAL_IWDG_MODULE_ENABLED
#include "stm32l4xx_hal_iwdg.h"
#endif /* HAL_IWDG_MODULE_ENABLED */
#ifdef HAL_LCD_MODULE_ENABLED
#include "stm32l4xx_hal_lcd.h"
#endif /* HAL_LCD_MODULE_ENABLED */
#ifdef HAL_LPTIM_MODULE_ENABLED
#include "stm32l4xx_hal_lptim.h"
#endif /* HAL_LPTIM_MODULE_ENABLED */
#ifdef HAL_LTDC_MODULE_ENABLED
#include "stm32l4xx_hal_ltdc.h"
#endif /* HAL_LTDC_MODULE_ENABLED */
#ifdef HAL_MMC_MODULE_ENABLED
#include "stm32l4xx_hal_mmc.h"
#endif /* HAL_MMC_MODULE_ENABLED */
#ifdef HAL_NAND_MODULE_ENABLED
#include "stm32l4xx_hal_nand.h"
#endif /* HAL_NAND_MODULE_ENABLED */
#ifdef HAL_NOR_MODULE_ENABLED
#include "stm32l4xx_hal_nor.h"
#endif /* HAL_NOR_MODULE_ENABLED */
#ifdef HAL_OPAMP_MODULE_ENABLED
#include "stm32l4xx_hal_opamp.h"
#endif /* HAL_OPAMP_MODULE_ENABLED */
#ifdef HAL_OSPI_MODULE_ENABLED
#include "stm32l4xx_hal_ospi.h"
#endif /* HAL_OSPI_MODULE_ENABLED */
#ifdef HAL_PCD_MODULE_ENABLED
#include "stm32l4xx_hal_pcd.h"
#endif /* HAL_PCD_MODULE_ENABLED */
#ifdef HAL_PWR_MODULE_ENABLED
#include "stm32l4xx_hal_pwr.h"
#endif /* HAL_PWR_MODULE_ENABLED */
#ifdef HAL_QSPI_MODULE_ENABLED
#include "stm32l4xx_hal_qspi.h"
#endif /* HAL_QSPI_MODULE_ENABLED */
#ifdef HAL_RNG_MODULE_ENABLED
#include "stm32l4xx_hal_rng.h"
#endif /* HAL_RNG_MODULE_ENABLED */
#ifdef HAL_RTC_MODULE_ENABLED
#include "stm32l4xx_hal_rtc.h"
#endif /* HAL_RTC_MODULE_ENABLED */
#ifdef HAL_SAI_MODULE_ENABLED
#include "stm32l4xx_hal_sai.h"
#endif /* HAL_SAI_MODULE_ENABLED */
#ifdef HAL_SD_MODULE_ENABLED
#include "stm32l4xx_hal_sd.h"
#endif /* HAL_SD_MODULE_ENABLED */
#ifdef HAL_SMARTCARD_MODULE_ENABLED
#include "stm32l4xx_hal_smartcard.h"
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
#ifdef HAL_SMBUS_MODULE_ENABLED
#include "stm32l4xx_hal_smbus.h"
#endif /* HAL_SMBUS_MODULE_ENABLED */
#ifdef HAL_SPI_MODULE_ENABLED
#include "stm32l4xx_hal_spi.h"
#endif /* HAL_SPI_MODULE_ENABLED */
#ifdef HAL_SRAM_MODULE_ENABLED
#include "stm32l4xx_hal_sram.h"
#endif /* HAL_SRAM_MODULE_ENABLED */
#ifdef HAL_SWPMI_MODULE_ENABLED
#include "stm32l4xx_hal_swpmi.h"
#endif /* HAL_SWPMI_MODULE_ENABLED */
#ifdef HAL_TIM_MODULE_ENABLED
#include "stm32l4xx_hal_tim.h"
#endif /* HAL_TIM_MODULE_ENABLED */
#ifdef HAL_TSC_MODULE_ENABLED
#include "stm32l4xx_hal_tsc.h"
#endif /* HAL_TSC_MODULE_ENABLED */
#ifdef HAL_UART_MODULE_ENABLED
#include "stm32l4xx_hal_uart.h"
#endif /* HAL_UART_MODULE_ENABLED */
#ifdef HAL_USART_MODULE_ENABLED
#include "stm32l4xx_hal_usart.h"
#endif /* HAL_USART_MODULE_ENABLED */
#ifdef HAL_WWDG_MODULE_ENABLED
#include "stm32l4xx_hal_wwdg.h"
#endif /* HAL_WWDG_MODULE_ENABLED */
/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for function's parameters check.
* @param expr: If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t *file, uint32_t line);
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
#ifdef __cplusplus
}
#endif
// CircuitPython specific conditionals. Using a value is better than checking
// defined because undefined variable happen when a file isn't included when it
// should have been.
#define CPY_STM32F4 0
#define CPY_STM32F7 0
#define CPY_STM32H7 0
#define CPY_STM32L4 1
#endif /* STM32L4xx_HAL_CONF_H */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -51,6 +51,9 @@ extern uint8_t _ld_default_stack_size;
#ifndef BOARD_NO_VBUS_SENSE
#define BOARD_NO_VBUS_SENSE (0)
#endif
#ifndef BOARD_NO_USB_OTG_ID_SENSE
#define BOARD_NO_USB_OTG_ID_SENSE (0)
#endif
// Peripheral implementation counts
#define MAX_UART 10

View File

@ -62,4 +62,22 @@ ifeq ($(MCU_SERIES),F7)
USB_NUM_ENDPOINT_PAIRS = 6
endif
ifeq ($(MCU_SERIES),L4)
# Not yet implemented common-hal modules:
CIRCUITPY_ANALOGIO ?= 0
CIRCUITPY_AUDIOBUSIO ?= 0
CIRCUITPY_AUDIOIO ?= 0
CIRCUITPY_COUNTIO ?= 0
CIRCUITPY_FREQUENCYIO ?= 0
CIRCUITPY_I2CPERIPHERAL ?= 0
CIRCUITPY_NEOPIXEL_WRITE ?= 0
CIRCUITPY_NVM ?= 0
CIRCUITPY_ROTARYIO ?= 0
CIRCUITPY_RTC ?= 0
# todo - this varies between devices in the series
# This slide deck https://www.st.com/content/ccc/resource/training/technical/product_training/98/89/c8/6c/3e/e9/49/79/STM32L4_Peripheral_USB.pdf/files/STM32L4_Peripheral_USB.pdf/jcr:content/translations/en.STM32L4_Peripheral_USB.pdf
# cites 16 endpoints, 8 endpoint pairs, while section 3.39 of the L4R5 datasheet states 6 endpoint pairs.
USB_NUM_ENDPOINT_PAIRS = 6
endif
CIRCUITPY_PARALLELDISPLAY := 0

View File

@ -0,0 +1,159 @@
#include "shared-bindings/microcontroller/__init__.h"
#include "common-hal/microcontroller/Pin.h"
#include "py/obj.h"
STATIC const mp_rom_map_elem_t mcu_pin_globals_table[] = {
// Pins 1-36
{ MP_ROM_QSTR(MP_QSTR_PE02), MP_ROM_PTR(&pin_PE02) },
{ MP_ROM_QSTR(MP_QSTR_PE03), MP_ROM_PTR(&pin_PE03) },
{ MP_ROM_QSTR(MP_QSTR_PE04), MP_ROM_PTR(&pin_PE04) },
{ MP_ROM_QSTR(MP_QSTR_PE05), MP_ROM_PTR(&pin_PE05) },
{ MP_ROM_QSTR(MP_QSTR_PE06), MP_ROM_PTR(&pin_PE06) },
/* VBAT -------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PC13), MP_ROM_PTR(&pin_PC13) },
// PC14 OSC32_IN ----------------------------------*/
// PC15 OSC32_OUT ---------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PF00), MP_ROM_PTR(&pin_PF00) },
{ MP_ROM_QSTR(MP_QSTR_PF01), MP_ROM_PTR(&pin_PF01) },
{ MP_ROM_QSTR(MP_QSTR_PF02), MP_ROM_PTR(&pin_PF02) },
{ MP_ROM_QSTR(MP_QSTR_PF03), MP_ROM_PTR(&pin_PF03) },
{ MP_ROM_QSTR(MP_QSTR_PF04), MP_ROM_PTR(&pin_PF04) },
{ MP_ROM_QSTR(MP_QSTR_PF05), MP_ROM_PTR(&pin_PF05) },
// VSS --------------------------------------------*/
// VDD --------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PF06), MP_ROM_PTR(&pin_PF06) },
{ MP_ROM_QSTR(MP_QSTR_PF07), MP_ROM_PTR(&pin_PF07) },
{ MP_ROM_QSTR(MP_QSTR_PF08), MP_ROM_PTR(&pin_PF08) },
{ MP_ROM_QSTR(MP_QSTR_PF09), MP_ROM_PTR(&pin_PF09) },
{ MP_ROM_QSTR(MP_QSTR_PF10), MP_ROM_PTR(&pin_PF10) },
// PH0 OSC_IN -------------------------------------*/
// PH1 OSC_OUT ------------------------------------*/
// NRST -------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PC00), MP_ROM_PTR(&pin_PC00) },
{ MP_ROM_QSTR(MP_QSTR_PC01), MP_ROM_PTR(&pin_PC01) },
{ MP_ROM_QSTR(MP_QSTR_PC02), MP_ROM_PTR(&pin_PC02) },
{ MP_ROM_QSTR(MP_QSTR_PC03), MP_ROM_PTR(&pin_PC03) },
// VDD --------------------------------------------*/
// VSSA -------------------------------------------*/
// VREF+ ------------------------------------------*/
// VDDA -------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PA00), MP_ROM_PTR(&pin_PA00) },
{ MP_ROM_QSTR(MP_QSTR_PA01), MP_ROM_PTR(&pin_PA01) },
{ MP_ROM_QSTR(MP_QSTR_PA02), MP_ROM_PTR(&pin_PA02) },
// Pins 37-72
{ MP_ROM_QSTR(MP_QSTR_PA03), MP_ROM_PTR(&pin_PA03) },
// VSS --------------------------------------------*/
// VDD --------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PA04), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_PA05), MP_ROM_PTR(&pin_PA05) },
{ MP_ROM_QSTR(MP_QSTR_PA06), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_PA07), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_PC04), MP_ROM_PTR(&pin_PC04) },
{ MP_ROM_QSTR(MP_QSTR_PC05), MP_ROM_PTR(&pin_PC05) },
{ MP_ROM_QSTR(MP_QSTR_PB00), MP_ROM_PTR(&pin_PB00) },
{ MP_ROM_QSTR(MP_QSTR_PB01), MP_ROM_PTR(&pin_PB01) },
{ MP_ROM_QSTR(MP_QSTR_PB02), MP_ROM_PTR(&pin_PB02) },
{ MP_ROM_QSTR(MP_QSTR_PF11), MP_ROM_PTR(&pin_PF11) },
{ MP_ROM_QSTR(MP_QSTR_PF12), MP_ROM_PTR(&pin_PF12) },
// VSS --------------------------------------------*/
// VDD --------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PF13), MP_ROM_PTR(&pin_PF13) },
{ MP_ROM_QSTR(MP_QSTR_PF14), MP_ROM_PTR(&pin_PF14) },
{ MP_ROM_QSTR(MP_QSTR_PF15), MP_ROM_PTR(&pin_PF15) },
{ MP_ROM_QSTR(MP_QSTR_PG00), MP_ROM_PTR(&pin_PG00) },
{ MP_ROM_QSTR(MP_QSTR_PG01), MP_ROM_PTR(&pin_PG01) },
{ MP_ROM_QSTR(MP_QSTR_PE07), MP_ROM_PTR(&pin_PE07) },
{ MP_ROM_QSTR(MP_QSTR_PE08), MP_ROM_PTR(&pin_PE08) },
{ MP_ROM_QSTR(MP_QSTR_PE09), MP_ROM_PTR(&pin_PE09) },
// VSS --------------------------------------------*/
// VDD --------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PE10), MP_ROM_PTR(&pin_PE10) },
{ MP_ROM_QSTR(MP_QSTR_PE11), MP_ROM_PTR(&pin_PE11) },
{ MP_ROM_QSTR(MP_QSTR_PE12), MP_ROM_PTR(&pin_PE12) },
{ MP_ROM_QSTR(MP_QSTR_PE13), MP_ROM_PTR(&pin_PE13) },
{ MP_ROM_QSTR(MP_QSTR_PE14), MP_ROM_PTR(&pin_PE14) },
{ MP_ROM_QSTR(MP_QSTR_PE15), MP_ROM_PTR(&pin_PE15) },
{ MP_ROM_QSTR(MP_QSTR_PB10), MP_ROM_PTR(&pin_PB10) },
{ MP_ROM_QSTR(MP_QSTR_PB11), MP_ROM_PTR(&pin_PB11) },
// VCAP1 ------------------------------------------*/
// VDD --------------------------------------------*/
// Pins 73-108
{ MP_ROM_QSTR(MP_QSTR_PB12), MP_ROM_PTR(&pin_PB12) },
{ MP_ROM_QSTR(MP_QSTR_PB13), MP_ROM_PTR(&pin_PB13) },
{ MP_ROM_QSTR(MP_QSTR_PB14), MP_ROM_PTR(&pin_PB14) },
{ MP_ROM_QSTR(MP_QSTR_PB15), MP_ROM_PTR(&pin_PB15) },
{ MP_ROM_QSTR(MP_QSTR_PD08), MP_ROM_PTR(&pin_PD08) },
{ MP_ROM_QSTR(MP_QSTR_PD09), MP_ROM_PTR(&pin_PD09) },
{ MP_ROM_QSTR(MP_QSTR_PD10), MP_ROM_PTR(&pin_PD10) },
{ MP_ROM_QSTR(MP_QSTR_PD11), MP_ROM_PTR(&pin_PD11) },
{ MP_ROM_QSTR(MP_QSTR_PD12), MP_ROM_PTR(&pin_PD12) },
{ MP_ROM_QSTR(MP_QSTR_PD13), MP_ROM_PTR(&pin_PD13) },
// VSS --------------------------------------------*/
// VDD --------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PD14), MP_ROM_PTR(&pin_PD14) },
{ MP_ROM_QSTR(MP_QSTR_PD15), MP_ROM_PTR(&pin_PD15) },
{ MP_ROM_QSTR(MP_QSTR_PG02), MP_ROM_PTR(&pin_PG02) },
{ MP_ROM_QSTR(MP_QSTR_PG03), MP_ROM_PTR(&pin_PG03) },
{ MP_ROM_QSTR(MP_QSTR_PG04), MP_ROM_PTR(&pin_PG04) },
{ MP_ROM_QSTR(MP_QSTR_PG05), MP_ROM_PTR(&pin_PG05) },
{ MP_ROM_QSTR(MP_QSTR_PG06), MP_ROM_PTR(&pin_PG06) },
{ MP_ROM_QSTR(MP_QSTR_PG07), MP_ROM_PTR(&pin_PG07) },
{ MP_ROM_QSTR(MP_QSTR_PG08), MP_ROM_PTR(&pin_PG08) },
// VSS --------------------------------------------*/
// VDD or VDD_USB (F412, F446) --------------------*/
{ MP_ROM_QSTR(MP_QSTR_PC06), MP_ROM_PTR(&pin_PC06) },
{ MP_ROM_QSTR(MP_QSTR_PC07), MP_ROM_PTR(&pin_PC07) },
{ MP_ROM_QSTR(MP_QSTR_PC08), MP_ROM_PTR(&pin_PC08) },
{ MP_ROM_QSTR(MP_QSTR_PC09), MP_ROM_PTR(&pin_PC09) },
{ MP_ROM_QSTR(MP_QSTR_PA08), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_PA09), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_PA10), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_PA11), MP_ROM_PTR(&pin_PA11) },
{ MP_ROM_QSTR(MP_QSTR_PA12), MP_ROM_PTR(&pin_PA12) },
{ MP_ROM_QSTR(MP_QSTR_PA13), MP_ROM_PTR(&pin_PA13) },
// VCAP2 ------------------------------------------*/
// VSS --------------------------------------------*/
// VDD --------------------------------------------*/
// Pins 109-144
{ MP_ROM_QSTR(MP_QSTR_PA14), MP_ROM_PTR(&pin_PA14) },
{ MP_ROM_QSTR(MP_QSTR_PA15), MP_ROM_PTR(&pin_PA15) },
{ MP_ROM_QSTR(MP_QSTR_PC10), MP_ROM_PTR(&pin_PC10) },
{ MP_ROM_QSTR(MP_QSTR_PC11), MP_ROM_PTR(&pin_PC11) },
{ MP_ROM_QSTR(MP_QSTR_PC12), MP_ROM_PTR(&pin_PC12) },
{ MP_ROM_QSTR(MP_QSTR_PD00), MP_ROM_PTR(&pin_PD00) },
{ MP_ROM_QSTR(MP_QSTR_PD01), MP_ROM_PTR(&pin_PD01) },
{ MP_ROM_QSTR(MP_QSTR_PD02), MP_ROM_PTR(&pin_PD02) },
{ MP_ROM_QSTR(MP_QSTR_PD03), MP_ROM_PTR(&pin_PD03) },
{ MP_ROM_QSTR(MP_QSTR_PD04), MP_ROM_PTR(&pin_PD04) },
{ MP_ROM_QSTR(MP_QSTR_PD05), MP_ROM_PTR(&pin_PD05) },
// VSS --------------------------------------------*/
// VDD --------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PD06), MP_ROM_PTR(&pin_PD06) },
{ MP_ROM_QSTR(MP_QSTR_PD07), MP_ROM_PTR(&pin_PD07) },
{ MP_ROM_QSTR(MP_QSTR_PG09), MP_ROM_PTR(&pin_PG09) },
{ MP_ROM_QSTR(MP_QSTR_PG10), MP_ROM_PTR(&pin_PG10) },
{ MP_ROM_QSTR(MP_QSTR_PG11), MP_ROM_PTR(&pin_PG11) },
{ MP_ROM_QSTR(MP_QSTR_PG12), MP_ROM_PTR(&pin_PG12) },
{ MP_ROM_QSTR(MP_QSTR_PG13), MP_ROM_PTR(&pin_PG13) },
{ MP_ROM_QSTR(MP_QSTR_PG14), MP_ROM_PTR(&pin_PG14) },
// VSS --------------------------------------------*/
// VDD --------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PG15), MP_ROM_PTR(&pin_PG15) },
{ MP_ROM_QSTR(MP_QSTR_PB03), MP_ROM_PTR(&pin_PB03) },
{ MP_ROM_QSTR(MP_QSTR_PB04), MP_ROM_PTR(&pin_PB04) },
{ MP_ROM_QSTR(MP_QSTR_PB05), MP_ROM_PTR(&pin_PB05) },
{ MP_ROM_QSTR(MP_QSTR_PB06), MP_ROM_PTR(&pin_PB06) },
{ MP_ROM_QSTR(MP_QSTR_PB07), MP_ROM_PTR(&pin_PB07) },
// BOOT0 ------------------------------------------*/
{ MP_ROM_QSTR(MP_QSTR_PB08), MP_ROM_PTR(&pin_PB08) },
{ MP_ROM_QSTR(MP_QSTR_PB09), MP_ROM_PTR(&pin_PB09) },
{ MP_ROM_QSTR(MP_QSTR_PE00), MP_ROM_PTR(&pin_PE00) },
{ MP_ROM_QSTR(MP_QSTR_PE01), MP_ROM_PTR(&pin_PE01) },
// PDR_ON -----------------------------------------*/
// VDD --------------------------------------------*/
};
MP_DEFINE_CONST_DICT(mcu_pin_globals, mcu_pin_globals_table);

View File

@ -123,6 +123,9 @@ void EXTI4_IRQHandler(void) {
stm_exti_callback[4](4);
}
#ifdef STM32L4
#define PR PR1
#endif
void EXTI9_5_IRQHandler(void) {
uint32_t pending = EXTI->PR;
for (uint i = 5; i <= 9; i++) {
@ -140,5 +143,9 @@ void EXTI15_10_IRQHandler(void) {
}
}
}
#ifdef STM32L4
#undef PR
#endif
#endif

View File

@ -91,6 +91,13 @@ typedef struct {
// Foundation Lines
#ifdef STM32L4R5xx
#define HAS_DAC 1
#define HAS_TRNG 1
#define HAS_BASIC_TIM 1
#include "stm32l4/stm32l4r5xx/periph.h"
#endif
#ifdef STM32F405xx
#define HAS_DAC 1
#define HAS_TRNG 1

View File

@ -85,6 +85,9 @@ extern const mp_obj_type_t mcu_pin_type;
#ifdef STM32F412Zx
#include "stm32f4/stm32f412zx/pins.h"
#endif
#ifdef STM32L4R5xx
#include "stm32l4/stm32l4r5xx/pins.h"
#endif
#ifdef STM32F405xx
#include "stm32f4/stm32f405xx/pins.h"
#endif

View File

@ -0,0 +1,110 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 Blues Wireless Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION 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 "stm32l4xx_hal.h"
#include "supervisor/shared/safe_mode.h"
#include <stdbool.h>
// L4 Series
#ifdef STM32L4R5xx
#include "stm32l4/stm32l4r5xx/clocks.h"
#else
#error Please add other MCUs here so that they are not silently ignored due to #define typos
#endif
#if BOARD_HAS_HIGH_SPEED_CRYSTAL
#error HSE support needs to be added for the L4 family.
#elif !BOARD_HAS_LOW_SPEED_CRYSTAL
#error LSE clock source required
#endif
void Error_Handler(void) {
for (;;) {
}
}
#define HAL_CHECK(x) if (x != HAL_OK) Error_Handler()
void stm32_peripherals_clocks_init(void) {
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
// Configure LSE Drive
HAL_PWR_EnableBkUpAccess();
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_LOW);
__HAL_RCC_PWR_CLK_ENABLE();
/** Configure the main internal regulator output voltage
*/
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST) != HAL_OK) {
Error_Handler();
}
/* Activate PLL with MSI , stabilizied via PLL by LSE */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE | RCC_OSCILLATORTYPE_MSI;
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11;
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI;
RCC_OscInitStruct.PLL.PLLM = 6;
RCC_OscInitStruct.PLL.PLLN = 30;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV5;
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
HAL_CHECK(HAL_RCC_OscConfig(&RCC_OscInitStruct));
/* Enable MSI Auto-calibration through LSE */
HAL_RCCEx_EnableMSIPLLMode();
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
clocks dividers */
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
// Avoid overshoot and start with HCLK 60 MHz
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
HAL_CHECK(HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3));
/* AHB prescaler divider at 1 as second step */
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
HAL_CHECK(HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5));
/* Select MSI output as USB clock source */
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB | RCC_PERIPHCLK_RTC | RCC_PERIPHCLK_ADC;
PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_MSI;
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_SYSCLK;
HAL_CHECK(HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct));
}

View File

@ -0,0 +1,67 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 Blues Wireless Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION 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 "stm32l4xx_hal.h"
// Chip: STM32L4R5
// Line Type: Foundation Line
// Speed: 120MHz (MAX)
// Defaults:
#ifndef CPY_CLK_VSCALE
#define CPY_CLK_VSCALE (PWR_REGULATOR_VOLTAGE_SCALE1_BOOST) // up to 120MHz
#endif
#ifndef CPY_CLK_PLLM
#define CPY_CLK_PLLM (12)
#endif
#ifndef CPY_CLK_PLLN
#define CPY_CLK_PLLN (60)
#endif
#ifndef CPY_CLK_PLLP
#define CPY_CLK_PLLP (RCC_PLLP_DIV2)
#endif
#ifndef CPY_CLK_PLLQ
#define CPY_CLK_PLLQ (2)
#endif
#ifndef CPY_CLK_AHBDIV
#define CPY_CLK_AHBDIV (RCC_SYSCLK_DIV1)
#endif
#ifndef CPY_CLK_APB1DIV
#define CPY_CLK_APB1DIV (RCC_HCLK_DIV1)
#endif
#ifndef CPY_CLK_APB2DIV
#define CPY_CLK_APB2DIV (RCC_HCLK_DIV1)
#endif
#ifndef CPY_CLK_FLASH_LATENCY
#define CPY_CLK_FLASH_LATENCY (FLASH_LATENCY_5)
#endif
#ifndef CPY_CLK_USB_USES_AUDIOPLL
#define CPY_CLK_USB_USES_AUDIOPLL (0)
#endif
#ifndef BOARD_HAS_HIGH_SPEED_CRYSTAL
#define BOARD_HAS_HIGH_SPEED_CRYSTAL (1)
#endif

View File

@ -0,0 +1,60 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 Blues Wireless Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "peripherals/gpio.h"
#include "common-hal/microcontroller/Pin.h"
void stm32_peripherals_gpio_init(void) {
// Enable all GPIO for now
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOF_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE();
// These ports are not used on the Swan R5 but may need to be enabeld on other boards
// __HAL_RCC_GPIOH_CLK_ENABLE();
// __HAL_RCC_GPIOI_CLK_ENABLE();
// Never reset pins
never_reset_pin_number(2,14); // PC14 OSC32_IN
never_reset_pin_number(2,15); // PC15 OSC32_OUT
never_reset_pin_number(0,13); // PA13 SWDIO
never_reset_pin_number(0,14); // PA14 SWCLK
// never_reset_pin_number(0,15); //PA15 JTDI
// never_reset_pin_number(1,3); //PB3 JTDO
// never_reset_pin_number(1,4); //PB4 JTRST
// Port H is not included in GPIO port array
// never_reset_pin_number(5,0); //PH0 JTDO
// never_reset_pin_number(5,1); //PH1 JTRST
}
void stm32l4_peripherals_status_led(uint8_t led, uint8_t state) {
}

View File

@ -0,0 +1,283 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 Blues Wireless Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION 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/mphal.h"
#include "peripherals/pins.h"
#include "peripherals/periph.h"
I2C_TypeDef *mcu_i2c_banks[I2C_BANK_ARRAY_LEN] = {I2C1, I2C2, I2C3, I2C4};
const mcu_periph_obj_t mcu_i2c_sda_list[I2C_SDA_ARRAY_LEN] = {
PERIPH(3, 4, &pin_PB04),
PERIPH(1, 4, &pin_PB07),
PERIPH(4, 5, &pin_PB07),
PERIPH(1, 4, &pin_PB09),
PERIPH(4, 3, &pin_PB11),
PERIPH(2, 4, &pin_PB11),
PERIPH(2, 4, &pin_PB14),
PERIPH(3, 4, &pin_PC01),
PERIPH(3, 6, &pin_PC09),
PERIPH(4, 4, &pin_PD13),
PERIPH(2, 4, &pin_PF00),
PERIPH(4, 4, &pin_PF15),
PERIPH(3, 4, &pin_PG08),
PERIPH(1, 4, &pin_PG13),
PERIPH(2, 4, &pin_PH05),
PERIPH(3, 4, &pin_PH08),
};
const mcu_periph_obj_t mcu_i2c_scl_list[I2C_SCL_ARRAY_LEN] = {
PERIPH(1, 4, &pin_PB06),
PERIPH(1, 4, &pin_PG14),
PERIPH(3, 4, &pin_PA07),
PERIPH(4, 5, &pin_PB06),
PERIPH(1, 4, &pin_PB08),
PERIPH(4, 3, &pin_PB10),
PERIPH(2, 4, &pin_PB10),
PERIPH(2, 4, &pin_PB13),
PERIPH(3, 4, &pin_PC00),
PERIPH(4, 4, &pin_PD12),
PERIPH(2, 4, &pin_PF01),
PERIPH(4, 4, &pin_PF14),
PERIPH(3, 4, &pin_PG07),
PERIPH(2, 4, &pin_PH04),
PERIPH(3, 4, &pin_PH07),
};
SPI_TypeDef *mcu_spi_banks[SPI_BANK_ARRAY_LEN] = {SPI1, SPI2, SPI3};
const mcu_periph_obj_t mcu_spi_sck_list[SPI_SCK_ARRAY_LEN] = {
PERIPH(1, 5, &pin_PA01),
PERIPH(1, 5, &pin_PA05),
PERIPH(2, 3, &pin_PA09),
PERIPH(1, 5, &pin_PB03),
PERIPH(3, 6, &pin_PB03),
PERIPH(2, 5, &pin_PB10),
PERIPH(2, 5, &pin_PB13),
PERIPH(3, 6, &pin_PC10),
PERIPH(2, 5, &pin_PD01),
PERIPH(2, 3, &pin_PD03),
PERIPH(1, 5, &pin_PE13),
PERIPH(1, 5, &pin_PG02),
PERIPH(3, 6, &pin_PG09),
PERIPH(2, 5, &pin_PI01),
};
const mcu_periph_obj_t mcu_spi_mosi_list[SPI_MOSI_ARRAY_LEN] = {
PERIPH(1, 5, &pin_PA07),
PERIPH(1, 5, &pin_PA12),
PERIPH(1, 5, &pin_PB05),
PERIPH(3, 6, &pin_PB05),
PERIPH(2, 5, &pin_PB15),
PERIPH(2, 3, &pin_PC01),
PERIPH(2, 5, &pin_PC03),
PERIPH(3, 6, &pin_PC12),
PERIPH(2, 5, &pin_PD04),
PERIPH(3, 5, &pin_PD06),
PERIPH(1, 5, &pin_PE15),
PERIPH(1, 5, &pin_PG04),
PERIPH(3, 6, &pin_PG11),
PERIPH(2, 5, &pin_PI03),
};
const mcu_periph_obj_t mcu_spi_miso_list[SPI_MISO_ARRAY_LEN] = {
PERIPH(1, 5, &pin_PA06),
PERIPH(1, 5, &pin_PA11),
PERIPH(1, 5, &pin_PB04),
PERIPH(3, 6, &pin_PB04),
PERIPH(2, 5, &pin_PB14),
PERIPH(2, 5, &pin_PC02),
PERIPH(3, 6, &pin_PC11),
PERIPH(2, 5, &pin_PD03),
PERIPH(1, 5, &pin_PE14),
PERIPH(1, 5, &pin_PG03),
PERIPH(3, 6, &pin_PG10),
PERIPH(2, 5, &pin_PI02),
};
const mcu_periph_obj_t mcu_spi_nss_list[SPI_NSS_ARRAY_LEN] = {
PERIPH(1, 5, &pin_PA04),
PERIPH(3, 6, &pin_PA04),
PERIPH(1, 5, &pin_PA15),
PERIPH(3, 6, &pin_PA15),
PERIPH(1, 5, &pin_PB00),
PERIPH(2, 5, &pin_PB09),
PERIPH(2, 5, &pin_PB12),
PERIPH(2, 5, &pin_PD00),
PERIPH(1, 5, &pin_PE12),
PERIPH(1, 5, &pin_PG05),
PERIPH(3, 6, &pin_PG12),
PERIPH(2, 5, &pin_PI00),
};
// todo - add LPUART?
USART_TypeDef *mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5};
bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false};
const mcu_periph_obj_t mcu_uart_tx_list[UART_TX_ARRAY_LEN] = {
PERIPH(4, 9, &pin_PA00),
PERIPH(2, 7, &pin_PA02),
PERIPH(1, 7, &pin_PA09),
PERIPH(1, 7, &pin_PB06),
PERIPH(3, 7, &pin_PB10),
PERIPH(3, 7, &pin_PC04),
PERIPH(3, 7, &pin_PC10),
PERIPH(4, 9, &pin_PC10),
PERIPH(5, 9, &pin_PC12),
PERIPH(2, 7, &pin_PD05),
PERIPH(3, 7, &pin_PD08),
PERIPH(1, 7, &pin_PG09),
};
const mcu_periph_obj_t mcu_uart_rx_list[UART_RX_ARRAY_LEN] = {
PERIPH(4, 9, &pin_PA01),
PERIPH(2, 7, &pin_PA03),
PERIPH(1, 7, &pin_PA10),
PERIPH(2, 3, &pin_PA15),
PERIPH(1, 7, &pin_PB07),
PERIPH(3, 7, &pin_PB11),
PERIPH(3, 7, &pin_PC05),
PERIPH(3, 7, &pin_PC11),
PERIPH(4, 9, &pin_PC11),
PERIPH(5, 9, &pin_PD02),
PERIPH(2, 7, &pin_PD06),
PERIPH(3, 7, &pin_PD09),
PERIPH(1, 7, &pin_PG10),
};
// Timers
// TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins
TIM_TypeDef *mcu_tim_banks[TIM_BANK_ARRAY_LEN] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, /*TIM9*/ NULL, NULL, NULL, NULL, NULL, NULL, TIM15, TIM16, TIM17};
const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN] = {
TIM(2, 1, 1, &pin_PA00),
TIM(5, 2, 1, &pin_PA00),
TIM(2, 1, 2, &pin_PA01),
TIM(5, 2, 2, &pin_PA01),
TIM(2, 1, 3, &pin_PA02),
TIM(5, 2, 3, &pin_PA02),
TIM(15, 15, 1, &pin_PA02),
TIM(2, 1, 4, &pin_PA03),
TIM(5, 2, 4, &pin_PA03),
TIM(15, 15, 2, &pin_PA03),
TIM(2, 1, 1, &pin_PA05),
TIM(3, 2, 1, &pin_PA06),
TIM(16, 15, 1, &pin_PA06),
TIM(3, 2, 2, &pin_PA07),
// TIM(17, 15, 1, &pin_PA07), // peripheral indices are 1 based, stored 0-based with 4 bits available.
TIM(1, 1, 1, &pin_PA08),
TIM(1, 1, 2, &pin_PA09),
TIM(1, 1, 3, &pin_PA10),
TIM(1, 1, 4, &pin_PA11),
TIM(2, 1, 1, &pin_PA15),
TIM(3, 2, 3, &pin_PB00),
TIM(3, 2, 4, &pin_PB01),
TIM(2, 1, 2, &pin_PB03),
TIM(3, 2, 1, &pin_PB04),
TIM(3, 2, 2, &pin_PB05),
TIM(4, 2, 1, &pin_PB06),
TIM(4, 2, 2, &pin_PB07),
TIM(4, 2, 3, &pin_PB08),
TIM(16, 15, 1, &pin_PB08),
TIM(4, 2, 4, &pin_PB09),
// TIM(17, 15, 1, &pin_PB09), // peripheral indices are 1 based, stored 0-based with 4 bits available.
TIM(2, 1, 3, &pin_PB10),
TIM(2, 1, 4, &pin_PB11),
TIM(15, 15, 1, &pin_PB14),
TIM(15, 15, 2, &pin_PB15),
TIM(3, 2, 1, &pin_PC06),
TIM(8, 3, 1, &pin_PC06),
TIM(3, 2, 2, &pin_PC07),
TIM(8, 3, 2, &pin_PC07),
TIM(3, 2, 3, &pin_PC08),
TIM(8, 3, 3, &pin_PC08),
TIM(3, 2, 4, &pin_PC09),
TIM(8, 3, 4, &pin_PC09),
TIM(4, 2, 1, &pin_PD12),
TIM(4, 2, 2, &pin_PD13),
TIM(4, 2, 3, &pin_PD14),
TIM(4, 2, 4, &pin_PD15),
TIM(16, 15, 1, &pin_PE00),
// TIM(17, 15, 1, &pin_PE01), // peripheral indices are 1 based, stored 0-based with 4 bits available.
TIM(3, 2, 1, &pin_PE03),
TIM(3, 2, 2, &pin_PE04),
TIM(3, 2, 3, &pin_PE05),
TIM(3, 2, 4, &pin_PE06),
TIM(1, 1, 1, &pin_PE09),
TIM(1, 1, 2, &pin_PE11),
TIM(1, 1, 3, &pin_PE13),
TIM(1, 1, 4, &pin_PE14),
TIM(5, 2, 1, &pin_PF06),
TIM(5, 2, 2, &pin_PF07),
TIM(5, 2, 3, &pin_PF08),
TIM(5, 2, 4, &pin_PF09),
TIM(15, 15, 1, &pin_PF09),
TIM(15, 15, 2, &pin_PF10),
TIM(15, 15, 1, &pin_PG10),
TIM(15, 15, 2, &pin_PG11),
TIM(5, 2, 1, &pin_PH10),
TIM(5, 2, 2, &pin_PH11),
TIM(5, 2, 3, &pin_PH12),
TIM(5, 2, 4, &pin_PI00),
TIM(8, 3, 4, &pin_PI02),
TIM(8, 3, 1, &pin_PI05),
TIM(8, 3, 2, &pin_PI06),
TIM(8, 3, 3, &pin_PI07),
};
// SDIO
// SDIO_TypeDef *mcu_sdio_banks[1] = {SDIO};
// todo - the L4 has a SDMMC pripheral
const mcu_periph_obj_t mcu_sdio_clock_list[1] = {
PERIPH(1, 12, &pin_PC12),
};
const mcu_periph_obj_t mcu_sdio_command_list[1] = {
PERIPH(1, 12, &pin_PD02),
};
const mcu_periph_obj_t mcu_sdio_data0_list[1] = {
PERIPH(1, 12, &pin_PC08),
};
const mcu_periph_obj_t mcu_sdio_data1_list[1] = {
PERIPH(1, 12, &pin_PC09),
};
const mcu_periph_obj_t mcu_sdio_data2_list[1] = {
PERIPH(1, 12, &pin_PC10),
};
const mcu_periph_obj_t mcu_sdio_data3_list[1] = {
PERIPH(1, 12, &pin_PC11),
};
// CAN
CAN_TypeDef *mcu_can_banks[] = {CAN1};
const mcu_periph_obj_t mcu_can_tx_list[4] = {
PERIPH(1, 10, &pin_PA12),
PERIPH(1, 10, &pin_PB09),
PERIPH(1, 10, &pin_PD01),
PERIPH(1, 10, &pin_PH13),
};
const mcu_periph_obj_t mcu_can_rx_list[4] = {
PERIPH(1, 10, &pin_PA11),
PERIPH(1, 10, &pin_PB08),
PERIPH(1, 10, &pin_PD00),
PERIPH(1, 10, &pin_PI09),
};

View File

@ -0,0 +1,80 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 Blues Wireless Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32L4R5XX_PERIPH_H
#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32L4R5XX_PERIPH_H
// I2C
#define I2C_BANK_ARRAY_LEN 4
#define I2C_SDA_ARRAY_LEN 16
#define I2C_SCL_ARRAY_LEN 15
extern I2C_TypeDef *mcu_i2c_banks[I2C_BANK_ARRAY_LEN];
extern const mcu_periph_obj_t mcu_i2c_sda_list[I2C_SDA_ARRAY_LEN];
extern const mcu_periph_obj_t mcu_i2c_scl_list[I2C_SCL_ARRAY_LEN];
// SPI
#define SPI_BANK_ARRAY_LEN 3
#define SPI_SCK_ARRAY_LEN 14
#define SPI_MOSI_ARRAY_LEN 14
#define SPI_MISO_ARRAY_LEN 12
#define SPI_NSS_ARRAY_LEN 12
extern SPI_TypeDef *mcu_spi_banks[SPI_BANK_ARRAY_LEN];
extern const mcu_periph_obj_t mcu_spi_sck_list[SPI_SCK_ARRAY_LEN];
extern const mcu_periph_obj_t mcu_spi_mosi_list[SPI_MOSI_ARRAY_LEN];
extern const mcu_periph_obj_t mcu_spi_miso_list[SPI_MISO_ARRAY_LEN];
extern const mcu_periph_obj_t mcu_spi_nss_list[SPI_NSS_ARRAY_LEN];
// UART
#define UART_TX_ARRAY_LEN 12
#define UART_RX_ARRAY_LEN 13
extern USART_TypeDef *mcu_uart_banks[MAX_UART];
extern bool mcu_uart_has_usart[MAX_UART];
extern const mcu_periph_obj_t mcu_uart_tx_list[UART_TX_ARRAY_LEN];
extern const mcu_periph_obj_t mcu_uart_rx_list[UART_RX_ARRAY_LEN];
// Timers
#define TIM_BANK_ARRAY_LEN 17
#define TIM_PIN_ARRAY_LEN (73 - 3)
extern TIM_TypeDef *mcu_tim_banks[TIM_BANK_ARRAY_LEN];
extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
// SDIO
// extern SDIO_TypeDef *mcu_sdio_banks[1];
// extern const mcu_periph_obj_t mcu_sdio_clock_list[1];
// extern const mcu_periph_obj_t mcu_sdio_command_list[1];
// extern const mcu_periph_obj_t mcu_sdio_data0_list[1];
// extern const mcu_periph_obj_t mcu_sdio_data1_list[1];
// extern const mcu_periph_obj_t mcu_sdio_data2_list[1];
// extern const mcu_periph_obj_t mcu_sdio_data3_list[1];
// CAN
extern CAN_TypeDef *mcu_can_banks[1];
extern const mcu_periph_obj_t mcu_can_tx_list[4];
extern const mcu_periph_obj_t mcu_can_rx_list[4];
#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32L4R5XX_PERIPH_H

View File

@ -0,0 +1,172 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2021 Blues Wireless Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION 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/mphal.h"
#include "peripherals/pins.h"
#include STM32_HAL_H
const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,5));
const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_1,6));
const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_1,7));
const mcu_pin_obj_t pin_PA03 = PIN(0, 3, ADC_INPUT(ADC_1,8));
const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_1,9));
const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_1,10));
const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_1,11));
const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_1,12));
const mcu_pin_obj_t pin_PA08 = PIN(0, 8, NO_ADC);
const mcu_pin_obj_t pin_PA09 = PIN(0, 9, NO_ADC);
const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC);
const mcu_pin_obj_t pin_PA11 = PIN(0, 11, NO_ADC);
const mcu_pin_obj_t pin_PA12 = PIN(0, 12, NO_ADC);
const mcu_pin_obj_t pin_PA13 = PIN(0, 13, NO_ADC);
const mcu_pin_obj_t pin_PA14 = PIN(0, 14, NO_ADC);
const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC);
const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,15));
const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_1,16));
const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC);
const mcu_pin_obj_t pin_PB03 = PIN(1, 3, NO_ADC);
const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC);
const mcu_pin_obj_t pin_PB05 = PIN(1, 5, NO_ADC);
const mcu_pin_obj_t pin_PB06 = PIN(1, 6, NO_ADC);
const mcu_pin_obj_t pin_PB07 = PIN(1, 7, NO_ADC);
const mcu_pin_obj_t pin_PB08 = PIN(1, 8, NO_ADC);
const mcu_pin_obj_t pin_PB09 = PIN(1, 9, NO_ADC);
const mcu_pin_obj_t pin_PB10 = PIN(1, 10, NO_ADC);
const mcu_pin_obj_t pin_PB11 = PIN(1, 11, NO_ADC);
const mcu_pin_obj_t pin_PB12 = PIN(1, 12, NO_ADC);
const mcu_pin_obj_t pin_PB13 = PIN(1, 13, NO_ADC);
const mcu_pin_obj_t pin_PB14 = PIN(1, 14, NO_ADC);
const mcu_pin_obj_t pin_PB15 = PIN(1, 15, NO_ADC);
const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_1,1));
const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_1,2));
const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_1,3));
const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_1,4));
const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_1,13));
const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_1,14));
const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC);
const mcu_pin_obj_t pin_PC07 = PIN(2, 7, NO_ADC);
const mcu_pin_obj_t pin_PC08 = PIN(2, 8, NO_ADC);
const mcu_pin_obj_t pin_PC09 = PIN(2, 9, NO_ADC);
const mcu_pin_obj_t pin_PC10 = PIN(2, 10, NO_ADC);
const mcu_pin_obj_t pin_PC11 = PIN(2, 11, NO_ADC);
const mcu_pin_obj_t pin_PC12 = PIN(2, 12, NO_ADC);
const mcu_pin_obj_t pin_PC13 = PIN(2, 13, NO_ADC);
const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC);
const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC);
const mcu_pin_obj_t pin_PD00 = PIN(3, 0, NO_ADC);
const mcu_pin_obj_t pin_PD01 = PIN(3, 1, NO_ADC);
const mcu_pin_obj_t pin_PD02 = PIN(3, 2, NO_ADC);
const mcu_pin_obj_t pin_PD03 = PIN(3, 3, NO_ADC);
const mcu_pin_obj_t pin_PD04 = PIN(3, 4, NO_ADC);
const mcu_pin_obj_t pin_PD05 = PIN(3, 5, NO_ADC);
const mcu_pin_obj_t pin_PD06 = PIN(3, 6, NO_ADC);
const mcu_pin_obj_t pin_PD07 = PIN(3, 7, NO_ADC);
const mcu_pin_obj_t pin_PD08 = PIN(3, 8, NO_ADC);
const mcu_pin_obj_t pin_PD09 = PIN(3, 9, NO_ADC);
const mcu_pin_obj_t pin_PD10 = PIN(3, 10, NO_ADC);
const mcu_pin_obj_t pin_PD11 = PIN(3, 11, NO_ADC);
const mcu_pin_obj_t pin_PD12 = PIN(3, 12, NO_ADC);
const mcu_pin_obj_t pin_PD13 = PIN(3, 13, NO_ADC);
const mcu_pin_obj_t pin_PD14 = PIN(3, 14, NO_ADC);
const mcu_pin_obj_t pin_PD15 = PIN(3, 15, NO_ADC);
const mcu_pin_obj_t pin_PE00 = PIN(4, 0, NO_ADC);
const mcu_pin_obj_t pin_PE01 = PIN(4, 1, NO_ADC);
const mcu_pin_obj_t pin_PE02 = PIN(4, 2, NO_ADC);
const mcu_pin_obj_t pin_PE03 = PIN(4, 3, NO_ADC);
const mcu_pin_obj_t pin_PE04 = PIN(4, 4, NO_ADC);
const mcu_pin_obj_t pin_PE05 = PIN(4, 5, NO_ADC);
const mcu_pin_obj_t pin_PE06 = PIN(4, 6, NO_ADC);
const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC);
const mcu_pin_obj_t pin_PE08 = PIN(4, 8, NO_ADC);
const mcu_pin_obj_t pin_PE09 = PIN(4, 9, NO_ADC);
const mcu_pin_obj_t pin_PE10 = PIN(4, 10, NO_ADC);
const mcu_pin_obj_t pin_PE11 = PIN(4, 11, NO_ADC);
const mcu_pin_obj_t pin_PE12 = PIN(4, 12, NO_ADC);
const mcu_pin_obj_t pin_PE13 = PIN(4, 13, NO_ADC);
const mcu_pin_obj_t pin_PE14 = PIN(4, 14, NO_ADC);
const mcu_pin_obj_t pin_PE15 = PIN(4, 15, NO_ADC);
const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC);
const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC);
const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC);
const mcu_pin_obj_t pin_PF03 = PIN(5, 3, NO_ADC);
const mcu_pin_obj_t pin_PF04 = PIN(5, 4, NO_ADC);
const mcu_pin_obj_t pin_PF05 = PIN(5, 5, NO_ADC);
const mcu_pin_obj_t pin_PF06 = PIN(5, 6, NO_ADC);
const mcu_pin_obj_t pin_PF07 = PIN(5, 7, NO_ADC);
const mcu_pin_obj_t pin_PF08 = PIN(5, 8, NO_ADC);
const mcu_pin_obj_t pin_PF09 = PIN(5, 9, NO_ADC);
const mcu_pin_obj_t pin_PF10 = PIN(5, 10, NO_ADC);
const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC);
const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC);
const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC);
const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC);
const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC);
const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC);
const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC);
const mcu_pin_obj_t pin_PG02 = PIN(6, 2, NO_ADC);
const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC);
const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC);
const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC);
const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC);
const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC);
const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC);
const mcu_pin_obj_t pin_PG09 = PIN(6, 9, NO_ADC);
const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC);
const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC);
const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC);
const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC);
const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC);
const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC);
const mcu_pin_obj_t pin_PH00 = PIN(7, 0, NO_ADC);
const mcu_pin_obj_t pin_PH01 = PIN(7, 1, NO_ADC);
const mcu_pin_obj_t pin_PH02 = PIN(7, 2, NO_ADC);
const mcu_pin_obj_t pin_PH03 = PIN(7, 3, NO_ADC);
const mcu_pin_obj_t pin_PH04 = PIN(7, 4, NO_ADC);
const mcu_pin_obj_t pin_PH05 = PIN(7, 5, NO_ADC);
const mcu_pin_obj_t pin_PH06 = PIN(7, 6, NO_ADC);
const mcu_pin_obj_t pin_PH07 = PIN(7, 7, NO_ADC);
const mcu_pin_obj_t pin_PH08 = PIN(7, 8, NO_ADC);
const mcu_pin_obj_t pin_PH09 = PIN(7, 9, NO_ADC);
const mcu_pin_obj_t pin_PH10 = PIN(7, 10, NO_ADC);
const mcu_pin_obj_t pin_PH11 = PIN(7, 11, NO_ADC);
const mcu_pin_obj_t pin_PH12 = PIN(7, 12, NO_ADC);
const mcu_pin_obj_t pin_PH13 = PIN(7, 13, NO_ADC);
const mcu_pin_obj_t pin_PH14 = PIN(7, 14, NO_ADC);
const mcu_pin_obj_t pin_PH15 = PIN(7, 15, NO_ADC);
const mcu_pin_obj_t pin_PI00 = PIN(8, 0, NO_ADC);
const mcu_pin_obj_t pin_PI01 = PIN(8, 1, NO_ADC);
const mcu_pin_obj_t pin_PI02 = PIN(8, 2, NO_ADC);
const mcu_pin_obj_t pin_PI03 = PIN(8, 3, NO_ADC);
const mcu_pin_obj_t pin_PI04 = PIN(8, 4, NO_ADC);
const mcu_pin_obj_t pin_PI05 = PIN(8, 5, NO_ADC);
const mcu_pin_obj_t pin_PI06 = PIN(8, 6, NO_ADC);
const mcu_pin_obj_t pin_PI07 = PIN(8, 7, NO_ADC);
const mcu_pin_obj_t pin_PI08 = PIN(8, 8, NO_ADC);
const mcu_pin_obj_t pin_PI09 = PIN(8, 9, NO_ADC);
const mcu_pin_obj_t pin_PI10 = PIN(8, 10, NO_ADC);
const mcu_pin_obj_t pin_PI11 = PIN(8, 11, NO_ADC);

Some files were not shown because too many files have changed in this diff Show More