commit
eac639a72c
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -37,7 +37,7 @@ jobs:
|
||||
run: |
|
||||
sudo apt-get install -y eatmydata
|
||||
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64
|
||||
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid
|
||||
pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort
|
||||
- name: Versions
|
||||
run: |
|
||||
gcc --version
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 0d2c083a2fb57a1562d4806775f45273abbfbfae
|
||||
Subproject commit 9596a5904ed757e6fbffcf03e7aa77ae9ecf5223
|
@ -1 +1 @@
|
||||
Subproject commit 9f71088d2c32206c6f0495704ae0c040426d5764
|
||||
Subproject commit 761d6437e8cd6a131d51de96974337121a9c7164
|
36
locale/ID.po
36
locale/ID.po
@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2020-07-06 18:10+0000\n"
|
||||
"Last-Translator: oon arfiandwi <oon.arfiandwi@gmail.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -84,10 +84,15 @@ msgstr "indeks %q harus bilangan bulat, bukan %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr "daftar %q harus berupa daftar"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "%q harus >= 1"
|
||||
|
||||
@ -111,6 +116,10 @@ msgstr "%q() mengambil posisi argumen %d tapi %d yang diberikan"
|
||||
msgid "'%q' argument required"
|
||||
msgstr "'%q' argumen dibutuhkan"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -321,6 +330,11 @@ msgstr "Semua timer sedang digunakan"
|
||||
msgid "Already advertising."
|
||||
msgstr "Sudah disebarkan."
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr "AnalogIn tidak didukung pada pin yang diberikan"
|
||||
@ -356,6 +370,11 @@ msgstr "Nilai array harus berupa byte tunggal."
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr "Paling banyak %d %q dapat ditentukan (bukan %d)"
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr "Mencoba alokasi heap ketika MicroPython VM tidak berjalan."
|
||||
@ -477,7 +496,9 @@ msgstr "Panggil super().__init__() sebelum mengakses objek asli."
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr "Tidak dapat mengatur CCCD pada Karakteristik lokal"
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "Tidak dapat menghapus nilai"
|
||||
|
||||
@ -1375,6 +1396,7 @@ msgstr ""
|
||||
msgid "Random number generation error"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr ""
|
||||
@ -1461,7 +1483,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr ""
|
||||
|
||||
@ -3137,7 +3161,7 @@ msgstr "struct: index keluar dari jangkauan"
|
||||
msgid "struct: no fields"
|
||||
msgstr "struct: tidak ada fields"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr ""
|
||||
|
||||
|
@ -1,12 +1,14 @@
|
||||
# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-21 18:43-0700\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -76,10 +78,15 @@ msgstr ""
|
||||
msgid "%q list must be a list"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr ""
|
||||
|
||||
@ -103,6 +110,10 @@ msgstr ""
|
||||
msgid "'%q' argument required"
|
||||
msgstr ""
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -223,6 +234,10 @@ msgstr ""
|
||||
msgid "'continue' outside loop"
|
||||
msgstr ""
|
||||
|
||||
#: py/objgenerator.c
|
||||
msgid "'coroutine' object is not an iterator"
|
||||
msgstr ""
|
||||
|
||||
#: py/compile.c
|
||||
msgid "'data' requires at least 2 arguments"
|
||||
msgstr ""
|
||||
@ -305,7 +320,7 @@ msgstr ""
|
||||
#: ports/cxd56/common-hal/pulseio/PulseOut.c
|
||||
#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
|
||||
#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c
|
||||
#: shared-bindings/pulseio/PWMOut.c
|
||||
#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c
|
||||
msgid "All timers in use"
|
||||
msgstr ""
|
||||
|
||||
@ -313,6 +328,11 @@ msgstr ""
|
||||
msgid "Already advertising."
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr ""
|
||||
@ -348,6 +368,11 @@ msgstr ""
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
@ -467,7 +492,9 @@ msgstr ""
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr ""
|
||||
|
||||
@ -1309,11 +1336,7 @@ msgstr ""
|
||||
msgid "Pull not used when direction is output."
|
||||
msgstr ""
|
||||
|
||||
#: ports/stm/common-hal/pulseio/PulseIn.c
|
||||
msgid "PulseIn not supported on this chip"
|
||||
msgstr ""
|
||||
|
||||
#: ports/stm/common-hal/pulseio/PulseOut.c
|
||||
#: ports/stm/ref/pulseout-pre-timeralloc.c
|
||||
msgid "PulseOut not supported on this chip"
|
||||
msgstr ""
|
||||
|
||||
@ -1347,6 +1370,7 @@ msgstr ""
|
||||
msgid "Random number generation error"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr ""
|
||||
@ -1431,7 +1455,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr ""
|
||||
|
||||
@ -1519,6 +1545,11 @@ msgstr ""
|
||||
msgid "Timeout is too long: Maximum timeout length is %d seconds"
|
||||
msgstr ""
|
||||
|
||||
#: ports/stm/common-hal/pulseio/PWMOut.c
|
||||
msgid ""
|
||||
"Timer was reserved for internal use - declare PWM pins earlier in the program"
|
||||
msgstr ""
|
||||
|
||||
#: ports/atmel-samd/common-hal/audiobusio/I2SOut.c
|
||||
msgid "Too many channels in sample."
|
||||
msgstr ""
|
||||
@ -3098,7 +3129,7 @@ msgstr ""
|
||||
msgid "struct: no fields"
|
||||
msgstr ""
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr ""
|
||||
|
||||
|
36
locale/cs.po
36
locale/cs.po
@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2020-05-24 03:22+0000\n"
|
||||
"Last-Translator: dronecz <mzuzelka@gmail.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -84,10 +84,15 @@ msgstr "Indexy% q musí být celá čísla, nikoli% s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr "Seznam% q musí být seznam"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "% q musí být > = 1"
|
||||
|
||||
@ -111,6 +116,10 @@ msgstr ""
|
||||
msgid "'%q' argument required"
|
||||
msgstr ""
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -321,6 +330,11 @@ msgstr ""
|
||||
msgid "Already advertising."
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr ""
|
||||
@ -356,6 +370,11 @@ msgstr ""
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
@ -475,7 +494,9 @@ msgstr ""
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr ""
|
||||
|
||||
@ -1355,6 +1376,7 @@ msgstr ""
|
||||
msgid "Random number generation error"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr ""
|
||||
@ -1439,7 +1461,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr ""
|
||||
|
||||
@ -3106,7 +3130,7 @@ msgstr ""
|
||||
msgid "struct: no fields"
|
||||
msgstr ""
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr ""
|
||||
|
||||
|
@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2020-06-16 18:24+0000\n"
|
||||
"Last-Translator: Andreas Buchen <andreas.buchen@gmail.com>\n"
|
||||
"Language: de_DE\n"
|
||||
@ -83,10 +83,15 @@ msgstr "%q Indizes müssen Integer sein, nicht %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr "%q Liste muss eine Liste sein"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "%q muss >= 1 sein"
|
||||
|
||||
@ -110,6 +115,10 @@ msgstr "%q() nimmt %d Argumente ohne Keyword an, aber es wurden %d angegeben"
|
||||
msgid "'%q' argument required"
|
||||
msgstr "'%q' Argument erforderlich"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -320,6 +329,11 @@ msgstr "Alle timer werden benutzt"
|
||||
msgid "Already advertising."
|
||||
msgstr "Bereits am anbieten (advertising)."
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr "AnalogIn ist an diesem Pin nicht unterstützt"
|
||||
@ -355,6 +369,11 @@ msgstr "Array-Werte sollten aus Einzelbytes bestehen."
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr "Es darf höchstens %d %q spezifiziert werden (nicht %d)"
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
@ -478,7 +497,9 @@ msgstr "Rufe super().__init__() vor dem Zugriff auf ein natives Objekt auf."
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr "CCCD kann nicht auf lokales Merkmal eingestellt werden"
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "Kann Werte nicht löschen"
|
||||
|
||||
@ -1385,6 +1406,7 @@ msgstr "RTS / CTS / RS485 Wird von diesem Gerät noch nicht unterstützt"
|
||||
msgid "Random number generation error"
|
||||
msgstr "Fehler bei der Erzeugung von Zufallszahlen"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr "Nur lesen möglich, da Schreibgeschützt"
|
||||
@ -1469,7 +1491,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr "Slice und Wert (value) haben unterschiedliche Längen."
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr "Slices werden nicht unterstützt"
|
||||
|
||||
@ -3190,7 +3214,7 @@ msgstr "struct: index außerhalb gültigen Bereichs"
|
||||
msgid "struct: no fields"
|
||||
msgstr "struct: keine Felder"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr "substring nicht gefunden"
|
||||
|
||||
|
39
locale/es.po
39
locale/es.po
@ -3,13 +3,12 @@
|
||||
# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"PO-Revision-Date: 2020-07-13 19:24+0000\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2020-07-22 20:48+0000\n"
|
||||
"Last-Translator: Alvaro Figueroa <alvaro@greencore.co.cr>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: es\n"
|
||||
@ -88,10 +87,15 @@ msgstr "%q indices deben ser enteros, no %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr "%q lista debe ser una lista"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "%q debe ser >= 1"
|
||||
|
||||
@ -115,6 +119,10 @@ msgstr "%q() toma %d argumentos posicionales pero %d fueron dados"
|
||||
msgid "'%q' argument required"
|
||||
msgstr "argumento '%q' requerido"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr "el objeto '%q' no es similar a bytes"
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -327,6 +335,11 @@ msgstr "Todos los timers en uso"
|
||||
msgid "Already advertising."
|
||||
msgstr "Ya se encuentra publicando."
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr "El pin proporcionado no soporta AnalogIn"
|
||||
@ -362,6 +375,11 @@ msgstr "Valores del array deben ser bytes individuales."
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr "Como máximo %d %q se puede especificar (no %d)"
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
@ -485,7 +503,9 @@ msgstr "Llame a super().__ init __() antes de acceder al objeto nativo."
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr "No se puede configurar CCCD en la característica local"
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "No se puede eliminar valores"
|
||||
|
||||
@ -1385,6 +1405,7 @@ msgstr "Sin capacidad de RTS/CTS/RS485 para este dispositivo"
|
||||
msgid "Random number generation error"
|
||||
msgstr "Error de generación de números aleatorios"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr "Solo-lectura"
|
||||
@ -1469,7 +1490,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr "Slice y value tienen tamaños diferentes."
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr "Rebanadas no soportadas"
|
||||
|
||||
@ -3174,7 +3197,7 @@ msgstr "struct: index fuera de rango"
|
||||
msgid "struct: no fields"
|
||||
msgstr "struct: sin campos"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr "substring no encontrado"
|
||||
|
||||
|
@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2018-12-20 22:15-0800\n"
|
||||
"Last-Translator: Timothy <me@timothygarcia.ca>\n"
|
||||
"Language-Team: fil\n"
|
||||
@ -76,10 +76,15 @@ msgstr "%q indeks ay dapat integers, hindi %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
#, fuzzy
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "aarehas na haba dapat ang buffer slices"
|
||||
@ -106,6 +111,10 @@ msgstr ""
|
||||
msgid "'%q' argument required"
|
||||
msgstr "'%q' argument kailangan"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -317,6 +326,11 @@ msgstr "Lahat ng timer ginagamit"
|
||||
msgid "Already advertising."
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr ""
|
||||
@ -352,6 +366,11 @@ msgstr "Array values ay dapat single bytes."
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
@ -474,7 +493,9 @@ msgstr ""
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "Hindi mabura ang values"
|
||||
|
||||
@ -1369,6 +1390,7 @@ msgstr ""
|
||||
msgid "Random number generation error"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr "Basahin-lamang"
|
||||
@ -1454,7 +1476,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr "Slice at value iba't ibang haba."
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr "Hindi suportado ang Slices"
|
||||
|
||||
@ -3153,7 +3177,7 @@ msgstr "struct: index hindi maabot"
|
||||
msgid "struct: no fields"
|
||||
msgstr "struct: walang fields"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr "substring hindi nahanap"
|
||||
|
||||
|
36
locale/fr.po
36
locale/fr.po
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: 0.1\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2020-06-05 17:29+0000\n"
|
||||
"Last-Translator: aberwag <aberwag@gmail.com>\n"
|
||||
"Language: fr\n"
|
||||
@ -88,10 +88,15 @@ msgstr "les indices %q doivent être des entiers, pas %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr "La liste %q doit être une liste"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "%q doit être >=1"
|
||||
|
||||
@ -115,6 +120,10 @@ msgstr "%q() prend %d arguments positionnels mais %d ont été donnés"
|
||||
msgid "'%q' argument required"
|
||||
msgstr "'%q' argument requis"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -325,6 +334,11 @@ msgstr "Tous les timers sont utilisés"
|
||||
msgid "Already advertising."
|
||||
msgstr "S'annonce déjà."
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr "'AnalogOut' n'est pas supporté sur la broche indiquée"
|
||||
@ -361,6 +375,11 @@ msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'."
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr "Au plus %d %q peut être spécifié (pas %d)"
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
@ -484,7 +503,9 @@ msgstr "Appelez super () .__ init __ () avant d'accéder à l'objet natif."
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr "Impossible de définir CCCD sur une caractéristique locale"
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "Impossible de supprimer les valeurs"
|
||||
|
||||
@ -1390,6 +1411,7 @@ msgstr "RTS / CTS / RS485 Pas encore pris en charge sur cet appareil"
|
||||
msgid "Random number generation error"
|
||||
msgstr "Erreur de génération de nombres aléatoires"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr "Lecture seule"
|
||||
@ -1474,7 +1496,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr "Tranche et valeur de tailles différentes."
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr "Tranches non supportées"
|
||||
|
||||
@ -3197,7 +3221,7 @@ msgstr "struct : index hors limites"
|
||||
msgid "struct: no fields"
|
||||
msgstr "struct : aucun champs"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr "sous-chaîne non trouvée"
|
||||
|
||||
|
@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2018-10-02 16:27+0200\n"
|
||||
"Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n"
|
||||
"Language-Team: \n"
|
||||
@ -76,10 +76,15 @@ msgstr "gli indici %q devono essere interi, non %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
#, fuzzy
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "slice del buffer devono essere della stessa lunghezza"
|
||||
@ -105,6 +110,10 @@ msgstr "%q() prende %d argomenti posizionali ma ne sono stati forniti %d"
|
||||
msgid "'%q' argument required"
|
||||
msgstr "'%q' argomento richiesto"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -316,6 +325,11 @@ msgstr "Tutti i timer utilizzati"
|
||||
msgid "Already advertising."
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr ""
|
||||
@ -351,6 +365,11 @@ msgstr "Valori di Array dovrebbero essere bytes singulari"
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
@ -474,7 +493,9 @@ msgstr ""
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "Impossibile cancellare valori"
|
||||
|
||||
@ -1378,6 +1399,7 @@ msgstr ""
|
||||
msgid "Random number generation error"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr "Sola lettura"
|
||||
@ -1465,7 +1487,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr "Slice non supportate"
|
||||
|
||||
@ -3160,7 +3184,7 @@ msgstr "struct: indice fuori intervallo"
|
||||
msgid "struct: no fields"
|
||||
msgstr "struct: nessun campo"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr "sottostringa non trovata"
|
||||
|
||||
|
36
locale/ko.po
36
locale/ko.po
@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2019-05-06 14:22-0700\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -78,10 +78,15 @@ msgstr "%q 인덱스는 %s 가 아닌 정수 여야합니다"
|
||||
msgid "%q list must be a list"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "%q 는 >=1이어야합니다"
|
||||
|
||||
@ -105,6 +110,10 @@ msgstr ""
|
||||
msgid "'%q' argument required"
|
||||
msgstr ""
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -315,6 +324,11 @@ msgstr "모든 타이머가 사용 중입니다"
|
||||
msgid "Already advertising."
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr ""
|
||||
@ -350,6 +364,11 @@ msgstr ""
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
@ -471,7 +490,9 @@ msgstr ""
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "값을 삭제할 수 없습니다"
|
||||
|
||||
@ -1351,6 +1372,7 @@ msgstr ""
|
||||
msgid "Random number generation error"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr ""
|
||||
@ -1435,7 +1457,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr ""
|
||||
|
||||
@ -3103,7 +3127,7 @@ msgstr ""
|
||||
msgid "struct: no fields"
|
||||
msgstr ""
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr ""
|
||||
|
||||
|
36
locale/nl.po
36
locale/nl.po
@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2020-07-13 17:39+0000\n"
|
||||
"Last-Translator: _fonzlate <vooralfred@gmail.com>\n"
|
||||
"Language-Team: none\n"
|
||||
@ -84,10 +84,15 @@ msgstr "%q indexen moeten integers zijn, niet %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr "%q lijst moet een lijst zijn"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "%q moet >= 1 zijn"
|
||||
|
||||
@ -111,6 +116,10 @@ msgstr "%q() verwacht %d positionele argumenten maar kreeg %d"
|
||||
msgid "'%q' argument required"
|
||||
msgstr "'%q' argument vereist"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -321,6 +330,11 @@ msgstr "Alle timers zijn in gebruik"
|
||||
msgid "Already advertising."
|
||||
msgstr "Advertising is al bezig."
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr "AnalogIn niet ondersteund door gegeven pin"
|
||||
@ -356,6 +370,11 @@ msgstr "Array waardes moet enkele bytes zijn."
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr "Op zijn meest %d %q mogen worden gespecificeerd (niet %d)"
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr "heap allocatie geprobeerd terwijl MicroPython VM niet draait."
|
||||
@ -477,7 +496,9 @@ msgstr "Roep super().__init__() aan voor toegang native object."
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr "Kan CCCD niet toewijzen aan lokaal Characteristic"
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "Kan waardes niet verwijderen"
|
||||
|
||||
@ -1381,6 +1402,7 @@ msgstr "RTS/CTS/RS485 Nog niet ondersteund door dit apparaat"
|
||||
msgid "Random number generation error"
|
||||
msgstr "Random number generatie fout"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr "Alleen-lezen"
|
||||
@ -1465,7 +1487,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr "Slice en waarde hebben verschillende lengtes."
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr "Slices niet ondersteund"
|
||||
|
||||
@ -3162,7 +3186,7 @@ msgstr "struct: index buiten bereik"
|
||||
msgid "struct: no fields"
|
||||
msgstr "struct: geen velden"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr "deelreeks niet gevonden"
|
||||
|
||||
|
36
locale/pl.po
36
locale/pl.po
@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2019-03-19 18:37-0700\n"
|
||||
"Last-Translator: Radomir Dopieralski <circuitpython@sheep.art.pl>\n"
|
||||
"Language-Team: pl\n"
|
||||
@ -78,10 +78,15 @@ msgstr "%q indeks musi być liczbą całkowitą, a nie %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "%q musi być >= 1"
|
||||
|
||||
@ -105,6 +110,10 @@ msgstr "%q() bierze %d argumentów pozycyjnych, lecz podano %d"
|
||||
msgid "'%q' argument required"
|
||||
msgstr "'%q' wymaga argumentu"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -315,6 +324,11 @@ msgstr "Wszystkie timery w użyciu"
|
||||
msgid "Already advertising."
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr ""
|
||||
@ -350,6 +364,11 @@ msgstr "Wartości powinny być bajtami."
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
@ -471,7 +490,9 @@ msgstr ""
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "Nie można usunąć"
|
||||
|
||||
@ -1353,6 +1374,7 @@ msgstr ""
|
||||
msgid "Random number generation error"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr "Tylko do odczytu"
|
||||
@ -1437,7 +1459,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr "Fragment i wartość są różnych długości."
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr "Fragmenty nieobsługiwane"
|
||||
|
||||
@ -3110,7 +3134,7 @@ msgstr "struct: indeks poza zakresem"
|
||||
msgid "struct: no fields"
|
||||
msgstr "struct: brak pól"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr "brak pod-łańcucha"
|
||||
|
||||
|
@ -5,8 +5,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"PO-Revision-Date: 2020-07-09 17:23+0000\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2020-07-23 02:57+0000\n"
|
||||
"Last-Translator: Wellington Terumi Uemura <wellingtonuemura@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: pt_BR\n"
|
||||
@ -84,10 +84,15 @@ msgstr "Os índices %q devem ser inteiros, e não %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr "A lista %q deve ser uma lista"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr "%q deve ser >= 0"
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "%q deve ser >= 1"
|
||||
|
||||
@ -111,6 +116,10 @@ msgstr "%q() recebe %d argumentos posicionais, porém %d foram informados"
|
||||
msgid "'%q' argument required"
|
||||
msgstr "'%q' argumento(s) requerido(s)"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr "objetos '%q' não são bytes-like"
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -323,6 +332,11 @@ msgstr "Todos os temporizadores em uso"
|
||||
msgid "Already advertising."
|
||||
msgstr "Já está anunciando."
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr "Já está em execução"
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr "O AnalogIn não é compatível no pino informado"
|
||||
@ -358,6 +372,11 @@ msgstr "Os valores das matrizes devem ser bytes simples."
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr "Pelo menos %d %q pode ser definido (não %d)"
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr "Tentativa de alocar %d blocos"
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr ""
|
||||
@ -483,7 +502,9 @@ msgstr "Chame super().__init__() antes de acessar o objeto nativo."
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr "Não é possível definir o CCCD com a característica local"
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "Não é possível excluir valores"
|
||||
|
||||
@ -1389,6 +1410,7 @@ msgstr "RTS/CTS/RS485 Ainda não é compatível neste dispositivo"
|
||||
msgid "Random number generation error"
|
||||
msgstr "Houve um erro na geração do número aleatório"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr "Somente leitura"
|
||||
@ -1473,7 +1495,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr "Fatie e avalie os diferentes comprimentos."
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr "Fatiamento não compatível"
|
||||
|
||||
@ -3186,7 +3210,7 @@ msgstr "struct: índice fora do intervalo"
|
||||
msgid "struct: no fields"
|
||||
msgstr "struct: sem campos"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr "a substring não foi encontrada"
|
||||
|
||||
|
36
locale/sv.po
36
locale/sv.po
@ -5,7 +5,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2020-07-13 17:39+0000\n"
|
||||
"Last-Translator: Jonny Bergdahl <jonny@bergdahl.it>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -84,10 +84,15 @@ msgstr "Indexet %q måste vara ett heltal, inte %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr "%q-listan måste vara en lista"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "%q måste vara >= 1"
|
||||
|
||||
@ -111,6 +116,10 @@ msgstr "%q() kräver %d positionsargument men %d gavs"
|
||||
msgid "'%q' argument required"
|
||||
msgstr "'%q' argument krävs"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -321,6 +330,11 @@ msgstr "Alla timers används"
|
||||
msgid "Already advertising."
|
||||
msgstr "Annonserar redan."
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr "AnalogIn stöds inte på angiven pinne"
|
||||
@ -356,6 +370,11 @@ msgstr "Matrisvärden ska bestå av enstaka bytes."
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr "Högst %d %q kan anges (inte %d)"
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr "Försökte tilldela heap när MicroPython VM inte körs."
|
||||
@ -477,7 +496,9 @@ msgstr "Anropa super().__init__() innan du använder det ursprungliga objektet."
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr "Kan inte ställa in CCCD på lokal karaktäristik"
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "Kan inte radera värden"
|
||||
|
||||
@ -1377,6 +1398,7 @@ msgstr "RTS/CTS/RS485 Stöds ännu inte på den här enheten"
|
||||
msgid "Random number generation error"
|
||||
msgstr "Fel vid generering av slumptal"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr "Skrivskyddad"
|
||||
@ -1461,7 +1483,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr "Slice och värde har olika längd."
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr "Slice stöds inte"
|
||||
|
||||
@ -3155,7 +3179,7 @@ msgstr "struct: index utanför intervallet"
|
||||
msgid "struct: no fields"
|
||||
msgstr "struct: inga fält"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr "det gick inte att hitta delsträng"
|
||||
|
||||
|
@ -6,7 +6,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: circuitpython-cn\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-07 14:38-0500\n"
|
||||
"POT-Creation-Date: 2020-07-17 18:03-0700\n"
|
||||
"PO-Revision-Date: 2019-04-13 10:10-0700\n"
|
||||
"Last-Translator: hexthat\n"
|
||||
"Language-Team: Chinese Hanyu Pinyin\n"
|
||||
@ -84,10 +84,15 @@ msgstr "%q suǒyǐn bìxū shì zhěngshù, ér bùshì %s"
|
||||
msgid "%q list must be a list"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
msgid "%q must be >= 0"
|
||||
msgstr ""
|
||||
|
||||
#: shared-bindings/_bleio/CharacteristicBuffer.c
|
||||
#: shared-bindings/_bleio/PacketBuffer.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/Shape.c shared-bindings/vectorio/Circle.c
|
||||
#: shared-bindings/vectorio/Rectangle.c
|
||||
#: shared-bindings/displayio/Shape.c
|
||||
#: shared-bindings/memorymonitor/AllocationAlarm.c
|
||||
#: shared-bindings/vectorio/Circle.c shared-bindings/vectorio/Rectangle.c
|
||||
msgid "%q must be >= 1"
|
||||
msgstr "%q bìxū dàyú huò děngyú 1"
|
||||
|
||||
@ -111,6 +116,10 @@ msgstr "%q() cǎiyòng %d wèizhì cānshù, dàn gěi chū %d"
|
||||
msgid "'%q' argument required"
|
||||
msgstr "xūyào '%q' cānshù"
|
||||
|
||||
#: py/objarray.c
|
||||
msgid "'%q' object is not bytes-like"
|
||||
msgstr ""
|
||||
|
||||
#: py/emitinlinethumb.c py/emitinlinextensa.c
|
||||
#, c-format
|
||||
msgid "'%s' expects a label"
|
||||
@ -321,6 +330,11 @@ msgstr "Suǒyǒu jìshí qì shǐyòng"
|
||||
msgid "Already advertising."
|
||||
msgstr "Mùqián zhèngzài guǎngbò"
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#: shared-module/memorymonitor/AllocationSize.c
|
||||
msgid "Already running"
|
||||
msgstr ""
|
||||
|
||||
#: ports/cxd56/common-hal/analogio/AnalogIn.c
|
||||
msgid "AnalogIn not supported on given pin"
|
||||
msgstr "Gěi dìng de yǐn jiǎo bù zhīchí AnalogIn"
|
||||
@ -356,6 +370,11 @@ msgstr "Shùzǔ zhí yīnggāi shì dāngè zì jié."
|
||||
msgid "At most %d %q may be specified (not %d)"
|
||||
msgstr ""
|
||||
|
||||
#: shared-module/memorymonitor/AllocationAlarm.c
|
||||
#, c-format
|
||||
msgid "Attempt to allocate %d blocks"
|
||||
msgstr ""
|
||||
|
||||
#: supervisor/shared/safe_mode.c
|
||||
msgid "Attempted heap allocation when MicroPython VM not running."
|
||||
msgstr "MicroPython VM zài wèi yùnxíng shí chángshì fēnpèi duī."
|
||||
@ -477,7 +496,9 @@ msgstr "Zài fǎngwèn běn jī wùjiàn zhīqián diàoyòng super().__init__()
|
||||
msgid "Can't set CCCD on local Characteristic"
|
||||
msgstr "Wúfǎ jiāng CCCD shèzhì wéi běndì tèzhēng"
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/Bitmap.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Cannot delete values"
|
||||
msgstr "Wúfǎ shānchú zhí"
|
||||
|
||||
@ -1367,6 +1388,7 @@ msgstr ""
|
||||
msgid "Random number generation error"
|
||||
msgstr "Suíjī shù shēngchéng cuòwù"
|
||||
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Read-only"
|
||||
msgstr "Zhǐ dú"
|
||||
@ -1451,7 +1473,9 @@ msgid "Slice and value different lengths."
|
||||
msgstr "Qiēpiàn hé zhí bùtóng chángdù."
|
||||
|
||||
#: shared-bindings/displayio/Bitmap.c shared-bindings/displayio/Group.c
|
||||
#: shared-bindings/displayio/TileGrid.c shared-bindings/pulseio/PulseIn.c
|
||||
#: shared-bindings/displayio/TileGrid.c
|
||||
#: shared-bindings/memorymonitor/AllocationSize.c
|
||||
#: shared-bindings/pulseio/PulseIn.c
|
||||
msgid "Slices not supported"
|
||||
msgstr "Qiēpiàn bù shòu zhīchí"
|
||||
|
||||
@ -3140,7 +3164,7 @@ msgstr "jiégòu: suǒyǐn chāochū fànwéi"
|
||||
msgid "struct: no fields"
|
||||
msgstr "jiégòu: méiyǒu zìduàn"
|
||||
|
||||
#: py/objstr.c
|
||||
#: py/objarray.c py/objstr.c
|
||||
msgid "substring not found"
|
||||
msgstr "wèi zhǎodào zi zìfú chuàn"
|
||||
|
||||
|
17
main.c
17
main.c
@ -64,6 +64,10 @@
|
||||
#include "shared-module/displayio/__init__.h"
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_MEMORYMONITOR
|
||||
#include "shared-module/memorymonitor/__init__.h"
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_NETWORK
|
||||
#include "shared-module/network/__init__.h"
|
||||
#endif
|
||||
@ -97,6 +101,10 @@ void do_str(const char *src, mp_parse_input_kind_t input_kind) {
|
||||
}
|
||||
}
|
||||
|
||||
#if MICROPY_ENABLE_PYSTACK
|
||||
static size_t PLACE_IN_DTCM_BSS(_pystack[CIRCUITPY_PYSTACK_SIZE / sizeof(size_t)]);
|
||||
#endif
|
||||
|
||||
void start_mp(supervisor_allocation* heap) {
|
||||
reset_status_led();
|
||||
autoreload_stop();
|
||||
@ -125,6 +133,10 @@ void start_mp(supervisor_allocation* heap) {
|
||||
// Clear the readline history. It references the heap we're about to destroy.
|
||||
readline_init0();
|
||||
|
||||
#if MICROPY_ENABLE_PYSTACK
|
||||
mp_pystack_init(_pystack, _pystack + (sizeof(_pystack) / sizeof(size_t)));
|
||||
#endif
|
||||
|
||||
#if MICROPY_ENABLE_GC
|
||||
gc_init(heap->ptr, heap->ptr + heap->length / 4);
|
||||
#endif
|
||||
@ -198,6 +210,9 @@ void cleanup_after_vm(supervisor_allocation* heap) {
|
||||
#if CIRCUITPY_DISPLAYIO
|
||||
reset_displays();
|
||||
#endif
|
||||
#if CIRCUITPY_MEMORYMONITOR
|
||||
memorymonitor_reset();
|
||||
#endif
|
||||
filesystem_flush();
|
||||
stop_mp();
|
||||
free_memory(heap);
|
||||
@ -316,6 +331,8 @@ bool run_code_py(safe_mode_t safe_mode) {
|
||||
}
|
||||
}
|
||||
|
||||
FIL* boot_output_file;
|
||||
|
||||
void __attribute__ ((noinline)) run_boot_py(safe_mode_t safe_mode) {
|
||||
// If not in safe mode, run boot before initing USB and capture output in a
|
||||
// file.
|
||||
|
@ -40,6 +40,7 @@
|
||||
|
||||
#define MICROPY_FLOAT_IMPL (MICROPY_FLOAT_IMPL_DOUBLE)
|
||||
#define MICROPY_CPYTHON_COMPAT (1)
|
||||
#define MICROPY_PY_ASYNC_AWAIT (1)
|
||||
#define MICROPY_USE_INTERNAL_PRINTF (0)
|
||||
|
||||
#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
|
||||
|
@ -13,6 +13,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1
|
||||
EXTERNAL_FLASH_DEVICES = GD25Q16C
|
||||
LONGINT_IMPL = MPZ
|
||||
|
||||
CIRCUITPY_NETWORK = 1
|
||||
MICROPY_PY_WIZNET5K = 5500
|
||||
CIRCUITPY_PS2IO = 1
|
||||
|
@ -12,6 +12,7 @@ EXTERNAL_FLASH_DEVICES = "W25Q32JV_IQ"
|
||||
LONGINT_IMPL = MPZ
|
||||
|
||||
CIRCUITPY_BITBANGIO = 0
|
||||
CIRCUITPY_COUNTIO = 0
|
||||
CIRCUITPY_FREQUENCYIO = 0
|
||||
CIRCUITPY_I2CPERIPHERAL = 0
|
||||
CIRCUITPY_VECTORIO = 0
|
||||
|
@ -11,6 +11,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2
|
||||
EXTERNAL_FLASH_DEVICES = "W25Q64JV_IQ, S25FL064L"
|
||||
LONGINT_IMPL = MPZ
|
||||
|
||||
CIRCUITPY_NETWORK = 1
|
||||
MICROPY_PY_WIZNET5K = 5500
|
||||
CIRCUITPY_PS2IO = 1
|
||||
|
@ -13,7 +13,6 @@ LONGINT_IMPL = MPZ
|
||||
CIRCUITPY_AUDIOBUSIO = 0
|
||||
CIRCUITPY_FRAMEBUFFERIO = 0
|
||||
CIRCUITPY_DISPLAYIO = 0
|
||||
CIRCUITPY_NETWORK = 0
|
||||
CIRCUITPY_RGBMATRIX = 0
|
||||
CIRCUITPY_PS2IO = 0
|
||||
CIRCUITPY_AUDIOMP3 = 0
|
||||
|
@ -10,38 +10,32 @@ INTERNAL_FLASH_FILESYSTEM = 1
|
||||
LONGINT_IMPL = NONE
|
||||
|
||||
CIRCUITPY_FULL_BUILD = 0
|
||||
# TODO: Turn off analogio for now for space reasons, but restore it
|
||||
# when frozen module gets smaller.
|
||||
CIRCUITPY_ANALOGIO = 0
|
||||
CIRCUITPY_AUDIOBUSIO = 0
|
||||
CIRCUITPY_AUDIOPWMIO = 0
|
||||
CIRCUITPY_AUDIOMP3 = 0
|
||||
CIRCUITPY_BITBANGIO = 0
|
||||
CIRCUITPY_BITBANG_APA102 = 0
|
||||
CIRCUITPY_FREQUENCYIO = 0
|
||||
CIRCUITPY_GAMEPADSHIFT = 0
|
||||
CIRCUITPY_I2CPERIPHERAL = 0
|
||||
CIRCUITPY_NEOPIXEL_WRITE = 0
|
||||
CIRCUITPY_NETWORK = 0
|
||||
CIRCUITPY_PIXELBUF = 0
|
||||
CIRCUITPY_PS2IO = 0
|
||||
CIRCUITPY_ROTARYIO = 0
|
||||
CIRCUITPY_RTC = 0
|
||||
CIRCUITPY_SAMD = 0
|
||||
CIRCUITPY_TOUCHIO = 0
|
||||
CIRCUITPY_USB_HID = 0
|
||||
CIRCUITPY_USB_MIDI = 0
|
||||
CIRCUITPY_AUDIOPWMIO = 0
|
||||
CIRCUITPY_AUDIOMP3 = 0
|
||||
CIRCUITPY_BITBANG_APA102 = 0
|
||||
CIRCUITPY_BLEIO = 0
|
||||
CIRCUITPY_GAMEPADSHIFT = 0
|
||||
CIRCUITPY_NETWORK = 0
|
||||
CIRCUITPY_ROTARYIO = 0
|
||||
CIRCUITPY_SAMD = 0
|
||||
CIRCUITPY_TOUCHIO = 0
|
||||
CIRCUITPY_VECTORIO = 0
|
||||
|
||||
CIRCUITPY_ANALOGIO = 1
|
||||
CIRCUITPY_AUDIOMIXER = 1
|
||||
CIRCUITPY_AUDIOIO = 1
|
||||
CIRCUITPY_DISPLAYIO = 1
|
||||
CIRCUITPY_GAMEPAD = 1
|
||||
CIRCUITPY_STAGE = 1
|
||||
CIRCUITPY_MATH = 1
|
||||
CIRCUITPY_STAGE = 1
|
||||
|
||||
FROZEN_MPY_DIRS += $(TOP)/frozen/circuitpython-stage/pewpew_m4
|
||||
CIRCUITPY_DISPLAY_FONT = $(TOP)/ports/atmel-samd/boards/ugame10/brutalist-6.bdf
|
||||
|
@ -12,6 +12,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1
|
||||
EXTERNAL_FLASH_DEVICES = AT25SF041A
|
||||
LONGINT_IMPL = MPZ
|
||||
|
||||
CIRCUITPY_NETWORK = 1
|
||||
MICROPY_PY_WIZNET5K = 5500
|
||||
CIRCUITPY_PS2IO = 1
|
||||
|
@ -10,9 +10,7 @@ INTERNAL_FLASH_FILESYSTEM = 1
|
||||
LONGINT_IMPL = NONE
|
||||
CIRCUITPY_FULL_BUILD = 0
|
||||
|
||||
# Tweak inlining depending on language.
|
||||
ifeq ($(TRANSLATION), zh_Latn_pinyin)
|
||||
# Always use aggressive inlining
|
||||
CFLAGS_INLINE_LIMIT = 45
|
||||
else
|
||||
CFLAGS_INLINE_LIMIT = 70
|
||||
endif
|
||||
|
||||
SUPEROPT_GC = 0
|
||||
|
@ -24,10 +24,13 @@ CIRCUITPY_BLEIO = 0
|
||||
CIRCUITPY_DISPLAYIO = 0
|
||||
CIRCUITPY_GAMEPAD = 0
|
||||
CIRCUITPY_I2CPERIPHERAL = 0
|
||||
CIRCUITPY_NETWORK = 0
|
||||
CIRCUITPY_TOUCHIO = 0
|
||||
CIRCUITPY_RGBMATRIX = 0
|
||||
CIRCUITPY_PS2IO = 0
|
||||
CIRCUITPY_USB_HID = 0
|
||||
CIRCUITPY_USB_MIDI = 0
|
||||
CIRCUITPY_RTC = 0
|
||||
|
||||
# Enable board-specific modules
|
||||
USER_C_MODULES = boards/winterbloom_big_honking_button/usermods
|
||||
CFLAGS += -DMODULE_BHB_ENABLED=1
|
||||
|
@ -0,0 +1,120 @@
|
||||
#include "py/obj.h"
|
||||
#include "py/runtime.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "samd/pins.h"
|
||||
#include "sam.h"
|
||||
|
||||
STATIC mp_obj_t _bhb_read_adc(void);
|
||||
|
||||
STATIC mp_obj_t _bhb_init_adc(void) {
|
||||
claim_pin(&pin_PB08);
|
||||
common_hal_never_reset_pin(&pin_PB08);
|
||||
|
||||
/* Enable the APB clock for the ADC. */
|
||||
PM->APBCMASK.reg |= PM_APBCMASK_ADC;
|
||||
|
||||
/* Enable GCLK0 for the ADC */
|
||||
GCLK->CLKCTRL.reg = GCLK_CLKCTRL_CLKEN |
|
||||
GCLK_CLKCTRL_GEN_GCLK0 |
|
||||
GCLK_CLKCTRL_ID_ADC;
|
||||
|
||||
/* Wait for bus synchronization. */
|
||||
while (GCLK->STATUS.bit.SYNCBUSY) {};
|
||||
|
||||
uint32_t bias = (*((uint32_t *) ADC_FUSES_BIASCAL_ADDR) & ADC_FUSES_BIASCAL_Msk) >> ADC_FUSES_BIASCAL_Pos;
|
||||
uint32_t linearity = (*((uint32_t *) ADC_FUSES_LINEARITY_0_ADDR) & ADC_FUSES_LINEARITY_0_Msk) >> ADC_FUSES_LINEARITY_0_Pos;
|
||||
linearity |= ((*((uint32_t *) ADC_FUSES_LINEARITY_1_ADDR) & ADC_FUSES_LINEARITY_1_Msk) >> ADC_FUSES_LINEARITY_1_Pos) << 5;
|
||||
|
||||
/* Wait for bus synchronization. */
|
||||
while (ADC->STATUS.bit.SYNCBUSY) {};
|
||||
|
||||
/* Write the calibration data. */
|
||||
ADC->CALIB.reg = ADC_CALIB_BIAS_CAL(bias) | ADC_CALIB_LINEARITY_CAL(linearity);
|
||||
|
||||
/* Use the internal VCC reference. This is 1/2 of what's on VCCA.
|
||||
since VCCA is 3.3v, this is 1.65v.
|
||||
*/
|
||||
ADC->REFCTRL.reg = ADC_REFCTRL_REFSEL_INTVCC1;
|
||||
|
||||
/* Capture 64 samples. */
|
||||
ADC->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_64 | ADC_AVGCTRL_ADJRES(4);
|
||||
|
||||
/* Set the clock prescaler to 32, which is the same as the CircuitPython default.
|
||||
Set the resolution to 16 for averaging
|
||||
*/
|
||||
ADC->CTRLB.reg = ADC_CTRLB_PRESCALER_DIV32 |
|
||||
ADC_CTRLB_RESSEL_16BIT;
|
||||
|
||||
/* Configure the input parameters.
|
||||
|
||||
- GAIN_DIV2 means that the input voltage is halved. This is important
|
||||
because the voltage reference is 1/2 of VCCA. So if you want to
|
||||
measure 0-3.3v, you need to halve the input as well.
|
||||
|
||||
- MUXNEG_GND means that the ADC should compare the input value to GND.
|
||||
|
||||
- MUXPOS_PIN3 means that the ADC should read from AIN2, or PB08.
|
||||
*/
|
||||
ADC->INPUTCTRL.reg = ADC_INPUTCTRL_GAIN_DIV2 |
|
||||
ADC_INPUTCTRL_MUXNEG_GND |
|
||||
ADC_INPUTCTRL_MUXPOS_PIN2;
|
||||
|
||||
|
||||
/* Set PB08 as an input pin. */
|
||||
PORT->Group[1].DIRCLR.reg = PORT_PB08;
|
||||
|
||||
/* Enable the peripheral multiplexer for PB08. */
|
||||
PORT->Group[1].PINCFG[8].reg |= PORT_PINCFG_PMUXEN;
|
||||
|
||||
/* Set PB08 to function B which is analog input. */
|
||||
PORT->Group[1].PMUX[4].reg |= PORT_PMUX_PMUXE_B;
|
||||
|
||||
/* Wait for bus synchronization. */
|
||||
while (ADC->STATUS.bit.SYNCBUSY) {};
|
||||
|
||||
/* Enable the ADC. */
|
||||
ADC->CTRLA.bit.ENABLE = true;
|
||||
|
||||
/* Make one read and throw it away, as per the datasheet. */
|
||||
_bhb_read_adc();
|
||||
|
||||
return mp_const_none;
|
||||
}
|
||||
|
||||
STATIC mp_obj_t _bhb_read_adc(void) {
|
||||
/* Wait for bus synchronization. */
|
||||
while (ADC->STATUS.bit.SYNCBUSY) {};
|
||||
|
||||
/* Start the ADC using a software trigger. */
|
||||
ADC->SWTRIG.bit.START = true;
|
||||
|
||||
/* Wait for the result ready flag to be set. */
|
||||
while (ADC->INTFLAG.bit.RESRDY == 0);
|
||||
|
||||
/* Clear the flag. */
|
||||
ADC->INTFLAG.reg = ADC_INTFLAG_RESRDY;
|
||||
|
||||
/* Read the value. */
|
||||
uint32_t result = ADC->RESULT.reg;
|
||||
|
||||
return MP_OBJ_NEW_SMALL_INT(result);
|
||||
}
|
||||
|
||||
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_0(_bhb_init_adc_obj, _bhb_init_adc);
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_0(_bhb_read_adc_obj, _bhb_read_adc);
|
||||
|
||||
STATIC const mp_rom_map_elem_t _bhb_module_globals_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR__bhb) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_init_adc), MP_ROM_PTR(&_bhb_init_adc_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_read_adc), MP_ROM_PTR(&_bhb_read_adc_obj) },
|
||||
};
|
||||
|
||||
STATIC MP_DEFINE_CONST_DICT(_bhb_module_globals, _bhb_module_globals_table);
|
||||
|
||||
const mp_obj_module_t _bhb_user_cmodule = {
|
||||
.base = { &mp_type_module },
|
||||
.globals = (mp_obj_dict_t*)&_bhb_module_globals,
|
||||
};
|
||||
|
||||
MP_REGISTER_MODULE(MP_QSTR__bhb, _bhb_user_cmodule, MODULE_BHB_ENABLED);
|
@ -0,0 +1,6 @@
|
||||
USERMODULES_DIR := $(USERMOD_DIR)
|
||||
|
||||
# Add all C files to SRC_USERMOD.
|
||||
SRC_USERMOD += $(USERMODULES_DIR)/bhb.c
|
||||
|
||||
CFLAGS_USERMOD += -I$(USERMODULES_DIR)
|
@ -23,7 +23,6 @@ CIRCUITPY_DISPLAYIO = 0
|
||||
CIRCUITPY_FRAMEBUFFERIO = 0
|
||||
CIRCUITPY_GAMEPAD = 0
|
||||
CIRCUITPY_I2CPERIPHERAL = 0
|
||||
CIRCUITPY_NETWORK = 0
|
||||
CIRCUITPY_TOUCHIO = 0
|
||||
CIRCUITPY_RGBMATRIX = 0
|
||||
CIRCUITPY_PS2IO = 0
|
||||
|
@ -54,8 +54,7 @@ CIRCUITPY_TOUCHIO_USE_NATIVE = 0
|
||||
# The ifndef's allow overriding in mpconfigboard.mk.
|
||||
|
||||
ifndef CIRCUITPY_NETWORK
|
||||
CIRCUITPY_NETWORK = 1
|
||||
MICROPY_PY_WIZNET5K = 5500
|
||||
CIRCUITPY_NETWORK = 0
|
||||
endif
|
||||
|
||||
ifndef CIRCUITPY_PS2IO
|
||||
|
@ -37,8 +37,8 @@
|
||||
#define mp_hal_ticks_ms() ((mp_uint_t) supervisor_ticks_ms32())
|
||||
|
||||
// Number of bytes in receive buffer
|
||||
volatile uint8_t usb_rx_count;
|
||||
volatile bool mp_cdc_enabled;
|
||||
extern volatile uint8_t usb_rx_count;
|
||||
extern volatile bool mp_cdc_enabled;
|
||||
|
||||
int receive_usb(void);
|
||||
|
||||
|
@ -270,7 +270,7 @@ esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h
|
||||
|
||||
$(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp
|
||||
$(STEPECHO) "LINK $@"
|
||||
$(Q)$(CC) -o $@ $(LDFLAGS) $^ $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) build-$(BOARD)/esp-idf/esp-idf/newlib/libnewlib.a -u newlib_include_pthread_impl
|
||||
$(Q)$(CC) -o $@ $(LDFLAGS) $^ $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) build-$(BOARD)/esp-idf/esp-idf/newlib/libnewlib.a -u newlib_include_pthread_impl -Wl,--start-group $(LIBS) -Wl,--end-group
|
||||
# $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(BUILD)/esp-idf/esp-idf/esp32s2/esp32s2_out.ld
|
||||
|
||||
$(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf
|
||||
|
198
ports/esp32s2/common-hal/pulseio/PWMOut.c
Normal file
198
ports/esp32s2/common-hal/pulseio/PWMOut.c
Normal file
@ -0,0 +1,198 @@
|
||||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 Lucian Copeland for Adafruit Industries
|
||||
* Uses code from Micropython, Copyright (c) 2013-2016 Damien P. George
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include <math.h>
|
||||
|
||||
#include "common-hal/pulseio/PWMOut.h"
|
||||
#include "shared-bindings/pulseio/PWMOut.h"
|
||||
#include "py/runtime.h"
|
||||
#include "driver/ledc.h"
|
||||
|
||||
#define INDEX_EMPTY 0xFF
|
||||
|
||||
STATIC uint32_t reserved_timer_freq[LEDC_TIMER_MAX];
|
||||
STATIC uint8_t reserved_channels[LEDC_CHANNEL_MAX];
|
||||
STATIC bool never_reset_tim[LEDC_TIMER_MAX];
|
||||
STATIC bool never_reset_chan[LEDC_CHANNEL_MAX];
|
||||
|
||||
void pwmout_reset(void) {
|
||||
for (size_t i = 0; i < LEDC_CHANNEL_MAX; i++ ) {
|
||||
ledc_stop(LEDC_LOW_SPEED_MODE, i, 0);
|
||||
if (!never_reset_chan[i]) {
|
||||
reserved_channels[i] = INDEX_EMPTY;
|
||||
}
|
||||
}
|
||||
for (size_t i = 0; i < LEDC_TIMER_MAX; i++ ) {
|
||||
ledc_timer_rst(LEDC_LOW_SPEED_MODE, i);
|
||||
if (!never_reset_tim[i]) {
|
||||
reserved_timer_freq[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
|
||||
const mcu_pin_obj_t* pin,
|
||||
uint16_t duty,
|
||||
uint32_t frequency,
|
||||
bool variable_frequency) {
|
||||
// Calculate duty cycle
|
||||
uint32_t duty_bits = 0;
|
||||
uint32_t interval = LEDC_APB_CLK_HZ/frequency;
|
||||
for (size_t i = 0; i < 32; i++) {
|
||||
if(!(interval >> i)) {
|
||||
duty_bits = i - 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (duty_bits < 1) {
|
||||
mp_raise_ValueError(translate("Invalid frequency"));
|
||||
} else if (duty_bits >= LEDC_TIMER_14_BIT) {
|
||||
duty_bits = LEDC_TIMER_13_BIT;
|
||||
}
|
||||
|
||||
// Find a viable timer
|
||||
size_t timer_index = INDEX_EMPTY;
|
||||
size_t channel_index = INDEX_EMPTY;
|
||||
for (size_t i = 0; i < LEDC_TIMER_MAX; i++) {
|
||||
if ((reserved_timer_freq[i] == frequency) && !variable_frequency) {
|
||||
//prioritize matched frequencies so we don't needlessly take slots
|
||||
timer_index = i;
|
||||
break;
|
||||
} else if (reserved_timer_freq[i] == 0) {
|
||||
timer_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (timer_index == INDEX_EMPTY) {
|
||||
// Running out of timers isn't pin related on ESP32S2 so we can't re-use error messages
|
||||
mp_raise_ValueError(translate("No more timers available"));
|
||||
}
|
||||
|
||||
// Find a viable channel
|
||||
for (size_t i = 0; i < LEDC_CHANNEL_MAX; i++) {
|
||||
if (reserved_channels[i] == INDEX_EMPTY) {
|
||||
channel_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (channel_index == INDEX_EMPTY) {
|
||||
mp_raise_ValueError(translate("No more channels available"));
|
||||
}
|
||||
|
||||
// Run configuration
|
||||
self->tim_handle.timer_num = timer_index;
|
||||
self->tim_handle.duty_resolution = duty_bits;
|
||||
self->tim_handle.freq_hz = frequency;
|
||||
self->tim_handle.speed_mode = LEDC_LOW_SPEED_MODE;
|
||||
self->tim_handle.clk_cfg = LEDC_AUTO_CLK;
|
||||
|
||||
if (ledc_timer_config(&(self->tim_handle)) != ESP_OK) {
|
||||
mp_raise_ValueError(translate("Could not initialize timer"));
|
||||
}
|
||||
|
||||
self->chan_handle.channel = channel_index;
|
||||
self->chan_handle.duty = duty >> (16 - duty_bits);
|
||||
self->chan_handle.gpio_num = pin->number;
|
||||
self->chan_handle.speed_mode = LEDC_LOW_SPEED_MODE; // Only LS is allowed on ESP32-S2
|
||||
self->chan_handle.hpoint = 0;
|
||||
self->chan_handle.timer_sel = timer_index;
|
||||
|
||||
if (ledc_channel_config(&(self->chan_handle))) {
|
||||
mp_raise_ValueError(translate("Could not initialize channel"));
|
||||
}
|
||||
|
||||
// Make reservations
|
||||
reserved_timer_freq[timer_index] = frequency;
|
||||
reserved_channels[channel_index] = timer_index;
|
||||
|
||||
self->variable_frequency = variable_frequency;
|
||||
self->pin_number = pin->number;
|
||||
self->deinited = false;
|
||||
self->duty_resolution = duty_bits;
|
||||
claim_pin(pin);
|
||||
|
||||
// Set initial duty
|
||||
common_hal_pulseio_pwmout_set_duty_cycle(self, duty);
|
||||
|
||||
return PWMOUT_OK;
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
|
||||
never_reset_tim[self->tim_handle.timer_num] = true;
|
||||
never_reset_chan[self->chan_handle.channel] = true;
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) {
|
||||
never_reset_tim[self->tim_handle.timer_num] = false;
|
||||
never_reset_chan[self->chan_handle.channel] = false;
|
||||
}
|
||||
|
||||
bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) {
|
||||
return self->deinited == true;
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
|
||||
if (common_hal_pulseio_pwmout_deinited(self)) {
|
||||
return;
|
||||
}
|
||||
ledc_stop(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, 0);
|
||||
// Search if any other channel is using the timer
|
||||
bool taken = false;
|
||||
for (size_t i =0; i < LEDC_CHANNEL_MAX; i++) {
|
||||
if (reserved_channels[i] == self->tim_handle.timer_num) {
|
||||
taken = true;
|
||||
}
|
||||
}
|
||||
// Variable frequency means there's only one channel on the timer
|
||||
if (!taken || self->variable_frequency) {
|
||||
ledc_timer_rst(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num);
|
||||
reserved_timer_freq[self->tim_handle.timer_num] = 0;
|
||||
}
|
||||
reset_pin_number(self->pin_number);
|
||||
reserved_channels[self->chan_handle.channel] = INDEX_EMPTY;
|
||||
self->deinited = true;
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) {
|
||||
ledc_set_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, duty >> (16 - self->duty_resolution));
|
||||
ledc_update_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel);
|
||||
}
|
||||
|
||||
uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) {
|
||||
return ledc_get_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel) << (16 - self->duty_resolution);
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) {
|
||||
ledc_set_freq(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num, frequency);
|
||||
}
|
||||
|
||||
uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {
|
||||
return ledc_get_freq(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num);
|
||||
}
|
||||
|
||||
bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) {
|
||||
return self->variable_frequency;
|
||||
}
|
45
ports/esp32s2/common-hal/pulseio/PWMOut.h
Normal file
45
ports/esp32s2/common-hal/pulseio/PWMOut.h
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 Lucian Copeland for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H
|
||||
#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H
|
||||
|
||||
#include "common-hal/microcontroller/Pin.h"
|
||||
#include "driver/ledc.h"
|
||||
|
||||
typedef struct {
|
||||
mp_obj_base_t base;
|
||||
ledc_timer_config_t tim_handle;
|
||||
ledc_channel_config_t chan_handle;
|
||||
uint16_t pin_number;
|
||||
uint8_t duty_resolution;
|
||||
bool variable_frequency: 1;
|
||||
bool deinited: 1;
|
||||
} pulseio_pwmout_obj_t;
|
||||
|
||||
void pwmout_reset(void);
|
||||
|
||||
#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H
|
75
ports/esp32s2/common-hal/pulseio/PulseIn.c
Normal file
75
ports/esp32s2/common-hal/pulseio/PulseIn.c
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Lucian Copeland for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "common-hal/pulseio/PulseIn.h"
|
||||
#include "py/runtime.h"
|
||||
|
||||
// STATIC void pulsein_handler(uint8_t num) {
|
||||
// }
|
||||
|
||||
void pulsein_reset(void) {
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin,
|
||||
uint16_t maxlen, bool idle_state) {
|
||||
mp_raise_NotImplementedError(translate("PulseIn not supported on this chip"));
|
||||
}
|
||||
|
||||
bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) {
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pulsein_pause(pulseio_pulsein_obj_t* self) {
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t* self, uint16_t trigger_duration) {
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pulsein_clear(pulseio_pulsein_obj_t* self) {
|
||||
}
|
||||
|
||||
uint16_t common_hal_pulseio_pulsein_get_item(pulseio_pulsein_obj_t* self, int16_t index) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t common_hal_pulseio_pulsein_popleft(pulseio_pulsein_obj_t* self) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t common_hal_pulseio_pulsein_get_maxlen(pulseio_pulsein_obj_t* self) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool common_hal_pulseio_pulsein_get_paused(pulseio_pulsein_obj_t* self) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16_t common_hal_pulseio_pulsein_get_len(pulseio_pulsein_obj_t* self) {
|
||||
return false;
|
||||
}
|
53
ports/esp32s2/common-hal/pulseio/PulseIn.h
Normal file
53
ports/esp32s2/common-hal/pulseio/PulseIn.h
Normal file
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 Lucian Copeland for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEIN_H
|
||||
#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEIN_H
|
||||
|
||||
#include "common-hal/microcontroller/Pin.h"
|
||||
|
||||
#include "py/obj.h"
|
||||
|
||||
typedef struct {
|
||||
mp_obj_base_t base;
|
||||
|
||||
const mcu_pin_obj_t* pin;
|
||||
bool idle_state;
|
||||
bool paused;
|
||||
volatile bool first_edge;
|
||||
|
||||
uint16_t* buffer;
|
||||
uint16_t maxlen;
|
||||
|
||||
volatile uint16_t start;
|
||||
volatile uint16_t len;
|
||||
volatile uint32_t last_overflow;
|
||||
volatile uint16_t last_count;
|
||||
} pulseio_pulsein_obj_t;
|
||||
|
||||
void pulsein_reset(void);
|
||||
|
||||
#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEIN_H
|
60
ports/esp32s2/common-hal/pulseio/PulseOut.c
Normal file
60
ports/esp32s2/common-hal/pulseio/PulseOut.c
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 Lucian Copeland for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "common-hal/pulseio/PulseOut.h"
|
||||
|
||||
#include "shared-bindings/pulseio/PWMOut.h"
|
||||
#include "py/runtime.h"
|
||||
|
||||
// STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) {
|
||||
// }
|
||||
|
||||
// STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) {
|
||||
// }
|
||||
|
||||
// STATIC void start_timer(void) {
|
||||
// }
|
||||
|
||||
// STATIC void pulseout_event_handler(void) {
|
||||
// }
|
||||
|
||||
void pulseout_reset() {
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
|
||||
const pulseio_pwmout_obj_t* carrier) {
|
||||
mp_raise_NotImplementedError(translate("PulseOut not supported on this chip"));
|
||||
}
|
||||
|
||||
bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) {
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pulses, uint16_t length) {
|
||||
}
|
42
ports/esp32s2/common-hal/pulseio/PulseOut.h
Normal file
42
ports/esp32s2/common-hal/pulseio/PulseOut.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* This file is part of the MicroPython project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2019 Lucian Copeland for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H
|
||||
#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H
|
||||
|
||||
#include "common-hal/microcontroller/Pin.h"
|
||||
#include "common-hal/pulseio/PWMOut.h"
|
||||
|
||||
#include "py/obj.h"
|
||||
|
||||
typedef struct {
|
||||
mp_obj_base_t base;
|
||||
pulseio_pwmout_obj_t *pwmout;
|
||||
} pulseio_pulseout_obj_t;
|
||||
|
||||
void pulseout_reset(void);
|
||||
|
||||
#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H
|
1
ports/esp32s2/common-hal/pulseio/__init__.c
Normal file
1
ports/esp32s2/common-hal/pulseio/__init__.c
Normal file
@ -0,0 +1 @@
|
||||
// No pulseio module functions.
|
@ -25,7 +25,7 @@ CIRCUITPY_FREQUENCYIO = 0
|
||||
CIRCUITPY_I2CPERIPHERAL = 0
|
||||
CIRCUITPY_MICROCONTROLLER = 1
|
||||
CIRCUITPY_NVM = 0
|
||||
CIRCUITPY_PULSEIO = 0
|
||||
CIRCUITPY_PULSEIO = 1
|
||||
CIRCUITPY_ROTARYIO = 0
|
||||
CIRCUITPY_RTC = 0
|
||||
CIRCUITPY_TOUCHIO = 0
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "common-hal/busio/I2C.h"
|
||||
#include "common-hal/busio/SPI.h"
|
||||
#include "common-hal/busio/UART.h"
|
||||
#include "common-hal/pulseio/PWMOut.h"
|
||||
#include "supervisor/memory.h"
|
||||
#include "supervisor/shared/tick.h"
|
||||
|
||||
@ -64,6 +65,9 @@ void reset_port(void) {
|
||||
// A larger delay so the idle task can run and do any IDF cleanup needed.
|
||||
vTaskDelay(4);
|
||||
|
||||
#if CIRCUITPY_PULSEIO
|
||||
pwmout_reset();
|
||||
#endif
|
||||
#if CIRCUITPY_BUSIO
|
||||
i2c_reset();
|
||||
spi_reset();
|
||||
|
@ -41,12 +41,19 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) {
|
||||
claimed_pins[pin_port] &= ~(1<<pin_number);
|
||||
}
|
||||
|
||||
void common_hal_reset_pin(const mcu_pin_obj_t* pin) {
|
||||
reset_pin_number(0, pin->number);
|
||||
}
|
||||
|
||||
void claim_pin(const mcu_pin_obj_t* pin) {
|
||||
// Set bit in claimed_pins bitmask.
|
||||
claimed_pins[0] |= 1<<pin->number;
|
||||
}
|
||||
|
||||
void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) {
|
||||
claim_pin(pin);
|
||||
}
|
||||
|
||||
bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) {
|
||||
return !(claimed_pins[pin_port] & 1<<pin_number);
|
||||
}
|
||||
|
@ -8,7 +8,3 @@ MCU_CHIP = nrf52840
|
||||
QSPI_FLASH_FILESYSTEM = 1
|
||||
EXTERNAL_FLASH_DEVICE_COUNT = 1
|
||||
EXTERNAL_FLASH_DEVICES = "MX25L3233F"
|
||||
|
||||
# Support for the Ethernet FeatherWing
|
||||
CIRCUITPY_NETWORK = 1
|
||||
MICROPY_PY_WIZNET5K = 5500
|
||||
|
@ -8,7 +8,3 @@ MCU_CHIP = nrf52840
|
||||
QSPI_FLASH_FILESYSTEM = 1
|
||||
EXTERNAL_FLASH_DEVICE_COUNT = 1
|
||||
EXTERNAL_FLASH_DEVICES = "MX25L3233F"
|
||||
|
||||
# Support for the Ethernet FeatherWing
|
||||
CIRCUITPY_NETWORK = 1
|
||||
MICROPY_PY_WIZNET5K = 5500
|
||||
|
@ -8,7 +8,3 @@ MCU_CHIP = nrf52840
|
||||
QSPI_FLASH_FILESYSTEM = 1
|
||||
EXTERNAL_FLASH_DEVICE_COUNT = 1
|
||||
EXTERNAL_FLASH_DEVICES = "MX25L3233F"
|
||||
|
||||
# Support for the Ethernet FeatherWing
|
||||
CIRCUITPY_NETWORK = 1
|
||||
MICROPY_PY_WIZNET5K = 5500
|
||||
|
@ -207,6 +207,7 @@ SRC_C += \
|
||||
mphalport.c \
|
||||
boards/$(BOARD)/board.c \
|
||||
boards/$(BOARD)/pins.c \
|
||||
peripherals/timers.c \
|
||||
peripherals/stm32$(MCU_SERIES_LOWER)/clocks.c \
|
||||
peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/pins.c \
|
||||
peripherals/stm32$(MCU_SERIES_LOWER)/$(MCU_VARIANT_LOWER)/gpio.c \
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "py/runtime.h"
|
||||
#include "supervisor/shared/translate.h"
|
||||
|
||||
#include "common-hal/microcontroller/Pin.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
|
||||
#include "stm32f4xx_hal.h"
|
||||
#include "stm32f4xx_ll_gpio.h"
|
||||
@ -57,7 +57,7 @@ void common_hal_analogio_analogin_construct(analogio_analogin_obj_t* self,
|
||||
} else {
|
||||
mp_raise_ValueError(translate("Invalid ADC Unit value"));
|
||||
}
|
||||
claim_pin(pin);
|
||||
common_hal_mcu_pin_claim(pin);
|
||||
self->pin = pin;
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self,
|
||||
|
||||
dac_on[self->dac_index] = true;
|
||||
self->pin = pin;
|
||||
claim_pin(pin);
|
||||
common_hal_mcu_pin_claim(pin);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
|
||||
#include "shared-bindings/microcontroller/__init__.h"
|
||||
#include "supervisor/shared/translate.h"
|
||||
#include "common-hal/microcontroller/Pin.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
|
||||
// I2C timing specs for the H7 and F7
|
||||
// Configured for maximum possible clock settings for the family
|
||||
@ -161,8 +161,8 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
|
||||
if (HAL_I2C_Init(&(self->handle)) != HAL_OK) {
|
||||
mp_raise_RuntimeError(translate("I2C Init Error"));
|
||||
}
|
||||
claim_pin(sda);
|
||||
claim_pin(scl);
|
||||
common_hal_mcu_pin_claim(sda);
|
||||
common_hal_mcu_pin_claim(scl);
|
||||
}
|
||||
|
||||
void common_hal_busio_i2c_never_reset(busio_i2c_obj_t *self) {
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "shared-bindings/microcontroller/__init__.h"
|
||||
#include "boards/board.h"
|
||||
#include "supervisor/shared/translate.h"
|
||||
#include "common-hal/microcontroller/Pin.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
|
||||
// Note that any bugs introduced in this file can cause crashes at startup
|
||||
// for chips using external SPI flash.
|
||||
@ -233,12 +233,12 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
|
||||
self->phase = 0;
|
||||
self->bits = 8;
|
||||
|
||||
claim_pin(sck);
|
||||
common_hal_mcu_pin_claim(sck);
|
||||
if (self->mosi != NULL) {
|
||||
claim_pin(mosi);
|
||||
common_hal_mcu_pin_claim(mosi);
|
||||
}
|
||||
if (self->miso != NULL) {
|
||||
claim_pin(miso);
|
||||
common_hal_mcu_pin_claim(miso);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "shared-bindings/microcontroller/__init__.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-bindings/busio/UART.h"
|
||||
|
||||
#include "mpconfigport.h"
|
||||
@ -224,10 +225,10 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
|
||||
mp_raise_ValueError(translate("UART Buffer allocation error"));
|
||||
}
|
||||
}
|
||||
claim_pin(rx);
|
||||
common_hal_mcu_pin_claim(rx);
|
||||
}
|
||||
if (self->tx != NULL) {
|
||||
claim_pin(tx);
|
||||
common_hal_mcu_pin_claim(tx);
|
||||
}
|
||||
self->baudrate = baudrate;
|
||||
self->timeout_ms = timeout * 1000;
|
||||
|
@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "shared-bindings/digitalio/DigitalInOut.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "py/runtime.h"
|
||||
#include "supervisor/shared/translate.h"
|
||||
|
||||
@ -46,7 +47,7 @@ void common_hal_digitalio_digitalinout_never_reset(
|
||||
digitalinout_result_t common_hal_digitalio_digitalinout_construct(
|
||||
digitalio_digitalinout_obj_t *self, const mcu_pin_obj_t *pin) {
|
||||
|
||||
claim_pin(pin);
|
||||
common_hal_mcu_pin_claim(pin);
|
||||
self->pin = pin;
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
|
@ -89,6 +89,8 @@ void reset_pin_number(uint8_t pin_port, uint8_t pin_number) {
|
||||
|
||||
void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number) {
|
||||
never_reset_pins[pin_port] |= 1<<pin_number;
|
||||
// Make sure never reset pins are also always claimed
|
||||
claimed_pins[pin_port] |= 1<<pin_number;
|
||||
}
|
||||
|
||||
void common_hal_never_reset_pin(const mcu_pin_obj_t* pin) {
|
||||
@ -99,15 +101,9 @@ void common_hal_reset_pin(const mcu_pin_obj_t* pin) {
|
||||
reset_pin_number(pin->port, pin->number);
|
||||
}
|
||||
|
||||
void claim_pin(const mcu_pin_obj_t* pin) {
|
||||
void claim_pin(uint8_t pin_port, uint8_t pin_number) {
|
||||
// Set bit in claimed_pins bitmask.
|
||||
claimed_pins[pin->port] |= 1<<pin->number;
|
||||
|
||||
#ifdef MICROPY_HW_NEOPIXEL
|
||||
if (pin == MICROPY_HW_NEOPIXEL) {
|
||||
neopixel_in_use = true;
|
||||
}
|
||||
#endif
|
||||
claimed_pins[pin_port] |= 1<<pin_number;
|
||||
}
|
||||
|
||||
bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number) {
|
||||
@ -137,7 +133,12 @@ uint8_t common_hal_mcu_pin_number(const mcu_pin_obj_t* pin) {
|
||||
}
|
||||
|
||||
void common_hal_mcu_pin_claim(const mcu_pin_obj_t* pin) {
|
||||
claim_pin(pin);
|
||||
claim_pin(pin->port, pin->number);
|
||||
#ifdef MICROPY_HW_NEOPIXEL
|
||||
if (pin == MICROPY_HW_NEOPIXEL) {
|
||||
neopixel_in_use = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void common_hal_mcu_pin_reset_number(uint8_t pin_no) {
|
||||
|
@ -43,7 +43,7 @@ void reset_all_pins(void);
|
||||
// reset_pin_number takes the pin number instead of the pointer so that objects don't
|
||||
// need to store a full pointer.
|
||||
void reset_pin_number(uint8_t pin_port, uint8_t pin_number);
|
||||
void claim_pin(const mcu_pin_obj_t* pin);
|
||||
void claim_pin(uint8_t pin_port, uint8_t pin_number);
|
||||
bool pin_number_is_free(uint8_t pin_port, uint8_t pin_number);
|
||||
void never_reset_pin_number(uint8_t pin_port, uint8_t pin_number);
|
||||
GPIO_TypeDef * pin_port(uint8_t pin_port);
|
||||
|
@ -33,7 +33,9 @@
|
||||
|
||||
#include "shared-bindings/microcontroller/__init__.h"
|
||||
#include STM32_HAL_H
|
||||
#include "common-hal/microcontroller/Pin.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
|
||||
#include "timers.h"
|
||||
|
||||
#define ALL_CLOCKS 0xFFFF
|
||||
|
||||
@ -41,32 +43,6 @@ STATIC uint8_t reserved_tim[TIM_BANK_ARRAY_LEN];
|
||||
STATIC uint32_t tim_frequencies[TIM_BANK_ARRAY_LEN];
|
||||
STATIC bool never_reset_tim[TIM_BANK_ARRAY_LEN];
|
||||
|
||||
STATIC void tim_clock_enable(uint16_t mask);
|
||||
STATIC void tim_clock_disable(uint16_t mask);
|
||||
|
||||
// Get the frequency (in Hz) of the source clock for the given timer.
|
||||
// On STM32F405/407/415/417 there are 2 cases for how the clock freq is set.
|
||||
// If the APB prescaler is 1, then the timer clock is equal to its respective
|
||||
// APB clock. Otherwise (APB prescaler > 1) the timer clock is twice its
|
||||
// respective APB clock. See DM00031020 Rev 4, page 115.
|
||||
STATIC uint32_t timer_get_source_freq(uint32_t tim_id) {
|
||||
uint32_t source, clk_div;
|
||||
if (tim_id == 1 || (8 <= tim_id && tim_id <= 11)) {
|
||||
// TIM{1,8,9,10,11} are on APB2
|
||||
source = HAL_RCC_GetPCLK2Freq();
|
||||
clk_div = RCC->CFGR & RCC_CFGR_PPRE2;
|
||||
} else {
|
||||
// TIM{2,3,4,5,6,7,12,13,14} are on APB1
|
||||
source = HAL_RCC_GetPCLK1Freq();
|
||||
clk_div = RCC->CFGR & RCC_CFGR_PPRE1;
|
||||
}
|
||||
if (clk_div != 0) {
|
||||
// APB prescaler for this timer is > 1
|
||||
source *= 2;
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
STATIC uint32_t timer_get_internal_duty(uint16_t duty, uint32_t period) {
|
||||
//duty cycle is duty/0xFFFF fraction x (number of pulses per period)
|
||||
return (duty*period) / ((1 << 16) - 1);
|
||||
@ -97,7 +73,6 @@ void pwmout_reset(void) {
|
||||
never_reset_mask |= 1 << i;
|
||||
}
|
||||
}
|
||||
tim_clock_disable(ALL_CLOCKS & ~(never_reset_mask));
|
||||
}
|
||||
|
||||
pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
|
||||
@ -107,6 +82,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
|
||||
bool variable_frequency) {
|
||||
TIM_TypeDef * TIMx;
|
||||
uint8_t tim_num = MP_ARRAY_SIZE(mcu_tim_pin_list);
|
||||
bool tim_taken_internal = false;
|
||||
bool tim_chan_taken = false;
|
||||
bool tim_taken_f_mismatch = false;
|
||||
bool var_freq_mismatch = false;
|
||||
@ -119,8 +95,13 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
|
||||
|
||||
//if pin is same
|
||||
if (l_tim->pin == pin) {
|
||||
//check if the timer has a channel active
|
||||
//check if the timer has a channel active, or is reserved by main timer system
|
||||
if (reserved_tim[l_tim_index] != 0) {
|
||||
// Timer has already been reserved by an internal module
|
||||
if (stm_peripherals_timer_is_reserved(mcu_tim_banks[l_tim_index])) {
|
||||
tim_taken_internal = true;
|
||||
continue; //keep looking
|
||||
}
|
||||
//is it the same channel? (or all channels reserved by a var-freq)
|
||||
if (reserved_tim[l_tim_index] & 1 << (l_tim_channel)) {
|
||||
tim_chan_taken = true;
|
||||
@ -155,9 +136,12 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
|
||||
reserved_tim[self->tim->tim_index - 1] |= 1 << (self->tim->channel_index - 1);
|
||||
}
|
||||
tim_frequencies[self->tim->tim_index - 1] = frequency;
|
||||
stm_peripherals_timer_reserve(TIMx);
|
||||
} else { //no match found
|
||||
if (tim_chan_taken) {
|
||||
mp_raise_ValueError(translate("No more timers available on this pin."));
|
||||
} else if (tim_taken_internal) {
|
||||
mp_raise_ValueError(translate("Timer was reserved for internal use - declare PWM pins earlier in the program"));
|
||||
} else if (tim_taken_f_mismatch) {
|
||||
mp_raise_ValueError(translate("Frequency must match existing PWMOut using this timer"));
|
||||
} else if (var_freq_mismatch) {
|
||||
@ -182,8 +166,8 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
|
||||
|
||||
uint32_t prescaler = 0; //prescaler is 15 bit
|
||||
uint32_t period = 0; //period is 16 bit
|
||||
timer_get_optimal_divisors(&period, &prescaler, frequency,
|
||||
timer_get_source_freq(self->tim->tim_index));
|
||||
uint32_t source_freq = stm_peripherals_timer_get_source_freq(TIMx);
|
||||
timer_get_optimal_divisors(&period, &prescaler, frequency, source_freq);
|
||||
|
||||
//Timer init
|
||||
self->handle.Instance = TIMx;
|
||||
@ -260,7 +244,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
|
||||
//if reserved timer has no active channels, we can disable it
|
||||
if (!reserved_tim[self->tim->tim_index - 1]) {
|
||||
tim_frequencies[self->tim->tim_index - 1] = 0x00;
|
||||
tim_clock_disable(1 << (self->tim->tim_index - 1));
|
||||
stm_peripherals_timer_free(self->handle.Instance);
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,8 +266,8 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_
|
||||
|
||||
uint32_t prescaler = 0;
|
||||
uint32_t period = 0;
|
||||
timer_get_optimal_divisors(&period, &prescaler, frequency,
|
||||
timer_get_source_freq(self->tim->tim_index));
|
||||
uint32_t source_freq = stm_peripherals_timer_get_source_freq(self->handle.Instance);
|
||||
timer_get_optimal_divisors(&period, &prescaler, frequency, source_freq);
|
||||
|
||||
//shut down
|
||||
HAL_TIM_PWM_Stop(&self->handle, self->channel);
|
||||
@ -318,131 +302,3 @@ uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {
|
||||
bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) {
|
||||
return self->variable_frequency;
|
||||
}
|
||||
|
||||
STATIC void tim_clock_enable(uint16_t mask) {
|
||||
#ifdef TIM1
|
||||
if (mask & (1 << 0)) {
|
||||
__HAL_RCC_TIM1_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM2
|
||||
if (mask & (1 << 1)) {
|
||||
__HAL_RCC_TIM2_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM3
|
||||
if (mask & (1 << 2)) {
|
||||
__HAL_RCC_TIM3_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM4
|
||||
if (mask & (1 << 3)) {
|
||||
__HAL_RCC_TIM4_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM5
|
||||
if (mask & (1 << 4)) {
|
||||
__HAL_RCC_TIM5_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
//6 and 7 are reserved ADC timers
|
||||
#ifdef TIM8
|
||||
if (mask & (1 << 7)) {
|
||||
__HAL_RCC_TIM8_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM9
|
||||
if (mask & (1 << 8)) {
|
||||
__HAL_RCC_TIM9_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM10
|
||||
if (mask & (1 << 9)) {
|
||||
__HAL_RCC_TIM10_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM11
|
||||
if (mask & (1 << 10)) {
|
||||
__HAL_RCC_TIM11_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM12
|
||||
if (mask & (1 << 11)) {
|
||||
__HAL_RCC_TIM12_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM13
|
||||
if (mask & (1 << 12)) {
|
||||
__HAL_RCC_TIM13_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM14
|
||||
if (mask & (1 << 13)) {
|
||||
__HAL_RCC_TIM14_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
STATIC void tim_clock_disable(uint16_t mask) {
|
||||
#ifdef TIM1
|
||||
if (mask & (1 << 0)) {
|
||||
__HAL_RCC_TIM1_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM2
|
||||
if (mask & (1 << 1)) {
|
||||
__HAL_RCC_TIM2_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM3
|
||||
if (mask & (1 << 2)) {
|
||||
__HAL_RCC_TIM3_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM4
|
||||
if (mask & (1 << 3)) {
|
||||
__HAL_RCC_TIM4_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM5
|
||||
if (mask & (1 << 4)) {
|
||||
__HAL_RCC_TIM5_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
//6 and 7 are reserved ADC timers
|
||||
#ifdef TIM8
|
||||
if (mask & (1 << 7)) {
|
||||
__HAL_RCC_TIM8_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM9
|
||||
if (mask & (1 << 8)) {
|
||||
__HAL_RCC_TIM9_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM10
|
||||
if (mask & (1 << 9)) {
|
||||
__HAL_RCC_TIM10_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM11
|
||||
if (mask & (1 << 10)) {
|
||||
__HAL_RCC_TIM11_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM12
|
||||
if (mask & (1 << 11)) {
|
||||
__HAL_RCC_TIM12_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM13
|
||||
if (mask & (1 << 12)) {
|
||||
__HAL_RCC_TIM13_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM14
|
||||
if (mask & (1 << 13)) {
|
||||
__HAL_RCC_TIM14_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -31,40 +31,38 @@
|
||||
#include "py/gc.h"
|
||||
#include "py/runtime.h"
|
||||
#include "shared-bindings/microcontroller/__init__.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "shared-bindings/pulseio/PulseIn.h"
|
||||
#include "timers.h"
|
||||
|
||||
#include STM32_HAL_H
|
||||
|
||||
#define STM32_GPIO_PORT_SIZE 16
|
||||
|
||||
static pulseio_pulsein_obj_t* _objs[STM32_GPIO_PORT_SIZE];
|
||||
|
||||
STATIC TIM_HandleTypeDef t6_handle;
|
||||
STATIC TIM_HandleTypeDef tim_handle;
|
||||
static uint32_t overflow_count = 0;
|
||||
STATIC uint8_t refcount = 0;
|
||||
|
||||
static void assign_EXTI_Interrupt(pulseio_pulsein_obj_t* self, uint8_t num);
|
||||
|
||||
void TIM6_IRQHandler(void)
|
||||
void pulsein_timer_event_handler(void)
|
||||
{
|
||||
// Detect TIM Update event
|
||||
if (__HAL_TIM_GET_FLAG(&t6_handle, TIM_FLAG_UPDATE) != RESET)
|
||||
if (__HAL_TIM_GET_FLAG(&tim_handle, TIM_FLAG_UPDATE) != RESET)
|
||||
{
|
||||
if (__HAL_TIM_GET_IT_SOURCE(&t6_handle, TIM_IT_UPDATE) != RESET)
|
||||
if (__HAL_TIM_GET_IT_SOURCE(&tim_handle, TIM_IT_UPDATE) != RESET)
|
||||
{
|
||||
__HAL_TIM_CLEAR_IT(&t6_handle, TIM_IT_UPDATE);
|
||||
__HAL_TIM_CLEAR_IT(&tim_handle, TIM_IT_UPDATE);
|
||||
overflow_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void pulsein_handler(uint8_t num) {
|
||||
static void pulsein_exti_event_handler(uint8_t num) {
|
||||
// Grab the current time first.
|
||||
uint32_t current_overflow = overflow_count;
|
||||
uint32_t current_count = 0;
|
||||
#if HAS_BASIC_TIM
|
||||
current_count = TIM6->CNT;
|
||||
#endif
|
||||
uint32_t current_count = tim_handle.Instance->CNT;
|
||||
|
||||
// Interrupt register must be cleared manually
|
||||
EXTI->PR = 1 << num;
|
||||
@ -105,17 +103,14 @@ void pulsein_reset(void) {
|
||||
}
|
||||
memset(_objs, 0, sizeof(_objs));
|
||||
|
||||
#if HAS_BASIC_TIM
|
||||
__HAL_RCC_TIM6_CLK_DISABLE();
|
||||
HAL_TIM_Base_DeInit(&tim_handle);
|
||||
tim_clock_disable(stm_peripherals_timer_get_index(tim_handle.Instance));
|
||||
memset(&tim_handle, 0, sizeof(tim_handle));
|
||||
refcount = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu_pin_obj_t* pin,
|
||||
uint16_t maxlen, bool idle_state) {
|
||||
#if !(HAS_BASIC_TIM)
|
||||
mp_raise_NotImplementedError(translate("PulseIn not supported on this chip"));
|
||||
#else
|
||||
// STM32 has one shared EXTI for each pin number, 0-15
|
||||
uint8_t p_num = pin->number;
|
||||
if(_objs[p_num]) {
|
||||
@ -141,24 +136,34 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu
|
||||
self->last_count = 0;
|
||||
self->last_overflow = 0;
|
||||
|
||||
if (HAL_TIM_Base_GetState(&t6_handle) == HAL_TIM_STATE_RESET) {
|
||||
// Set the new period
|
||||
t6_handle.Instance = TIM6;
|
||||
t6_handle.Init.Prescaler = 168; // HCLK is 168 mhz so divide down to 1mhz
|
||||
t6_handle.Init.Period = 0xffff;
|
||||
HAL_TIM_Base_Init(&t6_handle);
|
||||
if (HAL_TIM_Base_GetState(&tim_handle) == HAL_TIM_STATE_RESET) {
|
||||
// Find a suitable timer
|
||||
TIM_TypeDef * tim_instance = stm_peripherals_find_timer();
|
||||
stm_peripherals_timer_reserve(tim_instance);
|
||||
|
||||
// TIM6 has limited HAL support, set registers manually
|
||||
t6_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt
|
||||
t6_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer
|
||||
t6_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts
|
||||
__HAL_TIM_ENABLE_IT(&t6_handle, TIM_IT_UPDATE);
|
||||
// Set ticks to 1us
|
||||
uint32_t source = stm_peripherals_timer_get_source_freq(tim_instance);
|
||||
uint32_t prescaler = source/1000000;
|
||||
|
||||
// Enable clocks and IRQ, set callback
|
||||
stm_peripherals_timer_preinit(tim_instance, 4, pulsein_timer_event_handler);
|
||||
|
||||
// Set the new period
|
||||
tim_handle.Instance = tim_instance;
|
||||
tim_handle.Init.Prescaler = prescaler - 1;
|
||||
tim_handle.Init.Period = 0x10000 - 1; //65 ms period (maximum)
|
||||
HAL_TIM_Base_Init(&tim_handle);
|
||||
|
||||
// Set registers manually
|
||||
tim_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt
|
||||
tim_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer
|
||||
tim_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts
|
||||
__HAL_TIM_ENABLE_IT(&tim_handle, TIM_IT_UPDATE);
|
||||
|
||||
overflow_count = 0;
|
||||
}
|
||||
// Add to active PulseIns
|
||||
refcount++;
|
||||
#endif
|
||||
|
||||
// EXTI pins can also be read as an input
|
||||
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||
@ -170,7 +175,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu
|
||||
// Interrupt starts immediately
|
||||
assign_EXTI_Interrupt(self, pin->number);
|
||||
HAL_NVIC_EnableIRQ(self->irq);
|
||||
claim_pin(pin);
|
||||
common_hal_mcu_pin_claim(pin);
|
||||
}
|
||||
|
||||
bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) {
|
||||
@ -182,16 +187,13 @@ void common_hal_pulseio_pulsein_deinit(pulseio_pulsein_obj_t* self) {
|
||||
return;
|
||||
}
|
||||
//Remove pulsein slot from shared array
|
||||
HAL_NVIC_DisableIRQ(self->irq);
|
||||
_objs[self->pin->number] = NULL;
|
||||
reset_pin_number(self->pin->port, self->pin->number);
|
||||
self->pin = NULL;
|
||||
|
||||
refcount--;
|
||||
if (refcount == 0) {
|
||||
#if HAS_BASIC_TIM
|
||||
__HAL_RCC_TIM6_CLK_DISABLE();
|
||||
#endif
|
||||
stm_peripherals_timer_free(tim_handle.Instance);
|
||||
}
|
||||
}
|
||||
|
||||
@ -299,23 +301,23 @@ static void assign_EXTI_Interrupt(pulseio_pulsein_obj_t* self, uint8_t num) {
|
||||
|
||||
void EXTI0_IRQHandler(void)
|
||||
{
|
||||
pulsein_handler(0);
|
||||
pulsein_exti_event_handler(0);
|
||||
}
|
||||
void EXTI1_IRQHandler(void)
|
||||
{
|
||||
pulsein_handler(1);
|
||||
pulsein_exti_event_handler(1);
|
||||
}
|
||||
void EXTI2_IRQHandler(void)
|
||||
{
|
||||
pulsein_handler(2);
|
||||
pulsein_exti_event_handler(2);
|
||||
}
|
||||
void EXTI3_IRQHandler(void)
|
||||
{
|
||||
pulsein_handler(3);
|
||||
pulsein_exti_event_handler(3);
|
||||
}
|
||||
void EXTI4_IRQHandler(void)
|
||||
{
|
||||
pulsein_handler(4);
|
||||
pulsein_exti_event_handler(4);
|
||||
}
|
||||
|
||||
void EXTI9_5_IRQHandler(void)
|
||||
@ -323,7 +325,7 @@ void EXTI9_5_IRQHandler(void)
|
||||
uint32_t pending = EXTI->PR;
|
||||
for (uint i = 5; i <= 9; i++) {
|
||||
if(pending & (1 << i)) {
|
||||
pulsein_handler(i);
|
||||
pulsein_exti_event_handler(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -333,7 +335,7 @@ void EXTI15_10_IRQHandler(void)
|
||||
uint32_t pending = EXTI->PR;
|
||||
for (uint i = 10; i <= 15; i++) {
|
||||
if(pending & (1 << i)) {
|
||||
pulsein_handler(i);
|
||||
pulsein_exti_event_handler(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,20 +36,20 @@
|
||||
#include "supervisor/shared/translate.h"
|
||||
|
||||
#include STM32_HAL_H
|
||||
#include "common-hal/microcontroller/Pin.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
#include "timers.h"
|
||||
|
||||
// A single timer is shared amongst all PulseOut objects under the assumption that
|
||||
// the code is single threaded.
|
||||
STATIC uint8_t refcount = 0;
|
||||
|
||||
STATIC uint16_t *pulse_array = NULL;
|
||||
STATIC volatile uint16_t pulse_array_index = 0;
|
||||
STATIC uint16_t pulse_array_length;
|
||||
|
||||
//Timer is shared, must be accessible by interrupt
|
||||
STATIC TIM_HandleTypeDef t7_handle;
|
||||
STATIC TIM_HandleTypeDef tim_handle;
|
||||
pulseio_pulseout_obj_t *curr_pulseout = NULL;
|
||||
|
||||
|
||||
STATIC void turn_on(pulseio_pulseout_obj_t *pulseout) {
|
||||
// Turn on PWM
|
||||
HAL_TIM_PWM_Start(&(pulseout->pwmout->handle), pulseout->pwmout->channel);
|
||||
@ -65,91 +65,78 @@ STATIC void turn_off(pulseio_pulseout_obj_t *pulseout) {
|
||||
|
||||
STATIC void start_timer(void) {
|
||||
// Set the new period
|
||||
t7_handle.Init.Period = pulse_array[pulse_array_index] - 1;
|
||||
HAL_TIM_Base_Init(&t7_handle);
|
||||
tim_handle.Init.Period = pulse_array[pulse_array_index] - 1;
|
||||
HAL_TIM_Base_Init(&tim_handle);
|
||||
|
||||
// TIM7 has limited HAL support, set registers manually
|
||||
t7_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt
|
||||
t7_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer
|
||||
t7_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts
|
||||
__HAL_TIM_ENABLE_IT(&t7_handle, TIM_IT_UPDATE);
|
||||
|
||||
tim_handle.Instance->SR = 0; // Prevent the SR from triggering an interrupt
|
||||
tim_handle.Instance->CR1 |= TIM_CR1_CEN; // Resume timer
|
||||
tim_handle.Instance->CR1 |= TIM_CR1_URS; // Disable non-overflow interrupts
|
||||
__HAL_TIM_ENABLE_IT(&tim_handle, TIM_IT_UPDATE);
|
||||
}
|
||||
|
||||
STATIC void pulseout_event_handler(void) {
|
||||
if (curr_pulseout->pwmout == NULL) {
|
||||
return; //invalid interrupt
|
||||
// Detect TIM Update event
|
||||
if (__HAL_TIM_GET_FLAG(&tim_handle, TIM_FLAG_UPDATE) != RESET)
|
||||
{
|
||||
if (__HAL_TIM_GET_IT_SOURCE(&tim_handle, TIM_IT_UPDATE) != RESET)
|
||||
{
|
||||
__HAL_TIM_CLEAR_IT(&tim_handle, TIM_IT_UPDATE);
|
||||
if (curr_pulseout->pwmout == NULL) {
|
||||
return; //invalid interrupt
|
||||
}
|
||||
|
||||
pulse_array_index++;
|
||||
|
||||
// No more pulses. Turn off output and don't restart.
|
||||
if (pulse_array_index >= pulse_array_length) {
|
||||
turn_off(curr_pulseout);
|
||||
return;
|
||||
}
|
||||
|
||||
// Alternate on and off, starting with on.
|
||||
if (pulse_array_index % 2 == 0) {
|
||||
turn_on(curr_pulseout);
|
||||
} else {
|
||||
turn_off(curr_pulseout);
|
||||
}
|
||||
|
||||
// Count up to the next given value.
|
||||
start_timer();
|
||||
}
|
||||
}
|
||||
|
||||
HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 1);
|
||||
HAL_GPIO_WritePin(pin_port(2),pin_mask(6), 0);
|
||||
|
||||
pulse_array_index++;
|
||||
|
||||
// No more pulses. Turn off output and don't restart.
|
||||
if (pulse_array_index >= pulse_array_length) {
|
||||
turn_off(curr_pulseout);
|
||||
return;
|
||||
}
|
||||
|
||||
// Alternate on and off, starting with on.
|
||||
if (pulse_array_index % 2 == 0) {
|
||||
turn_on(curr_pulseout);
|
||||
} else {
|
||||
turn_off(curr_pulseout);
|
||||
}
|
||||
|
||||
// Count up to the next given value.
|
||||
start_timer();
|
||||
}
|
||||
|
||||
void pulseout_reset() {
|
||||
#if HAS_BASIC_TIM
|
||||
__HAL_RCC_TIM7_CLK_DISABLE();
|
||||
stm_peripherals_timer_free(tim_handle.Instance);
|
||||
refcount = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
|
||||
const pulseio_pwmout_obj_t* carrier) {
|
||||
#if !(HAS_BASIC_TIM)
|
||||
mp_raise_NotImplementedError(translate("PulseOut not supported on this chip"));
|
||||
#else
|
||||
// Add to active PulseOuts
|
||||
refcount++;
|
||||
TIM_TypeDef * tim_instance = stm_peripherals_find_timer();
|
||||
stm_peripherals_timer_reserve(tim_instance);
|
||||
|
||||
// Calculate a 1 ms period
|
||||
uint32_t source, clk_div;
|
||||
source = HAL_RCC_GetPCLK1Freq(); // TIM7 is on APB1
|
||||
clk_div = RCC->CFGR & RCC_CFGR_PPRE1;
|
||||
// APB quirk, see See DM00031020 Rev 4, page 115.
|
||||
if (clk_div != 0) {
|
||||
// APB prescaler for this timer is > 1
|
||||
source *= 2;
|
||||
}
|
||||
|
||||
//calculate a 1ms period
|
||||
uint32_t source = stm_peripherals_timer_get_source_freq(tim_instance);
|
||||
uint32_t prescaler = source/1000000; //1us intervals
|
||||
|
||||
__HAL_RCC_TIM7_CLK_ENABLE();
|
||||
HAL_NVIC_SetPriority(TIM7_IRQn, 4, 0);
|
||||
HAL_NVIC_EnableIRQ(TIM7_IRQn);
|
||||
stm_peripherals_timer_preinit(tim_instance, 4, pulseout_event_handler);
|
||||
tim_handle.Instance = tim_instance;
|
||||
tim_handle.Init.Period = 100; //immediately replaced.
|
||||
tim_handle.Init.Prescaler = prescaler - 1;
|
||||
tim_handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
tim_handle.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
tim_handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
|
||||
// Timers 6 and 7 have no pins, so using them doesn't affect PWM availability
|
||||
t7_handle.Instance = TIM7;
|
||||
t7_handle.Init.Period = 100; //immediately replaced.
|
||||
t7_handle.Init.Prescaler = prescaler - 1;
|
||||
t7_handle.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
|
||||
t7_handle.Init.CounterMode = TIM_COUNTERMODE_UP;
|
||||
t7_handle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
|
||||
|
||||
HAL_TIM_Base_Init(&t7_handle);
|
||||
t7_handle.Instance->SR = 0;
|
||||
HAL_TIM_Base_Init(&tim_handle);
|
||||
tim_handle.Instance->SR = 0;
|
||||
|
||||
// The HAL can't work with const, recast required.
|
||||
self->pwmout = (pulseio_pwmout_obj_t*)carrier;
|
||||
|
||||
turn_off(self);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool common_hal_pulseio_pulseout_deinited(pulseio_pulseout_obj_t* self) {
|
||||
@ -165,9 +152,7 @@ void common_hal_pulseio_pulseout_deinit(pulseio_pulseout_obj_t* self) {
|
||||
|
||||
refcount--;
|
||||
if (refcount == 0) {
|
||||
#if HAS_BASIC_TIM
|
||||
__HAL_RCC_TIM7_CLK_DISABLE();
|
||||
#endif
|
||||
stm_peripherals_timer_free(tim_handle.Instance);
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,24 +175,11 @@ void common_hal_pulseio_pulseout_send(pulseio_pulseout_obj_t* self, uint16_t* pu
|
||||
// signal.
|
||||
RUN_BACKGROUND_TASKS;
|
||||
|
||||
// Use when debugging, or issues are irrecoverable
|
||||
// // Use when debugging, or issues are irrecoverable
|
||||
// if ((supervisor_ticks_ms64() - starttime ) > timeout ) {
|
||||
// mp_raise_RuntimeError(translate("Error: Send Timeout"));
|
||||
// }
|
||||
}
|
||||
//turn off timer counter.
|
||||
t7_handle.Instance->CR1 &= ~TIM_CR1_CEN;
|
||||
}
|
||||
|
||||
void TIM7_IRQHandler(void)
|
||||
{
|
||||
// Detect TIM Update event
|
||||
if (__HAL_TIM_GET_FLAG(&t7_handle, TIM_FLAG_UPDATE) != RESET)
|
||||
{
|
||||
if (__HAL_TIM_GET_IT_SOURCE(&t7_handle, TIM_IT_UPDATE) != RESET)
|
||||
{
|
||||
__HAL_TIM_CLEAR_IT(&t7_handle, TIM_IT_UPDATE);
|
||||
pulseout_event_handler();
|
||||
}
|
||||
}
|
||||
tim_handle.Instance->CR1 &= ~TIM_CR1_CEN;
|
||||
}
|
||||
|
@ -27,28 +27,30 @@
|
||||
#include <stddef.h>
|
||||
|
||||
#include "common-hal/rgbmatrix/RGBMatrix.h"
|
||||
#include "timers.h"
|
||||
|
||||
#include STM32_HAL_H
|
||||
|
||||
extern void _PM_IRQ_HANDLER(void);
|
||||
|
||||
void *common_hal_rgbmatrix_timer_allocate() {
|
||||
// TODO(jepler) properly handle resource allocation including never-reset
|
||||
return TIM6;
|
||||
TIM_TypeDef * timer = stm_peripherals_find_timer();
|
||||
stm_peripherals_timer_reserve(timer);
|
||||
return timer;
|
||||
}
|
||||
|
||||
|
||||
void common_hal_rgbmatrix_timer_enable(void* ptr) {
|
||||
HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
|
||||
TIM_TypeDef *tim = (TIM_TypeDef*)ptr;
|
||||
HAL_NVIC_EnableIRQ(stm_peripherals_timer_get_irqnum(tim));
|
||||
}
|
||||
|
||||
void common_hal_rgbmatrix_timer_disable(void* ptr) {
|
||||
TIM_TypeDef *tim = (TIM_TypeDef*)ptr;
|
||||
tim->DIER &= ~TIM_DIER_UIE;
|
||||
HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn);
|
||||
}
|
||||
|
||||
void common_hal_rgbmatrix_timer_free(void* ptr) {
|
||||
TIM_TypeDef *tim = (TIM_TypeDef*)ptr;
|
||||
stm_peripherals_timer_free(tim);
|
||||
common_hal_rgbmatrix_timer_disable(ptr);
|
||||
// TODO(jepler) properly handle resource allocation including never-reset
|
||||
}
|
||||
|
@ -29,55 +29,57 @@
|
||||
#include "peripherals/pins.h"
|
||||
#include "peripherals/periph.h"
|
||||
|
||||
// I2C
|
||||
I2C_TypeDef * mcu_i2c_banks[I2C_BANK_ARRAY_LEN] = {I2C1, I2C2, I2C3};
|
||||
|
||||
I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3};
|
||||
|
||||
const mcu_periph_obj_t mcu_i2c_sda_list[4] = {
|
||||
const mcu_periph_obj_t mcu_i2c_sda_list[I2C_SDA_ARRAY_LEN] = {
|
||||
PERIPH(1, 4, &pin_PB07),
|
||||
PERIPH(1, 4, &pin_PB09),
|
||||
PERIPH(2, 4, &pin_PB11),
|
||||
PERIPH(3, 4, &pin_PC09),
|
||||
PERIPH(2, 4, &pin_PF00),
|
||||
PERIPH(2, 4, &pin_PH05),
|
||||
PERIPH(3, 4, &pin_PH08),
|
||||
};
|
||||
|
||||
const mcu_periph_obj_t mcu_i2c_scl_list[4] = {
|
||||
const mcu_periph_obj_t mcu_i2c_scl_list[I2C_SCL_ARRAY_LEN] = {
|
||||
PERIPH(3, 4, &pin_PA08),
|
||||
PERIPH(1, 4, &pin_PB06),
|
||||
PERIPH(1, 4, &pin_PB08),
|
||||
PERIPH(2, 4, &pin_PB10),
|
||||
PERIPH(3, 4, &pin_PA08)
|
||||
PERIPH(2, 4, &pin_PF01),
|
||||
PERIPH(2, 4, &pin_PH04),
|
||||
PERIPH(3, 4, &pin_PH07),
|
||||
};
|
||||
|
||||
SPI_TypeDef * mcu_spi_banks[3] = {SPI1, SPI2, SPI3};
|
||||
SPI_TypeDef * mcu_spi_banks[SPI_BANK_ARRAY_LEN] = {SPI1, SPI2, SPI3};
|
||||
|
||||
const mcu_periph_obj_t mcu_spi_sck_list[7] = {
|
||||
const mcu_periph_obj_t mcu_spi_sck_list[SPI_SCK_ARRAY_LEN] = {
|
||||
PERIPH(1, 5, &pin_PA05),
|
||||
PERIPH(1, 5, &pin_PB03),
|
||||
PERIPH(3, 6, &pin_PB03),
|
||||
PERIPH(2, 5, &pin_PB10),
|
||||
PERIPH(2, 5, &pin_PB13),
|
||||
PERIPH(2, 5, &pin_PC07),
|
||||
PERIPH(3, 6, &pin_PB03),
|
||||
PERIPH(3, 6, &pin_PC10),
|
||||
PERIPH(2, 5, &pin_PI01),
|
||||
};
|
||||
|
||||
const mcu_periph_obj_t mcu_spi_mosi_list[6] = {
|
||||
const mcu_periph_obj_t mcu_spi_mosi_list[SPI_MOSI_ARRAY_LEN] = {
|
||||
PERIPH(1, 5, &pin_PA07),
|
||||
PERIPH(1, 5, &pin_PB05),
|
||||
PERIPH(3, 6, &pin_PB05),
|
||||
PERIPH(2, 5, &pin_PB15),
|
||||
PERIPH(2, 5, &pin_PC03),
|
||||
PERIPH(3, 6, &pin_PB05),
|
||||
PERIPH(3, 6, &pin_PC12),
|
||||
PERIPH(2, 5, &pin_PI03),
|
||||
};
|
||||
|
||||
const mcu_periph_obj_t mcu_spi_miso_list[6] = {
|
||||
const mcu_periph_obj_t mcu_spi_miso_list[SPI_MISO_ARRAY_LEN] = {
|
||||
PERIPH(1, 5, &pin_PA06),
|
||||
PERIPH(1, 5, &pin_PB04),
|
||||
PERIPH(3, 6, &pin_PB04),
|
||||
PERIPH(2, 5, &pin_PB14),
|
||||
PERIPH(2, 5, &pin_PC02),
|
||||
PERIPH(3, 6, &pin_PB04),
|
||||
PERIPH(3, 6, &pin_PC11),
|
||||
PERIPH(2, 5, &pin_PI02),
|
||||
};
|
||||
|
||||
const mcu_periph_obj_t mcu_spi_nss_list[6] = {
|
||||
const mcu_periph_obj_t mcu_spi_nss_list[SPI_NSS_ARRAY_LEN] = {
|
||||
PERIPH(1, 5, &pin_PA04),
|
||||
PERIPH(1, 5, &pin_PA15),
|
||||
PERIPH(2, 5, &pin_PB09),
|
||||
@ -89,7 +91,7 @@ const mcu_periph_obj_t mcu_spi_nss_list[6] = {
|
||||
USART_TypeDef * mcu_uart_banks[MAX_UART] = {USART1, USART2, USART3, UART4, UART5, USART6};
|
||||
bool mcu_uart_has_usart[MAX_UART] = {true, true, true, false, false, true};
|
||||
|
||||
const mcu_periph_obj_t mcu_uart_tx_list[12] = {
|
||||
const mcu_periph_obj_t mcu_uart_tx_list[UART_TX_ARRAY_LEN] = {
|
||||
PERIPH(4, 8, &pin_PA00),
|
||||
PERIPH(2, 7, &pin_PA02),
|
||||
PERIPH(1, 7, &pin_PA09),
|
||||
@ -103,8 +105,7 @@ const mcu_periph_obj_t mcu_uart_tx_list[12] = {
|
||||
PERIPH(3, 7, &pin_PD08),
|
||||
PERIPH(6, 8, &pin_PG14),
|
||||
};
|
||||
|
||||
const mcu_periph_obj_t mcu_uart_rx_list[12] = {
|
||||
const mcu_periph_obj_t mcu_uart_rx_list[UART_RX_ARRAY_LEN] = {
|
||||
PERIPH(4, 8, &pin_PA01),
|
||||
PERIPH(2, 7, &pin_PA03),
|
||||
PERIPH(1, 7, &pin_PA10),
|
||||
@ -121,74 +122,75 @@ const mcu_periph_obj_t mcu_uart_rx_list[12] = {
|
||||
|
||||
//Timers
|
||||
//TIM6 and TIM7 are basic timers that are only used by DAC, and don't have pins
|
||||
TIM_TypeDef * mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10,
|
||||
TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8, TIM9, TIM10,
|
||||
TIM11, TIM12, TIM13, TIM14};
|
||||
|
||||
const mcu_tim_pin_obj_t mcu_tim_pin_list[56] = {
|
||||
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(2,1,4,&pin_PA03),
|
||||
TIM(5,2,4,&pin_PA03),
|
||||
TIM(9,3,1,&pin_PA02),
|
||||
TIM(9,3,2,&pin_PA03),
|
||||
TIM(3,2,1,&pin_PA06),
|
||||
TIM(13,9,1,&pin_PA06),
|
||||
TIM(3,2,2,&pin_PA07),
|
||||
TIM(14,9,1,&pin_PA07),
|
||||
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(10,2,1,&pin_PB08),
|
||||
TIM(4,2,4,&pin_PB09),
|
||||
TIM(11,2,1,&pin_PB09),
|
||||
TIM(2,1,3,&pin_PB10),
|
||||
TIM(2,1,4,&pin_PB11),
|
||||
TIM(12,9,1,&pin_PB14),
|
||||
TIM(12,9,2,&pin_PB15),
|
||||
TIM(3,2,1,&pin_PC06),
|
||||
TIM(3,2,2,&pin_PC07),
|
||||
TIM(3,2,3,&pin_PC08),
|
||||
TIM(3,2,4,&pin_PC09),
|
||||
TIM(8,3,1,&pin_PC06),
|
||||
TIM(8,3,2,&pin_PC07),
|
||||
TIM(8,3,3,&pin_PC08),
|
||||
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(9,3,1,&pin_PE05),
|
||||
TIM(9,3,2,&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(10,3,1,&pin_PF06),
|
||||
TIM(11,3,1,&pin_PF07),
|
||||
TIM(13,9,1,&pin_PF08),
|
||||
TIM(14,9,1,&pin_PF09),
|
||||
// TIM(12,9,1,&pin_PH06), //TODO: include these when pin map is expanded
|
||||
// TIM(12,9,2,&pin_PH09),
|
||||
// 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),
|
||||
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(9, 3, 1, &pin_PA02),
|
||||
TIM(2, 1, 4, &pin_PA03),
|
||||
TIM(5, 2, 4, &pin_PA03),
|
||||
TIM(9, 3, 2, &pin_PA03),
|
||||
TIM(2, 1, 1, &pin_PA05),
|
||||
TIM(3, 2, 1, &pin_PA06),
|
||||
TIM(13, 9, 1, &pin_PA06),
|
||||
TIM(3, 2, 2, &pin_PA07),
|
||||
TIM(14, 9, 1, &pin_PA07),
|
||||
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(10, 3, 1, &pin_PB08),
|
||||
TIM(4, 2, 4, &pin_PB09),
|
||||
TIM(11, 3, 1, &pin_PB09),
|
||||
TIM(2, 1, 3, &pin_PB10),
|
||||
TIM(2, 1, 4, &pin_PB11),
|
||||
TIM(12, 9, 1, &pin_PB14),
|
||||
TIM(12, 9, 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(9, 3, 1, &pin_PE05),
|
||||
TIM(9, 3, 2, &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(10, 3, 1, &pin_PF06),
|
||||
TIM(11, 3, 1, &pin_PF07),
|
||||
TIM(13, 9, 1, &pin_PF08),
|
||||
TIM(14, 9, 1, &pin_PF09),
|
||||
TIM(12, 9, 1, &pin_PH06),
|
||||
TIM(12, 9, 2, &pin_PH09),
|
||||
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),
|
||||
};
|
||||
|
@ -28,29 +28,36 @@
|
||||
#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PERIPH_H
|
||||
|
||||
//I2C
|
||||
extern I2C_TypeDef * mcu_i2c_banks[3];
|
||||
|
||||
extern const mcu_periph_obj_t mcu_i2c_sda_list[4];
|
||||
extern const mcu_periph_obj_t mcu_i2c_scl_list[4];
|
||||
#define I2C_BANK_ARRAY_LEN 3
|
||||
#define I2C_SDA_ARRAY_LEN 7
|
||||
#define I2C_SCL_ARRAY_LEN 7
|
||||
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
|
||||
extern SPI_TypeDef * mcu_spi_banks[3];
|
||||
|
||||
extern const mcu_periph_obj_t mcu_spi_sck_list[7];
|
||||
extern const mcu_periph_obj_t mcu_spi_mosi_list[6];
|
||||
extern const mcu_periph_obj_t mcu_spi_miso_list[6];
|
||||
extern const mcu_periph_obj_t mcu_spi_nss_list[6];
|
||||
#define SPI_BANK_ARRAY_LEN 3
|
||||
#define SPI_SCK_ARRAY_LEN 7
|
||||
#define SPI_MOSI_ARRAY_LEN 7
|
||||
#define SPI_MISO_ARRAY_LEN 7
|
||||
#define SPI_NSS_ARRAY_LEN 6
|
||||
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 12
|
||||
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[12];
|
||||
extern const mcu_periph_obj_t mcu_uart_rx_list[12];
|
||||
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 14
|
||||
#define TIM_PIN_ARRAY_LEN 56
|
||||
#define TIM_PIN_ARRAY_LEN 67
|
||||
TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
|
||||
const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
|
||||
|
||||
|
@ -28,33 +28,6 @@
|
||||
#include "py/mphal.h"
|
||||
#include "peripherals/pins.h"
|
||||
|
||||
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_PC13 = PIN(2, 13, NO_ADC); //anti-tamp
|
||||
const mcu_pin_obj_t pin_PC14 = PIN(2, 14, NO_ADC); //OSC32_IN
|
||||
const mcu_pin_obj_t pin_PC15 = PIN(2, 15, NO_ADC); //OSC32_OUT
|
||||
|
||||
const mcu_pin_obj_t pin_PF00 = PIN(5, 0, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PF01 = PIN(5, 1, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PF02 = PIN(5, 2, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); // 144 only
|
||||
const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); // 144 only
|
||||
const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); // 144 only
|
||||
const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); // 144 only
|
||||
const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); // 144 only
|
||||
const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); // 144 only
|
||||
const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); // 144 only
|
||||
const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); // 144 only
|
||||
|
||||
const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10));
|
||||
const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11));
|
||||
const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_123,12));
|
||||
const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_123,13));
|
||||
|
||||
const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_123,0));
|
||||
const mcu_pin_obj_t pin_PA01 = PIN(0, 1, ADC_INPUT(ADC_123,1));
|
||||
const mcu_pin_obj_t pin_PA02 = PIN(0, 2, ADC_INPUT(ADC_123,2));
|
||||
@ -63,23 +36,69 @@ const mcu_pin_obj_t pin_PA04 = PIN(0, 4, ADC_INPUT(ADC_12,4));
|
||||
const mcu_pin_obj_t pin_PA05 = PIN(0, 5, ADC_INPUT(ADC_12,5));
|
||||
const mcu_pin_obj_t pin_PA06 = PIN(0, 6, ADC_INPUT(ADC_12,6));
|
||||
const mcu_pin_obj_t pin_PA07 = PIN(0, 7, ADC_INPUT(ADC_12,7));
|
||||
|
||||
const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_12,14));
|
||||
const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_12,15));
|
||||
|
||||
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_12,8));
|
||||
const mcu_pin_obj_t pin_PB01 = PIN(1, 1, ADC_INPUT(ADC_12,9));
|
||||
const mcu_pin_obj_t pin_PB02 = PIN(1, 2, NO_ADC); //BOOT1
|
||||
|
||||
const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PF12 = PIN(5, 12, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PF13 = PIN(5, 13, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PF14 = PIN(5, 14, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PF15 = PIN(5, 15, NO_ADC); // 144 only
|
||||
|
||||
const mcu_pin_obj_t pin_PG00 = PIN(6, 0, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG01 = PIN(6, 1, NO_ADC); // 144 only
|
||||
|
||||
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_123,10));
|
||||
const mcu_pin_obj_t pin_PC01 = PIN(2, 1, ADC_INPUT(ADC_123,11));
|
||||
const mcu_pin_obj_t pin_PC02 = PIN(2, 2, ADC_INPUT(ADC_123,12));
|
||||
const mcu_pin_obj_t pin_PC03 = PIN(2, 3, ADC_INPUT(ADC_123,13));
|
||||
const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_12,14));
|
||||
const mcu_pin_obj_t pin_PC05 = PIN(2, 5, ADC_INPUT(ADC_12,15));
|
||||
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);
|
||||
@ -89,73 +108,63 @@ 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_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_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_PG02 = PIN(6, 2, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG03 = PIN(6, 3, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG04 = PIN(6, 4, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG05 = PIN(6, 5, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG06 = PIN(6, 6, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG07 = PIN(6, 7, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG08 = PIN(6, 8, NO_ADC); // 144 only
|
||||
|
||||
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_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_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_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_PG09 = PIN(6, 9, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG10 = PIN(6, 10, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG11 = PIN(6, 11, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG12 = PIN(6, 12, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG13 = PIN(6, 13, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG14 = PIN(6, 14, NO_ADC); // 144 only
|
||||
const mcu_pin_obj_t pin_PG15 = PIN(6, 15, NO_ADC); // 144 only
|
||||
|
||||
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_PE00 = PIN(4, 0, NO_ADC);
|
||||
const mcu_pin_obj_t pin_PE01 = PIN(4, 1, 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, ADC_INPUT(ADC_3,9));
|
||||
const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14));
|
||||
const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15));
|
||||
const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4));
|
||||
const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5));
|
||||
const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6));
|
||||
const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7));
|
||||
const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8));
|
||||
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);
|
||||
|
@ -27,107 +27,54 @@
|
||||
#ifndef MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PINS_H
|
||||
#define MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PINS_H
|
||||
|
||||
//Pins in datasheet order: DocID028087 Rev 7 page 50. LQFP100 only
|
||||
//pg 50
|
||||
extern const mcu_pin_obj_t pin_PE02;
|
||||
extern const mcu_pin_obj_t pin_PE03;
|
||||
extern const mcu_pin_obj_t pin_PE04;
|
||||
extern const mcu_pin_obj_t pin_PE05;
|
||||
extern const mcu_pin_obj_t pin_PE06;
|
||||
extern const mcu_pin_obj_t pin_PC13;
|
||||
extern const mcu_pin_obj_t pin_PC14;
|
||||
//pg 51
|
||||
extern const mcu_pin_obj_t pin_PC15;
|
||||
extern const mcu_pin_obj_t pin_PF00; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF01; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF02; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF03; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF04; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF05; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF06; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF07; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF08; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF09; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF10; // 144 only
|
||||
//pg 52
|
||||
extern const mcu_pin_obj_t pin_PC00;
|
||||
extern const mcu_pin_obj_t pin_PC01;
|
||||
extern const mcu_pin_obj_t pin_PC02;
|
||||
extern const mcu_pin_obj_t pin_PC03;
|
||||
extern const mcu_pin_obj_t pin_PA00;
|
||||
extern const mcu_pin_obj_t pin_PA01;
|
||||
extern const mcu_pin_obj_t pin_PA02;
|
||||
//pg 53
|
||||
extern const mcu_pin_obj_t pin_PA03;
|
||||
extern const mcu_pin_obj_t pin_PA04;
|
||||
extern const mcu_pin_obj_t pin_PA05;
|
||||
extern const mcu_pin_obj_t pin_PA06;
|
||||
extern const mcu_pin_obj_t pin_PA07;
|
||||
extern const mcu_pin_obj_t pin_PC04;
|
||||
//pg 54
|
||||
extern const mcu_pin_obj_t pin_PC05;
|
||||
extern const mcu_pin_obj_t pin_PB00;
|
||||
extern const mcu_pin_obj_t pin_PB01;
|
||||
extern const mcu_pin_obj_t pin_PB02;
|
||||
extern const mcu_pin_obj_t pin_PF11; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF12; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF13; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF14; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PF15; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG00; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG01; // 144 only
|
||||
//pg 55
|
||||
extern const mcu_pin_obj_t pin_PE07;
|
||||
extern const mcu_pin_obj_t pin_PE08;
|
||||
extern const mcu_pin_obj_t pin_PE09;
|
||||
extern const mcu_pin_obj_t pin_PE10;
|
||||
extern const mcu_pin_obj_t pin_PE11;
|
||||
extern const mcu_pin_obj_t pin_PE12;
|
||||
extern const mcu_pin_obj_t pin_PE13;
|
||||
extern const mcu_pin_obj_t pin_PE14;
|
||||
//pg 56
|
||||
extern const mcu_pin_obj_t pin_PE15;
|
||||
extern const mcu_pin_obj_t pin_PB10;
|
||||
extern const mcu_pin_obj_t pin_PB11; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PB12;
|
||||
extern const mcu_pin_obj_t pin_PB13;
|
||||
//pg 57
|
||||
extern const mcu_pin_obj_t pin_PB14;
|
||||
extern const mcu_pin_obj_t pin_PB15;
|
||||
extern const mcu_pin_obj_t pin_PD08;
|
||||
extern const mcu_pin_obj_t pin_PD09;
|
||||
extern const mcu_pin_obj_t pin_PD10;
|
||||
extern const mcu_pin_obj_t pin_PD11;
|
||||
extern const mcu_pin_obj_t pin_PD12;
|
||||
//pg 58
|
||||
extern const mcu_pin_obj_t pin_PD13;
|
||||
extern const mcu_pin_obj_t pin_PD14;
|
||||
extern const mcu_pin_obj_t pin_PD15;
|
||||
extern const mcu_pin_obj_t pin_PG02; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG03; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG04; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG05; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG06; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG07; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG08; // 144 only
|
||||
//pg 59
|
||||
extern const mcu_pin_obj_t pin_PC06;
|
||||
extern const mcu_pin_obj_t pin_PC07;
|
||||
extern const mcu_pin_obj_t pin_PC08;
|
||||
extern const mcu_pin_obj_t pin_PC09;
|
||||
extern const mcu_pin_obj_t pin_PA08;
|
||||
extern const mcu_pin_obj_t pin_PA09;
|
||||
extern const mcu_pin_obj_t pin_PA10;
|
||||
//pg 60
|
||||
extern const mcu_pin_obj_t pin_PA11;
|
||||
extern const mcu_pin_obj_t pin_PA12;
|
||||
extern const mcu_pin_obj_t pin_PA13;
|
||||
extern const mcu_pin_obj_t pin_PA14;
|
||||
extern const mcu_pin_obj_t pin_PA15;
|
||||
extern const mcu_pin_obj_t pin_PB00;
|
||||
extern const mcu_pin_obj_t pin_PB01;
|
||||
extern const mcu_pin_obj_t pin_PB02;
|
||||
extern const mcu_pin_obj_t pin_PB03;
|
||||
extern const mcu_pin_obj_t pin_PB04;
|
||||
extern const mcu_pin_obj_t pin_PB05;
|
||||
extern const mcu_pin_obj_t pin_PB06;
|
||||
extern const mcu_pin_obj_t pin_PB07;
|
||||
extern const mcu_pin_obj_t pin_PB08;
|
||||
extern const mcu_pin_obj_t pin_PB09;
|
||||
extern const mcu_pin_obj_t pin_PB10;
|
||||
extern const mcu_pin_obj_t pin_PB11;
|
||||
extern const mcu_pin_obj_t pin_PB12;
|
||||
extern const mcu_pin_obj_t pin_PB13;
|
||||
extern const mcu_pin_obj_t pin_PB14;
|
||||
extern const mcu_pin_obj_t pin_PB15;
|
||||
extern const mcu_pin_obj_t pin_PC00;
|
||||
extern const mcu_pin_obj_t pin_PC01;
|
||||
extern const mcu_pin_obj_t pin_PC02;
|
||||
extern const mcu_pin_obj_t pin_PC03;
|
||||
extern const mcu_pin_obj_t pin_PC04;
|
||||
extern const mcu_pin_obj_t pin_PC05;
|
||||
extern const mcu_pin_obj_t pin_PC06;
|
||||
extern const mcu_pin_obj_t pin_PC07;
|
||||
extern const mcu_pin_obj_t pin_PC08;
|
||||
extern const mcu_pin_obj_t pin_PC09;
|
||||
extern const mcu_pin_obj_t pin_PC10;
|
||||
extern const mcu_pin_obj_t pin_PC11;
|
||||
//pg 61
|
||||
extern const mcu_pin_obj_t pin_PC12;
|
||||
extern const mcu_pin_obj_t pin_PC13;
|
||||
extern const mcu_pin_obj_t pin_PC14;
|
||||
extern const mcu_pin_obj_t pin_PC15;
|
||||
extern const mcu_pin_obj_t pin_PD00;
|
||||
extern const mcu_pin_obj_t pin_PD01;
|
||||
extern const mcu_pin_obj_t pin_PD02;
|
||||
@ -136,23 +83,89 @@ extern const mcu_pin_obj_t pin_PD04;
|
||||
extern const mcu_pin_obj_t pin_PD05;
|
||||
extern const mcu_pin_obj_t pin_PD06;
|
||||
extern const mcu_pin_obj_t pin_PD07;
|
||||
//pg 62
|
||||
extern const mcu_pin_obj_t pin_PG09; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG10; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG11; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG12; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG13; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG14; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PG15; // 144 only
|
||||
extern const mcu_pin_obj_t pin_PB03;
|
||||
extern const mcu_pin_obj_t pin_PB04;
|
||||
//pg 63
|
||||
extern const mcu_pin_obj_t pin_PB05;
|
||||
extern const mcu_pin_obj_t pin_PB06;
|
||||
extern const mcu_pin_obj_t pin_PB07;
|
||||
extern const mcu_pin_obj_t pin_PB08;
|
||||
extern const mcu_pin_obj_t pin_PB09;
|
||||
extern const mcu_pin_obj_t pin_PD08;
|
||||
extern const mcu_pin_obj_t pin_PD09;
|
||||
extern const mcu_pin_obj_t pin_PD10;
|
||||
extern const mcu_pin_obj_t pin_PD11;
|
||||
extern const mcu_pin_obj_t pin_PD12;
|
||||
extern const mcu_pin_obj_t pin_PD13;
|
||||
extern const mcu_pin_obj_t pin_PD14;
|
||||
extern const mcu_pin_obj_t pin_PD15;
|
||||
extern const mcu_pin_obj_t pin_PE00;
|
||||
extern const mcu_pin_obj_t pin_PE01;
|
||||
extern const mcu_pin_obj_t pin_PE02;
|
||||
extern const mcu_pin_obj_t pin_PE03;
|
||||
extern const mcu_pin_obj_t pin_PE04;
|
||||
extern const mcu_pin_obj_t pin_PE05;
|
||||
extern const mcu_pin_obj_t pin_PE06;
|
||||
extern const mcu_pin_obj_t pin_PE07;
|
||||
extern const mcu_pin_obj_t pin_PE08;
|
||||
extern const mcu_pin_obj_t pin_PE09;
|
||||
extern const mcu_pin_obj_t pin_PE10;
|
||||
extern const mcu_pin_obj_t pin_PE11;
|
||||
extern const mcu_pin_obj_t pin_PE12;
|
||||
extern const mcu_pin_obj_t pin_PE13;
|
||||
extern const mcu_pin_obj_t pin_PE14;
|
||||
extern const mcu_pin_obj_t pin_PE15;
|
||||
extern const mcu_pin_obj_t pin_PF00;
|
||||
extern const mcu_pin_obj_t pin_PF01;
|
||||
extern const mcu_pin_obj_t pin_PF02;
|
||||
extern const mcu_pin_obj_t pin_PF03;
|
||||
extern const mcu_pin_obj_t pin_PF04;
|
||||
extern const mcu_pin_obj_t pin_PF05;
|
||||
extern const mcu_pin_obj_t pin_PF06;
|
||||
extern const mcu_pin_obj_t pin_PF07;
|
||||
extern const mcu_pin_obj_t pin_PF08;
|
||||
extern const mcu_pin_obj_t pin_PF09;
|
||||
extern const mcu_pin_obj_t pin_PF10;
|
||||
extern const mcu_pin_obj_t pin_PF11;
|
||||
extern const mcu_pin_obj_t pin_PF12;
|
||||
extern const mcu_pin_obj_t pin_PF13;
|
||||
extern const mcu_pin_obj_t pin_PF14;
|
||||
extern const mcu_pin_obj_t pin_PF15;
|
||||
extern const mcu_pin_obj_t pin_PG00;
|
||||
extern const mcu_pin_obj_t pin_PG01;
|
||||
extern const mcu_pin_obj_t pin_PG02;
|
||||
extern const mcu_pin_obj_t pin_PG03;
|
||||
extern const mcu_pin_obj_t pin_PG04;
|
||||
extern const mcu_pin_obj_t pin_PG05;
|
||||
extern const mcu_pin_obj_t pin_PG06;
|
||||
extern const mcu_pin_obj_t pin_PG07;
|
||||
extern const mcu_pin_obj_t pin_PG08;
|
||||
extern const mcu_pin_obj_t pin_PG09;
|
||||
extern const mcu_pin_obj_t pin_PG10;
|
||||
extern const mcu_pin_obj_t pin_PG11;
|
||||
extern const mcu_pin_obj_t pin_PG12;
|
||||
extern const mcu_pin_obj_t pin_PG13;
|
||||
extern const mcu_pin_obj_t pin_PG14;
|
||||
extern const mcu_pin_obj_t pin_PG15;
|
||||
extern const mcu_pin_obj_t pin_PH00;
|
||||
extern const mcu_pin_obj_t pin_PH01;
|
||||
extern const mcu_pin_obj_t pin_PH02;
|
||||
extern const mcu_pin_obj_t pin_PH03;
|
||||
extern const mcu_pin_obj_t pin_PH04;
|
||||
extern const mcu_pin_obj_t pin_PH05;
|
||||
extern const mcu_pin_obj_t pin_PH06;
|
||||
extern const mcu_pin_obj_t pin_PH07;
|
||||
extern const mcu_pin_obj_t pin_PH08;
|
||||
extern const mcu_pin_obj_t pin_PH09;
|
||||
extern const mcu_pin_obj_t pin_PH10;
|
||||
extern const mcu_pin_obj_t pin_PH11;
|
||||
extern const mcu_pin_obj_t pin_PH12;
|
||||
extern const mcu_pin_obj_t pin_PH13;
|
||||
extern const mcu_pin_obj_t pin_PH14;
|
||||
extern const mcu_pin_obj_t pin_PH15;
|
||||
extern const mcu_pin_obj_t pin_PI00;
|
||||
extern const mcu_pin_obj_t pin_PI01;
|
||||
extern const mcu_pin_obj_t pin_PI02;
|
||||
extern const mcu_pin_obj_t pin_PI03;
|
||||
extern const mcu_pin_obj_t pin_PI04;
|
||||
extern const mcu_pin_obj_t pin_PI05;
|
||||
extern const mcu_pin_obj_t pin_PI06;
|
||||
extern const mcu_pin_obj_t pin_PI07;
|
||||
extern const mcu_pin_obj_t pin_PI08;
|
||||
extern const mcu_pin_obj_t pin_PI09;
|
||||
extern const mcu_pin_obj_t pin_PI10;
|
||||
extern const mcu_pin_obj_t pin_PI11;
|
||||
|
||||
#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F405XX_PINS_H
|
||||
|
460
ports/stm/peripherals/timers.c
Normal file
460
ports/stm/peripherals/timers.c
Normal file
@ -0,0 +1,460 @@
|
||||
/*
|
||||
* This file is part of the Micro Python project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Lucian Copeland for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "timers.h"
|
||||
|
||||
#include "py/mpconfig.h"
|
||||
#include "py/gc.h"
|
||||
#include "py/obj.h"
|
||||
#include "py/runtime.h"
|
||||
#include "supervisor/shared/translate.h"
|
||||
|
||||
#include "shared-bindings/microcontroller/__init__.h"
|
||||
#include "shared-bindings/microcontroller/Pin.h"
|
||||
|
||||
#if !(CPY_STM32H7)
|
||||
|
||||
#define ALL_CLOCKS 0xFFFF
|
||||
#define NULL_IRQ 0xFF
|
||||
|
||||
static bool stm_timer_reserved[MP_ARRAY_SIZE(mcu_tim_banks)];
|
||||
static bool stm_timer_never_reset[MP_ARRAY_SIZE(mcu_tim_banks)];
|
||||
static void (*stm_timer_callback[MP_ARRAY_SIZE(mcu_tim_banks)])(void);
|
||||
static size_t irq_map[] = {
|
||||
#ifdef TIM1
|
||||
TIM1_CC_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM2
|
||||
TIM2_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM3
|
||||
TIM3_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM4
|
||||
TIM4_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM5
|
||||
TIM5_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM6
|
||||
#if !defined(DAC_BASE) && !defined(DAC1_BASE)
|
||||
TIM6_IRQn,
|
||||
#else
|
||||
TIM6_DAC_IRQn,
|
||||
#endif
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM7
|
||||
TIM7_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM8
|
||||
TIM8_CC_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM9
|
||||
TIM1_BRK_TIM9_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM10
|
||||
TIM1_UP_TIM10_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM11
|
||||
TIM1_TRG_COM_TIM11_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM12
|
||||
TIM8_BRK_TIM12_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM13
|
||||
TIM8_UP_TIM13_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM14
|
||||
TIM8_TRG_COM_TIM14_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM15
|
||||
TIM15_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM16
|
||||
TIM16_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
#ifdef TIM17
|
||||
TIM17_IRQn,
|
||||
#else
|
||||
NULL_IRQ,
|
||||
#endif
|
||||
};
|
||||
|
||||
// Get the frequency (in Hz) of the source clock for the given timer.
|
||||
// On STM32F405/407/415/417 there are 2 cases for how the clock freq is set.
|
||||
// If the APB prescaler is 1, then the timer clock is equal to its respective
|
||||
// APB clock. Otherwise (APB prescaler > 1) the timer clock is twice its
|
||||
// respective APB clock. See DM00031020 Rev 4, page 115.
|
||||
uint32_t stm_peripherals_timer_get_source_freq(TIM_TypeDef * timer) {
|
||||
size_t tim_id = stm_peripherals_timer_get_index(timer);
|
||||
uint32_t source, clk_div;
|
||||
if (tim_id == 1 || (8 <= tim_id && tim_id <= 11)) {
|
||||
// TIM{1,8,9,10,11} are on APB2
|
||||
source = HAL_RCC_GetPCLK2Freq();
|
||||
clk_div = RCC->CFGR & RCC_CFGR_PPRE2;
|
||||
} else {
|
||||
// TIM{2,3,4,5,6,7,12,13,14} are on APB1
|
||||
source = HAL_RCC_GetPCLK1Freq();
|
||||
clk_div = RCC->CFGR & RCC_CFGR_PPRE1;
|
||||
}
|
||||
if (clk_div != 0) {
|
||||
// APB prescaler for this timer is > 1
|
||||
source *= 2;
|
||||
}
|
||||
return source;
|
||||
}
|
||||
|
||||
size_t stm_peripherals_timer_get_irqnum(TIM_TypeDef * instance) {
|
||||
size_t tim_id = stm_peripherals_timer_get_index(instance);
|
||||
return irq_map[tim_id];
|
||||
}
|
||||
|
||||
void timers_reset(void) {
|
||||
uint16_t never_reset_mask = 0x00;
|
||||
for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_tim_banks); i++) {
|
||||
if (!stm_timer_never_reset[i]) {
|
||||
stm_timer_reserved[i] = false;
|
||||
} else {
|
||||
never_reset_mask |= 1 << i;
|
||||
}
|
||||
}
|
||||
tim_clock_disable(ALL_CLOCKS & ~(never_reset_mask));
|
||||
}
|
||||
|
||||
TIM_TypeDef * stm_peripherals_find_timer(void) {
|
||||
// Check for timers on pins outside the package size
|
||||
for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_tim_banks); i++) {
|
||||
bool timer_in_package = false;
|
||||
// Find each timer instance on the given bank
|
||||
for (size_t j = 0; j < MP_ARRAY_SIZE(mcu_tim_pin_list); j++) {
|
||||
// If a pin is claimed, we skip it
|
||||
if ( (mcu_tim_pin_list[j].tim_index == i + 1)
|
||||
&& (common_hal_mcu_pin_is_free(mcu_tim_pin_list[j].pin) == true) ) {
|
||||
// Search whether any pins in the package array match it
|
||||
for (size_t k = 0; k < mcu_pin_globals.map.alloc; k++) {
|
||||
if ( (mcu_tim_pin_list[j].pin == (mcu_pin_obj_t*)(mcu_pin_globals.map.table[k].value)) ) {
|
||||
timer_in_package = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// If no results are found, no unclaimed pins with this timer are in this package,
|
||||
// and it is safe to pick
|
||||
if (timer_in_package == false && mcu_tim_banks[i] != NULL) {
|
||||
// DEBUG: print the timer
|
||||
return mcu_tim_banks[i];
|
||||
mp_printf(&mp_plat_print, "Timer: %d\n",i);
|
||||
}
|
||||
}
|
||||
//TODO: secondary search for timers outside the pins in the board profile
|
||||
|
||||
// Work backwards - higher index timers have fewer pin allocations
|
||||
for (size_t i = (MP_ARRAY_SIZE(mcu_tim_banks) - 1); i >= 0; i--) {
|
||||
if ((!stm_timer_reserved[i]) && (mcu_tim_banks[i] != NULL)) {
|
||||
// DEBUG: print the timer
|
||||
mp_printf(&mp_plat_print, "Timer: %d\n",i);
|
||||
return mcu_tim_banks[i];
|
||||
}
|
||||
}
|
||||
mp_raise_RuntimeError(translate("All timers in use"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void stm_peripherals_timer_preinit(TIM_TypeDef * instance, uint8_t prio, void (*callback)(void)) {
|
||||
size_t tim_idx = stm_peripherals_timer_get_index(instance);
|
||||
stm_timer_callback[tim_idx] = callback;
|
||||
tim_clock_enable(1 << tim_idx);
|
||||
HAL_NVIC_SetPriority(irq_map[tim_idx], prio, 0);
|
||||
HAL_NVIC_EnableIRQ(irq_map[tim_idx]);
|
||||
}
|
||||
|
||||
void stm_peripherals_timer_reserve(TIM_TypeDef * instance) {
|
||||
size_t tim_idx = stm_peripherals_timer_get_index(instance);
|
||||
stm_timer_reserved[tim_idx] = true;
|
||||
}
|
||||
|
||||
void stm_peripherals_timer_set_callback(void(*callback)(void), TIM_TypeDef * timer) {
|
||||
stm_timer_callback[stm_peripherals_timer_get_index(timer)] = callback;
|
||||
}
|
||||
|
||||
void stm_peripherals_timer_free(TIM_TypeDef * instance) {
|
||||
size_t tim_idx = stm_peripherals_timer_get_index(instance);
|
||||
HAL_NVIC_DisableIRQ(irq_map[tim_idx]);
|
||||
stm_timer_callback[tim_idx] = NULL;
|
||||
tim_clock_disable(1 << tim_idx);
|
||||
stm_timer_reserved[tim_idx] = false;
|
||||
stm_timer_never_reset[tim_idx] = false;
|
||||
}
|
||||
|
||||
void stm_peripherals_timer_never_reset(TIM_TypeDef * instance) {
|
||||
size_t tim_idx = stm_peripherals_timer_get_index(instance);
|
||||
stm_timer_never_reset[tim_idx] = true;
|
||||
}
|
||||
void stm_peripherals_timer_reset_ok(TIM_TypeDef * instance) {
|
||||
size_t tim_idx = stm_peripherals_timer_get_index(instance);
|
||||
stm_timer_never_reset[tim_idx] = false;
|
||||
}
|
||||
bool stm_peripherals_timer_is_never_reset(TIM_TypeDef * instance){
|
||||
size_t tim_idx = stm_peripherals_timer_get_index(instance);
|
||||
return stm_timer_never_reset[tim_idx];
|
||||
}
|
||||
bool stm_peripherals_timer_is_reserved(TIM_TypeDef * instance) {
|
||||
size_t tim_idx = stm_peripherals_timer_get_index(instance);
|
||||
return stm_timer_reserved[tim_idx];
|
||||
}
|
||||
|
||||
size_t stm_peripherals_timer_get_index(TIM_TypeDef * instance) {
|
||||
for (size_t i = 0; i < MP_ARRAY_SIZE(mcu_tim_banks); i++) {
|
||||
if (instance == mcu_tim_banks[i]) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return ~(size_t)0;
|
||||
}
|
||||
|
||||
void tim_clock_enable(uint16_t mask) {
|
||||
#ifdef TIM1
|
||||
if (mask & (1 << 0)) {
|
||||
__HAL_RCC_TIM1_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM2
|
||||
if (mask & (1 << 1)) {
|
||||
__HAL_RCC_TIM2_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM3
|
||||
if (mask & (1 << 2)) {
|
||||
__HAL_RCC_TIM3_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM4
|
||||
if (mask & (1 << 3)) {
|
||||
__HAL_RCC_TIM4_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM5
|
||||
if (mask & (1 << 4)) {
|
||||
__HAL_RCC_TIM5_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
//6 and 7 are reserved ADC timers
|
||||
#ifdef TIM8
|
||||
if (mask & (1 << 7)) {
|
||||
__HAL_RCC_TIM8_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM9
|
||||
if (mask & (1 << 8)) {
|
||||
__HAL_RCC_TIM9_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM10
|
||||
if (mask & (1 << 9)) {
|
||||
__HAL_RCC_TIM10_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM11
|
||||
if (mask & (1 << 10)) {
|
||||
__HAL_RCC_TIM11_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM12
|
||||
if (mask & (1 << 11)) {
|
||||
__HAL_RCC_TIM12_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM13
|
||||
if (mask & (1 << 12)) {
|
||||
__HAL_RCC_TIM13_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM14
|
||||
if (mask & (1 << 13)) {
|
||||
__HAL_RCC_TIM14_CLK_ENABLE();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void tim_clock_disable(uint16_t mask) {
|
||||
#ifdef TIM1
|
||||
if (mask & (1 << 0)) {
|
||||
__HAL_RCC_TIM1_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM2
|
||||
if (mask & (1 << 1)) {
|
||||
__HAL_RCC_TIM2_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM3
|
||||
if (mask & (1 << 2)) {
|
||||
__HAL_RCC_TIM3_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM4
|
||||
if (mask & (1 << 3)) {
|
||||
__HAL_RCC_TIM4_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM5
|
||||
if (mask & (1 << 4)) {
|
||||
__HAL_RCC_TIM5_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
//6 and 7 are reserved ADC timers
|
||||
#ifdef TIM8
|
||||
if (mask & (1 << 7)) {
|
||||
__HAL_RCC_TIM8_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM9
|
||||
if (mask & (1 << 8)) {
|
||||
__HAL_RCC_TIM9_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM10
|
||||
if (mask & (1 << 9)) {
|
||||
__HAL_RCC_TIM10_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM11
|
||||
if (mask & (1 << 10)) {
|
||||
__HAL_RCC_TIM11_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM12
|
||||
if (mask & (1 << 11)) {
|
||||
__HAL_RCC_TIM12_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM13
|
||||
if (mask & (1 << 12)) {
|
||||
__HAL_RCC_TIM13_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
#ifdef TIM14
|
||||
if (mask & (1 << 13)) {
|
||||
__HAL_RCC_TIM14_CLK_DISABLE();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
STATIC void callback_router(size_t index) {
|
||||
if (stm_timer_callback[index - 1]) {
|
||||
(*stm_timer_callback[index - 1])();
|
||||
}
|
||||
}
|
||||
|
||||
void TIM1_CC_IRQHandler(void) { // Advanced timer
|
||||
callback_router(1);
|
||||
}
|
||||
void TIM2_IRQHandler(void) {
|
||||
callback_router(2);
|
||||
}
|
||||
void TIM3_IRQHandler(void) {
|
||||
callback_router(3);
|
||||
}
|
||||
void TIM4_IRQHandler(void) {
|
||||
callback_router(4);
|
||||
}
|
||||
void TIM5_IRQHandler(void) {
|
||||
callback_router(5);
|
||||
}
|
||||
void TIM6_DAC_IRQHandler(void) { // Basic timer (DAC)
|
||||
callback_router(6);
|
||||
}
|
||||
void TIM7_IRQHandler(void) { // Basic timer
|
||||
callback_router(7);
|
||||
}
|
||||
void TIM8_CC_IRQHandler(void) { // Advanced timer
|
||||
callback_router(8);
|
||||
}
|
||||
|
||||
// Advanced timer interrupts are currently unused.
|
||||
void TIM1_BRK_TIM9_IRQHandler(void) {
|
||||
callback_router(9);
|
||||
}
|
||||
void TIM1_UP_TIM10_IRQHandler(void) {
|
||||
callback_router(10);
|
||||
}
|
||||
void TIM1_TRG_COM_TIM11_IRQHandler(void) {
|
||||
callback_router(11);
|
||||
}
|
||||
void TIM8_BRK_TIM12_IRQHandler(void) {
|
||||
callback_router(12);
|
||||
}
|
||||
void TIM8_UP_TIM13_IRQHandler(void) {
|
||||
callback_router(13);
|
||||
}
|
||||
void TIM8_TRG_COM_TIM14_IRQHandler(void) {
|
||||
callback_router(14);
|
||||
}
|
||||
|
||||
#if (CPY_STM32H7)
|
||||
void TIM15_IRQHandler(void) {
|
||||
callback_router(15);
|
||||
}
|
||||
void TIM16_IRQHandler(void) {
|
||||
callback_router(16);
|
||||
}
|
||||
void TIM17_IRQHandler(void) {
|
||||
callback_router(17);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
46
ports/stm/peripherals/timers.h
Normal file
46
ports/stm/peripherals/timers.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file is part of the Micro Python project, http://micropython.org/
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2020 Lucian Copeland for Adafruit Industries
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "py/mphal.h"
|
||||
#include "peripherals/periph.h"
|
||||
|
||||
#include STM32_HAL_H
|
||||
|
||||
void tim_clock_enable(uint16_t mask);
|
||||
void tim_clock_disable(uint16_t mask);
|
||||
uint32_t stm_peripherals_timer_get_source_freq(TIM_TypeDef * timer);
|
||||
size_t stm_peripherals_timer_get_irqnum(TIM_TypeDef * instance);
|
||||
void timers_reset(void);
|
||||
TIM_TypeDef * stm_peripherals_find_timer(void);
|
||||
void stm_peripherals_timer_preinit(TIM_TypeDef * instance, uint8_t prio, void (*callback)(void));
|
||||
void stm_peripherals_timer_reserve(TIM_TypeDef * instance);
|
||||
void stm_peripherals_timer_free(TIM_TypeDef * instance);
|
||||
void stm_peripherals_timer_never_reset(TIM_TypeDef * instance);
|
||||
void stm_peripherals_timer_reset_ok(TIM_TypeDef * instance);
|
||||
bool stm_peripherals_timer_is_never_reset(TIM_TypeDef * instance);
|
||||
bool stm_peripherals_timer_is_reserved(TIM_TypeDef * instance);
|
||||
size_t stm_peripherals_timer_get_index(TIM_TypeDef * instance);
|
@ -41,6 +41,7 @@
|
||||
#include "common-hal/pulseio/PWMOut.h"
|
||||
#include "common-hal/pulseio/PulseOut.h"
|
||||
#include "common-hal/pulseio/PulseIn.h"
|
||||
#include "timers.h"
|
||||
#endif
|
||||
|
||||
#include "clocks.h"
|
||||
@ -224,6 +225,7 @@ void reset_port(void) {
|
||||
uart_reset();
|
||||
#endif
|
||||
#if CIRCUITPY_PULSEIO
|
||||
timers_reset();
|
||||
pwmout_reset();
|
||||
pulseout_reset();
|
||||
pulsein_reset();
|
||||
|
@ -86,6 +86,8 @@ void init_usb_hardware(void) {
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
never_reset_pin_number(0, 11);
|
||||
never_reset_pin_number(0, 12);
|
||||
claim_pin(0, 11);
|
||||
claim_pin(0, 12);
|
||||
|
||||
/* Configure VBUS Pin */
|
||||
#if !(BOARD_NO_VBUS_SENSE)
|
||||
@ -94,6 +96,7 @@ void init_usb_hardware(void) {
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
never_reset_pin_number(0, 9);
|
||||
claim_pin(0, 9);
|
||||
#endif
|
||||
|
||||
/* This for ID line debug */
|
||||
@ -108,6 +111,7 @@ void init_usb_hardware(void) {
|
||||
#endif
|
||||
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||
never_reset_pin_number(0, 10);
|
||||
claim_pin(0, 10);
|
||||
|
||||
#ifdef STM32F412Zx
|
||||
/* Configure POWER_SWITCH IO pin (F412 ONLY)*/
|
||||
@ -116,6 +120,7 @@ void init_usb_hardware(void) {
|
||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
|
||||
never_reset_pin_number(0, 8);
|
||||
claim_pin(0, 8);
|
||||
#endif
|
||||
|
||||
#if CPY_STM32H7
|
||||
|
@ -52,6 +52,8 @@ def evaluate_tim(inper, inlist, altfn, pin):
|
||||
|
||||
if inper[:3] == "TIM" and inper[5:7] == "CH" and inper[-1:] != 'N':
|
||||
inlist.append([inper[3:4],altfn,inper[-1:],pin])
|
||||
elif inper[:3] == "TIM" and inper[6:8] == "CH" and inper[-1:] != 'N':
|
||||
inlist.append([inper[3:5],altfn,inper[-1:],pin])
|
||||
|
||||
# Open target file
|
||||
with open(sys.argv[1]) as csv_file:
|
||||
|
@ -1,93 +0,0 @@
|
||||
A0,PA3
|
||||
A1,PC0
|
||||
A2,PC3
|
||||
A3,PB1
|
||||
A4,PC2
|
||||
A5,PF10
|
||||
A6,PF4
|
||||
A7,PF5
|
||||
A8,PF6
|
||||
D0,PB7
|
||||
D1,PB6
|
||||
D2,PG14
|
||||
D3,PE13
|
||||
D4,PE14
|
||||
D5,PE11
|
||||
D6,PE9
|
||||
D7,PG12
|
||||
D8,PF3
|
||||
D9,PD15
|
||||
D10,PD14
|
||||
D11,PB5
|
||||
D12,PA6
|
||||
D13,PA5
|
||||
D14,PB9
|
||||
D15,PB8
|
||||
D16,PC6
|
||||
D17,PB15
|
||||
D18,PB13
|
||||
D19,PB12
|
||||
D20,PA15
|
||||
D21,PC7
|
||||
D22,PB5
|
||||
D23,PB3
|
||||
D24,PA4
|
||||
D25,PB4
|
||||
D26,PG6
|
||||
D27,PB2
|
||||
D28,PD13
|
||||
D29,PD12
|
||||
D30,PD11
|
||||
D31,PE2
|
||||
D32,PA0
|
||||
D33,PB0
|
||||
D34,PE0
|
||||
D35,PB11
|
||||
D36,PB10
|
||||
D37,PE15
|
||||
D38,PE6
|
||||
D39,PE12
|
||||
D40,PE10
|
||||
D41,PE7
|
||||
D42,PE8
|
||||
D43,PC8
|
||||
D44,PC9
|
||||
D45,PC10
|
||||
D46,PC11
|
||||
D47,PC12
|
||||
D48,PD2
|
||||
D49,PG2
|
||||
D50,PG3
|
||||
D51,PD7
|
||||
D52,PD6
|
||||
D53,PD5
|
||||
D54,PD4
|
||||
D55,PD3
|
||||
D56,PE2
|
||||
D57,PE4
|
||||
D58,PE5
|
||||
D59,PE6
|
||||
D60,PE3
|
||||
D61,PF8
|
||||
D62,PF7
|
||||
D63,PF9
|
||||
D64,PG1
|
||||
D65,PG0
|
||||
D66,PD1
|
||||
D67,PD0
|
||||
D68,PF0
|
||||
D69,PF1
|
||||
D70,PF2
|
||||
D71,PE0
|
||||
D72,PB2
|
||||
SDA,PB9
|
||||
SCL,PB8
|
||||
MOSI,PB5
|
||||
MISO,PA6
|
||||
SCK,PA5
|
||||
RX,PB7
|
||||
TX,PB6
|
||||
LED1,PB00
|
||||
LED2,PE01
|
||||
LED3,PB14
|
||||
SW,PC13
|
|
@ -1,168 +0,0 @@
|
||||
PortA,PA0,,TIM2_CH1/TIM2_ETR,TIM5_CH1,TIM8_ETR,,,,USART2_CTS,UART4_TX,,SAI2_SD_B,ETH_MII_CRS,,,,EVENTOUT,ADC123_IN0
|
||||
PortA,PA1,,TIM2_CH2,TIM5_CH2,,,,,USART2_RTS,UART4_RX,QUADSPI_BK1_IO3,SAI2_MCK_B,ETH_MII_RX_CLK/ETH_RMII_REF_CLK,,,LCD_R2,EVENTOUT,ADC123_IN1
|
||||
PortA,PA2,,TIM2_CH3,TIM5_CH3,TIM9_CH1,,,,USART2_TX,SAI2_SCK_B,,,ETH_MDIO,MDIOS_MDIO,,LCD_R1,EVENTOUT,ADC123_IN2
|
||||
PortA,PA3,,TIM2_CH4,TIM5_CH4,TIM9_CH2,,,,USART2_RX,,LCD_B2,OTG_HS_ULPI_D0,ETH_MII_COL,,,LCD_B5,EVENTOUT,ADC123_IN3
|
||||
PortA,PA4,,,,,,SPI1_NSS/I2S1_WS,SPI3_NSS/I2S3_WS,USART2_CK,SPI6_NSS,,,,OTG_HS_SOF,DCMI_HSYNC,LCD_VSYNC,EVENTOUT,ADC12_IN4
|
||||
PortA,PA5,,TIM2_CH1/TIM2_ETR,,TIM8_CH1N,,SPI1_SCK/I2S1_CK,,,SPI6_SCK,,OTG_HS_ULPI_CK,,,,LCD_R4,EVENTOUT,ADC12_IN5
|
||||
PortA,PA6,,TIM1_BKIN,TIM3_CH1,TIM8_BKIN,,SPI1_MISO,,,SPI6_MISO,TIM13_CH1,,,MDIOS_MDC,DCMI_PIXCLK,LCD_G2,EVENTOUT,ADC12_IN6
|
||||
PortA,PA7,,TIM1_CH1N,TIM3_CH2,TIM8_CH1N,,SPI1_MOSI/I2S1_SD,,,SPI6_MOSI,TIM14_CH1,,ETH_MII_RX_DV/ETH_RMII_CRS_DV,FMC_SDNWE,,,EVENTOUT,ADC12_IN7
|
||||
PortA,PA8,MCO1,TIM1_CH1,,TIM8_BKIN2,I2C3_SCL,,,USART1_CK,,,OTG_FS_SOF,CAN3_RX,UART7_RX,LCD_B3,LCD_R6,EVENTOUT,
|
||||
PortA,PA9,,TIM1_CH2,,,I2C3_SMBA,SPI2_SCK/I2S2_CK,,USART1_TX,,,,,,DCMI_D0,LCD_R5,EVENTOUT,
|
||||
PortA,PA10,,TIM1_CH3,,,,,,USART1_RX,,LCD_B4,OTG_FS_ID,,MDIOS_MDIO,DCMI_D1,LCD_B1,EVENTOUT,
|
||||
PortA,PA11,,TIM1_CH4,,,,SPI2_NSS/I2S2_WS,UART4_RX,USART1_CTS,,CAN1_RX,OTG_FS_DM,,,,LCD_R4,EVENTOUT,
|
||||
PortA,PA12,,TIM1_ETR,,,,SPI2_SCK/I2S2_CK,UART4_TX,USART1_RTS,SAI2_FS_B,CAN1_TX,OTG_FS_DP,,,,LCD_R5,EVENTOUT,
|
||||
PortA,PA13,JTMS/SWDIO,,,,,,,,,,,,,,,EVENTOUT,
|
||||
PortA,PA14,JTCK/SWCLK,,,,,,,,,,,,,,,EVENTOUT,
|
||||
PortA,PA15,JTDI,TIM2_CH1/TIM2_ETR,,,HDMI_CEC,SPI1_NSS/I2S1_WS,SPI3_NSS/I2S3_WS,SPI6_NSS,UART4_RTS,,,CAN3_TX,UART7_TX,,,EVENTOUT,
|
||||
PortB,PB0,,TIM1_CH2N,TIM3_CH3,TIM8_CH2N,,,DFSDM1_CKOUT,,UART4_CTS,LCD_R3,OTG_HS_ULPI_D1,ETH_MII_RXD2,,,LCD_G1,EVENTOUT,ADC12_IN8
|
||||
PortB,PB1,,TIM1_CH3N,TIM3_CH4,TIM8_CH3N,,,DFSDM1_DATAIN1,,,LCD_R6,OTG_HS_ULPI_D2,ETH_MII_RXD3,,,LCD_G0,EVENTOUT,ADC12_IN9
|
||||
PortB,PB2,,,,,,,SAI1_SD_A,SPI3_MOSI/I2S3_SD,,QUADSPI_CLK,DFSDM1_CKIN1,,,,,EVENTOUT,
|
||||
PortB,PB3,JTDO/TRACESWO,TIM2_CH2,,,,SPI1_SCK/I2S1_CK,SPI3_SCK/I2S3_CK,,SPI6_SCK,,SDMMC2_D2,CAN3_RX,UART7_RX,,,EVENTOUT,
|
||||
PortB,PB4,NJTRST,,TIM3_CH1,,,SPI1_MISO,SPI3_MISO,SPI2_NSS/I2S2_WS,SPI6_MISO,,SDMMC2_D3,CAN3_TX,UART7_TX,,,EVENTOUT,
|
||||
PortB,PB5,,UART5_RX,TIM3_CH2,,I2C1_SMBA,SPI1_MOSI/I2S1_SD,SPI3_MOSI/I2S3_SD,,SPI6_MOSI,CAN2_RX,OTG_HS_ULPI_D7,ETH_PPS_OUT,FMC_SDCKE1,DCMI_D10,LCD_G7,EVENTOUT,
|
||||
PortB,PB6,,UART5_TX,TIM4_CH1,HDMI_CEC,I2C1_SCL,,DFSDM1_DATAIN5,USART1_TX,,CAN2_TX,QUADSPI_BK1_NCS,I2C4_SCL,FMC_SDNE1,DCMI_D5,,EVENTOUT,
|
||||
PortB,PB7,,,TIM4_CH2,,I2C1_SDA,,DFSDM1_CKIN5,USART1_RX,,,,I2C4_SDA,FMC_NL,DCMI_VSYNC,,EVENTOUT,
|
||||
PortB,PB8,,I2C4_SCL,TIM4_CH3,TIM10_CH1,I2C1_SCL,,DFSDM1_CKIN7,UART5_RX,,CAN1_RX,SDMMC2_D4,ETH_MII_TXD3,SDMMC1_D4,DCMI_D6,LCD_B6,EVENTOUT,
|
||||
PortB,PB9,,I2C4_SDA,TIM4_CH4,TIM11_CH1,I2C1_SDA,SPI2_NSS/I2S2_WS,DFSDM1_DATAIN7,UART5_TX,,CAN1_TX,SDMMC2_D5,I2C4_SMBA,SDMMC1_D5,DCMI_D7,LCD_B7,EVENTOUT,
|
||||
PortB,PB10,,TIM2_CH3,,,I2C2_SCL,SPI2_SCK/I2S2_CK,DFSDM1_DATAIN7,USART3_TX,,QUADSPI_BK1_NCS,OTG_HS_ULPI_D3,ETH_MII_RX_ER,,,LCD_G4,EVENTOUT,
|
||||
PortB,PB11,,TIM2_CH4,,,I2C2_SDA,,DFSDM1_CKIN7,USART3_RX,,,OTG_HS_ULPI_D4,ETH_MII_TX_EN/ETH_RMII_TX_EN,,DSI_TE,LCD_G5,EVENTOUT,
|
||||
PortB,PB12,,TIM1_BKIN,,,I2C2_SMBA,SPI2_NSS/I2S2_WS,DFSDM1_DATAIN1,USART3_CK,UART5_RX,CAN2_RX,OTG_HS_ULPI_D5,ETH_MII_TXD0/ETH_RMII_TXD0,OTG_HS_ID,,,EVENTOUT,
|
||||
PortB,PB13,,TIM1_CH1N,,,,SPI2_SCK/I2S2_CK,DFSDM1_CKIN1,USART3_CTS,UART5_TX,CAN2_TX,OTG_HS_ULPI_D6,ETH_MII_TXD1/ETH_RMII_TXD1,,,,EVENTOUT,
|
||||
PortB,PB14,,TIM1_CH2N,,TIM8_CH2N,USART1_TX,SPI2_MISO,DFSDM1_DATAIN2,USART3_RTS,UART4_RTS,TIM12_CH1,SDMMC2_D0,,OTG_HS_DM,,,EVENTOUT,
|
||||
PortB,PB15,RTC_REFIN,TIM1_CH3N,,TIM8_CH3N,USART1_RX,SPI2_MOSI/I2S2_SD,DFSDM1_CKIN2,,UART4_CTS,TIM12_CH2,SDMMC2_D1,,OTG_HS_DP,,,EVENTOUT,
|
||||
PortC,PC0,,,,DFSDM1_CKIN0,,,DFSDM1_DATAIN4,,SAI2_FS_B,,OTG_HS_ULPI_STP,,FMC_SDNWE,,LCD_R5,EVENTOUT,ADC123_IN10
|
||||
PortC,PC1,TRACED0,,,DFSDM1_DATAIN0,,SPI2_MOSI/I2S2_SD,SAI1_SD_A,,,,DFSDM1_CKIN4,ETH_MDC,MDIOS_MDC,,,EVENTOUT,ADC123_IN11
|
||||
PortC,PC2,,,,DFSDM1_CKIN1,,SPI2_MISO,DFSDM1_CKOUT,,,,OTG_HS_ULPI_DIR,ETH_MII_TXD2,FMC_SDNE0,,,EVENTOUT,ADC123_IN12
|
||||
PortC,PC3,,,,DFSDM1_DATAIN1,,SPI2_MOSI/I2S2_SD,,,,,OTG_HS_ULPI_NXT,ETH_MII_TX_CLK,FMC_SDCKE0,,,EVENTOUT,ADC123_IN13
|
||||
PortC,PC4,,,,DFSDM1_CKIN2,,I2S1_MCK,,,SPDIFRX_IN2,,,ETH_MII_RXD0/ETH_RMII_RXD0,FMC_SDNE0,,,EVENTOUT,ADC12_IN14
|
||||
PortC,PC5,,,,DFSDM1_DATAIN2,,,,,SPDIFRX_IN3,,,ETH_MII_RXD1/ETH_RMII_RXD1,FMC_SDCKE0,,,EVENTOUT,ADC12_IN15
|
||||
PortC,PC6,,,TIM3_CH1,TIM8_CH1,,I2S2_MCK,,DFSDM1_CKIN3,USART6_TX,FMC_NWAIT,SDMMC2_D6,,SDMMC1_D6,DCMI_D0,LCD_HSYNC,EVENTOUT,
|
||||
PortC,PC7,,,TIM3_CH2,TIM8_CH2,,,I2S3_MCK,DFSDM1_DATAIN3,USART6_RX,FMC_NE1,SDMMC2_D7,,SDMMC1_D7,DCMI_D1,LCD_G6,EVENTOUT,
|
||||
PortC,PC8,TRACED1,,TIM3_CH3,TIM8_CH3,,,,UART5_RTS,USART6_CK,FMC_NE2/FMC_NCE,,,SDMMC1_D0,DCMI_D2,,EVENTOUT,
|
||||
PortC,PC9,MCO2,,TIM3_CH4,TIM8_CH4,I2C3_SDA,I2S_CKIN,,UART5_CTS,,QUADSPI_BK1_IO0,LCD_G3,,SDMMC1_D1,DCMI_D3,LCD_B2,EVENTOUT,
|
||||
PortC,PC10,,,,DFSDM1_CKIN5,,,SPI3_SCK/I2S3_CK,USART3_TX,UART4_TX,QUADSPI_BK1_IO1,,,SDMMC1_D2,DCMI_D8,LCD_R2,EVENTOUT,
|
||||
PortC,PC11,,,,DFSDM1_DATAIN5,,,SPI3_MISO,USART3_RX,UART4_RX,QUADSPI_BK2_NCS,,,SDMMC1_D3,DCMI_D4,,EVENTOUT,
|
||||
PortC,PC12,TRACED3,,,,,,SPI3_MOSI/I2S3_SD,USART3_CK,UART5_TX,,,,SDMMC1_CK,DCMI_D9,,EVENTOUT,
|
||||
PortC,PC13,,,,,,,,,,,,,,,,EVENTOUT,
|
||||
PortC,PC14,,,,,,,,,,,,,,,,EVENTOUT,
|
||||
PortC,PC15,,,,,,,,,,,,,,,,EVENTOUT,
|
||||
PortD,PD0,,,,DFSDM1_CKIN6,,,DFSDM1_DATAIN7,,UART4_RX,CAN1_RX,,,FMC_D2,,,EVENTOUT,
|
||||
PortD,PD1,,,,DFSDM1_DATAIN6,,,DFSDM1_CKIN7,,UART4_TX,CAN1_TX,,,FMC_D3,,,EVENTOUT,
|
||||
PortD,PD2,TRACED2,,TIM3_ETR,,,,,,UART5_RX,,,,SDMMC1_CMD,DCMI_D11,,EVENTOUT,
|
||||
PortD,PD3,,,,DFSDM1_CKOUT,,SPI2_SCK/I2S2_CK,DFSDM1_DATAIN0,USART2_CTS,,,,,FMC_CLK,DCMI_D5,LCD_G7,EVENTOUT,
|
||||
PortD,PD4,,,,,,,DFSDM1_CKIN0,USART2_RTS,,,,,FMC_NOE,,,EVENTOUT,
|
||||
PortD,PD5,,,,,,,,USART2_TX,,,,,FMC_NWE,,,EVENTOUT,
|
||||
PortD,PD6,,,,DFSDM1_CKIN4,,SPI3_MOSI/I2S3_SD,SAI1_SD_A,USART2_RX,,,DFSDM1_DATAIN1,SDMMC2_CK,FMC_NWAIT,DCMI_D10,LCD_B2,EVENTOUT,
|
||||
PortD,PD7,,,,DFSDM1_DATAIN4,,SPI1_MOSI/I2S1_SD,DFSDM1_CKIN1,USART2_CK,SPDIFRX_IN0,,,SDMMC2_CMD,FMC_NE1,,,EVENTOUT,
|
||||
PortD,PD8,,,,DFSDM1_CKIN3,,,,USART3_TX,SPDIFRX_IN1,,,,FMC_D13,,,EVENTOUT,
|
||||
PortD,PD9,,,,DFSDM1_DATAIN3,,,,USART3_RX,,,,,FMC_D14,,,EVENTOUT,
|
||||
PortD,PD10,,,,DFSDM1_CKOUT,,,,USART3_CK,,,,,FMC_D15,,LCD_B3,EVENTOUT,
|
||||
PortD,PD11,,,,,I2C4_SMBA,,,USART3_CTS,,QUADSPI_BK1_IO0,SAI2_SD_A,,FMC_A16/FMC_CLE,,,EVENTOUT,
|
||||
PortD,PD12,,,TIM4_CH1,LPTIM1_IN1,I2C4_SCL,,,USART3_RTS,,QUADSPI_BK1_IO1,SAI2_FS_A,,FMC_A17/FMC_ALE,,,EVENTOUT,
|
||||
PortD,PD13,,,TIM4_CH2,LPTIM1_OUT,I2C4_SDA,,,,,QUADSPI_BK1_IO3,SAI2_SCK_A,,FMC_A18,,,EVENTOUT,
|
||||
PortD,PD14,,,TIM4_CH3,,,,,,UART8_CTS,,,,FMC_D0,,,EVENTOUT,
|
||||
PortD,PD15,,,TIM4_CH4,,,,,,UART8_RTS,,,,FMC_D1,,,EVENTOUT,
|
||||
PortE,PE0,,,TIM4_ETR,LPTIM1_ETR,,,,,UART8_RX,,SAI2_MCK_A,,FMC_NBL0,DCMI_D2,,EVENTOUT,
|
||||
PortE,PE1,,,,LPTIM1_IN2,,,,,UART8_TX,,,,FMC_NBL1,DCMI_D3,,EVENTOUT,
|
||||
PortE,PE2,TRACECLK,,,,,SPI4_SCK,SAI1_MCLK_A,,,QUADSPI_BK1_IO2,,ETH_MII_TXD3,FMC_A23,,,EVENTOUT,
|
||||
PortE,PE3,TRACED0,,,,,,SAI1_SD_B,,,,,,FMC_A19,,,EVENTOUT,
|
||||
PortE,PE4,TRACED1,,,,,SPI4_NSS,SAI1_FS_A,,,,DFSDM1_DATAIN3,,FMC_A20,DCMI_D4,LCD_B0,EVENTOUT,
|
||||
PortE,PE5,TRACED2,,,TIM9_CH1,,SPI4_MISO,SAI1_SCK_A,,,,DFSDM1_CKIN3,,FMC_A21,DCMI_D6,LCD_G0,EVENTOUT,
|
||||
PortE,PE6,TRACED3,TIM1_BKIN2,,TIM9_CH2,,SPI4_MOSI,SAI1_SD_A,,,,SAI2_MCK_B,,FMC_A22,DCMI_D7,LCD_G1,EVENTOUT,
|
||||
PortE,PE7,,TIM1_ETR,,,,,DFSDM1_DATAIN2,,UART7_RX,,QUADSPI_BK2_IO0,,FMC_D4,,,EVENTOUT,
|
||||
PortE,PE8,,TIM1_CH1N,,,,,DFSDM1_CKIN2,,UART7_TX,,QUADSPI_BK2_IO1,,FMC_D5,,,EVENTOUT,
|
||||
PortE,PE9,,TIM1_CH1,,,,,DFSDM1_CKOUT,,UART7_RTS,,QUADSPI_BK2_IO2,,FMC_D6,,,EVENTOUT,
|
||||
PortE,PE10,,TIM1_CH2N,,,,,DFSDM1_DATAIN4,,UART7_CTS,,QUADSPI_BK2_IO3,,FMC_D7,,,EVENTOUT,
|
||||
PortE,PE11,,TIM1_CH2,,,,SPI4_NSS,DFSDM1_CKIN4,,,,SAI2_SD_B,,FMC_D8,,LCD_G3,EVENTOUT,
|
||||
PortE,PE12,,TIM1_CH3N,,,,SPI4_SCK,DFSDM1_DATAIN5,,,,SAI2_SCK_B,,FMC_D9,,LCD_B4,EVENTOUT,
|
||||
PortE,PE13,,TIM1_CH3,,,,SPI4_MISO,DFSDM1_CKIN5,,,,SAI2_FS_B,,FMC_D10,,LCD_DE,EVENTOUT,
|
||||
PortE,PE14,,TIM1_CH4,,,,SPI4_MOSI,,,,,SAI2_MCK_B,,FMC_D11,,LCD_CLK,EVENTOUT,
|
||||
PortE,PE15,,TIM1_BKIN,,,,,,,,,,,FMC_D12,,LCD_R7,EVENTOUT,
|
||||
PortF,PF0,,,,,I2C2_SDA,,,,,,,,FMC_A0,,,EVENTOUT,
|
||||
PortF,PF1,,,,,I2C2_SCL,,,,,,,,FMC_A1,,,EVENTOUT,
|
||||
PortF,PF2,,,,,I2C2_SMBA,,,,,,,,FMC_A2,,,EVENTOUT,
|
||||
PortF,PF3,,,,,,,,,,,,,FMC_A3,,,EVENTOUT,ADC3_IN9
|
||||
PortF,PF4,,,,,,,,,,,,,FMC_A4,,,EVENTOUT,ADC3_IN14
|
||||
PortF,PF5,,,,,,,,,,,,,FMC_A5,,,EVENTOUT,ADC3_IN15
|
||||
PortF,PF6,,,,TIM10_CH1,,SPI5_NSS,SAI1_SD_B,,UART7_RX,QUADSPI_BK1_IO3,,,,,,EVENTOUT,ADC3_IN4
|
||||
PortF,PF7,,,,TIM11_CH1,,SPI5_SCK,SAI1_MCLK_B,,UART7_TX,QUADSPI_BK1_IO2,,,,,,EVENTOUT,ADC3_IN5
|
||||
PortF,PF8,,,,,,SPI5_MISO,SAI1_SCK_B,,UART7_RTS,TIM13_CH1,QUADSPI_BK1_IO0,,,,,EVENTOUT,ADC3_IN6
|
||||
PortF,PF9,,,,,,SPI5_MOSI,SAI1_FS_B,,UART7_CTS,TIM14_CH1,QUADSPI_BK1_IO1,,,,,EVENTOUT,ADC3_IN7
|
||||
PortF,PF10,,,,,,,,,,QUADSPI_CLK,,,,DCMI_D11,LCD_DE,EVENTOUT,ADC3_IN8
|
||||
PortF,PF11,,,,,,SPI5_MOSI,,,,,SAI2_SD_B,,FMC_SDNRAS,DCMI_D12,,EVENTOUT,
|
||||
PortF,PF12,,,,,,,,,,,,,FMC_A6,,,EVENTOUT,
|
||||
PortF,PF13,,,,,I2C4_SMBA,,DFSDM1_DATAIN6,,,,,,FMC_A7,,,EVENTOUT,
|
||||
PortF,PF14,,,,,I2C4_SCL,,DFSDM1_CKIN6,,,,,,FMC_A8,,,EVENTOUT,
|
||||
PortF,PF15,,,,,I2C4_SDA,,,,,,,,FMC_A9,,,EVENTOUT,
|
||||
PortG,PG0,,,,,,,,,,,,,FMC_A10,,,EVENTOUT,
|
||||
PortG,PG1,,,,,,,,,,,,,FMC_A11,,,EVENTOUT,
|
||||
PortG,PG2,,,,,,,,,,,,,FMC_A12,,,EVENTOUT,
|
||||
PortG,PG3,,,,,,,,,,,,,FMC_A13,,,EVENTOUT,
|
||||
PortG,PG4,,,,,,,,,,,,,FMC_A14/FMC_BA0,,,EVENTOUT,
|
||||
PortG,PG5,,,,,,,,,,,,,FMC_A15/FMC_BA1,,,EVENTOUT,
|
||||
PortG,PG6,,,,,,,,,,,,,FMC_NE3,DCMI_D12,LCD_R7,EVENTOUT,
|
||||
PortG,PG7,,,,,,,SAI1_MCLK_A,,USART6_CK,,,,FMC_INT,DCMI_D13,LCD_CLK,EVENTOUT,
|
||||
PortG,PG8,,,,,,SPI6_NSS,,SPDIFRX_IN2,USART6_RTS,,,ETH_PPS_OUT,FMC_SDCLK,,LCD_G7,EVENTOUT,
|
||||
PortG,PG9,,,,,,SPI1_MISO,,SPDIFRX_IN3,USART6_RX,QUADSPI_BK2_IO2,SAI2_FS_B,SDMMC2_D0,FMC_NE2/FMC_NCE,DCMI_VSYNC,,EVENTOUT,
|
||||
PortG,PG10,,,,,,SPI1_NSS/I2S1_WS,,,,LCD_G3,SAI2_SD_B,SDMMC2_D1,FMC_NE3,DCMI_D2,LCD_B2,EVENTOUT,
|
||||
PortG,PG11,,,,,,SPI1_SCK/I2S1_CK,,SPDIFRX_IN0,,,SDMMC2_D2,ETH_MII_TX_EN/ETH_RMII_TX_EN,,DCMI_D3,LCD_B3,EVENTOUT,
|
||||
PortG,PG12,,,,LPTIM1_IN1,,SPI6_MISO,,SPDIFRX_IN1,USART6_RTS,LCD_B4,,SDMMC2_D3,FMC_NE4,,LCD_B1,EVENTOUT,
|
||||
PortG,PG13,TRACED0,,,LPTIM1_OUT,,SPI6_SCK,,,USART6_CTS,,,ETH_MII_TXD0/ETH_RMII_TXD0,FMC_A24,,LCD_R0,EVENTOUT,
|
||||
PortG,PG14,TRACED1,,,LPTIM1_ETR,,SPI6_MOSI,,,USART6_TX,QUADSPI_BK2_IO3,,ETH_MII_TXD1/ETH_RMII_TXD1,FMC_A25,,LCD_B0,EVENTOUT,
|
||||
PortG,PG15,,,,,,,,,USART6_CTS,,,,FMC_SDNCAS,DCMI_D13,,EVENTOUT,
|
||||
PortH,PH0,,,,,,,,,,,,,,,,EVENTOUT,
|
||||
PortH,PH1,,,,,,,,,,,,,,,,EVENTOUT,
|
||||
PortH,PH2,,,,LPTIM1_IN2,,,,,,QUADSPI_BK2_IO0,SAI2_SCK_B,ETH_MII_CRS,FMC_SDCKE0,,LCD_R0,EVENTOUT,
|
||||
PortH,PH3,,,,,,,,,,QUADSPI_BK2_IO1,SAI2_MCK_B,ETH_MII_COL,FMC_SDNE0,,LCD_R1,EVENTOUT,
|
||||
PortH,PH4,,,,,I2C2_SCL,,,,,LCD_G5,OTG_HS_ULPI_NXT,,,,LCD_G4,EVENTOUT,
|
||||
PortH,PH5,,,,,I2C2_SDA,SPI5_NSS,,,,,,,FMC_SDNWE,,,EVENTOUT,
|
||||
PortH,PH6,,,,,I2C2_SMBA,SPI5_SCK,,,,TIM12_CH1,,ETH_MII_RXD2,FMC_SDNE1,DCMI_D8,,EVENTOUT,
|
||||
PortH,PH7,,,,,I2C3_SCL,SPI5_MISO,,,,,,ETH_MII_RXD3,FMC_SDCKE1,DCMI_D9,,EVENTOUT,
|
||||
PortH,PH8,,,,,I2C3_SDA,,,,,,,,FMC_D16,DCMI_HSYNC,LCD_R2,EVENTOUT,
|
||||
PortH,PH9,,,,,I2C3_SMBA,,,,,TIM12_CH2,,,FMC_D17,DCMI_D0,LCD_R3,EVENTOUT,
|
||||
PortH,PH10,,,TIM5_CH1,,I2C4_SMBA,,,,,,,,FMC_D18,DCMI_D1,LCD_R4,EVENTOUT,
|
||||
PortH,PH11,,,TIM5_CH2,,I2C4_SCL,,,,,,,,FMC_D19,DCMI_D2,LCD_R5,EVENTOUT,
|
||||
PortH,PH12,,,TIM5_CH3,,I2C4_SDA,,,,,,,,FMC_D20,DCMI_D3,LCD_R6,EVENTOUT,
|
||||
PortH,PH13,,,,TIM8_CH1N,,,,,UART4_TX,CAN1_TX,,,FMC_D21,,LCD_G2,EVENTOUT,
|
||||
PortH,PH14,,,,TIM8_CH2N,,,,,UART4_RX,CAN1_RX,,,FMC_D22,DCMI_D4,LCD_G3,EVENTOUT,
|
||||
PortH,PH15,,,,TIM8_CH3N,,,,,,,,,FMC_D23,DCMI_D11,LCD_G4,EVENTOUT,
|
||||
PortI,PI0,,,TIM5_CH4,,,SPI2_NSS/I2S2_WS,,,,,,,FMC_D24,DCMI_D13,LCD_G5,EVENTOUT,
|
||||
PortI,PI1,,,,TIM8_BKIN2,,SPI2_SCK/I2S2_CK,,,,,,,FMC_D25,DCMI_D8,LCD_G6,EVENTOUT,
|
||||
PortI,PI2,,,,TIM8_CH4,,SPI2_MISO,,,,,,,FMC_D26,DCMI_D9,LCD_G7,EVENTOUT,
|
||||
PortI,PI3,,,,TIM8_ETR,,SPI2_MOSI/I2S2_SD,,,,,,,FMC_D27,DCMI_D10,,EVENTOUT,
|
||||
PortI,PI4,,,,TIM8_BKIN,,,,,,,SAI2_MCK_A,,FMC_NBL2,DCMI_D5,LCD_B4,EVENTOUT,
|
||||
PortI,PI5,,,,TIM8_CH1,,,,,,,SAI2_SCK_A,,FMC_NBL3,DCMI_VSYNC,LCD_B5,EVENTOUT,
|
||||
PortI,PI6,,,,TIM8_CH2,,,,,,,SAI2_SD_A,,FMC_D28,DCMI_D6,LCD_B6,EVENTOUT,
|
||||
PortI,PI7,,,,TIM8_CH3,,,,,,,SAI2_FS_A,,FMC_D29,DCMI_D7,LCD_B7,EVENTOUT,
|
||||
PortI,PI8,,,,,,,,,,,,,,,,EVENTOUT,
|
||||
PortI,PI9,,,,,,,,,UART4_RX,CAN1_RX,,,FMC_D30,,LCD_VSYNC,EVENTOUT,
|
||||
PortI,PI10,,,,,,,,,,,,ETH_MII_RX_ER,FMC_D31,,LCD_HSYNC,EVENTOUT,
|
||||
PortI,PI11,,,,,,,,,,LCD_G6,OTG_HS_ULPI_DIR,,,,,EVENTOUT,
|
||||
PortI,PI12,,,,,,,,,,,,,,,LCD_HSYNC,EVENTOUT,
|
||||
PortI,PI13,,,,,,,,,,,,,,,LCD_VSYNC,EVENTOUT,
|
||||
PortI,PI14,,,,,,,,,,,,,,,LCD_CLK,EVENTOUT,
|
||||
PortI,PI15,,,,,,,,,,LCD_G2,,,,,LCD_R0,EVENTOUT,
|
||||
PortJ,PJ0,,,,,,,,,,LCD_R7,,,,,LCD_R1,EVENTOUT,
|
||||
PortJ,PJ1,,,,,,,,,,,,,,,LCD_R2,EVENTOUT,
|
||||
PortJ,PJ2,,,,,,,,,,,,,,DSI_TE,LCD_R3,EVENTOUT,
|
||||
PortJ,PJ3,,,,,,,,,,,,,,,LCD_R4,EVENTOUT,
|
||||
PortJ,PJ4,,,,,,,,,,,,,,,LCD_R5,EVENTOUT,
|
||||
PortJ,PJ5,,,,,,,,,,,,,,,LCD_R6,EVENTOUT,
|
||||
PortJ,PJ6,,,,,,,,,,,,,,,LCD_R7,EVENTOUT,
|
||||
PortJ,PJ7,,,,,,,,,,,,,,,LCD_G0,EVENTOUT,
|
||||
PortJ,PJ8,,,,,,,,,,,,,,,LCD_G1,EVENTOUT,
|
||||
PortJ,PJ9,,,,,,,,,,,,,,,LCD_G2,EVENTOUT,
|
||||
PortJ,PJ10,,,,,,,,,,,,,,,LCD_G3,EVENTOUT,
|
||||
PortJ,PJ11,,,,,,,,,,,,,,,LCD_G4,EVENTOUT,
|
||||
PortJ,PJ12,,,,,,,,,,LCD_G3,,,,,LCD_B0,EVENTOUT,
|
||||
PortJ,PJ13,,,,,,,,,,LCD_G4,,,,,LCD_B1,EVENTOUT,
|
||||
PortJ,PJ14,,,,,,,,,,,,,,,LCD_B2,EVENTOUT,
|
||||
PortJ,PJ15,,,,,,,,,,,,,,,LCD_B3,EVENTOUT,
|
||||
PortK,PK0,,,,,,,,,,,,,,,LCD_G5,EVENTOUT,
|
||||
PortK,PK1,,,,,,,,,,,,,,,LCD_G6,EVENTOUT,
|
||||
PortK,PK2,,,,,,,,,,,,,,,LCD_G7,EVENTOUT,
|
||||
PortK,PK3,,,,,,,,,,,,,,,LCD_B4,EVENTOUT,
|
||||
PortK,PK4,,,,,,,,,,,,,,,LCD_B5,EVENTOUT,
|
||||
PortK,PK5,,,,,,,,,,,,,,,LCD_B6,EVENTOUT,
|
||||
PortK,PK6,,,,,,,,,,,,,,,LCD_B7,EVENTOUT,
|
||||
PortK,PK7,,,,,,,,,,,,,,,LCD_DE,EVENTOUT,
|
|
@ -174,6 +174,9 @@ endif
|
||||
ifeq ($(CIRCUITPY__EVE),1)
|
||||
SRC_PATTERNS += _eve/%
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_MEMORYMONITOR),1)
|
||||
SRC_PATTERNS += memorymonitor/%
|
||||
endif
|
||||
ifeq ($(CIRCUITPY_MICROCONTROLLER),1)
|
||||
SRC_PATTERNS += microcontroller/%
|
||||
endif
|
||||
@ -398,6 +401,9 @@ SRC_SHARED_MODULE_ALL = \
|
||||
gamepad/__init__.c \
|
||||
gamepadshift/GamePadShift.c \
|
||||
gamepadshift/__init__.c \
|
||||
memorymonitor/__init__.c \
|
||||
memorymonitor/AllocationAlarm.c \
|
||||
memorymonitor/AllocationSize.c \
|
||||
network/__init__.c \
|
||||
os/__init__.c \
|
||||
random/__init__.c \
|
||||
|
@ -119,6 +119,7 @@
|
||||
#define MICROPY_QSTR_BYTES_IN_HASH (1)
|
||||
#define MICROPY_REPL_AUTO_INDENT (1)
|
||||
#define MICROPY_REPL_EVENT_DRIVEN (0)
|
||||
#define MICROPY_ENABLE_PYSTACK (1)
|
||||
#define MICROPY_STACK_CHECK (1)
|
||||
#define MICROPY_STREAMS_NON_BLOCK (1)
|
||||
#ifndef MICROPY_USE_INTERNAL_PRINTF
|
||||
@ -429,6 +430,16 @@ extern const struct _mp_obj_module_t _eve_module;
|
||||
#define _EVE_MODULE
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_MEMORYMONITOR
|
||||
extern const struct _mp_obj_module_t memorymonitor_module;
|
||||
#define MEMORYMONITOR_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_memorymonitor), (mp_obj_t)&memorymonitor_module },
|
||||
#define MEMORYMONITOR_ROOT_POINTERS mp_obj_t active_allocationsizes; \
|
||||
mp_obj_t active_allocationalarms;
|
||||
#else
|
||||
#define MEMORYMONITOR_MODULE
|
||||
#define MEMORYMONITOR_ROOT_POINTERS
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_MICROCONTROLLER
|
||||
extern const struct _mp_obj_module_t microcontroller_module;
|
||||
#define MICROCONTROLLER_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_microcontroller), (mp_obj_t)µcontroller_module },
|
||||
@ -708,6 +719,7 @@ extern const struct _mp_obj_module_t watchdog_module;
|
||||
JSON_MODULE \
|
||||
MATH_MODULE \
|
||||
_EVE_MODULE \
|
||||
MEMORYMONITOR_MODULE \
|
||||
MICROCONTROLLER_MODULE \
|
||||
NEOPIXEL_WRITE_MODULE \
|
||||
NETWORK_MODULE \
|
||||
@ -765,6 +777,7 @@ extern const struct _mp_obj_module_t watchdog_module;
|
||||
mp_obj_t terminal_tilegrid_tiles; \
|
||||
BOARD_UART_ROOT_POINTER \
|
||||
FLASH_ROOT_POINTERS \
|
||||
MEMORYMONITOR_ROOT_POINTERS \
|
||||
NETWORK_ROOT_POINTERS \
|
||||
|
||||
void supervisor_run_background_tasks_if_tick(void);
|
||||
@ -785,6 +798,10 @@ void supervisor_run_background_tasks_if_tick(void);
|
||||
#define CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS 1000
|
||||
#endif
|
||||
|
||||
#ifndef CIRCUITPY_PYSTACK_SIZE
|
||||
#define CIRCUITPY_PYSTACK_SIZE 1024
|
||||
#endif
|
||||
|
||||
#define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt"
|
||||
|
||||
#define CIRCUITPY_VERBOSE_BLE 0
|
||||
|
@ -118,6 +118,9 @@ CFLAGS += -DCIRCUITPY_MATH=$(CIRCUITPY_MATH)
|
||||
CIRCUITPY__EVE ?= 0
|
||||
CFLAGS += -DCIRCUITPY__EVE=$(CIRCUITPY__EVE)
|
||||
|
||||
CIRCUITPY_MEMORYMONITOR ?= 0
|
||||
CFLAGS += -DCIRCUITPY_MEMORYMONITOR=$(CIRCUITPY_MEMORYMONITOR)
|
||||
|
||||
CIRCUITPY_MICROCONTROLLER ?= 1
|
||||
CFLAGS += -DCIRCUITPY_MICROCONTROLLER=$(CIRCUITPY_MICROCONTROLLER)
|
||||
|
||||
|
@ -1890,7 +1890,7 @@ STATIC void compile_async_stmt(compiler_t *comp, mp_parse_node_struct_t *pns) {
|
||||
// async def
|
||||
compile_funcdef(comp, pns0);
|
||||
scope_t *fscope = (scope_t*)pns0->nodes[4];
|
||||
fscope->scope_flags |= MP_SCOPE_FLAG_GENERATOR;
|
||||
fscope->scope_flags |= MP_SCOPE_FLAG_GENERATOR | MP_SCOPE_FLAG_ASYNC;
|
||||
} else if (MP_PARSE_NODE_STRUCT_KIND(pns0) == PN_for_stmt) {
|
||||
// async for
|
||||
compile_async_for_stmt(comp, pns0);
|
||||
|
@ -152,7 +152,7 @@ mp_obj_t mp_make_function_from_raw_code(const mp_raw_code_t *rc, mp_obj_t def_ar
|
||||
|
||||
// check for generator functions and if so wrap in generator object
|
||||
if ((rc->scope_flags & MP_SCOPE_FLAG_GENERATOR) != 0) {
|
||||
fun = mp_obj_new_gen_wrap(fun);
|
||||
fun = mp_obj_new_gen_wrap(fun, (rc->scope_flags & MP_SCOPE_FLAG_ASYNC) != 0);
|
||||
}
|
||||
|
||||
return fun;
|
||||
|
16
py/gc.c
16
py/gc.c
@ -33,6 +33,10 @@
|
||||
|
||||
#include "supervisor/shared/safe_mode.h"
|
||||
|
||||
#if CIRCUITPY_MEMORYMONITOR
|
||||
#include "shared-module/memorymonitor/__init__.h"
|
||||
#endif
|
||||
|
||||
#if MICROPY_ENABLE_GC
|
||||
|
||||
#if MICROPY_DEBUG_VERBOSE // print debugging info
|
||||
@ -653,6 +657,10 @@ void *gc_alloc(size_t n_bytes, bool has_finaliser, bool long_lived) {
|
||||
gc_dump_alloc_table();
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_MEMORYMONITOR
|
||||
memorymonitor_track_allocation(end_block - start_block + 1);
|
||||
#endif
|
||||
|
||||
return ret_ptr;
|
||||
}
|
||||
|
||||
@ -906,6 +914,10 @@ void *gc_realloc(void *ptr_in, size_t n_bytes, bool allow_move) {
|
||||
gc_log_change(block, new_blocks);
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_MEMORYMONITOR
|
||||
memorymonitor_track_allocation(new_blocks);
|
||||
#endif
|
||||
|
||||
return ptr_in;
|
||||
}
|
||||
|
||||
@ -935,6 +947,10 @@ void *gc_realloc(void *ptr_in, size_t n_bytes, bool allow_move) {
|
||||
gc_log_change(block, new_blocks);
|
||||
#endif
|
||||
|
||||
#if CIRCUITPY_MEMORYMONITOR
|
||||
memorymonitor_track_allocation(new_blocks);
|
||||
#endif
|
||||
|
||||
return ptr_in;
|
||||
}
|
||||
|
||||
|
4
py/mpz.c
4
py/mpz.c
@ -444,6 +444,10 @@ STATIC size_t mpn_mul(mpz_dig_t *idig, mpz_dig_t *jdig, size_t jlen, mpz_dig_t *
|
||||
}
|
||||
|
||||
ilen = id - oidig;
|
||||
// check to prevent usb starvation
|
||||
#ifdef RUN_BACKGROUND_TASKS
|
||||
RUN_BACKGROUND_TASKS;
|
||||
#endif
|
||||
}
|
||||
|
||||
return ilen;
|
||||
|
2
py/obj.h
2
py/obj.h
@ -665,7 +665,7 @@ mp_obj_t mp_obj_new_fun_bc(mp_obj_t def_args, mp_obj_t def_kw_args, const byte *
|
||||
mp_obj_t mp_obj_new_fun_native(mp_obj_t def_args_in, mp_obj_t def_kw_args, const void *fun_data, const mp_uint_t *const_table);
|
||||
mp_obj_t mp_obj_new_fun_viper(size_t n_args, void *fun_data, mp_uint_t type_sig);
|
||||
mp_obj_t mp_obj_new_fun_asm(size_t n_args, void *fun_data, mp_uint_t type_sig);
|
||||
mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun);
|
||||
mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun, bool is_coroutine);
|
||||
mp_obj_t mp_obj_new_closure(mp_obj_t fun, size_t n_closed, const mp_obj_t *closed);
|
||||
mp_obj_t mp_obj_new_tuple(size_t n, const mp_obj_t *items);
|
||||
mp_obj_t mp_obj_new_list(size_t n, mp_obj_t *items);
|
||||
|
@ -400,6 +400,66 @@ STATIC mp_obj_t array_extend(mp_obj_t self_in, mp_obj_t arg_in) {
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(array_extend_obj, array_extend);
|
||||
#endif
|
||||
|
||||
#if MICROPY_PY_BUILTINS_BYTEARRAY && MICROPY_CPYTHON_COMPAT
|
||||
STATIC mp_obj_t buffer_finder(size_t n_args, const mp_obj_t *args, int direction, bool is_index) {
|
||||
mp_check_self(MP_OBJ_IS_TYPE(args[0], &mp_type_bytearray));
|
||||
const mp_obj_type_t *self_type = mp_obj_get_type(args[0]);
|
||||
|
||||
mp_buffer_info_t haystack_bufinfo;
|
||||
mp_get_buffer_raise(args[0], &haystack_bufinfo, MP_BUFFER_READ);
|
||||
|
||||
mp_buffer_info_t needle_bufinfo;
|
||||
mp_get_buffer_raise(args[1], &needle_bufinfo, MP_BUFFER_READ);
|
||||
|
||||
if (mp_binary_get_size('@', needle_bufinfo.typecode, NULL) != 1) {
|
||||
mp_raise_TypeError(translate("a bytes-like object is required"));
|
||||
}
|
||||
|
||||
const byte *start = haystack_bufinfo.buf;
|
||||
const byte *end = ((const byte*)haystack_bufinfo.buf) + haystack_bufinfo.len;
|
||||
if (n_args >= 3 && args[2] != mp_const_none) {
|
||||
start += mp_get_index(self_type, haystack_bufinfo.len, args[2], true);
|
||||
}
|
||||
if (n_args >= 4 && args[3] != mp_const_none) {
|
||||
end = ((const byte*)haystack_bufinfo.buf) + mp_get_index(self_type, haystack_bufinfo.len, args[3], true);
|
||||
}
|
||||
|
||||
const byte *p = NULL;
|
||||
if (end >= start) {
|
||||
p = find_subbytes(start, end - start, needle_bufinfo.buf, needle_bufinfo.len, direction);
|
||||
}
|
||||
|
||||
if (p == NULL) {
|
||||
if (is_index) {
|
||||
mp_raise_ValueError(translate("substring not found"));
|
||||
} else {
|
||||
return MP_OBJ_NEW_SMALL_INT(-1);
|
||||
}
|
||||
}
|
||||
return MP_OBJ_NEW_SMALL_INT(p - (const byte*) haystack_bufinfo.buf);
|
||||
}
|
||||
|
||||
STATIC mp_obj_t buffer_find(size_t n_args, const mp_obj_t *args) {
|
||||
return buffer_finder(n_args, args, 1, false);
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_find_obj, 2, 4, buffer_find);
|
||||
|
||||
STATIC mp_obj_t buffer_rfind(size_t n_args, const mp_obj_t *args) {
|
||||
return buffer_finder(n_args, args, -1, false);
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_rfind_obj, 2, 4, buffer_rfind);
|
||||
|
||||
STATIC mp_obj_t buffer_index(size_t n_args, const mp_obj_t *args) {
|
||||
return buffer_finder(n_args, args, 1, true);
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_index_obj, 2, 4, buffer_index);
|
||||
|
||||
STATIC mp_obj_t buffer_rindex(size_t n_args, const mp_obj_t *args) {
|
||||
return buffer_finder(n_args, args, -1, true);
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(buffer_rindex_obj, 2, 4, buffer_rindex);
|
||||
#endif
|
||||
|
||||
STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value) {
|
||||
if (value == MP_OBJ_NULL) {
|
||||
// delete item
|
||||
@ -580,7 +640,13 @@ STATIC MP_DEFINE_CONST_DICT(array_locals_dict, array_locals_dict_table);
|
||||
STATIC const mp_rom_map_elem_t bytearray_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_append), MP_ROM_PTR(&array_append_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_extend), MP_ROM_PTR(&array_extend_obj) },
|
||||
|
||||
#if MICROPY_CPYTHON_COMPAT
|
||||
{ MP_ROM_QSTR(MP_QSTR_find), MP_ROM_PTR(&buffer_find_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_rfind), MP_ROM_PTR(&buffer_rfind_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_index), MP_ROM_PTR(&buffer_index_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_rindex), MP_ROM_PTR(&buffer_rindex_obj) },
|
||||
|
||||
{ MP_ROM_QSTR(MP_QSTR_decode), MP_ROM_PTR(&array_decode_obj) },
|
||||
#endif
|
||||
};
|
||||
|
@ -42,11 +42,13 @@
|
||||
typedef struct _mp_obj_gen_wrap_t {
|
||||
mp_obj_base_t base;
|
||||
mp_obj_t *fun;
|
||||
bool coroutine_generator;
|
||||
} mp_obj_gen_wrap_t;
|
||||
|
||||
typedef struct _mp_obj_gen_instance_t {
|
||||
mp_obj_base_t base;
|
||||
mp_obj_dict_t *globals;
|
||||
bool coroutine_generator;
|
||||
mp_code_state_t code_state;
|
||||
} mp_obj_gen_instance_t;
|
||||
|
||||
@ -64,6 +66,7 @@ STATIC mp_obj_t gen_wrap_call(mp_obj_t self_in, size_t n_args, size_t n_kw, cons
|
||||
n_state * sizeof(mp_obj_t) + n_exc_stack * sizeof(mp_exc_stack_t));
|
||||
o->base.type = &mp_type_gen_instance;
|
||||
|
||||
o->coroutine_generator = self->coroutine_generator;
|
||||
o->globals = self_fun->globals;
|
||||
o->code_state.fun_bc = self_fun;
|
||||
o->code_state.ip = 0;
|
||||
@ -78,10 +81,11 @@ const mp_obj_type_t mp_type_gen_wrap = {
|
||||
.unary_op = mp_generic_unary_op,
|
||||
};
|
||||
|
||||
mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun) {
|
||||
mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun, bool is_coroutine) {
|
||||
mp_obj_gen_wrap_t *o = m_new_obj(mp_obj_gen_wrap_t);
|
||||
o->base.type = &mp_type_gen_wrap;
|
||||
o->fun = MP_OBJ_TO_PTR(fun);
|
||||
o->coroutine_generator = is_coroutine;
|
||||
return MP_OBJ_FROM_PTR(o);
|
||||
}
|
||||
|
||||
@ -91,6 +95,12 @@ mp_obj_t mp_obj_new_gen_wrap(mp_obj_t fun) {
|
||||
STATIC void gen_instance_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
|
||||
(void)kind;
|
||||
mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
#if MICROPY_PY_ASYNC_AWAIT
|
||||
if (self->coroutine_generator) {
|
||||
mp_printf(print, "<coroutine object '%q' at %p>", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
mp_printf(print, "<generator object '%q' at %p>", mp_obj_fun_get_name(MP_OBJ_FROM_PTR(self->code_state.fun_bc)), self);
|
||||
}
|
||||
|
||||
@ -194,6 +204,13 @@ STATIC mp_obj_t gen_resume_and_raise(mp_obj_t self_in, mp_obj_t send_value, mp_o
|
||||
}
|
||||
|
||||
STATIC mp_obj_t gen_instance_iternext(mp_obj_t self_in) {
|
||||
#if MICROPY_PY_ASYNC_AWAIT
|
||||
// This translate is literally too much for m0 boards
|
||||
mp_obj_gen_instance_t *self = MP_OBJ_TO_PTR(self_in);
|
||||
if (self->coroutine_generator) {
|
||||
mp_raise_TypeError(translate("'coroutine' object is not an iterator"));
|
||||
}
|
||||
#endif
|
||||
return gen_resume_and_raise(self_in, mp_const_none, MP_OBJ_NULL);
|
||||
}
|
||||
|
||||
|
@ -77,8 +77,8 @@ const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, s
|
||||
mp_obj_t index, bool is_slice);
|
||||
const byte *find_subbytes(const byte *haystack, size_t hlen, const byte *needle, size_t nlen, int direction);
|
||||
|
||||
const char nibble_to_hex_upper[16];
|
||||
const char nibble_to_hex_lower[16];
|
||||
extern const char nibble_to_hex_upper[16];
|
||||
extern const char nibble_to_hex_lower[16];
|
||||
|
||||
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_encode_obj);
|
||||
MP_DECLARE_CONST_FUN_OBJ_VAR_BETWEEN(str_find_obj);
|
||||
|
5
py/py.mk
5
py/py.mk
@ -346,6 +346,11 @@ $(HEADER_BUILD)/qstrdefs.generated.h: $(PY_SRC)/makeqstrdata.py $(HEADER_BUILD)/
|
||||
|
||||
$(PY_BUILD)/qstr.o: $(HEADER_BUILD)/qstrdefs.generated.h
|
||||
|
||||
# Standard C functions like memset need to be compiled with special flags so
|
||||
# the compiler does not optimise these functions in terms of themselves.
|
||||
CFLAGS_BUILTIN ?= -ffreestanding -fno-builtin -fno-lto
|
||||
$(BUILD)/lib/libc/string0.o: CFLAGS += $(CFLAGS_BUILTIN)
|
||||
|
||||
# Force nlr code to always be compiled with space-saving optimisation so
|
||||
# that the function preludes are of a minimal and predictable form.
|
||||
$(PY_BUILD)/nlr%.o: CFLAGS += -Os
|
||||
|
@ -33,6 +33,7 @@
|
||||
#define MP_SCOPE_FLAG_VARKEYWORDS (0x02)
|
||||
#define MP_SCOPE_FLAG_GENERATOR (0x04)
|
||||
#define MP_SCOPE_FLAG_DEFKWARGS (0x08)
|
||||
#define MP_SCOPE_FLAG_ASYNC (0x10)
|
||||
|
||||
// types for native (viper) function signature
|
||||
#define MP_NATIVE_TYPE_OBJ (0x00)
|
||||
|
@ -65,13 +65,13 @@
|
||||
//| connections and also initiate connections."""
|
||||
//|
|
||||
|
||||
//| def __init__(self, ):
|
||||
//| def __init__(self) -> None:
|
||||
//| """You cannot create an instance of `_bleio.Adapter`.
|
||||
//| Use `_bleio.adapter` to access the sole instance available."""
|
||||
//| ...
|
||||
//|
|
||||
|
||||
//| enabled: Any = ...
|
||||
//| enabled: bool = ...
|
||||
//| """State of the BLE adapter."""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_adapter_get_enabled(mp_obj_t self) {
|
||||
@ -95,7 +95,7 @@ const mp_obj_property_t bleio_adapter_enabled_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| address: Any = ...
|
||||
//| address: Address = ...
|
||||
//| """MAC address of the BLE adapter. (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_adapter_get_address(mp_obj_t self) {
|
||||
@ -111,7 +111,7 @@ const mp_obj_property_t bleio_adapter_address_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| name: Any = ...
|
||||
//| name: str = ...
|
||||
//| """name of the BLE adapter used once connected.
|
||||
//| The name is "CIRCUITPY" + the last four hex digits of ``adapter.address``,
|
||||
//| to make it easy to distinguish multiple CircuitPython boards."""
|
||||
@ -135,7 +135,7 @@ const mp_obj_property_t bleio_adapter_name_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| def start_advertising(self, data: buf, *, scan_response: buf = None, connectable: bool = True, anonymous: bool = False, timeout: int = 0, interval: float = 0.1) -> Any:
|
||||
//| def start_advertising(self, data: buf, *, scan_response: buf = None, connectable: bool = True, anonymous: bool = False, timeout: int = 0, interval: float = 0.1) -> None:
|
||||
//| """Starts advertising until `stop_advertising` is called or if connectable, another device
|
||||
//| connects to us.
|
||||
//|
|
||||
@ -202,7 +202,7 @@ STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_advertising_obj, 2, bleio_adapter_start_advertising);
|
||||
|
||||
//| def stop_advertising(self, ) -> Any:
|
||||
//| def stop_advertising(self) -> None:
|
||||
//| """Stop sending advertising packets."""
|
||||
//| ...
|
||||
//|
|
||||
@ -215,7 +215,7 @@ STATIC mp_obj_t bleio_adapter_stop_advertising(mp_obj_t self_in) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_advertising_obj, bleio_adapter_stop_advertising);
|
||||
|
||||
//| def start_scan(self, prefixes: sequence = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> Any:
|
||||
//| def start_scan(self, prefixes: sequence = b"", *, buffer_size: int = 512, extended: bool = False, timeout: float = None, interval: float = 0.1, window: float = 0.1, minimum_rssi: int = -80, active: bool = True) -> iterable:
|
||||
//| """Starts a BLE scan and returns an iterator of results. Advertisements and scan responses are
|
||||
//| filtered and returned separately.
|
||||
//|
|
||||
@ -288,7 +288,7 @@ STATIC mp_obj_t bleio_adapter_start_scan(size_t n_args, const mp_obj_t *pos_args
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_start_scan_obj, 1, bleio_adapter_start_scan);
|
||||
|
||||
//| def stop_scan(self, ) -> Any:
|
||||
//| def stop_scan(self) -> None:
|
||||
//| """Stop the current scan."""
|
||||
//| ...
|
||||
//|
|
||||
@ -301,7 +301,7 @@ STATIC mp_obj_t bleio_adapter_stop_scan(mp_obj_t self_in) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_adapter_stop_scan_obj, bleio_adapter_stop_scan);
|
||||
|
||||
//| advertising: Any = ...
|
||||
//| advertising: bool = ...
|
||||
//| """True when the adapter is currently advertising. (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_adapter_get_advertising(mp_obj_t self) {
|
||||
@ -317,7 +317,7 @@ const mp_obj_property_t bleio_adapter_advertising_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| connected: Any = ...
|
||||
//| connected: bool = ...
|
||||
//| """True when the adapter is connected to another device regardless of who initiated the
|
||||
//| connection. (read-only)"""
|
||||
//|
|
||||
@ -334,7 +334,7 @@ const mp_obj_property_t bleio_adapter_connected_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| connections: Any = ...
|
||||
//| connections: tuple = ...
|
||||
//| """Tuple of active connections including those initiated through
|
||||
//| :py:meth:`_bleio.Adapter.connect`. (read-only)"""
|
||||
//|
|
||||
@ -350,7 +350,7 @@ const mp_obj_property_t bleio_adapter_connections_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| def connect(self, address: Address, *, timeout: float/int) -> Any:
|
||||
//| def connect(self, address: Address, *, timeout: float/int) -> Connection:
|
||||
//| """Attempts a connection to the device with the given address.
|
||||
//|
|
||||
//| :param Address address: The address of the peripheral to connect to
|
||||
@ -380,7 +380,7 @@ STATIC mp_obj_t bleio_adapter_connect(mp_uint_t n_args, const mp_obj_t *pos_args
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_adapter_connect_obj, 2, bleio_adapter_connect);
|
||||
|
||||
//| def erase_bonding(self, ) -> Any:
|
||||
//| def erase_bonding(self) -> None:
|
||||
//| """Erase all bonding information stored in flash memory."""
|
||||
//| ...
|
||||
//|
|
||||
|
@ -38,7 +38,7 @@
|
||||
//| """Encapsulates the address of a BLE device."""
|
||||
//|
|
||||
|
||||
//| def __init__(self, address: buf, address_type: Any):
|
||||
//| def __init__(self, address: ReadableBuffer, address_type: int) -> None:
|
||||
//| """Create a new Address object encapsulating the address value.
|
||||
//| The value itself can be one of:
|
||||
//|
|
||||
@ -77,8 +77,8 @@ STATIC mp_obj_t bleio_address_make_new(const mp_obj_type_t *type, size_t n_args,
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
//| address_bytes: Any = ...
|
||||
//| r"""The bytes that make up the device address (read-only).
|
||||
//| address_bytes: bytes = ...
|
||||
//| """The bytes that make up the device address (read-only).
|
||||
//|
|
||||
//| Note that the ``bytes`` object returned is in little-endian order:
|
||||
//| The least significant byte is ``address_bytes[0]``. So the address will
|
||||
@ -108,7 +108,7 @@ const mp_obj_property_t bleio_address_address_bytes_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| type: Any = ...
|
||||
//| type: int = ...
|
||||
//| """The address type (read-only).
|
||||
//|
|
||||
//| One of the integer values: `PUBLIC`, `RANDOM_STATIC`, `RANDOM_PRIVATE_RESOLVABLE`,
|
||||
@ -128,7 +128,7 @@ const mp_obj_property_t bleio_address_type_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| def __eq__(self, other: Any) -> Any:
|
||||
//| def __eq__(self, other: Any) -> bool:
|
||||
//| """Two Address objects are equal if their addresses and address types are equal."""
|
||||
//| ...
|
||||
//|
|
||||
@ -154,7 +154,7 @@ STATIC mp_obj_t bleio_address_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_o
|
||||
}
|
||||
}
|
||||
|
||||
//| def __hash__(self, ) -> Any:
|
||||
//| def __hash__(self) -> int:
|
||||
//| """Returns a hash for the Address data."""
|
||||
//| ...
|
||||
//|
|
||||
@ -187,17 +187,17 @@ STATIC void bleio_address_print(const mp_print_t *print, mp_obj_t self_in, mp_pr
|
||||
buf[5], buf[4], buf[3], buf[2], buf[1], buf[0]);
|
||||
}
|
||||
|
||||
//| PUBLIC: Any = ...
|
||||
//| PUBLIC: int = ...
|
||||
//| """A publicly known address, with a company ID (high 24 bits)and company-assigned part (low 24 bits)."""
|
||||
//|
|
||||
//| RANDOM_STATIC: Any = ...
|
||||
//| RANDOM_STATIC: int = ...
|
||||
//| """A randomly generated address that does not change often. It may never change or may change after
|
||||
//| a power cycle."""
|
||||
//|
|
||||
//| RANDOM_PRIVATE_RESOLVABLE: Any = ...
|
||||
//| RANDOM_PRIVATE_RESOLVABLE: int = ...
|
||||
//| """An address that is usable when the peer knows the other device's secret Identity Resolving Key (IRK)."""
|
||||
//|
|
||||
//| RANDOM_PRIVATE_NON_RESOLVABLE: Any = ...
|
||||
//| RANDOM_PRIVATE_NON_RESOLVABLE: int = ...
|
||||
//| """A randomly generated address that changes on every connection."""
|
||||
//|
|
||||
STATIC const mp_rom_map_elem_t bleio_address_locals_dict_table[] = {
|
||||
|
@ -36,32 +36,32 @@
|
||||
//| :py:class:`~Characteristic` and :py:class:`~Descriptor`,
|
||||
//| but is not defined as a Python superclass of those classes."""
|
||||
//|
|
||||
//| def __init__(self, ):
|
||||
//| def __init__(self) -> None:
|
||||
//| """You cannot create an instance of :py:class:`~_bleio.Attribute`."""
|
||||
//| ...
|
||||
//|
|
||||
|
||||
STATIC const mp_rom_map_elem_t bleio_attribute_locals_dict_table[] = {
|
||||
|
||||
//| NO_ACCESS: Any = ...
|
||||
//| NO_ACCESS: int = ...
|
||||
//| """security mode: access not allowed"""
|
||||
//|
|
||||
//| OPEN: Any = ...
|
||||
//| OPEN: int = ...
|
||||
//| """security_mode: no security (link is not encrypted)"""
|
||||
//|
|
||||
//| ENCRYPT_NO_MITM: Any = ...
|
||||
//| ENCRYPT_NO_MITM: int = ...
|
||||
//| """security_mode: unauthenticated encryption, without man-in-the-middle protection"""
|
||||
//|
|
||||
//| ENCRYPT_WITH_MITM: Any = ...
|
||||
//| ENCRYPT_WITH_MITM: int = ...
|
||||
//| """security_mode: authenticated encryption, with man-in-the-middle protection"""
|
||||
//|
|
||||
//| LESC_ENCRYPT_WITH_MITM: Any = ...
|
||||
//| LESC_ENCRYPT_WITH_MITM: int = ...
|
||||
//| """security_mode: LESC encryption, with man-in-the-middle protection"""
|
||||
//|
|
||||
//| SIGNED_NO_MITM: Any = ...
|
||||
//| SIGNED_NO_MITM: int = ...
|
||||
//| """security_mode: unauthenticated data signing, without man-in-the-middle protection"""
|
||||
//|
|
||||
//| SIGNED_WITH_MITM: Any = ...
|
||||
//| SIGNED_WITH_MITM: int = ...
|
||||
//| """security_mode: authenticated data signing, without man-in-the-middle protection"""
|
||||
//|
|
||||
{ MP_ROM_QSTR(MP_QSTR_NO_ACCESS), MP_ROM_INT(SECURITY_MODE_NO_ACCESS) },
|
||||
|
@ -37,7 +37,7 @@
|
||||
//| """Stores information about a BLE service characteristic and allows reading
|
||||
//| and writing of the characteristic's value."""
|
||||
//|
|
||||
//| def __init__(self, ):
|
||||
//| def __init__(self) -> None:
|
||||
//| """There is no regular constructor for a Characteristic. A new local Characteristic can be created
|
||||
//| and attached to a Service by calling `add_to_service()`.
|
||||
//| Remote Characteristic objects are created by `Connection.discover_remote_services()`
|
||||
@ -45,7 +45,7 @@
|
||||
//| ...
|
||||
//|
|
||||
|
||||
//| def add_to_service(self, service: Service, uuid: UUID, *, properties: int = 0, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length: int = 20, fixed_length: bool = False, initial_value: buf = None) -> Any:
|
||||
//| def add_to_service(self, service: Service, uuid: UUID, *, properties: int = 0, read_perm: int = Attribute.OPEN, write_perm: int = Attribute.OPEN, max_length: int = 20, fixed_length: bool = False, initial_value: buf = None) -> Characteristic:
|
||||
//| """Create a new Characteristic object, and add it to this Service.
|
||||
//|
|
||||
//| :param Service service: The service that will provide this characteristic
|
||||
@ -141,7 +141,7 @@ STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(bleio_characteristic_add_to_service_obj,
|
||||
|
||||
|
||||
|
||||
//| properties: Any = ...
|
||||
//| properties: int = ...
|
||||
//| """An int bitmask representing which properties are set, specified as bitwise or'ing of
|
||||
//| of these possible values.
|
||||
//| `BROADCAST`, `INDICATE`, `NOTIFY`, `READ`, `WRITE`, `WRITE_NO_RESPONSE`."""
|
||||
@ -160,7 +160,7 @@ const mp_obj_property_t bleio_characteristic_properties_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| uuid: Any = ...
|
||||
//| uuid: Optional[UUID] = ...
|
||||
//| """The UUID of this characteristic. (read-only)
|
||||
//|
|
||||
//| Will be ``None`` if the 128-bit UUID for this characteristic is not known."""
|
||||
@ -180,7 +180,7 @@ const mp_obj_property_t bleio_characteristic_uuid_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| value: Any = ...
|
||||
//| value: bytearray = ...
|
||||
//| """The value of this characteristic."""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_characteristic_get_value(mp_obj_t self_in) {
|
||||
@ -211,7 +211,7 @@ const mp_obj_property_t bleio_characteristic_value_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| descriptors: Any = ...
|
||||
//| descriptors: Descriptor = ...
|
||||
//| """A tuple of :py:class:`Descriptor` that describe this characteristic. (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_characteristic_get_descriptors(mp_obj_t self_in) {
|
||||
@ -241,7 +241,7 @@ const mp_obj_property_t bleio_characteristic_descriptors_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| service: Any = ...
|
||||
//| service: Service = ...
|
||||
//| """The Service this Characteristic is a part of."""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_characteristic_get_service(mp_obj_t self_in) {
|
||||
@ -258,7 +258,7 @@ const mp_obj_property_t bleio_characteristic_service_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| def set_cccd(self, *, notify: bool = False, indicate: float = False) -> Any:
|
||||
//| def set_cccd(self, *, notify: bool = False, indicate: float = False) -> None:
|
||||
//| """Set the remote characteristic's CCCD to enable or disable notification and indication.
|
||||
//|
|
||||
//| :param bool notify: True if Characteristic should receive notifications of remote writes
|
||||
@ -291,22 +291,22 @@ STATIC const mp_rom_map_elem_t bleio_characteristic_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_set_cccd), MP_ROM_PTR(&bleio_characteristic_set_cccd_obj) },
|
||||
|
||||
// Bitmask constants to represent properties
|
||||
//| BROADCAST: Any = ...
|
||||
//| BROADCAST: int = ...
|
||||
//| """property: allowed in advertising packets"""
|
||||
//|
|
||||
//| INDICATE: Any = ...
|
||||
//| INDICATE: int = ...
|
||||
//| """property: server will indicate to the client when the value is set and wait for a response"""
|
||||
//|
|
||||
//| NOTIFY: Any = ...
|
||||
//| NOTIFY: int = ...
|
||||
//| """property: server will notify the client when the value is set"""
|
||||
//|
|
||||
//| READ: Any = ...
|
||||
//| READ: int = ...
|
||||
//| """property: clients may read this characteristic"""
|
||||
//|
|
||||
//| WRITE: Any = ...
|
||||
//| WRITE: int = ...
|
||||
//| """property: clients may write this characteristic; a response will be sent back"""
|
||||
//|
|
||||
//| WRITE_NO_RESPONSE: Any = ...
|
||||
//| WRITE_NO_RESPONSE: int = ...
|
||||
//| """property: clients may write this characteristic; no response will be sent back"""
|
||||
//|
|
||||
{ MP_ROM_QSTR(MP_QSTR_BROADCAST), MP_ROM_INT(CHAR_PROP_BROADCAST) },
|
||||
|
@ -44,7 +44,7 @@ STATIC void raise_error_if_not_connected(bleio_characteristic_buffer_obj_t *self
|
||||
//| class CharacteristicBuffer:
|
||||
//| """Accumulates a Characteristic's incoming values in a FIFO buffer."""
|
||||
//|
|
||||
//| def __init__(self, characteristic: Characteristic, *, timeout: int = 1, buffer_size: int = 64):
|
||||
//| def __init__(self, characteristic: Characteristic, *, timeout: int = 1, buffer_size: int = 64) -> None:
|
||||
//|
|
||||
//| """Monitor the given Characteristic. Each time a new value is written to the Characteristic
|
||||
//| add the newly-written bytes to a FIFO buffer.
|
||||
@ -100,7 +100,7 @@ STATIC void check_for_deinit(bleio_characteristic_buffer_obj_t *self) {
|
||||
|
||||
// These are standard stream methods. Code is in py/stream.c.
|
||||
//
|
||||
//| def read(self, nbytes: Any = None) -> Any:
|
||||
//| def read(self, nbytes: int = None) -> Optional[bytes]:
|
||||
//| """Read characters. If ``nbytes`` is specified then read at most that many
|
||||
//| bytes. Otherwise, read everything that arrives until the connection
|
||||
//| times out. Providing the number of bytes expected is highly recommended
|
||||
@ -110,14 +110,14 @@ STATIC void check_for_deinit(bleio_characteristic_buffer_obj_t *self) {
|
||||
//| :rtype: bytes or None"""
|
||||
//| ...
|
||||
//|
|
||||
//| def readinto(self, buf: Any) -> Any:
|
||||
//| def readinto(self, buf: WriteableBuffer) -> Optional[int]:
|
||||
//| """Read bytes into the ``buf``. Read at most ``len(buf)`` bytes.
|
||||
//|
|
||||
//| :return: number of bytes read and stored into ``buf``
|
||||
//| :rtype: int or None (on a non-blocking error)"""
|
||||
//| ...
|
||||
//|
|
||||
//| def readline(self, ) -> Any:
|
||||
//| def readline(self) -> bytes:
|
||||
//| """Read a line, ending in a newline character.
|
||||
//|
|
||||
//| :return: the line read
|
||||
@ -167,7 +167,7 @@ STATIC mp_uint_t bleio_characteristic_buffer_ioctl(mp_obj_t self_in, mp_uint_t r
|
||||
return ret;
|
||||
}
|
||||
|
||||
//| in_waiting: Any = ...
|
||||
//| in_waiting: int = ...
|
||||
//| """The number of bytes in the input buffer, available to be read"""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_characteristic_buffer_obj_get_in_waiting(mp_obj_t self_in) {
|
||||
@ -184,7 +184,7 @@ const mp_obj_property_t bleio_characteristic_buffer_in_waiting_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| def reset_input_buffer(self, ) -> Any:
|
||||
//| def reset_input_buffer(self) -> None:
|
||||
//| """Discard any unread characters in the input buffer."""
|
||||
//| ...
|
||||
//|
|
||||
@ -196,7 +196,7 @@ STATIC mp_obj_t bleio_characteristic_buffer_obj_reset_input_buffer(mp_obj_t self
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_characteristic_buffer_reset_input_buffer_obj, bleio_characteristic_buffer_obj_reset_input_buffer);
|
||||
|
||||
//| def deinit(self, ) -> Any:
|
||||
//| def deinit(self) -> None:
|
||||
//| """Disable permanently."""
|
||||
//| ...
|
||||
//|
|
||||
|
@ -68,13 +68,13 @@ void bleio_connection_ensure_connected(bleio_connection_obj_t *self) {
|
||||
}
|
||||
}
|
||||
|
||||
//| def __init__(self, ):
|
||||
//| def __init__(self) -> None:
|
||||
//| """Connections cannot be made directly. Instead, to initiate a connection use `Adapter.connect`.
|
||||
//| Connections may also be made when another device initiates a connection. To use a Connection
|
||||
//| created by a peer, read the `Adapter.connections` property.
|
||||
//| ...
|
||||
//|
|
||||
//| def disconnect(self, ) -> Any:
|
||||
//| def disconnect(self) -> Any:
|
||||
//| ""Disconnects from the remote peripheral. Does nothing if already disconnected."""
|
||||
//| ...
|
||||
//|
|
||||
@ -87,7 +87,7 @@ STATIC mp_obj_t bleio_connection_disconnect(mp_obj_t self_in) {
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_disconnect_obj, bleio_connection_disconnect);
|
||||
|
||||
|
||||
//| def pair(self, *, bond: Any = True) -> Any:
|
||||
//| def pair(self, *, bond: bool = True) -> None:
|
||||
//| """Pair to the peer to improve security."""
|
||||
//| ...
|
||||
//|
|
||||
@ -109,7 +109,7 @@ STATIC mp_obj_t bleio_connection_pair(mp_uint_t n_args, const mp_obj_t *pos_args
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_pair_obj, 1, bleio_connection_pair);
|
||||
|
||||
//| def discover_remote_services(self, service_uuids_whitelist: iterable = None) -> Any:
|
||||
//| def discover_remote_services(self, service_uuids_whitelist: iterable = None) -> Service:
|
||||
//| """Do BLE discovery for all services or for the given service UUIDS,
|
||||
//| to find their handles and characteristics, and return the discovered services.
|
||||
//| `Connection.connected` must be True.
|
||||
@ -152,7 +152,7 @@ STATIC mp_obj_t bleio_connection_discover_remote_services(mp_uint_t n_args, cons
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_connection_discover_remote_services_obj, 1, bleio_connection_discover_remote_services);
|
||||
|
||||
//| connected: Any = ...
|
||||
//| connected: bool = ...
|
||||
//| """True if connected to the remote peer."""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_connection_get_connected(mp_obj_t self_in) {
|
||||
@ -170,7 +170,7 @@ const mp_obj_property_t bleio_connection_connected_obj = {
|
||||
};
|
||||
|
||||
|
||||
//| paired: Any = ...
|
||||
//| paired: bool = ...
|
||||
//| """True if paired to the remote peer."""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_connection_get_paired(mp_obj_t self_in) {
|
||||
@ -188,7 +188,7 @@ const mp_obj_property_t bleio_connection_paired_obj = {
|
||||
};
|
||||
|
||||
|
||||
//| connection_interval: Any = ...
|
||||
//| connection_interval: float = ...
|
||||
//| """Time between transmissions in milliseconds. Will be multiple of 1.25ms. Lower numbers
|
||||
//| increase speed and decrease latency but increase power consumption.
|
||||
//|
|
||||
@ -206,7 +206,7 @@ STATIC mp_obj_t bleio_connection_get_connection_interval(mp_obj_t self_in) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_connection_get_connection_interval_obj, bleio_connection_get_connection_interval);
|
||||
|
||||
//| attribute: Any = ...
|
||||
//| attribute: int = ...
|
||||
//| """The maximum number of data bytes that can be sent in a single transmission,
|
||||
//| not including overhead bytes.
|
||||
//|
|
||||
|
@ -39,7 +39,7 @@
|
||||
//| Descriptors are attached to BLE characteristics and provide contextual
|
||||
//| information about the characteristic."""
|
||||
//|
|
||||
//| def __init__(self, ):
|
||||
//| def __init__(self) -> None:
|
||||
//| """There is no regular constructor for a Descriptor. A new local Descriptor can be created
|
||||
//| and attached to a Characteristic by calling `add_to_characteristic()`.
|
||||
//| Remote Descriptor objects are created by `Connection.discover_remote_services()`
|
||||
@ -132,7 +132,7 @@ STATIC mp_obj_t bleio_descriptor_add_to_characteristic(size_t n_args, const mp_o
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_descriptor_add_to_characteristic_fun_obj, 3, bleio_descriptor_add_to_characteristic);
|
||||
STATIC MP_DEFINE_CONST_CLASSMETHOD_OBJ(bleio_descriptor_add_to_characteristic_obj, MP_ROM_PTR(&bleio_descriptor_add_to_characteristic_fun_obj));
|
||||
|
||||
//| uuid: Any = ...
|
||||
//| uuid: UUID = ...
|
||||
//| """The descriptor uuid. (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_descriptor_get_uuid(mp_obj_t self_in) {
|
||||
@ -150,7 +150,7 @@ const mp_obj_property_t bleio_descriptor_uuid_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| characteristic: Any = ...
|
||||
//| characteristic: Characteristic = ...
|
||||
//| """The Characteristic this Descriptor is a part of."""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_descriptor_get_characteristic(mp_obj_t self_in) {
|
||||
@ -167,7 +167,7 @@ const mp_obj_property_t bleio_descriptor_characteristic_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| value: Any = ...
|
||||
//| value: WriteableBuffer = ...
|
||||
//| """The value of this descriptor."""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_descriptor_get_value(mp_obj_t self_in) {
|
||||
|
@ -44,7 +44,7 @@
|
||||
//| When we're the server, we ignore all connections besides the first to subscribe to
|
||||
//| notifications."""
|
||||
//|
|
||||
//| def __init__(self, characteristic: Characteristic, *, buffer_size: int):
|
||||
//| def __init__(self, characteristic: Characteristic, *, buffer_size: int) -> None:
|
||||
//| """Monitor the given Characteristic. Each time a new value is written to the Characteristic
|
||||
//| add the newly-written bytes to a FIFO buffer.
|
||||
//|
|
||||
@ -93,7 +93,7 @@ STATIC void check_for_deinit(bleio_packet_buffer_obj_t *self) {
|
||||
}
|
||||
}
|
||||
|
||||
//| def readinto(self, buf: Any) -> Any:
|
||||
//| def readinto(self, buf: WriteableBuffer) -> int:
|
||||
//| """Reads a single BLE packet into the ``buf``. Raises an exception if the next packet is longer
|
||||
//| than the given buffer. Use `packet_size` to read the maximum length of a single packet.
|
||||
//|
|
||||
@ -117,7 +117,7 @@ STATIC mp_obj_t bleio_packet_buffer_readinto(mp_obj_t self_in, mp_obj_t buffer_o
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(bleio_packet_buffer_readinto_obj, bleio_packet_buffer_readinto);
|
||||
|
||||
//| def write(self, data: Any, *, header: Any = None) -> Any:
|
||||
//| def write(self, data: bytes, *, header: Optional[bytes] = None) -> int:
|
||||
//| """Writes all bytes from data into the same outgoing packet. The bytes from header are included
|
||||
//| before data when the pending packet is currently empty.
|
||||
//|
|
||||
@ -169,7 +169,7 @@ STATIC mp_obj_t bleio_packet_buffer_write(mp_uint_t n_args, const mp_obj_t *pos_
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_packet_buffer_write_obj, 1, bleio_packet_buffer_write);
|
||||
|
||||
//| def deinit(self) -> Any:
|
||||
//| def deinit(self) -> None:
|
||||
//| """Disable permanently."""
|
||||
//| ...
|
||||
STATIC mp_obj_t bleio_packet_buffer_deinit(mp_obj_t self_in) {
|
||||
@ -184,7 +184,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(bleio_packet_buffer_deinit_obj, bleio_packet_bu
|
||||
//| The name `packet_size` is deprecated and
|
||||
//| will be removed in CircuitPython 6.0.0."""
|
||||
//|
|
||||
//| incoming_packet_length: Any = ...
|
||||
//| incoming_packet_length: int = ...
|
||||
//| """Maximum length in bytes of a packet we are reading."""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_packet_buffer_get_incoming_packet_length(mp_obj_t self_in) {
|
||||
|
@ -41,11 +41,11 @@
|
||||
//| it has no user-visible constructor."""
|
||||
//|
|
||||
|
||||
//| def __init__(self, ):
|
||||
//| def __init__(self) -> None:
|
||||
//| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`."""
|
||||
//| ...
|
||||
//|
|
||||
//| def matches(self, prefixes: Any, *, all: Any = True) -> Any:
|
||||
//| def matches(self, prefixes: ScanEntry, *, all: bool = True) -> bool:
|
||||
//| """Returns True if the ScanEntry matches all prefixes when ``all`` is True. This is stricter
|
||||
//| than the scan filtering which accepts any advertisements that match any of the prefixes
|
||||
//| where all is False."""
|
||||
@ -70,7 +70,7 @@ STATIC mp_obj_t bleio_scanentry_matches(mp_uint_t n_args, const mp_obj_t *pos_ar
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(bleio_scanentry_matches_obj, 2, bleio_scanentry_matches);
|
||||
|
||||
//| address: Any = ...
|
||||
//| address: Address = ...
|
||||
//| """The address of the device (read-only), of type `_bleio.Address`."""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_scanentry_get_address(mp_obj_t self_in) {
|
||||
@ -86,7 +86,7 @@ const mp_obj_property_t bleio_scanentry_address_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| advertisement_bytes: Any = ...
|
||||
//| advertisement_bytes: bytes = ...
|
||||
//| """All the advertisement data present in the packet, returned as a ``bytes`` object. (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t scanentry_get_advertisement_bytes(mp_obj_t self_in) {
|
||||
@ -102,7 +102,7 @@ const mp_obj_property_t bleio_scanentry_advertisement_bytes_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| rssi: Any = ...
|
||||
//| rssi: int = ...
|
||||
//| """The signal strength of the device at the time of the scan, in integer dBm. (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t scanentry_get_rssi(mp_obj_t self_in) {
|
||||
@ -118,7 +118,7 @@ const mp_obj_property_t bleio_scanentry_rssi_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| connectable: Any = ...
|
||||
//| connectable: bool = ...
|
||||
//| """True if the device can be connected to. (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t scanentry_get_connectable(mp_obj_t self_in) {
|
||||
@ -134,7 +134,7 @@ const mp_obj_property_t bleio_scanentry_connectable_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| scan_response: Any = ...
|
||||
//| scan_response: bool = ...
|
||||
//| """True if the entry was a scan response. (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t scanentry_get_scan_response(mp_obj_t self_in) {
|
||||
|
@ -46,15 +46,15 @@ STATIC mp_obj_t scanresults_iternext(mp_obj_t self_in) {
|
||||
return MP_OBJ_STOP_ITERATION;
|
||||
}
|
||||
|
||||
//| def __init__(self, ):
|
||||
//| def __init__(self) -> None:
|
||||
//| """Cannot be instantiated directly. Use `_bleio.Adapter.start_scan`."""
|
||||
//| ...
|
||||
//|
|
||||
//| def __iter__(self, ) -> Any:
|
||||
//| def __iter__(self) -> Iterator[ScanEntry]:
|
||||
//| """Returns itself since it is the iterator."""
|
||||
//| ...
|
||||
//|
|
||||
//| def __next__(self, ) -> Any:
|
||||
//| def __next__(self) -> ScanEntry:
|
||||
//| """Returns the next `_bleio.ScanEntry`. Blocks if none have been received and scanning is still
|
||||
//| active. Raises `StopIteration` if scanning is finished and no other results are available."""
|
||||
//| ...
|
||||
|
@ -35,7 +35,7 @@
|
||||
//| class Service:
|
||||
//| """Stores information about a BLE service and its characteristics."""
|
||||
//|
|
||||
//| def __init__(self, uuid: UUID, *, secondary: bool = False):
|
||||
//| def __init__(self, uuid: UUID, *, secondary: bool = False) -> None:
|
||||
//| """Create a new Service identified by the specified UUID. It can be accessed by all
|
||||
//| connections. This is known as a Service server. Client Service objects are created via
|
||||
//| `Connection.discover_remote_services`.
|
||||
@ -73,7 +73,7 @@ STATIC mp_obj_t bleio_service_make_new(const mp_obj_type_t *type, size_t n_args,
|
||||
return MP_OBJ_FROM_PTR(service);
|
||||
}
|
||||
|
||||
//| characteristics: Any = ...
|
||||
//| characteristics: Tuple[Characteristic, ...] = ...
|
||||
//| """A tuple of :py:class:`Characteristic` designating the characteristics that are offered by
|
||||
//| this service. (read-only)"""
|
||||
//|
|
||||
@ -92,7 +92,7 @@ const mp_obj_property_t bleio_service_characteristics_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| remote: Any = ...
|
||||
//| remote: bool = ...
|
||||
//| """True if this is a service provided by a remote device. (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_service_get_remote(mp_obj_t self_in) {
|
||||
@ -109,7 +109,7 @@ const mp_obj_property_t bleio_service_remote_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| secondary: Any = ...
|
||||
//| secondary: bool = ...
|
||||
//| """True if this is a secondary service. (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t bleio_service_get_secondary(mp_obj_t self_in) {
|
||||
@ -126,7 +126,7 @@ const mp_obj_property_t bleio_service_secondary_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj },
|
||||
};
|
||||
|
||||
//| uuid: Any = ...
|
||||
//| uuid: Optional[UUID] = ...
|
||||
//| """The UUID of this service. (read-only)
|
||||
//|
|
||||
//| Will be ``None`` if the 128-bit UUID for this service is not known."""
|
||||
|
@ -36,7 +36,7 @@
|
||||
//| class UUID:
|
||||
//| """A 16-bit or 128-bit UUID. Can be used for services, characteristics, descriptors and more."""
|
||||
//|
|
||||
//| def __init__(self, value: Any):
|
||||
//| def __init__(self, value: Union[int, ReadableBuffer, str]) -> None:
|
||||
//| """Create a new UUID or UUID object encapsulating the uuid value.
|
||||
//| The value can be one of:
|
||||
//|
|
||||
@ -120,7 +120,7 @@ STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, co
|
||||
return MP_OBJ_FROM_PTR(self);
|
||||
}
|
||||
|
||||
//| uuid16: Any = ...
|
||||
//| uuid16: int = ...
|
||||
//| """The 16-bit part of the UUID. (read-only)
|
||||
//|
|
||||
//| :type: int"""
|
||||
@ -139,7 +139,7 @@ const mp_obj_property_t bleio_uuid_uuid16_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| uuid128: Any = ...
|
||||
//| uuid128: bytes = ...
|
||||
//| """The 128-bit value of the UUID
|
||||
//| Raises AttributeError if this is a 16-bit UUID. (read-only)
|
||||
//|
|
||||
@ -165,7 +165,7 @@ const mp_obj_property_t bleio_uuid_uuid128_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| size: Any = ...
|
||||
//| size: int = ...
|
||||
//| """128 if this UUID represents a 128-bit vendor-specific UUID. 16 if this UUID represents a
|
||||
//| 16-bit Bluetooth SIG assigned UUID. (read-only) 32-bit UUIDs are not currently supported.
|
||||
//|
|
||||
@ -186,7 +186,7 @@ const mp_obj_property_t bleio_uuid_size_obj = {
|
||||
};
|
||||
|
||||
|
||||
//| def pack_into(self, buffer: Any, offset: Any = 0) -> Any:
|
||||
//| def pack_into(self, buffer: WriteableBuffer, offset: int = 0) -> None:
|
||||
//| """Packs the UUID into the given buffer at the given offset."""
|
||||
//| ...
|
||||
//|
|
||||
@ -248,7 +248,7 @@ STATIC mp_obj_t bleio_uuid_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
|
||||
}
|
||||
}
|
||||
|
||||
//| def __eq__(self, other: Any) -> Any:
|
||||
//| def __eq__(self, other: Any) -> bool:
|
||||
//| """Two UUID objects are equal if their values match and they are both 128-bit or both 16-bit."""
|
||||
//| ...
|
||||
//|
|
||||
|
@ -58,11 +58,9 @@
|
||||
//| This object is the sole instance of `_bleio.Adapter`."""
|
||||
//|
|
||||
|
||||
|
||||
//| class BluetoothError:
|
||||
//| def __init__(self, Exception: Any):
|
||||
//| """Catch all exception for Bluetooth related errors."""
|
||||
//| ...
|
||||
//| class BluetoothError(Exception):
|
||||
//| """Catchall exception for Bluetooth related errors."""
|
||||
//| ...
|
||||
MP_DEFINE_BLEIO_EXCEPTION(BluetoothError, Exception)
|
||||
|
||||
NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...) {
|
||||
@ -72,10 +70,9 @@ NORETURN void mp_raise_bleio_BluetoothError(const compressed_string_t* fmt, ...)
|
||||
va_end(argptr);
|
||||
nlr_raise(exception);
|
||||
}
|
||||
//| class ConnectionError:
|
||||
//| def __init__(self, BluetoothError: Any):
|
||||
//| """Raised when a connection is unavailable."""
|
||||
//| ...
|
||||
//| class ConnectionError(BluetoothError):
|
||||
//| """Raised when a connection is unavailable."""
|
||||
//| ...
|
||||
//|
|
||||
MP_DEFINE_BLEIO_EXCEPTION(ConnectionError, bleio_BluetoothError)
|
||||
NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ...) {
|
||||
@ -86,20 +83,18 @@ NORETURN void mp_raise_bleio_ConnectionError(const compressed_string_t* fmt, ...
|
||||
nlr_raise(exception);
|
||||
}
|
||||
|
||||
//| class RoleError:
|
||||
//| def __init__(self, BluetoothError: Any):
|
||||
//| """Raised when a resource is used as the mismatched role. For example, if a local CCCD is
|
||||
//| attempted to be set but they can only be set when remote."""
|
||||
//| ...
|
||||
//| class RoleError(BluetoothError):
|
||||
//| """Raised when a resource is used as the mismatched role. For example, if a local CCCD is
|
||||
//| attempted to be set but they can only be set when remote."""
|
||||
//| ...
|
||||
//|
|
||||
MP_DEFINE_BLEIO_EXCEPTION(RoleError, bleio_BluetoothError)
|
||||
NORETURN void mp_raise_bleio_RoleError(const compressed_string_t* msg) {
|
||||
mp_raise_msg(&mp_type_bleio_RoleError, msg);
|
||||
}
|
||||
//| class SecurityError:
|
||||
//| def __init__(self, BluetoothError: Any):
|
||||
//| """Raised when a security related error occurs."""
|
||||
//| ...
|
||||
//| class SecurityError(BluetoothError):
|
||||
//| """Raised when a security related error occurs."""
|
||||
//| ...
|
||||
//|
|
||||
MP_DEFINE_BLEIO_EXCEPTION(SecurityError, bleio_BluetoothError)
|
||||
NORETURN void mp_raise_bleio_SecurityError(const compressed_string_t* fmt, ...) {
|
||||
|
@ -58,7 +58,7 @@ STATIC mp_obj_t _register(mp_obj_t self, mp_obj_t o) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(register_obj, _register);
|
||||
|
||||
//| def flush(self, ) -> Any:
|
||||
//| def flush(self) -> None:
|
||||
//| """Send any queued drawing commands directly to the hardware.
|
||||
//|
|
||||
//| :param int width: The width of the grid in tiles, or 1 for sprites."""
|
||||
@ -70,7 +70,7 @@ STATIC mp_obj_t _flush(mp_obj_t self) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(flush_obj, _flush);
|
||||
|
||||
//| def cc(self, b: bytes) -> Any:
|
||||
//| def cc(self, b: bytes) -> None:
|
||||
//| """Append bytes to the command FIFO.
|
||||
//|
|
||||
//| :param bytes b: The bytes to add"""
|
||||
@ -86,7 +86,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_2(cc_obj, _cc);
|
||||
|
||||
//{
|
||||
|
||||
//| def AlphaFunc(self, func: int, ref: int) -> Any:
|
||||
//| def AlphaFunc(self, func: int, ref: int) -> None:
|
||||
//| """Set the alpha test function
|
||||
//|
|
||||
//| :param int func: specifies the test function, one of ``NEVER``, ``LESS``, ``LEQUAL``, ``GREATER``, ``GEQUAL``, ``EQUAL``, ``NOTEQUAL``, or ``ALWAYS``. Range 0-7. The initial value is ALWAYS(7)
|
||||
@ -104,7 +104,7 @@ STATIC mp_obj_t _alphafunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(alphafunc_obj, _alphafunc);
|
||||
|
||||
//| def Begin(self, prim: int) -> Any:
|
||||
//| def Begin(self, prim: int) -> None:
|
||||
//| """Begin drawing a graphics primitive
|
||||
//|
|
||||
//| :param int prim: graphics primitive.
|
||||
@ -120,7 +120,7 @@ STATIC mp_obj_t _begin(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(begin_obj, _begin);
|
||||
|
||||
//| def BitmapExtFormat(self, format: int) -> Any:
|
||||
//| def BitmapExtFormat(self, format: int) -> None:
|
||||
//| """Set the bitmap format
|
||||
//|
|
||||
//| :param int format: bitmap pixel format."""
|
||||
@ -134,7 +134,7 @@ STATIC mp_obj_t _bitmapextformat(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmapextformat_obj, _bitmapextformat);
|
||||
|
||||
//| def BitmapHandle(self, handle: int) -> Any:
|
||||
//| def BitmapHandle(self, handle: int) -> None:
|
||||
//| """Set the bitmap handle
|
||||
//|
|
||||
//| :param int handle: bitmap handle. Range 0-31. The initial value is 0
|
||||
@ -150,7 +150,7 @@ STATIC mp_obj_t _bitmaphandle(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaphandle_obj, _bitmaphandle);
|
||||
|
||||
//| def BitmapLayoutH(self, linestride: int, height: int) -> Any:
|
||||
//| def BitmapLayoutH(self, linestride: int, height: int) -> None:
|
||||
//| """Set the source bitmap memory format and layout for the current handle. high bits for large bitmaps
|
||||
//|
|
||||
//| :param int linestride: high part of bitmap line stride, in bytes. Range 0-7
|
||||
@ -166,7 +166,7 @@ STATIC mp_obj_t _bitmaplayouth(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaplayouth_obj, _bitmaplayouth);
|
||||
|
||||
//| def BitmapLayout(self, format: int, linestride: int, height: int) -> Any:
|
||||
//| def BitmapLayout(self, format: int, linestride: int, height: int) -> None:
|
||||
//| """Set the source bitmap memory format and layout for the current handle
|
||||
//|
|
||||
//| :param int format: bitmap pixel format, or GLFORMAT to use BITMAP_EXT_FORMAT instead. Range 0-31
|
||||
@ -184,7 +184,7 @@ STATIC mp_obj_t _bitmaplayout(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmaplayout_obj, 4, 4, _bitmaplayout);
|
||||
|
||||
//| def BitmapSizeH(self, width: int, height: int) -> Any:
|
||||
//| def BitmapSizeH(self, width: int, height: int) -> None:
|
||||
//| """Set the screen drawing of bitmaps for the current handle. high bits for large bitmaps
|
||||
//|
|
||||
//| :param int width: high part of drawn bitmap width, in pixels. Range 0-3
|
||||
@ -200,7 +200,7 @@ STATIC mp_obj_t _bitmapsizeh(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmapsizeh_obj, _bitmapsizeh);
|
||||
|
||||
//| def BitmapSize(self, filter: int, wrapx: int, wrapy: int, width: int, height: int) -> Any:
|
||||
//| def BitmapSize(self, filter: int, wrapx: int, wrapy: int, width: int, height: int) -> None:
|
||||
//| """Set the screen drawing of bitmaps for the current handle
|
||||
//|
|
||||
//| :param int filter: bitmap filtering mode, one of ``NEAREST`` or ``BILINEAR``. Range 0-1
|
||||
@ -222,7 +222,7 @@ STATIC mp_obj_t _bitmapsize(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmapsize_obj, 6, 6, _bitmapsize);
|
||||
|
||||
//| def BitmapSource(self, addr: int) -> Any:
|
||||
//| def BitmapSource(self, addr: int) -> None:
|
||||
//| """Set the source address for bitmap graphics
|
||||
//|
|
||||
//| :param int addr: Bitmap start address, pixel-aligned. May be in SRAM or flash. Range 0-16777215"""
|
||||
@ -236,7 +236,7 @@ STATIC mp_obj_t _bitmapsource(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmapsource_obj, _bitmapsource);
|
||||
|
||||
//| def BitmapSwizzle(self, r: int, g: int, b: int, a: int) -> Any:
|
||||
//| def BitmapSwizzle(self, r: int, g: int, b: int, a: int) -> None:
|
||||
//| """Set the source for the r,g,b and a channels of a bitmap
|
||||
//|
|
||||
//| :param int r: red component source channel. Range 0-7
|
||||
@ -256,7 +256,7 @@ STATIC mp_obj_t _bitmapswizzle(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(bitmapswizzle_obj, 5, 5, _bitmapswizzle);
|
||||
|
||||
//| def BitmapTransformA(self, p: Any, v: int) -> Any:
|
||||
//| def BitmapTransformA(self, p: int, v: int) -> None:
|
||||
//| """Set the :math:`a` component of the bitmap transform matrix
|
||||
//|
|
||||
//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0
|
||||
@ -276,7 +276,7 @@ STATIC mp_obj_t _bitmaptransforma(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransforma_obj, _bitmaptransforma);
|
||||
|
||||
//| def BitmapTransformB(self, p: Any, v: int) -> Any:
|
||||
//| def BitmapTransformB(self, p: int, v: int) -> None:
|
||||
//| """Set the :math:`b` component of the bitmap transform matrix
|
||||
//|
|
||||
//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0
|
||||
@ -296,7 +296,7 @@ STATIC mp_obj_t _bitmaptransformb(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransformb_obj, _bitmaptransformb);
|
||||
|
||||
//| def BitmapTransformC(self, v: int) -> Any:
|
||||
//| def BitmapTransformC(self, v: int) -> None:
|
||||
//| """Set the :math:`c` component of the bitmap transform matrix
|
||||
//|
|
||||
//| :param int v: The :math:`c` component of the bitmap transform matrix, in signed 15.8 bit fixed-point form. Range 0-16777215. The initial value is 0
|
||||
@ -312,7 +312,7 @@ STATIC mp_obj_t _bitmaptransformc(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaptransformc_obj, _bitmaptransformc);
|
||||
|
||||
//| def BitmapTransformD(self, p: Any, v: int) -> Any:
|
||||
//| def BitmapTransformD(self, p: int, v: int) -> None:
|
||||
//| """Set the :math:`d` component of the bitmap transform matrix
|
||||
//|
|
||||
//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0
|
||||
@ -332,7 +332,7 @@ STATIC mp_obj_t _bitmaptransformd(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransformd_obj, _bitmaptransformd);
|
||||
|
||||
//| def BitmapTransformE(self, p: Any, v: int) -> Any:
|
||||
//| def BitmapTransformE(self, p: int, v: int) -> None:
|
||||
//| """Set the :math:`e` component of the bitmap transform matrix
|
||||
//|
|
||||
//| :param int p: precision control: 0 is 8.8, 1 is 1.15. Range 0-1. The initial value is 0
|
||||
@ -352,7 +352,7 @@ STATIC mp_obj_t _bitmaptransforme(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(bitmaptransforme_obj, _bitmaptransforme);
|
||||
|
||||
//| def BitmapTransformF(self, v: int) -> Any:
|
||||
//| def BitmapTransformF(self, v: int) -> None:
|
||||
//| """Set the :math:`f` component of the bitmap transform matrix
|
||||
//|
|
||||
//| :param int v: The :math:`f` component of the bitmap transform matrix, in signed 15.8 bit fixed-point form. Range 0-16777215. The initial value is 0
|
||||
@ -368,7 +368,7 @@ STATIC mp_obj_t _bitmaptransformf(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(bitmaptransformf_obj, _bitmaptransformf);
|
||||
|
||||
//| def BlendFunc(self, src: int, dst: int) -> Any:
|
||||
//| def BlendFunc(self, src: int, dst: int) -> None:
|
||||
//| """Set pixel arithmetic
|
||||
//|
|
||||
//| :param int src: specifies how the source blending factor is computed. One of ``ZERO``, ``ONE``, ``SRC_ALPHA``, ``DST_ALPHA``, ``ONE_MINUS_SRC_ALPHA`` or ``ONE_MINUS_DST_ALPHA``. Range 0-7. The initial value is SRC_ALPHA(2)
|
||||
@ -386,7 +386,7 @@ STATIC mp_obj_t _blendfunc(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(blendfunc_obj, _blendfunc);
|
||||
|
||||
//| def Call(self, dest: int) -> Any:
|
||||
//| def Call(self, dest: int) -> None:
|
||||
//| """Execute a sequence of commands at another location in the display list
|
||||
//|
|
||||
//| :param int dest: display list address. Range 0-65535"""
|
||||
@ -400,7 +400,7 @@ STATIC mp_obj_t _call(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(call_obj, _call);
|
||||
|
||||
//| def Cell(self, cell: int) -> Any:
|
||||
//| def Cell(self, cell: int) -> None:
|
||||
//| """Set the bitmap cell number for the vertex2f command
|
||||
//|
|
||||
//| :param int cell: bitmap cell number. Range 0-127. The initial value is 0
|
||||
@ -416,7 +416,7 @@ STATIC mp_obj_t _cell(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(cell_obj, _cell);
|
||||
|
||||
//| def ClearColorA(self, alpha: int) -> Any:
|
||||
//| def ClearColorA(self, alpha: int) -> None:
|
||||
//| """Set clear value for the alpha channel
|
||||
//|
|
||||
//| :param int alpha: alpha value used when the color buffer is cleared. Range 0-255. The initial value is 0
|
||||
@ -432,7 +432,7 @@ STATIC mp_obj_t _clearcolora(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(clearcolora_obj, _clearcolora);
|
||||
|
||||
//| def ClearColorRGB(self, red: int, green: int, blue: int) -> Any:
|
||||
//| def ClearColorRGB(self, red: int, green: int, blue: int) -> None:
|
||||
//| """Set clear values for red, green and blue channels
|
||||
//|
|
||||
//| :param int red: red value used when the color buffer is cleared. Range 0-255. The initial value is 0
|
||||
@ -452,7 +452,7 @@ STATIC mp_obj_t _clearcolorrgb(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(clearcolorrgb_obj, 4, 4, _clearcolorrgb);
|
||||
|
||||
//| def Clear(self, c: int, s: int, t: int) -> Any:
|
||||
//| def Clear(self, c: int, s: int, t: int) -> None:
|
||||
//| """Clear buffers to preset values
|
||||
//|
|
||||
//| :param int c: clear color buffer. Range 0-1
|
||||
@ -470,7 +470,7 @@ STATIC mp_obj_t _clear(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(clear_obj, 1, 4, _clear);
|
||||
|
||||
//| def ClearStencil(self, s: int) -> Any:
|
||||
//| def ClearStencil(self, s: int) -> None:
|
||||
//| """Set clear value for the stencil buffer
|
||||
//|
|
||||
//| :param int s: value used when the stencil buffer is cleared. Range 0-255. The initial value is 0
|
||||
@ -486,7 +486,7 @@ STATIC mp_obj_t _clearstencil(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(clearstencil_obj, _clearstencil);
|
||||
|
||||
//| def ClearTag(self, s: int) -> Any:
|
||||
//| def ClearTag(self, s: int) -> None:
|
||||
//| """Set clear value for the tag buffer
|
||||
//|
|
||||
//| :param int s: value used when the tag buffer is cleared. Range 0-255. The initial value is 0
|
||||
@ -501,7 +501,7 @@ STATIC mp_obj_t _cleartag(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(cleartag_obj, _cleartag);
|
||||
|
||||
//| def ColorA(self, alpha: int) -> Any:
|
||||
//| def ColorA(self, alpha: int) -> None:
|
||||
//| """Set the current color alpha
|
||||
//|
|
||||
//| :param int alpha: alpha for the current color. Range 0-255. The initial value is 255
|
||||
@ -517,7 +517,7 @@ STATIC mp_obj_t _colora(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(colora_obj, _colora);
|
||||
|
||||
//| def ColorMask(self, r: int, g: int, b: int, a: int) -> Any:
|
||||
//| def ColorMask(self, r: int, g: int, b: int, a: int) -> None:
|
||||
//| """Enable and disable writing of frame buffer color components
|
||||
//|
|
||||
//| :param int r: allow updates to the frame buffer red component. Range 0-1. The initial value is 1
|
||||
@ -539,7 +539,7 @@ STATIC mp_obj_t _colormask(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(colormask_obj, 5, 5, _colormask);
|
||||
|
||||
//| def ColorRGB(self, red: int, green: int, blue: int) -> Any:
|
||||
//| def ColorRGB(self, red: int, green: int, blue: int) -> None:
|
||||
//| """Set the drawing color
|
||||
//|
|
||||
//| :param int red: red value for the current color. Range 0-255. The initial value is 255
|
||||
@ -559,9 +559,9 @@ STATIC mp_obj_t _colorrgb(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(colorrgb_obj, 4, 4, _colorrgb);
|
||||
|
||||
//| def Display(self, ) -> Any: ...
|
||||
//| """End the display list"""
|
||||
//|
|
||||
//| def Display(self) -> None:
|
||||
//| """End the display list"""
|
||||
//| ...
|
||||
|
||||
STATIC mp_obj_t _display(mp_obj_t self) {
|
||||
|
||||
@ -570,7 +570,7 @@ STATIC mp_obj_t _display(mp_obj_t self) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(display_obj, _display);
|
||||
|
||||
//| def End(self, ) -> Any:
|
||||
//| def End(self) -> None:
|
||||
//| """End drawing a graphics primitive
|
||||
//|
|
||||
//| :meth:`Vertex2ii` and :meth:`Vertex2f` calls are ignored until the next :meth:`Begin`."""
|
||||
@ -584,7 +584,7 @@ STATIC mp_obj_t _end(mp_obj_t self) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(end_obj, _end);
|
||||
|
||||
//| def Jump(self, dest: int) -> Any:
|
||||
//| def Jump(self, dest: int) -> None:
|
||||
//| """Execute commands at another location in the display list
|
||||
//|
|
||||
//| :param int dest: display list address. Range 0-65535"""
|
||||
@ -598,7 +598,7 @@ STATIC mp_obj_t _jump(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(jump_obj, _jump);
|
||||
|
||||
//| def LineWidth(self, width: int) -> Any:
|
||||
//| def LineWidth(self, width: int) -> None:
|
||||
//| """Set the width of rasterized lines
|
||||
//|
|
||||
//| :param int width: line width in :math:`1/16` pixel. Range 0-4095. The initial value is 16
|
||||
@ -614,7 +614,7 @@ STATIC mp_obj_t _linewidth(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(linewidth_obj, _linewidth);
|
||||
|
||||
//| def Macro(self, m: int) -> Any:
|
||||
//| def Macro(self, m: int) -> None:
|
||||
//| """Execute a single command from a macro register
|
||||
//|
|
||||
//| :param int m: macro register to read. Range 0-1"""
|
||||
@ -628,7 +628,7 @@ STATIC mp_obj_t _macro(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(macro_obj, _macro);
|
||||
|
||||
//| def Nop(self, ) -> Any:
|
||||
//| def Nop(self) -> None:
|
||||
//| """No operation"""
|
||||
//| ...
|
||||
//|
|
||||
@ -640,7 +640,7 @@ STATIC mp_obj_t _nop(mp_obj_t self) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(nop_obj, _nop);
|
||||
|
||||
//| def PaletteSource(self, addr: int) -> Any:
|
||||
//| def PaletteSource(self, addr: int) -> None:
|
||||
//| """Set the base address of the palette
|
||||
//|
|
||||
//| :param int addr: Address in graphics SRAM, 2-byte aligned. Range 0-4194303. The initial value is 0
|
||||
@ -656,7 +656,7 @@ STATIC mp_obj_t _palettesource(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(palettesource_obj, _palettesource);
|
||||
|
||||
//| def PointSize(self, size: int) -> Any:
|
||||
//| def PointSize(self, size: int) -> None:
|
||||
//| """Set the radius of rasterized points
|
||||
//|
|
||||
//| :param int size: point radius in :math:`1/16` pixel. Range 0-8191. The initial value is 16
|
||||
@ -672,7 +672,7 @@ STATIC mp_obj_t _pointsize(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(pointsize_obj, _pointsize);
|
||||
|
||||
//| def RestoreContext(self, ) -> Any:
|
||||
//| def RestoreContext(self) -> None:
|
||||
//| """Restore the current graphics context from the context stack"""
|
||||
//| ...
|
||||
//|
|
||||
@ -684,7 +684,7 @@ STATIC mp_obj_t _restorecontext(mp_obj_t self) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(restorecontext_obj, _restorecontext);
|
||||
|
||||
//| def Return(self, ) -> Any:
|
||||
//| def Return(self) -> None:
|
||||
//| """Return from a previous call command"""
|
||||
//| ...
|
||||
//|
|
||||
@ -696,7 +696,7 @@ STATIC mp_obj_t _return(mp_obj_t self) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(return_obj, _return);
|
||||
|
||||
//| def SaveContext(self, ) -> Any:
|
||||
//| def SaveContext(self) -> None:
|
||||
//| """Push the current graphics context on the context stack"""
|
||||
//| ...
|
||||
//|
|
||||
@ -708,7 +708,7 @@ STATIC mp_obj_t _savecontext(mp_obj_t self) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(savecontext_obj, _savecontext);
|
||||
|
||||
//| def ScissorSize(self, width: int, height: int) -> Any:
|
||||
//| def ScissorSize(self, width: int, height: int) -> None:
|
||||
//| """Set the size of the scissor clip rectangle
|
||||
//|
|
||||
//| :param int width: The width of the scissor clip rectangle, in pixels. Range 0-4095. The initial value is hsize
|
||||
@ -726,7 +726,7 @@ STATIC mp_obj_t _scissorsize(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(scissorsize_obj, _scissorsize);
|
||||
|
||||
//| def ScissorXY(self, x: int, y: int) -> Any:
|
||||
//| def ScissorXY(self, x: int, y: int) -> None:
|
||||
//| """Set the top left corner of the scissor clip rectangle
|
||||
//|
|
||||
//| :param int x: The :math:`x` coordinate of the scissor clip rectangle, in pixels. Range 0-2047. The initial value is 0
|
||||
@ -744,7 +744,7 @@ STATIC mp_obj_t _scissorxy(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(scissorxy_obj, _scissorxy);
|
||||
|
||||
//| def StencilFunc(self, func: int, ref: int, mask: int) -> Any:
|
||||
//| def StencilFunc(self, func: int, ref: int, mask: int) -> None:
|
||||
//| """Set function and reference value for stencil testing
|
||||
//|
|
||||
//| :param int func: specifies the test function, one of ``NEVER``, ``LESS``, ``LEQUAL``, ``GREATER``, ``GEQUAL``, ``EQUAL``, ``NOTEQUAL``, or ``ALWAYS``. Range 0-7. The initial value is ALWAYS(7)
|
||||
@ -764,7 +764,7 @@ STATIC mp_obj_t _stencilfunc(size_t n_args, const mp_obj_t *args) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(stencilfunc_obj, 4, 4, _stencilfunc);
|
||||
|
||||
//| def StencilMask(self, mask: int) -> Any:
|
||||
//| def StencilMask(self, mask: int) -> None:
|
||||
//| """Control the writing of individual bits in the stencil planes
|
||||
//|
|
||||
//| :param int mask: the mask used to enable writing stencil bits. Range 0-255. The initial value is 255
|
||||
@ -780,7 +780,7 @@ STATIC mp_obj_t _stencilmask(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(stencilmask_obj, _stencilmask);
|
||||
|
||||
//| def StencilOp(self, sfail: int, spass: int) -> Any:
|
||||
//| def StencilOp(self, sfail: int, spass: int) -> None:
|
||||
//| """Set stencil test actions
|
||||
//|
|
||||
//| :param int sfail: specifies the action to take when the stencil test fails, one of ``KEEP``, ``ZERO``, ``REPLACE``, ``INCR``, ``INCR_WRAP``, ``DECR``, ``DECR_WRAP``, and ``INVERT``. Range 0-7. The initial value is KEEP(1)
|
||||
@ -798,7 +798,7 @@ STATIC mp_obj_t _stencilop(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_3(stencilop_obj, _stencilop);
|
||||
|
||||
//| def TagMask(self, mask: int) -> Any:
|
||||
//| def TagMask(self, mask: int) -> None:
|
||||
//| """Control the writing of the tag buffer
|
||||
//|
|
||||
//| :param int mask: allow updates to the tag buffer. Range 0-1. The initial value is 1
|
||||
@ -814,7 +814,7 @@ STATIC mp_obj_t _tagmask(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(tagmask_obj, _tagmask);
|
||||
|
||||
//| def Tag(self, s: int) -> Any:
|
||||
//| def Tag(self, s: int) -> None:
|
||||
//| """Set the current tag value
|
||||
//|
|
||||
//| :param int s: tag value. Range 0-255. The initial value is 255
|
||||
@ -830,7 +830,7 @@ STATIC mp_obj_t _tag(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(tag_obj, _tag);
|
||||
|
||||
//| def VertexTranslateX(self, x: int) -> Any:
|
||||
//| def VertexTranslateX(self, x: int) -> None:
|
||||
//| """Set the vertex transformation's x translation component
|
||||
//|
|
||||
//| :param int x: signed x-coordinate in :math:`1/16` pixel. Range 0-131071. The initial value is 0
|
||||
@ -846,7 +846,7 @@ STATIC mp_obj_t _vertextranslatex(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertextranslatex_obj, _vertextranslatex);
|
||||
|
||||
//| def VertexTranslateY(self, y: int) -> Any:
|
||||
//| def VertexTranslateY(self, y: int) -> None:
|
||||
//| """Set the vertex transformation's y translation component
|
||||
//|
|
||||
//| :param int y: signed y-coordinate in :math:`1/16` pixel. Range 0-131071. The initial value is 0
|
||||
@ -863,7 +863,7 @@ STATIC mp_obj_t _vertextranslatey(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertextranslatey_obj, _vertextranslatey);
|
||||
|
||||
//| def VertexFormat(self, frac: int) -> Any:
|
||||
//| def VertexFormat(self, frac: int) -> None:
|
||||
//| """Set the precision of vertex2f coordinates
|
||||
//|
|
||||
//| :param int frac: Number of fractional bits in X,Y coordinates, 0-4. Range 0-7. The initial value is 4
|
||||
@ -879,7 +879,7 @@ STATIC mp_obj_t _vertexformat(mp_obj_t self, mp_obj_t a0) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertexformat_obj, _vertexformat);
|
||||
|
||||
//| def Vertex2ii(self, x: int, y: int, handle: int, cell: int) -> Any:
|
||||
//| def Vertex2ii(self, x: int, y: int, handle: int, cell: int) -> None:
|
||||
//| """:param int x: x-coordinate in pixels. Range 0-511
|
||||
//| :param int y: y-coordinate in pixels. Range 0-511
|
||||
//| :param int handle: bitmap handle. Range 0-31
|
||||
@ -954,7 +954,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(vertex2ii_obj, 3, 5, _vertex2ii);
|
||||
|
||||
// Hand-written functions {
|
||||
|
||||
//| def Vertex2f(self, b: Any) -> Any:
|
||||
//| def Vertex2f(self, b: float) -> None:
|
||||
//| """Draw a point.
|
||||
//|
|
||||
//| :param float x: pixel x-coordinate
|
||||
@ -973,7 +973,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_3(vertex2f_obj, _vertex2f);
|
||||
#define ADD_X(self, x) \
|
||||
common_hal__eve_add(EVEHAL(self), sizeof(x), &(x));
|
||||
|
||||
//| def cmd0(self, n: int) -> Any:
|
||||
//| def cmd0(self, n: int) -> None:
|
||||
//| """Append the command word n to the FIFO
|
||||
//|
|
||||
//| :param int n: The command code
|
||||
@ -990,7 +990,7 @@ STATIC mp_obj_t _cmd0(mp_obj_t self, mp_obj_t n) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(cmd0_obj, _cmd0);
|
||||
|
||||
//| def cmd(self, n: int, fmt: str, args: tuple) -> Any:
|
||||
//| def cmd(self, n: int, fmt: str, args: tuple) -> None:
|
||||
//| """Append a command packet to the FIFO.
|
||||
//|
|
||||
//| :param int n: The command code
|
||||
|
@ -46,7 +46,7 @@
|
||||
//| that library."""
|
||||
//|
|
||||
|
||||
//| def __init__(self, buffer: Any, rows: Any, cols: Any, buttons: Any):
|
||||
//| def __init__(self, buffer: ReadableBuffer, rows: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], cols: List[DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut, DigitalInOut], buttons: DigitalInOut) -> None:
|
||||
//| """Initializes matrix scanning routines.
|
||||
//|
|
||||
//| The ``buffer`` is a 64 byte long ``bytearray`` that stores what should
|
||||
|
@ -47,7 +47,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t
|
||||
//| class PixelBuf:
|
||||
//| """A fast RGB[W] pixel buffer for LED and similar devices."""
|
||||
//|
|
||||
//| def __init__(self, size: int, *, byteorder: str = "BGR", brightness: float = 0, auto_write: bool = False, header: bytes = b"", trailer: bytes = b""):
|
||||
//| def __init__(self, size: int, *, byteorder: str = "BGR", brightness: float = 0, auto_write: bool = False, header: bytes = b"", trailer: bytes = b"") -> None:
|
||||
//| """Create a PixelBuf object of the specified size, byteorder, and bits per pixel.
|
||||
//|
|
||||
//| When brightness is less than 1.0, a second buffer will be used to store the color values
|
||||
@ -152,7 +152,7 @@ static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t
|
||||
}
|
||||
}
|
||||
|
||||
//| bpp: Any = ...
|
||||
//| bpp: int = ...
|
||||
//| """The number of bytes per pixel in the buffer (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_bpp(mp_obj_t self_in) {
|
||||
@ -168,7 +168,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_bpp_obj = {
|
||||
};
|
||||
|
||||
|
||||
//| brightness: Any = ...
|
||||
//| brightness: float = ...
|
||||
//| """Float value between 0 and 1. Output brightness.
|
||||
//|
|
||||
//| When brightness is less than 1.0, a second buffer will be used to store the color values
|
||||
@ -199,7 +199,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_brightness_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| auto_write: Any = ...
|
||||
//| auto_write: bool = ...
|
||||
//| """Whether to automatically write the pixels after each update."""
|
||||
//|
|
||||
STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_auto_write(mp_obj_t self_in) {
|
||||
@ -221,7 +221,7 @@ const mp_obj_property_t pixelbuf_pixelbuf_auto_write_obj = {
|
||||
(mp_obj_t)&mp_const_none_obj},
|
||||
};
|
||||
|
||||
//| byteorder: Any = ...
|
||||
//| byteorder: string = ...
|
||||
//| """byteorder string for the buffer (read-only)"""
|
||||
//|
|
||||
STATIC mp_obj_t pixelbuf_pixelbuf_obj_get_byteorder(mp_obj_t self_in) {
|
||||
@ -245,7 +245,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_unary_op(mp_unary_op_t op, mp_obj_t self_in) {
|
||||
}
|
||||
}
|
||||
|
||||
//| def show(self, ) -> Any:
|
||||
//| def show(self) -> None:
|
||||
//| """Transmits the color data to the pixels so that they are shown. This is done automatically
|
||||
//| when `auto_write` is True."""
|
||||
//| ...
|
||||
@ -257,9 +257,9 @@ STATIC mp_obj_t pixelbuf_pixelbuf_show(mp_obj_t self_in) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(pixelbuf_pixelbuf_show_obj, pixelbuf_pixelbuf_show);
|
||||
|
||||
//| def fill(color: Any) -> Any:
|
||||
//| """Fills the given pixelbuf with the given color."""
|
||||
//| ...
|
||||
//| def fill(color: Union[int, Tuple[int, int, int]]) -> None:
|
||||
//| """Fills the given pixelbuf with the given color."""
|
||||
//| ...
|
||||
//|
|
||||
|
||||
STATIC mp_obj_t pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t value) {
|
||||
@ -269,13 +269,13 @@ STATIC mp_obj_t pixelbuf_pixelbuf_fill(mp_obj_t self_in, mp_obj_t value) {
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_2(pixelbuf_pixelbuf_fill_obj, pixelbuf_pixelbuf_fill);
|
||||
|
||||
//| def __getitem__(self, index: Any) -> Any:
|
||||
//| def __getitem__(self, index: int) -> Tuple[int, int, int, Union[int, float]]:
|
||||
//| """Returns the pixel value at the given index as a tuple of (Red, Green, Blue[, White]) values
|
||||
//| between 0 and 255. When in PWM (DotStar) mode, the 4th tuple value is a float of the pixel
|
||||
//| intensity from 0-1.0."""
|
||||
//| ...
|
||||
//|
|
||||
//| def __setitem__(self, index: Any, value: Any) -> Any:
|
||||
//| def __setitem__(self, index: int, value: Union[int, Tuple[int, int, int, Union[int, float]]]) -> PixelBuf:
|
||||
//| """Sets the pixel value at the given index. Value can either be a tuple or integer. Tuples are
|
||||
//| The individual (Red, Green, Blue[, White]) values between 0 and 255. If given an integer, the
|
||||
//| red, green and blue values are packed into the lower three bytes (0xRRGGBB).
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
#include "shared-module/_pixelbuf/PixelBuf.h"
|
||||
|
||||
const mp_obj_type_t pixelbuf_pixelbuf_type;
|
||||
extern const mp_obj_type_t pixelbuf_pixelbuf_type;
|
||||
|
||||
void common_hal__pixelbuf_pixelbuf_construct(pixelbuf_pixelbuf_obj_t *self, size_t n,
|
||||
pixelbuf_byteorder_details_t* byteorder, mp_float_t brightness, bool auto_write, uint8_t* header,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user