Merge branch 'adafruit:main' into motor

This commit is contained in:
ZodiusInfuser 2022-04-26 10:23:14 +01:00 committed by GitHub
commit 1ccf767112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
100 changed files with 1761 additions and 304 deletions

View File

@ -83,7 +83,7 @@ extensions = [
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['templates']
templates_path = ['templates', "docs/templates"]
# The suffix of source filenames.
source_suffix = {

@ -1 +1 @@
Subproject commit baab505fd4dcc54d8e9d45e6463c68bdc6d100eb
Subproject commit 9bd48820928afad549832fe9b4ae497b224007f0

@ -1 +1 @@
Subproject commit beec03065712cd62f79e839d5cf8f7c9847fc3b1
Subproject commit de7cacfbb4bddf74f5188f23b56f075c884f98c4

@ -1 +1 @@
Subproject commit 859a7d403e4e79ec1c8915c81ba581dbaab8a4ac
Subproject commit 258bb62c58e545c38749b8a66f5872035b2384cb

@ -1 +1 @@
Subproject commit a8abc3aa8dece6c4d0152b001dfca7d2c279f899
Subproject commit b96f0d279481446017ca1cc1ff4abf1f5a10346f

@ -1 +1 @@
Subproject commit b04042addd47c2645e139032b02a3b9ddeeb3425
Subproject commit f82d3ef195256aa71d274a34ea25f760d7e651d1

@ -1 +1 @@
Subproject commit 708bb0c82c7b075bd6912c97231aea880b1a1cb8
Subproject commit 2fad6f2f98c0df135e2306d32af18bb2796b852c

@ -1 +1 @@
Subproject commit 0bd04a235556979bd13a373821a6602445fe132b
Subproject commit de3276cc08ba13901d1f69060ff7501c1699bc4d

@ -1 +1 @@
Subproject commit eb6124fdff59b98d7d49dd86072df99c0e97167b
Subproject commit a90579e1e1e1c973e6ba8f6cf8e914d77fc8f0f2

@ -1 +1 @@
Subproject commit 13775b058422085762874fde8e587f2e9f066855
Subproject commit ddd26eb4abcd3c10ae5dd33b1345d10d58707995

@ -1 +1 @@
Subproject commit bccbe3da75f42b540b3faebb9d5a2d1ccf5e7147
Subproject commit a77f0f9c2e8f64568bbb68254d0134fbc7b5a8af

@ -1 +1 @@
Subproject commit 9771c9369c7e251f514eb26abcfcea1e891e6f27
Subproject commit 1e478b1530b3be81bd84f13620d0a23502d377f1

@ -1 +1 @@
Subproject commit 29816fbe98c012ea0a1b5cae7f07aeae7ebf8b52
Subproject commit a9cf0cde77c185c6bbc79a3b6d77dd024a9683d2

@ -1 +1 @@
Subproject commit 75e9ec62e4fe47a7212a69fb84aa1cfa7848e2b3
Subproject commit 2dfd61a0d5ffc8048e72d24e5ecdac9a74bb2bc3

@ -1 +1 @@
Subproject commit 6641509ef43b672a82addf41f02b6466d6c67f01
Subproject commit 3d871907f0187c627277382f184209f5520703a6

@ -1 +1 @@
Subproject commit a115fc30df1c230c09c8a533ca77f3a4afd9f6c3
Subproject commit 36d4a31010461e47f265553ebd764c69d38a254c

@ -1 +1 @@
Subproject commit 77ba8eedf89b96c85a6194e5da2061c9d5c20242
Subproject commit 2bc1b86ef2e709f31aea65469964b777f1da6d5b

@ -1 +1 @@
Subproject commit 270565665ada26fe8d7a99a3cb5941b452444471
Subproject commit 2e6b3f9feeacc678402454f7d3416b04a9a93e17

@ -1 +1 @@
Subproject commit 9dd51fecfcbb15cb2a00eeadbd66b36ce0c09ee2
Subproject commit 22cb706e5f718988d5442246120defd21c5937c9

@ -1 +1 @@
Subproject commit 79c70a49285be8b6548de3f5ca20aa5ac1fafa22
Subproject commit 5fdd62ab69fda70407644acc6f9b45681da9ef68

@ -1 +1 @@
Subproject commit c89c8689161e5b35bfe4fa8355615696e03f0648
Subproject commit 3aaf72165bc6ba10bf5219716c8654651649f87b

View File

@ -1124,6 +1124,11 @@ msgstr ""
msgid "Framebuffer requires %d bytes"
msgstr ""
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr "Frekuensi harus cocok dengan PWMOut yang ada menggunakan timer ini"
@ -3054,7 +3059,7 @@ msgstr ""
msgid "complex values not supported"
msgstr ""
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "kompresi header"
@ -3308,6 +3313,10 @@ msgstr ""
msgid "format requires a dict"
msgstr ""
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr ""

View File

@ -1107,6 +1107,11 @@ msgstr ""
msgid "Framebuffer requires %d bytes"
msgstr ""
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -1599,6 +1604,10 @@ msgstr ""
msgid "Name too long"
msgstr ""
#: shared-bindings/displayio/TileGrid.c
msgid "New bitmap must be same size as old bitmap"
msgstr ""
#: ports/espressif/common-hal/_bleio/__init__.c
msgid "Nimble out of memory"
msgstr ""
@ -3019,7 +3028,7 @@ msgstr ""
msgid "complex values not supported"
msgstr ""
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr ""
@ -3273,6 +3282,10 @@ msgstr ""
msgid "format requires a dict"
msgstr ""
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr ""

View File

@ -1114,6 +1114,11 @@ msgstr ""
msgid "Framebuffer requires %d bytes"
msgstr ""
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3028,7 +3033,7 @@ msgstr ""
msgid "complex values not supported"
msgstr ""
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr ""
@ -3282,6 +3287,10 @@ msgstr ""
msgid "format requires a dict"
msgstr ""
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr ""

View File

@ -1125,6 +1125,11 @@ msgstr "Format nicht unterstützt"
msgid "Framebuffer requires %d bytes"
msgstr "Framepuffer benötigt %d bytes"
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3097,7 +3102,7 @@ msgstr "Komplexe Division durch null"
msgid "complex values not supported"
msgstr "Komplexe Zahlen nicht unterstützt"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "kompression header"
@ -3353,6 +3358,10 @@ msgstr "Die Schriftart (font) muss 2048 Byte lang sein"
msgid "format requires a dict"
msgstr "Format erfordert ein Wörterbuch (dict)"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "voll"

View File

@ -1107,6 +1107,11 @@ msgstr ""
msgid "Framebuffer requires %d bytes"
msgstr ""
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3019,7 +3024,7 @@ msgstr ""
msgid "complex values not supported"
msgstr ""
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr ""
@ -3273,6 +3278,10 @@ msgstr ""
msgid "format requires a dict"
msgstr ""
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr ""

View File

@ -1118,6 +1118,11 @@ msgstr "Format not supported"
msgid "Framebuffer requires %d bytes"
msgstr "Framebuffer requires %d bytes"
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr "Frequency must match existing PWMOut using this timer"
@ -3053,7 +3058,7 @@ msgstr "complex division by zero"
msgid "complex values not supported"
msgstr "complex values not supported"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "compression header"
@ -3308,6 +3313,10 @@ msgstr "font must be 2048 bytes long"
msgid "format requires a dict"
msgstr "format requires a dict"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "full"

View File

@ -1128,6 +1128,11 @@ msgstr "Sin capacidades para el formato"
msgid "Framebuffer requires %d bytes"
msgstr "Framebuffer requiere %d bytes"
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3091,7 +3096,7 @@ msgstr "división compleja por cero"
msgid "complex values not supported"
msgstr "valores complejos no soportados"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "encabezado de compresión"
@ -3347,6 +3352,10 @@ msgstr "font debe ser 2048 bytes de largo"
msgid "format requires a dict"
msgstr "format requiere un dict"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "lleno"

View File

@ -1120,6 +1120,11 @@ msgstr ""
msgid "Framebuffer requires %d bytes"
msgstr ""
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3048,7 +3053,7 @@ msgstr "kumplikadong dibisyon sa pamamagitan ng zero"
msgid "complex values not supported"
msgstr "kumplikadong values hindi sinusuportahan"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "compression header"
@ -3307,6 +3312,10 @@ msgstr "font ay dapat 2048 bytes ang haba"
msgid "format requires a dict"
msgstr "kailangan ng format ng dict"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "puno"

View File

@ -1138,6 +1138,11 @@ msgstr "Format non supporté"
msgid "Framebuffer requires %d bytes"
msgstr "FrameBuffer nécessite %d octets"
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3117,7 +3122,7 @@ msgstr "division complexe par zéro"
msgid "complex values not supported"
msgstr "valeurs complexes non supportées"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "entête de compression"
@ -3374,6 +3379,10 @@ msgstr "la police doit être longue de 2048 octets"
msgid "format requires a dict"
msgstr "le format nécessite un dict"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "plein"

View File

@ -1107,6 +1107,11 @@ msgstr ""
msgid "Framebuffer requires %d bytes"
msgstr ""
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3019,7 +3024,7 @@ msgstr ""
msgid "complex values not supported"
msgstr ""
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr ""
@ -3273,6 +3278,10 @@ msgstr ""
msgid "format requires a dict"
msgstr ""
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr ""

View File

@ -1125,6 +1125,11 @@ msgstr ""
msgid "Framebuffer requires %d bytes"
msgstr ""
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3064,7 +3069,7 @@ msgstr "complex divisione per zero"
msgid "complex values not supported"
msgstr "valori complessi non supportai"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "compressione dell'header"
@ -3322,6 +3327,10 @@ msgstr "il font deve essere lungo 2048 byte"
msgid "format requires a dict"
msgstr "la formattazione richiede un dict"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "pieno"

View File

@ -1116,6 +1116,11 @@ msgstr "非対応の形式"
msgid "Framebuffer requires %d bytes"
msgstr ""
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr "このタイマーを使う既存のPWMOutと周波数を一致させる必要があります"
@ -3036,7 +3041,7 @@ msgstr "複素数ゼロ除算"
msgid "complex values not supported"
msgstr ""
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "圧縮ヘッダー"
@ -3292,6 +3297,10 @@ msgstr "fontは2048バイト長でなければなりません"
msgid "format requires a dict"
msgstr "formatにはdictが必要"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr ""

View File

@ -1110,6 +1110,11 @@ msgstr ""
msgid "Framebuffer requires %d bytes"
msgstr ""
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3023,7 +3028,7 @@ msgstr ""
msgid "complex values not supported"
msgstr ""
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr ""
@ -3277,6 +3282,10 @@ msgstr ""
msgid "format requires a dict"
msgstr ""
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "완전한(full)"

View File

@ -1116,6 +1116,11 @@ msgstr "Formaat wordt niet ondersteund"
msgid "Framebuffer requires %d bytes"
msgstr "Framebuffer benodigd %d bytes"
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3053,7 +3058,7 @@ msgstr "complexe deling door 0"
msgid "complex values not supported"
msgstr "complexe waardes niet ondersteund"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "compressie header"
@ -3309,6 +3314,10 @@ msgstr "lettertype moet 2048 bytes lang zijn"
msgid "format requires a dict"
msgstr "format vereist een dict"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "vol"

View File

@ -1116,6 +1116,11 @@ msgstr "Nie wspierany format"
msgid "Framebuffer requires %d bytes"
msgstr "Bufor ramki wymaga %d bajtów"
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3030,7 +3035,7 @@ msgstr "zespolone dzielenie przez zero"
msgid "complex values not supported"
msgstr "wartości zespolone nieobsługiwane"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "nagłówek kompresji"
@ -3285,6 +3290,10 @@ msgstr "font musi mieć 2048 bajtów długości"
msgid "format requires a dict"
msgstr "format wymaga słownika"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "pełny"

View File

@ -1135,6 +1135,11 @@ msgstr "O formato não é suportado"
msgid "Framebuffer requires %d bytes"
msgstr "O Framebuffer requer %d bytes"
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3109,7 +3114,7 @@ msgstr "divisão complexa por zero"
msgid "complex values not supported"
msgstr "os valores complexos não compatíveis"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "compressão do cabeçalho"
@ -3366,6 +3371,10 @@ msgstr "a fonte deve ter 2048 bytes de comprimento"
msgid "format requires a dict"
msgstr "formato requer um dict"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "cheio"

View File

@ -1134,6 +1134,11 @@ msgstr "Формат не поддерживается"
msgid "Framebuffer requires %d bytes"
msgstr "Фреймбуфер требует %d байт"
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3068,7 +3073,7 @@ msgstr ""
msgid "complex values not supported"
msgstr ""
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr ""
@ -3322,6 +3327,10 @@ msgstr ""
msgid "format requires a dict"
msgstr ""
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr ""

View File

@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-04 12:55-0600\n"
"PO-Revision-Date: 2022-03-23 08:58+0000\n"
"PO-Revision-Date: 2022-04-21 13:12+0000\n"
"Last-Translator: Jonny Bergdahl <jonny@bergdahl.it>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: sv\n"
@ -1122,18 +1122,25 @@ msgstr "Formatet stöds inte"
msgid "Framebuffer requires %d bytes"
msgstr "Framebuffer kräver %d byte"
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
"Frekvens måste vara en av 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 "
"eller 1008 Mhz"
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr "Frekvensen måste matcha befintlig PWMOut med denna timer"
msgstr "Frekvensen måste matcha befintlig PWMOut med den här timern"
#: shared-bindings/bitbangio/I2C.c shared-bindings/bitbangio/SPI.c
#: shared-bindings/busio/I2C.c shared-bindings/busio/SPI.c
msgid "Function requires lock"
msgstr "Funktion kräver lås"
msgstr "Funktionen kräver lås"
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
msgid "Generic Failure"
msgstr "Generiskt fel"
msgstr "Allmänt fel"
#: shared-bindings/displayio/Display.c
#: shared-bindings/displayio/EPaperDisplay.c
@ -3073,7 +3080,7 @@ msgstr "komplex division med noll"
msgid "complex values not supported"
msgstr "komplexa värden stöds inte"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "komprimeringsheader"
@ -3330,6 +3337,10 @@ msgstr "typsnitt måste vara 2048 bytes långt"
msgid "format requires a dict"
msgstr "formatet kräver en dict"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr "frekvens är skrivskyddad för detta kort"
#: py/objdeque.c
msgid "full"
msgstr "full"

View File

@ -7,15 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-01-16 13:56+0000\n"
"Last-Translator: Gökhan Koçmarlı <gokhankocmarli@gmail.com>\n"
"PO-Revision-Date: 2022-04-19 17:07+0000\n"
"Last-Translator: Siyabend Ürün <urunsiyabend@gmail.com>\n"
"Language-Team: none\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.10.1\n"
"X-Generator: Weblate 4.12-dev\n"
#: main.c
msgid ""
@ -30,6 +30,9 @@ msgid ""
"\n"
"Code stopped by auto-reload. Reloading soon.\n"
msgstr ""
"\n"
"Program otomatik yeniden yükleme tarafından durduruldu. Birazdan tekrar "
"yüklenecek.\n"
#: supervisor/shared/safe_mode.c
msgid ""
@ -513,7 +516,7 @@ msgstr "Dizi değerleri tekil bytelar olmalıdır."
#: shared-bindings/microcontroller/Pin.c
msgid "At most %d %q may be specified (not %d)"
msgstr ""
msgstr "En az %d %q belirtilmeli (%d değil)"
#: shared-module/memorymonitor/AllocationAlarm.c
#, c-format
@ -568,23 +571,24 @@ msgstr ""
#: shared-bindings/rgbmatrix/RGBMatrix.c
#, c-format
msgid "Bit depth must be from 1 to 6 inclusive, not %d"
msgstr ""
msgstr "Bit derinliği 1-6 aralığında olmalı, %d değil"
#: shared-bindings/audiobusio/PDMIn.c
msgid "Bit depth must be multiple of 8."
msgstr ""
msgstr "Bit derinliği 8'in katı olacak şekilde olmalı."
#: shared-bindings/bitmaptools/__init__.c
#, fuzzy
msgid "Bitmap size and bits per value must match"
msgstr ""
msgstr "Bitmap boyutu ve bit başına değer uyuşmalı"
#: supervisor/shared/safe_mode.c
msgid "Boot device must be first device (interface #0)."
msgstr ""
msgstr "Önyükleme cihazı ilk cihaz olmalı (arayüz #0)."
#: ports/mimxrt10xx/common-hal/busio/UART.c
msgid "Both RX and TX required for flow control"
msgstr ""
msgstr "Hem RX hem de TX akış kontrolü için gerekli"
#: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c
msgid "Both pins must support hardware interrupts"
@ -595,12 +599,12 @@ msgstr ""
#: shared-bindings/is31fl3741/FrameBuffer.c
#: shared-bindings/rgbmatrix/RGBMatrix.c
msgid "Brightness must be 0-1.0"
msgstr ""
msgstr "Parlaklık 0-1.0 aralığında olmalı"
#: shared-bindings/displayio/Display.c
#: shared-bindings/framebufferio/FramebufferDisplay.c
msgid "Brightness not adjustable"
msgstr ""
msgstr "Parlaklık ayarlanabilir değil"
#: shared-bindings/_bleio/UUID.c
#, c-format
@ -614,27 +618,27 @@ msgstr ""
#: shared-module/usb_hid/Device.c
#, c-format
msgid "Buffer incorrect size. Should be %d bytes."
msgstr ""
msgstr "Geçersiz arabellek boyutu. %d kadar olmalı"
#: shared-bindings/framebufferio/FramebufferDisplay.c
msgid "Buffer is not a bytearray."
msgstr ""
msgstr "Arabellek bayt dizisi değil"
#: ports/cxd56/common-hal/camera/Camera.c shared-bindings/displayio/Display.c
#: shared-bindings/framebufferio/FramebufferDisplay.c
msgid "Buffer is too small"
msgstr ""
msgstr "Arabellek çok küçük"
#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
#: ports/stm/common-hal/audiopwmio/PWMAudioOut.c
#, c-format
msgid "Buffer length %d too big. It must be less than %d"
msgstr ""
msgstr "Mevcut arabellek boyutu %d çok büyük. En fazla %d kadar olmalı"
#: ports/atmel-samd/common-hal/sdioio/SDCard.c
#: ports/cxd56/common-hal/sdioio/SDCard.c shared-module/sdcardio/SDCard.c
msgid "Buffer length must be a multiple of 512"
msgstr ""
msgstr "Arabellek boyutu 512'nin katı olmalı"
#: ports/stm/common-hal/sdioio/SDCard.c
msgid "Buffer must be a multiple of 512 bytes"
@ -642,7 +646,7 @@ msgstr ""
#: shared-bindings/bitbangio/I2C.c
msgid "Buffer must be at least length 1"
msgstr ""
msgstr "Arabellek boyutu en az 1 olmalı"
#: shared-bindings/_bleio/PacketBuffer.c
#, c-format
@ -651,7 +655,7 @@ msgstr ""
#: ports/espressif/common-hal/imagecapture/ParallelImageCapture.c
msgid "Buffers must be same size"
msgstr ""
msgstr "Arabellek boyutları aynı olmalı"
#: ports/atmel-samd/common-hal/paralleldisplay/ParallelBus.c
#: ports/espressif/common-hal/paralleldisplay/ParallelBus.c
@ -659,7 +663,7 @@ msgstr ""
#: ports/raspberrypi/common-hal/paralleldisplay/ParallelBus.c
#, c-format
msgid "Bus pin %d is already in use"
msgstr ""
msgstr "Veriyolu pini %d kullanımda"
#: shared-bindings/_bleio/UUID.c
msgid "Byte buffer must be 16 bytes."
@ -667,15 +671,15 @@ msgstr ""
#: shared-bindings/alarm/SleepMemory.c shared-bindings/nvm/ByteArray.c
msgid "Bytes must be between 0 and 255."
msgstr ""
msgstr "Baytlar 0-255 aralığında olmalı"
#: shared-bindings/aesio/aes.c
msgid "CBC blocks must be multiples of 16 bytes"
msgstr ""
msgstr "CBC blokları 16 baytın katları şeklinde olmalı"
#: supervisor/shared/safe_mode.c
msgid "CIRCUITPY drive could not be found or created."
msgstr ""
msgstr "CIRCUITPY sürücüsü bulunamadı veya oluşturulamadı"
#: ports/espressif/bindings/espidf/__init__.c ports/espressif/esp_error.c
msgid "CRC or checksum was invalid"
@ -705,17 +709,17 @@ msgstr ""
#: shared-bindings/storage/__init__.c shared-bindings/usb_cdc/__init__.c
#: shared-bindings/usb_hid/__init__.c shared-bindings/usb_midi/__init__.c
msgid "Cannot change USB devices now"
msgstr ""
msgstr "USB aygıtları şu an değiştirilemez"
#: shared-bindings/_bleio/Adapter.c
msgid "Cannot create a new Adapter; use _bleio.adapter;"
msgstr ""
msgstr "Yeni Adapter oluşturulamaz, _bleio.adapter; kullanın"
#: shared-bindings/displayio/Bitmap.c
#: shared-bindings/memorymonitor/AllocationSize.c
#: shared-bindings/pulseio/PulseIn.c
msgid "Cannot delete values"
msgstr ""
msgstr "Değerler silinemez"
#: ports/atmel-samd/common-hal/digitalio/DigitalInOut.c
#: ports/mimxrt10xx/common-hal/digitalio/DigitalInOut.c
@ -1120,6 +1124,11 @@ msgstr ""
msgid "Framebuffer requires %d bytes"
msgstr ""
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -3035,7 +3044,7 @@ msgstr ""
msgid "complex values not supported"
msgstr ""
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr ""
@ -3289,6 +3298,10 @@ msgstr ""
msgid "format requires a dict"
msgstr ""
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr ""

View File

@ -1131,6 +1131,11 @@ msgstr "Bù zhīyuán géshì"
msgid "Framebuffer requires %d bytes"
msgstr "zhēn huǎn chōng qū xū yào %d zì jié"
#: ports/mimxrt10xx/common-hal/microcontroller/Processor.c
msgid ""
"Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"
msgstr ""
#: shared-bindings/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr "Pínlǜ bìxū yǔ shǐyòng cǐ jìshí qì de xiàn yǒu PWMOut xiāng pǐpèi"
@ -3085,7 +3090,7 @@ msgstr "fùzá de fēngé wèi 0"
msgid "complex values not supported"
msgstr "bù zhīchí fùzá de zhí"
#: extmod/moduzlib.c shared-module/zlib/DecompIO.c
#: extmod/moduzlib.c
msgid "compression header"
msgstr "yāsuō tóu bù"
@ -3341,6 +3346,10 @@ msgstr "zìtǐ bìxū wèi 2048 zì jié"
msgid "format requires a dict"
msgstr "géshì yāoqiú yīgè yǔjù"
#: shared-bindings/microcontroller/Processor.c
msgid "frequency is read-only for this board"
msgstr ""
#: py/objdeque.c
msgid "full"
msgstr "chōngfèn"

7
main.c
View File

@ -62,6 +62,7 @@
#include "supervisor/shared/workflow.h"
#include "supervisor/usb.h"
#include "supervisor/workflow.h"
#include "supervisor/shared/external_flash/external_flash.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Processor.h"
@ -836,6 +837,12 @@ int __attribute__((used)) main(void) {
// Start the debug serial
serial_early_init();
#if !INTERNAL_FLASH_FILESYSTEM
// Set up anything that might need to get done before we try to use SPI flash
// This is needed for some boards where flash relies on GPIO setup to work
external_flash_setup();
#endif
// Create a new filesystem only if we're not in a safe mode.
// A power brownout here could make it appear as if there's
// no SPI flash filesystem, and we might erase the existing one.

View File

@ -6,12 +6,7 @@ include ../py/mkenv.mk
# define main target
ifeq ($(OS),Windows_NT)
# Detect a MINGW32 build, and change the name of the final executable.
PROG ?= mpy-cross.exe
else
PROG ?= mpy-cross
endif
# qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h

View File

@ -9,3 +9,5 @@ CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "MX25L51245G","GD25S512MD"
LONGINT_IMPL = MPZ
CIRCUITPY_ONEWIREIO = 0

View File

@ -9,3 +9,5 @@ CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
LONGINT_IMPL = MPZ
CIRCUITPY_ONEWIREIO = 0

View File

@ -9,3 +9,5 @@ CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "W25Q32FV"
LONGINT_IMPL = MPZ
CIRCUITPY_ONEWIREIO = 0

View File

@ -26,6 +26,9 @@
#include "supervisor/board.h"
#include "mpconfigboard.h"
#include "common-hal/microcontroller/Pin.h"
#include "hal/include/hal_gpio.h"
#include "supervisor/shared/external_flash/external_flash.h"
void board_init(void) {
}
@ -39,3 +42,20 @@ void reset_board(void) {
void board_deinit(void) {
}
void external_flash_setup(void) {
// Do not reset the external flash write-protect and hold pins high
never_reset_pin_number(PIN_PB22);
never_reset_pin_number(PIN_PB23);
// note: using output instead of input+pullups because the pullups are a little weak
// Set the WP pin high
gpio_set_pin_function(PIN_PB22, GPIO_PIN_FUNCTION_OFF);
gpio_set_pin_direction(PIN_PB22, GPIO_DIRECTION_OUT);
gpio_set_pin_level(PIN_PB22, true);
// Set the HOLD pin high
gpio_set_pin_function(PIN_PB23, GPIO_PIN_FUNCTION_OFF);
gpio_set_pin_direction(PIN_PB23, GPIO_DIRECTION_OUT);
gpio_set_pin_level(PIN_PB23, true);
}

View File

@ -27,3 +27,7 @@
// USB is always used internally so skip the pin objects for it.
#define IGNORE_PIN_PA24 1
#define IGNORE_PIN_PA25 1
// The external flash chip has WP (write-protect) and hold pins we should ignore
#define IGNORE_PIN_PB22
#define IGNORE_PIN_PB23

View File

@ -9,3 +9,5 @@ CHIP_FAMILY = samd21
SPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "W25Q64JVxQ"
LONGINT_IMPL = MPZ
CIRCUITPY_ONEWIREIO = 0

View File

@ -71,6 +71,12 @@ uint8_t display_init_sequence[] = {
void board_init(void) {
// THIS SHOULD BE HANDLED BY espressif_board_reset_pin_number(), but it is not working.
// TEMPORARY FIX UNTIL IT'S DIAGNOSED.
common_hal_never_reset_pin(&pin_GPIO21);
gpio_set_direction(21, GPIO_MODE_DEF_OUTPUT);
gpio_set_level(21, true);
busio_spi_obj_t *spi = common_hal_board_create_spi(0);
displayio_fourwire_obj_t *bus = &displays[0].fourwire_bus;
bus->base.type = &displayio_fourwire_type;

View File

@ -20,5 +20,4 @@ CIRCUITPY_MODULE=wroom
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register

View File

@ -19,5 +19,4 @@ CIRCUITPY_ESP_FLASH_SIZE=8MB
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Requests
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register

View File

@ -0,0 +1,64 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2019 Scott Shawcroft for Adafruit Industries
* Copyright (c) 2019 Artur Pacholec
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "supervisor/board.h"
#include "boards/flash_config.h"
#include "mpconfigboard.h"
#include "shared-bindings/microcontroller/Pin.h"
void board_init(void) {
// FLEX flash
common_hal_never_reset_pin(&pin_GPIO_SD_B1_06);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_07);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_08);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_09);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_10);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_11);
// FLEX flash 2
common_hal_never_reset_pin(&pin_GPIO_AD_B0_04);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_08);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_09);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);
common_hal_never_reset_pin(&pin_GPIO_EMC_01);
common_hal_never_reset_pin(&pin_GPIO_B0_13);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_11);
// Data strobe needs protection despite being grounded
common_hal_never_reset_pin(&pin_GPIO_SD_B1_05);
}
bool board_requests_safe_mode(void) {
return false;
}
void reset_board(void) {
}
void board_deinit(void) {
}

View File

@ -0,0 +1 @@
_ld_reserved_flash_size = 4K;

View File

@ -0,0 +1,170 @@
/*
* Copyright 2017 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include "boards/flash_config.h"
#include "fsl_flexspi_nor_boot.h"
__attribute__((section(".boot_hdr.ivt")))
/*************************************
* IVT Data
*************************************/
const ivt image_vector_table = {
IVT_HEADER, /* IVT Header */
IMAGE_ENTRY_ADDRESS, /* Image Entry Function */
IVT_RSVD, /* Reserved = 0 */
(uint32_t)DCD_ADDRESS, /* Address where DCD information is stored */
(uint32_t)BOOT_DATA_ADDRESS, /* Address where BOOT Data Structure is stored */
(uint32_t)&image_vector_table, /* Pointer to IVT Self (absolute address */
(uint32_t)CSF_ADDRESS, /* Address where CSF file is stored */
IVT_RSVD /* Reserved = 0 */
};
__attribute__((section(".boot_hdr.boot_data")))
/*************************************
* Boot Data
*************************************/
const BOOT_DATA_T boot_data = {
FLASH_BASE, /* boot start location */
FLASH_SIZE, /* size */
PLUGIN_FLAG, /* Plugin flag*/
0xFFFFFFFF /* empty - extra data word */
};
// Config for W25Q64JV with QSPI routed.
__attribute__((section(".boot_hdr.conf")))
const flexspi_nor_config_t qspiflash_config = {
.pageSize = 256u,
.sectorSize = 4u * 1024u,
.ipcmdSerialClkFreq = kFlexSpiSerialClk_30MHz,
.blockSize = 0x00010000,
.isUniformBlockSize = false,
.memConfig =
{
.tag = FLEXSPI_CFG_BLK_TAG,
.version = FLEXSPI_CFG_BLK_VERSION,
.readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
.csHoldTime = 3u,
.csSetupTime = 3u,
.busyOffset = 0u, // Status bit 0 indicates busy.
.busyBitPolarity = 0u, // Busy when the bit is 1.
.deviceModeCfgEnable = 1u,
.deviceModeType = kDeviceConfigCmdType_QuadEnable,
.deviceModeSeq = {
.seqId = 4u,
.seqNum = 1u,
},
.deviceModeArg = 0x02,
.deviceType = kFlexSpiDeviceType_SerialNOR,
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_60MHz,
.sflashA1Size = FLASH_SIZE,
.lookupTable =
{
// FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1)
// The high 16 bits is command 1 and the low are command 0.
// Within a command, the top 6 bits are the opcode, the next two are the number
// of pads and then last byte is the operand. The operand's meaning changes
// per opcode.
// Indices with ROM should always have the same function because the ROM
// bootloader uses it.
// 0: ROM: Read LUTs
// Quad version
SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB /* the command to send */,
RADDR_SDR, FLEXSPI_4PAD, 24 /* bits to transmit */),
FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 6 /* 6 dummy cycles, 2 for M7-0 and 4 dummy */,
READ_SDR, FLEXSPI_4PAD, 0x04),
// Single fast read version, good for debugging.
// FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x0B /* the command to send */,
// RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */),
// FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_1PAD, 8 /* 8 dummy clocks */,
// READ_SDR, FLEXSPI_1PAD, 0x04),
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS),
// 1: ROM: Read status
SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x05 /* the command to send */,
READ_SDR, FLEXSPI_1PAD, 0x01),
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS),
// 2: Empty
EMPTY_SEQUENCE,
// 3: ROM: Write Enable
SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x06 /* the command to send */,
STOP, FLEXSPI_1PAD, 0x00),
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS),
// 4: Config: Write Status
SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x31 /* the command to send */,
WRITE_SDR, FLEXSPI_1PAD, 0x01),
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS),
// 5: ROM: Erase Sector
SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x20 /* the command to send */,
RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */),
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS),
// 6: Empty
EMPTY_SEQUENCE,
// 7: Empty
EMPTY_SEQUENCE,
// 8: Block Erase
SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xD8 /* the command to send */,
RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */),
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS),
// 9: ROM: Page program
SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x02 /* the command to send */,
RADDR_SDR, FLEXSPI_1PAD, 24 /* bits to transmit */),
FLEXSPI_LUT_SEQ(WRITE_SDR, FLEXSPI_1PAD, 0x04 /* data out */,
STOP, FLEXSPI_1PAD, 0),
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS),
// 10: Empty
EMPTY_SEQUENCE,
// 11: ROM: Chip erase
SEQUENCE(FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0x60 /* the command to send */,
STOP, FLEXSPI_1PAD, 0),
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS,
TWO_EMPTY_STEPS),
// 12: Empty
EMPTY_SEQUENCE,
// 13: ROM: Read SFDP
EMPTY_SEQUENCE,
// 14: ROM: Restore no cmd
EMPTY_SEQUENCE,
// 15: ROM: Dummy
EMPTY_SEQUENCE
},
},
};

View File

@ -0,0 +1,21 @@
#define MICROPY_HW_BOARD_NAME "SparkFun Teensy MicroMod Processor"
#define MICROPY_HW_MCU_NAME "IMXRT1062DVL6A"
// If you change this, then make sure to update the linker scripts as well to
// make sure you don't overwrite code
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
#define BOARD_FLASH_SIZE (16 * 1024 * 1024)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO_AD_B1_00)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO_AD_B1_01)
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO_B0_03)
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO_B0_02)
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO_B0_01)
#define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B0_03)
#define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B0_02)
#define CIRCUITPY_USB_DEVICE_INSTANCE 0
#define CIRCUITPY_USB_HOST_INSTANCE 1

View File

@ -0,0 +1,11 @@
USB_VID = 0x1B4F
USB_PID = 0x002E
USB_PRODUCT = "Teensy MicroMod"
USB_MANUFACTURER = "PJRC/Sparkfun"
CHIP_VARIANT = MIMXRT1062DVJ6A
CHIP_FAMILY = MIMXRT1062
FLASH = W25Q128JV
CIRCUITPY__EVE = 1
CIRCUITPY_USB_HOST = 1
CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY = 1

View File

@ -0,0 +1,208 @@
#include "shared-bindings/board/__init__.h"
#include "supervisor/board.h"
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
// Micromod pins mapped to logical Teensy pins
// Plus pins mapping some of the names on micromod breakout boards
{MP_OBJ_NEW_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO_AD_B0_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_GPIO_AD_B0_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX1), MP_ROM_PTR(&pin_GPIO_AD_B0_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO_EMC_04)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO_EMC_05)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO_EMC_06)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO_EMC_08)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO_B0_10)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO_B1_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_B1_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO_B1_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_B1_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO_B0_11)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO_B0_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_B0_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO_B0_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_B0_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO_B0_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_B0_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_B0_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO_AD_B1_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_GPIO_AD_B1_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO_AD_B1_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_GPIO_AD_B1_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO_AD_B1_07)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO_AD_B1_06)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO_AD_B1_06)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO_AD_B1_06)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO_AD_B1_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO_AD_B1_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SDA0), MP_ROM_PTR(&pin_GPIO_AD_B1_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO_AD_B1_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO_AD_B1_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SCL0), MP_ROM_PTR(&pin_GPIO_AD_B1_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO_AD_B1_10)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO_AD_B1_10)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO_AD_B1_11)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO_AD_B1_11)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO_AD_B1_08)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO_AD_B1_08)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO_AD_B1_09)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO_AD_B1_09)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO_AD_B0_12)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO_AD_B0_12)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO_AD_B0_13)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO_AD_B0_13)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO_AD_B1_14)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO_AD_B1_14)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO_AD_B1_15)},
{MP_OBJ_NEW_QSTR(MP_QSTR_A13), MP_ROM_PTR(&pin_GPIO_AD_B1_15)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO_EMC_32)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D29), MP_ROM_PTR(&pin_GPIO_EMC_31)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_31)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D30), MP_ROM_PTR(&pin_GPIO_EMC_37)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D31), MP_ROM_PTR(&pin_GPIO_EMC_36)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D32), MP_ROM_PTR(&pin_GPIO_B0_12)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO_EMC_07)},
// SD Card slot
{MP_OBJ_NEW_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO_SD_B0_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO_SD_B0_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO_SD_B0_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_CLK), MP_ROM_PTR(&pin_GPIO_SD_B0_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO_SD_B0_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_CMD), MP_ROM_PTR(&pin_GPIO_SD_B0_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO_SD_B0_05)},
{MP_OBJ_NEW_QSTR(MP_QSTR_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO_SD_B0_04)},
{MP_OBJ_NEW_QSTR(MP_QSTR_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)},
// new pins (not on T4 or T4.1)
{MP_OBJ_NEW_QSTR(MP_QSTR_D40), MP_ROM_PTR(&pin_GPIO_B0_04)},
{MP_OBJ_NEW_QSTR(MP_QSTR_BUS0), MP_ROM_PTR(&pin_GPIO_B0_04)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D41), MP_ROM_PTR(&pin_GPIO_B0_05)},
{MP_OBJ_NEW_QSTR(MP_QSTR_BUS1), MP_ROM_PTR(&pin_GPIO_B0_05)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D42), MP_ROM_PTR(&pin_GPIO_B0_06)},
{MP_OBJ_NEW_QSTR(MP_QSTR_BUS2), MP_ROM_PTR(&pin_GPIO_B0_06)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D43), MP_ROM_PTR(&pin_GPIO_B0_07)},
{MP_OBJ_NEW_QSTR(MP_QSTR_BUS3), MP_ROM_PTR(&pin_GPIO_B0_07)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D44), MP_ROM_PTR(&pin_GPIO_B0_08)},
{MP_OBJ_NEW_QSTR(MP_QSTR_BUS4), MP_ROM_PTR(&pin_GPIO_B0_08)},
{MP_OBJ_NEW_QSTR(MP_QSTR_D45), MP_ROM_PTR(&pin_GPIO_B0_09)},
{MP_OBJ_NEW_QSTR(MP_QSTR_BUS5), MP_ROM_PTR(&pin_GPIO_B0_09)},
// USB Host
{MP_ROM_QSTR(MP_QSTR_USB_HOST_POWER), MP_ROM_PTR(&pin_GPIO_EMC_40)},
{MP_ROM_QSTR(MP_QSTR_USB_HOST_DP), MP_ROM_PTR(&pin_USB_OTG2_DP)},
{MP_ROM_QSTR(MP_QSTR_USB_HOST_DM), MP_ROM_PTR(&pin_USB_OTG2_DN)},
{MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj)},
{MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj)},
{MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj)},
// Micromod Names on different carrier boards
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_RX), MP_ROM_PTR(&pin_GPIO_AD_B0_03)}, // D0
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_TX), MP_ROM_PTR(&pin_GPIO_AD_B0_02)}, // D1
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_PWM1), MP_ROM_PTR(&pin_GPIO_EMC_04)}, // D2
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_PWM0), MP_ROM_PTR(&pin_GPIO_EMC_05)}, // D3
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_D0), MP_ROM_PTR(&pin_GPIO_EMC_06)}, // D4
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_D1), MP_ROM_PTR(&pin_GPIO_EMC_08)}, // D5
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G6), MP_ROM_PTR(&pin_GPIO_B0_10)}, // D6
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_SDO), MP_ROM_PTR(&pin_GPIO_B1_01)}, // D7
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_SDI), MP_ROM_PTR(&pin_GPIO_B1_00)}, // D8
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G7), MP_ROM_PTR(&pin_GPIO_B0_11)}, // D9
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_CS), MP_ROM_PTR(&pin_GPIO_B0_00)}, // D10
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_COPI), MP_ROM_PTR(&pin_GPIO_B0_02)}, // D11
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_CIPO), MP_ROM_PTR(&pin_GPIO_B0_01)}, // D12
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCK), MP_ROM_PTR(&pin_GPIO_B0_03)}, // D13
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_A0), MP_ROM_PTR(&pin_GPIO_AD_B1_02)}, // D14
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_A1), MP_ROM_PTR(&pin_GPIO_AD_B1_03)}, // D15
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_RX2), MP_ROM_PTR(&pin_GPIO_AD_B1_07)}, // D16
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_TX2), MP_ROM_PTR(&pin_GPIO_AD_B1_06)}, // D17
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_SDA), MP_ROM_PTR(&pin_GPIO_AD_B1_01)}, // D18
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCL), MP_ROM_PTR(&pin_GPIO_AD_B1_00)}, // D19
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_FS), MP_ROM_PTR(&pin_GPIO_AD_B1_10)}, // D20
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2S_CLK), MP_ROM_PTR(&pin_GPIO_AD_B1_11)}, // D21
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_BATT_VIN3), MP_ROM_PTR(&pin_GPIO_AD_B1_08)}, // D22
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_MCLK), MP_ROM_PTR(&pin_GPIO_AD_B1_09)}, // D23
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B0_12)}, // D24
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B0_13)}, // D25
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G8), MP_ROM_PTR(&pin_GPIO_AD_B1_14)}, // D26
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G11), MP_ROM_PTR(&pin_GPIO_AD_B1_15)}, // D27
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_33V_EN), MP_ROM_PTR(&pin_GPIO_EMC_32)}, // D28
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_I2C_INT), MP_ROM_PTR(&pin_GPIO_EMC_31)}, // D29
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_CAN_RX), MP_ROM_PTR(&pin_GPIO_EMC_37)}, // D30
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_CAN_TX), MP_ROM_PTR(&pin_GPIO_EMC_36)}, // D31
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G9), MP_ROM_PTR(&pin_GPIO_B0_12)}, // D32
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G10), MP_ROM_PTR(&pin_GPIO_EMC_07)}, // D33
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT1), MP_ROM_PTR(&pin_GPIO_SD_B0_03)}, // D34
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT0), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, // 35
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_CIPO1), MP_ROM_PTR(&pin_GPIO_SD_B0_02)}, // 35
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_SCK1), MP_ROM_PTR(&pin_GPIO_SD_B0_01)}, // D36
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_COPI1), MP_ROM_PTR(&pin_GPIO_SD_B0_00)}, // D37
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_CS1), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, // D38
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT3), MP_ROM_PTR(&pin_GPIO_SD_B0_05)}, // D38
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_DAT2), MP_ROM_PTR(&pin_GPIO_SD_B0_04)},
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G0), MP_ROM_PTR(&pin_GPIO_B0_04)}, // D40
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G1), MP_ROM_PTR(&pin_GPIO_B0_05)}, // D41
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G2), MP_ROM_PTR(&pin_GPIO_B0_06)}, // D42
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G3), MP_ROM_PTR(&pin_GPIO_B0_07)}, // D43
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G4), MP_ROM_PTR(&pin_GPIO_B0_08)}, // D44
{MP_OBJ_NEW_QSTR(MP_QSTR_MM_G5), MP_ROM_PTR(&pin_GPIO_B0_09)}, // D45
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -7,3 +7,4 @@ CHIP_VARIANT = MIMXRT1062DVJ6A
CHIP_FAMILY = MIMXRT1062
FLASH = W25Q16JV
CIRCUITPY__EVE = 1
CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY = 1

View File

@ -112,5 +112,27 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj)},
{MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj)},
{MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj)},
// other i2c ports defined
{MP_OBJ_NEW_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B1_06)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B1_07)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_GPIO_AD_B0_13)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_GPIO_AD_B0_12)},
// Serial Pins
{MP_OBJ_NEW_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO_B1_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO_B1_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_GPIO_AD_B1_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_GPIO_AD_B1_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_AD_B1_07)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_AD_B1_06)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_31)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX8), MP_ROM_PTR(&pin_GPIO_B1_13)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX8), MP_ROM_PTR(&pin_GPIO_B1_12)},
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -8,3 +8,4 @@ CHIP_FAMILY = MIMXRT1062
FLASH = W25Q64JV
CIRCUITPY__EVE = 1
CIRCUITPY_USB_HOST = 1
CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY = 1

View File

@ -150,5 +150,27 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj)},
{MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj)},
{MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj)},
// other i2c ports defined
{MP_OBJ_NEW_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO_AD_B1_06)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SCL1), MP_ROM_PTR(&pin_GPIO_AD_B1_07)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SDA2), MP_ROM_PTR(&pin_GPIO_AD_B0_13)},
{MP_OBJ_NEW_QSTR(MP_QSTR_SCL2), MP_ROM_PTR(&pin_GPIO_AD_B0_12)},
// Serial Pins
{MP_OBJ_NEW_QSTR(MP_QSTR_RX2), MP_ROM_PTR(&pin_GPIO_B1_01)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX2), MP_ROM_PTR(&pin_GPIO_B1_00)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX3), MP_ROM_PTR(&pin_GPIO_AD_B1_03)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX3), MP_ROM_PTR(&pin_GPIO_AD_B1_02)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX4), MP_ROM_PTR(&pin_GPIO_AD_B1_07)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX4), MP_ROM_PTR(&pin_GPIO_AD_B1_06)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX5), MP_ROM_PTR(&pin_GPIO_AD_B1_11)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX5), MP_ROM_PTR(&pin_GPIO_AD_B1_10)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX6), MP_ROM_PTR(&pin_GPIO_AD_B0_13)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX6), MP_ROM_PTR(&pin_GPIO_AD_B0_12)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX7), MP_ROM_PTR(&pin_GPIO_EMC_32)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX7), MP_ROM_PTR(&pin_GPIO_EMC_31)},
{MP_OBJ_NEW_QSTR(MP_QSTR_RX8), MP_ROM_PTR(&pin_GPIO_B1_13)},
{MP_OBJ_NEW_QSTR(MP_QSTR_TX8), MP_ROM_PTR(&pin_GPIO_B1_12)},
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -27,6 +27,8 @@
#include <math.h>
#include "py/runtime.h"
#include "common-hal/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/Processor.h"
#include "shared-bindings/microcontroller/ResetReason.h"
@ -50,6 +52,18 @@ float common_hal_mcu_processor_get_temperature(void) {
return temp;
}
uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self,
uint32_t frequency) {
uint32_t freq = frequency / 1000000;
if (freq != 24 && freq != 150 && freq != 396 && freq != 450 && freq != 528 && freq != 600 &&
freq != 720 && freq != 816 && freq != 912 && freq != 960 && freq != 1008) {
mp_raise_ValueError(translate("Frequency must be 24, 150, 396, 450, 528, 600, 720, 816, 912, 960 or 1008 Mhz"));
}
SystemCoreClock = setarmclock(frequency);
return SystemCoreClock;
}
float common_hal_mcu_processor_get_voltage(void) {
return NAN;
}

View File

@ -31,10 +31,11 @@
#define COMMON_HAL_MCU_PROCESSOR_UID_LENGTH 16
#include "py/obj.h"
#include "clocks.h"
typedef struct {
mp_obj_base_t base;
// Stores no state currently.
uint32_t frequency;
} mcu_processor_obj_t;
#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H

View File

@ -38,6 +38,10 @@
#include "supervisor/shared/translate.h"
#include "periph.h"
// Debug print support set to zero to enable debug printing
#define ENABLE_DEBUG_PRINTING 0
static void config_periph_pin(const mcu_pwm_obj_t *periph) {
IOMUXC_SetPinMux(
periph->pin->mux_reg, periph->mux_mode,
@ -83,6 +87,33 @@ static int calculate_pulse_count(uint32_t frequency, uint8_t *prescaler) {
return 0;
}
// ==========================================================
// Debug code
// ==========================================================
#if ENABLE_DEBUG_PRINTING
#define DBGPrintf mp_printf
extern void debug_print_flexpwm_registers(PWM_Type *base);
void debug_print_flexpwm_registers(PWM_Type *base) {
mp_printf(&mp_plat_print,
"\t\tPWM OUTEN:%x MASK:%x SWCOUT:%x DTSRCSEL:%x MCTRL:%x MCTRL2:%x FCTRL:%x FSTS:%x FFILT:%x FTST:%x FCTRL2:%x\n",
base->OUTEN, base->MASK, base->SWCOUT, base->DTSRCSEL, base->MCTRL, base->MCTRL2, base->FCTRL,
base->FSTS, base->FFILT, base->FTST, base->FCTRL2);
for (uint8_t i = 0; i < 4; i++) {
mp_printf(&mp_plat_print,
"\t\t(%u) INIT:%x CTRL2:%x CTRL:%x VAL0:%x VAL1:%x VAL2:%x VAL3:%x VAL4:%x VAL5:%x OCTRL:%x DTCNT0:%x DTCNT1:%x DISMAP: %x %x\n", i,
base->SM[i].INIT, base->SM[i].CTRL2, base->SM[i].CTRL, base->SM[i].VAL0, base->SM[i].VAL1, base->SM[i].VAL2,
base->SM[i].VAL3, base->SM[i].VAL4, base->SM[i].VAL5, base->SM[i].OCTRL, base->SM[i].DTCNT0, base->SM[i].DTCNT1,
base->SM[i].DISMAP[0], base->SM[i].DISMAP[1]);
}
}
#else
#define DBGPrintf(p,...)
inline void debug_print_flexpwm_registers(PWM_Type *base) {
}
#endif
pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self,
const mcu_pin_obj_t *pin,
uint16_t duty,
@ -93,6 +124,9 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self,
const uint32_t pwm_count = sizeof(mcu_pwm_list) / sizeof(mcu_pwm_obj_t);
DBGPrintf(&mp_plat_print, ">>> common_hal_pwmio_pwmout_construct called: pin: %p %u freq:%u duty:%u var:%u\n",
self->pin->gpio, self->pin->number, frequency, duty, variable_frequency);
for (uint32_t i = 0; i < pwm_count; ++i) {
if (mcu_pwm_list[i].pin != pin) {
continue;
@ -107,6 +141,8 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self,
return PWMOUT_INVALID_PIN;
}
DBGPrintf(&mp_plat_print, "\tFound in PWM List\n");
config_periph_pin(self->pwm);
pwm_config_t pwmConfig;
@ -138,33 +174,67 @@ pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self,
pwmConfig.prescale = self->prescaler;
DBGPrintf(&mp_plat_print, "\tCall PWM_Init\n");
if (PWM_Init(self->pwm->pwm, self->pwm->submodule, &pwmConfig) == kStatus_Fail) {
return PWMOUT_INVALID_PIN;
}
pwm_signal_param_t pwmSignal = {
.pwmChannel = self->pwm->channel,
.level = kPWM_HighTrue,
.dutyCyclePercent = 0, // avoid an initial transient
.deadtimeValue = 0, // allow 100% duty cycle
};
// Disable all fault inputs
self->pwm->pwm->SM[self->pwm->submodule].DISMAP[0] = 0;
self->pwm->pwm->SM[self->pwm->submodule].DISMAP[1] = 0;
status_t status = PWM_SetupPwm(self->pwm->pwm, self->pwm->submodule, &pwmSignal, 1, kPWM_EdgeAligned, frequency, PWM_SRC_CLK_FREQ);
DBGPrintf(&mp_plat_print, "\tCall PWM_SetupPwm %p %x %u\n", self->pwm->pwm, self->pwm->submodule);
// ========================================================================================================
// Not calling the PWM_SetupPwm as it was setup to only work for PWM output on chan A and B but not X
// I have done some experimenting, probably could try others, but again they do not work with X.
// Most of the code checks to see if A if not, then it assume B.
//
// Instead I set it up to work similar to what the Teensy 4.x code does.
//
// That is we set the PWM_CTRL_FULL_MASK, which then uses base->SM[submodule].VAL1 to control
// when the timer is reset, so it sets up your cycle/frequency. But then this implies that X channel
// which uses 0, 1 has to be handled specially. So for the different channels:
// A - Uses VAL2 to turn on (0) and VAL3=duty to turn off
// B - Uses VAL4 to turn on (0) and VAL5 to turn off
// X - As mentioned above VAL1 turns off, but it's set to the timing for frequency. so
// VAL0 turns on, so we set it to VAL1 - duty
//
PWM_Type *base = self->pwm->pwm;
uint8_t submodule = self->pwm->submodule;
if (status != kStatus_Success) {
return PWMOUT_INITIALIZATION_ERROR;
uint32_t mask = 1 << submodule;
uint32_t olddiv = base->SM[submodule].VAL1 + 1;
if (self->pulse_count != olddiv) {
base->MCTRL |= PWM_MCTRL_CLDOK(mask);
base->SM[submodule].CTRL = PWM_CTRL_PRSC_MASK | PWM_CTRL_PRSC(self->prescaler);
base->SM[submodule].VAL1 = self->pulse_count - 1;
base->SM[submodule].CTRL2 = PWM_CTRL2_INDEP_MASK | PWM_CTRL2_WAITEN_MASK | PWM_CTRL2_DBGEN_MASK;
if (olddiv == 1) {
base->SM[submodule].CTRL = PWM_CTRL_FULL_MASK;
base->SM[submodule].VAL0 = 0;
base->SM[submodule].VAL2 = 0;
base->SM[submodule].VAL3 = 0;
base->SM[submodule].VAL4 = 0;
base->SM[submodule].VAL5 = 0;
} else {
base->SM[submodule].VAL0 = (base->SM[submodule].VAL0 * self->pulse_count) / olddiv;
base->SM[submodule].VAL3 = (base->SM[submodule].VAL3 * self->pulse_count) / olddiv;
base->SM[submodule].VAL5 = (base->SM[submodule].VAL5 * self->pulse_count) / olddiv;
}
base->MCTRL |= PWM_MCTRL_LDOK(mask);
}
debug_print_flexpwm_registers(self->pwm->pwm);
PWM_SetPwmLdok(self->pwm->pwm, 1 << self->pwm->submodule, true);
PWM_StartTimer(self->pwm->pwm, 1 << self->pwm->submodule);
DBGPrintf(&mp_plat_print, "\tCall common_hal_pwmio_pwmout_set_duty_cycle\n");
common_hal_pwmio_pwmout_set_duty_cycle(self, duty);
DBGPrintf(&mp_plat_print, "\tReturn OK\n");
return PWMOUT_OK;
}
@ -185,7 +255,16 @@ void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uint16_t d
// we do not use PWM_UpdatePwmDutycycle because ...
// * it works in integer percents
// * it can't set the "X" duty cycle
// As mentioned in the setting up of the frequency code
// A - Uses VAL2 to turn on (0) and VAL3=duty to turn off
// B - Uses VAL4 to turn on (0) and VAL5 to turn off
// X - As mentioned above VAL1 turns off, but it's set to the timing for frequency. so
// VAL0 turns on, so we set it to VAL1 - duty
DBGPrintf(&mp_plat_print, "common_hal_pwmio_pwmout_set_duty_cycle %u\n", duty);
self->duty_cycle = duty;
PWM_Type *base = self->pwm->pwm;
uint8_t mask = 1 << self->pwm->submodule;
if (duty == 65535) {
self->duty_scaled = self->pulse_count + 1;
} else {
@ -193,18 +272,21 @@ void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uint16_t d
}
switch (self->pwm->channel) {
case kPWM_PwmX:
self->pwm->pwm->SM[self->pwm->submodule].VAL0 = 0;
self->pwm->pwm->SM[self->pwm->submodule].VAL1 = self->duty_scaled;
base->SM[self->pwm->submodule].VAL0 = self->pulse_count - self->duty_scaled;
base->OUTEN |= PWM_OUTEN_PWMX_EN(mask);
break;
case kPWM_PwmA:
self->pwm->pwm->SM[self->pwm->submodule].VAL2 = 0;
self->pwm->pwm->SM[self->pwm->submodule].VAL3 = self->duty_scaled;
base->SM[self->pwm->submodule].VAL3 = self->duty_scaled;
base->OUTEN |= PWM_OUTEN_PWMA_EN(mask);
break;
case kPWM_PwmB:
self->pwm->pwm->SM[self->pwm->submodule].VAL4 = 0;
self->pwm->pwm->SM[self->pwm->submodule].VAL5 = self->duty_scaled;
base->SM[self->pwm->submodule].VAL5 = self->duty_scaled;
base->OUTEN |= PWM_OUTEN_PWMB_EN(mask);
}
PWM_SetPwmLdok(self->pwm->pwm, 1 << self->pwm->submodule, true);
debug_print_flexpwm_registers(self->pwm->pwm);
}
uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t *self) {

View File

@ -0,0 +1 @@
_ld_flash_size = 16M;

View File

@ -34,6 +34,7 @@
#include "fsl_clock.h"
#include "fsl_iomuxc.h"
#include "fsl_device_registers.h"
#include "clocks.h"
@ -335,3 +336,257 @@ void clocks_init(void) {
CLOCK_EnableClock(kCLOCK_Iomuxc);
}
/* clockspeed.c
* http://www.pjrc.com/teensy/
* Copyright (c) 2017 PJRC.COM, LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
// Note setarmclock is a port from Teensyduino for the Teensy 4.x written by Paul Stroffgren,
// A brief explanation of F_CPU_ACTUAL vs F_CPU
// https://forum.pjrc.com/threads/57236?p=212642&viewfull=1#post212642
volatile uint32_t F_CPU_ACTUAL = 396000000;
volatile uint32_t F_BUS_ACTUAL = 132000000;
// Define these to increase the voltage when attempting overclocking
// The frequency step is how quickly to increase voltage per frequency
// The datasheet says 1600 is the absolute maximum voltage. The hardware
// can actually create up to 1575. But 1300 is the recommended limit.
// (earlier versions of the datasheet said 1300 was the absolute max)
#define OVERCLOCK_STEPSIZE 28000000
#define OVERCLOCK_MAX_VOLT 1575
#define DCDC_REG3 0x40080012
#define DCDC_REG0 0x40080000
#define DCDC_REG0_STS_DC_OK_L ((uint32_t)(1 << 31))
#define CCM_ANALOG_PLL_USB1_ENABLE_L ((uint32_t)(1 << 13))
#define CCM_ANALOG_PLL_USB1_POWER_L ((uint32_t)(1 << 12))
#define CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L ((uint32_t)(1 << 6))
#define CCM_ANALOG_PLL_USB1_LOCK_L ((uint32_t)(1 << 31))
#define CCM_CCGR6_DCDC(n) ((uint32_t)(((n) & 0x03) << 6))
#define CCM_ANALOG_PLL_ARM_LOCK_L ((uint32_t)(1 << 31))
#define CCM_ANALOG_PLL_ARM_BYPASS_L ((uint32_t)(1 << 16))
#define CCM_ANALOG_PLL_ARM_ENABLE_L ((uint32_t)(1 << 13))
#define CCM_ANALOG_PLL_ARM_POWERDOWN_L ((uint32_t)(1 << 12))
#define CCM_CDHIPR_ARM_PODF_BUSY_L ((uint32_t)(1 << 16))
#define CCM_CDHIPR_AHB_PODF_BUSY_L ((uint32_t)(1 << 1))
#define CCM_CDHIPR_PERIPH_CLK_SEL_BUSY_L ((uint32_t)(1 << 5))
#define CCM_CBCDR_PERIPH_CLK_SEL_L ((uint32_t)(1 << 25))
#define CCM_CCGR_OFF 0
#define CCM_CCGR_ON_RUNONLY 1
#define CCM_CCGR_ON 3
/* Teensyduino Core Library - clockspeed.c
* http://www.pjrc.com/teensy/
* Copyright (c) 2017 PJRC.COM, LLC.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* 1. The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* 2. If the Software is incorporated into a build system that allows
* selection among a list of target devices, then similar target
* devices manufactured by PJRC.COM must be included in the list of
* target devices and selectable in the same manner.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
// uint32_t set_arm_clock(uint32_t frequency);
// stuff needing wait handshake:
// CCM_CACRR ARM_PODF
// CCM_CBCDR PERIPH_CLK_SEL
// CCM_CBCMR PERIPH2_CLK_SEL
// CCM_CBCDR AHB_PODF
// CCM_CBCDR SEMC_PODF
uint32_t setarmclock(uint32_t frequency) {
uint32_t cbcdr = CCM->CBCDR; // pg 1021
uint32_t cbcmr = CCM->CBCMR; // pg 1023
uint32_t dcdc = DCDC->REG3;
// compute required voltage
uint32_t voltage = 1150; // default = 1.15V
if (frequency > 528000000) {
voltage = 1250; // 1.25V
#if defined(OVERCLOCK_STEPSIZE) && defined(OVERCLOCK_MAX_VOLT)
if (frequency > 600000000) {
voltage += ((frequency - 600000000) / OVERCLOCK_STEPSIZE) * 25;
if (voltage > OVERCLOCK_MAX_VOLT) {
voltage = OVERCLOCK_MAX_VOLT;
}
}
#endif
} else if (frequency <= 24000000) {
voltage = 950; // 0.95
}
// if voltage needs to increase, do it before switch clock speed
CCM->CCGR6 |= CCM_CCGR6_DCDC(CCM_CCGR_ON);
if ((dcdc & ((uint32_t)(0x1F << 0))) < ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) {
dcdc &= ~((uint32_t)(0x1F << 0));
dcdc |= ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0);
DCDC->REG3 = dcdc;
while (!(DCDC->REG0 & DCDC_REG0_STS_DC_OK_L)) {
; // wait voltage settling
}
}
if (!(cbcdr & CCM_CBCDR_PERIPH_CLK_SEL_L)) {
const uint32_t need1s = CCM_ANALOG_PLL_USB1_ENABLE_L | CCM_ANALOG_PLL_USB1_POWER_L |
CCM_ANALOG_PLL_USB1_LOCK_L | CCM_ANALOG_PLL_USB1_EN_USB_CLKS_L;
uint32_t sel, div;
if ((CCM_ANALOG->PLL_USB1 & need1s) == need1s) {
sel = 0;
div = 3; // divide down to 120 MHz, so IPG is ok even if IPG_PODF=0
} else {
sel = 1;
div = 0;
}
if ((cbcdr & ((uint32_t)(0x07 << 27))) != CCM_CBCDR_PERIPH_CLK2_PODF(div)) {
// PERIPH_CLK2 divider needs to be changed
cbcdr &= ~((uint32_t)(0x07 << 27));
cbcdr |= CCM_CBCDR_PERIPH_CLK2_PODF(div);
CCM->CBCDR = cbcdr;
}
if ((cbcmr & ((uint32_t)(0x03 << 12))) != CCM_CBCMR_PERIPH_CLK2_SEL(sel)) {
// PERIPH_CLK2 source select needs to be changed
cbcmr &= ~((uint32_t)(0x03 << 12));
cbcmr |= CCM_CBCMR_PERIPH_CLK2_SEL(sel);
CCM->CBCMR = cbcmr;
while (CCM->CDHIPR & ((uint32_t)(1 << 3))) {
; // wait
}
}
// switch over to PERIPH_CLK2
cbcdr |= ((uint32_t)(1 << 25));
CCM->CBCDR = cbcdr;
while (CCM->CDHIPR & ((uint32_t)(1 << 5))) {
; // wait
}
}
// TODO: check if PLL2 running, can 352, 396 or 528 can work? (no need for ARM PLL)
// DIV_SELECT: 54-108 = official range 648 to 1296 in 12 MHz steps
uint32_t div_arm = 1;
uint32_t div_ahb = 1;
while (frequency * div_arm * div_ahb < 648000000) {
if (div_arm < 8) {
div_arm = div_arm + 1;
} else {
if (div_ahb < 5) {
div_ahb = div_ahb + 1;
div_arm = 1;
} else {
break;
}
}
}
uint32_t mult = (frequency * div_arm * div_ahb + 6000000) / 12000000;
if (mult > 108) {
mult = 108;
}
if (mult < 54) {
mult = 54;
}
frequency = mult * 12000000 / div_arm / div_ahb;
const uint32_t arm_pll_mask = CCM_ANALOG_PLL_ARM_LOCK_L | CCM_ANALOG_PLL_ARM_BYPASS_L |
CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_POWERDOWN_L |
CCM_ANALOG_PLL_ARM_DIV_SELECT_MASK;
if ((CCM_ANALOG->PLL_ARM & arm_pll_mask) != (CCM_ANALOG_PLL_ARM_LOCK_L
| CCM_ANALOG_PLL_ARM_ENABLE_L | CCM_ANALOG_PLL_ARM_DIV_SELECT(mult))) {
// printf("ARM PLL needs reconfigure\n");
CCM_ANALOG->PLL_ARM = CCM_ANALOG_PLL_ARM_POWERDOWN_L;
// TODO: delay needed?
CCM_ANALOG->PLL_ARM = CCM_ANALOG_PLL_ARM_ENABLE_L
| CCM_ANALOG_PLL_ARM_DIV_SELECT(mult);
while (!(CCM_ANALOG->PLL_ARM & CCM_ANALOG_PLL_ARM_LOCK_L)) {
; // wait for lock
}
}
if ((CCM->CACRR & ((uint32_t)(0x07 << 0))) != (div_arm - 1)) {
CCM->CACRR = CCM_CACRR_ARM_PODF(div_arm - 1);
while (CCM->CDHIPR & CCM_CDHIPR_ARM_PODF_BUSY_L) {
; // wait
}
}
if ((cbcdr & ((uint32_t)(0x07 << 10))) != CCM_CBCDR_AHB_PODF(div_ahb - 1)) {
cbcdr &= ~((uint32_t)(0x07 << 10));
cbcdr |= CCM_CBCDR_AHB_PODF(div_ahb - 1);
CCM->CBCDR = cbcdr;
while (CCM->CDHIPR & CCM_CDHIPR_AHB_PODF_BUSY_L) {
; // wait
}
}
uint32_t div_ipg = (frequency + 149999999) / 150000000;
if (div_ipg > 4) {
div_ipg = 4;
}
if ((cbcdr & ((uint32_t)(0x03 << 8))) != (CCM_CBCDR_IPG_PODF(div_ipg - 1))) {
cbcdr &= ~((uint32_t)(0x03 << 8));
cbcdr |= CCM_CBCDR_IPG_PODF(div_ipg - 1);
// TODO: how to safely change IPG_PODF ??
CCM->CBCDR = cbcdr;
}
// cbcdr &= ~CCM_CBCDR_PERIPH_CLK_SEL;
// CCM_CBCDR = cbcdr; // why does this not work at 24 MHz?
CCM->CBCDR &= ~((uint32_t)(1 << 25));
while (CCM->CDHIPR & CCM_CDHIPR_PERIPH_CLK_SEL_BUSY_L) {
; // wait
}
F_CPU_ACTUAL = frequency;
F_BUS_ACTUAL = frequency / div_ipg;
// scale_cpu_cycles_to_microseconds = 0xFFFFFFFFu / (uint32_t)(frequency / 1000000u);
// if voltage needs to decrease, do it after switch clock speed
if ((dcdc & ((uint32_t)(0x1F << 0))) > ((uint32_t)(((voltage - 800) / 25) & 0x1F) << 0)) {
dcdc &= ~((uint32_t)(0x1F << 0));
dcdc |= ((uint32_t)(0x1F << 0));
DCDC->REG3 = dcdc;
while (!(DCDC->REG0 & DCDC_REG0_STS_DC_OK_L)) {
; // wait voltage settling
}
}
return frequency;
}

View File

@ -27,3 +27,4 @@
extern uint32_t SystemCoreClock;
void clocks_init(void);
uint32_t setarmclock(uint32_t frequency);

View File

@ -398,6 +398,13 @@ void port_interrupt_after_ticks(uint32_t ticks) {
void port_idle_until_interrupt(void) {
// App note here: https://www.nxp.com/docs/en/application-note/AN12085.pdf
// Currently I have disabled the setting into wait mode as this impacts lots of different
// subsystems and it is unclear if you can or should set it generically without having
// a better understanding of user intent. For example by default it will kill PWM
// when in this mode, unless PWM_CTRL2_WAITEN_MASK is set, and even with this set
// it may not work properly if the same timer/subtimer is trying to PWM on multiple channels.
// Maybe at later date, revisit after we have a better understanding on things like which
// timers it impacts and how each subsystem is configured.
// Clear the FPU interrupt because it can prevent us from sleeping.
if (__get_FPSCR() & ~(0x9f)) {
@ -408,13 +415,7 @@ void port_idle_until_interrupt(void) {
common_hal_mcu_disable_interrupts();
if (!background_callback_pending()) {
NVIC_ClearPendingIRQ(SNVS_HP_WRAPPER_IRQn);
// Don't down clock on debug builds because it prevents the DAP from
// reading memory
#if CIRCUITPY_DEBUG == 0
CLOCK_SetMode(kCLOCK_ModeWait);
#endif
__WFI();
CLOCK_SetMode(kCLOCK_ModeRun);
}
common_hal_mcu_enable_interrupts();
}

View File

@ -26,27 +26,28 @@
* THE SOFTWARE.
*/
#include "supervisor/serial.h"
#include "py/mphal.h"
#include <string.h>
#include "supervisor/serial.h"
#include "fsl_clock.h"
#include "fsl_lpuart.h"
// TODO: Switch this to using DEBUG_UART.
// If the board defined a debug uart tx or rx pin then we enable this code
#if defined(CIRCUITPY_DEBUG_UART_TX) || defined(CIRCUITPY_DEBUG_UART_RX)
// static LPUART_Type *uart_instance = LPUART1; // evk
static LPUART_Type *uart_instance = LPUART4; // feather 1011
// static LPUART_Type *uart_instance = LPUART2; // feather 1062
static uint32_t UartSrcFreq(void) {
uint32_t freq;
/* To make it simple, we assume default PLL and divider settings, and the only variable
from application is use PLL3 source or OSC source */
/* To make it simple, we assume default PLL and divider settings, and the only
variable from application is use PLL3 source or OSC source */
/* PLL3 div6 80M */
if (CLOCK_GetMux(kCLOCK_UartMux) == 0) {
freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
freq = (CLOCK_GetPllFreq(kCLOCK_PllUsb1) / 6U) /
(CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
} else {
freq = CLOCK_GetOscFreq() / (CLOCK_GetDiv(kCLOCK_UartDiv) + 1U);
}
@ -88,3 +89,4 @@ void port_serial_write_substring(const char *text, uint32_t len) {
LPUART_WriteBlocking(uart_instance, (uint8_t *)text, len);
}
#endif // USE_DEBUG_PORT_CODE

View File

@ -8,7 +8,6 @@ MCU_CHIP = nrf52840
QSPI_FLASH_FILESYSTEM = 1
EXTERNAL_FLASH_DEVICES = "GD25Q16C, W25Q128JVxQ"
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_ST7789
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Display_Shapes

View File

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

View File

@ -0,0 +1,2 @@
#define MICROPY_HW_BOARD_NAME "ELECFREAKS PICO:ED"
#define MICROPY_HW_MCU_NAME "rp2040"

View File

@ -0,0 +1,11 @@
USB_VID = 0x2E8A
USB_PID = 0x1026
USB_PRODUCT = "Pico:ed"
USB_MANUFACTURER = "ELECFREAKS"
CHIP_VARIANT = RP2040
CHIP_FAMILY = rp2
EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ"
CIRCUITPY__EVE = 1

View File

@ -0,0 +1 @@
// Put board-specific pico-sdk definitions here. This file must exist.

View File

@ -0,0 +1,56 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
{ MP_ROM_QSTR(MP_QSTR_BUZZER_GP0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_I2C0_SDA), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_I2C0_SCL), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_BUZZER), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_BUZZER_GP3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_P4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_P5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_P6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_P7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_P8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_P9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_P10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_P11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_P12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_P13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_P14), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_P15), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_P16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_P20), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_P19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO24) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) },
{ MP_ROM_QSTR(MP_QSTR_P0_A0), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_P0), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_P1_A1), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_P1), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_P2_A2), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_P2), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_P3_A3), MP_ROM_PTR(&pin_GPIO29) },
{ MP_ROM_QSTR(MP_QSTR_P3), MP_ROM_PTR(&pin_GPIO29) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -11,7 +11,6 @@ EXTERNAL_FLASH_DEVICES = "GD25Q64C"
CIRCUITPY__EVE = 1
FROZEN_MPY_DIRS += $(TOP)/ports/raspberrypi/boards/solderparty_rp2040_stamp
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Register

View File

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

View File

@ -0,0 +1,9 @@
#define MICROPY_HW_BOARD_NAME "W5100S-EVB-Pico"
#define MICROPY_HW_MCU_NAME "rp2040"
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO18)
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO19)
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO16)
#define DEFAULT_UART_BUS_RX (&pin_GPIO1)
#define DEFAULT_UART_BUS_TX (&pin_GPIO0)

View File

@ -0,0 +1,11 @@
USB_VID = 0x2E8A
USB_PID = 0x1027
USB_PRODUCT = "W5100S-EVB-Pico"
USB_MANUFACTURER = "WIZnet"
CHIP_VARIANT = RP2040
CHIP_FAMILY = rp2
EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ"
CIRCUITPY__EVE = 1

View File

@ -0,0 +1 @@
// Put board-specific pico-sdk definitions here. This file must exist.

View File

@ -0,0 +1,54 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
{ MP_ROM_QSTR(MP_QSTR_GP0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_GP1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_GP2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_GP3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_GP4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_GP5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_GP6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_GP7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_GP8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_GP9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_GP10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_GP11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_GP12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_GP13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_GP14), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_GP15), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_GP16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_GP17), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_GP18), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_GP19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_GP20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_GP21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_GP22), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_SMPS_MODE), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_GP23), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO24) },
{ MP_ROM_QSTR(MP_QSTR_GP24), MP_ROM_PTR(&pin_GPIO24) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO25) },
{ MP_ROM_QSTR(MP_QSTR_GP25), MP_ROM_PTR(&pin_GPIO25) },
{ MP_ROM_QSTR(MP_QSTR_GP26_A0), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_GP26), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_GP27_A1), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_GP27), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_GP28_A2), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_GP28), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) },
{ MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO29) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View File

@ -86,7 +86,7 @@ uint64_t stm32_peripherals_rtc_raw_ticks(uint8_t *subticks) {
uint32_t time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK);
uint32_t date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK);
uint32_t ssr = (uint32_t)(RTC->SSR);
while (ssr != first_ssr) {
if (ssr != first_ssr) {
first_ssr = ssr;
time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK);
date = (uint32_t)(RTC->DR & RTC_DR_RESERVED_MASK);
@ -184,13 +184,16 @@ void stm32_peripherals_rtc_set_alarm(uint8_t alarm_idx, uint32_t ticks) {
alarm.AlarmTime.SubSeconds = rtc_clock_frequency - 1 -
((raw_ticks % TICK_DIVISOR) * 32);
if (alarm.AlarmTime.SubSeconds > rtc_clock_frequency) {
alarm.AlarmTime.SubSeconds = alarm.AlarmTime.SubSeconds +
rtc_clock_frequency;
}
alarm.AlarmTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE;
alarm.AlarmTime.StoreOperation = RTC_STOREOPERATION_SET;
// Masking here means that the bits are ignored so we set none of them.
alarm.AlarmSubSecondMask = RTC_ALARMSUBSECONDMASK_NONE;
alarm.AlarmDateWeekDaySel = RTC_ALARMDATEWEEKDAYSEL_DATE;
alarm.Alarm = (alarm_idx == PERIPHERALS_ALARM_A) ? RTC_ALARM_A : RTC_ALARM_B;
HAL_RTC_SetAlarm_IT(&hrtc, &alarm, RTC_FORMAT_BIN);
HAL_NVIC_EnableIRQ(RTC_Alarm_IRQn);
alarmed_already[alarm_idx] = false;

View File

@ -49,7 +49,6 @@ CFLAGS += -DMICROPY_PY_USELECT=$(MICROPY_PY_USELECT)
MICROPY_PY_USELECT_SELECT ?= $(MICROPY_PY_USELECT)
CFLAGS += -DMICROPY_PY_USELECT_SELECT=$(MICROPY_PY_USELECT_SELECT)
CIRCUITPY_AESIO ?= $(CIRCUITPY_FULL_BUILD)
CFLAGS += -DCIRCUITPY_AESIO=$(CIRCUITPY_AESIO)
@ -347,6 +346,9 @@ CFLAGS += -DCIRCUITPY_SDIOIO=$(CIRCUITPY_SDIOIO)
CIRCUITPY_SERIAL_BLE ?= 0
CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE)
CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY?= 0
CFLAGS += -DCIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY=$(CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY)
CIRCUITPY_SHARPDISPLAY ?= $(CIRCUITPY_FRAMEBUFFERIO)
CFLAGS += -DCIRCUITPY_SHARPDISPLAY=$(CIRCUITPY_SHARPDISPLAY)

View File

@ -19,16 +19,14 @@ def get_version_info_from_git():
# Note: git describe doesn't work if no tag is available
try:
git_tag = subprocess.check_output(
[tools_describe],
stderr=subprocess.STDOUT,
universal_newlines=True,
[tools_describe], stderr=subprocess.STDOUT, universal_newlines=True, shell=True
).strip()
except subprocess.CalledProcessError as er:
if er.returncode == 128:
# git exit code of 128 means no repository found
return None
git_tag = ""
except OSError:
except OSError as e:
return None
try:
git_hash = subprocess.check_output(

View File

@ -299,7 +299,9 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_spi_write_obj, 1, busio_spi_write);
//|
//| :param WriteableBuffer buffer: read bytes into this buffer
//| :param int start: beginning of buffer slice
//| :param int end: end of buffer slice; if not specified, use ``len(buffer)``
//| :param int end: end of buffer slice; if not specified, it will be the equivalent value
//| of ``len(buffer)`` and for any value provided it will take the value of
//| ``min(end, len(buffer))``
//| :param int write_value: value to write while reading
//| """
//| ...

View File

@ -143,6 +143,7 @@ static displayio_tilegrid_t *native_tilegrid(mp_obj_t tilegrid_obj) {
mp_obj_assert_native_inited(native_tilegrid);
return MP_OBJ_TO_PTR(native_tilegrid);
}
//| hidden: bool
//| """True when the TileGrid is hidden. This may be False even when a part of a hidden Group."""
//|
@ -379,6 +380,72 @@ const mp_obj_property_t displayio_tilegrid_pixel_shader_obj = {
MP_ROM_NONE},
};
//| bitmap: Union[Bitmap,OnDiskBitmap,Shape]
//| """The bitmap of the tilegrid."""
//|
STATIC mp_obj_t displayio_tilegrid_obj_get_bitmap(mp_obj_t self_in) {
displayio_tilegrid_t *self = native_tilegrid(self_in);
return common_hal_displayio_tilegrid_get_bitmap(self);
}
MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_bitmap_obj, displayio_tilegrid_obj_get_bitmap);
STATIC mp_obj_t displayio_tilegrid_obj_set_bitmap(mp_obj_t self_in, mp_obj_t bitmap) {
displayio_tilegrid_t *self = native_tilegrid(self_in);
uint16_t new_bitmap_width;
uint16_t new_bitmap_height;
mp_obj_t native = mp_obj_cast_to_native_base(bitmap, &displayio_shape_type);
if (native != MP_OBJ_NULL) {
displayio_shape_t *bmp = MP_OBJ_TO_PTR(native);
new_bitmap_width = bmp->width;
new_bitmap_height = bmp->height;
} else if (mp_obj_is_type(bitmap, &displayio_bitmap_type)) {
displayio_bitmap_t *bmp = MP_OBJ_TO_PTR(bitmap);
native = bitmap;
new_bitmap_width = bmp->width;
new_bitmap_height = bmp->height;
} else if (mp_obj_is_type(bitmap, &displayio_ondiskbitmap_type)) {
displayio_ondiskbitmap_t *bmp = MP_OBJ_TO_PTR(bitmap);
native = bitmap;
new_bitmap_width = bmp->width;
new_bitmap_height = bmp->height;
} else {
mp_raise_TypeError_varg(translate("unsupported %q type"), MP_QSTR_bitmap);
}
mp_obj_t old_native = mp_obj_cast_to_native_base(self->bitmap, &displayio_shape_type);
if (old_native != MP_OBJ_NULL) {
displayio_shape_t *old_bmp = MP_OBJ_TO_PTR(old_native);
if (old_bmp->width != new_bitmap_width || old_bmp->height != new_bitmap_height) {
mp_raise_ValueError(translate("New bitmap must be same size as old bitmap"));
}
} else if (mp_obj_is_type(self->bitmap, &displayio_bitmap_type)) {
displayio_bitmap_t *old_bmp = MP_OBJ_TO_PTR(self->bitmap);
old_native = self->bitmap;
if (old_bmp->width != new_bitmap_width || old_bmp->height != new_bitmap_height) {
mp_raise_ValueError(translate("New bitmap must be same size as old bitmap"));
}
} else if (mp_obj_is_type(self->bitmap, &displayio_ondiskbitmap_type)) {
displayio_ondiskbitmap_t *old_bmp = MP_OBJ_TO_PTR(self->bitmap);
old_native = self->bitmap;
if (old_bmp->width != new_bitmap_width || old_bmp->height != new_bitmap_height) {
mp_raise_ValueError(translate("New bitmap must be same size as old bitmap"));
}
}
common_hal_displayio_tilegrid_set_bitmap(self, bitmap);
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_2(displayio_tilegrid_set_bitmap_obj, displayio_tilegrid_obj_set_bitmap);
const mp_obj_property_t displayio_tilegrid_bitmap_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&displayio_tilegrid_get_bitmap_obj,
(mp_obj_t)&displayio_tilegrid_set_bitmap_obj,
MP_ROM_NONE},
};
//| def __getitem__(self, index: Union[Tuple[int, int], int]) -> int:
//| """Returns the tile index at the given index. The index can either be an x,y tuple or an int equal
//| to ``y * width + x``.
@ -455,6 +522,7 @@ STATIC const mp_rom_map_elem_t displayio_tilegrid_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_flip_y), MP_ROM_PTR(&displayio_tilegrid_flip_y_obj) },
{ MP_ROM_QSTR(MP_QSTR_transpose_xy), MP_ROM_PTR(&displayio_tilegrid_transpose_xy_obj) },
{ MP_ROM_QSTR(MP_QSTR_pixel_shader), MP_ROM_PTR(&displayio_tilegrid_pixel_shader_obj) },
{ MP_ROM_QSTR(MP_QSTR_bitmap), MP_ROM_PTR(&displayio_tilegrid_bitmap_obj) },
};
STATIC MP_DEFINE_CONST_DICT(displayio_tilegrid_locals_dict, displayio_tilegrid_locals_dict_table);

View File

@ -45,6 +45,9 @@ void common_hal_displayio_tilegrid_set_y(displayio_tilegrid_t *self, mp_int_t y)
mp_obj_t common_hal_displayio_tilegrid_get_pixel_shader(displayio_tilegrid_t *self);
void common_hal_displayio_tilegrid_set_pixel_shader(displayio_tilegrid_t *self, mp_obj_t pixel_shader);
mp_obj_t common_hal_displayio_tilegrid_get_bitmap(displayio_tilegrid_t *self);
void common_hal_displayio_tilegrid_set_bitmap(displayio_tilegrid_t *self, mp_obj_t bitmap);
bool common_hal_displayio_tilegrid_get_flip_x(displayio_tilegrid_t *self);
void common_hal_displayio_tilegrid_set_flip_x(displayio_tilegrid_t *self, bool flip_x);

View File

@ -36,7 +36,7 @@
//| def __init__(self, key_number: int=0, pressed: bool=True, timestamp:Optional[int]=None) -> None:
//| """Create a key transition event, which reports a key-pressed or key-released transition.
//|
//| :param int key_number: the key number
//| :param int key_number: The key number.
//| :param bool pressed: ``True`` if the key was pressed; ``False`` if it was released.
//| :param int timestamp: The time in milliseconds that the keypress occurred in the `supervisor.ticks_ms` time system. If specified as None, the current value of `supervisor.ticks_ms` is used.
//| """
@ -120,7 +120,7 @@ const mp_obj_property_t keypad_event_released_obj = {
};
//| timestamp: int
//| """The timestamp"""
//| """The timestamp."""
//|
STATIC mp_obj_t keypad_event_get_timestamp(mp_obj_t self_in) {
keypad_event_obj_t *self = MP_OBJ_TO_PTR(self_in);

View File

@ -45,7 +45,7 @@
//| If a new event arrives when the queue is full, the event is discarded, and
//| `overflowed` is set to ``True``.
//|
//| :return: the next queued key transition `Event`
//| :return: The next queued key transition `Event`.
//| :rtype: Optional[Event]
//| """
//| ...

View File

@ -157,7 +157,7 @@ STATIC void check_for_deinit(keypad_keymatrix_obj_t *self) {
//| """
//|
//| def key_number_to_row_column(self, row: int, column: int) -> Tuple[int]:
//| def key_number_to_row_column(self, key_number: int) -> Tuple[int]:
//| """Return the row and column for the given key number.
//| The row is ``key_number // len(column_pins)``.
//| The column is ``key_number % len(column_pins)``.

View File

@ -157,6 +157,11 @@ STATIC NORETURN void math_error(void) {
//| """Return ``x * (2**exp)``."""
//| ...
//|
//| def log(x: float, base: float = e) -> float:
//| """Return the logarithm of x to the given base. If base is not specified,
//| returns the natural logarithm (base e) of x"""
//| ...
//|
//| def modf(x: float) -> Tuple[float, float]:
//| """Return a tuple of two floats, being the fractional and integral parts of
//| ``x``. Both return values have the same sign as ``x``."""

View File

@ -30,9 +30,16 @@
#include <math.h>
#include <stdint.h>
#include "py/objproperty.h"
#include "shared-bindings/util.h"
#include "shared/runtime/buffer_helper.h"
#include "shared/runtime/context_manager_helpers.h"
#include "py/mperrno.h"
#include "py/objtype.h"
#include "py/objproperty.h"
#include "py/runtime.h"
#include "supervisor/shared/translate.h"
//| class Processor:
//| """Microcontroller CPU information and control
@ -61,6 +68,20 @@
//| frequency: int
//| """The CPU operating frequency in Hertz. (read-only)"""
//|
STATIC mp_obj_t mcu_processor_set_frequency(mp_obj_t self, mp_obj_t freq) {
#if CIRCUITPY_SETTABLE_PROCESSOR_FREQUENCY
uint32_t value_of_freq = (uint32_t)mp_arg_validate_int_min(mp_obj_get_int(freq), 0, MP_QSTR_frequency);
common_hal_mcu_processor_set_frequency(self, value_of_freq);
#else
mp_raise_msg(&mp_type_NotImplementedError,translate("frequency is read-only for this board"));
#endif
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_2(mcu_processor_set_frequency_obj, mcu_processor_set_frequency);
STATIC mp_obj_t mcu_processor_get_frequency(mp_obj_t self) {
return mp_obj_new_int_from_uint(common_hal_mcu_processor_get_frequency());
}
@ -70,7 +91,7 @@ MP_DEFINE_CONST_FUN_OBJ_1(mcu_processor_get_frequency_obj, mcu_processor_get_fre
const mp_obj_property_t mcu_processor_frequency_obj = {
.base.type = &mp_type_property,
.proxy = {(mp_obj_t)&mcu_processor_get_frequency_obj, // getter
MP_ROM_NONE, // no setter
(mp_obj_t)&mcu_processor_set_frequency_obj, // setter
MP_ROM_NONE, // no deleter
},
};

View File

@ -39,5 +39,6 @@ mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void);
float common_hal_mcu_processor_get_temperature(void);
void common_hal_mcu_processor_get_uid(uint8_t raw_id[]);
float common_hal_mcu_processor_get_voltage(void);
uint32_t common_hal_mcu_processor_set_frequency(mcu_processor_obj_t *self, uint32_t frequency);
#endif // MICROPY_INCLUDED_SHARED_BINDINGS_MICROCONTROLLER_PROCESSOR_H

View File

@ -75,8 +75,13 @@ STATIC mp_obj_t random_getrandbits(mp_obj_t num_in) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(random_getrandbits_obj, random_getrandbits);
//| def randrange(stop: Tuple[int, int, int]) -> int:
//| """Returns a randomly selected integer from ``range(start, stop, step)``."""
//| @overload
//| def randrange(stop: int) -> int: ...
//| @overload
//| def randrange(start: int, stop: int) -> int: ...
//| @overload
//| def randrange(start: int, stop: int, step: int) -> int:
//| """Returns a randomly selected integer from ``range(start[, stop[, step]])``."""
//| ...
//|
STATIC mp_obj_t random_randrange(size_t n_args, const mp_obj_t *args) {

View File

@ -53,7 +53,7 @@
*/
STATIC bool mp3file_update_inbuf_always(audiomp3_mp3file_obj_t *self) {
// If we didn't previously reach the end of file, we can try reading now
if (!self->eof) {
if (!self->eof && self->inbuf_offset != 0) {
// Move the unconsumed portion of the buffer to the start
uint8_t *end_of_buffer = self->inbuf + self->inbuf_length;
@ -356,6 +356,11 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t *
return GET_BUFFER_DONE;
}
self->samples_decoded += *buffer_length / sizeof(int16_t);
mp3file_skip_id3v2(self);
int result = mp3file_find_sync_word(self) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE;
if (self->inbuf_offset >= 512) {
background_callback_add(
&self->inbuf_fill_cb,
@ -363,8 +368,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t *
self);
}
self->samples_decoded += *buffer_length / sizeof(int16_t);
return mp3file_find_sync_word(self) ? GET_BUFFER_MORE_DATA : GET_BUFFER_DONE;
return result;
}
void audiomp3_mp3file_get_buffer_structure(audiomp3_mp3file_obj_t *self, bool single_channel_output,

View File

@ -221,6 +221,15 @@ void common_hal_displayio_tilegrid_set_pixel_shader(displayio_tilegrid_t *self,
self->full_change = true;
}
mp_obj_t common_hal_displayio_tilegrid_get_bitmap(displayio_tilegrid_t *self) {
return self->bitmap;
}
void common_hal_displayio_tilegrid_set_bitmap(displayio_tilegrid_t *self, mp_obj_t bitmap) {
self->bitmap = bitmap;
self->full_change = true;
}
uint16_t common_hal_displayio_tilegrid_get_width(displayio_tilegrid_t *self) {
return self->width_in_tiles;
}

View File

@ -47,5 +47,4 @@ void reset_board(void);
// disabling USB, BLE or flash) because CircuitPython may continue to run.
void board_deinit(void);
#endif // MICROPY_INCLUDED_SUPERVISOR_BOARD_H

View File

@ -588,3 +588,6 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num,
}
return 0; // success
}
void MP_WEAK external_flash_setup(void) {
}

View File

@ -47,4 +47,9 @@
void supervisor_external_flash_flush(void);
// Configure anything that needs to get set up before the external flash
// is init'ed. For example, if GPIO needs to be configured to enable the
// flash chip, as is the case on some boards.
void external_flash_setup(void);
#endif // MICROPY_INCLUDED_SUPERVISOR_SHARED_EXTERNAL_FLASH_EXTERNAL_FLASH_H