merge from upstream

This commit is contained in:
Dan Halbert 2020-08-30 14:39:03 -04:00
commit 6dbd369272
133 changed files with 1753 additions and 547 deletions

View File

@ -408,8 +408,11 @@ jobs:
fail-fast: false
matrix:
board:
- "electroniccats_bastwifi"
- "espressif_kaluga_1"
- "espressif_saola_1_wroom"
- "espressif_saola_1_wrover"
- "microdev_micro_s2"
- "unexpectedmaker_feathers2"
steps:

View File

@ -42,6 +42,9 @@ master_doc = 'docs/index'
# Grab the JSON values to use while building the module support matrix
# in 'shared-bindings/index.rst'
# The stubs must be built before we calculate the shared bindings matrix
subprocess.check_output(["make", "stubs"])
#modules_support_matrix = shared_bindings_matrix.support_matrix_excluded_boards()
modules_support_matrix = shared_bindings_matrix.support_matrix_by_board()
@ -77,7 +80,6 @@ source_suffix = {
'.md': 'markdown',
}
subprocess.check_output(["make", "stubs"])
extensions.append('autoapi.extension')
autoapi_type = 'python'

View File

@ -51,10 +51,15 @@ as a natural "TODO" list. An example minimal build list is shown below:
.. code-block:: makefile
# These modules are implemented in ports/<port>/common-hal:
CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create
CIRCUITPY_DIGITALIO = 0 # Typically the second module to create
# Typically the first module to create
CIRCUITPY_MICROCONTROLLER = 0
# Typically the second module to create
CIRCUITPY_DIGITALIO = 0
# Other modules:
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_BUSIO = 0
CIRCUITPY_COUNTIO = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_OS = 0
@ -63,22 +68,34 @@ as a natural "TODO" list. An example minimal build list is shown below:
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_SDCARDIO = 0
CIRCUITPY_FRAMEBUFFERIO = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok)
# Requires SPI, PulseIO (stub ok):
CIRCUITPY_DISPLAYIO = 0
# These modules are implemented in shared-module/ - they can be included in
# any port once their prerequisites in common-hal are complete.
CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO
CIRCUITPY_GAMEPAD = 0 # Requires DigitalIO
CIRCUITPY_PIXELBUF = 0 # Requires neopixel_write or SPI (dotstar)
CIRCUITPY_RANDOM = 0 # Requires OS
CIRCUITPY_STORAGE = 0 # Requires OS, filesystem
CIRCUITPY_TOUCHIO = 0 # Requires Microcontroller
CIRCUITPY_USB_HID = 0 # Requires USB
CIRCUITPY_USB_MIDI = 0 # Requires USB
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 # Does nothing without I2C
CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash
# Requires DigitalIO:
CIRCUITPY_BITBANGIO = 0
# Requires DigitalIO
CIRCUITPY_GAMEPAD = 0
# Requires neopixel_write or SPI (dotstar)
CIRCUITPY_PIXELBUF = 0
# Requires OS
CIRCUITPY_RANDOM = 0
# Requires OS, filesystem
CIRCUITPY_STORAGE = 0
# Requires Microcontroller
CIRCUITPY_TOUCHIO = 0
# Requires USB
CIRCUITPY_USB_HID = 0
CIRCUITPY_USB_MIDI = 0
# Does nothing without I2C
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0
# No requirements, but takes extra flash
CIRCUITPY_ULAB = 0
Step 2: Init
--------------

View File

@ -28,6 +28,7 @@ import re
import subprocess
import sys
from concurrent.futures import ThreadPoolExecutor
SUPPORTED_PORTS = ['atmel-samd', 'esp32s2', 'litex', 'mimxrt10xx', 'nrf', 'stm']
@ -42,7 +43,7 @@ def get_circuitpython_root_dir():
def get_shared_bindings():
""" Get a list of modules in shared-bindings based on folder names
"""
shared_bindings_dir = get_circuitpython_root_dir() / "shared-bindings"
shared_bindings_dir = get_circuitpython_root_dir() / "circuitpython-stubs"
return [item.name for item in shared_bindings_dir.iterdir()]
@ -131,38 +132,44 @@ def lookup_setting(settings, key, default=''):
key = value[2:-1]
return value
def all_ports_all_boards(ports=SUPPORTED_PORTS):
for port in ports:
port_dir = get_circuitpython_root_dir() / "ports" / port
for entry in (port_dir / "boards").iterdir():
if not entry.is_dir():
continue
yield (port, entry)
def support_matrix_by_board(use_branded_name=True):
""" Compiles a list of the available core modules available for each
board.
"""
base = build_module_map()
boards = dict()
for port in SUPPORTED_PORTS:
def support_matrix(arg):
port, entry = arg
port_dir = get_circuitpython_root_dir() / "ports" / port
for entry in (port_dir / "boards").iterdir():
if not entry.is_dir():
continue
board_modules = []
board_name = entry.name
settings = get_settings_from_makefile(str(port_dir), entry.name)
settings = get_settings_from_makefile(str(port_dir), entry.name)
if use_branded_name:
with open(entry / "mpconfigboard.h") as get_name:
board_contents = get_name.read()
board_name_re = re.search(r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)",
board_contents)
if board_name_re:
board_name = board_name_re.group(1).strip('"')
if use_branded_name:
with open(entry / "mpconfigboard.h") as get_name:
board_contents = get_name.read()
board_name_re = re.search(r"(?<=MICROPY_HW_BOARD_NAME)\s+(.+)",
board_contents)
if board_name_re:
board_name = board_name_re.group(1).strip('"')
board_modules = []
for module in base:
key = f'CIRCUITPY_{module.upper()}'
if int(lookup_setting(settings, key, '0')):
board_modules.append(base[module]['name'])
board_modules = []
for module in base:
key = f'CIRCUITPY_{module.upper()}'
if int(lookup_setting(settings, key, '0')):
board_modules.append(base[module]['name'])
boards[board_name] = sorted(board_modules)
return (board_name, sorted(board_modules))
executor = ThreadPoolExecutor(max_workers=os.cpu_count())
boards = dict(sorted(executor.map(support_matrix, all_ports_all_boards())))
#print(json.dumps(boards, indent=2))
return boards

View File

@ -113,6 +113,8 @@ STATIC int parse_compile_execute(const void *source, mp_parse_input_kind_t input
start = mp_hal_ticks_ms();
mp_call_function_0(module_fun);
mp_hal_set_interrupt_char(-1); // disable interrupt
// Handle any ctrl-c interrupt that arrived just in time
mp_handle_pending();
nlr_pop();
ret = 0;
if (exec_flags & EXEC_FLAG_PRINT_EOF) {

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2020-07-06 18:10+0000\n"
"Last-Translator: oon arfiandwi <oon.arfiandwi@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -764,7 +764,7 @@ msgstr "Error pada regex"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Diharapkan %q"
@ -1352,6 +1352,15 @@ msgstr "Tambahkan module apapun pada filesystem\n"
msgid "Polygon needs at least 3 points"
msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr ""
@ -1366,6 +1375,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr ""
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-30 14:34-0400\n"
"POT-Creation-Date: 2020-08-30 14:38-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -302,7 +302,7 @@ msgstr ""
msgid "All sync event channels in use"
msgstr ""
#: shared-bindings/pulseio/PWMOut.c
#: shared-bindings/pwmio/PWMOut.c
msgid "All timers for this pin are in use"
msgstr ""
@ -314,7 +314,7 @@ msgstr ""
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/audiopwmio/PWMAudioOut.c
#: ports/nrf/common-hal/pulseio/PulseIn.c ports/nrf/peripherals/nrf/timers.c
#: ports/stm/peripherals/timers.c shared-bindings/pulseio/PWMOut.c
#: ports/stm/peripherals/timers.c shared-bindings/pwmio/PWMOut.c
msgid "All timers in use"
msgstr ""
@ -556,7 +556,7 @@ msgstr ""
msgid "Cannot unambiguously get sizeof scalar"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Cannot vary frequency on a timer that is already in use"
msgstr ""
@ -625,23 +625,23 @@ msgstr ""
msgid "Could not initialize UART"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Could not initialize channel"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Could not initialize timer"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Could not re-init channel"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Could not re-init timer"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Could not restart PWM"
msgstr ""
@ -649,7 +649,7 @@ msgstr ""
msgid "Could not set address"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Could not start PWM"
msgstr ""
@ -848,7 +848,7 @@ msgstr ""
msgid "Frequency captured is above capability. Capture Paused."
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Frequency must match existing PWMOut using this timer"
msgstr ""
@ -950,9 +950,9 @@ msgstr ""
msgid "Invalid DAC pin supplied"
msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PWMOut.c
#: ports/cxd56/common-hal/pulseio/PWMOut.c
#: ports/nrf/common-hal/pulseio/PWMOut.c shared-bindings/pulseio/PWMOut.c
#: ports/atmel-samd/common-hal/pwmio/PWMOut.c
#: ports/cxd56/common-hal/pwmio/PWMOut.c ports/nrf/common-hal/pwmio/PWMOut.c
#: shared-bindings/pwmio/PWMOut.c
msgid "Invalid PWM frequency"
msgstr ""
@ -992,7 +992,7 @@ msgstr ""
msgid "Invalid format chunk size"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Invalid frequency supplied"
msgstr ""
@ -1010,8 +1010,8 @@ msgid "Invalid phase"
msgstr ""
#: ports/atmel-samd/common-hal/audioio/AudioOut.c
#: ports/atmel-samd/common-hal/touchio/TouchIn.c
#: shared-bindings/pulseio/PWMOut.c shared-module/rgbmatrix/RGBMatrix.c
#: ports/atmel-samd/common-hal/touchio/TouchIn.c shared-bindings/pwmio/PWMOut.c
#: shared-module/rgbmatrix/RGBMatrix.c
msgid "Invalid pin"
msgstr ""
@ -1035,7 +1035,7 @@ msgstr ""
msgid "Invalid pins"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "Invalid pins for PWMOut"
msgstr ""
@ -1217,7 +1217,7 @@ msgstr ""
msgid "No long integer support"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid "No more timers available on this pin."
msgstr ""
@ -1289,12 +1289,12 @@ msgstr ""
msgid "Oversample must be multiple of 8."
msgstr ""
#: shared-bindings/pulseio/PWMOut.c
#: shared-bindings/pwmio/PWMOut.c
msgid ""
"PWM duty_cycle must be between 0 and 65535 inclusive (16 bit resolution)"
msgstr ""
#: shared-bindings/pulseio/PWMOut.c
#: shared-bindings/pwmio/PWMOut.c
msgid ""
"PWM frequency not writable when variable_frequency is False on construction."
msgstr ""
@ -1349,8 +1349,8 @@ msgstr ""
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
"Port does not accept pins or frequency. Construct and pass a PWMOut Carrier "
"instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
@ -1576,7 +1576,7 @@ msgstr ""
msgid "Timeout is too long: Maximum timeout length is %d seconds"
msgstr ""
#: ports/stm/common-hal/pulseio/PWMOut.c
#: ports/stm/common-hal/pwmio/PWMOut.c
msgid ""
"Timer was reserved for internal use - declare PWM pins earlier in the program"
msgstr ""
@ -2899,6 +2899,14 @@ msgstr ""
msgid "ord() expected a character, but string of length %d found"
msgstr ""
#: shared-bindings/displayio/Bitmap.c
msgid "out of range of source"
msgstr ""
#: shared-bindings/displayio/Bitmap.c
msgid "out of range of target"
msgstr ""
#: py/objint_mpz.c
msgid "overflow converting long int to machine word"
msgstr ""
@ -3076,6 +3084,10 @@ msgstr ""
msgid "sosfilt requires iterable arguments"
msgstr ""
#: shared-bindings/displayio/Bitmap.c
msgid "source palette too large"
msgstr ""
#: py/objstr.c
msgid "start/end indices"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2020-05-24 03:22+0000\n"
"Last-Translator: dronecz <mzuzelka@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -750,7 +750,7 @@ msgstr ""
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr ""
@ -1334,6 +1334,15 @@ msgstr ""
msgid "Polygon needs at least 3 points"
msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr ""
@ -1346,6 +1355,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr ""
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2020-06-16 18:24+0000\n"
"Last-Translator: Andreas Buchen <andreas.buchen@gmail.com>\n"
"Language: de_DE\n"
@ -760,7 +760,7 @@ msgstr "Fehler in regex"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Erwartet ein(e) %q"
@ -1362,6 +1362,15 @@ msgstr "und alle Module im Dateisystem \n"
msgid "Polygon needs at least 3 points"
msgstr "Polygone brauchen mindestens 3 Punkte"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr "Der Präfixbuffer muss sich auf dem Heap befinden"
@ -1376,6 +1385,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr "Pull wird nicht verwendet, wenn die Richtung output ist."
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr "PulseOut wird auf diesem Chip nicht unterstützt"
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "RNG DeInit-Fehler"
@ -3553,9 +3566,6 @@ msgstr ""
#~ msgid "'async for' or 'async with' outside async function"
#~ msgstr "'async for' oder 'async with' außerhalb der asynchronen Funktion"
#~ msgid "PulseOut not supported on this chip"
#~ msgstr "PulseOut wird auf diesem Chip nicht unterstützt"
#~ msgid "PulseIn not supported on this chip"
#~ msgstr "PulseIn wird auf diesem Chip nicht unterstützt"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2020-08-17 21:11+0000\n"
"Last-Translator: Alvaro Figueroa <alvaro@greencore.co.cr>\n"
"Language-Team: \n"
@ -765,7 +765,7 @@ msgstr "Error en regex"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Se espera un %q"
@ -1362,6 +1362,15 @@ msgstr "Además de cualquier módulo en el sistema de archivos\n"
msgid "Polygon needs at least 3 points"
msgstr "El polígono necesita al menos 3 puntos"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr "El búfer de prefijo debe estar en el montículo"
@ -1375,6 +1384,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr "Pull no se usa cuando la dirección es output."
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr "PulseOut no es compatible con este chip"
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "Error de desinicializado del RNG"
@ -3539,9 +3552,6 @@ msgstr "zi debe ser una forma (n_section,2)"
#~ msgid "'async for' or 'async with' outside async function"
#~ msgstr "'async for' o 'async with' fuera de la función async"
#~ msgid "PulseOut not supported on this chip"
#~ msgstr "PulseOut no es compatible con este chip"
#~ msgid "PulseIn not supported on this chip"
#~ msgstr "PulseIn no es compatible con este chip"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2018-12-20 22:15-0800\n"
"Last-Translator: Timothy <me@timothygarcia.ca>\n"
"Language-Team: fil\n"
@ -754,7 +754,7 @@ msgstr "May pagkakamali sa REGEX"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Umasa ng %q"
@ -1346,6 +1346,15 @@ msgstr "Kasama ang kung ano pang modules na sa filesystem\n"
msgid "Polygon needs at least 3 points"
msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr ""
@ -1360,6 +1369,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr "Pull hindi ginagamit kapag ang direksyon ay output."
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2020-07-27 21:27+0000\n"
"Last-Translator: Nathan <bonnemainsnathan@gmail.com>\n"
"Language: fr\n"
@ -768,7 +768,7 @@ msgstr "Erreur dans l'expression régulière"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Attendu un %q"
@ -1369,6 +1369,15 @@ msgstr "Ainsi que tout autre module présent sur le système de fichiers\n"
msgid "Polygon needs at least 3 points"
msgstr "Polygone a besoin dau moins 3 points"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr "Le tampon de préfixe doit être sur le tas"
@ -1381,6 +1390,10 @@ msgstr "Appuyez sur une touche pour entrer sur REPL ou CTRL-D pour recharger."
msgid "Pull not used when direction is output."
msgstr "Le tirage 'pull' n'est pas utilisé quand la direction est 'output'."
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr "PulseOut non pris en charge sur cette puce"
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "Erreur RNG DeInit"
@ -3557,9 +3570,6 @@ msgstr ""
#~ msgid "'async for' or 'async with' outside async function"
#~ msgstr "'async for' ou 'async with' sans fonction asynchrone extérieure"
#~ msgid "PulseOut not supported on this chip"
#~ msgstr "PulseOut non pris en charge sur cette puce"
#~ msgid "PulseIn not supported on this chip"
#~ msgstr "PulseIn non pris en charge sur cette puce"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
@ -743,7 +743,7 @@ msgstr ""
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr ""
@ -1327,6 +1327,15 @@ msgstr ""
msgid "Polygon needs at least 3 points"
msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr ""
@ -1339,6 +1348,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr ""
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2018-10-02 16:27+0200\n"
"Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n"
"Language-Team: \n"
@ -754,7 +754,7 @@ msgstr "Errore nella regex"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Atteso un %q"
@ -1356,6 +1356,15 @@ msgstr "Imposssibile rimontare il filesystem"
msgid "Polygon needs at least 3 points"
msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr ""
@ -1369,6 +1378,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr ""
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2020-08-16 13:25+0000\n"
"Last-Translator: Taku Fukada <naninunenor@gmail.com>\n"
"Language-Team: none\n"
@ -759,7 +759,7 @@ msgstr "正規表現にエラーがあります"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr ""
@ -1348,6 +1348,15 @@ msgstr ""
msgid "Polygon needs at least 3 points"
msgstr "ポリゴンには少なくとも3つの点が必要"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr "Prefixバッファはヒープ上になければなりません"
@ -1361,6 +1370,10 @@ msgstr "何らかのキーを押すとREPLに入ります。CTRL-Dでリロー
msgid "Pull not used when direction is output."
msgstr "方向がoutputのときpullは使われません"
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "乱数生成器の解体エラー"

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2019-05-06 14:22-0700\n"
"Last-Translator: \n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -746,7 +746,7 @@ msgstr "Regex에 오류가 있습니다."
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "%q 이 예상되었습니다."
@ -1330,6 +1330,15 @@ msgstr ""
msgid "Polygon needs at least 3 points"
msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr ""
@ -1342,6 +1351,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr ""
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2020-08-10 19:59+0000\n"
"Last-Translator: _fonzlate <vooralfred@gmail.com>\n"
"Language-Team: none\n"
@ -762,7 +762,7 @@ msgstr "Fout in regex"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Verwacht een %q"
@ -1364,6 +1364,15 @@ msgstr "En iedere module in het bestandssysteem\n"
msgid "Polygon needs at least 3 points"
msgstr "Polygon heeft op zijn minst 3 punten nodig"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr "Prefix buffer moet op de heap zijn"
@ -1378,6 +1387,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr "Pull niet gebruikt wanneer de richting output is."
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr "PulseOut niet ondersteund door deze chip"
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "RNG DeInit Fout"
@ -3531,9 +3544,6 @@ msgstr "zi moet vorm (n_section, 2) hebben"
#~ msgid "PulseIn not supported on this chip"
#~ msgstr "PusleIn niet ondersteund door deze chip"
#~ msgid "PulseOut not supported on this chip"
#~ msgstr "PulseOut niet ondersteund door deze chip"
#~ msgid "I2C operation not supported"
#~ msgstr "I2C actie niet ondersteund"

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2019-03-19 18:37-0700\n"
"Last-Translator: Radomir Dopieralski <circuitpython@sheep.art.pl>\n"
"Language-Team: pl\n"
@ -746,7 +746,7 @@ msgstr "Błąd w regex"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Oczekiwano %q"
@ -1332,6 +1332,15 @@ msgstr "Oraz moduły w systemie plików\n"
msgid "Polygon needs at least 3 points"
msgstr ""
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr ""
@ -1344,6 +1353,10 @@ msgstr "Dowolny klawisz aby uruchomić konsolę. CTRL-D aby przeładować."
msgid "Pull not used when direction is output."
msgstr "Podciągnięcie nieużywane w trybie wyjścia."
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr ""

View File

@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"PO-Revision-Date: 2020-08-16 02:25+0000\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2020-08-21 18:19+0000\n"
"Last-Translator: Wellington Terumi Uemura <wellingtonuemura@gmail.com>\n"
"Language-Team: \n"
"Language: pt_BR\n"
@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.2-dev\n"
"X-Generator: Weblate 4.2.1-dev\n"
#: main.c
msgid ""
@ -767,7 +767,7 @@ msgstr "Erro no regex"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Esperado um"
@ -1367,6 +1367,17 @@ msgstr "Além de quaisquer módulos no sistema de arquivos\n"
msgid "Polygon needs at least 3 points"
msgstr "O Polígono precisa de pelo menos 3 pontos"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
"A porta não aceita pinos ou frequência. "
"Em vez disso, Construa e encaminhe um PWMOut Carrier"
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr ""
@ -1382,6 +1393,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr "O Pull não foi usado quando a direção for gerada."
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr "O PulseOut não é compatível neste CI"
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "Erro DeInit RNG"
@ -3552,9 +3567,6 @@ msgstr "zi deve estar na forma (n_section, 2)"
#~ msgid "'async for' or 'async with' outside async function"
#~ msgstr "'assíncrono para' ou 'assíncrono com' função assíncrona externa"
#~ msgid "PulseOut not supported on this chip"
#~ msgstr "O PulseOut não é compatível neste CI"
#~ msgid "PulseIn not supported on this chip"
#~ msgstr "O PulseIn não é compatível neste CI"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2020-07-25 20:58+0000\n"
"Last-Translator: Jonny Bergdahl <jonny@bergdahl.it>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -758,7 +758,7 @@ msgstr "Fel i regex"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Förväntade %q"
@ -1355,6 +1355,15 @@ msgstr "Plus eventuella moduler i filsystemet\n"
msgid "Polygon needs at least 3 points"
msgstr "Polygonen behöver minst 3 punkter"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr "Prefixbufferten måste finnas på heap"
@ -1368,6 +1377,10 @@ msgstr ""
msgid "Pull not used when direction is output."
msgstr "Pull används inte när riktningen är output."
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr "PulseIn stöds inte av detta chip"
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "RNG DeInit-fel"
@ -3519,9 +3532,6 @@ msgstr "zi måste vara i formen (n_section, 2)"
#~ msgid "'async for' or 'async with' outside async function"
#~ msgstr "'async for' eller 'async with' utanför async-funktion"
#~ msgid "PulseOut not supported on this chip"
#~ msgstr "PulseIn stöds inte av detta chip"
#~ msgid "PulseIn not supported on this chip"
#~ msgstr "PulseIn stöds inte av detta chip"

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: circuitpython-cn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-14 09:36-0400\n"
"POT-Creation-Date: 2020-08-18 11:19-0400\n"
"PO-Revision-Date: 2019-04-13 10:10-0700\n"
"Last-Translator: hexthat\n"
"Language-Team: Chinese Hanyu Pinyin\n"
@ -755,7 +755,7 @@ msgstr "Zhèngzé biǎodá shì cuòwù"
#: shared-bindings/aesio/aes.c shared-bindings/busio/SPI.c
#: shared-bindings/microcontroller/Pin.c
#: shared-bindings/neopixel_write/__init__.c shared-bindings/pulseio/PulseOut.c
#: shared-bindings/neopixel_write/__init__.c
#: shared-bindings/terminalio/Terminal.c
msgid "Expected a %q"
msgstr "Yùqí %q"
@ -1350,6 +1350,15 @@ msgstr "Zài wénjiàn xìtǒng shàng tiānjiā rènhé mókuài\n"
msgid "Polygon needs at least 3 points"
msgstr "Duōbiānxíng zhìshǎo xūyào 3 diǎn"
#: ports/atmel-samd/common-hal/pulseio/PulseOut.c
#: ports/cxd56/common-hal/pulseio/PulseOut.c
#: ports/nrf/common-hal/pulseio/PulseOut.c
#: ports/stm/common-hal/pulseio/PulseOut.c
msgid ""
"Port does not accept pins or frequency. "
"Construct and pass a PWMOut Carrier instead"
msgstr ""
#: shared-bindings/_bleio/Adapter.c
msgid "Prefix buffer must be on the heap"
msgstr "Qiánzhuì huǎnchōng qū bìxū zài duī shàng"
@ -1362,6 +1371,10 @@ msgstr "Àn xià rènhé jiàn jìnrù REPL. Shǐyòng CTRL-D chóngxīn jiāzà
msgid "Pull not used when direction is output."
msgstr "Fāngxiàng shūchū shí Pull méiyǒu shǐyòng."
#: ports/stm/ref/pulseout-pre-timeralloc.c
msgid "PulseOut not supported on this chip"
msgstr ""
#: ports/stm/common-hal/os/__init__.c
msgid "RNG DeInit Error"
msgstr "RNG qǔxiāo chūshǐhuà cuòwù"

5
main.c
View File

@ -444,11 +444,12 @@ int run_repl(void) {
}
int __attribute__((used)) main(void) {
memory_init();
// initialise the cpu and peripherals
safe_mode_t safe_mode = port_init();
// Init memory after the port in case the port needs to set aside memory.
memory_init();
// Turn on LEDs
init_status_leds();
rgb_led_status_init();

View File

@ -39,5 +39,7 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PA03) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA03) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -32,7 +32,7 @@
#include "shared-bindings/nvm/ByteArray.h"
#include "common-hal/microcontroller/Pin.h"
#include "hal/include/hal_gpio.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
nvm_bytearray_obj_t bootcnt = {
.base = {
@ -44,9 +44,9 @@ nvm_bytearray_obj_t bootcnt = {
void board_init(void) {
pulseio_pwmout_obj_t pwm;
common_hal_pulseio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false);
common_hal_pulseio_pwmout_never_reset(&pwm);
pwmio_pwmout_obj_t pwm;
common_hal_pwmio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false);
common_hal_pwmio_pwmout_never_reset(&pwm);
}
bool board_requests_safe_mode(void) {

View File

@ -32,7 +32,7 @@
#include "shared-bindings/nvm/ByteArray.h"
#include "common-hal/microcontroller/Pin.h"
#include "hal/include/hal_gpio.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
nvm_bytearray_obj_t bootcnt = {
.base = {
@ -44,9 +44,9 @@ nvm_bytearray_obj_t bootcnt = {
void board_init(void) {
pulseio_pwmout_obj_t pwm;
common_hal_pulseio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false);
common_hal_pulseio_pwmout_never_reset(&pwm);
pwmio_pwmout_obj_t pwm;
common_hal_pwmio_pwmout_construct(&pwm, &pin_PA23, 4096, 2, false);
common_hal_pwmio_pwmout_never_reset(&pwm);
}
bool board_requests_safe_mode(void) {

View File

@ -96,13 +96,12 @@ void pulseout_reset() {
}
void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
const pulseio_pwmout_obj_t* carrier,
const pwmio_pwmout_obj_t* carrier,
const mcu_pin_obj_t* pin,
uint32_t frequency,
uint16_t duty_cycle) {
if (!carrier || pin || frequency) {
mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \
Construct and pass a PWMOut Carrier instead"));
mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead"));
}
if (refcount == 0) {

View File

@ -28,8 +28,8 @@
#include <stdint.h>
#include "py/runtime.h"
#include "common-hal/pulseio/PWMOut.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "shared-bindings/microcontroller/Processor.h"
#include "timer_handler.h"
@ -78,13 +78,13 @@ void timer_reset_ok(int index, bool is_tc) {
}
void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) {
timer_never_reset(self->timer->index, self->timer->is_tc);
never_reset_pin_number(self->pin->number);
}
void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) {
timer_reset_ok(self->timer->index, self->timer->is_tc);
}
@ -137,7 +137,7 @@ bool channel_ok(const pin_timer_t* t) {
t->is_tc;
}
pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
const mcu_pin_obj_t* pin,
uint16_t duty,
uint32_t frequency,
@ -296,16 +296,16 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
gpio_set_pin_function(pin->number, GPIO_PIN_FUNCTION_E + mux_position);
common_hal_pulseio_pwmout_set_duty_cycle(self, duty);
common_hal_pwmio_pwmout_set_duty_cycle(self, duty);
return PWMOUT_OK;
}
bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) {
bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self) {
return self->pin == NULL;
}
void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
if (common_hal_pulseio_pwmout_deinited(self)) {
void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) {
if (common_hal_pwmio_pwmout_deinited(self)) {
return;
}
const pin_timer_t* t = self->timer;
@ -331,7 +331,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
self->pin = NULL;
}
extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) {
extern void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) {
// Store the unadjusted duty cycle. It turns out the the process of adjusting and calculating
// the duty cycle here and reading it back is lossy - the value will decay over time.
// Track it here so that if frequency is changed we can use this value to recalculate the
@ -373,7 +373,7 @@ extern void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self,
}
}
uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) {
uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) {
const pin_timer_t* t = self->timer;
if (t->is_tc) {
Tc* tc = tc_insts[t->index];
@ -411,7 +411,7 @@ uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) {
}
void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self,
void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self,
uint32_t frequency) {
if (frequency == 0 || frequency > 6000000) {
mp_raise_ValueError(translate("Invalid PWM frequency"));
@ -466,10 +466,10 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self,
#endif
}
common_hal_pulseio_pwmout_set_duty_cycle(self, self->duty_cycle);
common_hal_pwmio_pwmout_set_duty_cycle(self, self->duty_cycle);
}
uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {
uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self) {
uint32_t system_clock = common_hal_mcu_processor_get_frequency();
const pin_timer_t* t = self->timer;
uint8_t divisor;
@ -484,6 +484,6 @@ uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {
return (system_clock / prescaler[divisor]) / (top + 1);
}
bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) {
bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self) {
return self->variable_frequency;
}

View File

@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PWMOUT_H
#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PWMOUT_H
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PWMIO_PWMOUT_H
#define MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PWMIO_PWMOUT_H
#include "common-hal/microcontroller/Pin.h"
@ -37,8 +37,8 @@ typedef struct {
const pin_timer_t* timer;
bool variable_frequency;
uint16_t duty_cycle;
} pulseio_pwmout_obj_t;
} pwmio_pwmout_obj_t;
void pwmout_reset(void);
#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PULSEIO_PWMOUT_H
#endif // MICROPY_INCLUDED_ATMEL_SAMD_COMMON_HAL_PWMIO_PWMOUT_H

View File

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

View File

@ -59,7 +59,7 @@
#include "common-hal/microcontroller/Pin.h"
#include "common-hal/pulseio/PulseIn.h"
#include "common-hal/pulseio/PulseOut.h"
#include "common-hal/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "common-hal/ps2io/Ps2.h"
#include "common-hal/rtc/RTC.h"
@ -335,6 +335,8 @@ void reset_port(void) {
#if CIRCUITPY_PULSEIO
pulsein_reset();
pulseout_reset();
#endif
#if CIRCUITPY_PWMIO
pwmout_reset();
#endif

View File

@ -35,6 +35,6 @@ typedef struct {
mp_obj_base_t base;
} mcu_processor_obj_t;
const mp_obj_type_t mcu_processor_type;
extern const mp_obj_type_t mcu_processor_type;
#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_MICROCONTROLLER_PROCESSOR_H

View File

@ -59,13 +59,12 @@ static bool pulseout_timer_handler(unsigned int *next_interval_us, void *arg)
}
void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
const pulseio_pwmout_obj_t* carrier,
const pwmio_pwmout_obj_t* carrier,
const mcu_pin_obj_t* pin,
uint32_t frequency,
uint16_t duty_cycle) {
if (!carrier || pin || frequency) {
mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \
Construct and pass a PWMOut Carrier instead"));
mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead"));
}
if (pulse_fd < 0) {

View File

@ -30,7 +30,7 @@
#include "py/runtime.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
typedef struct {
const char* devpath;
@ -46,7 +46,7 @@ STATIC pwmout_dev_t pwmout_dev[] = {
{"/dev/pwm3", &pin_PWM3, -1, true}
};
pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self,
pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self,
const mcu_pin_obj_t *pin, uint16_t duty, uint32_t frequency,
bool variable_frequency) {
self->number = -1;
@ -85,8 +85,8 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self,
return PWMOUT_OK;
}
void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t *self) {
if (common_hal_pulseio_pwmout_deinited(self)) {
void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t *self) {
if (common_hal_pwmio_pwmout_deinited(self)) {
return;
}
@ -98,21 +98,21 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t *self) {
self->pin = NULL;
}
bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t *self) {
bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t *self) {
return pwmout_dev[self->number].fd < 0;
}
void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t *self, uint16_t duty) {
void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uint16_t duty) {
self->info.duty = duty;
ioctl(pwmout_dev[self->number].fd, PWMIOC_SETCHARACTERISTICS, (unsigned long)((uintptr_t)&self->info));
}
uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t *self) {
uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t *self) {
return self->info.duty;
}
void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t *self, uint32_t frequency) {
void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t *self, uint32_t frequency) {
self->info.frequency = frequency;
if (ioctl(pwmout_dev[self->number].fd, PWMIOC_SETCHARACTERISTICS, (unsigned long)((uintptr_t)&self->info)) < 0) {
@ -120,21 +120,21 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t *self, uint32_
}
}
uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t *self) {
uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t *self) {
return self->info.frequency;
}
bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t *self) {
bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t *self) {
return self->variable_frequency;
}
void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) {
never_reset_pin_number(self->pin->number);
pwmout_dev[self->number].reset = false;
}
void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) {
pwmout_dev[self->number].reset = true;
}

View File

@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_PULSEIO_PWMOUT_H
#define MICROPY_INCLUDED_CXD56_COMMON_HAL_PULSEIO_PWMOUT_H
#ifndef MICROPY_INCLUDED_CXD56_COMMON_HAL_PWMIO_PWMOUT_H
#define MICROPY_INCLUDED_CXD56_COMMON_HAL_PWMIO_PWMOUT_H
#include <nuttx/timers/pwm.h>
@ -39,10 +39,10 @@ typedef struct {
struct pwm_info_s info;
bool variable_frequency;
int8_t number;
} pulseio_pwmout_obj_t;
} pwmio_pwmout_obj_t;
void pwmout_reset(void);
void pwmout_start(uint8_t pwm_num);
void pwmout_stop(uint8_t pwm_num);
#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_PULSEIO_PWMOUT_H
#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_PWMIO_PWMOUT_H

View File

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

View File

@ -43,7 +43,7 @@
#include "common-hal/microcontroller/Pin.h"
#include "common-hal/analogio/AnalogIn.h"
#include "common-hal/pulseio/PulseOut.h"
#include "common-hal/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "common-hal/busio/UART.h"
safe_mode_t port_init(void) {
@ -69,6 +69,8 @@ void reset_port(void) {
#endif
#if CIRCUITPY_PULSEIO
pulseout_reset();
#endif
#if CIRCUITPY_PWMIO
pwmout_reset();
#endif
#if CIRCUITPY_BUSIO

View File

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

View File

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

View File

@ -0,0 +1,19 @@
USB_VID = 0x1209
USB_PID = 0xBAB0
USB_PRODUCT = "Bast WiFi"
USB_MANUFACTURER = "ElectronicCats"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
# The default queue depth of 16 overflows on release builds,
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover

View File

@ -0,0 +1,64 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) },
{ MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },
{ MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO37) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) },
{ MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) },
{ MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) },
{ MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) },
{ MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) },
{ MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) },
{ MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) },
{ MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

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

View File

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

View File

@ -0,0 +1,17 @@
USB_VID = 0x239A
USB_PID = 0x80C8
USB_PRODUCT = "Kaluga 1"
USB_MANUFACTURER = "Espressif"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
# The default queue depth of 16 overflows on release builds,
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=dio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=4MB
CIRCUITPY_MODULE=wrover

View File

@ -0,0 +1,125 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) },
{ MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },
{ MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) },
{ MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) },
{ MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) },
{ MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) },
{ MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) },
{ MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) },
{ MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) },
{ MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) },
{ MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_XCLK), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_PCLK), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_HREF), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_VSYNC), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_SIOD), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_SIOC), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_D2), MP_ROM_PTR(&pin_GPIO46) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_D3), MP_ROM_PTR(&pin_GPIO45) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_D4), MP_ROM_PTR(&pin_GPIO41) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_D5), MP_ROM_PTR(&pin_GPIO42) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_D6), MP_ROM_PTR(&pin_GPIO39) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_D7), MP_ROM_PTR(&pin_GPIO40) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_D8), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_CAMERA_D9), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_TOUCH14), MP_ROM_PTR(&pin_GPIO14) },
// LED FPC
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_BT_ARRAY_ADC), MP_ROM_PTR(&pin_GPIO6) },
// 3.2 inch LCD FPC
{ MP_ROM_QSTR(MP_QSTR_LCD_TP_MISO), MP_ROM_PTR(&pin_GPIO42) },
{ MP_ROM_QSTR(MP_QSTR_LCD_TP_MOSI), MP_ROM_PTR(&pin_GPIO40) },
{ MP_ROM_QSTR(MP_QSTR_LCD_TP_SCK), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_LCD_TP_CS), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_LCD_TP_IRQ), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_LCD_TP_BUSY), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_LCD_BL_CTR), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_LCD_MISO), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_LCD_MOSI), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_LCD_CS), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_LCD_D_C), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_LCD_CLK), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_LCD_RST), MP_ROM_PTR(&pin_GPIO16) },
// Audio
{ MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_MISO), MP_ROM_PTR(&pin_GPIO42) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_MOSI), MP_ROM_PTR(&pin_GPIO40) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_SCK), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_SPI_CS), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_BT_ADC), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_SCL), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_SDA), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_MCLK), MP_ROM_PTR(&pin_GPIO41) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_BCLK), MP_ROM_PTR(&pin_GPIO39) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_LRCK), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_SDI), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_I2S0_SDO), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_RST), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_WAKE_INT), MP_ROM_PTR(&pin_GPIO34) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_MCLK), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_PA_CTRL), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_SDI), MP_ROM_PTR(&pin_GPIO46) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_SDO), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_LRCK_DAC1), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_AUDIO_I2S1_BCLK_DAC2), MP_ROM_PTR(&pin_GPIO18) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -0,0 +1,33 @@
CONFIG_ESP32S2_SPIRAM_SUPPORT=y
#
# SPI RAM config
#
# CONFIG_SPIRAM_TYPE_AUTO is not set
CONFIG_SPIRAM_TYPE_ESPPSRAM16=y
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
CONFIG_SPIRAM_SIZE=2097152
#
# PSRAM clock and cs IO for ESP32S2
#
CONFIG_DEFAULT_PSRAM_CLK_IO=30
CONFIG_DEFAULT_PSRAM_CS_IO=26
# end of PSRAM clock and cs IO for ESP32S2
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
# CONFIG_SPIRAM_RODATA is not set
# CONFIG_SPIRAM_SPEED_80M is not set
CONFIG_SPIRAM_SPEED_40M=y
# CONFIG_SPIRAM_SPEED_26M is not set
# CONFIG_SPIRAM_SPEED_20M is not set
CONFIG_SPIRAM=y
CONFIG_SPIRAM_BOOT_INIT=y
# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set
CONFIG_SPIRAM_USE_MEMMAP=y
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
# CONFIG_SPIRAM_USE_MALLOC is not set
CONFIG_SPIRAM_MEMTEST=y
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
# end of SPI RAM config

View File

@ -0,0 +1,33 @@
CONFIG_ESP32S2_SPIRAM_SUPPORT=y
#
# SPI RAM config
#
# CONFIG_SPIRAM_TYPE_AUTO is not set
CONFIG_SPIRAM_TYPE_ESPPSRAM16=y
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set
CONFIG_SPIRAM_SIZE=2097152
#
# PSRAM clock and cs IO for ESP32S2
#
CONFIG_DEFAULT_PSRAM_CLK_IO=30
CONFIG_DEFAULT_PSRAM_CS_IO=26
# end of PSRAM clock and cs IO for ESP32S2
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
# CONFIG_SPIRAM_RODATA is not set
# CONFIG_SPIRAM_SPEED_80M is not set
CONFIG_SPIRAM_SPEED_40M=y
# CONFIG_SPIRAM_SPEED_26M is not set
# CONFIG_SPIRAM_SPEED_20M is not set
CONFIG_SPIRAM=y
CONFIG_SPIRAM_BOOT_INIT=y
# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set
CONFIG_SPIRAM_USE_MEMMAP=y
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
# CONFIG_SPIRAM_USE_MALLOC is not set
CONFIG_SPIRAM_MEMTEST=y
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
# end of SPI RAM config

View File

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

View File

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

View File

@ -0,0 +1,15 @@
USB_VID = 0x239A
USB_PID = 0x80C6
USB_PRODUCT = "microS2"
USB_MANUFACTURER = "microDev"
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
# The default queue depth of 16 overflows on release builds,
# so increase it to 32.
CFLAGS += -DCFG_TUD_TASK_QUEUE_SZ=32
CIRCUITPY_ESP_FLASH_MODE=qio
CIRCUITPY_ESP_FLASH_FREQ=40m
CIRCUITPY_ESP_FLASH_SIZE=16MB

View File

@ -0,0 +1,49 @@
#include "shared-bindings/board/__init__.h"
STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_IO20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_IO26), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) },
{ MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },
{ MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) },
{ MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38) },
{ MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39) },
{ MP_ROM_QSTR(MP_QSTR_IO40), MP_ROM_PTR(&pin_GPIO40) },
{ MP_ROM_QSTR(MP_QSTR_IO41), MP_ROM_PTR(&pin_GPIO41) },
{ MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) },
{ MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43) },
{ MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44) },
{ MP_ROM_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) },
{ MP_ROM_QSTR(MP_QSTR_IO46), MP_ROM_PTR(&pin_GPIO46) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) },
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO33) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View File

@ -0,0 +1,35 @@
CONFIG_ESP32S2_SPIRAM_SUPPORT=y
#
# SPI RAM config
#
# CONFIG_SPIRAM_TYPE_AUTO is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
CONFIG_SPIRAM_TYPE_ESPPSRAM64=y
CONFIG_SPIRAM_SIZE=8388608
#
# PSRAM clock and cs IO for ESP32S2
#
CONFIG_DEFAULT_PSRAM_CLK_IO=30
CONFIG_DEFAULT_PSRAM_CS_IO=26
# end of PSRAM clock and cs IO for ESP32S2
CONFIG_SPIRAM_SPIWP_SD3_PIN=28
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
# CONFIG_SPIRAM_RODATA is not set
# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set
# CONFIG_SPIRAM_SPEED_80M is not set
CONFIG_SPIRAM_SPEED_40M=y
# CONFIG_SPIRAM_SPEED_26M is not set
# CONFIG_SPIRAM_SPEED_20M is not set
CONFIG_SPIRAM=y
CONFIG_SPIRAM_BOOT_INIT=y
# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set
CONFIG_SPIRAM_USE_MEMMAP=y
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
# CONFIG_SPIRAM_USE_MALLOC is not set
CONFIG_SPIRAM_MEMTEST=y
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
# end of SPI RAM config

View File

@ -0,0 +1,35 @@
CONFIG_ESP32S2_SPIRAM_SUPPORT=y
#
# SPI RAM config
#
# CONFIG_SPIRAM_TYPE_AUTO is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set
# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set
CONFIG_SPIRAM_TYPE_ESPPSRAM64=y
CONFIG_SPIRAM_SIZE=8388608
#
# PSRAM clock and cs IO for ESP32S2
#
CONFIG_DEFAULT_PSRAM_CLK_IO=30
CONFIG_DEFAULT_PSRAM_CS_IO=26
# end of PSRAM clock and cs IO for ESP32S2
CONFIG_SPIRAM_SPIWP_SD3_PIN=28
# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set
# CONFIG_SPIRAM_RODATA is not set
# CONFIG_SPIRAM_USE_AHB_DBUS3 is not set
# CONFIG_SPIRAM_SPEED_80M is not set
CONFIG_SPIRAM_SPEED_40M=y
# CONFIG_SPIRAM_SPEED_26M is not set
# CONFIG_SPIRAM_SPEED_20M is not set
CONFIG_SPIRAM=y
CONFIG_SPIRAM_BOOT_INIT=y
# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set
CONFIG_SPIRAM_USE_MEMMAP=y
# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set
# CONFIG_SPIRAM_USE_MALLOC is not set
CONFIG_SPIRAM_MEMTEST=y
# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set
# end of SPI RAM config

View File

@ -30,6 +30,8 @@
#include "py/objtuple.h"
#include "py/qstr.h"
#include "esp_system.h"
STATIC const qstr os_uname_info_fields[] = {
MP_QSTR_sysname, MP_QSTR_nodename,
MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine
@ -57,5 +59,15 @@ mp_obj_t common_hal_os_uname(void) {
}
bool common_hal_os_urandom(uint8_t* buffer, uint32_t length) {
return false;
uint32_t i = 0;
while (i < length) {
uint32_t new_random = esp_random();
for (int j = 0; j < 4 && i < length; j++) {
buffer[i] = new_random & 0xff;
i++;
new_random >>= 8;
}
}
return true;
}

View File

@ -26,19 +26,18 @@
#include "common-hal/pulseio/PulseOut.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "py/runtime.h"
// Requires rmt.c void esp32s2_peripherals_reset_all(void) to reset
void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
const pulseio_pwmout_obj_t* carrier,
const pwmio_pwmout_obj_t* carrier,
const mcu_pin_obj_t* pin,
uint32_t frequency,
uint16_t duty_cycle) {
if (carrier || !pin || !frequency) {
mp_raise_NotImplementedError(translate("Port does not accept PWM carrier. \
Pass a pin, frequency and duty cycle instead"));
mp_raise_NotImplementedError(translate("Port does not accept PWM carrier. Pass a pin, frequency and duty cycle instead"));
}
rmt_channel_t channel = esp32s2_peripherals_find_and_reserve_rmt();

View File

@ -28,7 +28,6 @@
#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PULSEOUT_H
#include "common-hal/microcontroller/Pin.h"
#include "common-hal/pulseio/PWMOut.h"
#include "driver/rmt.h"
#include "rmt.h"

View File

@ -25,8 +25,8 @@
*/
#include <math.h>
#include "common-hal/pulseio/PWMOut.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "py/runtime.h"
#include "driver/ledc.h"
@ -58,7 +58,7 @@ void pwmout_reset(void) {
not_first_reset = true;
}
pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
const mcu_pin_obj_t* pin,
uint16_t duty,
uint32_t frequency,
@ -140,27 +140,27 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
claim_pin(pin);
// Set initial duty
common_hal_pulseio_pwmout_set_duty_cycle(self, duty);
common_hal_pwmio_pwmout_set_duty_cycle(self, duty);
return PWMOUT_OK;
}
void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) {
never_reset_tim[self->tim_handle.timer_num] = true;
never_reset_chan[self->chan_handle.channel] = true;
}
void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) {
never_reset_tim[self->tim_handle.timer_num] = false;
never_reset_chan[self->chan_handle.channel] = false;
}
bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) {
bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self) {
return self->deinited == true;
}
void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
if (common_hal_pulseio_pwmout_deinited(self)) {
void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) {
if (common_hal_pwmio_pwmout_deinited(self)) {
return;
}
@ -186,23 +186,23 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
self->deinited = true;
}
void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) {
void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) {
ledc_set_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel, duty >> (16 - self->duty_resolution));
ledc_update_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel);
}
uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) {
uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) {
return ledc_get_duty(LEDC_LOW_SPEED_MODE, self->chan_handle.channel) << (16 - self->duty_resolution);
}
void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) {
void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency) {
ledc_set_freq(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num, frequency);
}
uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {
uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self) {
return ledc_get_freq(LEDC_LOW_SPEED_MODE, self->tim_handle.timer_num);
}
bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) {
bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self) {
return self->variable_frequency;
}

View File

@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H
#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H
#ifndef MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H
#define MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H
#include "common-hal/microcontroller/Pin.h"
#include "driver/ledc.h"
@ -38,8 +38,8 @@ typedef struct {
uint8_t duty_resolution;
bool variable_frequency: 1;
bool deinited: 1;
} pulseio_pwmout_obj_t;
} pwmio_pwmout_obj_t;
void pwmout_reset(void);
#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PULSEIO_PWMOUT_H
#endif // MICROPY_INCLUDED_ESP32S2_COMMON_HAL_PWMIO_PWMOUT_H

View File

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

View File

@ -25,8 +25,9 @@ CIRCUITPY_COUNTIO = 0
# These modules are implemented in shared-module/ - they can be included in
# any port once their prerequisites in common-hal are complete.
CIRCUITPY_RANDOM = 0 # Requires OS
CIRCUITPY_USB_MIDI = 0 # Requires USB
CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash
# Requires USB
CIRCUITPY_USB_MIDI = 0
# Too large for the partition table!
CIRCUITPY_ULAB = 0
CIRCUITPY_MODULE ?= none

View File

@ -38,12 +38,19 @@
#include "common-hal/busio/I2C.h"
#include "common-hal/busio/SPI.h"
#include "common-hal/busio/UART.h"
#include "common-hal/pulseio/PWMOut.h"
#include "common-hal/pulseio/PulseIn.h"
#include "common-hal/pwmio/PWMOut.h"
#include "supervisor/memory.h"
#include "supervisor/shared/tick.h"
#include "rmt.h"
#include "peripherals/rmt.h"
#include "esp-idf/components/heap/include/esp_heap_caps.h"
#include "esp-idf/components/soc/soc/esp32s2/include/soc/cache_memory.h"
#define HEAP_SIZE (48 * 1024)
uint32_t* heap;
uint32_t heap_size;
STATIC esp_timer_handle_t _tick_timer;
@ -59,6 +66,16 @@ safe_mode_t port_init(void) {
args.name = "CircuitPython Tick";
esp_timer_create(&args, &_tick_timer);
never_reset_module_internal_pins();
#ifdef CONFIG_SPIRAM
heap = (uint32_t*) (DRAM0_CACHE_ADDRESS_HIGH - CONFIG_SPIRAM_SIZE);
heap_size = CONFIG_SPIRAM_SIZE / sizeof(uint32_t);
#endif
if (heap == NULL) {
heap = malloc(HEAP_SIZE);
heap_size = HEAP_SIZE / sizeof(uint32_t);
}
return NO_SAFE_MODE;
}
@ -70,9 +87,13 @@ void reset_port(void) {
#if CIRCUITPY_PULSEIO
esp32s2_peripherals_rmt_reset();
pwmout_reset();
pulsein_reset();
#endif
#if CIRCUITPY_PWMIO
pwmout_reset();
#endif
#if CIRCUITPY_BUSIO
i2c_reset();
spi_reset();
@ -86,14 +107,12 @@ void reset_to_bootloader(void) {
void reset_cpu(void) {
}
uint32_t heap[64 / sizeof(uint32_t) * 1024];
uint32_t *port_heap_get_bottom(void) {
return heap;
}
uint32_t *port_heap_get_top(void) {
return heap + sizeof(heap) / sizeof(heap[0]);
return heap + heap_size;
}
uint32_t *port_stack_get_limit(void) {

View File

@ -94,7 +94,7 @@ void pulseout_reset() {
}
void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
const pulseio_pwmout_obj_t* carrier,
const pwmio_pwmout_obj_t* carrier,
const mcu_pin_obj_t* pin,
uint32_t frequency,
uint16_t duty_cycle) {

View File

@ -29,8 +29,8 @@
#include <stdint.h>
#include "py/runtime.h"
#include "common-hal/pulseio/PWMOut.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "shared-bindings/microcontroller/Processor.h"
#include "fsl_pwm.h"
@ -64,7 +64,7 @@
//
//static uint8_t never_reset_tc_or_tcc[TC_INST_NUM + TCC_INST_NUM];
void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) {
// if (self->timer->is_tc) {
// never_reset_tc_or_tcc[self->timer->index] += 1;
// } else {
@ -74,7 +74,7 @@ void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
// never_reset_pin_number(self->pin->number);
}
void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) {
// if (self->timer->is_tc) {
// never_reset_tc_or_tcc[self->timer->index] -= 1;
// } else {
@ -133,7 +133,7 @@ void pwmout_reset(void) {
#define PWM_SRC_CLK_FREQ CLOCK_GetFreq(kCLOCK_IpgClk)
pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self,
pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t *self,
const mcu_pin_obj_t *pin,
uint16_t duty,
uint32_t frequency,
@ -359,17 +359,17 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t *self,
//
// gpio_set_pin_function(pin->number, GPIO_PIN_FUNCTION_E + mux_position);
common_hal_pulseio_pwmout_set_duty_cycle(self, duty);
common_hal_pwmio_pwmout_set_duty_cycle(self, duty);
return PWMOUT_OK;
}
bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) {
bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self) {
return self->pin == NULL;
}
void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
if (common_hal_pulseio_pwmout_deinited(self)) {
void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) {
if (common_hal_pwmio_pwmout_deinited(self)) {
return;
}
@ -396,7 +396,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
self->pin = NULL;
}
void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t *self, uint16_t duty) {
void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t *self, uint16_t duty) {
PWM_UpdatePwmDutycycle(PWM1, self->pwm->submodule, self->pwm->channel, kPWM_SignedCenterAligned, duty);
// const pin_timer_t* t = self->timer;
@ -433,7 +433,7 @@ void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t *self, uint16
// }
}
uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) {
uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) {
return 0;
// const pin_timer_t* t = self->timer;
// if (t->is_tc) {
@ -471,7 +471,7 @@ uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) {
// }
}
void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self,
void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self,
uint32_t frequency) {
// if (frequency == 0 || frequency > 6000000) {
// mp_raise_ValueError(translate("Invalid PWM frequency"));
@ -492,7 +492,7 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self,
// break;
// }
// }
// uint16_t old_duty = common_hal_pulseio_pwmout_get_duty_cycle(self);
// uint16_t old_duty = common_hal_pwmio_pwmout_get_duty_cycle(self);
// if (t->is_tc) {
// Tc* tc = tc_insts[t->index];
// uint8_t old_divisor = tc->COUNT16.CTRLA.bit.PRESCALER;
@ -527,10 +527,10 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self,
// #endif
// }
// common_hal_pulseio_pwmout_set_duty_cycle(self, old_duty);
// common_hal_pwmio_pwmout_set_duty_cycle(self, old_duty);
}
uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {
uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self) {
// uint32_t system_clock = common_hal_mcu_processor_get_frequency();
// const pin_timer_t* t = self->timer;
// uint8_t divisor;
@ -546,6 +546,6 @@ uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {
return 0;
}
bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) {
bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self) {
return self->variable_frequency;
}

View File

@ -25,8 +25,8 @@
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PWMOUT_H
#define MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PWMOUT_H
#ifndef MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PWMIO_PWMOUT_H
#define MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PWMIO_PWMOUT_H
#include "common-hal/microcontroller/Pin.h"
#include "periph.h"
@ -37,8 +37,8 @@ typedef struct {
const mcu_pin_obj_t *pin;
const mcu_pwm_obj_t *pwm;
bool variable_frequency;
} pulseio_pwmout_obj_t;
} pwmio_pwmout_obj_t;
void pwmout_reset(void);
#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PULSEIO_PWMOUT_H
#endif // MICROPY_INCLUDED_MIMXRT10XX_COMMON_HAL_PWMIO_PWMOUT_H

View File

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

View File

@ -39,8 +39,8 @@ static inline mp_uint_t mp_hal_ticks_ms(void) {
return supervisor_ticks_ms32();
}
// Number of bytes in receive buffer
volatile uint8_t usb_rx_count;
volatile bool mp_cdc_enabled;
extern volatile uint8_t usb_rx_count;
extern volatile bool mp_cdc_enabled;
int receive_usb(void);

View File

@ -27,18 +27,18 @@
#ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
#define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
LPI2C_Type *mcu_i2c_banks[2];
extern LPI2C_Type *mcu_i2c_banks[2];
extern const mcu_periph_obj_t mcu_i2c_sda_list[8];
extern const mcu_periph_obj_t mcu_i2c_scl_list[8];
LPSPI_Type *mcu_spi_banks[2];
extern LPSPI_Type *mcu_spi_banks[2];
extern const mcu_periph_obj_t mcu_spi_sck_list[4];
extern const mcu_periph_obj_t mcu_spi_mosi_list[4];
extern const mcu_periph_obj_t mcu_spi_miso_list[4];
LPUART_Type *mcu_uart_banks[4];
extern LPUART_Type *mcu_uart_banks[4];
extern const mcu_periph_obj_t mcu_uart_rx_list[9];
extern const mcu_periph_obj_t mcu_uart_tx_list[9];

View File

@ -28,18 +28,18 @@
#ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H
#define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1021_PERIPH_H
LPI2C_Type *mcu_i2c_banks[4];
extern LPI2C_Type *mcu_i2c_banks[4];
extern const mcu_periph_obj_t mcu_i2c_sda_list[8];
extern const mcu_periph_obj_t mcu_i2c_scl_list[8];
LPSPI_Type *mcu_spi_banks[4];
extern LPSPI_Type *mcu_spi_banks[4];
extern const mcu_periph_obj_t mcu_spi_sck_list[8];
extern const mcu_periph_obj_t mcu_spi_mosi_list[8];
extern const mcu_periph_obj_t mcu_spi_miso_list[8];
LPUART_Type *mcu_uart_banks[8];
extern LPUART_Type *mcu_uart_banks[8];
extern const mcu_periph_obj_t mcu_uart_rx_list[16];
extern const mcu_periph_obj_t mcu_uart_tx_list[16];

View File

@ -27,18 +27,18 @@
#ifndef MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
#define MICROPY_INCLUDED_MIMXRT10XX_PERIPHERALS_MIMXRT1011_PERIPH_H
LPI2C_Type *mcu_i2c_banks[4];
extern LPI2C_Type *mcu_i2c_banks[4];
extern const mcu_periph_obj_t mcu_i2c_sda_list[9];
extern const mcu_periph_obj_t mcu_i2c_scl_list[9];
LPSPI_Type *mcu_spi_banks[4];
extern LPSPI_Type *mcu_spi_banks[4];
extern const mcu_periph_obj_t mcu_spi_sck_list[8];
extern const mcu_periph_obj_t mcu_spi_mosi_list[8];
extern const mcu_periph_obj_t mcu_spi_miso_list[8];
LPUART_Type *mcu_uart_banks[8];
extern LPUART_Type *mcu_uart_banks[8];
extern const mcu_periph_obj_t mcu_uart_rx_list[18];
extern const mcu_periph_obj_t mcu_uart_tx_list[18];

View File

@ -39,7 +39,7 @@
#include "common-hal/microcontroller/Pin.h"
#include "common-hal/pulseio/PulseIn.h"
#include "common-hal/pulseio/PulseOut.h"
#include "common-hal/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "common-hal/rtc/RTC.h"
#include "common-hal/busio/SPI.h"
@ -289,6 +289,8 @@ void reset_port(void) {
#if CIRCUITPY_PULSEIO
pulseout_reset();
#endif
#if CIRCUITPY_PWMIO
pwmout_reset();
#endif

View File

@ -88,6 +88,8 @@ void check_sec_status(uint8_t sec_status) {
}
}
bool vm_used_ble;
// Turn off BLE on a reset or reload.
void bleio_reset() {
if (!common_hal_bleio_adapter_get_enabled(&common_hal_bleio_adapter_obj)) {

View File

@ -46,6 +46,6 @@ void check_gatt_status(uint16_t gatt_status);
void check_sec_status(uint8_t sec_status);
// Track if the user code modified the BLE state to know if we need to undo it on reload.
bool vm_used_ble;
extern bool vm_used_ble;
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_BLEIO_INIT_H

View File

@ -32,7 +32,7 @@
#include "py/mperrno.h"
#include "py/runtime.h"
#include "common-hal/audiopwmio/PWMAudioOut.h"
#include "common-hal/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "shared-bindings/audiopwmio/PWMAudioOut.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Pin.h"

View File

@ -34,7 +34,7 @@
#include "py/gc.h"
#include "py/runtime.h"
#include "shared-bindings/pulseio/PulseOut.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "supervisor/shared/translate.h"
// A single timer is shared amongst all PulseOut objects under the assumption that
@ -100,13 +100,12 @@ void pulseout_reset() {
}
void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
const pulseio_pwmout_obj_t* carrier,
const pwmio_pwmout_obj_t* carrier,
const mcu_pin_obj_t* pin,
uint32_t frequency,
uint16_t duty_cycle) {
if (!carrier || pin || frequency) {
mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \
Construct and pass a PWMOut Carrier instead"));
mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead"));
}
if (refcount == 0) {

View File

@ -28,13 +28,13 @@
#define MICROPY_INCLUDED_NRF_COMMON_HAL_PULSEIO_PULSEOUT_H
#include "common-hal/microcontroller/Pin.h"
#include "common-hal/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "py/obj.h"
typedef struct {
mp_obj_base_t base;
const pulseio_pwmout_obj_t *pwmout;
const pwmio_pwmout_obj_t *pwmout;
} pulseio_pulseout_obj_t;
void pulseout_reset(void);

View File

@ -28,8 +28,8 @@
#include "nrf.h"
#include "py/runtime.h"
#include "common-hal/pulseio/PWMOut.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "supervisor/shared/translate.h"
#include "nrf_gpio.h"
@ -63,7 +63,7 @@ STATIC int pwm_idx(NRF_PWM_Type *pwm) {
return -1;
}
void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) {
for(size_t i=0; i < MP_ARRAY_SIZE(pwms); i++) {
NRF_PWM_Type* pwm = pwms[i];
if (pwm == self->pwm) {
@ -74,7 +74,7 @@ void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
never_reset_pin_number(self->pin_number);
}
void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) {
for(size_t i=0; i < MP_ARRAY_SIZE(pwms); i++) {
NRF_PWM_Type* pwm = pwms[i];
if (pwm == self->pwm) {
@ -204,7 +204,7 @@ void pwmout_free_channel(NRF_PWM_Type *pwm, int8_t channel) {
nrf_pwm_disable(pwm);
}
pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
const mcu_pin_obj_t* pin,
uint16_t duty,
uint32_t frequency,
@ -251,16 +251,16 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
nrf_pwm_enable(self->pwm);
common_hal_pulseio_pwmout_set_duty_cycle(self, duty);
common_hal_pwmio_pwmout_set_duty_cycle(self, duty);
return PWMOUT_OK;
}
bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) {
bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self) {
return self->pwm == NULL;
}
void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
if (common_hal_pulseio_pwmout_deinited(self)) {
void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) {
if (common_hal_pwmio_pwmout_deinited(self)) {
return;
}
@ -275,7 +275,7 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
self->pin_number = NO_PIN;
}
void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty_cycle) {
void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty_cycle) {
self->duty_cycle = duty_cycle;
uint16_t* p_value = ((uint16_t*)self->pwm->SEQ[0].PTR) + self->channel;
@ -284,11 +284,11 @@ void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16
self->pwm->TASKS_SEQSTART[0] = 1;
}
uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) {
uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) {
return self->duty_cycle;
}
void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) {
void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency) {
// COUNTERTOP is 3..32767, so highest available frequency is PWM_MAX_FREQ / 3.
uint16_t countertop;
nrf_pwm_clk_t base_clock;
@ -300,13 +300,13 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_
nrf_pwm_configure(self->pwm, base_clock, NRF_PWM_MODE_UP, countertop);
// Set the duty cycle again, because it depends on COUNTERTOP, which probably changed.
// Setting the duty cycle will also do a SEQSTART.
common_hal_pulseio_pwmout_set_duty_cycle(self, self->duty_cycle);
common_hal_pwmio_pwmout_set_duty_cycle(self, self->duty_cycle);
}
uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {
uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self) {
return self->frequency;
}
bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) {
bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self) {
return self->variable_frequency;
}

View File

@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_PULSEIO_PWMOUT_H
#define MICROPY_INCLUDED_NRF_COMMON_HAL_PULSEIO_PWMOUT_H
#ifndef MICROPY_INCLUDED_NRF_COMMON_HAL_PWMIO_PWMOUT_H
#define MICROPY_INCLUDED_NRF_COMMON_HAL_PWMIO_PWMOUT_H
#include "nrfx_pwm.h"
#include "py/obj.h"
@ -38,7 +38,7 @@ typedef struct {
bool variable_frequency: 1;
uint16_t duty_cycle;
uint32_t frequency;
} pulseio_pwmout_obj_t;
} pwmio_pwmout_obj_t;
void pwmout_reset(void);
NRF_PWM_Type *pwmout_allocate(uint16_t countertop, nrf_pwm_clk_t base_clock,
@ -46,4 +46,4 @@ NRF_PWM_Type *pwmout_allocate(uint16_t countertop, nrf_pwm_clk_t base_clock,
IRQn_Type *irq);
void pwmout_free_channel(NRF_PWM_Type *pwm, int8_t channel);
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_PULSEIO_PWMOUT_H
#endif // MICROPY_INCLUDED_NRF_COMMON_HAL_PWMIO_PWMOUT_H

View File

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

View File

@ -45,9 +45,9 @@
#include "common-hal/busio/I2C.h"
#include "common-hal/busio/SPI.h"
#include "common-hal/busio/UART.h"
#include "common-hal/pulseio/PWMOut.h"
#include "common-hal/pulseio/PulseOut.h"
#include "common-hal/pulseio/PulseIn.h"
#include "common-hal/pwmio/PWMOut.h"
#include "common-hal/rtc/RTC.h"
#include "common-hal/neopixel_write/__init__.h"
#include "common-hal/watchdog/WatchDogTimer.h"
@ -196,11 +196,14 @@ void reset_port(void) {
#if CIRCUITPY_PULSEIO
pwmout_reset();
pulseout_reset();
pulsein_reset();
#endif
#if CIRCUITPY_PWMIO
pwmout_reset();
#endif
#if CIRCUITPY_RTC
rtc_reset();
#endif

View File

@ -10,7 +10,8 @@ MCU_VARIANT = STM32F401xE
MCU_PACKAGE = UFQFPN48
LD_COMMON = boards/common_default.ld
LD_FILE = boards/STM32F401xd_fs.ld # use for internal flash
# use for internal flash
LD_FILE = boards/STM32F401xd_fs.ld
# Disable ulab as we're nearly out of space on this board due to
# INTERNAL_FLASH_FILESYSTEM. It can probably be reenabled if we enable

View File

@ -13,5 +13,6 @@ MCU_PACKAGE = LQFP64
LD_COMMON = boards/common_default.ld
LD_DEFAULT = boards/STM32F405_default.ld
LD_BOOT = boards/STM32F405_boot.ld # UF2 boot option
# UF2 boot option
LD_BOOT = boards/STM32F405_boot.ld
UF2_OFFSET = 0x8010000

View File

@ -106,7 +106,7 @@ void board_init(void) {
&pin_PB03,
NO_BRIGHTNESS_COMMAND,
1.0f, // brightness (ignored)
true, // auto_brightness
false, // auto_brightness
false, // single_byte_bounds
false, // data_as_commands
true, // auto_refresh

View File

@ -36,8 +36,7 @@
#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000)
#define HSE_VALUE ((uint32_t)12000000U)
#define LSE_VALUE ((uint32_t)32000U)
#define BOARD_HAS_LOW_SPEED_CRYSTAL (1)
#define BOARD_HAS_LOW_SPEED_CRYSTAL (0)
#define BOARD_NO_VBUS_SENSE (1)
#define BOARD_VTOR_DEFER (1) //Leave VTOR relocation to bootloader

View File

@ -18,4 +18,5 @@ OPTIMIZATION_FLAGS = -Os
LD_COMMON = boards/common_default.ld
LD_FILE = boards/STM32F401xe_boot.ld
# LD_FILE = boards/STM32F401xe_fs.ld # use for internal flash
# For debugging - also comment BOOTLOADER_OFFSET and BOARD_VTOR_DEFER
# LD_FILE = boards/STM32F401xe_fs.ld

View File

@ -72,16 +72,20 @@ bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) {
if (HAL_RNG_Init(&handle) != HAL_OK) mp_raise_ValueError(translate("RNG Init Error"));
//Assign bytes
for (uint i = 0; i < length; i++) {
uint32_t temp;
uint32_t i = 0;
while (i < length) {
uint32_t new_random;
uint32_t start = HAL_GetTick();
//the HAL function has a timeout, but it isn't long enough, and isn't adjustable
while(!(__HAL_RNG_GET_FLAG(&handle,RNG_FLAG_DRDY)) && ((HAL_GetTick() - start) < RNG_TIMEOUT));
//
if (HAL_RNG_GenerateRandomNumber(&handle, &temp) != HAL_OK) {
if (HAL_RNG_GenerateRandomNumber(&handle, &new_random) != HAL_OK) {
mp_raise_ValueError(translate("Random number generation error"));
}
*buffer = (uint8_t)temp;
for (int j = 0; j < 4 && i < length; j++) {
buffer[i] = new_random & 0xff;
i++;
new_random >>= 8;
}
}
//shut down the peripheral

View File

@ -32,7 +32,7 @@
#include "py/gc.h"
#include "py/runtime.h"
#include "shared-bindings/pulseio/PulseOut.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "supervisor/shared/translate.h"
#include STM32_HAL_H
@ -113,13 +113,12 @@ void pulseout_reset() {
}
void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
const pulseio_pwmout_obj_t* carrier,
const pwmio_pwmout_obj_t* carrier,
const mcu_pin_obj_t* pin,
uint32_t frequency,
uint16_t duty_cycle) {
if (!carrier || pin || frequency) {
mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \
Construct and pass a PWMOut Carrier instead"));
mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. Construct and pass a PWMOut Carrier instead"));
}
// Add to active PulseOuts
@ -143,7 +142,7 @@ void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
tim_handle.Instance->SR = 0;
// The HAL can't work with const, recast required.
self->pwmout = (pulseio_pwmout_obj_t*)carrier;
self->pwmout = (pwmio_pwmout_obj_t*)carrier;
turn_off(self);
}

View File

@ -28,13 +28,13 @@
#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PULSEOUT_H
#include "common-hal/microcontroller/Pin.h"
#include "common-hal/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "py/obj.h"
typedef struct {
mp_obj_base_t base;
pulseio_pwmout_obj_t *pwmout;
pwmio_pwmout_obj_t *pwmout;
} pulseio_pulseout_obj_t;
void pulseout_reset(void);

View File

@ -27,8 +27,8 @@
#include <stdint.h>
#include "py/runtime.h"
#include "common-hal/pulseio/PWMOut.h"
#include "shared-bindings/pulseio/PWMOut.h"
#include "common-hal/pwmio/PWMOut.h"
#include "shared-bindings/pwmio/PWMOut.h"
#include "supervisor/shared/translate.h"
#include "shared-bindings/microcontroller/__init__.h"
@ -75,7 +75,7 @@ void pwmout_reset(void) {
}
}
pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
pwmout_result_t common_hal_pwmio_pwmout_construct(pwmio_pwmout_obj_t* self,
const mcu_pin_obj_t* pin,
uint16_t duty,
uint32_t frequency,
@ -96,7 +96,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
//if pin is same
if (l_tim->pin == pin) {
//check if the timer has a channel active, or is reserved by main timer system
if (reserved_tim[l_tim_index] != 0) {
if (l_tim_index < TIM_BANK_ARRAY_LEN && reserved_tim[l_tim_index] != 0) {
// Timer has already been reserved by an internal module
if (stm_peripherals_timer_is_reserved(mcu_tim_banks[l_tim_index])) {
tim_taken_internal = true;
@ -204,7 +204,7 @@ pwmout_result_t common_hal_pulseio_pwmout_construct(pulseio_pwmout_obj_t* self,
return PWMOUT_OK;
}
void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_never_reset(pwmio_pwmout_obj_t *self) {
for (size_t i = 0; i < TIM_BANK_ARRAY_LEN; i++) {
if (mcu_tim_banks[i] == self->handle.Instance) {
never_reset_tim[i] = true;
@ -214,7 +214,7 @@ void common_hal_pulseio_pwmout_never_reset(pulseio_pwmout_obj_t *self) {
}
}
void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) {
void common_hal_pwmio_pwmout_reset_ok(pwmio_pwmout_obj_t *self) {
for(size_t i = 0; i < TIM_BANK_ARRAY_LEN; i++) {
if (mcu_tim_banks[i] == self->handle.Instance) {
never_reset_tim[i] = false;
@ -223,12 +223,12 @@ void common_hal_pulseio_pwmout_reset_ok(pulseio_pwmout_obj_t *self) {
}
}
bool common_hal_pulseio_pwmout_deinited(pulseio_pwmout_obj_t* self) {
bool common_hal_pwmio_pwmout_deinited(pwmio_pwmout_obj_t* self) {
return self->tim == NULL;
}
void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
if (common_hal_pulseio_pwmout_deinited(self)) {
void common_hal_pwmio_pwmout_deinit(pwmio_pwmout_obj_t* self) {
if (common_hal_pwmio_pwmout_deinited(self)) {
return;
}
//var freq shuts down entire timer, others just their channel
@ -239,26 +239,27 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
HAL_TIM_PWM_Stop(&self->handle, self->channel);
}
reset_pin_number(self->tim->pin->port,self->tim->pin->number);
self->tim = NULL;
//if reserved timer has no active channels, we can disable it
if (!reserved_tim[self->tim->tim_index - 1]) {
tim_frequencies[self->tim->tim_index - 1] = 0x00;
stm_peripherals_timer_free(self->handle.Instance);
}
self->tim = NULL;
}
void common_hal_pulseio_pwmout_set_duty_cycle(pulseio_pwmout_obj_t* self, uint16_t duty) {
void common_hal_pwmio_pwmout_set_duty_cycle(pwmio_pwmout_obj_t* self, uint16_t duty) {
uint32_t internal_duty_cycle = timer_get_internal_duty(duty, self->period);
__HAL_TIM_SET_COMPARE(&self->handle, self->channel, internal_duty_cycle);
self->duty_cycle = duty;
}
uint16_t common_hal_pulseio_pwmout_get_duty_cycle(pulseio_pwmout_obj_t* self) {
uint16_t common_hal_pwmio_pwmout_get_duty_cycle(pwmio_pwmout_obj_t* self) {
return self->duty_cycle;
}
void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_t frequency) {
void common_hal_pwmio_pwmout_set_frequency(pwmio_pwmout_obj_t* self, uint32_t frequency) {
//don't halt setup for the same frequency
if (frequency == self->frequency) {
return;
@ -295,10 +296,10 @@ void common_hal_pulseio_pwmout_set_frequency(pulseio_pwmout_obj_t* self, uint32_
self->period = period;
}
uint32_t common_hal_pulseio_pwmout_get_frequency(pulseio_pwmout_obj_t* self) {
uint32_t common_hal_pwmio_pwmout_get_frequency(pwmio_pwmout_obj_t* self) {
return self->frequency;
}
bool common_hal_pulseio_pwmout_get_variable_frequency(pulseio_pwmout_obj_t* self) {
bool common_hal_pwmio_pwmout_get_variable_frequency(pwmio_pwmout_obj_t* self) {
return self->variable_frequency;
}

View File

@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H
#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H
#ifndef MICROPY_INCLUDED_STM32F4_COMMON_HAL_PWMIO_PWMOUT_H
#define MICROPY_INCLUDED_STM32F4_COMMON_HAL_PWMIO_PWMOUT_H
#include "common-hal/microcontroller/Pin.h"
@ -44,8 +44,8 @@ typedef struct {
uint16_t duty_cycle;
uint32_t frequency;
uint32_t period;
} pulseio_pwmout_obj_t;
} pwmio_pwmout_obj_t;
void pwmout_reset(void);
#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_PULSEIO_PWMOUT_H
#endif // MICROPY_INCLUDED_STM32F4_COMMON_HAL_PWMIO_PWMOUT_H

View File

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

View File

@ -7,6 +7,7 @@ ifeq ($(MCU_VARIANT),STM32F405xx)
CIRCUITPY_FRAMEBUFFERIO ?= 1
CIRCUITPY_RGBMATRIX ?= 1
CIRCUITPY_SDIOIO ?= 1
USB_NUM_EP = 4
endif
ifeq ($(MCU_SERIES),F4)

View File

@ -38,8 +38,8 @@ static inline mp_uint_t mp_hal_ticks_ms(void) {
return supervisor_ticks_ms32();
}
// Number of bytes in receive buffer
volatile uint8_t usb_rx_count;
volatile bool mp_cdc_enabled;
extern volatile uint8_t usb_rx_count;
extern volatile bool mp_cdc_enabled;
int receive_usb(void);

View File

@ -49,7 +49,6 @@ void stm32_peripherals_clocks_init(void) {
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
bool lse_failure = false;
// Set voltage scaling in accordance with system clock speed
__HAL_RCC_PWR_CLK_ENABLE();
@ -76,15 +75,9 @@ void stm32_peripherals_clocks_init(void) {
#endif
if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
// Failure likely means a LSE issue - attempt to swap to LSI, and set to crash
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI;
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
// No HSE means no USB, so just fail forever
while(1);
}
lse_failure = true;
// Clock issues are too problematic to even attempt recovery.
// If you end up here, check whether your LSE settings match your board.
while(1);
}
// Configure bus clock sources and divisors
@ -113,8 +106,4 @@ void stm32_peripherals_clocks_init(void) {
#endif
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
if (lse_failure) {
reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT?
}
}

View File

@ -51,7 +51,7 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[6];
//Timers
#define TIM_BANK_ARRAY_LEN 14
#define TIM_PIN_ARRAY_LEN 44
TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F401XE_PERIPH_H

View File

@ -58,8 +58,8 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[UART_RX_ARRAY_LEN];
//Timers
#define TIM_BANK_ARRAY_LEN 14
#define TIM_PIN_ARRAY_LEN 67
TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
//SDIO
extern SDIO_TypeDef * mcu_sdio_banks[1];

View File

@ -51,7 +51,7 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[12];
//Timers
#define TIM_BANK_ARRAY_LEN 14
#define TIM_PIN_ARRAY_LEN 56
TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F407XX_PERIPH_H

View File

@ -51,7 +51,7 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[7];
//Timers
#define TIM_BANK_ARRAY_LEN 14
#define TIM_PIN_ARRAY_LEN 44
TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F411XE_PERIPH_H

View File

@ -52,7 +52,7 @@ extern const mcu_periph_obj_t mcu_uart_rx_list[12];
//Timers
#define TIM_BANK_ARRAY_LEN 14
#define TIM_PIN_ARRAY_LEN 60
TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F412ZX_PERIPH_H

View File

@ -40,7 +40,6 @@ void stm32_peripherals_clocks_init(void) {
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
bool lse_failure = false;
// Configure LSE Drive
HAL_PWR_EnableBkUpAccess();
@ -68,15 +67,9 @@ void stm32_peripherals_clocks_init(void) {
RCC_OscInitStruct.PLL.PLLQ = CPY_CLK_PLLQ;
if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
// Failure likely means a LSE issue - attempt to swap to LSI, and set to crash
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
RCC_OscInitStruct.OscillatorType |= RCC_OSCILLATORTYPE_LSI;
RCC_OscInitStruct.LSIState = RCC_LSI_ON;
if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
// No HSE means no USB, so just fail forever
while(1);
}
lse_failure = true;
// Clock issues are too problematic to even attempt recovery.
// If you end up here, check whether your LSE settings match your board.
while(1);
}
/* Activate the OverDrive to reach the 216 MHz Frequency */
@ -111,8 +104,4 @@ void stm32_peripherals_clocks_init(void) {
#endif
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
if (lse_failure) {
reset_into_safe_mode(HARD_CRASH); //TODO: make safe mode category CLOCK_FAULT?
}
}

View File

@ -31,28 +31,28 @@
//I2C
extern I2C_TypeDef * mcu_i2c_banks[4];
const mcu_periph_obj_t mcu_i2c_sda_list[10];
const mcu_periph_obj_t mcu_i2c_scl_list[10];
extern const mcu_periph_obj_t mcu_i2c_sda_list[10];
extern const mcu_periph_obj_t mcu_i2c_scl_list[10];
//SPI
extern SPI_TypeDef * mcu_spi_banks[6];
const mcu_periph_obj_t mcu_spi_sck_list[14];
const mcu_periph_obj_t mcu_spi_mosi_list[15];
const mcu_periph_obj_t mcu_spi_miso_list[12];
extern const mcu_periph_obj_t mcu_spi_sck_list[14];
extern const mcu_periph_obj_t mcu_spi_mosi_list[15];
extern const mcu_periph_obj_t mcu_spi_miso_list[12];
//UART
extern USART_TypeDef * mcu_uart_banks[MAX_UART];
extern bool mcu_uart_has_usart[MAX_UART];
const mcu_periph_obj_t mcu_uart_tx_list[15];
const mcu_periph_obj_t mcu_uart_rx_list[15];
extern const mcu_periph_obj_t mcu_uart_tx_list[15];
extern const mcu_periph_obj_t mcu_uart_rx_list[15];
//Timers
#define TIM_BANK_ARRAY_LEN 14
#define TIM_PIN_ARRAY_LEN 55
extern TIM_TypeDef * mcu_tim_banks[TIM_BANK_ARRAY_LEN];
const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
extern const mcu_tim_pin_obj_t mcu_tim_pin_list[TIM_PIN_ARRAY_LEN];
#endif // MICROPY_INCLUDED_STM32_PERIPHERALS_STM32F746XX_PERIPH_H

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